Home | Namespaces | Hierarchy | Alphabetical List | Class list | Files | Namespace Members | Class members | File members | Tutorials
ISceneManager.h
Go to the documentation of this file.
1 // Copyright (C) 2002-2010 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"
18 #include "EMeshWriterEnums.h"
19 #include "SceneParameters.h"
20 #include "IGeometryCreator.h"
21 #include "ISkinnedMesh.h"
22 
23 namespace irr
24 {
25  struct SKeyMap;
26  struct SEvent;
27 
28 namespace io
29 {
30  class IReadFile;
31  class IAttributes;
32  class IWriteFile;
33  class IFileSystem;
34 } // end namespace io
35 
36 namespace gui
37 {
38  class IGUIFont;
39  class IGUIEnvironment;
40 } // end namespace gui
41 
42 namespace video
43 {
44  class IVideoDriver;
45  class SMaterial;
46  class IImage;
47  class ITexture;
48 } // end namespace video
49 
50 namespace scene
51 {
52  class IMeshWriter;
53 
55 
58  {
61 
64 
67 
70 
72 
85 
88 
91 
94 
97  };
98 
99  class IMesh;
100  class IMeshBuffer;
101  class IAnimatedMesh;
102  class IMeshCache;
103  class ISceneNode;
104  class ICameraSceneNode;
105  class IAnimatedMeshSceneNode;
106  class ISceneNodeAnimator;
107  class ISceneNodeAnimatorCollisionResponse;
108  class ILightSceneNode;
109  class IBillboardSceneNode;
110  class ITerrainSceneNode;
111  class IMeshSceneNode;
112  class IMeshLoader;
113  class ISceneCollisionManager;
114  class IParticleSystemSceneNode;
115  class IDummyTransformationSceneNode;
116  class ITriangleSelector;
117  class IMetaTriangleSelector;
118  class IMeshManipulator;
119  class ITextSceneNode;
120  class IBillboardTextSceneNode;
121  class IVolumeLightSceneNode;
122  class ISceneNodeFactory;
123  class ISceneNodeAnimatorFactory;
124  class ISceneUserDataSerializer;
125  class ILightManager;
126 
127  namespace quake3
128  {
129  struct IShader;
130  } // end namespace quake3
131 
133 
150  class ISceneManager : public virtual IReferenceCounted
151  {
152  public:
153 
155  virtual ~ISceneManager() {}
156 
158 
347  virtual IAnimatedMesh* getMesh(const io::path& filename) = 0;
348 
350 
356  virtual IAnimatedMesh* getMesh(io::IReadFile* file) = 0;
357 
359 
362  virtual IMeshCache* getMeshCache() = 0;
363 
365 
367  virtual video::IVideoDriver* getVideoDriver() = 0;
368 
370 
373 
375 
377  virtual io::IFileSystem* getFileSystem() = 0;
378 
380 
394  const u32 subdivU = 32, const u32 subdivV = 32,
395  const video::SColor foot = video::SColor(51, 0, 230, 180),
396  const video::SColor tail = video::SColor(0, 0, 0, 0),
397  const core::vector3df& position = core::vector3df(0,0,0),
398  const core::vector3df& rotation = core::vector3df(0,0,0),
399  const core::vector3df& scale = core::vector3df(1.0f, 1.0f, 1.0f)) = 0;
400 
402 
412  virtual IMeshSceneNode* addCubeSceneNode(f32 size=10.0f, ISceneNode* parent=0, s32 id=-1,
413  const core::vector3df& position = core::vector3df(0,0,0),
414  const core::vector3df& rotation = core::vector3df(0,0,0),
415  const core::vector3df& scale = core::vector3df(1.0f, 1.0f, 1.0f)) = 0;
416 
418 
432  virtual IMeshSceneNode* addSphereSceneNode(f32 radius=5.0f, s32 polyCount=16,
433  ISceneNode* parent=0, s32 id=-1,
434  const core::vector3df& position = core::vector3df(0,0,0),
435  const core::vector3df& rotation = core::vector3df(0,0,0),
436  const core::vector3df& scale = core::vector3df(1.0f, 1.0f, 1.0f)) = 0;
437 
439 
450  ISceneNode* parent=0, s32 id=-1,
451  const core::vector3df& position = core::vector3df(0,0,0),
452  const core::vector3df& rotation = core::vector3df(0,0,0),
453  const core::vector3df& scale = core::vector3df(1.0f, 1.0f, 1.0f),
454  bool alsoAddIfMeshPointerZero=false) = 0;
455 
457 
467  virtual IMeshSceneNode* addMeshSceneNode(IMesh* mesh, ISceneNode* parent=0, s32 id=-1,
468  const core::vector3df& position = core::vector3df(0,0,0),
469  const core::vector3df& rotation = core::vector3df(0,0,0),
470  const core::vector3df& scale = core::vector3df(1.0f, 1.0f, 1.0f),
471  bool alsoAddIfMeshPointerZero=false) = 0;
472 
474 
489  f32 waveHeight=2.0f, f32 waveSpeed=300.0f, f32 waveLength=10.0f,
490  ISceneNode* parent=0, s32 id=-1,
491  const core::vector3df& position = core::vector3df(0,0,0),
492  const core::vector3df& rotation = core::vector3df(0,0,0),
493  const core::vector3df& scale = core::vector3df(1.0f, 1.0f, 1.0f)) = 0;
494 
495 
497 
509  virtual IMeshSceneNode* addOctreeSceneNode(IAnimatedMesh* mesh, ISceneNode* parent=0,
510  s32 id=-1, s32 minimalPolysPerNode=512, bool alsoAddIfMeshPointerZero=false) = 0;
511 
513 
515  s32 id=-1, s32 minimalPolysPerNode=512, bool alsoAddIfMeshPointerZero=false)
516  {
517  return addOctreeSceneNode(mesh, parent, id, minimalPolysPerNode, alsoAddIfMeshPointerZero);
518  }
519 
521 
533  virtual IMeshSceneNode* addOctreeSceneNode(IMesh* mesh, ISceneNode* parent=0,
534  s32 id=-1, s32 minimalPolysPerNode=256, bool alsoAddIfMeshPointerZero=false) = 0;
535 
537 
539  s32 id=-1, s32 minimalPolysPerNode=256, bool alsoAddIfMeshPointerZero=false)
540  {
541  return addOctreeSceneNode(mesh, parent, id, minimalPolysPerNode, alsoAddIfMeshPointerZero);
542  }
543 
545 
561  virtual ICameraSceneNode* addCameraSceneNode(ISceneNode* parent = 0,
562  const core::vector3df& position = core::vector3df(0,0,0),
563  const core::vector3df& lookat = core::vector3df(0,0,100),
564  s32 id=-1, bool makeActive=true) = 0;
565 
567 
579  f32 rotateSpeed = -1500.0f, f32 zoomSpeed = 200.0f,
580  f32 translationSpeed = 1500.0f, s32 id=-1,
581  bool makeActive=true) = 0;
582 
584 
648  f32 rotateSpeed = 100.0f, f32 moveSpeed = 0.5f, s32 id=-1,
649  SKeyMap* keyMapArray=0, s32 keyMapSize=0, bool noVerticalMovement=false,
650  f32 jumpSpeed = 0.f, bool invertMouse=false,
651  bool makeActive=true) = 0;
652 
654 
666  virtual ILightSceneNode* addLightSceneNode(ISceneNode* parent = 0,
667  const core::vector3df& position = core::vector3df(0,0,0),
668  video::SColorf color = video::SColorf(1.0f, 1.0f, 1.0f),
669  f32 radius=100.0f, s32 id=-1) = 0;
670 
672 
691  const core::dimension2d<f32>& size = core::dimension2d<f32>(10.0f, 10.0f),
692  const core::vector3df& position = core::vector3df(0,0,0), s32 id=-1,
693  video::SColor colorTop = 0xFFFFFFFF, video::SColor colorBottom = 0xFFFFFFFF) = 0;
694 
696 
711  video::ITexture* left, video::ITexture* right, video::ITexture* front,
712  video::ITexture* back, ISceneNode* parent = 0, s32 id=-1) = 0;
713 
715 
733  u32 horiRes=16, u32 vertRes=8,
734  f32 texturePercentage=0.9, f32 spherePercentage=2.0,f32 radius = 1000.f,
735  ISceneNode* parent=0, s32 id=-1) = 0;
736 
738 
751  bool withDefaultEmitter=true, ISceneNode* parent=0, s32 id=-1,
752  const core::vector3df& position = core::vector3df(0,0,0),
753  const core::vector3df& rotation = core::vector3df(0,0,0),
754  const core::vector3df& scale = core::vector3df(1.0f, 1.0f, 1.0f)) = 0;
755 
757 
813  const io::path& heightMapFileName,
814  ISceneNode* parent=0, s32 id=-1,
815  const core::vector3df& position = core::vector3df(0.0f,0.0f,0.0f),
816  const core::vector3df& rotation = core::vector3df(0.0f,0.0f,0.0f),
817  const core::vector3df& scale = core::vector3df(1.0f,1.0f,1.0f),
818  video::SColor vertexColor = video::SColor(255,255,255,255),
819  s32 maxLOD=5, E_TERRAIN_PATCH_SIZE patchSize=ETPS_17, s32 smoothFactor=0,
820  bool addAlsoIfHeightmapEmpty = false) = 0;
821 
823 
851  io::IReadFile* heightMapFile,
852  ISceneNode* parent=0, s32 id=-1,
853  const core::vector3df& position = core::vector3df(0.0f,0.0f,0.0f),
854  const core::vector3df& rotation = core::vector3df(0.0f,0.0f,0.0f),
855  const core::vector3df& scale = core::vector3df(1.0f,1.0f,1.0f),
856  video::SColor vertexColor = video::SColor(255,255,255,255),
857  s32 maxLOD=5, E_TERRAIN_PATCH_SIZE patchSize=ETPS_17, s32 smoothFactor=0,
858  bool addAlsoIfHeightmapEmpty = false) = 0;
859 
861 
864  virtual IMeshSceneNode* addQuake3SceneNode(const IMeshBuffer* meshBuffer, const quake3::IShader * shader,
865  ISceneNode* parent=0, s32 id=-1
866  ) = 0;
867 
868 
870 
874  virtual ISceneNode* addEmptySceneNode(ISceneNode* parent=0, s32 id=-1) = 0;
875 
877 
884  ISceneNode* parent=0, s32 id=-1) = 0;
885 
887  virtual ITextSceneNode* addTextSceneNode(gui::IGUIFont* font, const wchar_t* text,
888  video::SColor color=video::SColor(100,255,255,255),
889  ISceneNode* parent = 0, const core::vector3df& position = core::vector3df(0,0,0),
890  s32 id=-1) = 0;
891 
893 
904  virtual IBillboardTextSceneNode* addBillboardTextSceneNode( gui::IGUIFont* font, const wchar_t* text,
905  ISceneNode* parent = 0,
906  const core::dimension2d<f32>& size = core::dimension2d<f32>(10.0f, 10.0f),
907  const core::vector3df& position = core::vector3df(0,0,0), s32 id=-1,
908  video::SColor colorTop = 0xFFFFFFFF, video::SColor colorBottom = 0xFFFFFFFF) = 0;
909 
911 
937  virtual IAnimatedMesh* addHillPlaneMesh(const io::path& name,
938  const core::dimension2d<f32>& tileSize, const core::dimension2d<u32>& tileCount,
939  video::SMaterial* material = 0, f32 hillHeight = 0.0f,
940  const core::dimension2d<f32>& countHills = core::dimension2d<f32>(0.0f, 0.0f),
941  const core::dimension2d<f32>& textureRepeatCount = core::dimension2d<f32>(1.0f, 1.0f)) = 0;
942 
944 
966  virtual IAnimatedMesh* addTerrainMesh(const io::path& meshname,
967  video::IImage* texture, video::IImage* heightmap,
968  const core::dimension2d<f32>& stretchSize = core::dimension2d<f32>(10.0f,10.0f),
969  f32 maxHeight=200.0f,
970  const core::dimension2d<u32>& defaultVertexBlockSize = core::dimension2d<u32>(64,64)) = 0;
971 
973 
984  virtual IAnimatedMesh* addArrowMesh(const io::path& name,
985  video::SColor vtxColor0=0xFFFFFFFF,
986  video::SColor vtxColor1=0xFFFFFFFF,
987  u32 tesselationCylinder=4, u32 tesselationCone=8,
988  f32 height=1.f, f32 cylinderHeight=0.6f,
989  f32 width0=0.05f, f32 width1=0.3f) = 0;
990 
992 
998  virtual IAnimatedMesh* addSphereMesh(const io::path& name,
999  f32 radius=5.f, u32 polyCountX = 16,
1000  u32 polyCountY = 16) = 0;
1001 
1003 
1011  virtual IAnimatedMesh* addVolumeLightMesh(const io::path& name,
1012  const u32 SubdivideU = 32, const u32 SubdivideV = 32,
1013  const video::SColor FootColor = video::SColor(51, 0, 230, 180),
1014  const video::SColor TailColor = video::SColor(0, 0, 0, 0)) = 0;
1015 
1017 
1023  virtual ISceneNode* getRootSceneNode() = 0;
1024 
1026 
1033  virtual ISceneNode* getSceneNodeFromId(s32 id, ISceneNode* start=0) = 0;
1034 
1036 
1043  virtual ISceneNode* getSceneNodeFromName(const c8* name, ISceneNode* start=0) = 0;
1044 
1046 
1054 
1056 
1061  virtual void getSceneNodesFromType(ESCENE_NODE_TYPE type,
1063  ISceneNode* start=0) = 0;
1064 
1066 
1069  virtual ICameraSceneNode* getActiveCamera() const =0;
1070 
1072 
1074  virtual void setActiveCamera(ICameraSceneNode* camera) = 0;
1075 
1077  virtual void setShadowColor(video::SColor color = video::SColor(150,0,0,0)) = 0;
1078 
1080  virtual video::SColor getShadowColor() const = 0;
1081 
1083 
1091  virtual u32 registerNodeForRendering(ISceneNode* node,
1093 
1095 
1099  virtual void drawAll() = 0;
1100 
1102 
1107  virtual ISceneNodeAnimator* createRotationAnimator(const core::vector3df& rotationSpeed) = 0;
1108 
1110 
1123  const core::vector3df& center=core::vector3df(0.f,0.f,0.f),
1124  f32 radius=100.f, f32 speed=0.001f,
1125  const core::vector3df& direction=core::vector3df(0.f, 1.f, 0.f),
1126  f32 startPosition = 0.f,
1127  f32 radiusEllipsoid = 0.f) = 0;
1128 
1130 
1143  const core::vector3df& endPoint, u32 timeForWay, bool loop=false, bool pingpong = false) = 0;
1144 
1146 
1156  s32 timePerFrame, bool loop=true) = 0;
1157 
1159 
1164  virtual ISceneNodeAnimator* createDeleteAnimator(u32 timeMs) = 0;
1165 
1167 
1198  ITriangleSelector* world, ISceneNode* sceneNode,
1199  const core::vector3df& ellipsoidRadius = core::vector3df(30,60,30),
1200  const core::vector3df& gravityPerSecond = core::vector3df(0,-10.0f,0),
1201  const core::vector3df& ellipsoidTranslation = core::vector3df(0,0,0),
1202  f32 slidingValue = 0.0005f) = 0;
1203 
1205 
1214  const core::array< core::vector3df >& points,
1215  f32 speed = 1.0f, f32 tightness = 0.5f, bool loop=true, bool pingpong=false) = 0;
1216 
1218 
1236  virtual ITriangleSelector* createTriangleSelector(IMesh* mesh, ISceneNode* node) = 0;
1237 
1239 
1245 
1246 
1248 
1257 
1259 
1282  ISceneNode* node, s32 minimalPolysPerNode=32) = 0;
1283 
1285 
1287  ISceneNode* node, s32 minimalPolysPerNode=32)
1288  {
1289  return createOctreeTriangleSelector(mesh, node, minimalPolysPerNode);
1290  }
1291 
1293 
1301 
1303 
1309  ITerrainSceneNode* node, s32 LOD=0) = 0;
1310 
1312 
1318  virtual void addExternalMeshLoader(IMeshLoader* externalLoader) = 0;
1319 
1321 
1324 
1326 
1328  virtual IMeshManipulator* getMeshManipulator() = 0;
1329 
1331 
1339  virtual void addToDeletionQueue(ISceneNode* node) = 0;
1340 
1342 
1344  virtual bool postEventFromUser(const SEvent& event) = 0;
1345 
1347 
1348  virtual void clear() = 0;
1349 
1351 
1356  virtual io::IAttributes* getParameters() = 0;
1357 
1359 
1366 
1368 
1371 
1373 
1375  virtual void registerSceneNodeFactory(ISceneNodeFactory* factoryToAdd) = 0;
1376 
1378  virtual u32 getRegisteredSceneNodeFactoryCount() const = 0;
1379 
1381 
1383  virtual ISceneNodeFactory* getSceneNodeFactory(u32 index) = 0;
1384 
1386 
1389 
1391 
1393  virtual void registerSceneNodeAnimatorFactory(ISceneNodeAnimatorFactory* factoryToAdd) = 0;
1394 
1396  virtual u32 getRegisteredSceneNodeAnimatorFactoryCount() const = 0;
1397 
1399 
1402 
1404  virtual const c8* getSceneNodeTypeName(ESCENE_NODE_TYPE type) = 0;
1405 
1407  virtual const c8* getAnimatorTypeName(ESCENE_NODE_ANIMATOR_TYPE type) = 0;
1408 
1410 
1412  virtual ISceneNode* addSceneNode(const char* sceneNodeTypeName, ISceneNode* parent=0) = 0;
1413 
1415 
1433  virtual ISceneManager* createNewSceneManager(bool cloneContent=false) = 0;
1434 
1436 
1445  virtual bool saveScene(const io::path& filename, ISceneUserDataSerializer* userDataSerializer=0) = 0;
1446 
1448 
1457  virtual bool saveScene(io::IWriteFile* file, ISceneUserDataSerializer* userDataSerializer=0) = 0;
1458 
1460 
1470  virtual bool loadScene(const io::path& filename, ISceneUserDataSerializer* userDataSerializer=0) = 0;
1471 
1473 
1483  virtual bool loadScene(io::IReadFile* file, ISceneUserDataSerializer* userDataSerializer=0) = 0;
1484 
1486 
1488  virtual IMeshWriter* createMeshWriter(EMESH_WRITER_TYPE type) = 0;
1489 
1491 
1493  virtual ISkinnedMesh* createSkinnedMesh() = 0;
1494 
1496  virtual void setAmbientLight(const video::SColorf &ambientColor) = 0;
1497 
1499  virtual const video::SColorf& getAmbientLight() const = 0;
1500 
1502 
1504  virtual void setLightManager(ILightManager* lightManager) = 0;
1505 
1507 
1509  virtual const IGeometryCreator* getGeometryCreator(void) const = 0;
1510 
1512 
1520  virtual bool isCulled(const ISceneNode* node) const =0;
1521  };
1522 
1523 
1524 } // end namespace scene
1525 } // end namespace irr
1526 
1527 #endif
1528 

The Irrlicht Engine
The Irrlicht Engine Documentation © 2003-2010 by Nikolaus Gebhardt. Generated on Tue Jun 5 2012 17:57:13 by Doxygen (1.8.1)