Saga3D API Documentation  1.0-RC4
saga::scene::ISceneManager Class Referenceabstract

#include <ISceneManager.h>

Inheritance diagram for saga::scene::ISceneManager:
saga::IEventReceiver

Public Types

using SceneNodeList = std::vector< std::shared_ptr< ISceneNode > >
 
using PassSceneNodeList = std::unordered_map< video::RenderPassHandle, SceneNodeList >
 

Public Member Functions

virtual void resetID ()=0
 
virtual ID getMeshID ()=0
 
virtual ID getTextureID ()=0
 
virtual ID getNodeID ()=0
 
virtual void onEvent (const SDL_Event &event) override
 Called when an SDL event is fired. More...
 
virtual const std::shared_ptr< IMesh > & getMesh (const std::string &fileName)=0
 Loads a mesh from given file. More...
 
virtual const std::shared_ptr< IMesh > & getMesh (void *data, const std::size_t size, const std::string &extension)=0
 
virtual const std::shared_ptr< IMesh > & getMesh (const ID id) const =0
 
virtual void removeMesh (const std::shared_ptr< IMesh > &mesh)=0
 
virtual void removeMesh (const ID id)=0
 
virtual std::shared_ptr< ISceneNodecreateSceneNode (const std::shared_ptr< IMesh > &mesh, const std::shared_ptr< ISceneNode > &parent=nullptr, const glm::vec3 &position=glm::vec3(0, 0, 0), const glm::vec3 &rotation=glm::vec3(0, 0, 0), const glm::vec3 &scale=glm::vec3(1.0f, 1.0f, 1.0f))=0
 Adds a scene node for rendering a static mesh. More...
 
virtual void removeNode (const ID id)=0
 
virtual void removeNode (const std::shared_ptr< ISceneNode > &node)=0
 
virtual const std::shared_ptr< video::IVideoDriver > & getVideoDriver () const =0
 Get interface to the mesh cache which is shared between all existing scene managers. More...
 
virtual void registerNode (const std::shared_ptr< ISceneNode > &node, video::RenderPassHandle pass)=0
 
virtual const std::shared_ptr< ISceneNode > & getNode (const ID id) const =0
 
virtual void unregisterNode (const std::shared_ptr< ISceneNode > &node, video::RenderPassHandle pass)=0
 
virtual bool isEmptyPass (video::RenderPassHandle pass) const =0
 
virtual void clearRegisteredNodes ()=0
 
virtual SceneNodeListgetNodeList (const video::RenderPassHandle pass)=0
 
virtual PassSceneNodeListgetNodeList ()=0
 
virtual const std::shared_ptr< ICameraSceneNode > & addCameraSceneNode (const std::shared_ptr< ISceneNode > &parent=nullptr, const glm::vec3 &position=glm::vec3(0, 0, 0), const glm::vec3 &lookAt=glm::vec3(0, 0,-1), bool makeActive=true)=0
 Adds a cube scene node. More...
 
virtual const std::shared_ptr< ICameraSceneNode > & addCameraSceneNodeFPS (const std::shared_ptr< ISceneNode > &parent=nullptr, float moveSpeed=0.5f, float rotateSpeed=1.f, bool makeActive=true)=0
 Adds a maya style user controlled camera scene node to the scene graph. More...
 
virtual const std::shared_ptr< ISceneNode > & getRootSceneNode () const =0
 Adds a dynamic light scene node to the scene graph. More...
 
virtual const std::shared_ptr< ICameraSceneNode > & getActiveCamera () const =0
 Get the first scene node with the specified id. More...
 
virtual void setActiveCamera (const std::shared_ptr< ICameraSceneNode > &camera)=0
 Sets the currently active camera. More...
 
virtual void animate (const video::RenderPassHandle pass=video::NULL_GPU_RESOURCE_HANDLE)=0
 Registers a node for rendering it at a specific time. More...
 
virtual void clear ()=0
 Creates a rotation animator, which rotates the attached scene node around itself. More...
 
- Public Member Functions inherited from saga::IEventReceiver
virtual ~IEventReceiver ()
 Destructor. More...
 

Detailed Description

Definition at line 38 of file ISceneManager.h.

Member Typedef Documentation

◆ PassSceneNodeList

◆ SceneNodeList

using saga::scene::ISceneManager::SceneNodeList = std::vector<std::shared_ptr<ISceneNode> >

Definition at line 41 of file ISceneManager.h.

Member Function Documentation

◆ addCameraSceneNode()

virtual const std::shared_ptr<ICameraSceneNode>& saga::scene::ISceneManager::addCameraSceneNode ( const std::shared_ptr< ISceneNode > &  parent = nullptr,
const glm::vec3 &  position = glm::vec3(0, 0, 0),
const glm::vec3 &  lookAt = glm::vec3(0, 0,-1),
bool  makeActive = true 
)
pure virtual

Adds a cube scene node.

Parameters
sizeSize of the cube, uniformly in each dimension.
parentParent of the scene node. Can be 0 if no parent.
idId of the node. This id can be used to identify the scene node.
positionPosition of the space relative to its parent where the scene node will be placed.
rotationInitial rotation of the scene node.
scaleInitial scale of the scene node.
Returns
Pointer to the created test scene node. This pointer should not be dropped. See IReferenceCounted::drop() for more information. Adds a sphere scene node of the given radius and detail
Parameters
radiusRadius of the sphere.
polyCountThe number of vertices in horizontal and vertical direction. The total polyCount of the sphere is polyCount*polyCount. This parameter must be less than 256 to stay within the 16-bit limit of the indices of a meshbuffer.
parentParent of the scene node. Can be 0 if no parent.
idId of the node. This id can be used to identify the scene node.
positionPosition of the space relative to its parent where the scene node will be placed.
rotationInitial rotation of the scene node.
scaleInitial scale of the scene node.
Returns
Pointer to the created test scene node. This pointer should not be dropped. See IReferenceCounted::drop() for more information. Adds a scene node for rendering an animated mesh model.
Parameters
meshPointer to the loaded animated mesh to be displayed.
parentParent of the scene node. Can be NULL if no parent.
idId of the node. This id can be used to identify the scene node.
positionPosition of the space relative to its parent where the scene node will be placed.
rotationInitial rotation of the scene node.
scaleInitial scale of the scene node.
alsoAddIfMeshPointerZeroAdd the scene node even if a 0 pointer is passed.
Returns
Pointer to the created scene node. This pointer should not be dropped. See IReferenceCounted::drop() for more information. Adds a scene node for rendering a animated water surface mesh. Looks really good when the Material type E_MATERIAL_TYPE::TRANSPARENT_REFLECTION is used.
Parameters
waveHeightHeight of the water waves.
waveSpeedSpeed of the water waves.
waveLengthLength of a water wave.
meshPointer to the loaded static mesh to be displayed with water waves on it.
parentParent of the scene node. Can be NULL if no parent.
idId of the node. This id can be used to identify the scene node.
positionPosition of the space relative to its parent where the scene node will be placed.
rotationInitial rotation of the scene node.
scaleInitial scale of the scene node.
Returns
Pointer to the created scene node. This pointer should not be dropped. See IReferenceCounted::drop() for more information. Adds a scene node for rendering using a octree to the scene graph. This a good method for rendering scenes with lots of geometry. The octree is built on the fly from the mesh.
Parameters
meshThe mesh containing all geometry from which the octree will be build. If this animated mesh has more than one frames in it, the first frame is taken.
parentParent node of the octree node.
idid of the node. This id can be used to identify the node.
minimalPolysPerNodeSpecifies the minimal polygons contained a octree node. If a node gets less polys than this value it will not be split into smaller nodes.
alsoAddIfMeshPointerZeroAdd the scene node even if a 0 pointer is passed.
Returns
Pointer to the octree if successful, otherwise 0. This pointer should not be dropped. See IReferenceCounted::drop() for more information. Adds a scene node for rendering using a octree to the scene graph. This a good method for rendering scenes with lots of geometry. The octree is built on the fly from the mesh, much faster then a bsp tree.
Parameters
meshThe mesh containing all geometry from which the octree will be build.
parentParent node of the octree node.
idid of the node. This id can be used to identify the node.
minimalPolysPerNodeSpecifies the minimal polygons contained a octree node. If a node gets less polys than this value it will not be split into smaller nodes.
alsoAddIfMeshPointerZeroAdd the scene node even if a 0 pointer is passed.
Returns
Pointer to the octree if successful, otherwise 0. This pointer should not be dropped. See IReferenceCounted::drop() for more information. Adds a camera scene node to the scene graph and sets it as active camera. This camera does not react on user input like for example the one created with addCameraSceneNodeFPS(). If you want to move or animate it, use animators or the ISceneNode::setPosition(), ICameraSceneNode::setTarget() etc methods. By default, a camera's look at position (set with setTarget()) and its scene node rotation (set with setRotation()) are independent. If you want to be able to control the direction that the camera looks by using setRotation() then call ICameraSceneNode::bindTargetAndRotation(true) on it.
Parameters
positionPosition of the space relative to its parent where the camera will be placed.
lookAtPosition where the camera will look at. Also known as target.
parentParent scene node of the camera. Can be null. If the parent moves, the camera will move too.
idid of the camera. This id can be used to identify the camera.
makeActiveFlag whether this camera should become the active one. Make sure you always have one active camera.
Returns
Pointer to interface to camera if successful, otherwise 0. This pointer should not be dropped. See IReferenceCounted::drop() for more information.

◆ addCameraSceneNodeFPS()

virtual const std::shared_ptr<ICameraSceneNode>& saga::scene::ISceneManager::addCameraSceneNodeFPS ( const std::shared_ptr< ISceneNode > &  parent = nullptr,
float  moveSpeed = 0.5f,
float  rotateSpeed = 1.f,
bool  makeActive = true 
)
pure virtual

Adds a maya style user controlled camera scene node to the scene graph.

This is a standard camera with an animator that provides mouse control similar to camera in the 3D Software Maya by Alias Wavefront. The camera does not react on setPosition anymore after applying this animator. Instead use setTarget, to fix the target the camera the camera hovers around. And setDistance to set the current distance from that target, i.e. the radius of the orbit the camera hovers on.

Parameters
parentParent scene node of the camera. Can be null.
rotateSpeedRotation speed of the camera.
zoomSpeedZoom speed of the camera.
translationSpeedTranslationSpeed of the camera.
idid of the camera. This id can be used to identify the camera.
distanceInitial distance of the camera from the object
makeActiveFlag whether this camera should become the active one. Make sure you always have one active camera.
Returns
Returns a pointer to the interface of the camera if successful, otherwise 0. This pointer should not be dropped. See IReferenceCounted::drop() for more information. Adds a camera scene node with an animator which provides mouse and keyboard control appropriate for first person shooters (FPS). This FPS camera is intended to provide a demonstration of a camera that behaves like a typical First Person Shooter. It is useful for simple demos and prototyping but is not intended to provide a full solution for a production quality game. It binds the camera scene node rotation to the look-at target;
See also
ICameraSceneNode::bindTargetAndRotation(). With this camera, you look with the mouse, and move with cursor keys.
Parameters
parentParent scene node of the camera. Can be null.
rotateSpeedSpeed in degrees with which the camera is rotated. This can be done only with the mouse.
moveSpeedSpeed in units per millisecond with which the camera is moved. Movement is done with the cursor keys.
idid of the camera. This id can be used to identify the camera.
keyMapArrayOptional pointer to an array of a keymap, specifying what keys should be used to move the camera. If this is null, the default keymap is used. You can define actions more then one time in the array, to bind multiple keys to the same action.
keyMapSizeAmount of items in the keymap array.
noVerticalMovementSetting this to true makes the camera only move within a horizontal plane, and disables vertical movement as known from most ego shooters. Default is 'false', with which it is possible to fly around in space, if no gravity is there.
jumpSpeedSpeed with which the camera is moved when jumping.
invertMouseSetting this to true makes the camera look up when the mouse is moved down and down when the mouse is moved up, the default is 'false' which means it will follow the movement of the mouse cursor.
makeActiveFlag whether this camera should become the active one. Make sure you always have one active camera.
Returns
Pointer to the interface of the camera if successful, otherwise nullptr.

◆ animate()

virtual void saga::scene::ISceneManager::animate ( const video::RenderPassHandle  pass = video::NULL_GPU_RESOURCE_HANDLE)
pure virtual

Registers a node for rendering it at a specific time.

This method should only be used by SceneNodes when they get a ISceneNode::onRegisterSceneNode(video::RenderPassHandle pass) call.

Parameters
nodeNode to register for drawing. Usually scene nodes would set 'this' as parameter here because they want to be drawn.
passSpecifies when the node wants to be drawn in relation to the other nodes. For example, if the node is a shadow, it usually wants to be drawn after all other nodes and will use E_SCENE_NODE_RENDER_PASS::SHADOW for this. See scene::E_SCENE_NODE_RENDER_PASS for details.
Returns
scene will be rendered (passed culling) Clear all nodes which are currently registered for rendering Usually you don't have to care about this as drawAll will clear nodes after rendering them. But sometimes you might have to manully reset this. For example when you deleted nodes between registering and rendering. Animate all the scene nodes. This should be called before rendering

◆ clear()

virtual void saga::scene::ISceneManager::clear ( )
pure virtual

Creates a rotation animator, which rotates the attached scene node around itself.

Parameters
rotationSpeedSpecifies the speed of the animation in degree per 10 milliseconds.
Returns
The animator. Attach it to a scene node with ISceneNode::addAnimator() and the animator will animate it. If you no longer need the animator, you should call ISceneNodeAnimator::drop(). See IReferenceCounted::drop() for more information. Creates a fly circle animator, which lets the attached scene node fly around a center.
Parameters
centerCenter of the circle.
radiusRadius of the circle.
speedThe orbital speed, in radians per millisecond.
directionSpecifies the upvector used for alignment of the mesh.
startPositionThe position on the circle where the animator will begin. Value is in multiples of a circle, i.e. 0.5 is half way around. (phase)
radiusEllipsoidif radiusEllipsoid != 0 then radius2 from a ellipsoid begin. Value is in multiples of a circle, i.e. 0.5 is half way around. (phase)
Returns
The animator. Attach it to a scene node with ISceneNode::addAnimator() and the animator will animate it. If you no longer need the animator, you should call ISceneNodeAnimator::drop(). See IReferenceCounted::drop() for more information. Creates a fly straight animator, which lets the attached scene node fly or move along a line between two points.
Parameters
startPointStart point of the line.
endPointEnd point of the line.
timeForWayTime in milliseconds how long the node should need to move from the start point to the end point.
loopIf set to false, the node stops when the end point is reached. If loop is true, the node begins again at the start.
pingpongFlag to set whether the animator should fly back from end to start again.
Returns
The animator. Attach it to a scene node with ISceneNode::addAnimator() and the animator will animate it. If you no longer need the animator, you should call ISceneNodeAnimator::drop(). See IReferenceCounted::drop() for more information. Creates a texture animator, which switches the textures of the target scene node based on a list of textures.
Parameters
texturesList of textures to use.
timePerFrameTime in milliseconds, how long any texture in the list should be visible.
loopIf set to to false, the last texture remains set, and the animation stops. If set to true, the animation restarts with the first texture.
Returns
The animator. Attach it to a scene node with ISceneNode::addAnimator() and the animator will animate it. If you no longer need the animator, you should call ISceneNodeAnimator::drop(). See IReferenceCounted::drop() for more information. Creates a scene node animator, which deletes the scene node after some time automatically.
Parameters
timeMsTime in milliseconds, after when the node will be deleted.
Returns
The animator. Attach it to a scene node with ISceneNode::addAnimator() and the animator will animate it. If you no longer need the animator, you should call ISceneNodeAnimator::drop(). See IReferenceCounted::drop() for more information. Creates a special scene node animator for doing automatic collision detection and response. See ISceneNodeAnimatorCollisionResponse for details.
Parameters
worldTriangle selector holding all triangles of the world with which the scene node may collide. You can create a triangle selector with ISceneManager::createTriangleSelector();
sceneNodeSceneNode which should be manipulated. After you added this animator to the scene node, the scene node will not be able to move through walls and is affected by gravity. If you need to teleport the scene node to a new position without it being effected by the collision geometry, then call sceneNode->setPosition(); then animator->setTargetNode(sceneNode);
ellipsoidRadiusRadius of the ellipsoid with which collision detection and response is done. If you have got a scene node, and you are unsure about how big the radius should be, you could use the following code to determine it:
const core::aabbox3d<float>& box = yourSceneNode->getBoundingBox();
glm::vec3 radius = box.MaxEdge - box.getCenter();
gravityPerSecondSets the gravity of the environment, as an acceleration in units per second per second. If your units are equivalent to meters, then glm::vec3(0,-10.0f,0) would give an approximately realistic gravity. You can disable gravity by setting it to glm::vec3(0,0,0).
ellipsoidTranslationBy default, the ellipsoid for collision detection is created around the center of the scene node, which means that the ellipsoid surrounds it completely. If this is not what you want, you may specify a translation for the ellipsoid.
slidingValueDOCUMENTATION NEEDED.
Returns
The animator. Attach it to a scene node with ISceneNode::addAnimator() and the animator will cause it to do collision detection and response. If you no longer need the animator, you should call ISceneNodeAnimator::drop(). See IReferenceCounted::drop() for more information. Creates a follow spline animator. The animator modifies the position of the attached scene node to make it follow a Hermite spline. It uses a subset of Hermite splines: either cardinal splines (tightness != 0.5) or Catmull-Rom-splines (tightness == 0.5). The animator moves from one control point to the next in 1/speed seconds. This code was sent in by Matthias Gall. If you no longer need the animator, you should call ISceneNodeAnimator::drop(). See IReferenceCounted::drop() for more information. Creates a simple ITriangleSelector, based on a mesh. Triangle selectors can be used for doing collision detection. Don't use this selector for a huge amount of triangles like in Quake3 maps. Instead, use for example ISceneManager::createOctreeTriangleSelector(). Please note that the created triangle selector is not automatically attached to the scene node. You will have to call ISceneNode::setTriangleSelector() for this. To create and attach a triangle selector is done like this:
ITriangleSelector* s = sceneManager->createTriangleSelector(yourMesh,
yourSceneNode);
yourSceneNode->setTriangleSelector(s);
s->drop();
Parameters
meshMesh of which the triangles are taken.
nodeScene node of which transformation is used.
separateMeshbuffersWhen true it's possible to get information which meshbuffer got hit in collision tests. But has a slight speed cost.
Returns
The selector, or null if not successful. If you no longer need the selector, you should call ITriangleSelector::drop(). See IReferenceCounted::drop() for more information. Creates a simple ITriangleSelector, based on a meshbuffer. This is a static selector which won't update when the mesh changes.
Parameters
meshBufferTriangles of that meshbuffer are used
materialIndexIf you pass a material index that index can be returned by the triangle selector. \para node: Scene node of which transformation is used. Creates a simple ITriangleSelector, based on an animated mesh scene node. Details of the mesh associated with the node will be extracted internally.
nodeThe animated mesh scene node from which to build the selector
separateMeshbuffersWhen true it's possible to get information which meshbuffer got hit in collision tests. But has a slight speed cost. Creates a simple dynamic ITriangleSelector, based on a axis aligned bounding box. Triangle selectors can be used for doing collision detection. Every time when triangles are queried, the triangle selector gets the bounding box of the scene node, an creates new triangles. In this way, it works good with animated scene nodes.
nodeScene node of which the bounding box, visibility and transformation is used.
Returns
The selector, or null if not successful. If you no longer need the selector, you should call ITriangleSelector::drop(). See IReferenceCounted::drop() for more information. Creates a Triangle Selector, optimized by an octree. Triangle selectors can be used for doing collision detection. This triangle selector is optimized for huge amounts of triangle, it organizes them in an octree. Please note that the created triangle selector is not automatically attached to the scene node. You will have to call ISceneNode::setTriangleSelector() for this. To create and attach a triangle selector is done like this:
ITriangleSelector* s = sceneManager->createOctreeTriangleSelector(yourMesh,
yourSceneNode);
yourSceneNode->setTriangleSelector(s);
s->drop();
For more information and examples on this, take a look at the collision tutorial in the SDK.
Parameters
meshMesh of which the triangles are taken.
nodeScene node of which visibility and transformation is used.
minimalPolysPerNodeSpecifies the minimal polygons contained a octree node. If a node gets less polys than this value, it will not be split into smaller nodes.
Returns
The selector, or null if not successful. If you no longer need the selector, you should call ITriangleSelector::drop(). See IReferenceCounted::drop() for more information. Creates a Triangle Selector for a single meshbuffer, optimized by an octree. Triangle selectors can be used for doing collision detection. This triangle selector is optimized for huge amounts of triangle, it organizes them in an octree. Please note that the created triangle selector is not automatically attached to the scene node. You will have to call ISceneNode::setTriangleSelector() for this. To create and attach a triangle selector is done like this:
ITriangleSelector* s = sceneManager->createOctreeTriangleSelector(yourMesh,
yourSceneNode);
yourSceneNode->setTriangleSelector(s);
s->drop();
For more information and examples on this, take a look at the collision tutorial in the SDK.
Parameters
meshBufferMeshbuffer of which the triangles are taken.
materialIndexSetting this value allows the triangle selector to return the material index
nodeScene node of which visibility and transformation is used.
minimalPolysPerNodeSpecifies the minimal polygons contained a octree node. If a node gets less polys than this value, it will not be split into smaller nodes.
Returns
The selector, or null if not successful. If you no longer need the selector, you should call ITriangleSelector::drop(). See IReferenceCounted::drop() for more information. Creates a meta triangle selector. A meta triangle selector is nothing more than a collection of one or more triangle selectors providing together the interface of one triangle selector. In this way, collision tests can be done with different triangle soups in one pass.
The selector, or null if not successful. If you no longer need the selector, you should call ITriangleSelector::drop(). See IReferenceCounted::drop() for more information. Creates a triangle selector which can select triangles from a terrain scene node.
Parameters
nodePointer to the created terrain scene node
LODLevel of detail, 0 for highest detail.
Returns
The selector, or null if not successful. If you no longer need the selector, you should call ITriangleSelector::drop(). See IReferenceCounted::drop() for more information. Adds an external mesh loader for extending the engine with new file formats. If you want the engine to be extended with file formats it currently is not able to load (e.g. .cob), just implement the IMeshLoader interface in your loading class and add it with this method. Using this method it is also possible to override built-in mesh loaders with newer or updated versions without the need to recompile the engine.
Parameters
externalLoaderImplementation of a new mesh loader. Returns the number of mesh loaders supported by Irrlicht at this time Retrieve the given mesh loader
indexThe index of the loader to retrieve. This parameter is an 0-based array index.
Returns
A pointer to the specified loader, 0 if the index is incorrect. Adds an external scene loader for extending the engine with new file formats. If you want the engine to be extended with file formats it currently is not able to load (e.g. .vrml), just implement the ISceneLoader interface in your loading class and add it with this method. Using this method it is also possible to override the built-in scene loaders with newer or updated versions without the need to recompile the engine.
Parameters
externalLoaderImplementation of a new mesh loader. Returns the number of scene loaders supported by Irrlicht at this time Retrieve the given scene loader
indexThe index of the loader to retrieve. This parameter is an 0-based array index.
Returns
A pointer to the specified loader, 0 if the index is incorrect. Get pointer to the scene collision manager.
Pointer to the collision manager This pointer should not be dropped. See IReferenceCounted::drop() for more information. Get pointer to the mesh manipulator.
Pointer to the mesh manipulator This pointer should not be dropped. See IReferenceCounted::drop() for more information. Adds a scene node to the deletion queue. The scene node is immediately deleted when it's secure. Which means when the scene node does not execute animators and things like that. This method is for example used for deleting scene nodes by their scene node animators. In most other cases, a ISceneNode::remove() call is enough, using this deletion queue is not necessary. See ISceneManager::createDeleteAnimator() for details.
Parameters
nodeNode to delete. Clears the whole scene. All scene nodes are removed.

◆ clearRegisteredNodes()

virtual void saga::scene::ISceneManager::clearRegisteredNodes ( )
pure virtual

◆ createSceneNode()

virtual std::shared_ptr<ISceneNode> saga::scene::ISceneManager::createSceneNode ( const std::shared_ptr< IMesh > &  mesh,
const std::shared_ptr< ISceneNode > &  parent = nullptr,
const glm::vec3 &  position = glm::vec3(0, 0, 0),
const glm::vec3 &  rotation = glm::vec3(0, 0, 0),
const glm::vec3 &  scale = glm::vec3(1.0f, 1.0f, 1.0f) 
)
pure virtual

Adds a scene node for rendering a static mesh.

Parameters
meshPointer to the loaded static mesh to be displayed.
parentParent of the scene node. Can be NULL if no parent.
idId of the node. This id can be used to identify the scene node.
positionPosition of the space relative to its parent where the scene node will be placed.
rotationInitial rotation of the scene node.
scaleInitial scale of the scene node.
alsoAddIfMeshPointerZeroAdd the scene node even if a 0 pointer is passed.
Returns
Pointer to the created scene node. This pointer should not be dropped. See IReferenceCounted::drop() for more information.

◆ getActiveCamera()

virtual const std::shared_ptr<ICameraSceneNode>& saga::scene::ISceneManager::getActiveCamera ( ) const
pure virtual

Get the first scene node with the specified id.

Parameters
idThe id to search for
startScene node to start from. All children of this scene node are searched. If null is specified, the root scene node is taken.
Returns
Pointer to the first scene node with this id, and null if no scene node could be found. This pointer should not be dropped. See IReferenceCounted::drop() for more information. Get the first scene node with the specified name.
Parameters
nameThe name to search for
startScene node to start from. All children of this scene node are searched. If null is specified, the root scene node is taken.
Returns
Pointer to the first scene node with this id, and null if no scene node could be found. This pointer should not be dropped. See IReferenceCounted::drop() for more information. Get the first scene node with the specified type.
Parameters
typeThe type to search for
startScene node to start from. All children of this scene node are searched. If null is specified, the root scene node is taken.
Returns
Pointer to the first scene node with this type, and null if no scene node could be found. This pointer should not be dropped. See IReferenceCounted::drop() for more information. Get scene nodes by type.
Parameters
typeType of scene node to find (E_SCENE_NODE_TYPE::ANY will return all child nodes).
outNodesresults will be added to this array (outNodes is not cleared).
startScene node to start from. This node and all children of this scene node are checked (recursively, so also children of children, etc). If null is specified, the root scene node is taken as start-node. Get the current active camera.
Returns
The active camera is returned. Note that this can be NULL, if there was no camera created yet.

◆ getMesh() [1/3]

virtual const std::shared_ptr<IMesh>& saga::scene::ISceneManager::getMesh ( const ID  id) const
pure virtual

◆ getMesh() [2/3]

virtual const std::shared_ptr<IMesh>& saga::scene::ISceneManager::getMesh ( const std::string &  fileName)
pure virtual

Loads a mesh from given file.

◆ getMesh() [3/3]

virtual const std::shared_ptr<IMesh>& saga::scene::ISceneManager::getMesh ( void *  data,
const std::size_t  size,
const std::string &  extension 
)
pure virtual

◆ getMeshID()

virtual ID saga::scene::ISceneManager::getMeshID ( )
pure virtual

◆ getNode()

virtual const std::shared_ptr<ISceneNode>& saga::scene::ISceneManager::getNode ( const ID  id) const
pure virtual

◆ getNodeID()

virtual ID saga::scene::ISceneManager::getNodeID ( )
pure virtual

◆ getNodeList() [1/2]

virtual PassSceneNodeList& saga::scene::ISceneManager::getNodeList ( )
pure virtual

◆ getNodeList() [2/2]

virtual SceneNodeList& saga::scene::ISceneManager::getNodeList ( const video::RenderPassHandle  pass)
pure virtual

◆ getRootSceneNode()

virtual const std::shared_ptr<ISceneNode>& saga::scene::ISceneManager::getRootSceneNode ( ) const
pure virtual

Adds a dynamic light scene node to the scene graph.

The light will cast dynamic light on all other scene nodes in the scene, which have the material flag video::MTF_LIGHTING turned on. (This is the default setting in most scene nodes).

Parameters
parentParent scene node of the light. Can be null. If the parent moves, the light will move too.
positionPosition of the space relative to its parent where the light will be placed.
colorDiffuse color of the light. Ambient or Specular colors can be set manually with the ILightSceneNode::getLightData() method.
radiusRadius of the light.
idid of the node. This id can be used to identify the node.
Returns
Pointer to the interface of the light if successful, otherwise NULL. This pointer should not be dropped. See IReferenceCounted::drop() for more information. Adds a billboard scene node to the scene graph. A billboard is like a 3d sprite: A 2d element, which always looks to the camera. It is usually used for things like explosions, fire, lensflares and things like that.
Parameters
parentParent scene node of the billboard. Can be null. If the parent moves, the billboard will move too.
sizeSize of the billboard. This size is 2 dimensional because a billboard only has width and height.
positionPosition of the space relative to its parent where the billboard will be placed.
idAn id of the node. This id can be used to identify the node.
colorTopThe color of the vertices at the top of the billboard (default: white).
colorBottomThe color of the vertices at the bottom of the billboard (default: white).
Returns
Pointer to the billboard if successful, otherwise NULL. This pointer should not be dropped. See IReferenceCounted::drop() for more information. Adds a skybox scene node to the scene graph. A skybox is a big cube with 6 textures on it and is drawn around the camera position.
Parameters
topTexture for the top plane of the box.
bottomTexture for the bottom plane of the box.
leftTexture for the left plane of the box.
rightTexture for the right plane of the box.
frontTexture for the front plane of the box.
backTexture for the back plane of the box.
parentParent scene node of the skybox. A skybox usually has no parent, so this should be null. Note: If a parent is set to the skybox, the box will not change how it is drawn.
idAn id of the node. This id can be used to identify the node.
Returns
Pointer to the sky box if successful, otherwise NULL. This pointer should not be dropped. See IReferenceCounted::drop() for more information. Adds a skydome scene node to the scene graph. A skydome is a large (half-) sphere with a panoramic texture on the inside and is drawn around the camera position.
Parameters
textureTexture for the dome.
horiResNumber of vertices of a horizontal layer of the sphere.
vertResNumber of vertices of a vertical layer of the sphere.
texturePercentageHow much of the height of the texture is used. Should be between 0 and 1.
spherePercentageHow much of the sphere is drawn. Value should be between 0 and 2, where 1 is an exact half-sphere and 2 is a full sphere.
radiusThe Radius of the sphere
parentParent scene node of the dome. A dome usually has no parent, so this should be null. Note: If a parent is set, the dome will not change how it is drawn.
idAn id of the node. This id can be used to identify the node.
Returns
Pointer to the sky dome if successful, otherwise NULL. This pointer should not be dropped. See IReferenceCounted::drop() for more information. Adds a particle system scene node to the scene graph.
Parameters
withDefaultEmitterCreates a default working point emitter which emits some particles. Set this to true to see a particle system in action. If set to false, you'll have to set the emitter you want by calling IParticleSystemSceneNode::setEmitter().
parentParent of the scene node. Can be NULL if no parent.
idId of the node. This id can be used to identify the scene node.
positionPosition of the space relative to its parent where the scene node will be placed.
rotationInitial rotation of the scene node.
scaleInitial scale of the scene node.
Returns
Pointer to the created scene node. This pointer should not be dropped. See IReferenceCounted::drop() for more information. Adds a terrain scene node to the scene graph. This node implements is a simple terrain renderer which uses a technique known as geo mip mapping for reducing the detail of triangle blocks which are far away. The code for the TerrainSceneNode is based on the terrain renderer by Soconne and the GeoMipMapSceneNode developed by Spintz. They made their code available for Irrlicht and allowed it to be distributed under this licence. I only modified some parts. A lot of thanks go to them.

This scene node is capable of loading terrains and updating the indices at runtime to enable viewing very large terrains very quickly. It uses a CLOD (Continuous Level of Detail) algorithm which updates the indices for each patch based on a LOD (Level of Detail) which is determined based on a patch's distance from the camera.

The patch size of the terrain must always be a size of 2^N+1, i.e. 8+1(9), 16+1(17), etc. The MaxLOD available is directly dependent on the patch size of the terrain. LOD 0 contains all of the indices to draw all the triangles at the max detail for a patch. As each LOD goes up by 1 the step taken, in generating indices increases by -2^LOD, so for LOD 1, the step taken is 2, for LOD 2, the step taken is 4, LOD 3 - 8, etc. The step can be no larger than the size of the patch, so having a LOD of 8, with a patch size of 17, is asking the algorithm to generate indices every 2^8 ( 256) vertices, which is not possible with a patch size of 17. The maximum LOD for a patch size of 17 is 2^4 (16). So, with a MaxLOD of 5, you'll have LOD 0 (full detail), LOD 1 ( every 2 vertices), LOD 2 (every 4 vertices), LOD 3 (every 8 vertices) and LOD 4 (every 16 vertices).

Parameters
heightMapFileNameThe name of the file on disk, to read vertex data from. This should be a gray scale bitmap.
parentParent of the scene node. Can be 0 if no parent.
idId of the node. This id can be used to identify the scene node.
positionThe absolute position of this node.
rotationThe absolute rotation of this node. (NOT YET IMPLEMENTED)
scaleThe scale factor for the terrain. If you're using a heightmap of size 129x129 and would like your terrain to be 12900x12900 in game units, then use a scale factor of ( core::vector (100.0f, 100.0f, 100.0f). If you use a Y scaling factor of 0.0f, then your terrain will be flat.
vertexColorThe default color of all the vertices. If no texture is associated with the scene node, then all vertices will be this color. Defaults to white.
maxLODThe maximum LOD (level of detail) for the node. Only change if you know what you are doing, this might lead to strange behavior.
patchSizepatch size of the terrain. Only change if you know what you are doing, this might lead to strange behavior.
smoothFactorThe number of times the vertices are smoothed.
addAlsoIfHeightmapEmptyAdd terrain node even with empty heightmap.
Returns
Pointer to the created scene node. Can be null if the terrain could not be created, for example because the heightmap could not be loaded. The returned pointer should not be dropped. See IReferenceCounted::drop() for more information. Adds a terrain scene node to the scene graph. Just like the other addTerrainSceneNode() method, but takes an IReadFile pointer as parameter for the heightmap. For more information take a look at the other function.
Parameters
heightMapFileThe file handle to read vertex data from. This should be a gray scale bitmap.
parentParent of the scene node. Can be 0 if no parent.
idId of the node. This id can be used to identify the scene node.
positionThe absolute position of this node.
rotationThe absolute rotation of this node. (NOT YET IMPLEMENTED)
scaleThe scale factor for the terrain. If you're using a heightmap of size 129x129 and would like your terrain to be 12900x12900 in game units, then use a scale factor of ( core::vector (100.0f, 100.0f, 100.0f). If you use a Y scaling factor of 0.0f, then your terrain will be flat.
vertexColorThe default color of all the vertices. If no texture is associated with the scene node, then all vertices will be this color. Defaults to white.
maxLODThe maximum LOD (level of detail) for the node. Only change if you know what you are doing, this might lead to strange behavior.
patchSizepatch size of the terrain. Only change if you know what you are doing, this might lead to strange behavior.
smoothFactorThe number of times the vertices are smoothed.
addAlsoIfHeightmapEmptyAdd terrain node even with empty heightmap.
Returns
Pointer to the created scene node. Can be null if the terrain could not be created, for example because the heightmap could not be loaded. The returned pointer should not be dropped. See IReferenceCounted::drop() for more information. Adds an empty scene node to the scene graph. Can be used for doing advanced transformations or structuring the scene graph.
Pointer to the created scene node. This pointer should not be dropped. See IReferenceCounted::drop() for more information. Adds a dummy transformation scene node to the scene graph. This scene node does not render itself, and does not respond to set/getPosition, set/getRotation and set/getScale. Its just a simple scene node that takes a matrix as relative transformation, making it possible to insert any transformation anywhere into the scene graph.
Pointer to the created scene node. This pointer should not be dropped. See IReferenceCounted::drop() for more information. Adds a text scene node, which is able to display 2d text at a position in three dimensional space Adds a text scene node, which uses billboards. The node, and the text on it, will scale with distance.
Parameters
fontThe font to use on the billboard. Pass 0 to use the GUI environment's default font.
textThe text to display on the billboard.
parentThe billboard's parent. Pass 0 to use the root scene node.
sizeThe billboard's width and height.
positionThe billboards position relative to its parent.
idAn id of the node. This id can be used to identify the node.
colorTopThe color of the vertices at the top of the billboard (default: white).
colorBottomThe color of the vertices at the bottom of the billboard (default: white).
Returns
Pointer to the billboard if successful, otherwise NULL. This pointer should not be dropped. See IReferenceCounted::drop() for more information. Adds a Hill Plane mesh to the mesh pool. The mesh is generated on the fly and looks like a plane with some hills on it. It is uses mostly for quick tests of the engine only. You can specify how many hills there should be on the plane and how high they should be. Also you must specify a name for the mesh, because the mesh is added to the mesh pool, and can be retrieved again using ISceneManager::getMesh() with the name as parameter.
Parameters
nameThe name of this mesh which must be specified in order to be able to retrieve the mesh later with ISceneManager::getMesh().
tileSizeSize of a tile of the mesh. (10.0f, 10.0f) would be a good value to start, for example.
tileCountSpecifies how much tiles there will be. If you specify for example that a tile has the size (10.0f, 10.0f) and the tileCount is (10,10), than you get a field of 100 tiles which has the dimension 100.0f x 100.0f.
materialMaterial of the hill mesh.
hillHeightHeight of the hills. If you specify a negative value you will get holes instead of hills. If the height is 0, no hills will be created.
countHillsAmount of hills on the plane. There will be countHills.X hills along the X axis and countHills.Y along the Y axis. So in total there will be countHills.X * countHills.Y hills.
textureRepeatCountDefines how often the texture will be repeated in x and y direction. return Null if the creation failed. The reason could be that you specified some invalid parameters or that a mesh with that name already exists. If successful, a pointer to the mesh is returned. This pointer should not be dropped. See IReferenceCounted::drop() for more information. Adds a static terrain mesh to the mesh pool. The mesh is generated on the fly from a texture file and a height map file. Both files may be huge (8000x8000 pixels would be no problem) because the generator splits the files into smaller textures if necessary. You must specify a name for the mesh, because the mesh is added to the mesh pool, and can be retrieved again using ISceneManager::getMesh() with the name as parameter.
meshnameThe name of this mesh which must be specified in order to be able to retrieve the mesh later with ISceneManager::getMesh().
textureTexture for the terrain. Please note that this is not a hardware texture as usual (ITexture), but an IImage software texture. You can load this texture with IVideoDriver::createImageFromFile().
heightmapA grayscaled heightmap image. Like the texture, it can be created with IVideoDriver::createImageFromFile(). The amount of triangles created depends on the size of this texture, so use a small heightmap to increase rendering speed.
stretchSizeParameter defining how big a is pixel on the heightmap.
maxHeightDefines how high a white pixel on the heightmap is.
defaultVertexBlockSizeDefines the initial dimension between vertices.
Returns
Null if the creation failed. The reason could be that you specified some invalid parameters, that a mesh with that name already exists, or that a texture could not be found. If successful, a pointer to the mesh is returned. This pointer should not be dropped. See IReferenceCounted::drop() for more information. add a static arrow mesh to the meshpool
Parameters
nameName of the mesh
vtxColorCylindercolor of the cylinder
vtxColorConecolor of the cone
tesselationCylinderNumber of quads the cylinder side consists of
tesselationConeNumber of triangles the cone's roof consists of
heightTotal height of the arrow
cylinderHeightTotal height of the cylinder, should be lesser than total height
widthCylinderDiameter of the cylinder
widthConeDiameter of the cone's base, should be not smaller than the cylinder's diameter
Returns
Pointer to the arrow mesh if successful, otherwise 0. This pointer should not be dropped. See IReferenceCounted::drop() for more information. add a static sphere mesh to the meshpool
Parameters
nameName of the mesh
radiusRadius of the sphere
polyCountXNumber of quads used for the horizontal tiling
polyCountYNumber of quads used for the vertical tiling
Returns
Pointer to the sphere mesh if successful, otherwise 0. This pointer should not be dropped. See IReferenceCounted::drop() for more information. Gets the root scene node. This is the scene node which is parent of all scene nodes. The root scene node is a special scene node which only exists to manage all scene nodes. It will not be rendered and cannot be removed from the scene.
Pointer to the root scene node. This pointer should not be dropped. See IReferenceCounted::drop() for more information.

◆ getTextureID()

virtual ID saga::scene::ISceneManager::getTextureID ( )
pure virtual

◆ getVideoDriver()

virtual const std::shared_ptr<video::IVideoDriver>& saga::scene::ISceneManager::getVideoDriver ( ) const
pure virtual

Get interface to the mesh cache which is shared between all existing scene managers.

With this interface, it is possible to manually add new loaded meshes (if ISceneManager::getMesh() is not sufficient), to remove them and to iterate through already loaded meshes. Get the video driver.

Returns
Pointer to the video Driver. This pointer should not be dropped. See IReferenceCounted::drop() for more information.

◆ isEmptyPass()

virtual bool saga::scene::ISceneManager::isEmptyPass ( video::RenderPassHandle  pass) const
pure virtual

◆ onEvent()

virtual void saga::scene::ISceneManager::onEvent ( const SDL_Event &  event)
inlineoverridevirtual

Called when an SDL event is fired.

Implements saga::IEventReceiver.

Definition at line 49 of file ISceneManager.h.

◆ registerNode()

virtual void saga::scene::ISceneManager::registerNode ( const std::shared_ptr< ISceneNode > &  node,
video::RenderPassHandle  pass 
)
pure virtual

◆ removeMesh() [1/2]

virtual void saga::scene::ISceneManager::removeMesh ( const ID  id)
pure virtual

◆ removeMesh() [2/2]

virtual void saga::scene::ISceneManager::removeMesh ( const std::shared_ptr< IMesh > &  mesh)
pure virtual

◆ removeNode() [1/2]

virtual void saga::scene::ISceneManager::removeNode ( const ID  id)
pure virtual

◆ removeNode() [2/2]

virtual void saga::scene::ISceneManager::removeNode ( const std::shared_ptr< ISceneNode > &  node)
pure virtual

◆ resetID()

virtual void saga::scene::ISceneManager::resetID ( )
pure virtual

◆ setActiveCamera()

virtual void saga::scene::ISceneManager::setActiveCamera ( const std::shared_ptr< ICameraSceneNode > &  camera)
pure virtual

Sets the currently active camera.

The previous active camera will be deactivated.

Parameters
cameraThe new camera which should be active.

◆ unregisterNode()

virtual void saga::scene::ISceneManager::unregisterNode ( const std::shared_ptr< ISceneNode > &  node,
video::RenderPassHandle  pass 
)
pure virtual

The documentation for this class was generated from the following file: