|
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< ISceneNode > | 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))=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 SceneNodeList & | getNodeList (const video::RenderPassHandle pass)=0 |
|
virtual PassSceneNodeList & | getNodeList ()=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...
|
|
virtual | ~IEventReceiver () |
| Destructor. More...
|
|
Definition at line 38 of file ISceneManager.h.
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
-
parent | Parent scene node of the light. Can be null. If the parent moves, the light will move too. |
position | Position of the space relative to its parent where the light will be placed. |
color | Diffuse color of the light. Ambient or Specular colors can be set manually with the ILightSceneNode::getLightData() method. |
radius | Radius of the light. |
id | id 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
-
parent | Parent scene node of the billboard. Can be null. If the parent moves, the billboard will move too. |
size | Size of the billboard. This size is 2 dimensional because a billboard only has width and height. |
position | Position of the space relative to its parent where the billboard will be placed. |
id | An id of the node. This id can be used to identify the node. |
colorTop | The color of the vertices at the top of the billboard (default: white). |
colorBottom | The 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
-
top | Texture for the top plane of the box. |
bottom | Texture for the bottom plane of the box. |
left | Texture for the left plane of the box. |
right | Texture for the right plane of the box. |
front | Texture for the front plane of the box. |
back | Texture for the back plane of the box. |
parent | Parent 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. |
id | An 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
-
texture | Texture for the dome. |
horiRes | Number of vertices of a horizontal layer of the sphere. |
vertRes | Number of vertices of a vertical layer of the sphere. |
texturePercentage | How much of the height of the texture is used. Should be between 0 and 1. |
spherePercentage | How 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. |
radius | The Radius of the sphere |
parent | Parent 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. |
id | An 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
-
withDefaultEmitter | Creates 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(). |
parent | Parent of the scene node. Can be NULL if no parent. |
id | Id of the node. This id can be used to identify the scene node. |
position | Position of the space relative to its parent where the scene node will be placed. |
rotation | Initial rotation of the scene node. |
scale | Initial 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
-
heightMapFileName | The name of the file on disk, to read vertex data from. This should be a gray scale bitmap. |
parent | Parent of the scene node. Can be 0 if no parent. |
id | Id of the node. This id can be used to identify the scene node. |
position | The absolute position of this node. |
rotation | The absolute rotation of this node. (NOT YET IMPLEMENTED) |
scale | The 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. |
vertexColor | The 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. |
maxLOD | The maximum LOD (level of detail) for the node. Only change if you know what you are doing, this might lead to strange behavior. |
patchSize | patch size of the terrain. Only change if you know what you are doing, this might lead to strange behavior. |
smoothFactor | The number of times the vertices are smoothed. |
addAlsoIfHeightmapEmpty | Add 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
-
heightMapFile | The file handle to read vertex data from. This should be a gray scale bitmap. |
parent | Parent of the scene node. Can be 0 if no parent. |
id | Id of the node. This id can be used to identify the scene node. |
position | The absolute position of this node. |
rotation | The absolute rotation of this node. (NOT YET IMPLEMENTED) |
scale | The 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. |
vertexColor | The 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. |
maxLOD | The maximum LOD (level of detail) for the node. Only change if you know what you are doing, this might lead to strange behavior. |
patchSize | patch size of the terrain. Only change if you know what you are doing, this might lead to strange behavior. |
smoothFactor | The number of times the vertices are smoothed. |
addAlsoIfHeightmapEmpty | Add 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
-
font | The font to use on the billboard. Pass 0 to use the GUI environment's default font. |
text | The text to display on the billboard. |
parent | The billboard's parent. Pass 0 to use the root scene node. |
size | The billboard's width and height. |
position | The billboards position relative to its parent. |
id | An id of the node. This id can be used to identify the node. |
colorTop | The color of the vertices at the top of the billboard (default: white). |
colorBottom | The 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
-
name | The name of this mesh which must be specified in order to be able to retrieve the mesh later with ISceneManager::getMesh(). |
tileSize | Size of a tile of the mesh. (10.0f, 10.0f) would be a good value to start, for example. |
tileCount | Specifies 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. |
material | Material of the hill mesh. |
hillHeight | Height 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. |
countHills | Amount 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. |
textureRepeatCount | Defines 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. |
meshname | The name of this mesh which must be specified in order to be able to retrieve the mesh later with ISceneManager::getMesh(). |
texture | Texture 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(). |
heightmap | A 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. |
stretchSize | Parameter defining how big a is pixel on the heightmap. |
maxHeight | Defines how high a white pixel on the heightmap is. |
defaultVertexBlockSize | Defines 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
-
name | Name of the mesh |
vtxColorCylinder | color of the cylinder |
vtxColorCone | color of the cone |
tesselationCylinder | Number of quads the cylinder side consists of |
tesselationCone | Number of triangles the cone's roof consists of |
height | Total height of the arrow |
cylinderHeight | Total height of the cylinder, should be lesser than total height |
widthCylinder | Diameter of the cylinder |
widthCone | Diameter 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
-
name | Name of the mesh |
radius | Radius of the sphere |
polyCountX | Number of quads used for the horizontal tiling |
polyCountY | Number 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.