This page has been translated automatically.
Programming
Fundamentals
Setting Up Development Environment
UnigineScript
High-Level Systems
C++
C#
UUSL (Unified UNIGINE Shader Language)
File Formats
Rebuilding the Engine and 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
Networking Functionality
Pathfinding-Related Classes
Physics-Related Classes
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.

engine.surround Functions

This set of functions is available when the AppSurround or App3DSurround plugin is loaded.

If the plugins are loaded together with the engine, the following definitions are set:

  • HAS_APP_SURROUND for the AppSurround plugin
  • HAS_APP_3D_SURROUND for the App3DSurround plugin
These definitions can be used, for example, to avoid errors if the plugins are not loaded: the code in which the plugin functions are executed can be wrapped around as follows:
Source code (UnigineScript)
#ifdef HAS_APP_SURROUND
	// engine.surround functions
#endif

#ifdef HAS_APP_3D_SURROUND
	// engine.surround functions
#endif

Gui engine.surround.getGui(int num)

Returns a GUI instance to draw interface on the specified monitor.

Arguments

  • int num - Monitor number.

Return value

GUI instance.

void engine.surround.getModelview(int num)

Gets the current modelview matrix used for the specified monitor.

Arguments

  • int num - Monitor number from 0 (the left monitor) to 2 (the right monitor).

void engine.surround.getProjection(int num)

Gets the current projection matrix used for the specified monitor.

Arguments

  • int num - Monitor number from 0 (the left monitor) to 2 (the right monitor).

int engine.surround.isEnabled(int num)

Returns a value indicating if the specified monitor is enabled for viewport rendering.

Arguments

  • int num - Monitor number from 0 (the left monitor) to 2 (the right monitor).

Return value

Returns 1 if the monitor is enabled for rendering; otherwise, 0.

void engine.surround.setEnabled(int num, int enable)

Enables the specified monitor for viewport rendering.

Arguments

  • int num - Monitor number from 0 (the left monitor) to 2 (the right monitor).
  • int enable - 1 to enable the monitor for rendering; 0 to disable it.

void engine.surround.setLeftModelview(int num, mat4 modelview)

Sets stereo pair modelview matrices for the left monitor, i.e. one projection matrix for the left stereo image and one for the right stereo image.
Notice
This function lang="usc" is available only when the App3DSurround plugin is loaded and the HAS_APP_3D_SUROUND identifier is specified.

Arguments

  • int num - Monitor number from 0 (the left monitor) to 2 (the right monitor).
  • mat4 modelview - Modelview matrix for the left or right stereo image.

void engine.surround.setLeftProjection(int num, mat4 projection)

Sets stereo pair projection matrices for the left monitor, i.e. one projection matrix for the left stereo image and one for the right stereo image.
Notice
This function lang="usc" is available only when the App3DSurround plugin is loaded and the HAS_APP_3D_SUROUND identifier is specified.

Arguments

  • int num - Monitor number from 0 (the left monitor) to 2 (the right monitor).
  • mat4 projection - Projection matrix for the left or right stereo image.

void engine.surround.setMaterials(int num, string materials)

Sets postprocess materials to be applied to the specified monitor.

Arguments

  • int num - Monitor number from 0 (the left monitor) to 2 (the right monitor).
  • string materials - Postprocess materials (comma-separated list).

void engine.surround.setModelview(int num, mat4 modelview)

Sets the modelview matrix for the specified monitor.

Arguments

  • int num - Monitor number from 0 (the left monitor) to 2 (the right monitor).
  • mat4 modelview - Modelview matrix.

void engine.surround.setProjection(int num, mat4 projection)

Sets the projection matrix for the specified monitor.

Arguments

  • int num - Monitor number from 0 (the left monitor) to 2 (the right monitor).
  • mat4 projection - Projection matrix.

void engine.surround.setReflectionMask(int num, int mask)

Sets a bit mask for rendering reflections on the specified monitor. Reflections are rendered in the viewport if masks of reflective materials match this one (one matching bit is enough).

Arguments

  • int num - Monitor number from 0 (the left monitor) to 2 (the right monitor).
  • int mask - Integer, each bit of which is a mask.

void engine.surround.setRightModelview(int num, mat4 modelview)

Sets stereo pair modelview matrices for the left monitor, i.e. one projection matrix for the left stereo image and one for the right stereo image.
Notice
This function lang="usc" is available only when the App3DSurround plugin is loaded and the HAS_APP_3D_SUROUND identifier is specified.

Arguments

  • int num - Monitor number from 0 (the left monitor) to 2 (the right monitor).
  • mat4 modelview - Modelview matrix for the left or right stereo image.

void engine.surround.setRightProjection(int num, mat4 projection)

Sets stereo pair projection matrices for the right monitor, i.e. one projection matrix for the left stereo image and one for the right stereo image.
Notice
This function lang="usc" is available only when the App3DSurround plugin is loaded and the HAS_APP_3D_SUROUND identifier is specified.

Arguments

  • int num - Monitor number from 0 (the left monitor) to 2 (the right monitor).
  • mat4 projection - Projection matrix for the left or right stereo image.

void engine.surround.setViewportMask(int num, int mask)

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

Arguments

  • int num - Monitor number from 0 (the left monitor) to 2 (the right monitor).
  • int mask - Integer, each bit of which is a mask.
Last update: 2017-07-03
Build: ()