![]() |
Skylicht Engine
|
The Scene Manager manages scene nodes, mesh recources, cameras and all the other stuff. More...
#include <C:/Projects/skylicht-engine/Projects/Irrlicht/Include/ISceneManager.h>
Public Member Functions | |
| virtual video::IVideoDriver * | getVideoDriver ()=0 |
| Get the video driver. | |
| virtual gui::IGUIEnvironment * | getGUIEnvironment ()=0 |
| Get the active GUIEnvironment. | |
| virtual io::IFileSystem * | getFileSystem ()=0 |
| Get the active FileSystem. | |
| virtual ICameraSceneNode * | addCameraSceneNode (ISceneNode *parent=0, const core::vector3df &position=core::vector3df(0, 0, 0), const core::vector3df &lookat=core::vector3df(0, 0, 100), s32 id=-1, bool makeActive=true)=0 |
| Adds a camera scene node to the scene graph and sets it as active camera. | |
| virtual ISceneNode * | addEmptySceneNode (ISceneNode *parent=0, s32 id=-1)=0 |
| Adds an empty scene node to the scene graph. | |
| virtual ISceneNode * | getRootSceneNode ()=0 |
| Gets the root scene node. | |
| virtual ISceneNode * | getSceneNodeFromId (s32 id, ISceneNode *start=0)=0 |
| Get the first scene node with the specified id. | |
| virtual ISceneNode * | getSceneNodeFromName (const c8 *name, ISceneNode *start=0)=0 |
| Get the first scene node with the specified name. | |
| virtual ISceneNode * | getSceneNodeFromType (scene::ESCENE_NODE_TYPE type, ISceneNode *start=0)=0 |
| Get the first scene node with the specified type. | |
| virtual void | getSceneNodesFromType (ESCENE_NODE_TYPE type, core::array< scene::ISceneNode * > &outNodes, ISceneNode *start=0)=0 |
| Get scene nodes by type. | |
| virtual ICameraSceneNode * | getActiveCamera () const =0 |
| Get the current active camera. | |
| virtual void | setActiveCamera (ICameraSceneNode *camera)=0 |
| Sets the currently active camera. | |
| virtual void | setShadowColor (video::SColor color=video::SColor(150, 0, 0, 0))=0 |
| Sets the color of stencil buffers shadows drawn by the scene manager. | |
| virtual video::SColor | getShadowColor () const =0 |
| Get the current color of shadows. | |
| virtual u32 | registerNodeForRendering (ISceneNode *node, E_SCENE_NODE_RENDER_PASS pass=ESNRP_AUTOMATIC)=0 |
| Registers a node for rendering it at a specific time. | |
| virtual void | drawAll ()=0 |
| Draws all the scene nodes. | |
| virtual void | update ()=0 |
| virtual void | draw ()=0 |
| virtual void | draw (E_SCENE_NODE_RENDER_PASS renderPass)=0 |
| virtual ITriangleSelector * | createTriangleSelector (IMesh *mesh, ISceneNode *node)=0 |
| Creates a simple ITriangleSelector, based on a mesh. | |
| virtual ITriangleSelector * | createTriangleSelectorFromBoundingBox (ISceneNode *node)=0 |
| Creates a simple dynamic ITriangleSelector, based on a axis aligned bounding box. | |
| virtual ITriangleSelector * | createOctreeTriangleSelector (IMesh *mesh, ISceneNode *node, s32 minimalPolysPerNode=32)=0 |
| Creates a Triangle Selector, optimized by an octree. | |
| _IRR_DEPRECATED_ ITriangleSelector * | createOctTreeTriangleSelector (IMesh *mesh, ISceneNode *node, s32 minimalPolysPerNode=32) |
| //! Creates a Triangle Selector, optimized by an octree. | |
| virtual IMetaTriangleSelector * | createMetaTriangleSelector ()=0 |
| Creates a meta triangle selector. | |
| virtual ISceneCollisionManager * | getSceneCollisionManager ()=0 |
| Get pointer to the scene collision manager. | |
| virtual IMeshManipulator * | getMeshManipulator ()=0 |
| Returns a pointer to the mesh manipulator. | |
| virtual void | addToDeletionQueue (ISceneNode *node)=0 |
| Adds a scene node to the deletion queue. | |
| virtual bool | postEventFromUser (const SEvent &event)=0 |
| Posts an input event to the environment. | |
| virtual void | clear ()=0 |
| Clears the whole scene. | |
| virtual io::IAttributes * | getParameters ()=0 |
| Get interface to the parameters set in this scene. | |
| virtual E_SCENE_NODE_RENDER_PASS | getSceneNodeRenderPass () const =0 |
| Get current render pass. | |
| virtual ISceneManager * | createNewSceneManager (bool cloneContent=false)=0 |
| Creates a new scene manager. | |
| virtual void | setAmbientLight (const video::SColorf &ambientColor)=0 |
| Sets ambient color of the scene. | |
| virtual const video::SColorf & | getAmbientLight () const =0 |
| Get ambient color of the scene. | |
| virtual const IGeometryCreator * | getGeometryCreator (void) const =0 |
| Get an instance of a geometry creator. | |
| virtual bool | isCulled (const ISceneNode *node) const =0 |
| Check if node is culled in current view frustum. | |
| Public Member Functions inherited from irr::IReferenceCounted | |
| IReferenceCounted () | |
| Constructor. | |
| virtual | ~IReferenceCounted () |
| Destructor. | |
| void | grab () const |
| Grabs the object. Increments the reference counter by one. | |
| bool | drop () const |
| Drops the object. Decrements the reference counter by one. | |
| s32 | getReferenceCount () const |
| Get the reference count. | |
| const c8 * | getDebugName () const |
| Returns the debug name of the object. | |
Additional Inherited Members | |
| Protected Member Functions inherited from irr::IReferenceCounted | |
| void | setDebugName (const c8 *newName) |
| Sets the debug name of the object. | |
The Scene Manager manages scene nodes, mesh recources, cameras and all the other stuff.
All Scene nodes can be created only here. There is a always growing list of scene nodes for lots of purposes: Indoor rendering scene nodes like the Octree (addOctreeSceneNode()) or the terrain renderer (addTerrainSceneNode()), different Camera scene nodes (addCameraSceneNode(), addCameraSceneNodeMaya()), scene nodes for Light (addLightSceneNode()), Billboards (addBillboardSceneNode()) and so on. A scene node is a node in the hierachical scene graph. Every scene node may have children, which are other scene nodes. Children move relative the their parents position. If the parent of a node is not visible, its children won't be visible, too. In this way, it is for example easily possible to attach a light to a moving car or to place a walking character on a moving platform on a moving ship. The SceneManager is also able to load 3d mesh files of different formats. Take a look at getMesh() to find out what formats are supported. If these formats are not enough, use addExternalMeshLoader() to add new formats to the engine.
|
pure virtual |
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.
| position | Position of the space relative to its parent where the camera will be placed. |
| lookat | Position where the camera will look at. Also known as target. |
| parent | Parent scene node of the camera. Can be null. If the parent moves, the camera will move too. |
| id | id of the camera. This id can be used to identify the camera. |
| makeActive | Flag whether this camera should become the active one. Make sure you always have one active camera. |
|
pure virtual |
Adds an empty scene node to the scene graph.
Can be used for doing advanced transformations or structuring the scene graph.
|
pure virtual |
Adds a scene node to the deletion queue.
The scene node is immediatly 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.
| node | Node to detete. |
|
pure virtual |
Clears the whole scene.
All scene nodes are removed.
|
pure virtual |
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.
|
pure virtual |
Creates a new scene manager.
This can be used to easily draw and/or store two independent scenes at the same time. The mesh cache will be shared between all existing scene managers, which means if you load a mesh in the original scene manager using for example getMesh(), the mesh will be available in all other scene managers too, without loading. The original/main scene manager will still be there and accessible via IrrlichtDevice::getSceneManager(). If you need input event in this new scene manager, for example for FPS cameras, you'll need to forward input to this manually: Just implement an IEventReceiver and call yourNewSceneManager->postEventFromUser(), and return true so that the original scene manager doesn't get the event. Otherwise, all input will go to the main scene manager automatically. If you no longer need the new scene manager, you should call ISceneManager::drop(). See IReferenceCounted::drop() for more information.
|
pure virtual |
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 automaticly 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:
For more informations and examples on this, take a look at the collision tutorial in the SDK.
| mesh | Mesh of which the triangles are taken. |
| node | Scene node of which visibility and transformation is used. |
| minimalPolysPerNode | Specifies the minimal polygons contained a octree node. If a node gets less polys the this value, it will not be splitted into smaller nodes. |
|
inline |
//! Creates a Triangle Selector, optimized by an octree.
|
pure virtual |
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 automaticly 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:
| mesh | Mesh of which the triangles are taken. |
| node | Scene node of which visibility and transformation is used. |
|
pure virtual |
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.
| node | Scene node of which the bounding box, visibility and transformation is used. |
|
pure virtual |
Draws all the scene nodes.
This can only be invoked between IVideoDriver::beginScene() and IVideoDriver::endScene(). Please note that the scene is not only drawn when calling this, but also animated by existing scene node animators, culling of scene nodes is done, etc.
|
pure virtual |
Get the current active camera.
|
pure virtual |
Get the active FileSystem.
|
pure virtual |
Get an instance of a geometry creator.
The geometry creator provides some helper methods to create various types of basic geometry. This can be useful for custom scene nodes.
|
pure virtual |
Get the active GUIEnvironment.
|
pure virtual |
Get interface to the parameters set in this scene.
String parameters can be used by plugins and mesh loaders. For example the CMS and LMTS loader want a parameter named 'CSM_TexturePath' and 'LMTS_TexturePath' set to the path were attached textures can be found. See CSM_TEXTURE_PATH, LMTS_TEXTURE_PATH, MY3D_TEXTURE_PATH, COLLADA_CREATE_SCENE_INSTANCES, DMF_TEXTURE_PATH and DMF_USE_MATERIALS_DIRS
|
pure virtual |
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.
|
pure virtual |
Get pointer to the scene collision manager.
|
pure virtual |
Get the first scene node with the specified id.
| id | The id to search for |
| start | Scene node to start from. All children of this scene node are searched. If null is specified, the root scene node is taken. |
|
pure virtual |
Get the first scene node with the specified name.
| name | The name to search for |
| start | Scene node to start from. All children of this scene node are searched. If null is specified, the root scene node is taken. |
|
pure virtual |
Get the first scene node with the specified type.
| type | The type to search for |
| start | Scene node to start from. All children of this scene node are searched. If null is specified, the root scene node is taken. |
|
pure virtual |
Get current render pass.
All scene nodes are being rendered in a specific order. First lights, cameras, sky boxes, solid geometry, and then transparent stuff. During the rendering process, scene nodes may want to know what the scene manager is rendering currently, because for example they registered for rendering twice, once for transparent geometry and once for solid. When knowing what rendering pass currently is active they can render the correct part of their geometry.
|
pure virtual |
Get scene nodes by type.
| type | Type of scene node to find (ESNT_ANY will return all child nodes). |
| outNodes | array to be filled with results. |
| start | Scene node to start from. All children of this scene node are searched. If null is specified, the root scene node is taken. |
|
pure virtual |
Get the video driver.
|
pure virtual |
Check if node is culled in current view frustum.
Please note that depending on the used culling method this check can be rather coarse, or slow. A positive result is correct, though, i.e. if this method returns true the node is positively not visible. The node might still be invisible even if this method returns false.
| node | The scene node which is checked for culling. |
|
pure virtual |
Posts an input event to the environment.
Usually you do not have to use this method, it is used by the internal engine.
|
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() call.
| node | Node to register for drawing. Usually scene nodes would set 'this' as parameter here because they want to be drawn. |
| pass | Specifies 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 ESNRP_SHADOW for this. See scene::E_SCENE_NODE_RENDER_PASS for details. |
|
pure virtual |
Sets the currently active camera.
The previous active camera will be deactivated.
| camera | The new camera which should be active. |