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
C++ API
API Reference
Integration Samples
Usage Examples
C++ Plugins
Content Creation
Materials
Unigine Material Library
Tutorials
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::Player Class

Interface for player handling. See also the UnigineScript analog.

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

Unigine::Player Class

Members


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

Player constructor.

Arguments

  • const NodePtr & node - Node smart pointer.

virtual Ptr< Player > getPlayer () const =0

Returns a player pointer.

Return value

The player pointer.

virtual void setViewportMask (int mask) const =0

Sets a viewport mask. Object surfaces, materials, decals, lights and GUI objects will be rendered into the viewport only if their viewport mask matches the player's one (one matching bit is enough).

Arguments

  • int mask - Viewport mask (integer, each bit of which is a mask).

virtual int getViewportMask () const =0

Returns the current viewport mask. Object surfaces, materials, decals, lights and GUI objects will be rendered into the viewport only if their viewport mask matches the player's one (one matching bit is enough).

Return value

Viewport mask (integer, each bit of which is a mask).

virtual void setReflectionMask (int mask) const =0

Sets a reflection mask for rendering reflections into the viewport. Reflections are rendered in the viewport if masks of reflective materials match this one.

Arguments

  • int mask - Reflection mask (integer, each bit of which is a mask).

virtual int getReflectionMask () const =0

Returns the current reflection mask used for rendering reflections into the viewport. Reflections are rendered in the viewport if masks of reflective materials match this one.

Return value

Reflection mask (integer, each bit of which is a mask).

virtual void setSourceMask (int mask) const =0

Sets a source mask that determines sound sources, which can be heard. For a sound source to be heard, its mask should match with this one in at least one bit. Plus, the volume of sound channel in which the sound plays (its number also depends on this mask) should not be equal to 0.

Arguments

  • int mask - Source mask (integer, each bit of which specifies a sound channel).

virtual int getSourceMask () const =0

Returns the source mask that determines sound sources, which can be heard. For a sound source to be heard, its mask should match with this one in at least one bit. Plus, the volume of sound channel in which the sound plays (its number also depends on this mask) should not be equal to 0.

Return value

Source mask (integer, each bit of which specifies a sound channel).

virtual void setReverbMask (int mask) const =0

Sets a reverb mask that determines reverberation zones, which can be heard. For sound to reverberate, at least one bit of this mask should match with a reverb mask of the sound source and a reverb mask of the reverberation zone. Masks of a sound source and reverberation zone can match with the player's one in different bits, not necessarily one.

Arguments

  • int mask - Reverb mask (integer, each bit of which is a mask for reverberating sound sources and reverberation zones).

virtual int getReverbMask () const =0

Returns the reverb mask that determines reverberation zones, which can be heard. For sound to reverberate, at least one bit of this mask should match with a reverb mask of the sound source and a reverb mask of the reverberation zone. Masks of a sound source and reverberation zone can match with the player's one in different bits, not necessarily one.

Return value

Reverb mask (integer, each bit of which is a mask for reverberating sound sources and reverberation zones).

virtual void setFov (float fov) const =0

Sets a field of view of the player. The default is 60 degrees.

Arguments

  • float fov - Field of view in degrees. The provided value will be saturated in the range [0; 180].

virtual float getFov () const =0

Returns the current field of view of the player. The default is 60 degrees.

Return value

Current field of view in degrees.

virtual void setZNear (float znear) const =0

Sets a distance to the near clipping plane of the player's viewing frustum. The default is 0.1 units.

Arguments

  • float znear - Distance to the near clipping plane in units. The minimum value is 0.

virtual float getZNear () const =0

Returns the distance to the near clipping plane of the player's viewing frustum. The default is 0.1 units.

Return value

Distance to the near clipping plane in units.

virtual void setZFar (float zfar) const =0

Sets a distanc to the far clipping plane of the player's viewing frustum. The default is 10000 units.

Arguments

  • float zfar - Distance to the far clipping plane in units. The minimum value is 0.

virtual float getZFar () const =0

Returns the current distance to the far clipping plane of the player's viewing frustum. The default is 10000 units.

Return value

Distance to the far clipping plane in units.

virtual void setProjection (const mat4 & projection) const =0

Sets a projection matrix.

Arguments

  • const mat4 & projection - New projection matrix.

virtual mat4 getProjection () const =0

Returns the current projection matrix.

Return value

Current projection matrix.

virtual void setSProjection (const mat4 & sprojection) const =0

Sets a shader projection matrix.

Arguments

  • const mat4 & sprojection - New shader projection matrix.

virtual mat4 getSProjection () const =0

Returns the current shader projection matrix.

Return value

Current shader projection matrix.

virtual void setModelview (const UNIGINE_MAT4 & modelview) const =0

Sets a new modelview matrix.

Arguments

  • const UNIGINE_MAT4 & modelview - New modelview matrix.

virtual UNIGINE_MAT4 getModelview () const =0

Returns the current modelview matrix.

Return value

Current modelview matrix.

virtual UNIGINE_MAT4 getIModelview () const =0

Returns the current inverse modelview matrix.

Return value

Inverse modelview matrix.

virtual void setOffset (const mat4 & offset) const =0

Sets an offset matrix for the player. This transformation is applied after the model-view transformation. It does not affect it or the position of the player. For example, the offset matrix can be used to set player's head position (in case the player turns his head) or to simulate camera shake from an explosion.

Arguments

  • const mat4 & offset - Offset matrix.

virtual mat4 getOffset () const =0

Returns the current offset matrix. This transformation is applied after the model-view transformation. It does not affect it or the position of the player. For example, the offset matrix can be used to set player's head position (in case the player turns his head) or to simulate camera shake from an explosion. The default value is mat4_identity (identity matrix).

Return value

Current offset matrix.

virtual void setPostMaterials (const char * materials) const =0

Sets postprocess materials that are applied after all other postprocess (such as HDR, DOF, etc.) are rendered.

Arguments

  • const char * materials - Comma-separated list of names of postprocess materials.

virtual const char * getPostMaterials () const =0

Returns names of postprocess materials applied after all other postprocess (such as HDR, DOF, etc.) are rendered.

Return value

Comma-separated list of names of postprocess materials.
Last update: 2017-07-03
Build: ()