This page has been translated automatically.
UnigineEditor
Interface Overview
Assets Workflow
Settings and Preferences
Working With Projects
Adjusting Node Parameters
Setting Up Materials
Setting Up Properties
Landscape Tool
Using Editor Tools for Specific Tasks
Extending Editor Functionality
Programming
Fundamentals
Setting Up Development Environment
Usage Examples
UnigineScript
C++
C#
UUSL (Unified UNIGINE Shader Language)
File Formats
Rebuilding the Engine Tools
GUI
Double Precision Coordinates
API
Containers
Common Functionality
Controls-Related Classes
Engine-Related Classes
Filesystem Functionality
GUI-Related Classes
Math Functionality
Node-Related Classes
Objects-Related Classes
Networking Functionality
Pathfinding-Related Classes
Physics-Related Classes
Plugins-Related Classes
IG Plugin
CIGIConnector Plugin
Rendering-Related Classes
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.PlayerSpectator Class

Inherits: Player

Interface for player spectator handling.

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

See Also#

  • A UnigineScript API sample <UnigineSDK>/data/samples/players/spectator_00
  • A C# API sample <UnigineSDK>/source/csharp/samples/Api/Nodes/CustomPlayers/CustomPlayerSpectator

PlayerSpectator Class

Properties

int NumContacts#

The number of contacts, in which the spectator's sphere participates.

float ThetaAngle#

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.
set
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.
set value - 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.

float PhiAngle#

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.
set
Sets the phi angle (azimuth angle, also known as yaw angle). This angle determines the horizontal viewing direction, i.e. left or right.
set value - New angle in degrees. Positive values rotate the player right; negative values rotate it left.

float Turning#

A velocity of player turning.
set
Sets a velocity of player turning.
set value - Turning velocity in degrees per second. If a negative value is provided, 0 will be used instead.

float Damping#

The spectator's damping.
set
Sets a spectator's damping.
set value - New damping.

float Acceleration#

The current acceleration of the spectator.
set
Sets an acceleration of the spectator.
set value - New acceleration in units per second squared. If a negative value is provided, 0 will be used instead.

float MaxThetaAngle#

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.
set
Sets the maximum theta angle (zenith angle, also known as pitch angle) that determines how far downward the player can look.
set value - New angle in degrees in range [0;90]. The higher the value, the further down the player can look.

float MinThetaAngle#

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.
set
Sets the minimum theta angle (zenith angle, also known as pitch angle) that determines how far upward the player can look.
set value - New angle in degrees in range [-90;0]. The lower the value, the further up the player can look.

float MaxVelocity#

The velocity of the spectator, which is used while the spectator runs (the controls::state_run control state is "pressed").
set
Sets the velocity of the spectator, which is used while the spectator runs (the Controls::STATE_RUN control state is "pressed").
set value - New velocity in units per second. If a negative value is provided, 0 will be used instead.

float MinVelocity#

The default velocity of the spectator.
set
Sets the default velocity of the spectator.
set value - New velocity in units per second. If a negative value is provided, 0 will be used instead.

float CollisionRadius#

Radius of the spectators's collision sphere.
set
Updates radius of the spectators's collision sphere.
set value - New radius of the collision sphere.

int CollisionMask#

A collision mask of the spectators's collision sphere. two objects collide, if they both have matching masks.
set
Sets a collision mask for the spectators's collision sphere. Two objects collide, if they both have matching masks.
set value - Integer, each bit of which is a mask.

int Collision#

A value indicating if collisions with spectator's sphere should be taken into account.
set
Updates a value indicating if collisions with spectator's sphere should be taken into account.
set value - 1 to enable collisions, 0 to let the spectator fly through objects.

vec3 ViewDirection#

The current player's view direction vector.
set
Sets a new Player's view direction vector.
set value - New view direction vector to be set.

Members


static PlayerSpectator ( ) #

Constructor. Creates a new spectator with default properties.

float GetContactDepth ( int contact ) #

Returns penetration depth by the given contact.

Arguments

  • int contact - Contact number.

Return value

Penetration depth.

vec3 GetContactNormal ( int contact ) #

Returns a normal of the contact point, in world coordinates.

Arguments

  • int contact - Contact number.

Return value

Normal of the contact point.

Object GetContactObject ( int contact ) #

Returns an object participating in the contact with the player (used for collisions with physical object).

Arguments

  • int contact - Contact number.

Return value

Object in contact.

vec3 GetContactPoint ( int contact ) #

Returns world coordinates of the contact point.

Arguments

  • int contact - Contact number.

Return value

Contact point.

Ptr<Shape> GetContactShape ( int num ) #

Returns a shape that collided with the player.

Arguments

  • int num - Contact number.

Return value

Shape in contact.

int GetContactSurface ( int contact ) #

Returns the surface of the current object, which is in contact (used for collisions with non-physical object).

Arguments

  • int contact - Contact number.

Return value

Surface number.

static int type ( ) #

Returns the type of the player.

Return value

PlayerSpectator type identifier.
Last update: 2020-07-31
Build: ()