This page has been translated automatically.
UnigineScript
The Language
Core Library
Engine Library
Node-Related Classes
GUI-Related Classes
Plugins Library
High-Level Systems
Samples
Usage Examples
C++ API
API Reference
Integration Samples
Usage Examples
C++ Plugins
Migration
Migrating to UNIGINE 2.0
C++ API Migration
Migrating from UNIGINE 2.0 to UNIGINE 2.1
Внимание! Эта версия документация УСТАРЕЛА, поскольку относится к более ранней версии SDK! Пожалуйста, переключитесь на самую актуальную документацию для последней версии SDK.
Внимание! Эта версия документации описывает устаревшую версию SDK, которая больше не поддерживается! Пожалуйста, обновитесь до последней версии SDK.

Unigine::PlayerSpectator Class

Interface for player spectator handling.

To use this class, include the UniginePlayerSpectator.h file.

Unigine::PlayerSpectator Class

Members


static int type ()

PlayerSpectator type.

Return value

PlayerSpectator type identifier.

static Ptr< PlayerSpectator > create (const NodePtr & node)

PlayerSpectator constructor.

Arguments

  • const NodePtr & node - Node smart pointer.

static Ptr< PlayerSpectator > create (const PlayerPtr & player)

PlayerSpectator constructor.

Arguments

  • const PlayerPtr & player - Player smart pointer.

static Ptr< PlayerSpectator > create ()

PlayerSpectator constructor.

virtual void setCollision (int collision) const =0

Updates a value indicating if collisions with spectator's sphere should be taken into account.

Arguments

  • int collision - 1 to enable collisions, 0 to let the spectator fly through objects.

virtual int getCollision () const =0

Returns a value indicating if collisions with spectator's sphere should be taken into account.

Return value

1 if collisions are taken into account; otherwise, 0.

virtual void setCollisionMask (int mask) const =0

Sets a collision mask for the spectators's collision sphere. Two objects collide, if they both have matching masks.

Arguments

  • int mask - An integer value, each bit of which is used to set a bit mask.

virtual int getCollisionMask () const =0

Returns a collision mask of the spectators's collision sphere. Two objects collide, if they both have matching masks.

Return value

An integer value, each bit of which is used to set a bit mask.

virtual void setCollisionRadius (float radius) const =0

Updates radius of the spectators's collision sphere.

Arguments

  • float radius - New radius of the collision sphere.

virtual float getCollisionRadius () const =0

Returns radius of the spectators's collision sphere.

Return value

Radius of the collision sphere in units.

virtual void setMinVelocity (float velocity) const =0

Sets the default velocity of the spectator.

Arguments

  • float velocity - New velocity in units per second. If a negative value is provided, 0 will be used instead.

virtual float getMinVelocity () const =0

Returns the default velocity of the spectator.

Return value

Velocity in units per second.

virtual void setMaxVelocity (float velocity) const =0

Sets the velocity of the actor, which is used while the actor runs (the Unigine::Controls::STATE_RUN control state is "pressed").

Arguments

  • float velocity - New velocity in units per second. If a negative value is provided, 0 will be used instead.

virtual float getMaxVelocity () const =0

Returns the velocity of the actor, which is used while the actor runs (the Unigine::Controls::STATE_RUN control state is "pressed").

Return value

Velocity in units per second.

virtual void setMinThetaAngle (float angle) const =0

Sets the minimum theta angle (zenith angle, also known as pitch angle) that determines how far upward the player can look.

Arguments

  • float angle - New angle in degrees in range [-90;0]. The lower the value, the further up the player can look.

virtual float getMinThetaAngle () const =0

Returns the minimum theta angle (zenith angle, also known as pitch angle) that determines how far upward the player can look. The lower the value, the further up the player can look.

Return value

Current minimum theta angle in degrees.

virtual void setMaxThetaAngle (float angle) const =0

Sets the maximum theta angle (zenith angle, also known as pitch angle) that determines how far downward the player can look.

Arguments

  • float angle - New angle in degrees in range [0;90]. The higher the value, the further down the player can look.

virtual float getMaxThetaAngle () const =0

Returns the maximum theta angle (zenith angle, also known as pitch angle) that determines how far downward the player can look. The higher the value, the further down the player can look.

Return value

Current maximum theta angle in degrees.

virtual void setAcceleration (float acceleration) const =0

Sets an acceleration of the spectator.

Arguments

  • float acceleration - New acceleration in units per second squared. If a negative value is provided, 0 will be used instead.

virtual float getAcceleration () const =0

Returns the current acceleration of the spectator.

Return value

Acceleration in units per second squared.

virtual void setDamping (float damping) const =0

Sets a spectator's damping.

Arguments

  • float damping - New damping value.

virtual float getDamping () const =0

Returns the spectator's damping.

Return value

Damping value.

virtual void setTurning (float turning) const =0

Sets a velocity of player turning.

Arguments

  • float turning - Turning velocity in degrees per second. If a negative value is provided, 0 will be used instead.

virtual float getTurning () const =0

Returns a velocity of player turning.

Return value

Turning velocity in degrees per second.

virtual void setPhiAngle (float angle) const =0

Sets the phi angle (azimuth angle, also known as yaw angle). This angle determines the horizontal viewing direction, i.e. left or right.

Arguments

  • float angle - New angle in degrees. Positive values rotate the player right; negative values rotate the player left.

virtual float getPhiAngle () const =0

Returns the phi angle (azimuth angle, also known as yaw angle). This angle determines the horizontal viewing direction, i.e. left or right. Positive values rotate the player right; negative values rotate it to the left.

Return value

Phi angle value.

virtual void setThetaAngle (float angle) const =0

Sets the theta angle of the player (zenith angle, also known as pitch angle). This angle determines the vertical viewing direction, i.e. upwards or downwards. The value will be clamped between the minimum and the maximum theta angle.

Arguments

  • float angle - New angle in degrees in range [-90;90]. If a positive value is specified, the player will look upwards; if a negative value is specified, the player will look downwards.

virtual float getThetaAngle () const =0

Returns the theta angle (zenith angle, also known as pitch angle). This angle determines the vertical viewing direction, i.e. upwards or downwards. If a positive value is returned, the player looks upwards; if a negative value is returned, the player looks downwards. The value is clamped between the minimum and the maximum theta angle.

Return value

Theta angle value.
Last update: 03.07.2017
Build: ()