aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/src/others/irrlicht-1.8.1/include/ISceneManager.h
diff options
context:
space:
mode:
authorDavid Walter Seikel2016-03-28 22:28:34 +1000
committerDavid Walter Seikel2016-03-28 22:28:34 +1000
commit7028cbe09c688437910a25623098762bf0fa592d (patch)
tree10b5af58277d9880380c2251f109325542c4e6eb /src/others/irrlicht-1.8.1/include/ISceneManager.h
parentMove lemon to the src/others directory. (diff)
downloadSledjHamr-7028cbe09c688437910a25623098762bf0fa592d.zip
SledjHamr-7028cbe09c688437910a25623098762bf0fa592d.tar.gz
SledjHamr-7028cbe09c688437910a25623098762bf0fa592d.tar.bz2
SledjHamr-7028cbe09c688437910a25623098762bf0fa592d.tar.xz
Move Irrlicht to src/others.
Diffstat (limited to 'src/others/irrlicht-1.8.1/include/ISceneManager.h')
-rw-r--r--src/others/irrlicht-1.8.1/include/ISceneManager.h1663
1 files changed, 1663 insertions, 0 deletions
diff --git a/src/others/irrlicht-1.8.1/include/ISceneManager.h b/src/others/irrlicht-1.8.1/include/ISceneManager.h
new file mode 100644
index 0000000..d0b14a1
--- /dev/null
+++ b/src/others/irrlicht-1.8.1/include/ISceneManager.h
@@ -0,0 +1,1663 @@
1// Copyright (C) 2002-2012 Nikolaus Gebhardt
2// This file is part of the "Irrlicht Engine".
3// For conditions of distribution and use, see copyright notice in irrlicht.h
4
5#ifndef __I_SCENE_MANAGER_H_INCLUDED__
6#define __I_SCENE_MANAGER_H_INCLUDED__
7
8#include "IReferenceCounted.h"
9#include "irrArray.h"
10#include "irrString.h"
11#include "path.h"
12#include "vector3d.h"
13#include "dimension2d.h"
14#include "SColor.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"
22
23namespace irr
24{
25 struct SKeyMap;
26 struct SEvent;
27
28namespace io
29{
30 class IReadFile;
31 class IAttributes;
32 class IWriteFile;
33 class IFileSystem;
34} // end namespace io
35
36namespace gui
37{
38 class IGUIFont;
39 class IGUIEnvironment;
40} // end namespace gui
41
42namespace video
43{
44 class IVideoDriver;
45 class SMaterial;
46 class IImage;
47 class ITexture;
48} // end namespace video
49
50namespace scene
51{
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
56 {
57 //! No pass currently active
58 ESNRP_NONE =0,
59
60 //! Camera pass. The active view is set up here. The very first pass.
61 ESNRP_CAMERA =1,
62
63 //! In this pass, lights are transformed into camera space and added to the driver
64 ESNRP_LIGHT =2,
65
66 //! This is used for sky boxes.
67 ESNRP_SKY_BOX =4,
68
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
81 the node. */
82 ESNRP_AUTOMATIC =24,
83
84 //! Solid scene nodes or special scene nodes without materials.
85 ESNRP_SOLID =8,
86
87 //! Transparent scene nodes, drawn after solid nodes. They are sorted from back to front and drawn in that order.
88 ESNRP_TRANSPARENT =16,
89
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,
92
93 //! Drawn after the solid nodes, before the transparent nodes, the time for drawing shadow volumes
94 ESNRP_SHADOW =64
95 };
96
97 class IAnimatedMesh;
98 class IAnimatedMeshSceneNode;
99 class IBillboardSceneNode;
100 class IBillboardTextSceneNode;
101 class ICameraSceneNode;
102 class IDummyTransformationSceneNode;
103 class ILightManager;
104 class ILightSceneNode;
105 class IMesh;
106 class IMeshBuffer;
107 class IMeshCache;
108 class IMeshLoader;
109 class IMeshManipulator;
110 class IMeshSceneNode;
111 class IMeshWriter;
112 class IMetaTriangleSelector;
113 class IParticleSystemSceneNode;
114 class ISceneCollisionManager;
115 class ISceneLoader;
116 class ISceneNode;
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;
126
127 namespace quake3
128 {
129 struct IShader;
130 } // end namespace quake3
131
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.
149 */
150 class ISceneManager : public virtual IReferenceCounted
151 {
152 public:
153
154 //! Get pointer to an animateable mesh. Loads the file if not loaded already.
155 /**
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">
159 * <TR>
160 * <TD>Format</TD>
161 * <TD>Description</TD>
162 * </TR>
163 * <TR>
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>
168 * </TR>
169 * <TR>
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>
174 * </TR>
175 * <TR>
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>
183 * </TR>
184 * <TR>
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
193 * using
194 * SceneManager-&gt;getParameters()-&gt;setAttribute(scene::CSM_TEXTURE_PATH,
195 * &quot;path/to/your/textures&quot;);</TD>
196 * </TR>
197 * <TR>
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
212 * using
213 * SceneManager-&gt;getParameters()-&gt;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
221
222
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.
226 * </TD>
227 * </TR>
228 * <TR>
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.
247 * </TD>
248 * </TR>
249 * <TR>
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>
259 * </TR>
260 * <TR>
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>
264 * </TR>
265 * <TR>
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
270 * lightmapper.</TD>
271 * </TR>
272 * <TR>
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>
278 * </TR>
279 * <TR>
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>
285 * </TR>
286 * <TR>
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>
292 * </TR>
293 * <TR>
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
303 * using
304 * SceneManager-&gt;getParameters()-&gt;setAttribute(scene::MY3D_TEXTURE_PATH,
305 * &quot;path/to/your/textures&quot;);
306 * </TD>
307 * </TR>
308 * <TR>
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>
317 * </TR>
318 * <TR>
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
327 * loader.</TD>
328 * </TR>
329 * <TR>
330 * <TD>Pulsar LMTools (.lmts)</TD>
331 * <TD>LMTools is a set of tools (Windows &amp; 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-&gt;getParameters()-&gt;setAttribute(scene::LMTS_TEXTURE_PATH,
338 * &quot;path/to/your/textures&quot;);
339 * Notes for<br> this version of the loader:<br>
340 * - It does not recognise/support user data in the
341 * *.lmts files.<br>
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>
346 * </TR>
347 * <TR>
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
355 * feature. </TD>
356 * </TR>
357 * <TR>
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>
362 * </TR>
363 * <TR>
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>
369 * </TR>
370 * <TR>
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
378 * coordinates.</TD>
379 * </TR>
380 * <TR>
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
384 * materials.</TD>
385 * </TR>
386 * </TABLE>
387 *
388 * To load and display a mesh quickly, just do this:
389 * \code
390 * SceneManager->addAnimatedMeshSceneNode(
391 * SceneManager->getMesh("yourmesh.3ds"));
392 * \endcode
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.
398 **/
399 virtual IAnimatedMesh* getMesh(const io::path& filename) = 0;
400
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;
409
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;
415
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;
420
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;
425
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;
430
431 //! adds Volume Lighting Scene Node.
432 /** Example Usage:
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
437 );
438 if (n)
439 {
440 n->setScale(core::vector3df(46.0f, 45.0f, 46.0f));
441 n->getMaterial(0).setTexture(0, smgr->getVideoDriver()->getTexture("lightFalloff.png"));
442 }
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;
452
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;
468
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;
489
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;
507
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;
524
525 //! Adds a scene node for rendering a animated water surface mesh.
526 /** Looks really good when the Material type EMT_TRANSPARENT_REFLECTION
527 is used.
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;
546
547
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
557 smaller nodes.
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;
563
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)
568 {
569 return addOctreeSceneNode(mesh, parent, id, minimalPolysPerNode, alsoAddIfMeshPointerZero);
570 }
571
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
581 smaller nodes.
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;
587
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)
592 {
593 return addOctreeSceneNode(mesh, parent, id, minimalPolysPerNode, alsoAddIfMeshPointerZero);
594 }
595
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;
617
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 The camera does not react on setPosition anymore after applying this animator. Instead
622 use setTarget, to fix the target the camera the camera hovers around. And setDistance
623 to set the current distance from that target, i.e. the radius of the orbit the camera
624 hovers on.
625 \param parent: Parent scene node of the camera. Can be null.
626 \param rotateSpeed: Rotation speed of the camera.
627 \param zoomSpeed: Zoom speed of the camera.
628 \param translationSpeed: TranslationSpeed of the camera.
629 \param id: id of the camera. This id can be used to identify the camera.
630 \param distance Initial distance of the camera from the object
631 \param makeActive Flag whether this camera should become the active one.
632 Make sure you always have one active camera.
633 \return Returns a pointer to the interface of the camera if successful, otherwise 0.
634 This pointer should not be dropped. See IReferenceCounted::drop() for more information. */
635 virtual ICameraSceneNode* addCameraSceneNodeMaya(ISceneNode* parent=0,
636 f32 rotateSpeed=-1500.f, f32 zoomSpeed=200.f,
637 f32 translationSpeed=1500.f, s32 id=-1, f32 distance=70.f,
638 bool makeActive=true) =0;
639
640 //! Adds a camera scene node with an animator which provides mouse and keyboard control appropriate for first person shooters (FPS).
641 /** This FPS camera is intended to provide a demonstration of a
642 camera that behaves like a typical First Person Shooter. It is
643 useful for simple demos and prototyping but is not intended to
644 provide a full solution for a production quality game. It binds
645 the camera scene node rotation to the look-at target; @see
646 ICameraSceneNode::bindTargetAndRotation(). With this camera,
647 you look with the mouse, and move with cursor keys. If you want
648 to change the key layout, you can specify your own keymap. For
649 example to make the camera be controlled by the cursor keys AND
650 the keys W,A,S, and D, do something like this:
651 \code
652 SKeyMap keyMap[8];
653 keyMap[0].Action = EKA_MOVE_FORWARD;
654 keyMap[0].KeyCode = KEY_UP;
655 keyMap[1].Action = EKA_MOVE_FORWARD;
656 keyMap[1].KeyCode = KEY_KEY_W;
657
658 keyMap[2].Action = EKA_MOVE_BACKWARD;
659 keyMap[2].KeyCode = KEY_DOWN;
660 keyMap[3].Action = EKA_MOVE_BACKWARD;
661 keyMap[3].KeyCode = KEY_KEY_S;
662
663 keyMap[4].Action = EKA_STRAFE_LEFT;
664 keyMap[4].KeyCode = KEY_LEFT;
665 keyMap[5].Action = EKA_STRAFE_LEFT;
666 keyMap[5].KeyCode = KEY_KEY_A;
667
668 keyMap[6].Action = EKA_STRAFE_RIGHT;
669 keyMap[6].KeyCode = KEY_RIGHT;
670 keyMap[7].Action = EKA_STRAFE_RIGHT;
671 keyMap[7].KeyCode = KEY_KEY_D;
672
673 camera = sceneManager->addCameraSceneNodeFPS(0, 100, 500, -1, keyMap, 8);
674 \endcode
675 \param parent: Parent scene node of the camera. Can be null.
676 \param rotateSpeed: Speed in degress with which the camera is
677 rotated. This can be done only with the mouse.
678 \param moveSpeed: Speed in units per millisecond with which
679 the camera is moved. Movement is done with the cursor keys.
680 \param id: id of the camera. This id can be used to identify
681 the camera.
682 \param keyMapArray: Optional pointer to an array of a keymap,
683 specifying what keys should be used to move the camera. If this
684 is null, the default keymap is used. You can define actions
685 more then one time in the array, to bind multiple keys to the
686 same action.
687 \param keyMapSize: Amount of items in the keymap array.
688 \param noVerticalMovement: Setting this to true makes the
689 camera only move within a horizontal plane, and disables
690 vertical movement as known from most ego shooters. Default is
691 'false', with which it is possible to fly around in space, if
692 no gravity is there.
693 \param jumpSpeed: Speed with which the camera is moved when
694 jumping.
695 \param invertMouse: Setting this to true makes the camera look
696 up when the mouse is moved down and down when the mouse is
697 moved up, the default is 'false' which means it will follow the
698 movement of the mouse cursor.
699 \param makeActive Flag whether this camera should become the active one.
700 Make sure you always have one active camera.
701 \return Pointer to the interface of the camera if successful,
702 otherwise 0. This pointer should not be dropped. See
703 IReferenceCounted::drop() for more information. */
704 virtual ICameraSceneNode* addCameraSceneNodeFPS(ISceneNode* parent = 0,
705 f32 rotateSpeed = 100.0f, f32 moveSpeed = 0.5f, s32 id=-1,
706 SKeyMap* keyMapArray=0, s32 keyMapSize=0, bool noVerticalMovement=false,
707 f32 jumpSpeed = 0.f, bool invertMouse=false,
708 bool makeActive=true) = 0;
709
710 //! Adds a dynamic light scene node to the scene graph.
711 /** The light will cast dynamic light on all
712 other scene nodes in the scene, which have the material flag video::MTF_LIGHTING
713 turned on. (This is the default setting in most scene nodes).
714 \param parent: Parent scene node of the light. Can be null. If the parent moves,
715 the light will move too.
716 \param position: Position of the space relative to its parent where the light will be placed.
717 \param color: Diffuse color of the light. Ambient or Specular colors can be set manually with
718 the ILightSceneNode::getLightData() method.
719 \param radius: Radius of the light.
720 \param id: id of the node. This id can be used to identify the node.
721 \return Pointer to the interface of the light if successful, otherwise NULL.
722 This pointer should not be dropped. See IReferenceCounted::drop() for more information. */
723 virtual ILightSceneNode* addLightSceneNode(ISceneNode* parent = 0,
724 const core::vector3df& position = core::vector3df(0,0,0),
725 video::SColorf color = video::SColorf(1.0f, 1.0f, 1.0f),
726 f32 radius=100.0f, s32 id=-1) = 0;
727
728 //! Adds a billboard scene node to the scene graph.
729 /** A billboard is like a 3d sprite: A 2d element,
730 which always looks to the camera. It is usually used for things
731 like explosions, fire, lensflares and things like that.
732 \param parent Parent scene node of the billboard. Can be null.
733 If the parent moves, the billboard will move too.
734 \param size Size of the billboard. This size is 2 dimensional
735 because a billboard only has width and height.
736 \param position Position of the space relative to its parent
737 where the billboard will be placed.
738 \param id An id of the node. This id can be used to identify
739 the node.
740 \param colorTop The color of the vertices at the top of the
741 billboard (default: white).
742 \param colorBottom The color of the vertices at the bottom of
743 the billboard (default: white).
744 \return Pointer to the billboard if successful, otherwise NULL.
745 This pointer should not be dropped. See
746 IReferenceCounted::drop() for more information. */
747 virtual IBillboardSceneNode* addBillboardSceneNode(ISceneNode* parent = 0,
748 const core::dimension2d<f32>& size = core::dimension2d<f32>(10.0f, 10.0f),
749 const core::vector3df& position = core::vector3df(0,0,0), s32 id=-1,
750 video::SColor colorTop = 0xFFFFFFFF, video::SColor colorBottom = 0xFFFFFFFF) = 0;
751
752 //! Adds a skybox scene node to the scene graph.
753 /** A skybox is a big cube with 6 textures on it and
754 is drawn around the camera position.
755 \param top: Texture for the top plane of the box.
756 \param bottom: Texture for the bottom plane of the box.
757 \param left: Texture for the left plane of the box.
758 \param right: Texture for the right plane of the box.
759 \param front: Texture for the front plane of the box.
760 \param back: Texture for the back plane of the box.
761 \param parent: Parent scene node of the skybox. A skybox usually has no parent,
762 so this should be null. Note: If a parent is set to the skybox, the box will not
763 change how it is drawn.
764 \param id: An id of the node. This id can be used to identify the node.
765 \return Pointer to the sky box if successful, otherwise NULL.
766 This pointer should not be dropped. See IReferenceCounted::drop() for more information. */
767 virtual ISceneNode* addSkyBoxSceneNode(video::ITexture* top, video::ITexture* bottom,
768 video::ITexture* left, video::ITexture* right, video::ITexture* front,
769 video::ITexture* back, ISceneNode* parent = 0, s32 id=-1) = 0;
770
771 //! Adds a skydome scene node to the scene graph.
772 /** A skydome is a large (half-) sphere with a panoramic texture
773 on the inside and is drawn around the camera position.
774 \param texture: Texture for the dome.
775 \param horiRes: Number of vertices of a horizontal layer of the sphere.
776 \param vertRes: Number of vertices of a vertical layer of the sphere.
777 \param texturePercentage: How much of the height of the
778 texture is used. Should be between 0 and 1.
779 \param spherePercentage: How much of the sphere is drawn.
780 Value should be between 0 and 2, where 1 is an exact
781 half-sphere and 2 is a full sphere.
782 \param radius The Radius of the sphere
783 \param parent: Parent scene node of the dome. A dome usually has no parent,
784 so this should be null. Note: If a parent is set, the dome will not
785 change how it is drawn.
786 \param id: An id of the node. This id can be used to identify the node.
787 \return Pointer to the sky dome if successful, otherwise NULL.
788 This pointer should not be dropped. See IReferenceCounted::drop() for more information. */
789 virtual ISceneNode* addSkyDomeSceneNode(video::ITexture* texture,
790 u32 horiRes=16, u32 vertRes=8,
791 f32 texturePercentage=0.9, f32 spherePercentage=2.0,f32 radius = 1000.f,
792 ISceneNode* parent=0, s32 id=-1) = 0;
793
794 //! Adds a particle system scene node to the scene graph.
795 /** \param withDefaultEmitter: Creates a default working point emitter
796 which emitts some particles. Set this to true to see a particle system
797 in action. If set to false, you'll have to set the emitter you want by
798 calling IParticleSystemSceneNode::setEmitter().
799 \param parent: Parent of the scene node. Can be NULL if no parent.
800 \param id: Id of the node. This id can be used to identify the scene node.
801 \param position: Position of the space relative to its parent where the
802 scene node will be placed.
803 \param rotation: Initital rotation of the scene node.
804 \param scale: Initial scale of the scene node.
805 \return Pointer to the created scene node.
806 This pointer should not be dropped. See IReferenceCounted::drop() for more information. */
807 virtual IParticleSystemSceneNode* addParticleSystemSceneNode(
808 bool withDefaultEmitter=true, ISceneNode* parent=0, s32 id=-1,
809 const core::vector3df& position = core::vector3df(0,0,0),
810 const core::vector3df& rotation = core::vector3df(0,0,0),
811 const core::vector3df& scale = core::vector3df(1.0f, 1.0f, 1.0f)) = 0;
812
813 //! Adds a terrain scene node to the scene graph.
814 /** This node implements is a simple terrain renderer which uses
815 a technique known as geo mip mapping
816 for reducing the detail of triangle blocks which are far away.
817 The code for the TerrainSceneNode is based on the terrain
818 renderer by Soconne and the GeoMipMapSceneNode developed by
819 Spintz. They made their code available for Irrlicht and allowed
820 it to be distributed under this licence. I only modified some
821 parts. A lot of thanks go to them.
822
823 This scene node is capable of loading terrains and updating
824 the indices at runtime to enable viewing very large terrains
825 very quickly. It uses a CLOD (Continuous Level of Detail)
826 algorithm which updates the indices for each patch based on
827 a LOD (Level of Detail) which is determined based on a patch's
828 distance from the camera.
829
830 The patch size of the terrain must always be a size of 2^N+1,
831 i.e. 8+1(9), 16+1(17), etc.
832 The MaxLOD available is directly dependent on the patch size
833 of the terrain. LOD 0 contains all of the indices to draw all
834 the triangles at the max detail for a patch. As each LOD goes
835 up by 1 the step taken, in generating indices increases by
836 -2^LOD, so for LOD 1, the step taken is 2, for LOD 2, the step
837 taken is 4, LOD 3 - 8, etc. The step can be no larger than
838 the size of the patch, so having a LOD of 8, with a patch size
839 of 17, is asking the algoritm to generate indices every 2^8 (
840 256 ) vertices, which is not possible with a patch size of 17.
841 The maximum LOD for a patch size of 17 is 2^4 ( 16 ). So,
842 with a MaxLOD of 5, you'll have LOD 0 ( full detail ), LOD 1 (
843 every 2 vertices ), LOD 2 ( every 4 vertices ), LOD 3 ( every
844 8 vertices ) and LOD 4 ( every 16 vertices ).
845 \param heightMapFileName: The name of the file on disk, to read vertex data from. This should
846 be a gray scale bitmap.
847 \param parent: Parent of the scene node. Can be 0 if no parent.
848 \param id: Id of the node. This id can be used to identify the scene node.
849 \param position: The absolute position of this node.
850 \param rotation: The absolute rotation of this node. ( NOT YET IMPLEMENTED )
851 \param scale: The scale factor for the terrain. If you're
852 using a heightmap of size 129x129 and would like your terrain
853 to be 12900x12900 in game units, then use a scale factor of (
854 core::vector ( 100.0f, 100.0f, 100.0f ). If you use a Y
855 scaling factor of 0.0f, then your terrain will be flat.
856 \param vertexColor: The default color of all the vertices. If no texture is associated
857 with the scene node, then all vertices will be this color. Defaults to white.
858 \param maxLOD: The maximum LOD (level of detail) for the node. Only change if you
859 know what you are doing, this might lead to strange behavior.
860 \param patchSize: patch size of the terrain. Only change if you
861 know what you are doing, this might lead to strange behavior.
862 \param smoothFactor: The number of times the vertices are smoothed.
863 \param addAlsoIfHeightmapEmpty: Add terrain node even with empty heightmap.
864 \return Pointer to the created scene node. Can be null
865 if the terrain could not be created, for example because the
866 heightmap could not be loaded. The returned pointer should
867 not be dropped. See IReferenceCounted::drop() for more
868 information. */
869 virtual ITerrainSceneNode* addTerrainSceneNode(
870 const io::path& heightMapFileName,
871 ISceneNode* parent=0, s32 id=-1,
872 const core::vector3df& position = core::vector3df(0.0f,0.0f,0.0f),
873 const core::vector3df& rotation = core::vector3df(0.0f,0.0f,0.0f),
874 const core::vector3df& scale = core::vector3df(1.0f,1.0f,1.0f),
875 video::SColor vertexColor = video::SColor(255,255,255,255),
876 s32 maxLOD=5, E_TERRAIN_PATCH_SIZE patchSize=ETPS_17, s32 smoothFactor=0,
877 bool addAlsoIfHeightmapEmpty = false) = 0;
878
879 //! Adds a terrain scene node to the scene graph.
880 /** Just like the other addTerrainSceneNode() method, but takes an IReadFile
881 pointer as parameter for the heightmap. For more informations take a look
882 at the other function.
883 \param heightMapFile: The file handle to read vertex data from. This should
884 be a gray scale bitmap.
885 \param parent: Parent of the scene node. Can be 0 if no parent.
886 \param id: Id of the node. This id can be used to identify the scene node.
887 \param position: The absolute position of this node.
888 \param rotation: The absolute rotation of this node. ( NOT YET IMPLEMENTED )
889 \param scale: The scale factor for the terrain. If you're
890 using a heightmap of size 129x129 and would like your terrain
891 to be 12900x12900 in game units, then use a scale factor of (
892 core::vector ( 100.0f, 100.0f, 100.0f ). If you use a Y
893 scaling factor of 0.0f, then your terrain will be flat.
894 \param vertexColor: The default color of all the vertices. If no texture is associated
895 with the scene node, then all vertices will be this color. Defaults to white.
896 \param maxLOD: The maximum LOD (level of detail) for the node. Only change if you
897 know what you are doing, this might lead to strange behavior.
898 \param patchSize: patch size of the terrain. Only change if you
899 know what you are doing, this might lead to strange behavior.
900 \param smoothFactor: The number of times the vertices are smoothed.
901 \param addAlsoIfHeightmapEmpty: Add terrain node even with empty heightmap.
902 \return Pointer to the created scene node. Can be null
903 if the terrain could not be created, for example because the
904 heightmap could not be loaded. The returned pointer should
905 not be dropped. See IReferenceCounted::drop() for more
906 information. */
907 virtual ITerrainSceneNode* addTerrainSceneNode(
908 io::IReadFile* heightMapFile,
909 ISceneNode* parent=0, s32 id=-1,
910 const core::vector3df& position = core::vector3df(0.0f,0.0f,0.0f),
911 const core::vector3df& rotation = core::vector3df(0.0f,0.0f,0.0f),
912 const core::vector3df& scale = core::vector3df(1.0f,1.0f,1.0f),
913 video::SColor vertexColor = video::SColor(255,255,255,255),
914 s32 maxLOD=5, E_TERRAIN_PATCH_SIZE patchSize=ETPS_17, s32 smoothFactor=0,
915 bool addAlsoIfHeightmapEmpty = false) = 0;
916
917 //! Adds a quake3 scene node to the scene graph.
918 /** A Quake3 Scene renders multiple meshes for a specific HighLanguage Shader (Quake3 Style )
919 \return Pointer to the quake3 scene node if successful, otherwise NULL.
920 This pointer should not be dropped. See IReferenceCounted::drop() for more information. */
921 virtual IMeshSceneNode* addQuake3SceneNode(const IMeshBuffer* meshBuffer, const quake3::IShader * shader,
922 ISceneNode* parent=0, s32 id=-1
923 ) = 0;
924
925
926 //! Adds an empty scene node to the scene graph.
927 /** Can be used for doing advanced transformations
928 or structuring the scene graph.
929 \return Pointer to the created scene node.
930 This pointer should not be dropped. See IReferenceCounted::drop() for more information. */
931 virtual ISceneNode* addEmptySceneNode(ISceneNode* parent=0, s32 id=-1) = 0;
932
933 //! Adds a dummy transformation scene node to the scene graph.
934 /** This scene node does not render itself, and does not respond to set/getPosition,
935 set/getRotation and set/getScale. Its just a simple scene node that takes a
936 matrix as relative transformation, making it possible to insert any transformation
937 anywhere into the scene graph.
938 \return Pointer to the created scene node.
939 This pointer should not be dropped. See IReferenceCounted::drop() for more information. */
940 virtual IDummyTransformationSceneNode* addDummyTransformationSceneNode(
941 ISceneNode* parent=0, s32 id=-1) = 0;
942
943 //! Adds a text scene node, which is able to display 2d text at a position in three dimensional space
944 virtual ITextSceneNode* addTextSceneNode(gui::IGUIFont* font, const wchar_t* text,
945 video::SColor color=video::SColor(100,255,255,255),
946 ISceneNode* parent = 0, const core::vector3df& position = core::vector3df(0,0,0),
947 s32 id=-1) = 0;
948
949 //! Adds a text scene node, which uses billboards. The node, and the text on it, will scale with distance.
950 /**
951 \param font The font to use on the billboard. Pass 0 to use the GUI environment's default font.
952 \param text The text to display on the billboard.
953 \param parent The billboard's parent. Pass 0 to use the root scene node.
954 \param size The billboard's width and height.
955 \param position The billboards position relative to its parent.
956 \param id: An id of the node. This id can be used to identify the node.
957 \param colorTop: The color of the vertices at the top of the billboard (default: white).
958 \param colorBottom: The color of the vertices at the bottom of the billboard (default: white).
959 \return Pointer to the billboard if successful, otherwise NULL.
960 This pointer should not be dropped. See IReferenceCounted::drop() for more information. */
961 virtual IBillboardTextSceneNode* addBillboardTextSceneNode( gui::IGUIFont* font, const wchar_t* text,
962 ISceneNode* parent = 0,
963 const core::dimension2d<f32>& size = core::dimension2d<f32>(10.0f, 10.0f),
964 const core::vector3df& position = core::vector3df(0,0,0), s32 id=-1,
965 video::SColor colorTop = 0xFFFFFFFF, video::SColor colorBottom = 0xFFFFFFFF) = 0;
966
967 //! Adds a Hill Plane mesh to the mesh pool.
968 /** The mesh is generated on the fly
969 and looks like a plane with some hills on it. It is uses mostly for quick
970 tests of the engine only. You can specify how many hills there should be
971 on the plane and how high they should be. Also you must specify a name for
972 the mesh, because the mesh is added to the mesh pool, and can be retrieved
973 again using ISceneManager::getMesh() with the name as parameter.
974 \param name: The name of this mesh which must be specified in order
975 to be able to retrieve the mesh later with ISceneManager::getMesh().
976 \param tileSize: Size of a tile of the mesh. (10.0f, 10.0f) would be a
977 good value to start, for example.
978 \param tileCount: Specifies how much tiles there will be. If you specifiy
979 for example that a tile has the size (10.0f, 10.0f) and the tileCount is
980 (10,10), than you get a field of 100 tiles which has the dimension 100.0fx100.0f.
981 \param material: Material of the hill mesh.
982 \param hillHeight: Height of the hills. If you specify a negative value
983 you will get holes instead of hills. If the height is 0, no hills will be
984 created.
985 \param countHills: Amount of hills on the plane. There will be countHills.X
986 hills along the X axis and countHills.Y along the Y axis. So in total there
987 will be countHills.X * countHills.Y hills.
988 \param textureRepeatCount: Defines how often the texture will be repeated in
989 x and y direction.
990 return Null if the creation failed. The reason could be that you
991 specified some invalid parameters or that a mesh with that name already
992 exists. If successful, a pointer to the mesh is returned.
993 This pointer should not be dropped. See IReferenceCounted::drop() for more information. */
994 virtual IAnimatedMesh* addHillPlaneMesh(const io::path& name,
995 const core::dimension2d<f32>& tileSize, const core::dimension2d<u32>& tileCount,
996 video::SMaterial* material = 0, f32 hillHeight = 0.0f,
997 const core::dimension2d<f32>& countHills = core::dimension2d<f32>(0.0f, 0.0f),
998 const core::dimension2d<f32>& textureRepeatCount = core::dimension2d<f32>(1.0f, 1.0f)) = 0;
999
1000 //! Adds a static terrain mesh to the mesh pool.
1001 /** The mesh is generated on the fly
1002 from a texture file and a height map file. Both files may be huge
1003 (8000x8000 pixels would be no problem) because the generator splits the
1004 files into smaller textures if necessary.
1005 You must specify a name for the mesh, because the mesh is added to the mesh pool,
1006 and can be retrieved again using ISceneManager::getMesh() with the name as parameter.
1007 \param meshname: The name of this mesh which must be specified in order
1008 to be able to retrieve the mesh later with ISceneManager::getMesh().
1009 \param texture: Texture for the terrain. Please note that this is not a
1010 hardware texture as usual (ITexture), but an IImage software texture.
1011 You can load this texture with IVideoDriver::createImageFromFile().
1012 \param heightmap: A grayscaled heightmap image. Like the texture,
1013 it can be created with IVideoDriver::createImageFromFile(). The amount
1014 of triangles created depends on the size of this texture, so use a small
1015 heightmap to increase rendering speed.
1016 \param stretchSize: Parameter defining how big a is pixel on the heightmap.
1017 \param maxHeight: Defines how high a white pixel on the heighmap is.
1018 \param defaultVertexBlockSize: Defines the initial dimension between vertices.
1019 \return Null if the creation failed. The reason could be that you
1020 specified some invalid parameters, that a mesh with that name already
1021 exists, or that a texture could not be found. If successful, a pointer to the mesh is returned.
1022 This pointer should not be dropped. See IReferenceCounted::drop() for more information. */
1023 virtual IAnimatedMesh* addTerrainMesh(const io::path& meshname,
1024 video::IImage* texture, video::IImage* heightmap,
1025 const core::dimension2d<f32>& stretchSize = core::dimension2d<f32>(10.0f,10.0f),
1026 f32 maxHeight=200.0f,
1027 const core::dimension2d<u32>& defaultVertexBlockSize = core::dimension2d<u32>(64,64)) = 0;
1028
1029 //! add a static arrow mesh to the meshpool
1030 /** \param name Name of the mesh
1031 \param vtxColorCylinder color of the cylinder
1032 \param vtxColorCone color of the cone
1033 \param tesselationCylinder Number of quads the cylinder side consists of
1034 \param tesselationCone Number of triangles the cone's roof consits of
1035 \param height Total height of the arrow
1036 \param cylinderHeight Total height of the cylinder, should be lesser than total height
1037 \param widthCylinder Diameter of the cylinder
1038 \param widthCone Diameter of the cone's base, should be not smaller than the cylinder's diameter
1039 \return Pointer to the arrow mesh if successful, otherwise 0.
1040 This pointer should not be dropped. See IReferenceCounted::drop() for more information. */
1041 virtual IAnimatedMesh* addArrowMesh(const io::path& name,
1042 video::SColor vtxColorCylinder=0xFFFFFFFF,
1043 video::SColor vtxColorCone=0xFFFFFFFF,
1044 u32 tesselationCylinder=4, u32 tesselationCone=8,
1045 f32 height=1.f, f32 cylinderHeight=0.6f,
1046 f32 widthCylinder=0.05f, f32 widthCone=0.3f) = 0;
1047
1048 //! add a static sphere mesh to the meshpool
1049 /** \param name Name of the mesh
1050 \param radius Radius of the sphere
1051 \param polyCountX Number of quads used for the horizontal tiling
1052 \param polyCountY Number of quads used for the vertical tiling
1053 \return Pointer to the sphere mesh if successful, otherwise 0.
1054 This pointer should not be dropped. See IReferenceCounted::drop() for more information. */
1055 virtual IAnimatedMesh* addSphereMesh(const io::path& name,
1056 f32 radius=5.f, u32 polyCountX = 16,
1057 u32 polyCountY = 16) = 0;
1058
1059 //! Add a volume light mesh to the meshpool
1060 /** \param name Name of the mesh
1061 \param SubdivideU Horizontal subdivision count
1062 \param SubdivideV Vertical subdivision count
1063 \param FootColor Color of the bottom of the light
1064 \param TailColor Color of the top of the light
1065 \return Pointer to the volume light mesh if successful, otherwise 0.
1066 This pointer should not be dropped. See IReferenceCounted::drop() for more information.
1067 */
1068 virtual IAnimatedMesh* addVolumeLightMesh(const io::path& name,
1069 const u32 SubdivideU = 32, const u32 SubdivideV = 32,
1070 const video::SColor FootColor = video::SColor(51, 0, 230, 180),
1071 const video::SColor TailColor = video::SColor(0, 0, 0, 0)) = 0;
1072
1073 //! Gets the root scene node.
1074 /** This is the scene node which is parent
1075 of all scene nodes. The root scene node is a special scene node which
1076 only exists to manage all scene nodes. It will not be rendered and cannot
1077 be removed from the scene.
1078 \return Pointer to the root scene node.
1079 This pointer should not be dropped. See IReferenceCounted::drop() for more information. */
1080 virtual ISceneNode* getRootSceneNode() = 0;
1081
1082 //! Get the first scene node with the specified id.
1083 /** \param id: The id to search for
1084 \param start: Scene node to start from. All children of this scene
1085 node are searched. If null is specified, the root scene node is
1086 taken.
1087 \return Pointer to the first scene node with this id,
1088 and null if no scene node could be found.
1089 This pointer should not be dropped. See IReferenceCounted::drop() for more information. */
1090 virtual ISceneNode* getSceneNodeFromId(s32 id, ISceneNode* start=0) = 0;
1091
1092 //! Get the first scene node with the specified name.
1093 /** \param name: The name to search for
1094 \param start: Scene node to start from. All children of this scene
1095 node are searched. If null is specified, the root scene node is
1096 taken.
1097 \return Pointer to the first scene node with this id,
1098 and null if no scene node could be found.
1099 This pointer should not be dropped. See IReferenceCounted::drop() for more information. */
1100 virtual ISceneNode* getSceneNodeFromName(const c8* name, ISceneNode* start=0) = 0;
1101
1102 //! Get the first scene node with the specified type.
1103 /** \param type: The type to search for
1104 \param start: Scene node to start from. All children of this scene
1105 node are searched. If null is specified, the root scene node is
1106 taken.
1107 \return Pointer to the first scene node with this type,
1108 and null if no scene node could be found.
1109 This pointer should not be dropped. See IReferenceCounted::drop() for more information. */
1110 virtual ISceneNode* getSceneNodeFromType(scene::ESCENE_NODE_TYPE type, ISceneNode* start=0) = 0;
1111
1112 //! Get scene nodes by type.
1113 /** \param type: Type of scene node to find (ESNT_ANY will return all child nodes).
1114 \param outNodes: array to be filled with results.
1115 \param start: Scene node to start from. All children of this scene
1116 node are searched. If null is specified, the root scene node is
1117 taken. */
1118 virtual void getSceneNodesFromType(ESCENE_NODE_TYPE type,
1119 core::array<scene::ISceneNode*>& outNodes,
1120 ISceneNode* start=0) = 0;
1121
1122 //! Get the current active camera.
1123 /** \return The active camera is returned. Note that this can
1124 be NULL, if there was no camera created yet.
1125 This pointer should not be dropped. See IReferenceCounted::drop() for more information. */
1126 virtual ICameraSceneNode* getActiveCamera() const =0;
1127
1128 //! Sets the currently active camera.
1129 /** The previous active camera will be deactivated.
1130 \param camera: The new camera which should be active. */
1131 virtual void setActiveCamera(ICameraSceneNode* camera) = 0;
1132
1133 //! Sets the color of stencil buffers shadows drawn by the scene manager.
1134 virtual void setShadowColor(video::SColor color = video::SColor(150,0,0,0)) = 0;
1135
1136 //! Get the current color of shadows.
1137 virtual video::SColor getShadowColor() const = 0;
1138
1139 //! Registers a node for rendering it at a specific time.
1140 /** This method should only be used by SceneNodes when they get a
1141 ISceneNode::OnRegisterSceneNode() call.
1142 \param node: Node to register for drawing. Usually scene nodes would set 'this'
1143 as parameter here because they want to be drawn.
1144 \param pass: Specifies when the node wants to be drawn in relation to the other nodes.
1145 For example, if the node is a shadow, it usually wants to be drawn after all other nodes
1146 and will use ESNRP_SHADOW for this. See scene::E_SCENE_NODE_RENDER_PASS for details.
1147 \return scene will be rendered ( passed culling ) */
1148 virtual u32 registerNodeForRendering(ISceneNode* node,
1149 E_SCENE_NODE_RENDER_PASS pass = ESNRP_AUTOMATIC) = 0;
1150
1151 //! Draws all the scene nodes.
1152 /** This can only be invoked between
1153 IVideoDriver::beginScene() and IVideoDriver::endScene(). Please note that
1154 the scene is not only drawn when calling this, but also animated
1155 by existing scene node animators, culling of scene nodes is done, etc. */
1156 virtual void drawAll() = 0;
1157
1158 //! Creates a rotation animator, which rotates the attached scene node around itself.
1159 /** \param rotationSpeed Specifies the speed of the animation in degree per 10 milliseconds.
1160 \return The animator. Attach it to a scene node with ISceneNode::addAnimator()
1161 and the animator will animate it.
1162 If you no longer need the animator, you should call ISceneNodeAnimator::drop().
1163 See IReferenceCounted::drop() for more information. */
1164 virtual ISceneNodeAnimator* createRotationAnimator(const core::vector3df& rotationSpeed) = 0;
1165
1166 //! Creates a fly circle animator, which lets the attached scene node fly around a center.
1167 /** \param center: Center of the circle.
1168 \param radius: Radius of the circle.
1169 \param speed: The orbital speed, in radians per millisecond.
1170 \param direction: Specifies the upvector used for alignment of the mesh.
1171 \param startPosition: The position on the circle where the animator will
1172 begin. Value is in multiples of a circle, i.e. 0.5 is half way around. (phase)
1173 \param radiusEllipsoid: if radiusEllipsoid != 0 then radius2 froms a ellipsoid
1174 begin. Value is in multiples of a circle, i.e. 0.5 is half way around. (phase)
1175 \return The animator. Attach it to a scene node with ISceneNode::addAnimator()
1176 and the animator will animate it.
1177 If you no longer need the animator, you should call ISceneNodeAnimator::drop().
1178 See IReferenceCounted::drop() for more information. */
1179 virtual ISceneNodeAnimator* createFlyCircleAnimator(
1180 const core::vector3df& center=core::vector3df(0.f,0.f,0.f),
1181 f32 radius=100.f, f32 speed=0.001f,
1182 const core::vector3df& direction=core::vector3df(0.f, 1.f, 0.f),
1183 f32 startPosition = 0.f,
1184 f32 radiusEllipsoid = 0.f) = 0;
1185
1186 //! Creates a fly straight animator, which lets the attached scene node fly or move along a line between two points.
1187 /** \param startPoint: Start point of the line.
1188 \param endPoint: End point of the line.
1189 \param timeForWay: Time in milli seconds how long the node should need to
1190 move from the start point to the end point.
1191 \param loop: If set to false, the node stops when the end point is reached.
1192 If loop is true, the node begins again at the start.
1193 \param pingpong Flag to set whether the animator should fly
1194 back from end to start again.
1195 \return The animator. Attach it to a scene node with ISceneNode::addAnimator()
1196 and the animator will animate it.
1197 If you no longer need the animator, you should call ISceneNodeAnimator::drop().
1198 See IReferenceCounted::drop() for more information. */
1199 virtual ISceneNodeAnimator* createFlyStraightAnimator(const core::vector3df& startPoint,
1200 const core::vector3df& endPoint, u32 timeForWay, bool loop=false, bool pingpong = false) = 0;
1201
1202 //! Creates a texture animator, which switches the textures of the target scene node based on a list of textures.
1203 /** \param textures: List of textures to use.
1204 \param timePerFrame: Time in milliseconds, how long any texture in the list
1205 should be visible.
1206 \param loop: If set to to false, the last texture remains set, and the animation
1207 stops. If set to true, the animation restarts with the first texture.
1208 \return The animator. Attach it to a scene node with ISceneNode::addAnimator()
1209 and the animator will animate it.
1210 If you no longer need the animator, you should call ISceneNodeAnimator::drop().
1211 See IReferenceCounted::drop() for more information. */
1212 virtual ISceneNodeAnimator* createTextureAnimator(const core::array<video::ITexture*>& textures,
1213 s32 timePerFrame, bool loop=true) = 0;
1214
1215 //! Creates a scene node animator, which deletes the scene node after some time automatically.
1216 /** \param timeMs: Time in milliseconds, after when the node will be deleted.
1217 \return The animator. Attach it to a scene node with ISceneNode::addAnimator()
1218 and the animator will animate it.
1219 If you no longer need the animator, you should call ISceneNodeAnimator::drop().
1220 See IReferenceCounted::drop() for more information. */
1221 virtual ISceneNodeAnimator* createDeleteAnimator(u32 timeMs) = 0;
1222
1223 //! Creates a special scene node animator for doing automatic collision detection and response.
1224 /** See ISceneNodeAnimatorCollisionResponse for details.
1225 \param world: Triangle selector holding all triangles of the world with which
1226 the scene node may collide. You can create a triangle selector with
1227 ISceneManager::createTriangleSelector();
1228 \param sceneNode: SceneNode which should be manipulated. After you added this animator
1229 to the scene node, the scene node will not be able to move through walls and is
1230 affected by gravity. If you need to teleport the scene node to a new position without
1231 it being effected by the collision geometry, then call sceneNode->setPosition(); then
1232 animator->setTargetNode(sceneNode);
1233 \param ellipsoidRadius: Radius of the ellipsoid with which collision detection and
1234 response is done. If you have got a scene node, and you are unsure about
1235 how big the radius should be, you could use the following code to determine
1236 it:
1237 \code
1238 const core::aabbox3d<f32>& box = yourSceneNode->getBoundingBox();
1239 core::vector3df radius = box.MaxEdge - box.getCenter();
1240 \endcode
1241 \param gravityPerSecond: Sets the gravity of the environment, as an acceleration in
1242 units per second per second. If your units are equivalent to metres, then
1243 core::vector3df(0,-10.0f,0) would give an approximately realistic gravity.
1244 You can disable gravity by setting it to core::vector3df(0,0,0).
1245 \param ellipsoidTranslation: By default, the ellipsoid for collision detection is created around
1246 the center of the scene node, which means that the ellipsoid surrounds
1247 it completely. If this is not what you want, you may specify a translation
1248 for the ellipsoid.
1249 \param slidingValue: DOCUMENTATION NEEDED.
1250 \return The animator. Attach it to a scene node with ISceneNode::addAnimator()
1251 and the animator will cause it to do collision detection and response.
1252 If you no longer need the animator, you should call ISceneNodeAnimator::drop().
1253 See IReferenceCounted::drop() for more information. */
1254 virtual ISceneNodeAnimatorCollisionResponse* createCollisionResponseAnimator(
1255 ITriangleSelector* world, ISceneNode* sceneNode,
1256 const core::vector3df& ellipsoidRadius = core::vector3df(30,60,30),
1257 const core::vector3df& gravityPerSecond = core::vector3df(0,-10.0f,0),
1258 const core::vector3df& ellipsoidTranslation = core::vector3df(0,0,0),
1259 f32 slidingValue = 0.0005f) = 0;
1260
1261 //! Creates a follow spline animator.
1262 /** The animator modifies the position of
1263 the attached scene node to make it follow a hermite spline.
1264 It uses a subset of hermite splines: either cardinal splines
1265 (tightness != 0.5) or catmull-rom-splines (tightness == 0.5).
1266 The animator moves from one control point to the next in
1267 1/speed seconds. This code was sent in by Matthias Gall.
1268 If you no longer need the animator, you should call ISceneNodeAnimator::drop().
1269 See IReferenceCounted::drop() for more information. */
1270 virtual ISceneNodeAnimator* createFollowSplineAnimator(s32 startTime,
1271 const core::array< core::vector3df >& points,
1272 f32 speed = 1.0f, f32 tightness = 0.5f, bool loop=true, bool pingpong=false) = 0;
1273
1274 //! Creates a simple ITriangleSelector, based on a mesh.
1275 /** Triangle selectors
1276 can be used for doing collision detection. Don't use this selector
1277 for a huge amount of triangles like in Quake3 maps.
1278 Instead, use for example ISceneManager::createOctreeTriangleSelector().
1279 Please note that the created triangle selector is not automaticly attached
1280 to the scene node. You will have to call ISceneNode::setTriangleSelector()
1281 for this. To create and attach a triangle selector is done like this:
1282 \code
1283 ITriangleSelector* s = sceneManager->createTriangleSelector(yourMesh,
1284 yourSceneNode);
1285 yourSceneNode->setTriangleSelector(s);
1286 s->drop();
1287 \endcode
1288 \param mesh: Mesh of which the triangles are taken.
1289 \param node: Scene node of which visibility and transformation is used.
1290 \return The selector, or null if not successful.
1291 If you no longer need the selector, you should call ITriangleSelector::drop().
1292 See IReferenceCounted::drop() for more information. */
1293 virtual ITriangleSelector* createTriangleSelector(IMesh* mesh, ISceneNode* node) = 0;
1294
1295 //! Creates a simple ITriangleSelector, based on an animated mesh scene node.
1296 /** Details of the mesh associated with the node will be extracted internally.
1297 Call ITriangleSelector::update() to have the triangle selector updated based
1298 on the current frame of the animated mesh scene node.
1299 \param node The animated mesh scene node from which to build the selector
1300 */
1301 virtual ITriangleSelector* createTriangleSelector(IAnimatedMeshSceneNode* node) = 0;
1302
1303
1304 //! Creates a simple dynamic ITriangleSelector, based on a axis aligned bounding box.
1305 /** Triangle selectors
1306 can be used for doing collision detection. Every time when triangles are
1307 queried, the triangle selector gets the bounding box of the scene node,
1308 an creates new triangles. In this way, it works good with animated scene nodes.
1309 \param node: Scene node of which the bounding box, visibility and transformation is used.
1310 \return The selector, or null if not successful.
1311 If you no longer need the selector, you should call ITriangleSelector::drop().
1312 See IReferenceCounted::drop() for more information. */
1313 virtual ITriangleSelector* createTriangleSelectorFromBoundingBox(ISceneNode* node) = 0;
1314
1315 //! Creates a Triangle Selector, optimized by an octree.
1316 /** Triangle selectors
1317 can be used for doing collision detection. This triangle selector is
1318 optimized for huge amounts of triangle, it organizes them in an octree.
1319 Please note that the created triangle selector is not automaticly attached
1320 to the scene node. You will have to call ISceneNode::setTriangleSelector()
1321 for this. To create and attach a triangle selector is done like this:
1322 \code
1323 ITriangleSelector* s = sceneManager->createOctreeTriangleSelector(yourMesh,
1324 yourSceneNode);
1325 yourSceneNode->setTriangleSelector(s);
1326 s->drop();
1327 \endcode
1328 For more informations and examples on this, take a look at the collision
1329 tutorial in the SDK.
1330 \param mesh: Mesh of which the triangles are taken.
1331 \param node: Scene node of which visibility and transformation is used.
1332 \param minimalPolysPerNode: Specifies the minimal polygons contained a octree node.
1333 If a node gets less polys the this value, it will not be splitted into
1334 smaller nodes.
1335 \return The selector, or null if not successful.
1336 If you no longer need the selector, you should call ITriangleSelector::drop().
1337 See IReferenceCounted::drop() for more information. */
1338 virtual ITriangleSelector* createOctreeTriangleSelector(IMesh* mesh,
1339 ISceneNode* node, s32 minimalPolysPerNode=32) = 0;
1340
1341 //! //! Creates a Triangle Selector, optimized by an octree.
1342 /** \deprecated Use createOctreeTriangleSelector instead. This method may be removed by Irrlicht 1.9. */
1343 _IRR_DEPRECATED_ ITriangleSelector* createOctTreeTriangleSelector(IMesh* mesh,
1344 ISceneNode* node, s32 minimalPolysPerNode=32)
1345 {
1346 return createOctreeTriangleSelector(mesh, node, minimalPolysPerNode);
1347 }
1348
1349 //! Creates a meta triangle selector.
1350 /** A meta triangle selector is nothing more than a
1351 collection of one or more triangle selectors providing together
1352 the interface of one triangle selector. In this way,
1353 collision tests can be done with different triangle soups in one pass.
1354 \return The selector, or null if not successful.
1355 If you no longer need the selector, you should call ITriangleSelector::drop().
1356 See IReferenceCounted::drop() for more information. */
1357 virtual IMetaTriangleSelector* createMetaTriangleSelector() = 0;
1358
1359 //! Creates a triangle selector which can select triangles from a terrain scene node.
1360 /** \param node: Pointer to the created terrain scene node
1361 \param LOD: Level of detail, 0 for highest detail.
1362 \return The selector, or null if not successful.
1363 If you no longer need the selector, you should call ITriangleSelector::drop().
1364 See IReferenceCounted::drop() for more information. */
1365 virtual ITriangleSelector* createTerrainTriangleSelector(
1366 ITerrainSceneNode* node, s32 LOD=0) = 0;
1367
1368 //! Adds an external mesh loader for extending the engine with new file formats.
1369 /** If you want the engine to be extended with
1370 file formats it currently is not able to load (e.g. .cob), just implement
1371 the IMeshLoader interface in your loading class and add it with this method.
1372 Using this method it is also possible to override built-in mesh loaders with
1373 newer or updated versions without the need to recompile the engine.
1374 \param externalLoader: Implementation of a new mesh loader. */
1375 virtual void addExternalMeshLoader(IMeshLoader* externalLoader) = 0;
1376
1377 //! Returns the number of mesh loaders supported by Irrlicht at this time
1378 virtual u32 getMeshLoaderCount() const = 0;
1379
1380 //! Retrieve the given mesh loader
1381 /** \param index The index of the loader to retrieve. This parameter is an 0-based
1382 array index.
1383 \return A pointer to the specified loader, 0 if the index is incorrect. */
1384 virtual IMeshLoader* getMeshLoader(u32 index) const = 0;
1385
1386 //! Adds an external scene loader for extending the engine with new file formats.
1387 /** If you want the engine to be extended with
1388 file formats it currently is not able to load (e.g. .vrml), just implement
1389 the ISceneLoader interface in your loading class and add it with this method.
1390 Using this method it is also possible to override the built-in scene loaders
1391 with newer or updated versions without the need to recompile the engine.
1392 \param externalLoader: Implementation of a new mesh loader. */
1393 virtual void addExternalSceneLoader(ISceneLoader* externalLoader) = 0;
1394
1395 //! Returns the number of scene loaders supported by Irrlicht at this time
1396 virtual u32 getSceneLoaderCount() const = 0;
1397
1398 //! Retrieve the given scene loader
1399 /** \param index The index of the loader to retrieve. This parameter is an 0-based
1400 array index.
1401 \return A pointer to the specified loader, 0 if the index is incorrect. */
1402 virtual ISceneLoader* getSceneLoader(u32 index) const = 0;
1403
1404 //! Get pointer to the scene collision manager.
1405 /** \return Pointer to the collision manager
1406 This pointer should not be dropped. See IReferenceCounted::drop() for more information. */
1407 virtual ISceneCollisionManager* getSceneCollisionManager() = 0;
1408
1409 //! Get pointer to the mesh manipulator.
1410 /** \return Pointer to the mesh manipulator
1411 This pointer should not be dropped. See IReferenceCounted::drop() for more information. */
1412 virtual IMeshManipulator* getMeshManipulator() = 0;
1413
1414 //! Adds a scene node to the deletion queue.
1415 /** The scene node is immediatly
1416 deleted when it's secure. Which means when the scene node does not
1417 execute animators and things like that. This method is for example
1418 used for deleting scene nodes by their scene node animators. In
1419 most other cases, a ISceneNode::remove() call is enough, using this
1420 deletion queue is not necessary.
1421 See ISceneManager::createDeleteAnimator() for details.
1422 \param node: Node to detete. */
1423 virtual void addToDeletionQueue(ISceneNode* node) = 0;
1424
1425 //! Posts an input event to the environment.
1426 /** Usually you do not have to
1427 use this method, it is used by the internal engine. */
1428 virtual bool postEventFromUser(const SEvent& event) = 0;
1429
1430 //! Clears the whole scene.
1431 /** All scene nodes are removed. */
1432 virtual void clear() = 0;
1433
1434 //! Get interface to the parameters set in this scene.
1435 /** String parameters can be used by plugins and mesh loaders.
1436 For example the CMS and LMTS loader want a parameter named 'CSM_TexturePath'
1437 and 'LMTS_TexturePath' set to the path were attached textures can be found. See
1438 CSM_TEXTURE_PATH, LMTS_TEXTURE_PATH, MY3D_TEXTURE_PATH,
1439 COLLADA_CREATE_SCENE_INSTANCES, DMF_TEXTURE_PATH and DMF_USE_MATERIALS_DIRS*/
1440 virtual io::IAttributes* getParameters() = 0;
1441
1442 //! Get current render pass.
1443 /** All scene nodes are being rendered in a specific order.
1444 First lights, cameras, sky boxes, solid geometry, and then transparent
1445 stuff. During the rendering process, scene nodes may want to know what the scene
1446 manager is rendering currently, because for example they registered for rendering
1447 twice, once for transparent geometry and once for solid. When knowing what rendering
1448 pass currently is active they can render the correct part of their geometry. */
1449 virtual E_SCENE_NODE_RENDER_PASS getSceneNodeRenderPass() const = 0;
1450
1451 //! Get the default scene node factory which can create all built in scene nodes
1452 /** \return Pointer to the default scene node factory
1453 This pointer should not be dropped. See IReferenceCounted::drop() for more information. */
1454 virtual ISceneNodeFactory* getDefaultSceneNodeFactory() = 0;
1455
1456 //! Adds a scene node factory to the scene manager.
1457 /** Use this to extend the scene manager with new scene node types which it should be
1458 able to create automaticly, for example when loading data from xml files. */
1459 virtual void registerSceneNodeFactory(ISceneNodeFactory* factoryToAdd) = 0;
1460
1461 //! Get amount of registered scene node factories.
1462 virtual u32 getRegisteredSceneNodeFactoryCount() const = 0;
1463
1464 //! Get a scene node factory by index
1465 /** \return Pointer to the requested scene node factory, or 0 if it does not exist.
1466 This pointer should not be dropped. See IReferenceCounted::drop() for more information. */
1467 virtual ISceneNodeFactory* getSceneNodeFactory(u32 index) = 0;
1468
1469 //! Get the default scene node animator factory which can create all built-in scene node animators
1470 /** \return Pointer to the default scene node animator factory
1471 This pointer should not be dropped. See IReferenceCounted::drop() for more information. */
1472 virtual ISceneNodeAnimatorFactory* getDefaultSceneNodeAnimatorFactory() = 0;
1473
1474 //! Adds a scene node animator factory to the scene manager.
1475 /** Use this to extend the scene manager with new scene node animator types which it should be
1476 able to create automaticly, for example when loading data from xml files. */
1477 virtual void registerSceneNodeAnimatorFactory(ISceneNodeAnimatorFactory* factoryToAdd) = 0;
1478
1479 //! Get amount of registered scene node animator factories.
1480 virtual u32 getRegisteredSceneNodeAnimatorFactoryCount() const = 0;
1481
1482 //! Get scene node animator factory by index
1483 /** \return Pointer to the requested scene node animator factory, or 0 if it does not exist.
1484 This pointer should not be dropped. See IReferenceCounted::drop() for more information. */
1485 virtual ISceneNodeAnimatorFactory* getSceneNodeAnimatorFactory(u32 index) = 0;
1486
1487 //! Get typename from a scene node type or null if not found
1488 virtual const c8* getSceneNodeTypeName(ESCENE_NODE_TYPE type) = 0;
1489
1490 //! Returns a typename from a scene node animator type or null if not found
1491 virtual const c8* getAnimatorTypeName(ESCENE_NODE_ANIMATOR_TYPE type) = 0;
1492
1493 //! Adds a scene node to the scene by name
1494 /** \return Pointer to the scene node added by a factory
1495 This pointer should not be dropped. See IReferenceCounted::drop() for more information. */
1496 virtual ISceneNode* addSceneNode(const char* sceneNodeTypeName, ISceneNode* parent=0) = 0;
1497
1498 //! creates a scene node animator based on its type name
1499 /** \param typeName: Type of the scene node animator to add.
1500 \param target: Target scene node of the new animator.
1501 \return Returns pointer to the new scene node animator or null if not successful. You need to
1502 drop this pointer after calling this, see IReferenceCounted::drop() for details. */
1503 virtual ISceneNodeAnimator* createSceneNodeAnimator(const char* typeName, ISceneNode* target=0) = 0;
1504
1505 //! Creates a new scene manager.
1506 /** This can be used to easily draw and/or store two
1507 independent scenes at the same time. The mesh cache will be
1508 shared between all existing scene managers, which means if you
1509 load a mesh in the original scene manager using for example
1510 getMesh(), the mesh will be available in all other scene
1511 managers too, without loading.
1512 The original/main scene manager will still be there and
1513 accessible via IrrlichtDevice::getSceneManager(). If you need
1514 input event in this new scene manager, for example for FPS
1515 cameras, you'll need to forward input to this manually: Just
1516 implement an IEventReceiver and call
1517 yourNewSceneManager->postEventFromUser(), and return true so
1518 that the original scene manager doesn't get the event.
1519 Otherwise, all input will go to the main scene manager
1520 automatically.
1521 If you no longer need the new scene manager, you should call
1522 ISceneManager::drop().
1523 See IReferenceCounted::drop() for more information. */
1524 virtual ISceneManager* createNewSceneManager(bool cloneContent=false) = 0;
1525
1526 //! Saves the current scene into a file.
1527 /** Scene nodes with the option isDebugObject set to true are
1528 not being saved. The scene is usually written to an .irr file,
1529 an xml based format. .irr files can Be edited with the Irrlicht
1530 Engine Editor, irrEdit (http://www.ambiera.com/irredit/). To
1531 load .irr files again, see ISceneManager::loadScene().
1532 \param filename Name of the file.
1533 \param userDataSerializer If you want to save some user data
1534 for every scene node into the file, implement the
1535 ISceneUserDataSerializer interface and provide it as parameter
1536 here. Otherwise, simply specify 0 as this parameter.
1537 \param node Node which is taken as the top node of the scene.
1538 This node and all of its descendants are saved into the scene
1539 file. Pass 0 or the scene manager to save the full scene (which
1540 is also the default).
1541 \return True if successful. */
1542 virtual bool saveScene(const io::path& filename, ISceneUserDataSerializer* userDataSerializer=0, ISceneNode* node=0) = 0;
1543
1544 //! Saves the current scene into a file.
1545 /** Scene nodes with the option isDebugObject set to true are
1546 not being saved. The scene is usually written to an .irr file,
1547 an xml based format. .irr files can Be edited with the Irrlicht
1548 Engine Editor, irrEdit (http://www.ambiera.com/irredit/). To
1549 load .irr files again, see ISceneManager::loadScene().
1550 \param file File where the scene is saved into.
1551 \param userDataSerializer If you want to save some user data
1552 for every scene node into the file, implement the
1553 ISceneUserDataSerializer interface and provide it as parameter
1554 here. Otherwise, simply specify 0 as this parameter.
1555 \param node Node which is taken as the top node of the scene.
1556 This node and all of its descendants are saved into the scene
1557 file. Pass 0 or the scene manager to save the full scene (which
1558 is also the default).
1559 \return True if successful. */
1560 virtual bool saveScene(io::IWriteFile* file, ISceneUserDataSerializer* userDataSerializer=0, ISceneNode* node=0) = 0;
1561
1562 //! Saves the current scene into a file.
1563 /** Scene nodes with the option isDebugObject set to true are
1564 not being saved. The scene is usually written to an .irr file,
1565 an xml based format. .irr files can Be edited with the Irrlicht
1566 Engine Editor, irrEdit (http://www.ambiera.com/irredit/). To
1567 load .irr files again, see ISceneManager::loadScene().
1568 \param writer XMLWriter with which the scene is saved.
1569 \param currentPath Path which is used for relative file names.
1570 Usually the directory of the file written into.
1571 \param userDataSerializer If you want to save some user data
1572 for every scene node into the file, implement the
1573 ISceneUserDataSerializer interface and provide it as parameter
1574 here. Otherwise, simply specify 0 as this parameter.
1575 \param node Node which is taken as the top node of the scene.
1576 This node and all of its descendants are saved into the scene
1577 file. Pass 0 or the scene manager to save the full scene (which
1578 is also the default).
1579 \return True if successful. */
1580 virtual bool saveScene(io::IXMLWriter* writer, const io::path& currentPath, ISceneUserDataSerializer* userDataSerializer=0, ISceneNode* node=0) = 0;
1581
1582 //! Loads a scene. Note that the current scene is not cleared before.
1583 /** The scene is usually loaded from an .irr file, an xml based
1584 format, but other scene formats can be added to the engine via
1585 ISceneManager::addExternalSceneLoader. .irr files can Be edited
1586 with the Irrlicht Engine Editor, irrEdit
1587 (http://www.ambiera.com/irredit/) or saved directly by the engine
1588 using ISceneManager::saveScene().
1589 \param filename Name of the file to load from.
1590 \param userDataSerializer If you want to load user data
1591 possibily saved in that file for some scene nodes in the file,
1592 implement the ISceneUserDataSerializer interface and provide it
1593 as parameter here. Otherwise, simply specify 0 as this
1594 parameter.
1595 \param rootNode Node which is taken as the root node of the
1596 scene. Pass 0 to add the scene directly to the scene manager
1597 (which is also the default).
1598 \return True if successful. */
1599 virtual bool loadScene(const io::path& filename, ISceneUserDataSerializer* userDataSerializer=0, ISceneNode* rootNode=0) = 0;
1600
1601 //! Loads a scene. Note that the current scene is not cleared before.
1602 /** The scene is usually loaded from an .irr file, an xml based
1603 format, but other scene formats can be added to the engine via
1604 ISceneManager::addExternalSceneLoader. .irr files can Be edited
1605 with the Irrlicht Engine Editor, irrEdit
1606 (http://www.ambiera.com/irredit/) or saved directly by the engine
1607 using ISceneManager::saveScene().
1608 \param file File where the scene is loaded from.
1609 \param userDataSerializer If you want to load user data
1610 possibily saved in that file for some scene nodes in the file,
1611 implement the ISceneUserDataSerializer interface and provide it
1612 as parameter here. Otherwise, simply specify 0 as this
1613 parameter.
1614 \param rootNode Node which is taken as the root node of the
1615 scene. Pass 0 to add the scene directly to the scene manager
1616 (which is also the default).
1617 \return True if successful. */
1618 virtual bool loadScene(io::IReadFile* file, ISceneUserDataSerializer* userDataSerializer=0, ISceneNode* rootNode=0) = 0;
1619
1620 //! Get a mesh writer implementation if available
1621 /** Note: You need to drop() the pointer after use again, see IReferenceCounted::drop()
1622 for details. */
1623 virtual IMeshWriter* createMeshWriter(EMESH_WRITER_TYPE type) = 0;
1624
1625 //! Get a skinned mesh, which is not available as header-only code
1626 /** Note: You need to drop() the pointer after use again, see IReferenceCounted::drop()
1627 for details. */
1628 virtual ISkinnedMesh* createSkinnedMesh() = 0;
1629
1630 //! Sets ambient color of the scene
1631 virtual void setAmbientLight(const video::SColorf &ambientColor) = 0;
1632
1633 //! Get ambient color of the scene
1634 virtual const video::SColorf& getAmbientLight() const = 0;
1635
1636 //! Register a custom callbacks manager which gets callbacks during scene rendering.
1637 /** \param[in] lightManager: the new callbacks manager. You may pass 0 to remove the
1638 current callbacks manager and restore the default behavior. */
1639 virtual void setLightManager(ILightManager* lightManager) = 0;
1640
1641 //! Get an instance of a geometry creator.
1642 /** The geometry creator provides some helper methods to create various types of
1643 basic geometry. This can be useful for custom scene nodes. */
1644 virtual const IGeometryCreator* getGeometryCreator(void) const = 0;
1645
1646 //! Check if node is culled in current view frustum
1647 /** Please note that depending on the used culling method this
1648 check can be rather coarse, or slow. A positive result is
1649 correct, though, i.e. if this method returns true the node is
1650 positively not visible. The node might still be invisible even
1651 if this method returns false.
1652 \param node The scene node which is checked for culling.
1653 \return True if node is not visible in the current scene, else
1654 false. */
1655 virtual bool isCulled(const ISceneNode* node) const =0;
1656 };
1657
1658
1659} // end namespace scene
1660} // end namespace irr
1661
1662#endif
1663