This page has been translated automatically.
UnigineEditor
Interface Overview
Assets Workflow
Settings and Preferences
Adjusting Node Parameters
Setting Up Materials
Setting Up Properties
Landscape Tool
Using Editor Tools for Specific Tasks
FAQ
Programming
Fundamentals
Setting Up Development Environment
Usage Examples
UnigineScript
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
Objects-Related Classes
Networking Functionality
Pathfinding-Related Classes
Physics-Related Classes
Plugins-Related Classes
CIGI Client 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.WorldExpression Class

Inherits: Node

This class is used to create a world expression, that executes an arbitrary expression. An expression can be executed for the other nodes if they are assigned as child nodes of WorldExpression. The child nodes will inherit transformations (if any) of the world expression and will be transformed relative to the pivot point of WorldExpression.

See Also#

A set of UnigineScript API samples located in the <UnigineSDK>/data/samples/worlds/ folder:

  • expression_00
  • expression_01
  • expression_02
  • expression_03
  • expression_04
  • expression_05

WorldExpression Class

Properties

bool IsCompiled#

A value indicating if the given expression has been compiled. it is automatically called on world load or after setExpression() is used.

float IFps#

The current constant frame duration used to execute the expression. 0 means that the expression is executed at the same frame rate as the main application window.
set
Sets a constant frame duration used to execute the expression. It can be used to decrease the frame rate to get higher performance. 0 means that the expression is executed at the same frame rate as the main application window.
set value - Frame duration (inverse FPS) in seconds (1/FPS). If a too small value is provided, 1E-6 will be used instead.

float Distance#

The distance at which the expression is not executed.
set
Sets the distance at which the expression is not executed.
set value - The distance value. If a negative value is specified, 0 will be used instead.

vec3 Offset#

The offset of the center of the world expression's bounding box along the x, y and z axes.
set
Sets an offset of the center of the world expression's bounding box along the X, Y and Z axes.
set value - An offset of the expression box center.

vec3 Size#

The current size of the worldexpression bounding box. the size of the bounding box is important as if the bounding box gets outside the viewing frustum, the expression is not executed.
Notice
If the child object transformed according to the expression gets outside the view frustum, but the bounding box is still in the viewing frustum, the playback of the transformation sequence will not stop.
set
Sets the size of the WorldExpression bounding box. The size of the bounding box is important as if the bounding box gets outside the viewing frustum, the expression is not executed.
Notice
If the child object transformed according to the expression gets outside the view frustum, but the bounding box is still in the viewing frustum, the playback of the transformation sequence will not stop.
set value - Size of the bounding box in units.

Members


static WorldExpression ( vec3 size ) #

Constructor. Creates an arbitrary expression to be executed.
Notice
An expression is executed only when its bounding box is in the viewing frustum or when the camera is positioned within this bounding box, so the size is important.

Arguments

  • vec3 size - Size of the bounding box. This is an optional argument.

static WorldExpression Cast ( Node node ) #

Casts a WorldExpression out of the Node instance.

Arguments

  • Node node - Node instance.

Return value

WorldExpression instance.

bool SetExpression ( string src ) #

Sets the arbitrary expression to be executed.
Notice
The expression passed as an argument must be wrapped with curly braces {} as they define the world expression scope.

Arguments

  • string src - An executable expression.

Return value

The expression number.

string GetExpression ( ) #

Returns the executable expression.

Return value

The executable expression.

bool IsFunction ( string name, int num_args ) #

Returns a value indicating if the given world expression has the function with specified name and number of arguments.

Arguments

  • string name - The name of the function.
  • int num_args - The number of arguments.

Return value

1 if the expression exists; otherwise, 0.

static int type ( ) #

Returns the type of the node.

Return value

World type identifier.

bool SetExpressionName ( string name ) #

Loads an expression from the given file.

Arguments

  • string name - Expression file name.

Return value

1 if the expression is successfully loaded from the given file; otherwise, 0.

string GetExpressionName ( ) #

Returns the name of the expression file.

Return value

Expression file name.
Last update: 2019-08-16
Build: ()