// Copyright (C) 2002-2012 Nikolaus Gebhardt // This file is part of the "Irrlicht Engine". // For conditions of distribution and use, see copyright notice in irrlicht.h #ifndef __I_SCENE_MANAGER_H_INCLUDED__ #define __I_SCENE_MANAGER_H_INCLUDED__ #include "IReferenceCounted.h" #include "irrArray.h" #include "irrString.h" #include "path.h" #include "vector3d.h" #include "dimension2d.h" #include "SColor.h" #include "ESceneNodeTypes.h" #include "EMeshWriterEnums.h" #include "SceneParameters.h" #include "ISkinnedMesh.h" namespace irr { struct SKeyMap; struct SEvent; namespace io { class IReadFile; class IAttributes; class IWriteFile; class IFileSystem; } // end namespace io namespace gui { class IGUIFont; class IGUIEnvironment; } // end namespace gui namespace video { class IVideoDriver; class SMaterial; class IImage; class ITexture; } // end namespace video namespace scene { //! Enumeration for render passes. /** A parameter passed to the registerNodeForRendering() method of the ISceneManager, specifying when the node wants to be drawn in relation to the other nodes. Note: Despite the numbering this is not used as bit-field. */ enum E_SCENE_NODE_RENDER_PASS { //! No pass currently active ESNRP_NONE =0, //! Camera pass. The active view is set up here. The very first pass. ESNRP_CAMERA =1, //! In this pass, lights are transformed into camera space and added to the driver ESNRP_LIGHT =2, //! This is used for sky boxes. ESNRP_SKY_BOX =4, //! All normal objects can use this for registering themselves. /** This value will never be returned by ISceneManager::getSceneNodeRenderPass(). The scene manager will determine by itself if an object is transparent or solid and register the object as ESNRT_TRANSPARENT or ESNRP_SOLID automatically if you call registerNodeForRendering with this value (which is default). Note that it will register the node only as ONE type. If your scene node has both solid and transparent material types register it twice (one time as ESNRP_SOLID, the other time as ESNRT_TRANSPARENT) and in the render() method call getSceneNodeRenderPass() to find out the current render pass and render only the corresponding parts of the node. */ ESNRP_AUTOMATIC =24, //! Solid scene nodes or special scene nodes without materials. ESNRP_SOLID =8, //! Transparent scene nodes, drawn after solid nodes. They are sorted from back to front and drawn in that order. ESNRP_TRANSPARENT =16, //! Transparent effect scene nodes, drawn after Transparent nodes. They are sorted from back to front and drawn in that order. ESNRP_TRANSPARENT_EFFECT =32, //! Drawn after the solid nodes, before the transparent nodes, the time for drawing shadow volumes ESNRP_SHADOW =64, //! Drawn after transparent effect nodes. For custom gui's. Unsorted (in order nodes registered themselves). ESNRP_GUI = 128 }; class IAnimatedMesh; class IAnimatedMeshSceneNode; class IBillboardSceneNode; class ICameraSceneNode; class IDummyTransformationSceneNode; class IMesh; class IMeshBuffer; class IMeshCache; class ISceneCollisionManager; class IMeshLoader; class IMeshManipulator; class IMeshSceneNode; class IMeshWriter; class ISceneNode; class ISceneNodeFactory; //! The Scene Manager manages scene nodes, mesh resources, cameras and all the other stuff. /** All Scene nodes can be created only here. A scene node is a node in the hierarchical scene graph. Every scene node may have children, which are other scene nodes. Children move relative the their parents position. If the parent of a node is not visible, its children won't be visible, too. In this way, it is for example easily possible to attach a light to a moving car or to place a walking character on a moving platform on a moving ship. The SceneManager is also able to load 3d mesh files of different formats. Take a look at getMesh() to find out what formats are supported. If these formats are not enough, use addExternalMeshLoader() to add new formats to the engine. */ class ISceneManager : public virtual IReferenceCounted { public: //! Get pointer to an animateable mesh. Loads the file if not loaded already. /** * If you want to remove a loaded mesh from the cache again, use removeMesh(). * Currently there are the following mesh formats supported: *
Format | *Description | *
3D Studio (.3ds) | *Loader for 3D-Studio files which lots of 3D packages * are able to export. Only static meshes are currently * supported by this importer. | *
3D World Studio (.smf) | *Loader for Leadwerks SMF mesh files, a simple mesh format * containing static geometry for games. The proprietary .STF texture format * is not supported yet. This loader was originally written by Joseph Ellis. | *
Bliz Basic B3D (.b3d) | *Loader for blitz basic files, developed by Mark * Sibly. This is the ideal animated mesh format for game * characters as it is both rigidly defined and widely * supported by modeling and animation software. * As this format supports skeletal animations, an * ISkinnedMesh will be returned by this importer. | *
Cartography shop 4 (.csm) | *Cartography Shop is a modeling program for creating * architecture and calculating lighting. Irrlicht can * directly import .csm files thanks to the IrrCSM library * created by Saurav Mohapatra which is now integrated * directly in Irrlicht. * |
Delgine DeleD (.dmf) | *DeleD (delgine.com) is a 3D editor and level-editor * combined into one and is specifically designed for 3D * game-development. With this loader, it is possible to * directly load all geometry is as well as textures and * lightmaps from .dmf files. To set texture and * material paths, see scene::DMF_USE_MATERIALS_DIRS. * It is also possible to flip the alpha texture by setting * scene::DMF_FLIP_ALPHA_TEXTURES to true and to set the * material transparent reference value by setting * scene::DMF_ALPHA_CHANNEL_REF to a float between 0 and * 1. The loader is based on Salvatore Russo's .dmf * loader, I just changed some parts of it. Thanks to * Salvatore for his work and for allowing me to use his * code in Irrlicht and put it under Irrlicht's license. * For newer and more enhanced versions of the loader, * take a look at delgine.com. * | *
DirectX (.x) | *Platform independent importer (so not D3D-only) for * .x files. Most 3D packages can export these natively * and there are several tools for them available, e.g. * the Maya exporter included in the DX SDK. * .x files can include skeletal animations and Irrlicht * is able to play and display them, users can manipulate * the joints via the ISkinnedMesh interface. Currently, * Irrlicht only supports uncompressed .x files. | *
Half-Life model (.mdl) | *This loader opens Half-life 1 models, it was contributed * by Fabio Concas and adapted by Thomas Alten. | *
LightWave (.lwo) | *Native to NewTek's LightWave 3D, the LWO format is well * known and supported by many exporters. This loader will * import LWO2 models including lightmaps, bumpmaps and * reflection textures. | *
Maya (.obj) | *Most 3D software can create .obj files which contain * static geometry without material data. The material * files .mtl are also supported. This importer for * Irrlicht can load them directly. | *
Milkshape (.ms3d) | *.MS3D files contain models and sometimes skeletal * animations from the Milkshape 3D modeling and animation * software. Like the other skeletal mesh loaders, joints * are exposed via the ISkinnedMesh animated mesh type. | *
My3D (.my3d) | *.my3D is a flexible 3D file format. The My3DTools * contains plug-ins to export .my3D files from several * 3D packages. With this built-in importer, Irrlicht * can read and display those files directly. This * loader was written by Zhuck Dimitry who also created * the whole My3DTools package. * | *
OCT (.oct) | *The oct file format contains 3D geometry and
* lightmaps and can be loaded directly by Irrlicht. OCT
* files can be created by FSRad, Paul Nette's * radiosity processor or exported from Blender using * OCTTools which can be found in the exporters/OCTTools * directory of the SDK. Thanks to Murphy McCauley for * creating all this. |
*
OGRE Meshes (.mesh) | *Ogre .mesh files contain 3D data for the OGRE 3D * engine. Irrlicht can read and display them directly * with this importer. To define materials for the mesh, * copy a .material file named like the corresponding * .mesh file where the .mesh file is. (For example * ogrehead.material for ogrehead.mesh). Thanks to * Christian Stehno who wrote and contributed this * loader. | *
Pulsar LMTools (.lmts) | *LMTools is a set of tools (Windows & Linux) for
* creating lightmaps. Irrlicht can directly read .lmts
* files thanks to the importer created by Jonas * Petersen. * Notes for this version of the loader: * - It does not recognize/support user data in the * *.lmts files. * - The TGAs generated by LMTools don't work in * Irrlicht for some reason (the textures are upside * down). Opening and resaving them in a graphics app * will solve the problem. |
*
Quake 3 levels (.bsp) | *Quake 3 is a popular game by IDSoftware, and .pk3 * files contain .bsp files and textures/lightmaps * describing huge prelighted levels. Irrlicht can read * .pk3 and .bsp files directly and thus render Quake 3 * levels directly. Written by Nikolaus Gebhardt * enhanced by Dean P. Macri with the curved surfaces * feature. | *
Quake 2 models (.md2) | *Quake 2 models are characters with morph target * animation. Irrlicht can read, display and animate * them directly with this importer. | *
Quake 3 models (.md3) | *Quake 3 models are characters with morph target * animation, they contain mount points for weapons and body * parts and are typically made of several sections which are * manually joined together. | *
Stanford Triangle (.ply) | *Invented by Stanford University and known as the native * format of the infamous "Stanford Bunny" model, this is a * popular static mesh format used by 3D scanning hardware * and software. This loader supports extremely large models * in both ASCII and binary format, but only has rudimentary * material support in the form of vertex colors and texture * coordinates. | *
Stereolithography (.stl) | *The STL format is used for rapid prototyping and * computer-aided manufacturing, thus has no support for * materials. | *