Unigine::WorldExpression Class
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.
Unigine::WorldExpression Class
Members
static int type ()
WorldExpression type.Return value
WorldExpression type identifier.static Ptr< WorldExpression > create (const NodePtr & node)
WorldExpression constructor.Arguments
- const NodePtr & node - Node smart pointer.
static Ptr< WorldExpression > create (const vec3 & size)
WorldExpression constructor.virtual Ptr< Node > getNode () const =0
Returns a node pointer.Return value
Node pointer.void setSize (vec3 & size)
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.
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.
Arguments
- vec3 & size - Size of the bounding box in units.
virtual vec3 getSize () const =0
Returns 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.
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.
Return value
Size of the bounding box in units.virtual void setOffset (vec3 & offset) =0
Sets an offset of the center of the world expression's bounding box along the X, Y and Z axes.Arguments
- vec3 & offset - An offset of the expression box center.
virtual vec3 getOffset () const =0
Returns the offset of the center of the world expression's bounding box along the X, Y and Z axes.Return value
The offset of the expression box center.virtual void setDistance (float distance) =0
Sets the distance at which the expression is not executed.Arguments
- float distance - The distance value. If a negative value is specified, 0 will be used instead.
virtual float getDistance () const =0
Returns the distance at which the expression is not executed.Return value
The distance value.virtual void setIFps (float ifps) =0
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.Arguments
- float ifps - Frame duration (inverse FPS) in seconds (1/FPS). If a too small value is provided, 1E-6 will be used instead.
virtual float getIFps () const =0
Returns 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.Return value
Frame duration (inverse FPS) in seconds (1/FPS).int isCompiled ()
Returns a value indicating if the given expression has been compiled. It is automatically called on world load or after setExpression() is used.Return value
1 if the expression has been compiled; otherwise, 0.virtual int setExpression (const char * src) =0
Sets the arbitrary expression to be executed.
The expression passed as an argument must be wrapped with curly braces {} as they define the world expression scope.
Arguments
- const char * src - An executable expression.
Return value
The expression number.virtual const char * getExpression () const =0
Returns the executable expression.Return value
The executable expression.Last update: 2017-07-03
Help improve this article
Was this article helpful?
(or select a word/phrase and press Ctrl+Enter)