1
// Copyright (C) 2002-2011 Nikolaus Gebhardt
2
// This file is part of the "Irrlicht Engine".
3
// For conditions of distribution and use, see copyright notice in irrlicht.h
5
#ifndef __I_SCENE_MANAGER_H_INCLUDED__
6
#define __I_SCENE_MANAGER_H_INCLUDED__
8
#include "IReferenceCounted.h"
10
#include "irrString.h"
13
#include "dimension2d.h"
15
#include "ETerrainElements.h"
16
#include "ESceneNodeTypes.h"
17
#include "ESceneNodeAnimatorTypes.h"
18
#include "EMeshWriterEnums.h"
19
#include "SceneParameters.h"
20
#include "IGeometryCreator.h"
21
#include "ISkinnedMesh.h"
39
class IGUIEnvironment;
40
} // end namespace gui
48
} // end namespace video
52
//! Enumeration for render passes.
53
/** A parameter passed to the registerNodeForRendering() method of the ISceneManager,
54
specifying when the node wants to be drawn in relation to the other nodes. */
55
enum E_SCENE_NODE_RENDER_PASS
57
//! No pass currently active
60
//! Camera pass. The active view is set up here. The very first pass.
63
//! In this pass, lights are transformed into camera space and added to the driver
66
//! This is used for sky boxes.
69
//! All normal objects can use this for registering themselves.
70
/** This value will never be returned by
71
ISceneManager::getSceneNodeRenderPass(). The scene manager
72
will determine by itself if an object is transparent or solid
73
and register the object as SNRT_TRANSPARENT or SNRT_SOLD
74
automatically if you call registerNodeForRendering with this
75
value (which is default). Note that it will register the node
76
only as ONE type. If your scene node has both solid and
77
transparent material types register it twice (one time as
78
SNRT_SOLID, the other time as SNRT_TRANSPARENT) and in the
79
render() method call getSceneNodeRenderPass() to find out the
80
current render pass and render only the corresponding parts of
84
//! Solid scene nodes or special scene nodes without materials.
87
//! Transparent scene nodes, drawn after solid nodes. They are sorted from back to front and drawn in that order.
88
ESNRP_TRANSPARENT =16,
90
//! Transparent effect scene nodes, drawn after Transparent nodes. They are sorted from back to front and drawn in that order.
91
ESNRP_TRANSPARENT_EFFECT =32,
93
//! Drawn after the transparent nodes, the time for drawing shadow volumes
98
class IAnimatedMeshSceneNode;
99
class IBillboardSceneNode;
100
class IBillboardTextSceneNode;
101
class ICameraSceneNode;
102
class IDummyTransformationSceneNode;
104
class ILightSceneNode;
109
class IMeshManipulator;
110
class IMeshSceneNode;
112
class IMetaTriangleSelector;
113
class IParticleSystemSceneNode;
114
class ISceneCollisionManager;
117
class ISceneNodeAnimator;
118
class ISceneNodeAnimatorCollisionResponse;
119
class ISceneNodeAnimatorFactory;
120
class ISceneNodeFactory;
121
class ISceneUserDataSerializer;
122
class ITerrainSceneNode;
123
class ITextSceneNode;
124
class ITriangleSelector;
125
class IVolumeLightSceneNode;
130
} // end namespace quake3
132
//! The Scene Manager manages scene nodes, mesh recources, cameras and all the other stuff.
133
/** All Scene nodes can be created only here. There is a always growing
134
list of scene nodes for lots of purposes: Indoor rendering scene nodes
135
like the Octree (addOctreeSceneNode()) or the terrain renderer
136
(addTerrainSceneNode()), different Camera scene nodes
137
(addCameraSceneNode(), addCameraSceneNodeMaya()), scene nodes for Light
138
(addLightSceneNode()), Billboards (addBillboardSceneNode()) and so on.
139
A scene node is a node in the hierachical scene graph. Every scene node
140
may have children, which are other scene nodes. Children move relative
141
the their parents position. If the parent of a node is not visible, its
142
children won't be visible, too. In this way, it is for example easily
143
possible to attach a light to a moving car or to place a walking
144
character on a moving platform on a moving ship.
145
The SceneManager is also able to load 3d mesh files of different
146
formats. Take a look at getMesh() to find out what formats are
147
supported. If these formats are not enough, use
148
addExternalMeshLoader() to add new formats to the engine.
150
class ISceneManager : public virtual IReferenceCounted
154
//! Get pointer to an animateable mesh. Loads the file if not loaded already.
156
* If you want to remove a loaded mesh from the cache again, use removeMesh().
157
* Currently there are the following mesh formats supported:
158
* <TABLE border="1" cellpadding="2" cellspacing="0">
161
* <TD>Description</TD>
164
* <TD>3D Studio (.3ds)</TD>
165
* <TD>Loader for 3D-Studio files which lots of 3D packages
166
* are able to export. Only static meshes are currently
167
* supported by this importer.</TD>
170
* <TD>3D World Studio (.smf)</TD>
171
* <TD>Loader for Leadwerks SMF mesh files, a simple mesh format
172
* containing static geometry for games. The proprietary .STF texture format
173
* is not supported yet. This loader was originally written by Joseph Ellis. </TD>
176
* <TD>Bliz Basic B3D (.b3d)</TD>
177
* <TD>Loader for blitz basic files, developed by Mark
178
* Sibly. This is the ideal animated mesh format for game
179
* characters as it is both rigidly defined and widely
180
* supported by modeling and animation software.
181
* As this format supports skeletal animations, an
182
* ISkinnedMesh will be returned by this importer.</TD>
185
* <TD>Cartography shop 4 (.csm)</TD>
186
* <TD>Cartography Shop is a modeling program for creating
187
* architecture and calculating lighting. Irrlicht can
188
* directly import .csm files thanks to the IrrCSM library
189
* created by Saurav Mohapatra which is now integrated
190
* directly in Irrlicht. If you are using this loader,
191
* please note that you'll have to set the path of the
192
* textures before loading .csm files. You can do this
194
* SceneManager->getParameters()->setAttribute(scene::CSM_TEXTURE_PATH,
195
* "path/to/your/textures");</TD>
198
* <TD>COLLADA (.dae, .xml)</TD>
199
* <TD>COLLADA is an open Digital Asset Exchange Schema for
200
* the interactive 3D industry. There are exporters and
201
* importers for this format available for most of the
202
* big 3d packagesat http://collada.org. Irrlicht can
203
* import COLLADA files by using the
204
* ISceneManager::getMesh() method. COLLADA files need
205
* not contain only one single mesh but multiple meshes
206
* and a whole scene setup with lights, cameras and mesh
207
* instances, this loader can set up a scene as
208
* described by the COLLADA file instead of loading and
209
* returning one single mesh. By default, this loader
210
* behaves like the other loaders and does not create
211
* instances, but it can be switched into this mode by
213
* SceneManager->getParameters()->setAttribute(COLLADA_CREATE_SCENE_INSTANCES, true);
214
* Created scene nodes will be named as the names of the
215
* nodes in the COLLADA file. The returned mesh is just
216
* a dummy object in this mode. Meshes included in the
217
* scene will be added into the scene manager with the
218
* following naming scheme:
219
* "path/to/file/file.dea#meshname". The loading of such
220
* meshes is logged. Currently, this loader is able to
223
* create meshes (made of only polygons), lights, and
224
* cameras. Materials and animations are currently not
225
* supported but this will change with future releases.
229
* <TD>Delgine DeleD (.dmf)</TD>
230
* <TD>DeleD (delgine.com) is a 3D editor and level-editor
231
* combined into one and is specifically designed for 3D
232
* game-development. With this loader, it is possible to
233
* directly load all geometry is as well as textures and
234
* lightmaps from .dmf files. To set texture and
235
* material paths, see scene::DMF_USE_MATERIALS_DIRS and
236
* scene::DMF_TEXTURE_PATH. It is also possible to flip
237
* the alpha texture by setting
238
* scene::DMF_FLIP_ALPHA_TEXTURES to true and to set the
239
* material transparent reference value by setting
240
* scene::DMF_ALPHA_CHANNEL_REF to a float between 0 and
241
* 1. The loader is based on Salvatore Russo's .dmf
242
* loader, I just changed some parts of it. Thanks to
243
* Salvatore for his work and for allowing me to use his
244
* code in Irrlicht and put it under Irrlicht's license.
245
* For newer and more enchanced versions of the loader,
246
* take a look at delgine.com.
250
* <TD>DirectX (.x)</TD>
251
* <TD>Platform independent importer (so not D3D-only) for
252
* .x files. Most 3D packages can export these natively
253
* and there are several tools for them available, e.g.
254
* the Maya exporter included in the DX SDK.
255
* .x files can include skeletal animations and Irrlicht
256
* is able to play and display them, users can manipulate
257
* the joints via the ISkinnedMesh interface. Currently,
258
* Irrlicht only supports uncompressed .x files.</TD>
261
* <TD>Half-Life model (.mdl)</TD>
262
* <TD>This loader opens Half-life 1 models, it was contributed
263
* by Fabio Concas and adapted by Thomas Alten.</TD>
266
* <TD>Irrlicht Mesh (.irrMesh)</TD>
267
* <TD>This is a static mesh format written in XML, native
268
* to Irrlicht and written by the irr mesh writer.
269
* This format is exported by the CopperCube engine's
273
* <TD>LightWave (.lwo)</TD>
274
* <TD>Native to NewTek's LightWave 3D, the LWO format is well
275
* known and supported by many exporters. This loader will
276
* import LWO2 models including lightmaps, bumpmaps and
277
* reflection textures.</TD>
280
* <TD>Maya (.obj)</TD>
281
* <TD>Most 3D software can create .obj files which contain
282
* static geometry without material data. The material
283
* files .mtl are also supported. This importer for
284
* Irrlicht can load them directly. </TD>
287
* <TD>Milkshape (.ms3d)</TD>
288
* <TD>.MS3D files contain models and sometimes skeletal
289
* animations from the Milkshape 3D modeling and animation
290
* software. Like the other skeletal mesh loaders, oints
291
* are exposed via the ISkinnedMesh animated mesh type.</TD>
294
* <TD>My3D (.my3d)</TD>
295
* <TD>.my3D is a flexible 3D file format. The My3DTools
296
* contains plug-ins to export .my3D files from several
297
* 3D packages. With this built-in importer, Irrlicht
298
* can read and display those files directly. This
299
* loader was written by Zhuck Dimitry who also created
300
* the whole My3DTools package. If you are using this
301
* loader, please note that you can set the path of the
302
* textures before loading .my3d files. You can do this
304
* SceneManager->getParameters()->setAttribute(scene::MY3D_TEXTURE_PATH,
305
* "path/to/your/textures");
309
* <TD>OCT (.oct)</TD>
310
* <TD>The oct file format contains 3D geometry and
311
* lightmaps and can be loaded directly by Irrlicht. OCT
312
* files<br> can be created by FSRad, Paul Nette's
313
* radiosity processor or exported from Blender using
314
* OCTTools which can be found in the exporters/OCTTools
315
* directory of the SDK. Thanks to Murphy McCauley for
316
* creating all this.</TD>
319
* <TD>OGRE Meshes (.mesh)</TD>
320
* <TD>Ogre .mesh files contain 3D data for the OGRE 3D
321
* engine. Irrlicht can read and display them directly
322
* with this importer. To define materials for the mesh,
323
* copy a .material file named like the corresponding
324
* .mesh file where the .mesh file is. (For example
325
* ogrehead.material for ogrehead.mesh). Thanks to
326
* Christian Stehno who wrote and contributed this
330
* <TD>Pulsar LMTools (.lmts)</TD>
331
* <TD>LMTools is a set of tools (Windows & Linux) for
332
* creating lightmaps. Irrlicht can directly read .lmts
333
* files thanks to<br> the importer created by Jonas
334
* Petersen. If you are using this loader, please note
335
* that you can set the path of the textures before
336
* loading .lmts files. You can do this using
337
* SceneManager->getParameters()->setAttribute(scene::LMTS_TEXTURE_PATH,
338
* "path/to/your/textures");
339
* Notes for<br> this version of the loader:<br>
340
* - It does not recognise/support user data in the
342
* - The TGAs generated by LMTools don't work in
343
* Irrlicht for some reason (the textures are upside
344
* down). Opening and resaving them in a graphics app
345
* will solve the problem.</TD>
348
* <TD>Quake 3 levels (.bsp)</TD>
349
* <TD>Quake 3 is a popular game by IDSoftware, and .pk3
350
* files contain .bsp files and textures/lightmaps
351
* describing huge prelighted levels. Irrlicht can read
352
* .pk3 and .bsp files directly and thus render Quake 3
353
* levels directly. Written by Nikolaus Gebhardt
354
* enhanced by Dean P. Macri with the curved surfaces
358
* <TD>Quake 2 models (.md2)</TD>
359
* <TD>Quake 2 models are characters with morph target
360
* animation. Irrlicht can read, display and animate
361
* them directly with this importer. </TD>
364
* <TD>Quake 3 models (.md3)</TD>
365
* <TD>Quake 3 models are characters with morph target
366
* animation, they contain mount points for weapons and body
367
* parts and are typically made of several sections which are
368
* manually joined together.</TD>
371
* <TD>Stanford Triangle (.ply)</TD>
372
* <TD>Invented by Stanford University and known as the native
373
* format of the infamous "Stanford Bunny" model, this is a
374
* popular static mesh format used by 3D scanning hardware
375
* and software. This loader supports extremely large models
376
* in both ASCII and binary format, but only has rudimentary
377
* material support in the form of vertex colors and texture
381
* <TD>Stereolithography (.stl)</TD>
382
* <TD>The STL format is used for rapid prototyping and
383
* computer-aided manufacturing, thus has no support for
388
* To load and display a mesh quickly, just do this:
390
* SceneManager->addAnimatedMeshSceneNode(
391
* SceneManager->getMesh("yourmesh.3ds"));
393
* If you would like to implement and add your own file format loader to Irrlicht,
394
* see addExternalMeshLoader().
395
* \param filename: Filename of the mesh to load.
396
* \return Null if failed, otherwise pointer to the mesh.
397
* This pointer should not be dropped. See IReferenceCounted::drop() for more information.
399
virtual IAnimatedMesh* getMesh(const io::path& filename) = 0;
401
//! Get pointer to an animateable mesh. Loads the file if not loaded already.
402
/** Works just as getMesh(const char* filename). If you want to
403
remove a loaded mesh from the cache again, use removeMesh().
404
\param file File handle of the mesh to load.
405
\return NULL if failed and pointer to the mesh if successful.
406
This pointer should not be dropped. See
407
IReferenceCounted::drop() for more information. */
408
virtual IAnimatedMesh* getMesh(io::IReadFile* file) = 0;
410
//! Get interface to the mesh cache which is shared beween all existing scene managers.
411
/** With this interface, it is possible to manually add new loaded
412
meshes (if ISceneManager::getMesh() is not sufficient), to remove them and to iterate
413
through already loaded meshes. */
414
virtual IMeshCache* getMeshCache() = 0;
416
//! Get the video driver.
417
/** \return Pointer to the video Driver.
418
This pointer should not be dropped. See IReferenceCounted::drop() for more information. */
419
virtual video::IVideoDriver* getVideoDriver() = 0;
421
//! Get the active GUIEnvironment
422
/** \return Pointer to the GUIEnvironment
423
This pointer should not be dropped. See IReferenceCounted::drop() for more information. */
424
virtual gui::IGUIEnvironment* getGUIEnvironment() = 0;
426
//! Get the active FileSystem
427
/** \return Pointer to the FileSystem
428
This pointer should not be dropped. See IReferenceCounted::drop() for more information. */
429
virtual io::IFileSystem* getFileSystem() = 0;
431
//! adds Volume Lighting Scene Node.
433
scene::IVolumeLightSceneNode * n = smgr->addVolumeLightSceneNode(0, -1,
434
32, 32, //Subdivide U/V
435
video::SColor(0, 180, 180, 180), //foot color
436
video::SColor(0, 0, 0, 0) //tail color
440
n->setScale(core::vector3df(46.0f, 45.0f, 46.0f));
441
n->getMaterial(0).setTexture(0, smgr->getVideoDriver()->getTexture("lightFalloff.png"));
443
\return Pointer to the volumeLight if successful, otherwise NULL.
444
This pointer should not be dropped. See IReferenceCounted::drop() for more information. */
445
virtual IVolumeLightSceneNode* addVolumeLightSceneNode(ISceneNode* parent=0, s32 id=-1,
446
const u32 subdivU = 32, const u32 subdivV = 32,
447
const video::SColor foot = video::SColor(51, 0, 230, 180),
448
const video::SColor tail = video::SColor(0, 0, 0, 0),
449
const core::vector3df& position = core::vector3df(0,0,0),
450
const core::vector3df& rotation = core::vector3df(0,0,0),
451
const core::vector3df& scale = core::vector3df(1.0f, 1.0f, 1.0f)) = 0;
453
//! Adds a cube scene node
454
/** \param size: Size of the cube, uniformly in each dimension.
455
\param parent: Parent of the scene node. Can be 0 if no parent.
456
\param id: Id of the node. This id can be used to identify the scene node.
457
\param position: Position of the space relative to its parent
458
where the scene node will be placed.
459
\param rotation: Initital rotation of the scene node.
460
\param scale: Initial scale of the scene node.
461
\return Pointer to the created test scene node. This
462
pointer should not be dropped. See IReferenceCounted::drop()
463
for more information. */
464
virtual IMeshSceneNode* addCubeSceneNode(f32 size=10.0f, ISceneNode* parent=0, s32 id=-1,
465
const core::vector3df& position = core::vector3df(0,0,0),
466
const core::vector3df& rotation = core::vector3df(0,0,0),
467
const core::vector3df& scale = core::vector3df(1.0f, 1.0f, 1.0f)) = 0;
469
//! Adds a sphere scene node of the given radius and detail
470
/** \param radius: Radius of the sphere.
471
\param polyCount: The number of vertices in horizontal and
472
vertical direction. The total polyCount of the sphere is
473
polyCount*polyCount. This parameter must be less than 256 to
474
stay within the 16-bit limit of the indices of a meshbuffer.
475
\param parent: Parent of the scene node. Can be 0 if no parent.
476
\param id: Id of the node. This id can be used to identify the scene node.
477
\param position: Position of the space relative to its parent
478
where the scene node will be placed.
479
\param rotation: Initital rotation of the scene node.
480
\param scale: Initial scale of the scene node.
481
\return Pointer to the created test scene node. This
482
pointer should not be dropped. See IReferenceCounted::drop()
483
for more information. */
484
virtual IMeshSceneNode* addSphereSceneNode(f32 radius=5.0f, s32 polyCount=16,
485
ISceneNode* parent=0, s32 id=-1,
486
const core::vector3df& position = core::vector3df(0,0,0),
487
const core::vector3df& rotation = core::vector3df(0,0,0),
488
const core::vector3df& scale = core::vector3df(1.0f, 1.0f, 1.0f)) = 0;
490
//! Adds a scene node for rendering an animated mesh model.
491
/** \param mesh: Pointer to the loaded animated mesh to be displayed.
492
\param parent: Parent of the scene node. Can be NULL if no parent.
493
\param id: Id of the node. This id can be used to identify the scene node.
494
\param position: Position of the space relative to its parent where the
495
scene node will be placed.
496
\param rotation: Initital rotation of the scene node.
497
\param scale: Initial scale of the scene node.
498
\param alsoAddIfMeshPointerZero: Add the scene node even if a 0 pointer is passed.
499
\return Pointer to the created scene node.
500
This pointer should not be dropped. See IReferenceCounted::drop() for more information. */
501
virtual IAnimatedMeshSceneNode* addAnimatedMeshSceneNode(IAnimatedMesh* mesh,
502
ISceneNode* parent=0, s32 id=-1,
503
const core::vector3df& position = core::vector3df(0,0,0),
504
const core::vector3df& rotation = core::vector3df(0,0,0),
505
const core::vector3df& scale = core::vector3df(1.0f, 1.0f, 1.0f),
506
bool alsoAddIfMeshPointerZero=false) = 0;
508
//! Adds a scene node for rendering a static mesh.
509
/** \param mesh: Pointer to the loaded static mesh to be displayed.
510
\param parent: Parent of the scene node. Can be NULL if no parent.
511
\param id: Id of the node. This id can be used to identify the scene node.
512
\param position: Position of the space relative to its parent where the
513
scene node will be placed.
514
\param rotation: Initital rotation of the scene node.
515
\param scale: Initial scale of the scene node.
516
\param alsoAddIfMeshPointerZero: Add the scene node even if a 0 pointer is passed.
517
\return Pointer to the created scene node.
518
This pointer should not be dropped. See IReferenceCounted::drop() for more information. */
519
virtual IMeshSceneNode* addMeshSceneNode(IMesh* mesh, ISceneNode* parent=0, s32 id=-1,
520
const core::vector3df& position = core::vector3df(0,0,0),
521
const core::vector3df& rotation = core::vector3df(0,0,0),
522
const core::vector3df& scale = core::vector3df(1.0f, 1.0f, 1.0f),
523
bool alsoAddIfMeshPointerZero=false) = 0;
525
//! Adds a scene node for rendering a animated water surface mesh.
526
/** Looks really good when the Material type EMT_TRANSPARENT_REFLECTION
528
\param waveHeight: Height of the water waves.
529
\param waveSpeed: Speed of the water waves.
530
\param waveLength: Lenght of a water wave.
531
\param mesh: Pointer to the loaded static mesh to be displayed with water waves on it.
532
\param parent: Parent of the scene node. Can be NULL if no parent.
533
\param id: Id of the node. This id can be used to identify the scene node.
534
\param position: Position of the space relative to its parent where the
535
scene node will be placed.
536
\param rotation: Initital rotation of the scene node.
537
\param scale: Initial scale of the scene node.
538
\return Pointer to the created scene node.
539
This pointer should not be dropped. See IReferenceCounted::drop() for more information. */
540
virtual ISceneNode* addWaterSurfaceSceneNode(IMesh* mesh,
541
f32 waveHeight=2.0f, f32 waveSpeed=300.0f, f32 waveLength=10.0f,
542
ISceneNode* parent=0, s32 id=-1,
543
const core::vector3df& position = core::vector3df(0,0,0),
544
const core::vector3df& rotation = core::vector3df(0,0,0),
545
const core::vector3df& scale = core::vector3df(1.0f, 1.0f, 1.0f)) = 0;
548
//! Adds a scene node for rendering using a octree to the scene graph.
549
/** This a good method for rendering
550
scenes with lots of geometry. The Octree is built on the fly from the mesh.
551
\param mesh: The mesh containing all geometry from which the octree will be build.
552
If this animated mesh has more than one frames in it, the first frame is taken.
553
\param parent: Parent node of the octree node.
554
\param id: id of the node. This id can be used to identify the node.
555
\param minimalPolysPerNode: Specifies the minimal polygons contained a octree node.
556
If a node gets less polys than this value it will not be split into
558
\param alsoAddIfMeshPointerZero: Add the scene node even if a 0 pointer is passed.
559
\return Pointer to the Octree if successful, otherwise 0.
560
This pointer should not be dropped. See IReferenceCounted::drop() for more information. */
561
virtual IMeshSceneNode* addOctreeSceneNode(IAnimatedMesh* mesh, ISceneNode* parent=0,
562
s32 id=-1, s32 minimalPolysPerNode=512, bool alsoAddIfMeshPointerZero=false) = 0;
564
//! Adds a scene node for rendering using a octree to the scene graph.
565
/** \deprecated Use addOctreeSceneNode instead. This method may be removed by Irrlicht 1.9. */
566
_IRR_DEPRECATED_ IMeshSceneNode* addOctTreeSceneNode(IAnimatedMesh* mesh, ISceneNode* parent=0,
567
s32 id=-1, s32 minimalPolysPerNode=512, bool alsoAddIfMeshPointerZero=false)
569
return addOctreeSceneNode(mesh, parent, id, minimalPolysPerNode, alsoAddIfMeshPointerZero);
572
//! Adds a scene node for rendering using a octree to the scene graph.
573
/** This a good method for rendering scenes with lots of
574
geometry. The Octree is built on the fly from the mesh, much
575
faster then a bsp tree.
576
\param mesh: The mesh containing all geometry from which the octree will be build.
577
\param parent: Parent node of the octree node.
578
\param id: id of the node. This id can be used to identify the node.
579
\param minimalPolysPerNode: Specifies the minimal polygons contained a octree node.
580
If a node gets less polys than this value it will not be split into
582
\param alsoAddIfMeshPointerZero: Add the scene node even if a 0 pointer is passed.
583
\return Pointer to the octree if successful, otherwise 0.
584
This pointer should not be dropped. See IReferenceCounted::drop() for more information. */
585
virtual IMeshSceneNode* addOctreeSceneNode(IMesh* mesh, ISceneNode* parent=0,
586
s32 id=-1, s32 minimalPolysPerNode=256, bool alsoAddIfMeshPointerZero=false) = 0;
588
//! Adds a scene node for rendering using a octree to the scene graph.
589
/** \deprecated Use addOctreeSceneNode instead. This method may be removed by Irrlicht 1.9. */
590
_IRR_DEPRECATED_ IMeshSceneNode* addOctTreeSceneNode(IMesh* mesh, ISceneNode* parent=0,
591
s32 id=-1, s32 minimalPolysPerNode=256, bool alsoAddIfMeshPointerZero=false)
593
return addOctreeSceneNode(mesh, parent, id, minimalPolysPerNode, alsoAddIfMeshPointerZero);
596
//! Adds a camera scene node to the scene graph and sets it as active camera.
597
/** This camera does not react on user input like for example the one created with
598
addCameraSceneNodeFPS(). If you want to move or animate it, use animators or the
599
ISceneNode::setPosition(), ICameraSceneNode::setTarget() etc methods.
600
By default, a camera's look at position (set with setTarget()) and its scene node
601
rotation (set with setRotation()) are independent. If you want to be able to
602
control the direction that the camera looks by using setRotation() then call
603
ICameraSceneNode::bindTargetAndRotation(true) on it.
604
\param position: Position of the space relative to its parent where the camera will be placed.
605
\param lookat: Position where the camera will look at. Also known as target.
606
\param parent: Parent scene node of the camera. Can be null. If the parent moves,
607
the camera will move too.
608
\param id: id of the camera. This id can be used to identify the camera.
609
\param makeActive Flag whether this camera should become the active one.
610
Make sure you always have one active camera.
611
\return Pointer to interface to camera if successful, otherwise 0.
612
This pointer should not be dropped. See IReferenceCounted::drop() for more information. */
613
virtual ICameraSceneNode* addCameraSceneNode(ISceneNode* parent = 0,
614
const core::vector3df& position = core::vector3df(0,0,0),
615
const core::vector3df& lookat = core::vector3df(0,0,100),
616
s32 id=-1, bool makeActive=true) = 0;
618
//! Adds a maya style user controlled camera scene node to the scene graph.
619
/** This is a standard camera with an animator that provides mouse control similar
620
to camera in the 3D Software Maya by Alias Wavefront.
621
\param parent: Parent scene node of the camera. Can be null.
622
\param rotateSpeed: Rotation speed of the camera.
623
\param zoomSpeed: Zoom speed of the camera.
624
\param translationSpeed: TranslationSpeed of the camera.
625
\param id: id of the camera. This id can be used to identify the camera.
626
\param makeActive Flag whether this camera should become the active one.
627
Make sure you always have one active camera.
628
\return Returns a pointer to the interface of the camera if successful, otherwise 0.
629
This pointer should not be dropped. See IReferenceCounted::drop() for more information. */
630
virtual ICameraSceneNode* addCameraSceneNodeMaya(ISceneNode* parent = 0,
631
f32 rotateSpeed = -1500.0f, f32 zoomSpeed = 200.0f,
632
f32 translationSpeed = 1500.0f, s32 id=-1,
633
bool makeActive=true) = 0;
635
//! Adds a camera scene node with an animator which provides mouse and keyboard control appropriate for first person shooters (FPS).
636
/** This FPS camera is intended to provide a demonstration of a
637
camera that behaves like a typical First Person Shooter. It is
638
useful for simple demos and prototyping but is not intended to
639
provide a full solution for a production quality game. It binds
640
the camera scene node rotation to the look-at target; @see
641
ICameraSceneNode::bindTargetAndRotation(). With this camera,
642
you look with the mouse, and move with cursor keys. If you want
643
to change the key layout, you can specify your own keymap. For
644
example to make the camera be controlled by the cursor keys AND
645
the keys W,A,S, and D, do something like this:
648
keyMap[0].Action = EKA_MOVE_FORWARD;
649
keyMap[0].KeyCode = KEY_UP;
650
keyMap[1].Action = EKA_MOVE_FORWARD;
651
keyMap[1].KeyCode = KEY_KEY_W;
653
keyMap[2].Action = EKA_MOVE_BACKWARD;
654
keyMap[2].KeyCode = KEY_DOWN;
655
keyMap[3].Action = EKA_MOVE_BACKWARD;
656
keyMap[3].KeyCode = KEY_KEY_S;
658
keyMap[4].Action = EKA_STRAFE_LEFT;
659
keyMap[4].KeyCode = KEY_LEFT;
660
keyMap[5].Action = EKA_STRAFE_LEFT;
661
keyMap[5].KeyCode = KEY_KEY_A;
663
keyMap[6].Action = EKA_STRAFE_RIGHT;
664
keyMap[6].KeyCode = KEY_RIGHT;
665
keyMap[7].Action = EKA_STRAFE_RIGHT;
666
keyMap[7].KeyCode = KEY_KEY_D;
668
camera = sceneManager->addCameraSceneNodeFPS(0, 100, 500, -1, keyMap, 8);
670
\param parent: Parent scene node of the camera. Can be null.
671
\param rotateSpeed: Speed in degress with which the camera is
672
rotated. This can be done only with the mouse.
673
\param moveSpeed: Speed in units per millisecond with which
674
the camera is moved. Movement is done with the cursor keys.
675
\param id: id of the camera. This id can be used to identify
677
\param keyMapArray: Optional pointer to an array of a keymap,
678
specifying what keys should be used to move the camera. If this
679
is null, the default keymap is used. You can define actions
680
more then one time in the array, to bind multiple keys to the
682
\param keyMapSize: Amount of items in the keymap array.
683
\param noVerticalMovement: Setting this to true makes the
684
camera only move within a horizontal plane, and disables
685
vertical movement as known from most ego shooters. Default is
686
'false', with which it is possible to fly around in space, if
688
\param jumpSpeed: Speed with which the camera is moved when
690
\param invertMouse: Setting this to true makes the camera look
691
up when the mouse is moved down and down when the mouse is
692
moved up, the default is 'false' which means it will follow the
693
movement of the mouse cursor.
694
\param makeActive Flag whether this camera should become the active one.
695
Make sure you always have one active camera.
696
\return Pointer to the interface of the camera if successful,
697
otherwise 0. This pointer should not be dropped. See
698
IReferenceCounted::drop() for more information. */
699
virtual ICameraSceneNode* addCameraSceneNodeFPS(ISceneNode* parent = 0,
700
f32 rotateSpeed = 100.0f, f32 moveSpeed = 0.5f, s32 id=-1,
701
SKeyMap* keyMapArray=0, s32 keyMapSize=0, bool noVerticalMovement=false,
702
f32 jumpSpeed = 0.f, bool invertMouse=false,
703
bool makeActive=true) = 0;
705
//! Adds a dynamic light scene node to the scene graph.
706
/** The light will cast dynamic light on all
707
other scene nodes in the scene, which have the material flag video::MTF_LIGHTING
708
turned on. (This is the default setting in most scene nodes).
709
\param parent: Parent scene node of the light. Can be null. If the parent moves,
710
the light will move too.
711
\param position: Position of the space relative to its parent where the light will be placed.
712
\param color: Diffuse color of the light. Ambient or Specular colors can be set manually with
713
the ILightSceneNode::getLightData() method.
714
\param radius: Radius of the light.
715
\param id: id of the node. This id can be used to identify the node.
716
\return Pointer to the interface of the light if successful, otherwise NULL.
717
This pointer should not be dropped. See IReferenceCounted::drop() for more information. */
718
virtual ILightSceneNode* addLightSceneNode(ISceneNode* parent = 0,
719
const core::vector3df& position = core::vector3df(0,0,0),
720
video::SColorf color = video::SColorf(1.0f, 1.0f, 1.0f),
721
f32 radius=100.0f, s32 id=-1) = 0;
723
//! Adds a billboard scene node to the scene graph.
724
/** A billboard is like a 3d sprite: A 2d element,
725
which always looks to the camera. It is usually used for things
726
like explosions, fire, lensflares and things like that.
727
\param parent Parent scene node of the billboard. Can be null.
728
If the parent moves, the billboard will move too.
729
\param size Size of the billboard. This size is 2 dimensional
730
because a billboard only has width and height.
731
\param position Position of the space relative to its parent
732
where the billboard will be placed.
733
\param id An id of the node. This id can be used to identify
735
\param colorTop The color of the vertices at the top of the
736
billboard (default: white).
737
\param colorBottom The color of the vertices at the bottom of
738
the billboard (default: white).
739
\return Pointer to the billboard if successful, otherwise NULL.
740
This pointer should not be dropped. See
741
IReferenceCounted::drop() for more information. */
742
virtual IBillboardSceneNode* addBillboardSceneNode(ISceneNode* parent = 0,
743
const core::dimension2d<f32>& size = core::dimension2d<f32>(10.0f, 10.0f),
744
const core::vector3df& position = core::vector3df(0,0,0), s32 id=-1,
745
video::SColor colorTop = 0xFFFFFFFF, video::SColor colorBottom = 0xFFFFFFFF) = 0;
747
//! Adds a skybox scene node to the scene graph.
748
/** A skybox is a big cube with 6 textures on it and
749
is drawn around the camera position.
750
\param top: Texture for the top plane of the box.
751
\param bottom: Texture for the bottom plane of the box.
752
\param left: Texture for the left plane of the box.
753
\param right: Texture for the right plane of the box.
754
\param front: Texture for the front plane of the box.
755
\param back: Texture for the back plane of the box.
756
\param parent: Parent scene node of the skybox. A skybox usually has no parent,
757
so this should be null. Note: If a parent is set to the skybox, the box will not
758
change how it is drawn.
759
\param id: An id of the node. This id can be used to identify the node.
760
\return Pointer to the sky box if successful, otherwise NULL.
761
This pointer should not be dropped. See IReferenceCounted::drop() for more information. */
762
virtual ISceneNode* addSkyBoxSceneNode(video::ITexture* top, video::ITexture* bottom,
763
video::ITexture* left, video::ITexture* right, video::ITexture* front,
764
video::ITexture* back, ISceneNode* parent = 0, s32 id=-1) = 0;
766
//! Adds a skydome scene node to the scene graph.
767
/** A skydome is a large (half-) sphere with a panoramic texture
768
on the inside and is drawn around the camera position.
769
\param texture: Texture for the dome.
770
\param horiRes: Number of vertices of a horizontal layer of the sphere.
771
\param vertRes: Number of vertices of a vertical layer of the sphere.
772
\param texturePercentage: How much of the height of the
773
texture is used. Should be between 0 and 1.
774
\param spherePercentage: How much of the sphere is drawn.
775
Value should be between 0 and 2, where 1 is an exact
776
half-sphere and 2 is a full sphere.
777
\param radius The Radius of the sphere
778
\param parent: Parent scene node of the dome. A dome usually has no parent,
779
so this should be null. Note: If a parent is set, the dome will not
780
change how it is drawn.
781
\param id: An id of the node. This id can be used to identify the node.
782
\return Pointer to the sky dome if successful, otherwise NULL.
783
This pointer should not be dropped. See IReferenceCounted::drop() for more information. */
784
virtual ISceneNode* addSkyDomeSceneNode(video::ITexture* texture,
785
u32 horiRes=16, u32 vertRes=8,
786
f32 texturePercentage=0.9, f32 spherePercentage=2.0,f32 radius = 1000.f,
787
ISceneNode* parent=0, s32 id=-1) = 0;
789
//! Adds a particle system scene node to the scene graph.
790
/** \param withDefaultEmitter: Creates a default working point emitter
791
which emitts some particles. Set this to true to see a particle system
792
in action. If set to false, you'll have to set the emitter you want by
793
calling IParticleSystemSceneNode::setEmitter().
794
\param parent: Parent of the scene node. Can be NULL if no parent.
795
\param id: Id of the node. This id can be used to identify the scene node.
796
\param position: Position of the space relative to its parent where the
797
scene node will be placed.
798
\param rotation: Initital rotation of the scene node.
799
\param scale: Initial scale of the scene node.
800
\return Pointer to the created scene node.
801
This pointer should not be dropped. See IReferenceCounted::drop() for more information. */
802
virtual IParticleSystemSceneNode* addParticleSystemSceneNode(
803
bool withDefaultEmitter=true, ISceneNode* parent=0, s32 id=-1,
804
const core::vector3df& position = core::vector3df(0,0,0),
805
const core::vector3df& rotation = core::vector3df(0,0,0),
806
const core::vector3df& scale = core::vector3df(1.0f, 1.0f, 1.0f)) = 0;
808
//! Adds a terrain scene node to the scene graph.
809
/** This node implements is a simple terrain renderer which uses
810
a technique known as geo mip mapping
811
for reducing the detail of triangle blocks which are far away.
812
The code for the TerrainSceneNode is based on the terrain
813
renderer by Soconne and the GeoMipMapSceneNode developed by
814
Spintz. They made their code available for Irrlicht and allowed
815
it to be distributed under this licence. I only modified some
816
parts. A lot of thanks go to them.
818
This scene node is capable of loading terrains and updating
819
the indices at runtime to enable viewing very large terrains
820
very quickly. It uses a CLOD (Continuous Level of Detail)
821
algorithm which updates the indices for each patch based on
822
a LOD (Level of Detail) which is determined based on a patch's
823
distance from the camera.
825
The patch size of the terrain must always be a size of 2^N+1,
826
i.e. 8+1(9), 16+1(17), etc.
827
The MaxLOD available is directly dependent on the patch size
828
of the terrain. LOD 0 contains all of the indices to draw all
829
the triangles at the max detail for a patch. As each LOD goes
830
up by 1 the step taken, in generating indices increases by
831
-2^LOD, so for LOD 1, the step taken is 2, for LOD 2, the step
832
taken is 4, LOD 3 - 8, etc. The step can be no larger than
833
the size of the patch, so having a LOD of 8, with a patch size
834
of 17, is asking the algoritm to generate indices every 2^8 (
835
256 ) vertices, which is not possible with a patch size of 17.
836
The maximum LOD for a patch size of 17 is 2^4 ( 16 ). So,
837
with a MaxLOD of 5, you'll have LOD 0 ( full detail ), LOD 1 (
838
every 2 vertices ), LOD 2 ( every 4 vertices ), LOD 3 ( every
839
8 vertices ) and LOD 4 ( every 16 vertices ).
840
\param heightMapFileName: The name of the file on disk, to read vertex data from. This should
841
be a gray scale bitmap.
842
\param parent: Parent of the scene node. Can be 0 if no parent.
843
\param id: Id of the node. This id can be used to identify the scene node.
844
\param position: The absolute position of this node.
845
\param rotation: The absolute rotation of this node. ( NOT YET IMPLEMENTED )
846
\param scale: The scale factor for the terrain. If you're
847
using a heightmap of size 129x129 and would like your terrain
848
to be 12900x12900 in game units, then use a scale factor of (
849
core::vector ( 100.0f, 100.0f, 100.0f ). If you use a Y
850
scaling factor of 0.0f, then your terrain will be flat.
851
\param vertexColor: The default color of all the vertices. If no texture is associated
852
with the scene node, then all vertices will be this color. Defaults to white.
853
\param maxLOD: The maximum LOD (level of detail) for the node. Only change if you
854
know what you are doing, this might lead to strange behaviour.
855
\param patchSize: patch size of the terrain. Only change if you
856
know what you are doing, this might lead to strange behaviour.
857
\param smoothFactor: The number of times the vertices are smoothed.
858
\param addAlsoIfHeightmapEmpty: Add terrain node even with empty heightmap.
859
\return Pointer to the created scene node. Can be null
860
if the terrain could not be created, for example because the
861
heightmap could not be loaded. The returned pointer should
862
not be dropped. See IReferenceCounted::drop() for more
864
virtual ITerrainSceneNode* addTerrainSceneNode(
865
const io::path& heightMapFileName,
866
ISceneNode* parent=0, s32 id=-1,
867
const core::vector3df& position = core::vector3df(0.0f,0.0f,0.0f),
868
const core::vector3df& rotation = core::vector3df(0.0f,0.0f,0.0f),
869
const core::vector3df& scale = core::vector3df(1.0f,1.0f,1.0f),
870
video::SColor vertexColor = video::SColor(255,255,255,255),
871
s32 maxLOD=5, E_TERRAIN_PATCH_SIZE patchSize=ETPS_17, s32 smoothFactor=0,
872
bool addAlsoIfHeightmapEmpty = false) = 0;
874
//! Adds a terrain scene node to the scene graph.
875
/** Just like the other addTerrainSceneNode() method, but takes an IReadFile
876
pointer as parameter for the heightmap. For more informations take a look
877
at the other function.
878
\param heightMapFile: The file handle to read vertex data from. This should
879
be a gray scale bitmap.
880
\param parent: Parent of the scene node. Can be 0 if no parent.
881
\param id: Id of the node. This id can be used to identify the scene node.
882
\param position: The absolute position of this node.
883
\param rotation: The absolute rotation of this node. ( NOT YET IMPLEMENTED )
884
\param scale: The scale factor for the terrain. If you're
885
using a heightmap of size 129x129 and would like your terrain
886
to be 12900x12900 in game units, then use a scale factor of (
887
core::vector ( 100.0f, 100.0f, 100.0f ). If you use a Y
888
scaling factor of 0.0f, then your terrain will be flat.
889
\param vertexColor: The default color of all the vertices. If no texture is associated
890
with the scene node, then all vertices will be this color. Defaults to white.
891
\param maxLOD: The maximum LOD (level of detail) for the node. Only change if you
892
know what you are doing, this might lead to strange behaviour.
893
\param patchSize: patch size of the terrain. Only change if you
894
know what you are doing, this might lead to strange behaviour.
895
\param smoothFactor: The number of times the vertices are smoothed.
896
\param addAlsoIfHeightmapEmpty: Add terrain node even with empty heightmap.
897
\return Pointer to the created scene node. Can be null
898
if the terrain could not be created, for example because the
899
heightmap could not be loaded. The returned pointer should
900
not be dropped. See IReferenceCounted::drop() for more
902
virtual ITerrainSceneNode* addTerrainSceneNode(
903
io::IReadFile* heightMapFile,
904
ISceneNode* parent=0, s32 id=-1,
905
const core::vector3df& position = core::vector3df(0.0f,0.0f,0.0f),
906
const core::vector3df& rotation = core::vector3df(0.0f,0.0f,0.0f),
907
const core::vector3df& scale = core::vector3df(1.0f,1.0f,1.0f),
908
video::SColor vertexColor = video::SColor(255,255,255,255),
909
s32 maxLOD=5, E_TERRAIN_PATCH_SIZE patchSize=ETPS_17, s32 smoothFactor=0,
910
bool addAlsoIfHeightmapEmpty = false) = 0;
912
//! Adds a quake3 scene node to the scene graph.
913
/** A Quake3 Scene renders multiple meshes for a specific HighLanguage Shader (Quake3 Style )
914
\return Pointer to the quake3 scene node if successful, otherwise NULL.
915
This pointer should not be dropped. See IReferenceCounted::drop() for more information. */
916
virtual IMeshSceneNode* addQuake3SceneNode(const IMeshBuffer* meshBuffer, const quake3::IShader * shader,
917
ISceneNode* parent=0, s32 id=-1
921
//! Adds an empty scene node to the scene graph.
922
/** Can be used for doing advanced transformations
923
or structuring the scene graph.
924
\return Pointer to the created scene node.
925
This pointer should not be dropped. See IReferenceCounted::drop() for more information. */
926
virtual ISceneNode* addEmptySceneNode(ISceneNode* parent=0, s32 id=-1) = 0;
928
//! Adds a dummy transformation scene node to the scene graph.
929
/** This scene node does not render itself, and does not respond to set/getPosition,
930
set/getRotation and set/getScale. Its just a simple scene node that takes a
931
matrix as relative transformation, making it possible to insert any transformation
932
anywhere into the scene graph.
933
\return Pointer to the created scene node.
934
This pointer should not be dropped. See IReferenceCounted::drop() for more information. */
935
virtual IDummyTransformationSceneNode* addDummyTransformationSceneNode(
936
ISceneNode* parent=0, s32 id=-1) = 0;
938
//! Adds a text scene node, which is able to display 2d text at a position in three dimensional space
939
virtual ITextSceneNode* addTextSceneNode(gui::IGUIFont* font, const wchar_t* text,
940
video::SColor color=video::SColor(100,255,255,255),
941
ISceneNode* parent = 0, const core::vector3df& position = core::vector3df(0,0,0),
944
//! Adds a text scene node, which uses billboards. The node, and the text on it, will scale with distance.
946
\param font The font to use on the billboard. Pass 0 to use the GUI environment's default font.
947
\param text The text to display on the billboard.
948
\param parent The billboard's parent. Pass 0 to use the root scene node.
949
\param size The billboard's width and height.
950
\param position The billboards position relative to its parent.
951
\param id: An id of the node. This id can be used to identify the node.
952
\param colorTop: The color of the vertices at the top of the billboard (default: white).
953
\param colorBottom: The color of the vertices at the bottom of the billboard (default: white).
954
\return Pointer to the billboard if successful, otherwise NULL.
955
This pointer should not be dropped. See IReferenceCounted::drop() for more information. */
956
virtual IBillboardTextSceneNode* addBillboardTextSceneNode( gui::IGUIFont* font, const wchar_t* text,
957
ISceneNode* parent = 0,
958
const core::dimension2d<f32>& size = core::dimension2d<f32>(10.0f, 10.0f),
959
const core::vector3df& position = core::vector3df(0,0,0), s32 id=-1,
960
video::SColor colorTop = 0xFFFFFFFF, video::SColor colorBottom = 0xFFFFFFFF) = 0;
962
//! Adds a Hill Plane mesh to the mesh pool.
963
/** The mesh is generated on the fly
964
and looks like a plane with some hills on it. It is uses mostly for quick
965
tests of the engine only. You can specify how many hills there should be
966
on the plane and how high they should be. Also you must specify a name for
967
the mesh, because the mesh is added to the mesh pool, and can be retrieved
968
again using ISceneManager::getMesh() with the name as parameter.
969
\param name: The name of this mesh which must be specified in order
970
to be able to retrieve the mesh later with ISceneManager::getMesh().
971
\param tileSize: Size of a tile of the mesh. (10.0f, 10.0f) would be a
972
good value to start, for example.
973
\param tileCount: Specifies how much tiles there will be. If you specifiy
974
for example that a tile has the size (10.0f, 10.0f) and the tileCount is
975
(10,10), than you get a field of 100 tiles which has the dimension 100.0fx100.0f.
976
\param material: Material of the hill mesh.
977
\param hillHeight: Height of the hills. If you specify a negative value
978
you will get holes instead of hills. If the height is 0, no hills will be
980
\param countHills: Amount of hills on the plane. There will be countHills.X
981
hills along the X axis and countHills.Y along the Y axis. So in total there
982
will be countHills.X * countHills.Y hills.
983
\param textureRepeatCount: Defines how often the texture will be repeated in
985
return Null if the creation failed. The reason could be that you
986
specified some invalid parameters or that a mesh with that name already
987
exists. If successful, a pointer to the mesh is returned.
988
This pointer should not be dropped. See IReferenceCounted::drop() for more information. */
989
virtual IAnimatedMesh* addHillPlaneMesh(const io::path& name,
990
const core::dimension2d<f32>& tileSize, const core::dimension2d<u32>& tileCount,
991
video::SMaterial* material = 0, f32 hillHeight = 0.0f,
992
const core::dimension2d<f32>& countHills = core::dimension2d<f32>(0.0f, 0.0f),
993
const core::dimension2d<f32>& textureRepeatCount = core::dimension2d<f32>(1.0f, 1.0f)) = 0;
995
//! Adds a static terrain mesh to the mesh pool.
996
/** The mesh is generated on the fly
997
from a texture file and a height map file. Both files may be huge
998
(8000x8000 pixels would be no problem) because the generator splits the
999
files into smaller textures if necessary.
1000
You must specify a name for the mesh, because the mesh is added to the mesh pool,
1001
and can be retrieved again using ISceneManager::getMesh() with the name as parameter.
1002
\param meshname: The name of this mesh which must be specified in order
1003
to be able to retrieve the mesh later with ISceneManager::getMesh().
1004
\param texture: Texture for the terrain. Please note that this is not a
1005
hardware texture as usual (ITexture), but an IImage software texture.
1006
You can load this texture with IVideoDriver::createImageFromFile().
1007
\param heightmap: A grayscaled heightmap image. Like the texture,
1008
it can be created with IVideoDriver::createImageFromFile(). The amount
1009
of triangles created depends on the size of this texture, so use a small
1010
heightmap to increase rendering speed.
1011
\param stretchSize: Parameter defining how big a is pixel on the heightmap.
1012
\param maxHeight: Defines how high a white pixel on the heighmap is.
1013
\param defaultVertexBlockSize: Defines the initial dimension between vertices.
1014
\return Null if the creation failed. The reason could be that you
1015
specified some invalid parameters, that a mesh with that name already
1016
exists, or that a texture could not be found. If successful, a pointer to the mesh is returned.
1017
This pointer should not be dropped. See IReferenceCounted::drop() for more information. */
1018
virtual IAnimatedMesh* addTerrainMesh(const io::path& meshname,
1019
video::IImage* texture, video::IImage* heightmap,
1020
const core::dimension2d<f32>& stretchSize = core::dimension2d<f32>(10.0f,10.0f),
1021
f32 maxHeight=200.0f,
1022
const core::dimension2d<u32>& defaultVertexBlockSize = core::dimension2d<u32>(64,64)) = 0;
1024
//! add a static arrow mesh to the meshpool
1025
/** \param name Name of the mesh
1026
\param vtxColorCylinder color of the cylinder
1027
\param vtxColorCone color of the cone
1028
\param tesselationCylinder Number of quads the cylinder side consists of
1029
\param tesselationCone Number of triangles the cone's roof consits of
1030
\param height Total height of the arrow
1031
\param cylinderHeight Total height of the cylinder, should be lesser than total height
1032
\param widthCylinder Diameter of the cylinder
1033
\param widthCone Diameter of the cone's base, should be not smaller than the cylinder's diameter
1034
\return Pointer to the arrow mesh if successful, otherwise 0.
1035
This pointer should not be dropped. See IReferenceCounted::drop() for more information. */
1036
virtual IAnimatedMesh* addArrowMesh(const io::path& name,
1037
video::SColor vtxColorCylinder=0xFFFFFFFF,
1038
video::SColor vtxColorCone=0xFFFFFFFF,
1039
u32 tesselationCylinder=4, u32 tesselationCone=8,
1040
f32 height=1.f, f32 cylinderHeight=0.6f,
1041
f32 widthCylinder=0.05f, f32 widthCone=0.3f) = 0;
1043
//! add a static sphere mesh to the meshpool
1044
/** \param name Name of the mesh
1045
\param radius Radius of the sphere
1046
\param polyCountX Number of quads used for the horizontal tiling
1047
\param polyCountY Number of quads used for the vertical tiling
1048
\return Pointer to the sphere mesh if successful, otherwise 0.
1049
This pointer should not be dropped. See IReferenceCounted::drop() for more information. */
1050
virtual IAnimatedMesh* addSphereMesh(const io::path& name,
1051
f32 radius=5.f, u32 polyCountX = 16,
1052
u32 polyCountY = 16) = 0;
1054
//! Add a volume light mesh to the meshpool
1055
/** \param name Name of the mesh
1056
\param SubdivideU Horizontal subdivision count
1057
\param SubdivideV Vertical subdivision count
1058
\param FootColor Color of the bottom of the light
1059
\param TailColor Color of the top of the light
1060
\return Pointer to the volume light mesh if successful, otherwise 0.
1061
This pointer should not be dropped. See IReferenceCounted::drop() for more information.
1063
virtual IAnimatedMesh* addVolumeLightMesh(const io::path& name,
1064
const u32 SubdivideU = 32, const u32 SubdivideV = 32,
1065
const video::SColor FootColor = video::SColor(51, 0, 230, 180),
1066
const video::SColor TailColor = video::SColor(0, 0, 0, 0)) = 0;
1068
//! Gets the root scene node.
1069
/** This is the scene node which is parent
1070
of all scene nodes. The root scene node is a special scene node which
1071
only exists to manage all scene nodes. It will not be rendered and cannot
1072
be removed from the scene.
1073
\return Pointer to the root scene node.
1074
This pointer should not be dropped. See IReferenceCounted::drop() for more information. */
1075
virtual ISceneNode* getRootSceneNode() = 0;
1077
//! Get the first scene node with the specified id.
1078
/** \param id: The id to search for
1079
\param start: Scene node to start from. All children of this scene
1080
node are searched. If null is specified, the root scene node is
1082
\return Pointer to the first scene node with this id,
1083
and null if no scene node could be found.
1084
This pointer should not be dropped. See IReferenceCounted::drop() for more information. */
1085
virtual ISceneNode* getSceneNodeFromId(s32 id, ISceneNode* start=0) = 0;
1087
//! Get the first scene node with the specified name.
1088
/** \param name: The name to search for
1089
\param start: Scene node to start from. All children of this scene
1090
node are searched. If null is specified, the root scene node is
1092
\return Pointer to the first scene node with this id,
1093
and null if no scene node could be found.
1094
This pointer should not be dropped. See IReferenceCounted::drop() for more information. */
1095
virtual ISceneNode* getSceneNodeFromName(const c8* name, ISceneNode* start=0) = 0;
1097
//! Get the first scene node with the specified type.
1098
/** \param type: The type to search for
1099
\param start: Scene node to start from. All children of this scene
1100
node are searched. If null is specified, the root scene node is
1102
\return Pointer to the first scene node with this type,
1103
and null if no scene node could be found.
1104
This pointer should not be dropped. See IReferenceCounted::drop() for more information. */
1105
virtual ISceneNode* getSceneNodeFromType(scene::ESCENE_NODE_TYPE type, ISceneNode* start=0) = 0;
1107
//! Get scene nodes by type.
1108
/** \param type: Type of scene node to find (ESNT_ANY will return all child nodes).
1109
\param outNodes: array to be filled with results.
1110
\param start: Scene node to start from. All children of this scene
1111
node are searched. If null is specified, the root scene node is
1113
virtual void getSceneNodesFromType(ESCENE_NODE_TYPE type,
1114
core::array<scene::ISceneNode*>& outNodes,
1115
ISceneNode* start=0) = 0;
1117
//! Get the current active camera.
1118
/** \return The active camera is returned. Note that this can
1119
be NULL, if there was no camera created yet.
1120
This pointer should not be dropped. See IReferenceCounted::drop() for more information. */
1121
virtual ICameraSceneNode* getActiveCamera() const =0;
1123
//! Sets the currently active camera.
1124
/** The previous active camera will be deactivated.
1125
\param camera: The new camera which should be active. */
1126
virtual void setActiveCamera(ICameraSceneNode* camera) = 0;
1128
//! Sets the color of stencil buffers shadows drawn by the scene manager.
1129
virtual void setShadowColor(video::SColor color = video::SColor(150,0,0,0)) = 0;
1131
//! Get the current color of shadows.
1132
virtual video::SColor getShadowColor() const = 0;
1134
//! Registers a node for rendering it at a specific time.
1135
/** This method should only be used by SceneNodes when they get a
1136
ISceneNode::OnRegisterSceneNode() call.
1137
\param node: Node to register for drawing. Usually scene nodes would set 'this'
1138
as parameter here because they want to be drawn.
1139
\param pass: Specifies when the node wants to be drawn in relation to the other nodes.
1140
For example, if the node is a shadow, it usually wants to be drawn after all other nodes
1141
and will use ESNRP_SHADOW for this. See scene::E_SCENE_NODE_RENDER_PASS for details.
1142
\return scene will be rendered ( passed culling ) */
1143
virtual u32 registerNodeForRendering(ISceneNode* node,
1144
E_SCENE_NODE_RENDER_PASS pass = ESNRP_AUTOMATIC) = 0;
1146
//! Draws all the scene nodes.
1147
/** This can only be invoked between
1148
IVideoDriver::beginScene() and IVideoDriver::endScene(). Please note that
1149
the scene is not only drawn when calling this, but also animated
1150
by existing scene node animators, culling of scene nodes is done, etc. */
1151
virtual void drawAll() = 0;
1153
//! Creates a rotation animator, which rotates the attached scene node around itself.
1154
/** \param rotationSpeed Specifies the speed of the animation in degree per 10 milliseconds.
1155
\return The animator. Attach it to a scene node with ISceneNode::addAnimator()
1156
and the animator will animate it.
1157
If you no longer need the animator, you should call ISceneNodeAnimator::drop().
1158
See IReferenceCounted::drop() for more information. */
1159
virtual ISceneNodeAnimator* createRotationAnimator(const core::vector3df& rotationSpeed) = 0;
1161
//! Creates a fly circle animator, which lets the attached scene node fly around a center.
1162
/** \param center: Center of the circle.
1163
\param radius: Radius of the circle.
1164
\param speed: The orbital speed, in radians per millisecond.
1165
\param direction: Specifies the upvector used for alignment of the mesh.
1166
\param startPosition: The position on the circle where the animator will
1167
begin. Value is in multiples of a circle, i.e. 0.5 is half way around. (phase)
1168
\param radiusEllipsoid: if radiusEllipsoid != 0 then radius2 froms a ellipsoid
1169
begin. Value is in multiples of a circle, i.e. 0.5 is half way around. (phase)
1170
\return The animator. Attach it to a scene node with ISceneNode::addAnimator()
1171
and the animator will animate it.
1172
If you no longer need the animator, you should call ISceneNodeAnimator::drop().
1173
See IReferenceCounted::drop() for more information. */
1174
virtual ISceneNodeAnimator* createFlyCircleAnimator(
1175
const core::vector3df& center=core::vector3df(0.f,0.f,0.f),
1176
f32 radius=100.f, f32 speed=0.001f,
1177
const core::vector3df& direction=core::vector3df(0.f, 1.f, 0.f),
1178
f32 startPosition = 0.f,
1179
f32 radiusEllipsoid = 0.f) = 0;
1181
//! Creates a fly straight animator, which lets the attached scene node fly or move along a line between two points.
1182
/** \param startPoint: Start point of the line.
1183
\param endPoint: End point of the line.
1184
\param timeForWay: Time in milli seconds how long the node should need to
1185
move from the start point to the end point.
1186
\param loop: If set to false, the node stops when the end point is reached.
1187
If loop is true, the node begins again at the start.
1188
\param pingpong Flag to set whether the animator should fly
1189
back from end to start again.
1190
\return The animator. Attach it to a scene node with ISceneNode::addAnimator()
1191
and the animator will animate it.
1192
If you no longer need the animator, you should call ISceneNodeAnimator::drop().
1193
See IReferenceCounted::drop() for more information. */
1194
virtual ISceneNodeAnimator* createFlyStraightAnimator(const core::vector3df& startPoint,
1195
const core::vector3df& endPoint, u32 timeForWay, bool loop=false, bool pingpong = false) = 0;
1197
//! Creates a texture animator, which switches the textures of the target scene node based on a list of textures.
1198
/** \param textures: List of textures to use.
1199
\param timePerFrame: Time in milliseconds, how long any texture in the list
1201
\param loop: If set to to false, the last texture remains set, and the animation
1202
stops. If set to true, the animation restarts with the first texture.
1203
\return The animator. Attach it to a scene node with ISceneNode::addAnimator()
1204
and the animator will animate it.
1205
If you no longer need the animator, you should call ISceneNodeAnimator::drop().
1206
See IReferenceCounted::drop() for more information. */
1207
virtual ISceneNodeAnimator* createTextureAnimator(const core::array<video::ITexture*>& textures,
1208
s32 timePerFrame, bool loop=true) = 0;
1210
//! Creates a scene node animator, which deletes the scene node after some time automatically.
1211
/** \param timeMs: Time in milliseconds, after when the node will be deleted.
1212
\return The animator. Attach it to a scene node with ISceneNode::addAnimator()
1213
and the animator will animate it.
1214
If you no longer need the animator, you should call ISceneNodeAnimator::drop().
1215
See IReferenceCounted::drop() for more information. */
1216
virtual ISceneNodeAnimator* createDeleteAnimator(u32 timeMs) = 0;
1218
//! Creates a special scene node animator for doing automatic collision detection and response.
1219
/** See ISceneNodeAnimatorCollisionResponse for details.
1220
\param world: Triangle selector holding all triangles of the world with which
1221
the scene node may collide. You can create a triangle selector with
1222
ISceneManager::createTriangleSelector();
1223
\param sceneNode: SceneNode which should be manipulated. After you added this animator
1224
to the scene node, the scene node will not be able to move through walls and is
1225
affected by gravity. If you need to teleport the scene node to a new position without
1226
it being effected by the collision geometry, then call sceneNode->setPosition(); then
1227
animator->setTargetNode(sceneNode);
1228
\param ellipsoidRadius: Radius of the ellipsoid with which collision detection and
1229
response is done. If you have got a scene node, and you are unsure about
1230
how big the radius should be, you could use the following code to determine
1233
const core::aabbox3d<f32>& box = yourSceneNode->getBoundingBox();
1234
core::vector3df radius = box.MaxEdge - box.getCenter();
1236
\param gravityPerSecond: Sets the gravity of the environment, as an acceleration in
1237
units per second per second. If your units are equivalent to metres, then
1238
core::vector3df(0,-10.0f,0) would give an approximately realistic gravity.
1239
You can disable gravity by setting it to core::vector3df(0,0,0).
1240
\param ellipsoidTranslation: By default, the ellipsoid for collision detection is created around
1241
the center of the scene node, which means that the ellipsoid surrounds
1242
it completely. If this is not what you want, you may specify a translation
1244
\param slidingValue: DOCUMENTATION NEEDED.
1245
\return The animator. Attach it to a scene node with ISceneNode::addAnimator()
1246
and the animator will cause it to do collision detection and response.
1247
If you no longer need the animator, you should call ISceneNodeAnimator::drop().
1248
See IReferenceCounted::drop() for more information. */
1249
virtual ISceneNodeAnimatorCollisionResponse* createCollisionResponseAnimator(
1250
ITriangleSelector* world, ISceneNode* sceneNode,
1251
const core::vector3df& ellipsoidRadius = core::vector3df(30,60,30),
1252
const core::vector3df& gravityPerSecond = core::vector3df(0,-10.0f,0),
1253
const core::vector3df& ellipsoidTranslation = core::vector3df(0,0,0),
1254
f32 slidingValue = 0.0005f) = 0;
1256
//! Creates a follow spline animator.
1257
/** The animator modifies the position of
1258
the attached scene node to make it follow a hermite spline.
1259
It uses a subset of hermite splines: either cardinal splines
1260
(tightness != 0.5) or catmull-rom-splines (tightness == 0.5).
1261
The animator moves from one control point to the next in
1262
1/speed seconds. This code was sent in by Matthias Gall.
1263
If you no longer need the animator, you should call ISceneNodeAnimator::drop().
1264
See IReferenceCounted::drop() for more information. */
1265
virtual ISceneNodeAnimator* createFollowSplineAnimator(s32 startTime,
1266
const core::array< core::vector3df >& points,
1267
f32 speed = 1.0f, f32 tightness = 0.5f, bool loop=true, bool pingpong=false) = 0;
1269
//! Creates a simple ITriangleSelector, based on a mesh.
1270
/** Triangle selectors
1271
can be used for doing collision detection. Don't use this selector
1272
for a huge amount of triangles like in Quake3 maps.
1273
Instead, use for example ISceneManager::createOctreeTriangleSelector().
1274
Please note that the created triangle selector is not automaticly attached
1275
to the scene node. You will have to call ISceneNode::setTriangleSelector()
1276
for this. To create and attach a triangle selector is done like this:
1278
ITriangleSelector* s = sceneManager->createTriangleSelector(yourMesh,
1280
yourSceneNode->setTriangleSelector(s);
1283
\param mesh: Mesh of which the triangles are taken.
1284
\param node: Scene node of which visibility and transformation is used.
1285
\return The selector, or null if not successful.
1286
If you no longer need the selector, you should call ITriangleSelector::drop().
1287
See IReferenceCounted::drop() for more information. */
1288
virtual ITriangleSelector* createTriangleSelector(IMesh* mesh, ISceneNode* node) = 0;
1290
//! Creates a simple ITriangleSelector, based on an animated mesh scene node.
1291
/** Details of the mesh associated with the node will be extracted internally.
1292
Call ITriangleSelector::update() to have the triangle selector updated based
1293
on the current frame of the animated mesh scene node.
1294
\param node The animated mesh scene node from which to build the selector
1296
virtual ITriangleSelector* createTriangleSelector(IAnimatedMeshSceneNode* node) = 0;
1299
//! Creates a simple dynamic ITriangleSelector, based on a axis aligned bounding box.
1300
/** Triangle selectors
1301
can be used for doing collision detection. Every time when triangles are
1302
queried, the triangle selector gets the bounding box of the scene node,
1303
an creates new triangles. In this way, it works good with animated scene nodes.
1304
\param node: Scene node of which the bounding box, visibility and transformation is used.
1305
\return The selector, or null if not successful.
1306
If you no longer need the selector, you should call ITriangleSelector::drop().
1307
See IReferenceCounted::drop() for more information. */
1308
virtual ITriangleSelector* createTriangleSelectorFromBoundingBox(ISceneNode* node) = 0;
1310
//! Creates a Triangle Selector, optimized by an octree.
1311
/** Triangle selectors
1312
can be used for doing collision detection. This triangle selector is
1313
optimized for huge amounts of triangle, it organizes them in an octree.
1314
Please note that the created triangle selector is not automaticly attached
1315
to the scene node. You will have to call ISceneNode::setTriangleSelector()
1316
for this. To create and attach a triangle selector is done like this:
1318
ITriangleSelector* s = sceneManager->createOctreeTriangleSelector(yourMesh,
1320
yourSceneNode->setTriangleSelector(s);
1323
For more informations and examples on this, take a look at the collision
1324
tutorial in the SDK.
1325
\param mesh: Mesh of which the triangles are taken.
1326
\param node: Scene node of which visibility and transformation is used.
1327
\param minimalPolysPerNode: Specifies the minimal polygons contained a octree node.
1328
If a node gets less polys the this value, it will not be splitted into
1330
\return The selector, or null if not successful.
1331
If you no longer need the selector, you should call ITriangleSelector::drop().
1332
See IReferenceCounted::drop() for more information. */
1333
virtual ITriangleSelector* createOctreeTriangleSelector(IMesh* mesh,
1334
ISceneNode* node, s32 minimalPolysPerNode=32) = 0;
1336
//! //! Creates a Triangle Selector, optimized by an octree.
1337
/** \deprecated Use createOctreeTriangleSelector instead. This method may be removed by Irrlicht 1.9. */
1338
_IRR_DEPRECATED_ ITriangleSelector* createOctTreeTriangleSelector(IMesh* mesh,
1339
ISceneNode* node, s32 minimalPolysPerNode=32)
1341
return createOctreeTriangleSelector(mesh, node, minimalPolysPerNode);
1344
//! Creates a meta triangle selector.
1345
/** A meta triangle selector is nothing more than a
1346
collection of one or more triangle selectors providing together
1347
the interface of one triangle selector. In this way,
1348
collision tests can be done with different triangle soups in one pass.
1349
\return The selector, or null if not successful.
1350
If you no longer need the selector, you should call ITriangleSelector::drop().
1351
See IReferenceCounted::drop() for more information. */
1352
virtual IMetaTriangleSelector* createMetaTriangleSelector() = 0;
1354
//! Creates a triangle selector which can select triangles from a terrain scene node.
1355
/** \param node: Pointer to the created terrain scene node
1356
\param LOD: Level of detail, 0 for highest detail.
1357
\return The selector, or null if not successful.
1358
If you no longer need the selector, you should call ITriangleSelector::drop().
1359
See IReferenceCounted::drop() for more information. */
1360
virtual ITriangleSelector* createTerrainTriangleSelector(
1361
ITerrainSceneNode* node, s32 LOD=0) = 0;
1363
//! Adds an external mesh loader for extending the engine with new file formats.
1364
/** If you want the engine to be extended with
1365
file formats it currently is not able to load (e.g. .cob), just implement
1366
the IMeshLoader interface in your loading class and add it with this method.
1367
Using this method it is also possible to override built-in mesh loaders with
1368
newer or updated versions without the need to recompile the engine.
1369
\param externalLoader: Implementation of a new mesh loader. */
1370
virtual void addExternalMeshLoader(IMeshLoader* externalLoader) = 0;
1372
//! Returns the number of mesh loaders supported by Irrlicht at this time
1373
virtual u32 getMeshLoaderCount() const = 0;
1375
//! Retrieve the given mesh loader
1376
/** \param index The index of the loader to retrieve. This parameter is an 0-based
1378
\return A pointer to the specified loader, 0 if the index is incorrect. */
1379
virtual IMeshLoader* getMeshLoader(u32 index) const = 0;
1381
//! Adds an external scene loader for extending the engine with new file formats.
1382
/** If you want the engine to be extended with
1383
file formats it currently is not able to load (e.g. .vrml), just implement
1384
the ISceneLoader interface in your loading class and add it with this method.
1385
Using this method it is also possible to override the built-in scene loaders
1386
with newer or updated versions without the need to recompile the engine.
1387
\param externalLoader: Implementation of a new mesh loader. */
1388
virtual void addExternalSceneLoader(ISceneLoader* externalLoader) = 0;
1390
//! Returns the number of scene loaders supported by Irrlicht at this time
1391
virtual u32 getSceneLoaderCount() const = 0;
1393
//! Retrieve the given scene loader
1394
/** \param index The index of the loader to retrieve. This parameter is an 0-based
1396
\return A pointer to the specified loader, 0 if the index is incorrect. */
1397
virtual ISceneLoader* getSceneLoader(u32 index) const = 0;
1399
//! Get pointer to the scene collision manager.
1400
/** \return Pointer to the collision manager
1401
This pointer should not be dropped. See IReferenceCounted::drop() for more information. */
1402
virtual ISceneCollisionManager* getSceneCollisionManager() = 0;
1404
//! Get pointer to the mesh manipulator.
1405
/** \return Pointer to the mesh manipulator
1406
This pointer should not be dropped. See IReferenceCounted::drop() for more information. */
1407
virtual IMeshManipulator* getMeshManipulator() = 0;
1409
//! Adds a scene node to the deletion queue.
1410
/** The scene node is immediatly
1411
deleted when it's secure. Which means when the scene node does not
1412
execute animators and things like that. This method is for example
1413
used for deleting scene nodes by their scene node animators. In
1414
most other cases, a ISceneNode::remove() call is enough, using this
1415
deletion queue is not necessary.
1416
See ISceneManager::createDeleteAnimator() for details.
1417
\param node: Node to detete. */
1418
virtual void addToDeletionQueue(ISceneNode* node) = 0;
1420
//! Posts an input event to the environment.
1421
/** Usually you do not have to
1422
use this method, it is used by the internal engine. */
1423
virtual bool postEventFromUser(const SEvent& event) = 0;
1425
//! Clears the whole scene.
1426
/** All scene nodes are removed. */
1427
virtual void clear() = 0;
1429
//! Get interface to the parameters set in this scene.
1430
/** String parameters can be used by plugins and mesh loaders.
1431
For example the CMS and LMTS loader want a parameter named 'CSM_TexturePath'
1432
and 'LMTS_TexturePath' set to the path were attached textures can be found. See
1433
CSM_TEXTURE_PATH, LMTS_TEXTURE_PATH, MY3D_TEXTURE_PATH,
1434
COLLADA_CREATE_SCENE_INSTANCES, DMF_TEXTURE_PATH and DMF_USE_MATERIALS_DIRS*/
1435
virtual io::IAttributes* getParameters() = 0;
1437
//! Get current render pass.
1438
/** All scene nodes are being rendered in a specific order.
1439
First lights, cameras, sky boxes, solid geometry, and then transparent
1440
stuff. During the rendering process, scene nodes may want to know what the scene
1441
manager is rendering currently, because for example they registered for rendering
1442
twice, once for transparent geometry and once for solid. When knowing what rendering
1443
pass currently is active they can render the correct part of their geometry. */
1444
virtual E_SCENE_NODE_RENDER_PASS getSceneNodeRenderPass() const = 0;
1446
//! Get the default scene node factory which can create all built in scene nodes
1447
/** \return Pointer to the default scene node factory
1448
This pointer should not be dropped. See IReferenceCounted::drop() for more information. */
1449
virtual ISceneNodeFactory* getDefaultSceneNodeFactory() = 0;
1451
//! Adds a scene node factory to the scene manager.
1452
/** Use this to extend the scene manager with new scene node types which it should be
1453
able to create automaticly, for example when loading data from xml files. */
1454
virtual void registerSceneNodeFactory(ISceneNodeFactory* factoryToAdd) = 0;
1456
//! Get amount of registered scene node factories.
1457
virtual u32 getRegisteredSceneNodeFactoryCount() const = 0;
1459
//! Get a scene node factory by index
1460
/** \return Pointer to the requested scene node factory, or 0 if it does not exist.
1461
This pointer should not be dropped. See IReferenceCounted::drop() for more information. */
1462
virtual ISceneNodeFactory* getSceneNodeFactory(u32 index) = 0;
1464
//! Get the default scene node animator factory which can create all built-in scene node animators
1465
/** \return Pointer to the default scene node animator factory
1466
This pointer should not be dropped. See IReferenceCounted::drop() for more information. */
1467
virtual ISceneNodeAnimatorFactory* getDefaultSceneNodeAnimatorFactory() = 0;
1469
//! Adds a scene node animator factory to the scene manager.
1470
/** Use this to extend the scene manager with new scene node animator types which it should be
1471
able to create automaticly, for example when loading data from xml files. */
1472
virtual void registerSceneNodeAnimatorFactory(ISceneNodeAnimatorFactory* factoryToAdd) = 0;
1474
//! Get amount of registered scene node animator factories.
1475
virtual u32 getRegisteredSceneNodeAnimatorFactoryCount() const = 0;
1477
//! Get scene node animator factory by index
1478
/** \return Pointer to the requested scene node animator factory, or 0 if it does not exist.
1479
This pointer should not be dropped. See IReferenceCounted::drop() for more information. */
1480
virtual ISceneNodeAnimatorFactory* getSceneNodeAnimatorFactory(u32 index) = 0;
1482
//! Get typename from a scene node type or null if not found
1483
virtual const c8* getSceneNodeTypeName(ESCENE_NODE_TYPE type) = 0;
1485
//! Returns a typename from a scene node animator type or null if not found
1486
virtual const c8* getAnimatorTypeName(ESCENE_NODE_ANIMATOR_TYPE type) = 0;
1488
//! Adds a scene node to the scene by name
1489
/** \return Pointer to the scene node added by a factory
1490
This pointer should not be dropped. See IReferenceCounted::drop() for more information. */
1491
virtual ISceneNode* addSceneNode(const char* sceneNodeTypeName, ISceneNode* parent=0) = 0;
1493
//! creates a scene node animator based on its type name
1494
/** \param typeName: Type of the scene node animator to add.
1495
\param target: Target scene node of the new animator.
1496
\return Returns pointer to the new scene node animator or null if not successful. You need to
1497
drop this pointer after calling this, see IReferenceCounted::drop() for details. */
1498
virtual ISceneNodeAnimator* createSceneNodeAnimator(const char* typeName, ISceneNode* target=0) = 0;
1500
//! Creates a new scene manager.
1501
/** This can be used to easily draw and/or store two
1502
independent scenes at the same time. The mesh cache will be
1503
shared between all existing scene managers, which means if you
1504
load a mesh in the original scene manager using for example
1505
getMesh(), the mesh will be available in all other scene
1506
managers too, without loading.
1507
The original/main scene manager will still be there and
1508
accessible via IrrlichtDevice::getSceneManager(). If you need
1509
input event in this new scene manager, for example for FPS
1510
cameras, you'll need to forward input to this manually: Just
1511
implement an IEventReceiver and call
1512
yourNewSceneManager->postEventFromUser(), and return true so
1513
that the original scene manager doesn't get the event.
1514
Otherwise, all input will go to the main scene manager
1516
If you no longer need the new scene manager, you should call
1517
ISceneManager::drop().
1518
See IReferenceCounted::drop() for more information. */
1519
virtual ISceneManager* createNewSceneManager(bool cloneContent=false) = 0;
1521
//! Saves the current scene into a file.
1522
/** Scene nodes with the option isDebugObject set to true are not being saved.
1523
The scene is usually written to an .irr file, an xml based format. .irr files can
1524
Be edited with the Irrlicht Engine Editor, irrEdit (http://irredit.irrlicht3d.org).
1525
To load .irr files again, see ISceneManager::loadScene().
1526
\param filename Name of the file.
1527
\param userDataSerializer If you want to save some user data for every scene node into the
1528
file, implement the ISceneUserDataSerializer interface and provide it as parameter here.
1529
Otherwise, simply specify 0 as this parameter.
1530
\param node Node which is taken as the top node of the scene. This node and all of its
1531
descendants are saved into the scene file. Pass 0 or the scene manager to save the full
1532
scene (which is also the default).
1533
\return True if successful. */
1534
virtual bool saveScene(const io::path& filename, ISceneUserDataSerializer* userDataSerializer=0, ISceneNode* node=0) = 0;
1536
//! Saves the current scene into a file.
1537
/** Scene nodes with the option isDebugObject set to true are not being saved.
1538
The scene is usually written to an .irr file, an xml based format. .irr files can
1539
Be edited with the Irrlicht Engine Editor, irrEdit (http://irredit.irrlicht3d.org).
1540
To load .irr files again, see ISceneManager::loadScene().
1541
\param file: File where the scene is saved into.
1542
\param userDataSerializer: If you want to save some user data for every scene node into the
1543
file, implement the ISceneUserDataSerializer interface and provide it as parameter here.
1544
Otherwise, simply specify 0 as this parameter.
1545
\param node Node which is taken as the top node of the scene. This node and all of its
1546
descendants are saved into the scene file. Pass 0 or the scene manager to save the full
1547
scene (which is also the default).
1548
\return True if successful. */
1549
virtual bool saveScene(io::IWriteFile* file, ISceneUserDataSerializer* userDataSerializer=0, ISceneNode* node=0) = 0;
1551
//! Loads a scene. Note that the current scene is not cleared before.
1552
/** The scene is usually loaded from an .irr file, an xml based format, but other scene formats
1553
can be added to the engine via ISceneManager::addExternalSceneLoader. .irr files can
1554
Be edited with the Irrlicht Engine Editor, irrEdit (http://irredit.irrlicht3d.org) or
1555
saved directly by the engine using ISceneManager::saveScene().
1556
\param filename: Name of the file.
1557
\param userDataSerializer: If you want to load user data
1558
possibily saved in that file for some scene nodes in the file,
1559
implement the ISceneUserDataSerializer interface and provide it
1560
as parameter here. Otherwise, simply specify 0 as this
1562
\param rootNode Node which is taken as the root node of the scene. Pass 0 to add the scene
1563
directly to the scene manager (which is also the default).
1564
\return True if successful. */
1565
virtual bool loadScene(const io::path& filename, ISceneUserDataSerializer* userDataSerializer=0, ISceneNode* rootNode=0) = 0;
1567
//! Loads a scene. Note that the current scene is not cleared before.
1568
/** The scene is usually loaded from an .irr file, an xml based format, but other scene formats
1569
can be added to the engine via ISceneManager::addExternalSceneLoader. .irr files can
1570
Be edited with the Irrlicht Engine Editor, irrEdit (http://irredit.irrlicht3d.org) or
1571
saved directly by the engine using ISceneManager::saveScene().
1572
\param file: File where the scene is going to be saved into.
1573
\param userDataSerializer: If you want to load user data
1574
possibily saved in that file for some scene nodes in the file,
1575
implement the ISceneUserDataSerializer interface and provide it
1576
as parameter here. Otherwise, simply specify 0 as this
1578
\param rootNode Node which is taken as the root node of the scene. Pass 0 to add the scene
1579
directly to the scene manager (which is also the default).
1580
\return True if successful. */
1581
virtual bool loadScene(io::IReadFile* file, ISceneUserDataSerializer* userDataSerializer=0, ISceneNode* rootNode=0) = 0;
1583
//! Get a mesh writer implementation if available
1584
/** Note: You need to drop() the pointer after use again, see IReferenceCounted::drop()
1586
virtual IMeshWriter* createMeshWriter(EMESH_WRITER_TYPE type) = 0;
1588
//! Get a skinned mesh, which is not available as header-only code
1589
/** Note: You need to drop() the pointer after use again, see IReferenceCounted::drop()
1591
virtual ISkinnedMesh* createSkinnedMesh() = 0;
1593
//! Sets ambient color of the scene
1594
virtual void setAmbientLight(const video::SColorf &ambientColor) = 0;
1596
//! Get ambient color of the scene
1597
virtual const video::SColorf& getAmbientLight() const = 0;
1599
//! Register a custom callbacks manager which gets callbacks during scene rendering.
1600
/** \param[in] lightManager: the new callbacks manager. You may pass 0 to remove the
1601
current callbacks manager and restore the default behaviour. */
1602
virtual void setLightManager(ILightManager* lightManager) = 0;
1604
//! Get an instance of a geometry creator.
1605
/** The geometry creator provides some helper methods to create various types of
1606
basic geometry. This can be useful for custom scene nodes. */
1607
virtual const IGeometryCreator* getGeometryCreator(void) const = 0;
1609
//! Check if node is culled in current view frustum
1610
/** Please note that depending on the used culling method this
1611
check can be rather coarse, or slow. A positive result is
1612
correct, though, i.e. if this method returns true the node is
1613
positively not visible. The node might still be invisible even
1614
if this method returns false.
1615
\param node The scene node which is checked for culling.
1616
\return True if node is not visible in the current scene, else
1618
virtual bool isCulled(const ISceneNode* node) const =0;
1622
} // end namespace scene
1623
} // end namespace irr