Inherited: Object


Note: A scene object creating automatically by the engine. Only one World instance can be created in the game. A scene object must be set as a parent for other game hierarchies to show them on the screen. The main scene graph object can be retrieved using Engine::sceneGraph()

Public Methods

Scene *

activeScene () const

Scene *

createScene (const std::string & name)


isToBeUpdated ()

Scene *

loadScene (const std::string & path, bool additive)


makeDirty ()


rayCast (const Ray & ray, float maxDistance, Ray::Hit * hit)


setActiveScene (Scene * scene)


setRayCastHandler (RayCastCallback callback, System * system)


setToBeUpdated (bool flag)


unloadAll ()


unloadScene (Scene * scene)

Static Methods


Methods Description

:ref:`Scene<api_Scene>`* World::activeScene () const

Returns an active Scene.

There must always be one Scene marked as the active at the same time.

See also setActiveScene().

:ref:`Scene<api_Scene>`* World::createScene (std::string & name)

Create an empty new Scene at runtime with the given name.

bool World::isToBeUpdated ()

Returns in case of scene must be updated in the current frame; otherwise returns false.

:ref:`Scene<api_Scene>`* World::loadScene (std::string & path, bool additive)

Loads the scene stored in the .map files by the it’s path.

Note: The previous scenes will be not unloaded in the case of an additive flag is true.

void World::makeDirty ()

Marks World as dirty. Mainly used to detect scene graph configuration changes.

bool World::rayCast (Ray & ray, float maxDistance, Ray::Hit * hit)

Casts a ray, of length maxDistance, against all colliders in the World. Returns true if the ray has a hit point with a Collider; otherwise returns false.

void World::setActiveScene (Scene * scene)

Sets the scene to be active.

There must always be one Scene marked as the active at the same time.

See also activeScene().

void World::setRayCastHandler (RayCastCallback callback, System * system)

Sets the raycast callback function.

This function will be used to check intersections with in game geometry. In the most cases implemented in the physical engines. This callback is added by any physical system by the default.

void World::setToBeUpdated (bool flag)

Sets an update flag.

See also isToBeUpdated().

void World::unloadAll ()

Unloads all from the World.

void World::unloadScene (Scene * scene)

Unloads the scene from the World.