This page has been translated automatically.
Getting Started
Migrating to UNIGINE 2.0
C++ API Migration
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
Warning! This version of documentation is OUTDATED, as it describes an older SDK version! Please switch to the documentation for the latest SDK version.
Warning! This version of documentation describes an old SDK version which is no longer supported! Please upgrade to the latest SDK version.

Unigine::PlayerPersecutor Class

Interface for player persecutor handling.

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

Unigine::PlayerPersecutor Class

Members


static int type ()

PlayerPersecutor type.

Return value

PlayerPersecutor type identifier.

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

PlayerPersecutor constructor.

Arguments

  • const NodePtr & node - Node smart pointer.

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

PlayerPersecutor constructor.

Arguments

  • const PlayerPtr & player - Player smart pointer.

static Ptr< PlayerPersecutor > create ()

PlayerPersecutor constructor.

virtual void setFixed (int fixed) const =0

Sets a value indicating if the persecutor can freely rotate around its target or it is oriented strictly in one direction. The fixed viewing direction is the same direction the persecutor was looking in when this function is called, though it can be reset to another one afterwards.

Arguments

  • int fixed - 1 to move independently, 0 to follow the target.

virtual int isFixed () const =0

Returns a value indicating if the persecutor can freely rotate around its target or it is oriented strictly in one direction. The fixed viewing direction is the same direction the persecutor was looking in when the setFixed() function is called, though it can be reset to another one afterwards.

Return value

1 if the persecutor moves independently; otherwise, 0.

virtual void setCollision (int collision) const =0

Sets a value indicating if collisions with persecutor's sphere should be taken into account.

Arguments

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

virtual int getCollision () const =0

Returns a value indicating if collisions with persecutor'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 persecutor'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 persecutor'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

Sets the radius of the persecutor's collision sphere.

Arguments

  • float radius - New radius of the collision sphere.

virtual float getCollisionRadius () const =0

Returns radius of the persecutor's collision sphere.

Return value

Radius of the collision sphere in units.

virtual void setTarget (const NodePtr & node) const =0

Sets an object, which will be followed by the persecutor.

Arguments

  • const NodePtr & node - New target node.

virtual NodePtr getTarget () const =0

Returns the object currently followed by the persecutor.

Return value

Target node smart pointer.

virtual void setAnchor (const vec3 & anchor) const =0

Sets coordinates of an anchor point (in the target node local coordinates), to which the persecutor is bound.

Arguments

  • const vec3 & anchor - Anchor coordinates.

virtual vec3 getAnchor () const =0

Returns coordinates of an anchor point (in the target node local coordinates), to which the persecutor is bound.

Return value

Anchor coordinates.

virtual void setMinDistance (float distance) const =0

Sets the minimum possible distance between the persecutor and the target.

Arguments

  • float distance - New distance in units.

virtual float getMinDistance () const =0

Returns the minimum possible distance between the persecutor and the target.

Return value

Distance in units.

virtual void setMaxDistance (float distance) const =0

Sets the maximum possible distance between the persecutor and the target.

Arguments

  • float distance - New distance in units.

virtual float getMaxDistance () const =0

Returns the maximum possible distance between the persecutor and the target.

Return value

Distance in units.

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

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

Angle in degrees.

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 setDistance (float distance) const =0

Sets a distance between the target node and the persecutor. The value will be clamped between the minimum and the maximum distance values.

Arguments

  • float distance - New distance in units.

virtual float getDistance () const =0

Returns the current distance between the target and the persecutor. The value is clamped between the minimum and the maximum distance values.

Return value

Distance in units.

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 the player left.

Return value

Angle in degrees.

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

Angle in degrees.
Last update: 2017-07-03
Build: ()