// Copyright (C) 2002-2012 Nikolaus Gebhardt
// This file is part of the "Irrlicht Engine".
// For conditions of distribution and use, see copyright notice in irrlicht.h
#ifndef IRR_I_SCENE_MANAGER_H_INCLUDED
#define IRR_I_SCENE_MANAGER_H_INCLUDED
#include "IReferenceCounted.h"
#include "irrArray.h"
#include "irrString.h"
#include "path.h"
#include "vector3d.h"
#include "dimension2d.h"
#include "SColor.h"
#include "ETerrainElements.h"
#include "ESceneNodeTypes.h"
#include "ESceneNodeAnimatorTypes.h"
#include "EMeshWriterEnums.h"
#include "SceneParameters.h"
#include "IGeometryCreator.h"
#include "ISkinnedMesh.h"
#include "IXMLWriter.h"
namespace irr
{
struct SKeyMap;
struct SEvent;
namespace io
{
class IReadFile;
class IAttributes;
class IWriteFile;
class IFileSystem;
} // end namespace io
namespace gui
{
class IGUIFont;
class IGUIEnvironment;
} // end namespace gui
namespace video
{
class IVideoDriver;
class SMaterial;
class IImage;
class ITexture;
} // end namespace video
namespace scene
{
//! Enumeration for render passes.
/** A parameter passed to the registerNodeForRendering() method of the ISceneManager,
specifying when the node wants to be drawn in relation to the other nodes.
Note: Despite the numbering this is not used as bit-field.
*/
enum E_SCENE_NODE_RENDER_PASS
{
//! No pass currently active
ESNRP_NONE =0,
//! Camera pass. The active view is set up here. The very first pass.
ESNRP_CAMERA =1,
//! In this pass, lights are transformed into camera space and added to the driver
ESNRP_LIGHT =2,
//! This is used for sky boxes.
ESNRP_SKY_BOX =4,
//! All normal objects can use this for registering themselves.
/** This value will never be returned by
ISceneManager::getSceneNodeRenderPass(). The scene manager
will determine by itself if an object is transparent or solid
and register the object as ESNRT_TRANSPARENT or ESNRP_SOLID
automatically if you call registerNodeForRendering with this
value (which is default). Note that it will register the node
only as ONE type. If your scene node has both solid and
transparent material types register it twice (one time as
ESNRP_SOLID, the other time as ESNRT_TRANSPARENT) and in the
render() method call getSceneNodeRenderPass() to find out the
current render pass and render only the corresponding parts of
the node. */
ESNRP_AUTOMATIC =24,
//! Solid scene nodes or special scene nodes without materials.
ESNRP_SOLID =8,
//! Transparent scene nodes, drawn after solid nodes. They are sorted from back to front and drawn in that order.
ESNRP_TRANSPARENT =16,
//! Transparent effect scene nodes, drawn after Transparent nodes. They are sorted from back to front and drawn in that order.
ESNRP_TRANSPARENT_EFFECT =32,
//! Drawn after the solid nodes, before the transparent nodes, the time for drawing shadow volumes
ESNRP_SHADOW =64,
//! Drawn after transparent effect nodes. For custom gui's. Unsorted (in order nodes registered themselves).
ESNRP_GUI = 128
};
class IAnimatedMesh;
class IAnimatedMeshSceneNode;
class IBillboardSceneNode;
class IBillboardTextSceneNode;
class ICameraSceneNode;
class IDummyTransformationSceneNode;
class ILightManager;
class ILightSceneNode;
class IMesh;
class IMeshBuffer;
class IMeshCache;
class IMeshLoader;
class IMeshManipulator;
class IMeshSceneNode;
class IMeshWriter;
class IMetaTriangleSelector;
class IOctreeSceneNode;
class IParticleSystemSceneNode;
class ISceneCollisionManager;
class ISceneLoader;
class ISceneNode;
class ISceneNodeAnimator;
class ISceneNodeAnimatorCollisionResponse;
class ISceneNodeAnimatorFactory;
class ISceneNodeFactory;
class ISceneUserDataSerializer;
class IShadowVolumeSceneNode;
class ITerrainSceneNode;
class ITextSceneNode;
class ITriangleSelector;
class IVolumeLightSceneNode;
namespace quake3
{
struct IShader;
} // end namespace quake3
//! The Scene Manager manages scene nodes, mesh resources, 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 hierarchical 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.
*/
class ISceneManager : public virtual IReferenceCounted
{
public:
//! Get pointer to an animateable mesh. Loads the file if not loaded already.
/**
* If you want to remove a loaded mesh from the cache again, use removeMesh().
* Currently there are the following mesh formats supported:
*
*
* Format |
* Description |
*
*
* 3D Studio (.3ds) |
* Loader for 3D-Studio files which lots of 3D packages
* are able to export. Only static meshes are currently
* supported by this importer. |
*
*
* 3D World Studio (.smf) |
* Loader for Leadwerks SMF mesh files, a simple mesh format
* containing static geometry for games. The proprietary .STF texture format
* is not supported yet. This loader was originally written by Joseph Ellis. |
*
*
* Bliz Basic B3D (.b3d) |
* Loader for blitz basic files, developed by Mark
* Sibly. This is the ideal animated mesh format for game
* characters as it is both rigidly defined and widely
* supported by modeling and animation software.
* As this format supports skeletal animations, an
* ISkinnedMesh will be returned by this importer. |
*
*
* Cartography shop 4 (.csm) |
* Cartography Shop is a modeling program for creating
* architecture and calculating lighting. Irrlicht can
* directly import .csm files thanks to the IrrCSM library
* created by Saurav Mohapatra which is now integrated
* directly in Irrlicht.
* |
*
* COLLADA (.dae, .xml) |
* COLLADA is an open Digital Asset Exchange Schema for
* the interactive 3D industry. There are exporters and
* importers for this format available for most of the
* big 3d packagesat http://collada.org. Irrlicht can
* import COLLADA files by using the
* ISceneManager::getMesh() method. COLLADA files need
* not contain only one single mesh but multiple meshes
* and a whole scene setup with lights, cameras and mesh
* instances, this loader can set up a scene as
* described by the COLLADA file instead of loading and
* returning one single mesh. By default, this loader
* behaves like the other loaders and does not create
* instances, but it can be switched into this mode by
* using
* SceneManager->getParameters()->setAttribute(COLLADA_CREATE_SCENE_INSTANCES, true);
* Created scene nodes will be named as the names of the
* nodes in the COLLADA file. The returned mesh is just
* a dummy object in this mode. Meshes included in the
* scene will be added into the scene manager with the
* following naming scheme:
* "path/to/file/file.dea#meshname". The loading of such
* meshes is logged. Currently, this loader is able to
* create meshes (made of only polygons), lights, and
* cameras. Materials and animations are currently not
* supported but this will change with future releases.
* |
*
*
* Delgine DeleD (.dmf) |
* DeleD (delgine.com) is a 3D editor and level-editor
* combined into one and is specifically designed for 3D
* game-development. With this loader, it is possible to
* directly load all geometry is as well as textures and
* lightmaps from .dmf files. To set texture and
* material paths, see scene::DMF_USE_MATERIALS_DIRS.
* It is also possible to flip the alpha texture by setting
* scene::DMF_FLIP_ALPHA_TEXTURES to true and to set the
* material transparent reference value by setting
* scene::DMF_ALPHA_CHANNEL_REF to a float between 0 and
* 1. The loader is based on Salvatore Russo's .dmf
* loader, I just changed some parts of it. Thanks to
* Salvatore for his work and for allowing me to use his
* code in Irrlicht and put it under Irrlicht's license.
* For newer and more enhanced versions of the loader,
* take a look at delgine.com.
* |
*
*
* DirectX (.x) |
* Platform independent importer (so not D3D-only) for
* .x files. Most 3D packages can export these natively
* and there are several tools for them available, e.g.
* the Maya exporter included in the DX SDK.
* .x files can include skeletal animations and Irrlicht
* is able to play and display them, users can manipulate
* the joints via the ISkinnedMesh interface. Currently,
* Irrlicht only supports uncompressed .x files. |
*
*
* Half-Life model (.mdl) |
* This loader opens Half-life 1 models, it was contributed
* by Fabio Concas and adapted by Thomas Alten. |
*
*
* Irrlicht Mesh (.irrMesh) |
* This is a static mesh format written in XML, native
* to Irrlicht and written by the irr mesh writer.
* This format is exported by the CopperCube engine's
* lightmapper. |
*
*
* LightWave (.lwo) |
* Native to NewTek's LightWave 3D, the LWO format is well
* known and supported by many exporters. This loader will
* import LWO2 models including lightmaps, bumpmaps and
* reflection textures. |
*
*
* Maya (.obj) |
* Most 3D software can create .obj files which contain
* static geometry without material data. The material
* files .mtl are also supported. This importer for
* Irrlicht can load them directly. |
*
*
* Milkshape (.ms3d) |
* .MS3D files contain models and sometimes skeletal
* animations from the Milkshape 3D modeling and animation
* software. Like the other skeletal mesh loaders, joints
* are exposed via the ISkinnedMesh animated mesh type. |
*
*
* My3D (.my3d) |
* .my3D is a flexible 3D file format. The My3DTools
* contains plug-ins to export .my3D files from several
* 3D packages. With this built-in importer, Irrlicht
* can read and display those files directly. This
* loader was written by Zhuck Dimitry who also created
* the whole My3DTools package.
* |
*
*
* OCT (.oct) |
* The oct file format contains 3D geometry and
* lightmaps and can be loaded directly by Irrlicht. OCT
* files can be created by FSRad, Paul Nette's
* radiosity processor or exported from Blender using
* OCTTools which can be found in the exporters/OCTTools
* directory of the SDK. Thanks to Murphy McCauley for
* creating all this. |
*
*
* OGRE Meshes (.mesh) |
* Ogre .mesh files contain 3D data for the OGRE 3D
* engine. Irrlicht can read and display them directly
* with this importer. To define materials for the mesh,
* copy a .material file named like the corresponding
* .mesh file where the .mesh file is. (For example
* ogrehead.material for ogrehead.mesh). Thanks to
* Christian Stehno who wrote and contributed this
* loader. |
*
*
* Pulsar LMTools (.lmts) |
* LMTools is a set of tools (Windows & Linux) for
* creating lightmaps. Irrlicht can directly read .lmts
* files thanks to the importer created by Jonas
* Petersen.
* Notes for this version of the loader:
* - It does not recognize/support user data in the
* *.lmts files.
* - The TGAs generated by LMTools don't work in
* Irrlicht for some reason (the textures are upside
* down). Opening and resaving them in a graphics app
* will solve the problem. |
*
*
* Quake 3 levels (.bsp) |
* Quake 3 is a popular game by IDSoftware, and .pk3
* files contain .bsp files and textures/lightmaps
* describing huge prelighted levels. Irrlicht can read
* .pk3 and .bsp files directly and thus render Quake 3
* levels directly. Written by Nikolaus Gebhardt
* enhanced by Dean P. Macri with the curved surfaces
* feature. |
*
*
* Quake 2 models (.md2) |
* Quake 2 models are characters with morph target
* animation. Irrlicht can read, display and animate
* them directly with this importer. |
*
*
* Quake 3 models (.md3) |
* Quake 3 models are characters with morph target
* animation, they contain mount points for weapons and body
* parts and are typically made of several sections which are
* manually joined together. |
*
*
* Stanford Triangle (.ply) |
* Invented by Stanford University and known as the native
* format of the infamous "Stanford Bunny" model, this is a
* popular static mesh format used by 3D scanning hardware
* and software. This loader supports extremely large models
* in both ASCII and binary format, but only has rudimentary
* material support in the form of vertex colors and texture
* coordinates. |
*
*
* Stereolithography (.stl) |
* The STL format is used for rapid prototyping and
* computer-aided manufacturing, thus has no support for
* materials. |
*
*
*
* To load and display a mesh quickly, just do this:
* \code
* SceneManager->addAnimatedMeshSceneNode(
* SceneManager->getMesh("yourmesh.3ds"));
* \endcode
* If you would like to implement and add your own file format loader to Irrlicht,
* see addExternalMeshLoader().
* \param filename: Filename of the mesh to load.
* \param alternativeCacheName: In case you want to have the mesh under another name in the cache (to create real copies)
* \return Null if failed, otherwise pointer to the mesh.
* This pointer should not be dropped. See IReferenceCounted::drop() for more information.
**/
virtual IAnimatedMesh* getMesh(const io::path& filename, const io::path& alternativeCacheName=io::path("")) = 0;
//! Get pointer to an animateable mesh. Loads the file if not loaded already.
/** Works just as getMesh(const char* filename). If you want to
remove a loaded mesh from the cache again, use removeMesh().
\param file File handle of the mesh to load.
\return NULL if failed and pointer to the mesh if successful.
This pointer should not be dropped. See
IReferenceCounted::drop() for more information. */
virtual IAnimatedMesh* getMesh(io::IReadFile* file) = 0;
//! 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. */
virtual IMeshCache* getMeshCache() = 0;
//! Get the video driver.
/** \return Pointer to the video Driver.
This pointer should not be dropped. See IReferenceCounted::drop() for more information. */
virtual video::IVideoDriver* getVideoDriver() = 0;
//! Get the active GUIEnvironment
/** \return Pointer to the GUIEnvironment
This pointer should not be dropped. See IReferenceCounted::drop() for more information. */
virtual gui::IGUIEnvironment* getGUIEnvironment() = 0;
//! Get the active FileSystem
/** \return Pointer to the FileSystem
This pointer should not be dropped. See IReferenceCounted::drop() for more information. */
virtual io::IFileSystem* getFileSystem() = 0;
//! adds Volume Lighting Scene Node.
/** Example Usage:
scene::IVolumeLightSceneNode * n = smgr->addVolumeLightSceneNode(0, -1,
32, 32, //Subdivide U/V
video::SColor(0, 180, 180, 180), //foot color
video::SColor(0, 0, 0, 0) //tail color
);
if (n)
{
n->setScale(core::vector3df(46.0f, 45.0f, 46.0f));
n->getMaterial(0).setTexture(0, smgr->getVideoDriver()->getTexture("lightFalloff.png"));
}
\return Pointer to the volumeLight if successful, otherwise NULL.
This pointer should not be dropped. See IReferenceCounted::drop() for more information. */
virtual IVolumeLightSceneNode* addVolumeLightSceneNode(ISceneNode* parent=0, s32 id=-1,
const u32 subdivU = 32, const u32 subdivV = 32,
const video::SColor foot = video::SColor(51, 0, 230, 180),
const video::SColor tail = video::SColor(0, 0, 0, 0),
const core::vector3df& position = core::vector3df(0,0,0),
const core::vector3df& rotation = core::vector3df(0,0,0),
const core::vector3df& scale = core::vector3df(1.0f, 1.0f, 1.0f)) = 0;
//! Adds a cube scene node
/** \param size: Size of the cube, uniformly in each dimension.
\param parent: Parent of the scene node. Can be 0 if no parent.
\param id: Id of the node. This id can be used to identify the scene node.
\param position: Position of the space relative to its parent
where the scene node will be placed.
\param rotation: Initial rotation of the scene node.
\param scale: Initial scale of the scene node.
\return Pointer to the created test scene node. This
pointer should not be dropped. See IReferenceCounted::drop()
for more information. */
virtual IMeshSceneNode* addCubeSceneNode(f32 size=10.0f, ISceneNode* parent=0, s32 id=-1,
const core::vector3df& position = core::vector3df(0,0,0),
const core::vector3df& rotation = core::vector3df(0,0,0),
const core::vector3df& scale = core::vector3df(1.0f, 1.0f, 1.0f)) = 0;
//! Adds a sphere scene node of the given radius and detail
/** \param radius: Radius of the sphere.
\param polyCount: The 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.
\param parent: Parent of the scene node. Can be 0 if no parent.
\param id: Id of the node. This id can be used to identify the scene node.
\param position: Position of the space relative to its parent
where the scene node will be placed.
\param rotation: Initial rotation of the scene node.
\param scale: Initial scale of the scene node.
\return Pointer to the created test scene node. This
pointer should not be dropped. See IReferenceCounted::drop()
for more information. */
virtual IMeshSceneNode* addSphereSceneNode(f32 radius=5.0f, s32 polyCount=16,
ISceneNode* parent=0, s32 id=-1,
const core::vector3df& position = core::vector3df(0,0,0),
const core::vector3df& rotation = core::vector3df(0,0,0),
const core::vector3df& scale = core::vector3df(1.0f, 1.0f, 1.0f)) = 0;
//! Adds a scene node for rendering an animated mesh model.
/** \param mesh: Pointer to the loaded animated mesh to be displayed.
\param parent: Parent of the scene node. Can be NULL if no parent.
\param id: Id of the node. This id can be used to identify the scene node.
\param position: Position of the space relative to its parent where the
scene node will be placed.
\param rotation: Initial rotation of the scene node.
\param scale: Initial scale of the scene node.
\param alsoAddIfMeshPointerZero: Add the scene node even if a 0 pointer is passed.
\return Pointer to the created scene node.
This pointer should not be dropped. See IReferenceCounted::drop() for more information. */
virtual IAnimatedMeshSceneNode* addAnimatedMeshSceneNode(IAnimatedMesh* mesh,
ISceneNode* parent=0, s32 id=-1,
const core::vector3df& position = core::vector3df(0,0,0),
const core::vector3df& rotation = core::vector3df(0,0,0),
const core::vector3df& scale = core::vector3df(1.0f, 1.0f, 1.0f),
bool alsoAddIfMeshPointerZero=false) = 0;
//! Adds a scene node for rendering a static mesh.
/** \param mesh: Pointer to the loaded static mesh to be displayed.
\param parent: Parent of the scene node. Can be NULL if no parent.
\param id: Id of the node. This id can be used to identify the scene node.
\param position: Position of the space relative to its parent where the
scene node will be placed.
\param rotation: Initial rotation of the scene node.
\param scale: Initial scale of the scene node.
\param alsoAddIfMeshPointerZero: Add the scene node even if a 0 pointer is passed.
\return Pointer to the created scene node.
This pointer should not be dropped. See IReferenceCounted::drop() for more information. */
virtual IMeshSceneNode* addMeshSceneNode(IMesh* mesh, ISceneNode* parent=0, s32 id=-1,
const core::vector3df& position = core::vector3df(0,0,0),
const core::vector3df& rotation = core::vector3df(0,0,0),
const core::vector3df& scale = core::vector3df(1.0f, 1.0f, 1.0f),
bool alsoAddIfMeshPointerZero=false) = 0;
//! Adds a scene node for rendering a animated water surface mesh.
/** Looks really good when the Material type EMT_TRANSPARENT_REFLECTION
is used.
\param waveHeight: Height of the water waves.
\param waveSpeed: Speed of the water waves.
\param waveLength: Length of a water wave.
\param mesh: Pointer to the loaded static mesh to be displayed with water waves on it.
\param parent: Parent of the scene node. Can be NULL if no parent.
\param id: Id of the node. This id can be used to identify the scene node.
\param position: Position of the space relative to its parent where the
scene node will be placed.
\param rotation: Initial rotation of the scene node.
\param scale: Initial scale of the scene node.
\return Pointer to the created scene node.
This pointer should not be dropped. See IReferenceCounted::drop() for more information. */
virtual ISceneNode* addWaterSurfaceSceneNode(IMesh* mesh,
f32 waveHeight=2.0f, f32 waveSpeed=300.0f, f32 waveLength=10.0f,
ISceneNode* parent=0, s32 id=-1,
const core::vector3df& position = core::vector3df(0,0,0),
const core::vector3df& rotation = core::vector3df(0,0,0),
const core::vector3df& scale = core::vector3df(1.0f, 1.0f, 1.0f)) = 0;
//! 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.
\param mesh: The 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.
\param parent: Parent node of the octree node.
\param id: id of the node. This id can be used to identify the node.
\param minimalPolysPerNode: Specifies the minimal polygons contained a octree node.
If a node gets less polys than this value it will not be split into
smaller nodes.
\param alsoAddIfMeshPointerZero: Add the scene node even if a 0 pointer is passed.
\return Pointer to the octree if successful, otherwise 0.
This pointer should not be dropped. See IReferenceCounted::drop() for more information. */
virtual IOctreeSceneNode* addOctreeSceneNode(IAnimatedMesh* mesh, ISceneNode* parent=0,
s32 id=-1, s32 minimalPolysPerNode=512, bool alsoAddIfMeshPointerZero=false) = 0;
//! 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.
\param mesh: The mesh containing all geometry from which the octree will be build.
\param parent: Parent node of the octree node.
\param id: id of the node. This id can be used to identify the node.
\param minimalPolysPerNode: Specifies the minimal polygons contained a octree node.
If a node gets less polys than this value it will not be split into
smaller nodes.
\param alsoAddIfMeshPointerZero: Add the scene node even if a 0 pointer is passed.
\return Pointer to the octree if successful, otherwise 0.
This pointer should not be dropped. See IReferenceCounted::drop() for more information. */
virtual IOctreeSceneNode* addOctreeSceneNode(IMesh* mesh, ISceneNode* parent=0,
s32 id=-1, s32 minimalPolysPerNode=256, bool alsoAddIfMeshPointerZero=false) = 0;
//! 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.
\param position: Position of the space relative to its parent where the camera will be placed.
\param lookat: Position where the camera will look at. Also known as target.
\param parent: Parent scene node of the camera. Can be null. If the parent moves,
the camera will move too.
\param id: id of the camera. This id can be used to identify the camera.
\param makeActive Flag whether this camera should become the active one.
Make sure you always have one active camera.
\return Pointer to interface to camera if successful, otherwise 0.
This pointer should not be dropped. See IReferenceCounted::drop() for more information. */
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 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.
\param parent: Parent scene node of the camera. Can be null.
\param rotateSpeed: Rotation speed of the camera.
\param zoomSpeed: Zoom speed of the camera.
\param translationSpeed: TranslationSpeed of the camera.
\param id: id of the camera. This id can be used to identify the camera.
\param distance Initial distance of the camera from the object
\param makeActive Flag whether this camera should become the active one.
Make sure you always have one active camera.
\return 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. */
virtual ICameraSceneNode* addCameraSceneNodeMaya(ISceneNode* parent=0,
f32 rotateSpeed=-1500.f, f32 zoomSpeed=200.f,
f32 translationSpeed=1500.f, s32 id=-1, f32 distance=70.f,
bool makeActive=true) =0;
//! 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
ICameraSceneNode::bindTargetAndRotation(). With this camera,
you look with the mouse, and move with cursor keys. If you want
to change the key layout, you can specify your own keymap. For
example to make the camera be controlled by the cursor keys AND
the keys W,A,S, and D, do something like this:
\code
SKeyMap keyMap[8];
keyMap[0].Action = EKA_MOVE_FORWARD;
keyMap[0].KeyCode = KEY_UP;
keyMap[1].Action = EKA_MOVE_FORWARD;
keyMap[1].KeyCode = KEY_KEY_W;
keyMap[2].Action = EKA_MOVE_BACKWARD;
keyMap[2].KeyCode = KEY_DOWN;
keyMap[3].Action = EKA_MOVE_BACKWARD;
keyMap[3].KeyCode = KEY_KEY_S;
keyMap[4].Action = EKA_STRAFE_LEFT;
keyMap[4].KeyCode = KEY_LEFT;
keyMap[5].Action = EKA_STRAFE_LEFT;
keyMap[5].KeyCode = KEY_KEY_A;
keyMap[6].Action = EKA_STRAFE_RIGHT;
keyMap[6].KeyCode = KEY_RIGHT;
keyMap[7].Action = EKA_STRAFE_RIGHT;
keyMap[7].KeyCode = KEY_KEY_D;
camera = sceneManager->addCameraSceneNodeFPS(0, 100, 500, -1, keyMap, 8);
\endcode
\param parent: Parent scene node of the camera. Can be null.
\param rotateSpeed: Speed in degrees with which the camera is
rotated. This can be done only with the mouse.
\param moveSpeed: Speed in units per millisecond with which
the camera is moved. Movement is done with the cursor keys.
\param id: id of the camera. This id can be used to identify
the camera.
\param keyMapArray: Optional 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.
\param keyMapSize: Amount of items in the keymap array.
\param noVerticalMovement: Setting 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.
\param jumpSpeed: Speed with which the camera is moved when
jumping.
\param invertMouse: Setting 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.
\param makeActive Flag whether this camera should become the active one.
Make sure you always have one active camera.
\return Pointer to the interface of the camera if successful,
otherwise 0. This pointer should not be dropped. See
IReferenceCounted::drop() for more information. */
virtual ICameraSceneNode* addCameraSceneNodeFPS(ISceneNode* parent = 0,
f32 rotateSpeed = 100.0f, f32 moveSpeed = 0.5f, s32 id=-1,
SKeyMap* keyMapArray=0, s32 keyMapSize=0, bool noVerticalMovement=false,
f32 jumpSpeed = 0.f, bool invertMouse=false,
bool makeActive=true) = 0;
//! 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).
\param parent: Parent scene node of the light. Can be null. If the parent moves,
the light will move too.
\param position: Position of the space relative to its parent where the light will be placed.
\param color: Diffuse color of the light. Ambient or Specular colors can be set manually with
the ILightSceneNode::getLightData() method.
\param radius: Radius of the light.
\param id: id of the node. This id can be used to identify the node.
\return Pointer to the interface of the light if successful, otherwise NULL.
This pointer should not be dropped. See IReferenceCounted::drop() for more information. */
virtual ILightSceneNode* addLightSceneNode(ISceneNode* parent = 0,
const core::vector3df& position = core::vector3df(0,0,0),
video::SColorf color = video::SColorf(1.0f, 1.0f, 1.0f),
f32 radius=100.0f, s32 id=-1) = 0;
//! 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.
\param parent Parent scene node of the billboard. Can be null.
If the parent moves, the billboard will move too.
\param size Size of the billboard. This size is 2 dimensional
because a billboard only has width and height.
\param position Position of the space relative to its parent
where the billboard will be placed.
\param id An id of the node. This id can be used to identify
the node.
\param colorTop The color of the vertices at the top of the
billboard (default: white).
\param colorBottom The color of the vertices at the bottom of
the billboard (default: white).
\return Pointer to the billboard if successful, otherwise NULL.
This pointer should not be dropped. See
IReferenceCounted::drop() for more information. */
virtual IBillboardSceneNode* addBillboardSceneNode(ISceneNode* parent = 0,
const core::dimension2d