shown in other instead.
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.
A set of UnigineScript API samples located in the <UnigineSDK>/data/samples/worlds/ folder:
static WorldExpressionPtr create ( ) #Constructor. Creates an arbitrary expression to be executed.
bool isCompiled ( ) # constReturns a value indicating if the given expression has been compiled. It is automatically called on world load or after setExpression() is used.
Return value1 if the expression has been compiled; otherwise, 0.
bool setExpression ( const char * src ) #Sets the arbitrary expression to be executed.
- const char * src - An executable expression.
Return valuetrue if the expression is set successfully; otherwise, false.
const char * getExpression ( ) # constReturns the executable expression.
Return valueThe executable expression.
bool isFunction ( const char * name, int num_args ) # constReturns a value indicating if the given world expression has the function with specified name and number of arguments.
- const char * name - The name of the function.
- int num_args - The number of arguments.
Return valuetrue if the expression exists; otherwise, false.
void setIFps ( float ifps ) #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.
- float ifps - Frame duration (inverse FPS) in seconds (1/FPS). If a too small value is provided, 1E-6 will be used instead.
float getIFps ( ) # constReturns 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 valueFrame duration (inverse FPS) in seconds (1/FPS).
static int type ( ) #Returns the type of the node.
Return valueWorld type identifier.
bool setExpressionName ( const char * name ) #Loads an expression from the given file.
- const char * name - Expression file name.
Return valuetrue if the expression is successfully loaded from the given file; otherwise, false.
const char * getExpressionName ( ) # constReturns the name of the expression file.
Return valueExpression file name.
void setUpdateDistanceLimit ( float limit ) #Sets the distance from the camera within which the object should be updated.
- float limit - Distance from the camera within which the object should be updated.