This page has been translated automatically.
UnigineEditor
Interface Overview
Assets Workflow
Settings and Preferences
Working With Projects
Adjusting Node Parameters
Setting Up Materials
Setting Up Properties
Landscape Tool
Using Editor Tools for Specific Tasks
Extending Editor Functionality
Programming
Fundamentals
Setting Up Development Environment
Usage Examples
UnigineScript
C++
C#
UUSL (Unified UNIGINE Shader Language)
File Formats
Rebuilding the Engine Tools
GUI
Double Precision Coordinates
API
Containers
Common Functionality
Controls-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
IG Plugin
CIGIConnector 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.

engine.world Functions

Warning
UnigineScript is deprecated and will be removed in future releases. Please consider using C#/C++ instead, as these APIs are the preferred ones. Availability of new Engine features in UnigineScipt is not guaranteed, as the current level of support assumes only fixing critical issues.

This class provides functionality for the world script. It contains methods required for loading the world with all its nodes, managing a spatial tree and handling nodes collisions and intersections.

Loading of nodes on demand is managed via the engine.async Class.

Notice
C++ methods running editor script functions are described in the Engine class reference.

See also#

  • engine.async Class to manage loading nodes and other resources on demand
  • The Intersections article demonstrating how to use intersection-related functions
  • The UnigineScript API sample <UnigineSDK>/data/samples/systems/selection_00

World Class

Members


void engine.world.set ( string function, Variable value ) #

Set a variable in a world script (this function can be called directly from any other script).

Arguments

  • string function - Variable name.
  • Variable value - Value of the variable.

int engine.world.isAutoReloadNodeReferences ( ) #

Returns a value indicating if automatic reloading of NodeReferences is enabled. If enabled all NodeReference nodes will reload their *.node files, when the saveNode() method is called.
Notice
This option can be used if you modify and save reference nodes at runtime. Otherwise you'll have to manually update pointers for all NodeReferences referring to the changed node.

Return value

1 if automatic reloading of NodeReferences is enabled; otherwise, 0.

void engine.world.setAutoReloadNodeReferences ( int references ) #

Enables automatic reloading of NodeReferences. If enabled all NodeReference nodes will reload their *.node files, when the saveNode() method is called.
Notice
This option can be used if you modify and save reference nodes at runtime. Otherwise you'll have to manually update pointers for all NodeReferences referring to the changed node.

Arguments

  • int references - 1 to enable automatic reloading of NodeReferences; 0 - to disable it. The default value is 0.

Variable engine.world.get ( string function ) #

Returns a variable from the world script. Instances of user-defined classes cannot be requested in such a manner.

Arguments

  • string function - Variable name with a namespace, if needed.

Return value

Requested instance.

void engine.world.setBudget ( float budget ) #

Sets the world generation budget value for Grass and Clutter objects. New objects are not created when time is out of the budget.

Arguments

  • float budget - The budget value in seconds. The default value is 1/60.

float engine.world.getBudget ( ) #

Returns the value of the world generation budget for Grass and Clutter objects. New objects are not created when time is out of the budget.

Return value

The budget value in seconds.

int engine.world.getCollisionObjects ( Variable v, int[] ret ) #

Searches for all collider objects within a given bounding volume. Intersection is performed with node surfaces (polygons).

Notice
As a new node becomes a part of the BSP tree only after the updateSpatial() method is called (the engine calls the method automatically each frame after the world script update() code is executed), all engine subsystems can process this node only in the next frame. If you need to get the node in the very first frame, call the updateSpatial() method manually. The engine will call this method automatically after the update() code is executed anyways.

Arguments

  • Variable v - Variable. Can be one of the following:
    • BoundSphere bs - The bounding sphere.
    • BoundBox bb - The bounding box.
    • BoundFrustum bf - The bounding frustum.
  • int[] ret - Array into which the result will be placed.

Return value

Number of nodes found.

int engine.world.getCollisionObjects ( vec3 p0, vec3 p1, int[] ret ) #

Performs tracing from the p0 point to the p1 point to find all collider objects intersecting the line. This function detects intersection with surfaces (polygons) of mesh and terrain objects.

Collisions with the surface can be found only if the following conditions are fulfilled:

  1. The surface is enabled.
  2. Per-surface Collision flag is enabled.
  3. The surface has a material assigned.
Notice
As a new node becomes a part of the BSP tree only after the updateSpatial() method is called (the engine calls the method automatically each frame after the world script update() code is executed), all engine subsystems can process this node only in the next frame. If you need to get the node in the very first frame, call the updateSpatial() method manually. The engine will call this method automatically after the update() code is executed anyways.

Arguments

  • vec3 p0 - Coordinates of the line start point.
  • vec3 p1 - Coordinates of the line end point.
  • int[] ret - Array into which the result will be placed.

Return value

Number of nodes found.

int engine.world.getCollisionObjectVariables ( Variable v, int[] ret ) #

Searches for all collider objects which have set user variables. Intersection is performed with node surfaces (polygons). The search is performed within a given bounding volume.

Notice
As a new node becomes a part of the BSP tree only after the updateSpatial() method is called (the engine calls the method automatically each frame after the world script update() code is executed), all engine subsystems can process this node only in the next frame. If you need to get the node in the very first frame, call the updateSpatial() method manually. The engine will call this method automatically after the update() code is executed anyways.

Arguments

  • Variable v - Variable. Can be one of the following:
    • BoundSphere bs - The bounding sphere.
    • BoundBox bb - The bounding box.
    • BoundFrustum bf - The bounding frustum.
  • int[] ret - Array into which the result will be placed.

Return value

Number of nodes found.

int engine.world.getCollisionObjectVariables ( vec3 p0, vec3 p1, int[] ret ) #

Performs tracing from the p0 point to the p1 point to find all collider objects which have set user variables. This function detects intersection with surfaces (polygons) of mesh and terrain objects.

Collisions with the surface can be found only if the following conditions are fulfilled:

  1. The surface is enabled.
  2. Per-surface Collision flag is enabled.
  3. The surface has a material assigned.
Notice
As a new node becomes a part of the BSP tree only after the updateSpatial() method is called (the engine calls the method automatically each frame after the world script update() code is executed), all engine subsystems can process this node only in the next frame. If you need to get the node in the very first frame, call the updateSpatial() method manually. The engine will call this method automatically after the update() code is executed anyways.

Arguments

  • vec3 p0 - Coordinates of the line start point.
  • vec3 p1 - Coordinates of the line end point.
  • int[] ret - Array into which the result will be placed.

Return value

Number of nodes found.

void engine.world.setData ( string data ) #

Sets user data associated with the world. In the *.world file, the data is set in the data tag.

Arguments

  • string data - New user data.

string engine.world.getData ( ) #

Returns user string data associated with the world. This string is written directly into the data tag of the *.world file.

Return value

User string data.

void engine.world.setDistance ( float distance ) #

Updates the distance, at which (and farther) nothing will be rendered or simulated.

Arguments

  • float distance - New distance in units.

float engine.world.getDistance ( ) #

Returns a distance, at which (and farther) nothing will be rendered or simulated.

Return value

Distance in units.

int engine.world.isFunction ( string name, int num_args ) #

Returns a value indicating if the given function with the specified number of arguments exists in the world script.

Arguments

  • string name - Function name.
  • int num_args - Number of function arguments.

Return value

1 if the function exists; otherwise, 0.

Object engine.world.getIntersection ( vec3 p0, vec3 p1, int mask, int[] exclude, Variable value ) #

Performs tracing from the p0 point to the p1 point to find the list of objects intersecting the line. This function detects intersection with surfaces (polygons) of meshes. An intersection can be found found only if an object is matching the intersection mask.

Intersections with the surface can be found only if the following conditions are fulfilled:

  1. The surface is enabled.
  2. Per-surface Intersection flag is enabled.
  3. The surface has a material assigned.

Arguments

  • vec3 p0 - Coordinates of the line start point.
  • vec3 p1 - Coordinates of the line end point.
  • int mask - Intersection mask. If 0 is passed, the function will return NULL.
  • int[] exclude - The list of objects IDs to be excluded.
  • Variable value - Variable. Can be one of the following:
    Notice
    As a new node becomes a part of the BSP tree only after the updateSpatial() method is called (the engine calls the method automatically each frame after the world script update() code is executed), all engine subsystems can process this node only in the next frame. If you need to get the node in the very first frame, call the updateSpatial() method manually. The engine will call this method automatically after the update() code is executed anyways.

Return value

The first intersected object, if found; otherwise, 0.

Object engine.world.getIntersection ( vec3 p0, vec3 p1, int mask, Variable value ) #

Performs tracing from the p0 point to the p1 point to find the nearest object which intersects the line. This function detects intersection with surfaces (polygons) of meshes. An intersection is found only if an object is matching the intersection mask.

Intersections with the surface can be found only if the following conditions are fulfilled:

  1. The surface is enabled.
  2. Per-surface Intersection flag is enabled.
  3. The surface has a material assigned.

Usage Example

The following example shows how you can get the intersection information by using the WorldIntersection class. In this example the line is an invisible traced line from the point of the camera (vec3 p0) to the point of the mouse pointer (vec3 p1). The executing sequence is the following:

  • Define and initialize two points (p0 and p1) by using the Unigine::getPlayerMouseDirection() function from core/scripts/utils.h.
  • Create an instance of the WorldIntersection class to get the intersection information.
  • Check, if there is a intersection with an object. The engine.world.getIntersection() function returns an intersected object when the object intersects with the traced line.
  • In this example, when the object intersects with the traced line, all the surfaces of the intersected object change their material parameters. The WorldIntersection class instance gets the coordinates of the intersection point, the index of the surface and the index of the intersected triangle. You can get all these fields by using getIndex(), getPoint() and getSurface() functions
Source code (UnigineScript)
#include <core/scripts/utils.h>
/* ... */
// define two vec3 coordinates
vec3 p0,p1;
// get the mouse direction from camera (p0) to cursor pointer (p1)
Unigine::getPlayerMouseDirection(p0,p1);

// create an instance of the WorldIntersection class to get the result
WorldIntersection wis = new WorldIntersection();

// create an instance for intersected object
Object object = engine.world.getIntersection(p0,p1,1,wis);

// if the intersection has been occurred, change the parameter and the texture of the object's material
if(object != NULL)
{
	forloop(int i=0; object.getNumSurfaces())
	{
		object.setMaterialParameterFloat4("diffuse_color", vec4(1.0f, 0.0f, 0.0f, 1.0f),i);
		object.setMaterialTexture("diffuse","", i);
		
		// show intersection details in console
		log.message("point: %s index: %i surface: %i \n", typeinfo(wis.getPoint()), wis.getIndex(), wis.getSurface());
	}

}
/* ... */

Arguments

  • vec3 p0 - Coordinates of the line start point.
  • vec3 p1 - Coordinates of the line end point.
  • int mask - Intersection mask. If 0 is passed, the function will return NULL.
  • Variable value - Variable. Can be one of the following:
    Notice
    As a new node becomes a part of the BSP tree only after the updateSpatial() method is called (the engine calls the method automatically each frame after the world script update() code is executed), all engine subsystems can process this node only in the next frame. If you need to get the node in the very first frame, call the updateSpatial() method manually. The engine will call this method automatically after the update() code is executed anyways.

Return value

The first intersected object, if found; otherwise, 0.

int engine.world.getIntersectionNodes ( Variable value, int type, int[] ret ) #

Searches for all nodes (or nodes filtered by type) within a given bounding volume. Intersection is performed with node surfaces (polygons). The search is performed within a given bounding volume.

Notice
As a new node becomes a part of the BSP tree only after the updateSpatial() method is called (the engine calls the method automatically each frame after the world script update() code is executed), all engine subsystems can process this node only in the next frame. If you need to get the node in the very first frame, call the updateSpatial() method manually. The engine will call this method automatically after the update() code is executed anyways.

Arguments

  • Variable value - Variable. Can be one of the following:
    • BoundSphere bs - The bounding sphere.
    • BoundBox bb - The bounding box.
    • BoundFrustum bf - The bounding frustum.
  • int type - Node type (one of the NODE_* variables); -1 is not to use a filter.
  • int[] ret - Array into which the result will be placed.

Return value

Number of nodes found.

int engine.world.getIntersectionNodeVariables ( Variable value, int type, int[] ret ) #

Searches for all nodes (or nodes filtered by type) which have set user variables. Intersection is performed with node surfaces (polygons). The search is performed within a given bounding volume.

Notice
As a new node becomes a part of the BSP tree only after the updateSpatial() method is called (the engine calls the method automatically each frame after the world script update() code is executed), all engine subsystems can process this node only in the next frame. If you need to get the node in the very first frame, call the updateSpatial() method manually. The engine will call this method automatically after the update() code is executed anyways.

Arguments

  • Variable value - Variable. Can be one of the following:
    • BoundSphere bs - The bounding sphere.
    • BoundBox bb - The bounding box.
    • BoundFrustum bf - The bounding frustum.
  • int type - Node type (one of the NODE_* variables); -1 is not to use a filter.
  • int[] ret - Array into which the result will be placed.

Return value

Number of nodes found.

int engine.world.getIntersectionObjects ( Variable value, int[] ret ) #

Searches for all objects within a given bounding volume. Intersection is performed with node surfaces (polygons).

Notice
As a new node becomes a part of the BSP tree only after the updateSpatial() method is called (the engine calls the method automatically each frame after the world script update() code is executed), all engine subsystems can process this node only in the next frame. If you need to get the node in the very first frame, call the updateSpatial() method manually. The engine will call this method automatically after the update() code is executed anyways.

Arguments

  • Variable value - Variable. Can be one of the following:
    • BoundSphere bs - The bounding sphere.
    • BoundBox bb - The bounding box.
    • BoundFrustum bf - The bounding frustum.
  • int[] ret - Array into which the result will be placed.

Return value

Number of nodes found.

int engine.world.getIntersectionObjects ( vec3 p0, vec3 p1, int[] ret ) #

Performs tracing from the p0 point to the p1 point to find all objects intersecting the line. This function detects intersection with surfaces (polygons) of mesh and terrain objects.

Intersections with the surface can be found only if the following conditions are fulfilled:

  1. The surface is enabled.
  2. Per-surface Intersection flag is enabled.
  3. The surface has a material assigned.
Notice
As a new node becomes a part of the BSP tree only after the updateSpatial() method is called (the engine calls the method automatically each frame after the world script update() code is executed), all engine subsystems can process this node only in the next frame. If you need to get the node in the very first frame, call the updateSpatial() method manually. The engine will call this method automatically after the update() code is executed anyways.

Arguments

  • vec3 p0 - Coordinates of the line start point.
  • vec3 p1 - Coordinates of the line end point.
  • int[] ret - Array into which the result will be placed.

Return value

Number of nodes found.

int engine.world.getIntersectionObjectVariables ( Variable v, int[] ret ) #

Searches for the data associated with all objects (or objects filtered by type) within a given bounding volume. Intersection is performed with object surfaces (polygons).

Notice
As a new node becomes a part of the BSP tree only after the updateSpatial() method is called (the engine calls the method automatically each frame after the world script update() code is executed), all engine subsystems can process this node only in the next frame. If you need to get the node in the very first frame, call the updateSpatial() method manually. The engine will call this method automatically after the update() code is executed anyways.

Arguments

  • Variable v - Variable. Can be one of the following:
    • BoundSphere bs - The bounding sphere.
    • BoundBox bb - The bounding box.
    • BoundFrustum bf - The bounding frustum.
  • int[] ret - Array into which the result will be placed.

Return value

Number of nodes found.

int engine.world.getIntersectionObjectVariables ( vec3 p0, vec3 p1, int[] ret ) #

Performs tracing from the p0 point to the p1 point to find all objects which have set user variables. This function detects intersection with surfaces (polygons) of meshes.

Intersections with the surface can be found only if the following conditions are fulfilled:

  1. The surface is enabled.
  2. Per-surface Intersection flag is enabled.
  3. The surface has a material assigned.
Notice
As a new node becomes a part of the BSP tree only after the updateSpatial() method is called (the engine calls the method automatically each frame after the world script update() code is executed), all engine subsystems can process this node only in the next frame. If you need to get the node in the very first frame, call the updateSpatial() method manually. The engine will call this method automatically after the update() code is executed anyways.

Arguments

  • vec3 p0 - Coordinates of the line start point.
  • vec3 p1 - Coordinates of the line end point.
  • int[] ret - Array into which the result will be placed.

Return value

Number of nodes found.

int engine.world.loadWorld ( string path ) #

Loads a world from the specified file path and replaces the current world with it.

Arguments

Return value

1 if the world is loaded successfully; otherwise, 0.

int engine.world.isLoaded ( ) #

Returns a value indicating if the current world is fully loaded.

Return value

1 if the world is loaded; otherwise, 0.

void engine.world.setPath ( string path ) #

Sets the path to the *.world-file where the world is stored.

Arguments

  • string path - Path to the *.world-file.

string engine.world.getPath ( ) #

Returns the current path to the *.world-file where the world is stored.

Return value

Path to the *.world-file.

void engine.world.setPhysicsSettings ( string settings ) #

Sets the name of the *.physics file containing default physics settings to be used for the world.

Arguments

  • string settings - Name of the default *.physics asset to be used for the world.

string engine.world.getPhysicsSettings ( ) #

Returns the name of the *.physics file containing default physics settings currently used by the world.

Return value

Name of the default *.physics asset used for the world.

void engine.world.setRenderSettings ( string settings ) #

Sets the name of the *.render file containing default render settings to be used for the world.

Arguments

  • string settings - Name of the default *.render asset to be used for the world.

string engine.world.getRenderSettings ( ) #

Returns the name of the *.render file containing default render settings currently used by the world.

Return value

Name of the default *.render asset used for the world.

void engine.world.setSoundSettings ( string settings ) #

Sets the name of the *.sound file containing default sound settings to be used for the world.

Arguments

  • string settings - Name of the default *.sound asset to be used for the world.

string engine.world.getSoundSettings ( ) #

Returns the name of the *.sound file containing default sound settings currently used by the world.

Return value

Name of the default *.sound asset used for the world.

void engine.world.setScriptName ( string name ) #

Sets the name of the world script file *.usc.

Arguments

  • string name - Name of the world script file *.usc.

string engine.world.getScriptName ( ) #

Returns the name of the world script file *.usc.

Return value

Name of the world script file *.usc.

int engine.world.isNode ( int id ) #

Checks if a node with a given ID exists in the world.

Arguments

  • int id - Node ID.

Return value

1 if the node with the given ID exists; otherwise, 0.

void engine.world.getNodes ( Node[] nodes ) #

Returns all instances of all nodes (either loaded from the *.world file or created dynamically at run time), including cache, Node Reference internals, etc.
Notice
If you need only root nodes to be returned, use getRootNodes() instead

Arguments

  • Node[] nodes - Array with node smart pointers.

int engine.world.isVariable ( string name ) #

Returns a value indicating if the given variable exists in the world script.

Arguments

  • string name - Variable name.

Return value

1 if the variable exists; otherwise, 0.

int engine.world.addWorld ( string name ) #

Loads a world from a file and adds it to the current world.

Arguments

Return value

1 if the world is loaded and added successfully; otherwise, 0.

Variable engine.world.call ( Variable function ) #

Executes a function of the world script from an external script. The function should not take any arguments.

Arguments

  • Variable function - Name of the function to execute.

Return value

Value returned by the function.

Variable engine.world.call ( Variable function, Variable arg0 ) #

Executes a function of the world script from an external script. The function should take one argument.

Arguments

  • Variable function - Name of the function to execute.
  • Variable arg0 - Argument of the function.

Return value

Value returned by the function.

Variable engine.world.call ( Variable function, Variable arg0, Variable arg1 ) #

Executes a function of the world script from an external script. The function should take two arguments.

Arguments

  • Variable function - Name of the function to execute.
  • Variable arg0 - Argument of the function.
  • Variable arg1 - Argument of the function.

Return value

Value returned by the function.

Variable engine.world.call ( Variable function, Variable arg0, Variable arg1, Variable arg2 ) #

Executes a function of the world script from an external script. The function should take three arguments.

Arguments

  • Variable function - Name of the function to execute.
  • Variable arg0 - Argument of the function.
  • Variable arg1 - Argument of the function.
  • Variable arg2 - Argument of the function.

Return value

Value returned by the function.

Variable engine.world.call ( Variable function, Variable arg0, Variable arg1, Variable arg2, Variable arg3 ) #

Executes a function of the world script from an external script. The function should take four arguments.

Arguments

  • Variable function - Name of the function to execute.
  • Variable arg0 - Argument of the function.
  • Variable arg1 - Argument of the function.
  • Variable arg2 - Argument of the function.
  • Variable arg3 - Argument of the function.

Return value

Value returned by the function.

Variable engine.world.call ( Variable function, Variable arg0, Variable arg1, Variable arg2, Variable arg3, Variable arg4 ) #

Executes a function of the world script from an external script. The function should take five arguments.

Arguments

  • Variable function - Name of the function to execute.
  • Variable arg0 - Argument of the function.
  • Variable arg1 - Argument of the function.
  • Variable arg2 - Argument of the function.
  • Variable arg3 - Argument of the function.
  • Variable arg4 - Argument of the function.

Return value

Value returned by the function.

Variable engine.world.call ( Variable function, Variable arg0, Variable arg1, Variable arg2, Variable arg3, Variable arg4, Variable arg5 ) #

Executes a function of the world script from an external script. The function should take six arguments.

Arguments

  • Variable function - Name of the function to execute.
  • Variable arg0 - Argument of the function.
  • Variable arg1 - Argument of the function.
  • Variable arg2 - Argument of the function.
  • Variable arg3 - Argument of the function.
  • Variable arg4 - Argument of the function.
  • Variable arg5 - Argument of the function.

Return value

Value returned by the function.

Variable engine.world.call ( Variable function, int id = [] ) #

Executes a function of the world script from an external script. The function takes an array of arguments (up to 8 arguments are supported).

Arguments

  • Variable function - Name of the function to execute.
  • int id - Array of up to 8 arguments.

Return value

Value returned by the function.

int engine.world.clearNode ( string name ) #

Clears a cache of the given NodeReference.

Arguments

  • string name - File with the node.

Return value

1 if the cache was successfully cleaned; otherwise, 0.

void engine.world.setUnpackNodeReferences ( int references ) #

Enables or disables automatic unpacking of node references at run time. This option can be used to simplify hierarchy management, as when it is enabled all nodes contained in node references will be present in the world hierarchy. When disabled you have to check the hierarchy of each node reference individually (e.g. to find the number of children or manage some of them). The content of NodeReference nodes is unpacked only at run time and does not affect your *.world and *.node files. So, you can use all advantages of node references when building worlds in the UnigineEditor and manage a clear and straightforward hierarchy at run time.
Notice
This option is available only via code, can be enabled in the System Script and works for all worlds used in your project.

Arguments

  • int references - 1 - to enable automatic unpacking of node references at run time, 0 - to disable it.

int engine.world.isUnpackNodeReferences ( ) #

Returns the value indicating if automatic unpacking of node references at run time is enabled. This option can be used to simplify hierarchy management, as when it is enabled all nodes contained in node references will be present in the world hierarchy. When disabled you have to check the hierarchy of each node reference individually (e.g. to find the number of children or manage some of them). The content of NodeReference nodes is unpacked only at run time and does not affect your *.world and *.node files. So, you can use all advantages of node references when building worlds in the UnigineEditor and manage a clear and straightforward hierarchy at run time.
Notice
This option is available only via code, can be enabled in the System Script and works for all worlds used in your project.

Return value

1 if automatic unpacking of node references at run time is enabled; otherwise, 0.

void engine.world.updateSpatial ( ) #

Updates the node BSP (binary space partitioning) tree.

The engine calls this method automatically each frame after the world script update() code is executed. As a new node becomes a part of the BSP tree only after this method is called, all engine subsystems (renderer, physics, sound, pathfinding, collisions, intersections, etc.) can process this node only in the next frame. If you need the subsystem to process the node in the very first frame, you can call the updateSpatial() method manually. The engine will call this method automatically after the update() code is executed anyways.

void engine.world.setUpdateGridSize ( float size ) #

Sets the size of the grid to be used for spatial tree update. The default value is an average one, and can be adjusted when necessary depending on the scene.

Arguments

  • float size - New grid size, in units. The default value is 1000 units.

float engine.world.getUpdateGridSize ( ) #

Returns the current size of the grid to be used for spatial tree update. The default value is an average one, and can be adjusted when necessary depending on the scene.

Return value

Current grid size, in units. The default value is 1000 units.

void engine.world.setScriptExecute ( int execute ) #

Sets a value indicating if a logic script associated with the world is to be loaded with it.

Arguments

  • int execute - 1 - to load the world along with the associated logic script (if any), 0 - to ignore it.

int engine.world.isScriptExecute ( ) #

Returns a value indicating if a logic script associated with the world is to be loaded with it.

Return value

1 if a logic script associated with the world is to be loaded with it; otherwise, 0.

Node engine.world.getNodeById ( int node_id ) #

Returns a node by its identifier if it exists.

Arguments

  • int node_id - Node ID.

Return value

Node engine.world.getNodeByName ( string name ) #

Returns a node by its name if it exists. If the world contains multiple nodes having the same name, only the first one found shall be returned. To get all nodes having the same name, use the getNodesByName() method.
Notice
method filters out isolated node hierarchies and cache nodes, so it does not return nodes having a possessor (NodeReference / Clutter / Cluster) among its predecessors or nodes from cache.

Arguments

  • string name - Node name.

Return value

void engine.world.clearBindings ( ) #

Clears internal buffers with pointers and instances. This function is used for proper cloning of objects with hierarchies, for example, bodies and joints. Should be called before cloning.

int engine.world.getRootNodeIndex ( Node node ) #

Returns the index for the specified root node, that belongs to the world hierarchy.

Arguments

  • Node node - Root node, for which an index is to be obtained.

Return value

Index of the specified root node if it exists; otherwise, -1.

void engine.world.setRootNodeIndex ( Node node, int index ) #

Sets a new index for the specified root node, that belongs to the world hierarchy.

Arguments

  • Node node - Root node, for which a new index is to be set.
  • int index - New index to be set for the specified root node.
Last update: 2020-06-01
Build: ()