Commit 1864555d authored by hybrid's avatar hybrid

Added method to alter the minimum vertex count required for a HW buffer to be created.

git-svn-id: svn://svn.code.sf.net/p/irrlicht/code/trunk@2132 dfc29bdd-3216-0410-991c-e03cc46cb475
parent d51b2f83
...@@ -352,12 +352,12 @@ namespace scene ...@@ -352,12 +352,12 @@ namespace scene
//! Get the video driver. //! Get the video driver.
/** \return Pointer to the video Driver. /** \return Pointer to the video Driver.
This pointer should not be dropped. See IReferenceCounted::drop() for more information. */ This pointer should not be dropped. See IReferenceCounted::drop() for more information. */
virtual video::IVideoDriver* getVideoDriver() = 0; virtual video::IVideoDriver* getVideoDriver() = 0;
//! Get the active GUIEnvironment //! Get the active GUIEnvironment
/** \return Pointer to the GUIEnvironment /** \return Pointer to the GUIEnvironment
This pointer should not be dropped. See IReferenceCounted::drop() for more information. */ This pointer should not be dropped. See IReferenceCounted::drop() for more information. */
virtual gui::IGUIEnvironment* getGUIEnvironment() = 0; virtual gui::IGUIEnvironment* getGUIEnvironment() = 0;
//! adds Volume Lighting Scene Node. //! adds Volume Lighting Scene Node.
...@@ -389,7 +389,7 @@ namespace scene ...@@ -389,7 +389,7 @@ namespace scene
\param parent: Parent of the scene node. Can be NULL if no parent. \param parent: Parent of the scene node. Can be NULL if no parent.
\param id: Id of the node. This id can be used to identify the scene node. \param id: Id of the node. This id can be used to identify the scene node.
\param position: Position of the space relative to its parent where the \param position: Position of the space relative to its parent where the
scene node will be placed. scene node will be placed.
\param rotation: Initital rotation of the scene node. \param rotation: Initital rotation of the scene node.
\param scale: Initial scale of the scene node. \param scale: Initial scale of the scene node.
\return Pointer to the created test scene node. This \return Pointer to the created test scene node. This
...@@ -407,7 +407,7 @@ namespace scene ...@@ -407,7 +407,7 @@ namespace scene
\param parent: Parent of the scene node. Can be NULL if no parent. \param parent: Parent of the scene node. Can be NULL if no parent.
\param id: Id of the node. This id can be used to identify the scene node. \param id: Id of the node. This id can be used to identify the scene node.
\param position: Position of the space relative to its parent where the \param position: Position of the space relative to its parent where the
scene node will be placed. scene node will be placed.
\param rotation: Initital rotation of the scene node. \param rotation: Initital rotation of the scene node.
\param scale: Initial scale of the scene node. \param scale: Initial scale of the scene node.
\return Pointer to the created test scene node. This \return Pointer to the created test scene node. This
...@@ -477,19 +477,19 @@ namespace scene ...@@ -477,19 +477,19 @@ namespace scene
const core::vector3df& scale = core::vector3df(1.0f, 1.0f, 1.0f)) = 0; const core::vector3df& scale = core::vector3df(1.0f, 1.0f, 1.0f)) = 0;
//! Adds a scene node for rendering using a octtree to the scene graph. //! Adds a scene node for rendering using a octtree to the scene graph.
/** This a good method for rendering /** This a good method for rendering
scenes with lots of geometry. The Octree is built on the fly from the mesh. scenes with lots of geometry. The Octree is built on the fly from the mesh.
\param mesh: The mesh containing all geometry from which the octtree will be build. \param mesh: The mesh containing all geometry from which the octtree will be build.
If this animated mesh has more than one frames in it, the first frame is taken. If this animated mesh has more than one frames in it, the first frame is taken.
\param parent: Parent node of the octtree node. \param parent: Parent node of the octtree node.
\param id: id of the node. This id can be used to identify the node. \param id: id of the node. This id can be used to identify the node.
\param minimalPolysPerNode: Specifies the minimal polygons contained a octree node. \param minimalPolysPerNode: Specifies the minimal polygons contained a octree node.
If a node gets less polys than this value it will not be split into If a node gets less polys than this value it will not be split into
smaller nodes. smaller nodes.
\param alsoAddIfMeshPointerZero: Add the scene node even if a 0 pointer is passed. \param alsoAddIfMeshPointerZero: Add the scene node even if a 0 pointer is passed.
\return Pointer to the OctTree if successful, otherwise 0. \return Pointer to the OctTree if successful, otherwise 0.
This pointer should not be dropped. See IReferenceCounted::drop() for more information. */ This pointer should not be dropped. See IReferenceCounted::drop() for more information. */
virtual ISceneNode* addOctTreeSceneNode(IAnimatedMesh* mesh, ISceneNode* parent=0, virtual ISceneNode* addOctTreeSceneNode(IAnimatedMesh* mesh, ISceneNode* parent=0,
s32 id=-1, s32 minimalPolysPerNode=512, bool alsoAddIfMeshPointerZero=false) = 0; s32 id=-1, s32 minimalPolysPerNode=512, bool alsoAddIfMeshPointerZero=false) = 0;
...@@ -608,17 +608,17 @@ namespace scene ...@@ -608,17 +608,17 @@ namespace scene
//! Adds a dynamic light scene node to the scene graph. //! Adds a dynamic light scene node to the scene graph.
/** The light will cast dynamic light on all /** The light will cast dynamic light on all
other scene nodes in the scene, which have the material flag video::MTF_LIGHTING other scene nodes in the scene, which have the material flag video::MTF_LIGHTING
turned on. (This is the default setting in most scene nodes). turned on. (This is the default setting in most scene nodes).
\param parent: Parent scene node of the light. Can be null. If the parent moves, \param parent: Parent scene node of the light. Can be null. If the parent moves,
the light will move too. the light will move too.
\param position: Position of the space relative to its parent where the light will be placed. \param position: Position of the space relative to its parent where the light will be placed.
\param color: Diffuse color of the light. Ambient or Specular colors can be set manually with \param color: Diffuse color of the light. Ambient or Specular colors can be set manually with
the ILightSceneNode::getLightData() method. the ILightSceneNode::getLightData() method.
\param radius: Radius of the light. \param radius: Radius of the light.
\param id: id of the node. This id can be used to identify the node. \param id: id of the node. This id can be used to identify the node.
\return Pointer to the interface of the light if successful, otherwise NULL. \return Pointer to the interface of the light if successful, otherwise NULL.
This pointer should not be dropped. See IReferenceCounted::drop() for more information. */ This pointer should not be dropped. See IReferenceCounted::drop() for more information. */
virtual ILightSceneNode* addLightSceneNode(ISceneNode* parent = 0, virtual ILightSceneNode* addLightSceneNode(ISceneNode* parent = 0,
const core::vector3df& position = core::vector3df(0,0,0), const core::vector3df& position = core::vector3df(0,0,0),
video::SColorf color = video::SColorf(1.0f, 1.0f, 1.0f), video::SColorf color = video::SColorf(1.0f, 1.0f, 1.0f),
...@@ -626,19 +626,19 @@ namespace scene ...@@ -626,19 +626,19 @@ namespace scene
//! Adds a billboard scene node to the scene graph. //! Adds a billboard scene node to the scene graph.
/** A billboard is like a 3d sprite: A 2d element, /** A billboard is like a 3d sprite: A 2d element,
which always looks to the camera. It is usually used for things like explosions, fire, which always looks to the camera. It is usually used for things like explosions, fire,
lensflares and things like that. lensflares and things like that.
\param parent: Parent scene node of the billboard. Can be null. If the parent moves, \param parent: Parent scene node of the billboard. Can be null. If the parent moves,
the billboard will move too. the billboard will move too.
\param position: Position of the space relative to its parent \param position: Position of the space relative to its parent
where the billboard will be placed. where the billboard will be placed.
\param size: Size of the billboard. This size is 2 dimensional because a billboard only has \param size: Size of the billboard. This size is 2 dimensional because a billboard only has
width and height. width and height.
\param id: An id of the node. This id can be used to identify the node. \param id: An id of the node. This id can be used to identify the node.
\param colorTop: The color of the vertices at the top of the billboard (default: white). \param colorTop: The color of the vertices at the top of the billboard (default: white).
\param colorBottom: The color of the vertices at the bottom of the billboard (default: white). \param colorBottom: The color of the vertices at the bottom of the billboard (default: white).
\return Pointer to the billboard if successful, otherwise NULL. \return Pointer to the billboard if successful, otherwise NULL.
This pointer should not be dropped. See IReferenceCounted::drop() for more information. */ This pointer should not be dropped. See IReferenceCounted::drop() for more information. */
virtual IBillboardSceneNode* addBillboardSceneNode(ISceneNode* parent = 0, virtual IBillboardSceneNode* addBillboardSceneNode(ISceneNode* parent = 0,
const core::dimension2d<f32>& size = core::dimension2d<f32>(10.0f, 10.0f), const core::dimension2d<f32>& size = core::dimension2d<f32>(10.0f, 10.0f),
const core::vector3df& position = core::vector3df(0,0,0), s32 id=-1, const core::vector3df& position = core::vector3df(0,0,0), s32 id=-1,
...@@ -646,40 +646,40 @@ namespace scene ...@@ -646,40 +646,40 @@ namespace scene
//! Adds a skybox scene node to the scene graph. //! Adds a skybox scene node to the scene graph.
/** A skybox is a big cube with 6 textures on it and /** A skybox is a big cube with 6 textures on it and
is drawn around the camera position. is drawn around the camera position.
\param top: Texture for the top plane of the box. \param top: Texture for the top plane of the box.
\param bottom: Texture for the bottom plane of the box. \param bottom: Texture for the bottom plane of the box.
\param left: Texture for the left plane of the box. \param left: Texture for the left plane of the box.
\param right: Texture for the right plane of the box. \param right: Texture for the right plane of the box.
\param front: Texture for the front plane of the box. \param front: Texture for the front plane of the box.
\param back: Texture for the back plane of the box. \param back: Texture for the back plane of the box.
\param parent: Parent scene node of the skybox. A skybox usually has no parent, \param parent: Parent scene node of the skybox. A skybox usually has no parent,
so this should be null. Note: If a parent is set to the skybox, the box will not so this should be null. Note: If a parent is set to the skybox, the box will not
change how it is drawn. change how it is drawn.
\param id: An id of the node. This id can be used to identify the node. \param id: An id of the node. This id can be used to identify the node.
\return Pointer to the sky box if successful, otherwise NULL. \return Pointer to the sky box if successful, otherwise NULL.
This pointer should not be dropped. See IReferenceCounted::drop() for more information. */ This pointer should not be dropped. See IReferenceCounted::drop() for more information. */
virtual ISceneNode* addSkyBoxSceneNode(video::ITexture* top, video::ITexture* bottom, virtual ISceneNode* addSkyBoxSceneNode(video::ITexture* top, video::ITexture* bottom,
video::ITexture* left, video::ITexture* right, video::ITexture* front, video::ITexture* left, video::ITexture* right, video::ITexture* front,
video::ITexture* back, ISceneNode* parent = 0, s32 id=-1) = 0; video::ITexture* back, ISceneNode* parent = 0, s32 id=-1) = 0;
//! Adds a skydome scene node to the scene graph. //! Adds a skydome scene node to the scene graph.
/** A skydome is a large (half-) sphere with a panoramic texture /** A skydome is a large (half-) sphere with a panoramic texture
on the inside and is drawn around the camera position. on the inside and is drawn around the camera position.
\param texture: Texture for the dome. \param texture: Texture for the dome.
\param horiRes: Number of vertices of a horizontal layer of the sphere. \param horiRes: Number of vertices of a horizontal layer of the sphere.
\param vertRes: Number of vertices of a vertical layer of the sphere. \param vertRes: Number of vertices of a vertical layer of the sphere.
\param texturePercentage: How much of the height of the \param texturePercentage: How much of the height of the
texture is used. Should be between 0 and 1. texture is used. Should be between 0 and 1.
\param spherePercentage: How much of the sphere is drawn. \param spherePercentage: How much of the sphere is drawn.
Value should be between 0 and 2, where 1 is an exact Value should be between 0 and 2, where 1 is an exact
half-sphere and 2 is a full sphere. half-sphere and 2 is a full sphere.
\param parent: Parent scene node of the dome. A dome usually has no parent, \param parent: Parent scene node of the dome. A dome usually has no parent,
so this should be null. Note: If a parent is set, the dome will not so this should be null. Note: If a parent is set, the dome will not
change how it is drawn. change how it is drawn.
\param id: An id of the node. This id can be used to identify the node. \param id: An id of the node. This id can be used to identify the node.
\return Pointer to the sky dome if successful, otherwise NULL. \return Pointer to the sky dome if successful, otherwise NULL.
This pointer should not be dropped. See IReferenceCounted::drop() for more information. */ This pointer should not be dropped. See IReferenceCounted::drop() for more information. */
virtual ISceneNode* addSkyDomeSceneNode(video::ITexture* texture, virtual ISceneNode* addSkyDomeSceneNode(video::ITexture* texture,
u32 horiRes=16, u32 vertRes=8, u32 horiRes=16, u32 vertRes=8,
f64 texturePercentage=0.9, f64 spherePercentage=2.0, f64 texturePercentage=0.9, f64 spherePercentage=2.0,
...@@ -687,17 +687,17 @@ namespace scene ...@@ -687,17 +687,17 @@ namespace scene
//! Adds a particle system scene node to the scene graph. //! Adds a particle system scene node to the scene graph.
/** \param withDefaultEmitter: Creates a default working point emitter /** \param withDefaultEmitter: Creates a default working point emitter
which emitts some particles. Set this to true to see a particle system which emitts some particles. Set this to true to see a particle system
in action. If set to false, you'll have to set the emitter you want by in action. If set to false, you'll have to set the emitter you want by
calling IParticleSystemSceneNode::setEmitter(). calling IParticleSystemSceneNode::setEmitter().
\param parent: Parent of the scene node. Can be NULL if no parent. \param parent: Parent of the scene node. Can be NULL if no parent.
\param id: Id of the node. This id can be used to identify the scene node. \param id: Id of the node. This id can be used to identify the scene node.
\param position: Position of the space relative to its parent where the \param position: Position of the space relative to its parent where the
scene node will be placed. scene node will be placed.
\param rotation: Initital rotation of the scene node. \param rotation: Initital rotation of the scene node.
\param scale: Initial scale of the scene node. \param scale: Initial scale of the scene node.
\return Pointer to the created scene node. \return Pointer to the created scene node.
This pointer should not be dropped. See IReferenceCounted::drop() for more information. */ This pointer should not be dropped. See IReferenceCounted::drop() for more information. */
virtual IParticleSystemSceneNode* addParticleSystemSceneNode( virtual IParticleSystemSceneNode* addParticleSystemSceneNode(
bool withDefaultEmitter=true, ISceneNode* parent=0, s32 id=-1, bool withDefaultEmitter=true, ISceneNode* parent=0, s32 id=-1,
const core::vector3df& position = core::vector3df(0,0,0), const core::vector3df& position = core::vector3df(0,0,0),
...@@ -706,60 +706,60 @@ namespace scene ...@@ -706,60 +706,60 @@ namespace scene
//! Adds a terrain scene node to the scene graph. //! Adds a terrain scene node to the scene graph.
/** This node implements is a simple terrain renderer which uses /** This node implements is a simple terrain renderer which uses
a technique known as geo mip mapping a technique known as geo mip mapping
for reducing the detail of triangle blocks which are far away. for reducing the detail of triangle blocks which are far away.
The code for the TerrainSceneNode is based on the terrain The code for the TerrainSceneNode is based on the terrain
renderer by Soconne and the GeoMipMapSceneNode developed by renderer by Soconne and the GeoMipMapSceneNode developed by
Spintz. They made their code available for Irrlicht and allowed Spintz. They made their code available for Irrlicht and allowed
it to be distributed under this licence. I only modified some it to be distributed under this licence. I only modified some
parts. A lot of thanks go to them. parts. A lot of thanks go to them.
This scene node is capable of loading terrains and updating This scene node is capable of loading terrains and updating
the indices at runtime to enable viewing very large terrains the indices at runtime to enable viewing very large terrains
very quickly. It uses a CLOD (Continuous Level of Detail) very quickly. It uses a CLOD (Continuous Level of Detail)
algorithm which updates the indices for each patch based on algorithm which updates the indices for each patch based on
a LOD (Level of Detail) which is determined based on a patch's a LOD (Level of Detail) which is determined based on a patch's
distance from the camera. distance from the camera.
The patch size of the terrain must always be a size of 2^N+1, The patch size of the terrain must always be a size of 2^N+1,
i.e. 8+1(9), 16+1(17), etc. i.e. 8+1(9), 16+1(17), etc.
The MaxLOD available is directly dependent on the patch size The MaxLOD available is directly dependent on the patch size
of the terrain. LOD 0 contains all of the indices to draw all of the terrain. LOD 0 contains all of the indices to draw all
the triangles at the max detail for a patch. As each LOD goes the triangles at the max detail for a patch. As each LOD goes
up by 1 the step taken, in generating indices increases by up by 1 the step taken, in generating indices increases by
-2^LOD, so for LOD 1, the step taken is 2, for LOD 2, the step -2^LOD, so for LOD 1, the step taken is 2, for LOD 2, the step
taken is 4, LOD 3 - 8, etc. The step can be no larger than taken is 4, LOD 3 - 8, etc. The step can be no larger than
the size of the patch, so having a LOD of 8, with a patch size the size of the patch, so having a LOD of 8, with a patch size
of 17, is asking the algoritm to generate indices every 2^8 ( of 17, is asking the algoritm to generate indices every 2^8 (
256 ) vertices, which is not possible with a patch size of 17. 256 ) vertices, which is not possible with a patch size of 17.
The maximum LOD for a patch size of 17 is 2^4 ( 16 ). So, The maximum LOD for a patch size of 17 is 2^4 ( 16 ). So,
with a MaxLOD of 5, you'll have LOD 0 ( full detail ), LOD 1 ( with a MaxLOD of 5, you'll have LOD 0 ( full detail ), LOD 1 (
every 2 vertices ), LOD 2 ( every 4 vertices ), LOD 3 ( every every 2 vertices ), LOD 2 ( every 4 vertices ), LOD 3 ( every
8 vertices ) and LOD 4 ( every 16 vertices ). 8 vertices ) and LOD 4 ( every 16 vertices ).
\param heightMapFileName: The name of the file on disk, to read vertex data from. This should \param heightMapFileName: The name of the file on disk, to read vertex data from. This should
be a gray scale bitmap. be a gray scale bitmap.
\param parent: Parent of the scene node. Can be 0 if no parent. \param parent: Parent of the scene node. Can be 0 if no parent.
\param id: Id of the node. This id can be used to identify the scene node. \param id: Id of the node. This id can be used to identify the scene node.
\param position: The absolute position of this node. \param position: The absolute position of this node.
\param rotation: The absolute rotation of this node. ( NOT YET IMPLEMENTED ) \param rotation: The absolute rotation of this node. ( NOT YET IMPLEMENTED )
\param scale: The scale factor for the terrain. If you're \param scale: The scale factor for the terrain. If you're
using a heightmap of size 129x129 and would like your terrain using a heightmap of size 129x129 and would like your terrain
to be 12900x12900 in game units, then use a scale factor of ( to be 12900x12900 in game units, then use a scale factor of (
core::vector ( 100.0f, 100.0f, 100.0f ). If you use a Y core::vector ( 100.0f, 100.0f, 100.0f ). If you use a Y
scaling factor of 0.0f, then your terrain will be flat. scaling factor of 0.0f, then your terrain will be flat.
\param vertexColor: The default color of all the vertices. If no texture is associated \param vertexColor: The default color of all the vertices. If no texture is associated
with the scene node, then all vertices will be this color. Defaults to white. with the scene node, then all vertices will be this color. Defaults to white.
\param maxLOD: The maximum LOD (level of detail) for the node. Only change if you \param maxLOD: The maximum LOD (level of detail) for the node. Only change if you
know what you are doing, this might lead to strange behaviour. know what you are doing, this might lead to strange behaviour.
\param patchSize: patch size of the terrain. Only change if you \param patchSize: patch size of the terrain. Only change if you
know what you are doing, this might lead to strange behaviour. know what you are doing, this might lead to strange behaviour.
\param smoothFactor: The number of times the vertices are smoothed. \param smoothFactor: The number of times the vertices are smoothed.
\param addAlsoIfHeightmapEmpty: Add terrain node even with empty heightmap. \param addAlsoIfHeightmapEmpty: Add terrain node even with empty heightmap.
\return Pointer to the created scene node. Can be null \return Pointer to the created scene node. Can be null
if the terrain could not be created, for example because the if the terrain could not be created, for example because the
heightmap could not be loaded. The returned pointer should heightmap could not be loaded. The returned pointer should
not be dropped. See IReferenceCounted::drop() for more not be dropped. See IReferenceCounted::drop() for more
information. */ information. */
virtual ITerrainSceneNode* addTerrainSceneNode( virtual ITerrainSceneNode* addTerrainSceneNode(
const c8* heightMapFileName, const c8* heightMapFileName,
ISceneNode* parent=0, s32 id=-1, ISceneNode* parent=0, s32 id=-1,
...@@ -772,32 +772,32 @@ namespace scene ...@@ -772,32 +772,32 @@ namespace scene
//! Adds a terrain scene node to the scene graph. //! Adds a terrain scene node to the scene graph.
/** Just like the other addTerrainSceneNode() method, but takes an IReadFile /** Just like the other addTerrainSceneNode() method, but takes an IReadFile
pointer as parameter for the heightmap. For more informations take a look pointer as parameter for the heightmap. For more informations take a look
at the other function. at the other function.
\param heightMapFile: The file handle to read vertex data from. This should \param heightMapFile: The file handle to read vertex data from. This should
be a gray scale bitmap. be a gray scale bitmap.
\param parent: Parent of the scene node. Can be 0 if no parent. \param parent: Parent of the scene node. Can be 0 if no parent.
\param id: Id of the node. This id can be used to identify the scene node. \param id: Id of the node. This id can be used to identify the scene node.
\param position: The absolute position of this node. \param position: The absolute position of this node.
\param rotation: The absolute rotation of this node. ( NOT YET IMPLEMENTED ) \param rotation: The absolute rotation of this node. ( NOT YET IMPLEMENTED )
\param scale: The scale factor for the terrain. If you're \param scale: The scale factor for the terrain. If you're
using a heightmap of size 129x129 and would like your terrain using a heightmap of size 129x129 and would like your terrain
to be 12900x12900 in game units, then use a scale factor of ( to be 12900x12900 in game units, then use a scale factor of (
core::vector ( 100.0f, 100.0f, 100.0f ). If you use a Y core::vector ( 100.0f, 100.0f, 100.0f ). If you use a Y
scaling factor of 0.0f, then your terrain will be flat. scaling factor of 0.0f, then your terrain will be flat.
\param vertexColor: The default color of all the vertices. If no texture is associated \param vertexColor: The default color of all the vertices. If no texture is associated
with the scene node, then all vertices will be this color. Defaults to white. with the scene node, then all vertices will be this color. Defaults to white.
\param maxLOD: The maximum LOD (level of detail) for the node. Only change if you \param maxLOD: The maximum LOD (level of detail) for the node. Only change if you
know what you are doing, this might lead to strange behaviour. know what you are doing, this might lead to strange behaviour.
\param patchSize: patch size of the terrain. Only change if you \param patchSize: patch size of the terrain. Only change if you
know what you are doing, this might lead to strange behaviour. know what you are doing, this might lead to strange behaviour.
\param smoothFactor: The number of times the vertices are smoothed. \param smoothFactor: The number of times the vertices are smoothed.
\param addAlsoIfHeightmapEmpty: Add terrain node even with empty heightmap. \param addAlsoIfHeightmapEmpty: Add terrain node even with empty heightmap.
\return Pointer to the created scene node. Can be null \return Pointer to the created scene node. Can be null
if the terrain could not be created, for example because the if the terrain could not be created, for example because the
heightmap could not be loaded. The returned pointer should heightmap could not be loaded. The returned pointer should
not be dropped. See IReferenceCounted::drop() for more not be dropped. See IReferenceCounted::drop() for more
information. */ information. */
virtual ITerrainSceneNode* addTerrainSceneNode( virtual ITerrainSceneNode* addTerrainSceneNode(
io::IReadFile* heightMapFile, io::IReadFile* heightMapFile,
ISceneNode* parent=0, s32 id=-1, ISceneNode* parent=0, s32 id=-1,
...@@ -810,8 +810,8 @@ namespace scene ...@@ -810,8 +810,8 @@ namespace scene
//! Adds a quake3 scene node to the scene graph. //! Adds a quake3 scene node to the scene graph.
/** A Quake3 Scene renders multiple meshes for a specific HighLanguage Shader (Quake3 Style ) /** A Quake3 Scene renders multiple meshes for a specific HighLanguage Shader (Quake3 Style )
\return Pointer to the quake3 scene node if successful, otherwise NULL. \return Pointer to the quake3 scene node if successful, otherwise NULL.
This pointer should not be dropped. See IReferenceCounted::drop() for more information. */ This pointer should not be dropped. See IReferenceCounted::drop() for more information. */
virtual ISceneNode* addQuake3SceneNode(IMeshBuffer* meshBuffer, const quake3::SShader * shader, virtual ISceneNode* addQuake3SceneNode(IMeshBuffer* meshBuffer, const quake3::SShader * shader,
ISceneNode* parent=0, s32 id=-1 ISceneNode* parent=0, s32 id=-1
) = 0; ) = 0;
...@@ -819,18 +819,18 @@ namespace scene ...@@ -819,18 +819,18 @@ namespace scene
//! Adds an empty scene node to the scene graph. //! Adds an empty scene node to the scene graph.
/** Can be used for doing advanced transformations /** Can be used for doing advanced transformations
or structuring the scene graph. or structuring the scene graph.
\return Pointer to the created scene node. \return Pointer to the created scene node.
This pointer should not be dropped. See IReferenceCounted::drop() for more information. */ This pointer should not be dropped. See IReferenceCounted::drop() for more information. */
virtual ISceneNode* addEmptySceneNode(ISceneNode* parent=0, s32 id=-1) = 0; virtual ISceneNode* addEmptySceneNode(ISceneNode* parent=0, s32 id=-1) = 0;
//! Adds a dummy transformation scene node to the scene graph. //! Adds a dummy transformation scene node to the scene graph.
/** This scene node does not render itself, and does not respond to set/getPosition, /** This scene node does not render itself, and does not respond to set/getPosition,
set/getRotation and set/getScale. Its just a simple scene node that takes a set/getRotation and set/getScale. Its just a simple scene node that takes a
matrix as relative transformation, making it possible to insert any transformation matrix as relative transformation, making it possible to insert any transformation
anywhere into the scene graph. anywhere into the scene graph.
\return Pointer to the created scene node. \return Pointer to the created scene node.
This pointer should not be dropped. See IReferenceCounted::drop() for more information. */ This pointer should not be dropped. See IReferenceCounted::drop() for more information. */
virtual IDummyTransformationSceneNode* addDummyTransformationSceneNode( virtual IDummyTransformationSceneNode* addDummyTransformationSceneNode(
ISceneNode* parent=0, s32 id=-1) = 0; ISceneNode* parent=0, s32 id=-1) = 0;
...@@ -860,60 +860,60 @@ namespace scene ...@@ -860,60 +860,60 @@ namespace scene
//! Adds a Hill Plane mesh to the mesh pool. //! Adds a Hill Plane mesh to the mesh pool.
/** The mesh is generated on the fly /** The mesh is generated on the fly
and looks like a plane with some hills on it. It is uses mostly for quick and looks like a plane with some hills on it. It is uses mostly for quick
tests of the engine only. You can specify how many hills there should be tests of the engine only. You can specify how many hills there should be
on the plane and how high they should be. Also you must specify a name for on the plane and how high they should be. Also you must specify a name for
the mesh, because the mesh is added to the mesh pool, and can be retrieved the mesh, because the mesh is added to the mesh pool, and can be retrieved
again using ISceneManager::getMesh() with the name as parameter. again using ISceneManager::getMesh() with the name as parameter.
\param name: The name of this mesh which must be specified in order \param name: The name of this mesh which must be specified in order
to be able to retrieve the mesh later with ISceneManager::getMesh(). to be able to retrieve the mesh later with ISceneManager::getMesh().
\param tileSize: Size of a tile of the mesh. (10.0f, 10.0f) would be a \param tileSize: Size of a tile of the mesh. (10.0f, 10.0f) would be a
good value to start, for example. good value to start, for example.
\param tileCount: Specifies how much tiles there will be. If you specifiy \param tileCount: Specifies how much tiles there will be. If you specifiy
for example that a tile has the size (10.0f, 10.0f) and the tileCount is for example that a tile has the size (10.0f, 10.0f) and the tileCount is
(10,10), than you get a field of 100 tiles which has the dimension 100.0fx100.0f. (10,10), than you get a field of 100 tiles which has the dimension 100.0fx100.0f.
\param material: Material of the hill mesh. \param material: Material of the hill mesh.
\param hillHeight: Height of the hills. If you specify a negative value \param hillHeight: Height of the hills. If you specify a negative value
you will get holes instead of hills. If the height is 0, no hills will be you will get holes instead of hills. If the height is 0, no hills will be
created. created.
\param countHills: Amount of hills on the plane. There will be countHills.X \param countHills: Amount of hills on the plane. There will be countHills.X
hills along the X axis and countHills.Y along the Y axis. So in total there hills along the X axis and countHills.Y along the Y axis. So in total there
will be countHills.X * countHills.Y hills. will be countHills.X * countHills.Y hills.
\param textureRepeatCount: Defines how often the texture will be repeated in \param textureRepeatCount: Defines how often the texture will be repeated in
x and y direction. x and y direction.
\return Null if the creation failed. The reason could be that you return Null if the creation failed. The reason could be that you
specified some invalid parameters or that a mesh with that name already specified some invalid parameters or that a mesh with that name already
exists. If successful, a pointer to the mesh is returned. exists. If successful, a pointer to the mesh is returned.
This pointer should not be dropped. See IReferenceCounted::drop() for more information. */ This pointer should not be dropped. See IReferenceCounted::drop() for more information. */
virtual IAnimatedMesh* addHillPlaneMesh(const c8* name, virtual IAnimatedMesh* addHillPlaneMesh(const c8* name,
const core::dimension2d<f32>& tileSize, const core::dimension2d<u32>& tileCount, const core::dimension2d<f32>& tileSize, const core::dimension2d<u32>& tileCount,
video::SMaterial* material = 0, f32 hillHeight = 0.0f, video::SMaterial* material = 0, f32 hillHeight = 0.0f,
const core::dimension2d<f32>& countHills = core::dimension2d<f32>(0.0f, 0.0f), const core::dimension2d<f32>& countHills = core::dimension2d<f32>(0.0f, 0.0f),
const core::dimension2d<f32>& textureRepeatCount = core::dimension2d<f32>(1.0f, 1.0f)) = 0; const core::dimension2d<f32>& textureRepeatCount = core::dimension2d<f32>(1.0f, 1.0f)) = 0;
//! Adds a static terrain mesh to the mesh pool. //! Adds a static terrain mesh to the mesh pool.
/** The mesh is generated on the fly /** The mesh is generated on the fly
from a texture file and a height map file. Both files may be huge from a texture file and a height map file. Both files may be huge
(8000x8000 pixels would be no problem) because the generator splits the (8000x8000 pixels would be no problem) because the generator splits the
files into smaller textures if necessary. files into smaller textures if necessary.
You must specify a name for the mesh, because the mesh is added to the mesh pool, You must specify a name for the mesh, because the mesh is added to the mesh pool,
and can be retrieved again using ISceneManager::getMesh() with the name as parameter. and can be retrieved again using ISceneManager::getMesh() with the name as parameter.
\param meshname: The name of this mesh which must be specified in order \param meshname: The name of this mesh which must be specified in order
to be able to retrieve the mesh later with ISceneManager::getMesh(). to be able to retrieve the mesh later with ISceneManager::getMesh().
\param texture: Texture for the terrain. Please note that this is not a \param texture: Texture for the terrain. Please note that this is not a
hardware texture as usual (ITexture), but an IImage software texture. hardware texture as usual (ITexture), but an IImage software texture.
You can load this texture with IVideoDriver::createImageFromFile(). You can load this texture with IVideoDriver::createImageFromFile().
\param heightmap: A grayscaled heightmap image. Like the texture, \param heightmap: A grayscaled heightmap image. Like the texture,
it can be created with IVideoDriver::createImageFromFile(). The amount it can be created with IVideoDriver::createImageFromFile(). The amount
of triangles created depends on the size of this texture, so use a small of triangles created depends on the size of this texture, so use a small
heightmap to increase rendering speed. heightmap to increase rendering speed.
\param stretchSize: Parameter defining how big a is pixel on the heightmap. \param stretchSize: Parameter defining how big a is pixel on the heightmap.
\param maxHeight: Defines how high a white pixel on the heighmap is. \param maxHeight: Defines how high a white pixel on the heighmap is.
\param defaultVertexBlockSize: Defines the initial dimension between vertices. \param defaultVertexBlockSize: Defines the initial dimension between vertices.
\return Null if the creation failed. The reason could be that you \return Null if the creation failed. The reason could be that you
specified some invalid parameters, that a mesh with that name already specified some invalid parameters, that a mesh with that name already
exists, or that a texture could not be found. If successful, a pointer to the mesh is returned. exists, or that a texture could not be found. If successful, a pointer to the mesh is returned.
This pointer should not be dropped. See IReferenceCounted::drop() for more information. */ This pointer should not be dropped. See IReferenceCounted::drop() for more information. */
virtual IAnimatedMesh* addTerrainMesh(const c8* meshname, virtual IAnimatedMesh* addTerrainMesh(const c8* meshname,
video::IImage* texture, video::IImage* heightmap, video::IImage* texture, video::IImage* heightmap,
const core::dimension2d<f32>& stretchSize = core::dimension2d<f32>(10.0f,10.0f), const core::dimension2d<f32>& stretchSize = core::dimension2d<f32>(10.0f,10.0f),
...@@ -1018,42 +1018,42 @@ namespace scene ...@@ -1018,42 +1018,42 @@ namespace scene
//! Registers a node for rendering it at a specific time. //! Registers a node for rendering it at a specific time.
/** This method should only be used by SceneNodes when they get a /** This method should only be used by SceneNodes when they get a
ISceneNode::OnRegisterSceneNode() call. ISceneNode::OnRegisterSceneNode() call.
\param node: Node to register for drawing. Usually scene nodes would set 'this' \param node: Node to register for drawing. Usually scene nodes would set 'this'
as parameter here because they want to be drawn. as parameter here because they want to be drawn.
\param pass: Specifies when the node wants to be drawn in relation to the other nodes. \param pass: Specifies when the node wants to be drawn in relation to the other nodes.
For example, if the node is a shadow, it usually wants to be drawn after all other nodes For example, if the node is a shadow, it usually wants to be drawn after all other nodes
and will use ESNRP_SHADOW for this. See scene::E_SCENE_NODE_RENDER_PASS for details. and will use ESNRP_SHADOW for this. See scene::E_SCENE_NODE_RENDER_PASS for details.
\return scene will be rendered ( passed culling ) */ \return scene will be rendered ( passed culling ) */
virtual u32 registerNodeForRendering(ISceneNode* node, virtual u32 registerNodeForRendering(ISceneNode* node,
E_SCENE_NODE_RENDER_PASS pass = ESNRP_AUTOMATIC) = 0; E_SCENE_NODE_RENDER_PASS pass = ESNRP_AUTOMATIC) = 0;
//! Draws all the scene nodes. //! Draws all the scene nodes.
/** This can only be invoked between /** This can only be invoked between
IVideoDriver::beginScene() and IVideoDriver::endScene(). Please note that IVideoDriver::beginScene() and IVideoDriver::endScene(). Please note that
the scene is not only drawn when calling this, but also animated the scene is not only drawn when calling this, but also animated
by existing scene node animators, culling of scene nodes is done, etc. */ by existing scene node animators, culling of scene nodes is done, etc. */
virtual void drawAll() = 0; virtual void drawAll() = 0;
//! Creates a rotation animator, which rotates the attached scene node around itself. //! Creates a rotation animator, which rotates the attached scene node around itself.
/** \param rotationPerSecond: Specifies the speed of the animation /** \param rotationPerSecond: Specifies the speed of the animation
\return The animator. Attach it to a scene node with ISceneNode::addAnimator() \return The animator. Attach it to a scene node with ISceneNode::addAnimator()
and the animator will animate it. and the animator will animate it.
If you no longer need the animator, you should call ISceneNodeAnimator::drop(). If you no longer need the animator, you should call ISceneNodeAnimator::drop().
See IReferenceCounted::drop() for more information. */ See IReferenceCounted::drop() for more information. */
virtual ISceneNodeAnimator* createRotationAnimator(const core::vector3df& rotationPerSecond) = 0; virtual ISceneNodeAnimator* createRotationAnimator(const core::vector3df& rotationPerSecond) = 0;
//! Creates a fly circle animator, which lets the attached scene node fly around a center. //! Creates a fly circle animator, which lets the attached scene node fly around a center.
/** \param center: Center of the circle. /** \param center: Center of the circle.
\param radius: Radius of the circle. \param radius: Radius of the circle.
\param speed: The orbital speed, in radians per millisecond. \param speed: The orbital speed, in radians per millisecond.
\param direction: Specifies the upvector used for alignment of the mesh. \param direction: Specifies the upvector used for alignment of the mesh.
\param startPosition: The position on the circle where the animator will \param startPosition: The position on the circle where the animator will
begin. Value is in multiples of a circle, i.e. 0.5 is half way around. begin. Value is in multiples of a circle, i.e. 0.5 is half way around.
\return The animator. Attach it to a scene node with ISceneNode::addAnimator() \return The animator. Attach it to a scene node with ISceneNode::addAnimator()
and the animator will animate it. and the animator will animate it.
If you no longer need the animator, you should call ISceneNodeAnimator::drop(). If you no longer need the animator, you should call ISceneNodeAnimator::drop().
See IReferenceCounted::drop() for more information. */ See IReferenceCounted::drop() for more information. */
virtual ISceneNodeAnimator* createFlyCircleAnimator( virtual ISceneNodeAnimator* createFlyCircleAnimator(
const core::vector3df& center=core::vector3df(0.f,0.f,0.f), const core::vector3df& center=core::vector3df(0.f,0.f,0.f),
f32 radius=100.f, f32 speed=0.001f, f32 radius=100.f, f32 speed=0.001f,
...@@ -1062,70 +1062,70 @@ namespace scene ...@@ -1062,70 +1062,70 @@ namespace scene
//! Creates a fly straight animator, which lets the attached scene node fly or move along a line between two points. //! Creates a fly straight animator, which lets the attached scene node fly or move along a line between two points.
/** \param startPoint: Start point of the line. /** \param startPoint: Start point of the line.
\param endPoint: End point of the line. \param endPoint: End point of the line.
\param timeForWay: Time in milli seconds how long the node should need to \param timeForWay: Time in milli seconds how long the node should need to
move from the start point to the end point. move from the start point to the end point.
\param loop: If set to false, the node stops when the end point is reached. \param loop: If set to false, the node stops when the end point is reached.
If loop is true, the node begins again at the start. If loop is true, the node begins again at the start.
\return The animator. Attach it to a scene node with ISceneNode::addAnimator() \return The animator. Attach it to a scene node with ISceneNode::addAnimator()
and the animator will animate it. and the animator will animate it.
If you no longer need the animator, you should call ISceneNodeAnimator::drop(). If you no longer need the animator, you should call ISceneNodeAnimator::drop().
See IReferenceCounted::drop() for more information. */ See IReferenceCounted::drop() for more information. */
virtual ISceneNodeAnimator* createFlyStraightAnimator(const core::vector3df& startPoint, virtual ISceneNodeAnimator* createFlyStraightAnimator(const core::vector3df& startPoint,
const core::vector3df& endPoint, u32 timeForWay, bool loop=false) = 0; const core::vector3df& endPoint, u32 timeForWay, bool loop=false) = 0;
//! Creates a texture animator, which switches the textures of the target scene node based on a list of textures. //! Creates a texture animator, which switches the textures of the target scene node based on a list of textures.
/** \param textures: List of textures to use. /** \param textures: List of textures to use.
\param timePerFrame: Time in milliseconds, how long any texture in the list \param timePerFrame: Time in milliseconds, how long any texture in the list
should be visible. should be visible.
\param loop: If set to to false, the last texture remains set, and the animation \param loop: If set to to false, the last texture remains set, and the animation
stops. If set to true, the animation restarts with the first texture. stops. If set to true, the animation restarts with the first texture.
\return The animator. Attach it to a scene node with ISceneNode::addAnimator() \return The animator. Attach it to a scene node with ISceneNode::addAnimator()
and the animator will animate it. and the animator will animate it.
If you no longer need the animator, you should call ISceneNodeAnimator::drop(). If you no longer need the animator, you should call ISceneNodeAnimator::drop().
See IReferenceCounted::drop() for more information. */ See IReferenceCounted::drop() for more information. */
virtual ISceneNodeAnimator* createTextureAnimator(const core::array<video::ITexture*>& textures, virtual ISceneNodeAnimator* createTextureAnimator(const core::array<video::ITexture*>& textures,
s32 timePerFrame, bool loop=true) = 0; s32 timePerFrame, bool loop=true) = 0;
//! Creates a scene node animator, which deletes the scene node after some time automatically. //! Creates a scene node animator, which deletes the scene node after some time automatically.
/** \param timeMs: Time in milliseconds, after when the node will be deleted. /** \param timeMs: Time in milliseconds, after when the node will be deleted.
\return The animator. Attach it to a scene node with ISceneNode::addAnimator() \return The animator. Attach it to a scene node with ISceneNode::addAnimator()
and the animator will animate it. and the animator will animate it.
If you no longer need the animator, you should call ISceneNodeAnimator::drop(). If you no longer need the animator, you should call ISceneNodeAnimator::drop().
See IReferenceCounted::drop() for more information. */ See IReferenceCounted::drop() for more information. */
virtual ISceneNodeAnimator* createDeleteAnimator(u32 timeMs) = 0; virtual ISceneNodeAnimator* createDeleteAnimator(u32 timeMs) = 0;
//! Creates a special scene node animator for doing automatic collision detection and response. //! Creates a special scene node animator for doing automatic collision detection and response.
/** See ISceneNodeAnimatorCollisionResponse for details. /** See ISceneNodeAnimatorCollisionResponse for details.
\param world: Triangle selector holding all triangles of the world with which \param world: Triangle selector holding all triangles of the world with which
the scene node may collide. You can create a triangle selector with the scene node may collide. You can create a triangle selector with
ISceneManager::createTriangleSelector(); ISceneManager::createTriangleSelector();
\param sceneNode: SceneNode which should be manipulated. After you added this animator \param sceneNode: SceneNode which should be manipulated. After you added this animator
to the scene node, the scene node will not be able to move through walls and is to the scene node, the scene node will not be able to move through walls and is
affected by gravity. If you need to teleport the scene node to a new position without affected by gravity. If you need to teleport the scene node to a new position without
it being effected by the collision geometry, then call sceneNode->setPosition(); then it being effected by the collision geometry, then call sceneNode->setPosition(); then
animator->setTargetNode(sceneNode); animator->setTargetNode(sceneNode);
\param ellipsoidRadius: Radius of the ellipsoid with which collision detection and \param ellipsoidRadius: Radius of the ellipsoid with which collision detection and
response is done. If you have got a scene node, and you are unsure about response is done. If you have got a scene node, and you are unsure about
how big the radius should be, you could use the following code to determine how big the radius should be, you could use the following code to determine
it: it:
\code \code
const core::aabbox3d<f32>& box = yourSceneNode->getBoundingBox(); const core::aabbox3d<f32>& box = yourSceneNode->getBoundingBox();
core::vector3df radius = box.MaxEdge - box.getCenter(); core::vector3df radius = box.MaxEdge - box.getCenter();
\endcode \endcode
\param gravityPerSecond: Sets the gravity of the environment, as an acceleration in \param gravityPerSecond: Sets the gravity of the environment, as an acceleration in
units per second per second. If your units are equivalent to metres, then units per second per second. If your units are equivalent to metres, then
core::vector3df(0,-10.0f,0) would give an approximately realistic gravity. core::vector3df(0,-10.0f,0) would give an approximately realistic gravity.
You can disable gravity by setting it to core::vector3df(0,0,0). You can disable gravity by setting it to core::vector3df(0,0,0).
\param ellipsoidTranslation: By default, the ellipsoid for collision detection is created around \param ellipsoidTranslation: By default, the ellipsoid for collision detection is created around
the center of the scene node, which means that the ellipsoid surrounds the center of the scene node, which means that the ellipsoid surrounds
it completely. If this is not what you want, you may specify a translation it completely. If this is not what you want, you may specify a translation
for the ellipsoid. for the ellipsoid.
\param slidingValue: DOCUMENTATION NEEDED. \param slidingValue: DOCUMENTATION NEEDED.
\return The animator. Attach it to a scene node with ISceneNode::addAnimator() \return The animator. Attach it to a scene node with ISceneNode::addAnimator()
and the animator will cause it to do collision detection and response. and the animator will cause it to do collision detection and response.
If you no longer need the animator, you should call ISceneNodeAnimator::drop(). If you no longer need the animator, you should call ISceneNodeAnimator::drop().
See IReferenceCounted::drop() for more information. */ See IReferenceCounted::drop() for more information. */
virtual ISceneNodeAnimatorCollisionResponse* createCollisionResponseAnimator( virtual ISceneNodeAnimatorCollisionResponse* createCollisionResponseAnimator(
ITriangleSelector* world, ISceneNode* sceneNode, ITriangleSelector* world, ISceneNode* sceneNode,
const core::vector3df& ellipsoidRadius = core::vector3df(30,60,30), const core::vector3df& ellipsoidRadius = core::vector3df(30,60,30),
...@@ -1148,70 +1148,70 @@ namespace scene ...@@ -1148,70 +1148,70 @@ namespace scene
//! Creates a simple ITriangleSelector, based on a mesh. //! Creates a simple ITriangleSelector, based on a mesh.
/** Triangle selectors /** Triangle selectors
can be used for doing collision detection. Don't use this selector can be used for doing collision detection. Don't use this selector
for a huge amount of triangles like in Quake3 maps. for a huge amount of triangles like in Quake3 maps.
Instead, use for example ISceneManager::createOctTreeTriangleSelector(). Instead, use for example ISceneManager::createOctTreeTriangleSelector().
Please note that the created triangle selector is not automaticly attached Please note that the created triangle selector is not automaticly attached
to the scene node. You will have to call ISceneNode::setTriangleSelector() to the scene node. You will have to call ISceneNode::setTriangleSelector()
for this. To create and attach a triangle selector is done like this: for this. To create and attach a triangle selector is done like this:
\code \code
ITriangleSelector* s = sceneManager->createTriangleSelector(yourMesh, ITriangleSelector* s = sceneManager->createTriangleSelector(yourMesh,
yourSceneNode); yourSceneNode);
yourSceneNode->setTriangleSelector(s); yourSceneNode->setTriangleSelector(s);
s->drop(); s->drop();
\endcode \endcode
\param mesh: Mesh of which the triangles are taken. \param mesh: Mesh of which the triangles are taken.
\param node: Scene node of which visibility and transformation is used. \param node: Scene node of which visibility and transformation is used.
\return The selector, or null if not successful. \return The selector, or null if not successful.
If you no longer need the selector, you should call ITriangleSelector::drop(). If you no longer need the selector, you should call ITriangleSelector::drop().
See IReferenceCounted::drop() for more information. */ See IReferenceCounted::drop() for more information. */
virtual ITriangleSelector* createTriangleSelector(IMesh* mesh, ISceneNode* node) = 0; virtual ITriangleSelector* createTriangleSelector(IMesh* mesh, ISceneNode* node) = 0;
//! Creates a simple dynamic ITriangleSelector, based on a axis aligned bounding box. //! Creates a simple dynamic ITriangleSelector, based on a axis aligned bounding box.
/** Triangle selectors /** Triangle selectors
can be used for doing collision detection. Every time when triangles are can be used for doing collision detection. Every time when triangles are
queried, the triangle selector gets the bounding box of the scene node, queried, the triangle selector gets the bounding box of the scene node,
an creates new triangles. In this way, it works good with animated scene nodes. an creates new triangles. In this way, it works good with animated scene nodes.
\param node: Scene node of which the bounding box, visibility and transformation is used. \param node: Scene node of which the bounding box, visibility and transformation is used.
\return The selector, or null if not successful. \return The selector, or null if not successful.
If you no longer need the selector, you should call ITriangleSelector::drop(). If you no longer need the selector, you should call ITriangleSelector::drop().
See IReferenceCounted::drop() for more information. */ See IReferenceCounted::drop() for more information. */
virtual ITriangleSelector* createTriangleSelectorFromBoundingBox(ISceneNode* node) = 0; virtual ITriangleSelector* createTriangleSelectorFromBoundingBox(ISceneNode* node) = 0;
//! Creates a Triangle Selector, optimized by an octtree. //! Creates a Triangle Selector, optimized by an octtree.
/** Triangle selectors /** Triangle selectors
can be used for doing collision detection. This triangle selector is can be used for doing collision detection. This triangle selector is
optimized for huge amounts of triangle, it organizes them in an octtree. optimized for huge amounts of triangle, it organizes them in an octtree.
Please note that the created triangle selector is not automaticly attached Please note that the created triangle selector is not automaticly attached
to the scene node. You will have to call ISceneNode::setTriangleSelector() to the scene node. You will have to call ISceneNode::setTriangleSelector()
for this. To create and attach a triangle selector is done like this: for this. To create and attach a triangle selector is done like this:
\code \code
ITriangleSelector* s = sceneManager->createOctTreeTriangleSelector(yourMesh, ITriangleSelector* s = sceneManager->createOctTreeTriangleSelector(yourMesh,
yourSceneNode); yourSceneNode);
yourSceneNode->setTriangleSelector(s); yourSceneNode->setTriangleSelector(s);
s->drop(); s->drop();
\endcode \endcode
For more informations and examples on this, take a look at the collision For more informations and examples on this, take a look at the collision
tutorial in the SDK. tutorial in the SDK.
\param mesh: Mesh of which the triangles are taken. \param mesh: Mesh of which the triangles are taken.
\param node: Scene node of which visibility and transformation is used. \param node: Scene node of which visibility and transformation is used.
\param minimalPolysPerNode: Specifies the minimal polygons contained a octree node. \param minimalPolysPerNode: Specifies the minimal polygons contained a octree node.
If a node gets less polys the this value, it will not be splitted into If a node gets less polys the this value, it will not be splitted into
smaller nodes. smaller nodes.
\return The selector, or null if not successful. \return The selector, or null if not successful.
If you no longer need the selector, you should call ITriangleSelector::drop(). If you no longer need the selector, you should call ITriangleSelector::drop().
See IReferenceCounted::drop() for more information. */ See IReferenceCounted::drop() for more information. */
virtual ITriangleSelector* createOctTreeTriangleSelector(IMesh* mesh, virtual ITriangleSelector* createOctTreeTriangleSelector(IMesh* mesh,
ISceneNode* node, s32 minimalPolysPerNode=32) = 0; ISceneNode* node, s32 minimalPolysPerNode=32) = 0;
//! Creates a meta triangle selector. //! Creates a meta triangle selector.
/** A meta triangle selector is nothing more than a /** A meta triangle selector is nothing more than a
collection of one or more triangle selectors providing together collection of one or more triangle selectors providing together
the interface of one triangle selector. In this way, the interface of one triangle selector. In this way,
collision tests can be done with different triangle soups in one pass. collision tests can be done with different triangle soups in one pass.
\return The selector, or null if not successful. \return The selector, or null if not successful.
If you no longer need the selector, you should call ITriangleSelector::drop(). If you no longer need the selector, you should call ITriangleSelector::drop().
See IReferenceCounted::drop() for more information. */ See IReferenceCounted::drop() for more information. */
virtual IMetaTriangleSelector* createMetaTriangleSelector() = 0; virtual IMetaTriangleSelector* createMetaTriangleSelector() = 0;
//! Creates a triangle selector which can select triangles from a terrain scene node. //! Creates a triangle selector which can select triangles from a terrain scene node.
...@@ -1244,18 +1244,18 @@ namespace scene ...@@ -1244,18 +1244,18 @@ namespace scene
//! Adds a scene node to the deletion queue. //! Adds a scene node to the deletion queue.
/** The scene node is immediatly /** The scene node is immediatly
deleted when it's secure. Which means when the scene node does not deleted when it's secure. Which means when the scene node does not
execute animators and things like that. This method is for example execute animators and things like that. This method is for example
used for deleting scene nodes by their scene node animators. In used for deleting scene nodes by their scene node animators. In
most other cases, a ISceneNode::remove() call is enough, using this most other cases, a ISceneNode::remove() call is enough, using this
deletion queue is not necessary. deletion queue is not necessary.
See ISceneManager::createDeleteAnimator() for details. See ISceneManager::createDeleteAnimator() for details.
\param node: Node to detete. */ \param node: Node to detete. */
virtual void addToDeletionQueue(ISceneNode* node) = 0; virtual void addToDeletionQueue(ISceneNode* node) = 0;
//! Posts an input event to the environment. //! Posts an input event to the environment.
/** Usually you do not have to /** Usually you do not have to
use this method, it is used by the internal engine. */ use this method, it is used by the internal engine. */
virtual bool postEventFromUser(const SEvent& event) = 0; virtual bool postEventFromUser(const SEvent& event) = 0;
//! Clears the whole scene. //! Clears the whole scene.
...@@ -1264,19 +1264,19 @@ namespace scene ...@@ -1264,19 +1264,19 @@ namespace scene
//! Get interface to the parameters set in this scene. //! Get interface to the parameters set in this scene.
/** String parameters can be used by plugins and mesh loaders. /** String parameters can be used by plugins and mesh loaders.
For example the CMS and LMTS loader want a parameter named 'CSM_TexturePath' For example the CMS and LMTS loader want a parameter named 'CSM_TexturePath'
and 'LMTS_TexturePath' set to the path were attached textures can be found. See and 'LMTS_TexturePath' set to the path were attached textures can be found. See
CSM_TEXTURE_PATH, LMTS_TEXTURE_PATH, MY3D_TEXTURE_PATH, CSM_TEXTURE_PATH, LMTS_TEXTURE_PATH, MY3D_TEXTURE_PATH,
COLLADA_CREATE_SCENE_INSTANCES, DMF_TEXTURE_PATH and DMF_USE_MATERIALS_DIRS*/ COLLADA_CREATE_SCENE_INSTANCES, DMF_TEXTURE_PATH and DMF_USE_MATERIALS_DIRS*/
virtual io::IAttributes* getParameters() = 0; virtual io::IAttributes* getParameters() = 0;
//! Get current render pass. //! Get current render pass.
/** All scene nodes are being rendered in a specific order. /** All scene nodes are being rendered in a specific order.
First lights, cameras, sky boxes, solid geometry, and then transparent First lights, cameras, sky boxes, solid geometry, and then transparent
stuff. During the rendering process, scene nodes may want to know what the scene stuff. During the rendering process, scene nodes may want to know what the scene
manager is rendering currently, because for example they registered for rendering manager is rendering currently, because for example they registered for rendering
twice, once for transparent geometry and once for solid. When knowing what rendering twice, once for transparent geometry and once for solid. When knowing what rendering
pass currently is active they can render the correct part of their geometry. */ pass currently is active they can render the correct part of their geometry. */
virtual E_SCENE_NODE_RENDER_PASS getSceneNodeRenderPass() const = 0; virtual E_SCENE_NODE_RENDER_PASS getSceneNodeRenderPass() const = 0;
//! Get the default scene node factory which can create all built in scene nodes //! Get the default scene node factory which can create all built in scene nodes
......
...@@ -82,6 +82,7 @@ namespace video ...@@ -82,6 +82,7 @@ namespace video
{ {
//! Render target is the main color frame buffer //! Render target is the main color frame buffer
ERT_FRAME_BUFFER=0, ERT_FRAME_BUFFER=0,
//! Render target is the main color frame buffer
ERT_STEREO_LEFT_BUFFER=0, ERT_STEREO_LEFT_BUFFER=0,
//! Render target is a render texture //! Render target is a render texture
ERT_RENDER_TEXTURE, ERT_RENDER_TEXTURE,
...@@ -134,19 +135,19 @@ namespace video ...@@ -134,19 +135,19 @@ namespace video
virtual bool beginScene(bool backBuffer=true, bool zBuffer=true, virtual bool beginScene(bool backBuffer=true, bool zBuffer=true,
SColor color=SColor(255,0,0,0), SColor color=SColor(255,0,0,0),
void* windowId=0, void* windowId=0,
core::rect<s32>* sourceRect=0) = 0; core::rect<s32>* sourceRect=0) =0;
//! Presents the rendered image to the screen. //! Presents the rendered image to the screen.
/** Applications must call this method after performing any /** Applications must call this method after performing any
rendering. rendering.
\return False if failed and true if succeeded. */ \return False if failed and true if succeeded. */
virtual bool endScene() = 0; virtual bool endScene() =0;
//! Queries the features of the driver. //! Queries the features of the driver.
/** Returns true if a feature is available /** Returns true if a feature is available
\param feature Feature to query. \param feature Feature to query.
\return True if the feature is available, false if not. */ \return True if the feature is available, false if not. */
virtual bool queryFeature(E_VIDEO_DRIVER_FEATURE feature) const = 0; virtual bool queryFeature(E_VIDEO_DRIVER_FEATURE feature) const =0;
//! Disable a feature of the driver. //! Disable a feature of the driver.
/** Can also be used to enable the features again. It is not /** Can also be used to enable the features again. It is not
...@@ -165,17 +166,17 @@ namespace video ...@@ -165,17 +166,17 @@ namespace video
/** \param state Transformation type to be set, e.g. view, /** \param state Transformation type to be set, e.g. view,
world, or projection. world, or projection.
\param mat Matrix describing the transformation. */ \param mat Matrix describing the transformation. */
virtual void setTransform(E_TRANSFORMATION_STATE state, const core::matrix4& mat) = 0; virtual void setTransform(E_TRANSFORMATION_STATE state, const core::matrix4& mat) =0;
//! Returns the transformation set by setTransform //! Returns the transformation set by setTransform
/** \param state Transformation type to query /** \param state Transformation type to query
\return Matrix describing the transformation. */ \return Matrix describing the transformation. */
virtual const core::matrix4& getTransform(E_TRANSFORMATION_STATE state) const = 0; virtual const core::matrix4& getTransform(E_TRANSFORMATION_STATE state) const =0;
//! Sets a material. //! Sets a material.
/** All 3d drawing functions will draw geometry using this material thereafter. /** All 3d drawing functions will draw geometry using this material thereafter.
\param material: Material to be used from now on. */ \param material: Material to be used from now on. */
virtual void setMaterial(const SMaterial& material) = 0; virtual void setMaterial(const SMaterial& material) =0;
//! Get access to a named texture. //! Get access to a named texture.
/** Loads the texture from disk if it is not /** Loads the texture from disk if it is not
...@@ -187,7 +188,7 @@ namespace video ...@@ -187,7 +188,7 @@ namespace video
\return Pointer to the texture, or 0 if the texture \return Pointer to the texture, or 0 if the texture
could not be loaded. This pointer should not be dropped. See could not be loaded. This pointer should not be dropped. See
IReferenceCounted::drop() for more information. */ IReferenceCounted::drop() for more information. */
virtual ITexture* getTexture(const c8* filename) = 0; virtual ITexture* getTexture(const c8* filename) =0;
//! Get access to a named texture. //! Get access to a named texture.
/** Loads the texture from disk if it is not /** Loads the texture from disk if it is not
...@@ -199,7 +200,7 @@ namespace video ...@@ -199,7 +200,7 @@ namespace video
\return Pointer to the texture, or 0 if the texture \return Pointer to the texture, or 0 if the texture
could not be loaded. This pointer should not be dropped. See could not be loaded. This pointer should not be dropped. See
IReferenceCounted::drop() for more information. */ IReferenceCounted::drop() for more information. */
virtual ITexture* getTexture(const core::stringc& filename) = 0; virtual ITexture* getTexture(const core::stringc& filename) =0;
//! Get access to a named texture. //! Get access to a named texture.
/** Loads the texture from disk if it is not /** Loads the texture from disk if it is not
...@@ -211,7 +212,7 @@ namespace video ...@@ -211,7 +212,7 @@ namespace video
\return Pointer to the texture, or 0 if the texture \return Pointer to the texture, or 0 if the texture
could not be loaded. This pointer should not be dropped. See could not be loaded. This pointer should not be dropped. See
IReferenceCounted::drop() for more information. */ IReferenceCounted::drop() for more information. */
virtual ITexture* getTexture(io::IReadFile* file) = 0; virtual ITexture* getTexture(io::IReadFile* file) =0;
//! Returns a texture by index //! Returns a texture by index
/** \param index: Index of the texture, must be smaller than /** \param index: Index of the texture, must be smaller than
...@@ -220,7 +221,7 @@ namespace video ...@@ -220,7 +221,7 @@ namespace video
\return Pointer to the texture, or 0 if the texture was not \return Pointer to the texture, or 0 if the texture was not
set or index is out of bounds. This pointer should not be set or index is out of bounds. This pointer should not be
dropped. See IReferenceCounted::drop() for more information. */ dropped. See IReferenceCounted::drop() for more information. */
virtual ITexture* getTextureByIndex(u32 index) = 0; virtual ITexture* getTextureByIndex(u32 index) =0;
//! Returns amount of textures currently loaded //! Returns amount of textures currently loaded
/** \return Amount of textures currently loaded */ /** \return Amount of textures currently loaded */
...@@ -229,7 +230,7 @@ namespace video ...@@ -229,7 +230,7 @@ namespace video
//! Renames a texture //! Renames a texture
/** \param texture Pointer to the texture to rename. /** \param texture Pointer to the texture to rename.
\param newName New name for the texture. This should be a unique name. */ \param newName New name for the texture. This should be a unique name. */
virtual void renameTexture(ITexture* texture, const c8* newName) = 0; virtual void renameTexture(ITexture* texture, const c8* newName) =0;
//! Creates an empty texture of specified size. //! Creates an empty texture of specified size.
/** \param size: Size of the texture. /** \param size: Size of the texture.
...@@ -242,7 +243,7 @@ namespace video ...@@ -242,7 +243,7 @@ namespace video
should not be dropped. See IReferenceCounted::drop() for more should not be dropped. See IReferenceCounted::drop() for more
information. */ information. */
virtual ITexture* addTexture(const core::dimension2d<u32>& size, virtual ITexture* addTexture(const core::dimension2d<u32>& size,
const c8* name, ECOLOR_FORMAT format = ECF_A8R8G8B8) = 0; const c8* name, ECOLOR_FORMAT format = ECF_A8R8G8B8) =0;
//! Creates a texture from an IImage. //! Creates a texture from an IImage.
/** \param name A name for the texture. Later calls of /** \param name A name for the texture. Later calls of
...@@ -251,7 +252,7 @@ namespace video ...@@ -251,7 +252,7 @@ namespace video
\return Pointer to the newly created texture. This pointer \return Pointer to the newly created texture. This pointer
should not be dropped. See IReferenceCounted::drop() for more should not be dropped. See IReferenceCounted::drop() for more
information. */ information. */
virtual ITexture* addTexture(const c8* name, IImage* image) = 0; virtual ITexture* addTexture(const c8* name, IImage* image) =0;
//! Adds a new render target texture to the texture cache. //! Adds a new render target texture to the texture cache.
/** \param size Size of the texture, in pixels. Width and /** \param size Size of the texture, in pixels. Width and
...@@ -278,7 +279,7 @@ namespace video ...@@ -278,7 +279,7 @@ namespace video
good idea to set all materials which are using this texture to good idea to set all materials which are using this texture to
0 or another texture first. 0 or another texture first.
\param texture Texture to delete from the engine cache. */ \param texture Texture to delete from the engine cache. */
virtual void removeTexture(ITexture* texture) = 0; virtual void removeTexture(ITexture* texture) =0;
//! Removes all textures from the texture cache and deletes them. //! Removes all textures from the texture cache and deletes them.
/** This method can free a lot of memory! /** This method can free a lot of memory!
...@@ -287,13 +288,13 @@ namespace video ...@@ -287,13 +288,13 @@ namespace video
by other parts of the engine for storing it longer. So it is a by other parts of the engine for storing it longer. So it is a
good idea to set all materials which are using this texture to good idea to set all materials which are using this texture to
0 or another texture first. */ 0 or another texture first. */
virtual void removeAllTextures() = 0; virtual void removeAllTextures() =0;
//! Remove hardware buffer //! Remove hardware buffer
virtual void removeHardwareBuffer(const scene::IMeshBuffer* mb) = 0; virtual void removeHardwareBuffer(const scene::IMeshBuffer* mb) =0;
//! Remove all hardware buffers //! Remove all hardware buffers
virtual void removeAllHardwareBuffers() = 0; virtual void removeAllHardwareBuffers() =0;
//! Sets a boolean alpha channel on the texture based on a color key. //! Sets a boolean alpha channel on the texture based on a color key.
/** This makes the texture fully transparent at the texels where /** This makes the texture fully transparent at the texels where
...@@ -312,8 +313,8 @@ namespace video ...@@ -312,8 +313,8 @@ namespace video
(i.e. black). This behaviour matches the legacy (buggy) behaviour prior (i.e. black). This behaviour matches the legacy (buggy) behaviour prior
to release 1.5 and is provided for backwards compatibility only.*/ to release 1.5 and is provided for backwards compatibility only.*/
virtual void makeColorKeyTexture(video::ITexture* texture, virtual void makeColorKeyTexture(video::ITexture* texture,
video::SColor color, video::SColor color,
bool zeroTexels = false) const = 0; bool zeroTexels = false) const =0;
//! Sets a boolean alpha channel on the texture based on the color at a position. //! Sets a boolean alpha channel on the texture based on the color at a position.
/** This makes the texture fully transparent at the texels where /** This makes the texture fully transparent at the texels where
...@@ -328,8 +329,8 @@ namespace video ...@@ -328,8 +329,8 @@ namespace video
(i.e. black). This behaviour matches the legacy (buggy) behaviour prior (i.e. black). This behaviour matches the legacy (buggy) behaviour prior
to release 1.5 and is provided for backwards compatibility only.*/ to release 1.5 and is provided for backwards compatibility only.*/
virtual void makeColorKeyTexture(video::ITexture* texture, virtual void makeColorKeyTexture(video::ITexture* texture,
core::position2d<s32> colorKeyPixelPos, core::position2d<s32> colorKeyPixelPos,
bool zeroTexels = false) const = 0; bool zeroTexels = false) const =0;
//! Creates a normal map from a height map texture. //! Creates a normal map from a height map texture.
/** If the target texture has 32 bit, the height value is /** If the target texture has 32 bit, the height value is
...@@ -339,7 +340,7 @@ namespace video ...@@ -339,7 +340,7 @@ namespace video
\param texture Texture whose alpha channel is modified. \param texture Texture whose alpha channel is modified.
\param amplitude Constant value by which the height \param amplitude Constant value by which the height
information is multiplied.*/ information is multiplied.*/
virtual void makeNormalMapTexture(video::ITexture* texture, f32 amplitude=1.0f) const = 0; virtual void makeNormalMapTexture(video::ITexture* texture, f32 amplitude=1.0f) const =0;
//! Sets a new render target. //! Sets a new render target.
/** This will only work if the driver supports the /** This will only work if the driver supports the
...@@ -396,11 +397,11 @@ namespace video ...@@ -396,11 +397,11 @@ namespace video
/** Every rendering operation is done into this new area. /** Every rendering operation is done into this new area.
\param area: Rectangle defining the new area of rendering \param area: Rectangle defining the new area of rendering
operations. */ operations. */
virtual void setViewPort(const core::rect<s32>& area) = 0; virtual void setViewPort(const core::rect<s32>& area) =0;
//! Gets the area of the current viewport. //! Gets the area of the current viewport.
/** \return Rectangle of the current viewport. */ /** \return Rectangle of the current viewport. */
virtual const core::rect<s32>& getViewPort() const = 0; virtual const core::rect<s32>& getViewPort() const =0;
//! Draws a vertex primitive list //! Draws a vertex primitive list
/** Note that, depending on the index type, some vertices might be not /** Note that, depending on the index type, some vertices might be not
...@@ -415,7 +416,9 @@ namespace video ...@@ -415,7 +416,9 @@ namespace video
\param iType Index type, e.g. video::EIT_16BIT for a triangle fan. */ \param iType Index type, e.g. video::EIT_16BIT for a triangle fan. */
virtual void drawVertexPrimitiveList(const void* vertices, u32 vertexCount, virtual void drawVertexPrimitiveList(const void* vertices, u32 vertexCount,
const void* indexList, u32 primCount, const void* indexList, u32 primCount,
E_VERTEX_TYPE vType=EVT_STANDARD, scene::E_PRIMITIVE_TYPE pType=scene::EPT_TRIANGLES, E_INDEX_TYPE iType=EIT_16BIT) = 0; E_VERTEX_TYPE vType=EVT_STANDARD,
scene::E_PRIMITIVE_TYPE pType=scene::EPT_TRIANGLES,
E_INDEX_TYPE iType=EIT_16BIT) =0;
//! Draws an indexed triangle list. //! Draws an indexed triangle list.
/** Note that there may be at maximum 65536 vertices, because /** Note that there may be at maximum 65536 vertices, because
...@@ -427,7 +430,7 @@ namespace video ...@@ -427,7 +430,7 @@ namespace video
\param indexList Pointer to array of indices. \param indexList Pointer to array of indices.
\param triangleCount Amount of Triangles. Usually amount of indices / 3. */ \param triangleCount Amount of Triangles. Usually amount of indices / 3. */
virtual void drawIndexedTriangleList(const S3DVertex* vertices, virtual void drawIndexedTriangleList(const S3DVertex* vertices,
u32 vertexCount, const u16* indexList, u32 triangleCount) = 0; u32 vertexCount, const u16* indexList, u32 triangleCount) =0;
//! Draws an indexed triangle list. //! Draws an indexed triangle list.
/** Note that there may be at maximum 65536 vertices, because /** Note that there may be at maximum 65536 vertices, because
...@@ -439,7 +442,7 @@ namespace video ...@@ -439,7 +442,7 @@ namespace video
\param indexList Pointer to array of indices. \param indexList Pointer to array of indices.
\param triangleCount Amount of Triangles. Usually amount of indices / 3. */ \param triangleCount Amount of Triangles. Usually amount of indices / 3. */
virtual void drawIndexedTriangleList(const S3DVertex2TCoords* vertices, virtual void drawIndexedTriangleList(const S3DVertex2TCoords* vertices,
u32 vertexCount, const u16* indexList, u32 triangleCount) = 0; u32 vertexCount, const u16* indexList, u32 triangleCount) =0;
//! Draws an indexed triangle list. //! Draws an indexed triangle list.
/** Note that there may be at maximum 65536 vertices, because /** Note that there may be at maximum 65536 vertices, because
...@@ -451,7 +454,7 @@ namespace video ...@@ -451,7 +454,7 @@ namespace video
\param indexList Pointer to array of indices. \param indexList Pointer to array of indices.
\param triangleCount Amount of Triangles. Usually amount of indices / 3. */ \param triangleCount Amount of Triangles. Usually amount of indices / 3. */
virtual void drawIndexedTriangleList(const S3DVertexTangents* vertices, virtual void drawIndexedTriangleList(const S3DVertexTangents* vertices,
u32 vertexCount, const u16* indexList, u32 triangleCount) = 0; u32 vertexCount, const u16* indexList, u32 triangleCount) =0;
//! Draws an indexed triangle fan. //! Draws an indexed triangle fan.
/** Note that there may be at maximum 65536 vertices, because /** Note that there may be at maximum 65536 vertices, because
...@@ -463,7 +466,7 @@ namespace video ...@@ -463,7 +466,7 @@ namespace video
\param indexList Pointer to array of indices. \param indexList Pointer to array of indices.
\param triangleCount Amount of Triangles. Usually amount of indices - 2. */ \param triangleCount Amount of Triangles. Usually amount of indices - 2. */
virtual void drawIndexedTriangleFan(const S3DVertex* vertices, virtual void drawIndexedTriangleFan(const S3DVertex* vertices,
u32 vertexCount, const u16* indexList, u32 triangleCount) = 0; u32 vertexCount, const u16* indexList, u32 triangleCount) =0;
//! Draws an indexed triangle fan. //! Draws an indexed triangle fan.
/** Note that there may be at maximum 65536 vertices, because /** Note that there may be at maximum 65536 vertices, because
...@@ -475,7 +478,7 @@ namespace video ...@@ -475,7 +478,7 @@ namespace video
\param indexList Pointer to array of indices. \param indexList Pointer to array of indices.
\param triangleCount Amount of Triangles. Usually amount of indices - 2. */ \param triangleCount Amount of Triangles. Usually amount of indices - 2. */
virtual void drawIndexedTriangleFan(const S3DVertex2TCoords* vertices, virtual void drawIndexedTriangleFan(const S3DVertex2TCoords* vertices,
u32 vertexCount, const u16* indexList, u32 triangleCount) = 0; u32 vertexCount, const u16* indexList, u32 triangleCount) =0;
//! Draws a 3d line. //! Draws a 3d line.
/** For some implementations, this method simply calls /** For some implementations, this method simply calls
...@@ -493,7 +496,7 @@ namespace video ...@@ -493,7 +496,7 @@ namespace video
\param end End of the 3d line. \param end End of the 3d line.
\param color Color of the line. */ \param color Color of the line. */
virtual void draw3DLine(const core::vector3df& start, virtual void draw3DLine(const core::vector3df& start,
const core::vector3df& end, SColor color = SColor(255,255,255,255)) = 0; const core::vector3df& end, SColor color = SColor(255,255,255,255)) =0;
//! Draws a 3d triangle. //! Draws a 3d triangle.
/** This method calls drawIndexedTriangles for some triangles. /** This method calls drawIndexedTriangles for some triangles.
...@@ -510,7 +513,7 @@ namespace video ...@@ -510,7 +513,7 @@ namespace video
\param triangle The triangle to draw. \param triangle The triangle to draw.
\param color Color of the line. */ \param color Color of the line. */
virtual void draw3DTriangle(const core::triangle3df& triangle, virtual void draw3DTriangle(const core::triangle3df& triangle,
SColor color = SColor(255,255,255,255)) = 0; SColor color = SColor(255,255,255,255)) =0;
//! Draws a 3d axis aligned box. //! Draws a 3d axis aligned box.
/** This method simply calls draw3DLine for the edges of the /** This method simply calls draw3DLine for the edges of the
...@@ -525,14 +528,14 @@ namespace video ...@@ -525,14 +528,14 @@ namespace video
\param box The axis aligned box to draw \param box The axis aligned box to draw
\param color Color to use while drawing the box. */ \param color Color to use while drawing the box. */
virtual void draw3DBox(const core::aabbox3d<f32>& box, virtual void draw3DBox(const core::aabbox3d<f32>& box,
SColor color = SColor(255,255,255,255)) = 0; SColor color = SColor(255,255,255,255)) =0;
//! Draws a 2d image without any special effects //! Draws a 2d image without any special effects
/** \param texture Pointer to texture to use. /** \param texture Pointer to texture to use.
\param destPos Upper left 2d destination position where the \param destPos Upper left 2d destination position where the
image will be drawn. */ image will be drawn. */
virtual void draw2DImage(const video::ITexture* texture, virtual void draw2DImage(const video::ITexture* texture,
const core::position2d<s32>& destPos) = 0; const core::position2d<s32>& destPos) =0;
//! Draws a 2d image using a color //! Draws a 2d image using a color
/** (if color is other than /** (if color is other than
...@@ -551,8 +554,8 @@ namespace video ...@@ -551,8 +554,8 @@ namespace video
\param useAlphaChannelOfTexture: If true, the alpha channel of \param useAlphaChannelOfTexture: If true, the alpha channel of
the texture is used to draw the image.*/ the texture is used to draw the image.*/
virtual void draw2DImage(const video::ITexture* texture, const core::position2d<s32>& destPos, virtual void draw2DImage(const video::ITexture* texture, const core::position2d<s32>& destPos,
const core::rect<s32>& sourceRect, const core::rect<s32>* clipRect = 0, const core::rect<s32>& sourceRect, const core::rect<s32>* clipRect =0,
SColor color=SColor(255,255,255,255), bool useAlphaChannelOfTexture=false) = 0; SColor color=SColor(255,255,255,255), bool useAlphaChannelOfTexture=false) =0;
//! Draws a set of 2d images, using a color and the alpha channel of the texture. //! Draws a set of 2d images, using a color and the alpha channel of the texture.
/** The images are drawn beginning at pos and concatenated in /** The images are drawn beginning at pos and concatenated in
...@@ -581,7 +584,7 @@ namespace video ...@@ -581,7 +584,7 @@ namespace video
s32 kerningWidth=0, s32 kerningWidth=0,
const core::rect<s32>* clipRect=0, const core::rect<s32>* clipRect=0,
SColor color=SColor(255,255,255,255), SColor color=SColor(255,255,255,255),
bool useAlphaChannelOfTexture=false) = 0; bool useAlphaChannelOfTexture=false) =0;
//! Draws a part of the texture into the rectangle. Note that colors must be an array of 4 colors if used. //! Draws a part of the texture into the rectangle. Note that colors must be an array of 4 colors if used.
/** Suggested and first implemented by zola. /** Suggested and first implemented by zola.
...@@ -594,8 +597,8 @@ namespace video ...@@ -594,8 +597,8 @@ namespace video
\param useAlphaChannelOfTexture True if alpha channel will be \param useAlphaChannelOfTexture True if alpha channel will be
blended. */ blended. */
virtual void draw2DImage(const video::ITexture* texture, const core::rect<s32>& destRect, virtual void draw2DImage(const video::ITexture* texture, const core::rect<s32>& destRect,
const core::rect<s32>& sourceRect, const core::rect<s32>* clipRect = 0, const core::rect<s32>& sourceRect, const core::rect<s32>* clipRect =0,
const video::SColor * const colors=0, bool useAlphaChannelOfTexture=false) = 0; const video::SColor * const colors=0, bool useAlphaChannelOfTexture=false) =0;
//! Draws a 2d rectangle. //! Draws a 2d rectangle.
/** \param color Color of the rectangle to draw. The alpha /** \param color Color of the rectangle to draw. The alpha
...@@ -606,7 +609,7 @@ namespace video ...@@ -606,7 +609,7 @@ namespace video
will be clipped. If the pointer is null, no clipping will be will be clipped. If the pointer is null, no clipping will be
performed. */ performed. */
virtual void draw2DRectangle(SColor color, const core::rect<s32>& pos, virtual void draw2DRectangle(SColor color, const core::rect<s32>& pos,
const core::rect<s32>* clip = 0) = 0; const core::rect<s32>* clip =0) =0;
//! Draws a 2d rectangle with a gradient. //! Draws a 2d rectangle with a gradient.
/** \param colorLeftUp Color of the upper left corner to draw. /** \param colorLeftUp Color of the upper left corner to draw.
...@@ -628,14 +631,14 @@ namespace video ...@@ -628,14 +631,14 @@ namespace video
virtual void draw2DRectangle(const core::rect<s32>& pos, virtual void draw2DRectangle(const core::rect<s32>& pos,
SColor colorLeftUp, SColor colorRightUp, SColor colorLeftUp, SColor colorRightUp,
SColor colorLeftDown, SColor colorRightDown, SColor colorLeftDown, SColor colorRightDown,
const core::rect<s32>* clip = 0) = 0; const core::rect<s32>* clip =0) =0;
//! Draws the outline of a 2D rectangle. //! Draws the outline of a 2D rectangle.
/** \param pos Position of the rectangle. /** \param pos Position of the rectangle.
\param color Color of the rectangle to draw. The alpha component \param color Color of the rectangle to draw. The alpha component
specifies how transparent the rectangle outline will be. */ specifies how transparent the rectangle outline will be. */
virtual void draw2DRectangleOutline(const core::recti& pos, virtual void draw2DRectangleOutline(const core::recti& pos,
SColor color=SColor(255,255,255,255)) = 0 ; SColor color=SColor(255,255,255,255)) =0;
//! Draws a 2d line. //! Draws a 2d line.
/** \param start Screen coordinates of the start of the line /** \param start Screen coordinates of the start of the line
...@@ -645,13 +648,13 @@ namespace video ...@@ -645,13 +648,13 @@ namespace video
\param color Color of the line to draw. */ \param color Color of the line to draw. */
virtual void draw2DLine(const core::position2d<s32>& start, virtual void draw2DLine(const core::position2d<s32>& start,
const core::position2d<s32>& end, const core::position2d<s32>& end,
SColor color=SColor(255,255,255,255)) = 0; SColor color=SColor(255,255,255,255)) =0;
//! Draws a pixel. //! Draws a pixel.
/** \param x The x-position of the pixel. /** \param x The x-position of the pixel.
\param y The y-position of the pixel. \param y The y-position of the pixel.
\param color Color of the pixel to draw. */ \param color Color of the pixel to draw. */
virtual void drawPixel(u32 x, u32 y, const SColor& color) = 0; virtual void drawPixel(u32 x, u32 y, const SColor& color) =0;
//! Draws a non filled concyclic regular 2d polyon. //! Draws a non filled concyclic regular 2d polyon.
/** This method can be used to draw circles, but also /** This method can be used to draw circles, but also
...@@ -669,7 +672,7 @@ namespace video ...@@ -669,7 +672,7 @@ namespace video
virtual void draw2DPolygon(core::position2d<s32> center, virtual void draw2DPolygon(core::position2d<s32> center,
f32 radius, f32 radius,
video::SColor color=SColor(100,255,255,255), video::SColor color=SColor(100,255,255,255),
s32 vertexCount=10) = 0; s32 vertexCount=10) =0;
//! Draws a shadow volume into the stencil buffer. //! Draws a shadow volume into the stencil buffer.
/** To draw a stencil shadow, do this: First, draw all geometry. /** To draw a stencil shadow, do this: First, draw all geometry.
...@@ -683,7 +686,7 @@ namespace video ...@@ -683,7 +686,7 @@ namespace video
\param count Amount of triangles in the array. \param count Amount of triangles in the array.
\param zfail If set to true, zfail method is used, otherwise \param zfail If set to true, zfail method is used, otherwise
zpass. */ zpass. */
virtual void drawStencilShadowVolume(const core::vector3df* triangles, s32 count, bool zfail=true) = 0; virtual void drawStencilShadowVolume(const core::vector3df* triangles, s32 count, bool zfail=true) =0;
//! Fills the stencil shadow with color. //! Fills the stencil shadow with color.
/** After the shadow volume has been drawn into the stencil /** After the shadow volume has been drawn into the stencil
...@@ -709,11 +712,11 @@ namespace video ...@@ -709,11 +712,11 @@ namespace video
video::SColor leftUpEdge = video::SColor(255,0,0,0), video::SColor leftUpEdge = video::SColor(255,0,0,0),
video::SColor rightUpEdge = video::SColor(255,0,0,0), video::SColor rightUpEdge = video::SColor(255,0,0,0),
video::SColor leftDownEdge = video::SColor(255,0,0,0), video::SColor leftDownEdge = video::SColor(255,0,0,0),
video::SColor rightDownEdge = video::SColor(255,0,0,0)) = 0; video::SColor rightDownEdge = video::SColor(255,0,0,0)) =0;
//! Draws a mesh buffer //! Draws a mesh buffer
/** \param mb Buffer to draw; */ /** \param mb Buffer to draw; */
virtual void drawMeshBuffer(const scene::IMeshBuffer* mb) = 0; virtual void drawMeshBuffer(const scene::IMeshBuffer* mb) =0;
//! Sets the fog mode. //! Sets the fog mode.
/** These are global values attached to each 3d object rendered, /** These are global values attached to each 3d object rendered,
...@@ -736,22 +739,22 @@ namespace video ...@@ -736,22 +739,22 @@ namespace video
virtual void setFog(SColor color=SColor(0,255,255,255), virtual void setFog(SColor color=SColor(0,255,255,255),
bool linearFog=true, f32 start=50.0f, f32 end=100.0f, bool linearFog=true, f32 start=50.0f, f32 end=100.0f,
f32 density=0.01f, f32 density=0.01f,
bool pixelFog=false, bool rangeFog=false) = 0; bool pixelFog=false, bool rangeFog=false) =0;
//! Get the current color format of the color buffer //! Get the current color format of the color buffer
/** \return Color format of the color buffer. */ /** \return Color format of the color buffer. */
virtual ECOLOR_FORMAT getColorFormat() const = 0; virtual ECOLOR_FORMAT getColorFormat() const =0;
//! Get the size of the screen or render window. //! Get the size of the screen or render window.
/** \return Size of screen or render window. */ /** \return Size of screen or render window. */
virtual const core::dimension2d<u32>& getScreenSize() const = 0; virtual const core::dimension2d<u32>& getScreenSize() const =0;
//! Get the size of the current render target //! Get the size of the current render target
/** This method will return the screen size if the driver /** This method will return the screen size if the driver
doesn't support render to texture, or if the current render doesn't support render to texture, or if the current render
target is the screen. target is the screen.
\return Size of render target or screen/window */ \return Size of render target or screen/window */
virtual const core::dimension2d<u32>& getCurrentRenderTargetSize() const = 0; virtual const core::dimension2d<u32>& getCurrentRenderTargetSize() const =0;
//! Returns current frames per second value. //! Returns current frames per second value.
/** This value is updated approximately every 1.5 seconds and /** This value is updated approximately every 1.5 seconds and
...@@ -759,46 +762,46 @@ namespace video ...@@ -759,46 +762,46 @@ namespace video
rate. It is not suitable for use in performing timing rate. It is not suitable for use in performing timing
calculations or framerate independent movement. calculations or framerate independent movement.
\return Approximate amount of frames per second drawn. */ \return Approximate amount of frames per second drawn. */
virtual s32 getFPS() const = 0; virtual s32 getFPS() const =0;
//! Returns amount of primitives (mostly triangles) which were drawn in the last frame. //! Returns amount of primitives (mostly triangles) which were drawn in the last frame.
/** Together with getFPS() very useful method for statistics. /** Together with getFPS() very useful method for statistics.
\param mode Defines if the primitives drawn are accumulated or \param mode Defines if the primitives drawn are accumulated or
counted per frame. counted per frame.
\return Amount of primitives drawn in the last frame. */ \return Amount of primitives drawn in the last frame. */
virtual u32 getPrimitiveCountDrawn( u32 mode = 0 ) const = 0; virtual u32 getPrimitiveCountDrawn( u32 mode =0 ) const =0;
//! Deletes all dynamic lights which were previously added with addDynamicLight(). //! Deletes all dynamic lights which were previously added with addDynamicLight().
virtual void deleteAllDynamicLights() = 0; virtual void deleteAllDynamicLights() =0;
//! adds a dynamic light, returning an index to the light //! adds a dynamic light, returning an index to the light
//! \param light: the light data to use to create the light //! \param light: the light data to use to create the light
//! \return An index to the light, or -1 if an error occurs //! \return An index to the light, or -1 if an error occurs
virtual s32 addDynamicLight(const SLight& light) = 0; virtual s32 addDynamicLight(const SLight& light) =0;
//! Returns the maximal amount of dynamic lights the device can handle //! Returns the maximal amount of dynamic lights the device can handle
/** \return Maximal amount of dynamic lights. */ /** \return Maximal amount of dynamic lights. */
virtual u32 getMaximalDynamicLightAmount() const = 0; virtual u32 getMaximalDynamicLightAmount() const =0;
//! Returns amount of dynamic lights currently set //! Returns amount of dynamic lights currently set
/** \return Amount of dynamic lights currently set */ /** \return Amount of dynamic lights currently set */
virtual u32 getDynamicLightCount() const = 0; virtual u32 getDynamicLightCount() const =0;
//! Returns light data which was previously set by IVideoDriver::addDynamicLight(). //! Returns light data which was previously set by IVideoDriver::addDynamicLight().
/** \param idx Zero based index of the light. Must be 0 or /** \param idx Zero based index of the light. Must be 0 or
greater and smaller than IVideoDriver()::getDynamicLightCount. greater and smaller than IVideoDriver()::getDynamicLightCount.
\return Light data. */ \return Light data. */
virtual const SLight& getDynamicLight(u32 idx) const = 0; virtual const SLight& getDynamicLight(u32 idx) const =0;
//! Turns a dynamic light on or off //! Turns a dynamic light on or off
//! \param lightIndex: the index returned by addDynamicLight //! \param lightIndex: the index returned by addDynamicLight
//! \param turnOn: true to turn the light on, false to turn it off //! \param turnOn: true to turn the light on, false to turn it off
virtual void turnLightOn(s32 lightIndex, bool turnOn) = 0; virtual void turnLightOn(s32 lightIndex, bool turnOn) =0;
//! Gets name of this video driver. //! Gets name of this video driver.
/** \return Returns the name of the video driver, e.g. in case /** \return Returns the name of the video driver, e.g. in case
of the Direct3D8 driver, it would return "Direct3D 8.1". */ of the Direct3D8 driver, it would return "Direct3D 8.1". */
virtual const wchar_t* getName() const = 0; virtual const wchar_t* getName() const =0;
//! Adds an external image loader to the engine. //! Adds an external image loader to the engine.
/** This is useful if the Irrlicht Engine should be able to load /** This is useful if the Irrlicht Engine should be able to load
...@@ -807,7 +810,7 @@ namespace video ...@@ -807,7 +810,7 @@ namespace video
format. A pointer to the implementation can be passed to the format. A pointer to the implementation can be passed to the
engine using this method. engine using this method.
\param loader Pointer to the external loader created. */ \param loader Pointer to the external loader created. */
virtual void addExternalImageLoader(IImageLoader* loader) = 0; virtual void addExternalImageLoader(IImageLoader* loader) =0;
//! Adds an external image writer to the engine. //! Adds an external image writer to the engine.
/** This is useful if the Irrlicht Engine should be able to /** This is useful if the Irrlicht Engine should be able to
...@@ -816,13 +819,13 @@ namespace video ...@@ -816,13 +819,13 @@ namespace video
writing this file format. A pointer to the implementation can writing this file format. A pointer to the implementation can
be passed to the engine using this method. be passed to the engine using this method.
\param writer: Pointer to the external writer created. */ \param writer: Pointer to the external writer created. */
virtual void addExternalImageWriter(IImageWriter* writer) = 0; virtual void addExternalImageWriter(IImageWriter* writer) =0;
//! Returns the maximum amount of primitives //! Returns the maximum amount of primitives
/** (mostly vertices) which the device is able to render with /** (mostly vertices) which the device is able to render with
one drawIndexedTriangleList call. one drawIndexedTriangleList call.
\return Maximum amount of primitives. */ \return Maximum amount of primitives. */
virtual u32 getMaximalPrimitiveCount() const = 0; virtual u32 getMaximalPrimitiveCount() const =0;
//! Enables or disables a texture creation flag. //! Enables or disables a texture creation flag.
/** These flags define how textures should be created. By /** These flags define how textures should be created. By
...@@ -834,13 +837,13 @@ namespace video ...@@ -834,13 +837,13 @@ namespace video
\param flag Texture creation flag. \param flag Texture creation flag.
\param enabled Specifies if the given flag should be enabled or \param enabled Specifies if the given flag should be enabled or
disabled. */ disabled. */
virtual void setTextureCreationFlag(E_TEXTURE_CREATION_FLAG flag, bool enabled) = 0; virtual void setTextureCreationFlag(E_TEXTURE_CREATION_FLAG flag, bool enabled) =0;
//! Returns if a texture creation flag is enabled or disabled. //! Returns if a texture creation flag is enabled or disabled.
/** You can change this value using setTextureCreationMode(). /** You can change this value using setTextureCreationMode().
\param flag Texture creation flag. \param flag Texture creation flag.
\return The current texture creation mode. */ \return The current texture creation mode. */
virtual bool getTextureCreationFlag(E_TEXTURE_CREATION_FLAG flag) const = 0; virtual bool getTextureCreationFlag(E_TEXTURE_CREATION_FLAG flag) const =0;
//! Creates a software image from a file. //! Creates a software image from a file.
/** No hardware texture will be created for this image. This /** No hardware texture will be created for this image. This
...@@ -851,7 +854,7 @@ namespace video ...@@ -851,7 +854,7 @@ namespace video
\return The created image. \return The created image.
If you no longer need the image, you should call IImage::drop(). If you no longer need the image, you should call IImage::drop().
See IReferenceCounted::drop() for more information. */ See IReferenceCounted::drop() for more information. */
virtual IImage* createImageFromFile(const c8* filename) = 0; virtual IImage* createImageFromFile(const c8* filename) =0;
//! Creates a software image from a file. //! Creates a software image from a file.
/** No hardware texture will be created for this image. This /** No hardware texture will be created for this image. This
...@@ -861,7 +864,7 @@ namespace video ...@@ -861,7 +864,7 @@ namespace video
\return The created image. \return The created image.
If you no longer need the image, you should call IImage::drop(). If you no longer need the image, you should call IImage::drop().
See IReferenceCounted::drop() for more information. */ See IReferenceCounted::drop() for more information. */
virtual IImage* createImageFromFile(io::IReadFile* file) = 0; virtual IImage* createImageFromFile(io::IReadFile* file) =0;
//! Writes the provided image to a file. //! Writes the provided image to a file.
/** Requires that there is a suitable image writer registered /** Requires that there is a suitable image writer registered
...@@ -871,7 +874,7 @@ namespace video ...@@ -871,7 +874,7 @@ namespace video
\param param Control parameter for the backend (e.g. compression \param param Control parameter for the backend (e.g. compression
level). level).
\return True on successful write. */ \return True on successful write. */
virtual bool writeImageToFile(IImage* image, const c8* filename, u32 param = 0) = 0; virtual bool writeImageToFile(IImage* image, const c8* filename, u32 param =0) =0;
//! Writes the provided image to a file. //! Writes the provided image to a file.
/** Requires that there is a suitable image writer registered /** Requires that there is a suitable image writer registered
...@@ -882,7 +885,7 @@ namespace video ...@@ -882,7 +885,7 @@ namespace video
\param param Control parameter for the backend (e.g. compression \param param Control parameter for the backend (e.g. compression
level). level).
\return True on successful write. */ \return True on successful write. */
virtual bool writeImageToFile(IImage* image, io::IWriteFile* file, u32 param = 0) = 0; virtual bool writeImageToFile(IImage* image, io::IWriteFile* file, u32 param =0) =0;
//! Creates a software image from a byte array. //! Creates a software image from a byte array.
/** No hardware texture will be created for this image. This /** No hardware texture will be created for this image. This
...@@ -902,7 +905,7 @@ namespace video ...@@ -902,7 +905,7 @@ namespace video
virtual IImage* createImageFromData(ECOLOR_FORMAT format, virtual IImage* createImageFromData(ECOLOR_FORMAT format,
const core::dimension2d<u32>& size, void *data, const core::dimension2d<u32>& size, void *data,
bool ownForeignMemory=false, bool ownForeignMemory=false,
bool deleteMemory = true) = 0; bool deleteMemory = true) =0;
//! Creates an empty software image. //! Creates an empty software image.
/** /**
...@@ -937,7 +940,7 @@ namespace video ...@@ -937,7 +940,7 @@ namespace video
//! Event handler for resize events. Only used by the engine internally. //! Event handler for resize events. Only used by the engine internally.
/** Used to notify the driver that the window was resized. /** Used to notify the driver that the window was resized.
Usually, there is no need to call this method. */ Usually, there is no need to call this method. */
virtual void OnResize(const core::dimension2d<u32>& size) = 0; virtual void OnResize(const core::dimension2d<u32>& size) =0;
//! Adds a new material renderer to the video device. //! Adds a new material renderer to the video device.
/** Use this method to extend the VideoDriver with new material /** Use this method to extend the VideoDriver with new material
...@@ -960,18 +963,18 @@ namespace video ...@@ -960,18 +963,18 @@ namespace video
an error occured. For example if you tried to add an material an error occured. For example if you tried to add an material
renderer to the software renderer or the null device, which do renderer to the software renderer or the null device, which do
not accept material renderers. */ not accept material renderers. */
virtual s32 addMaterialRenderer(IMaterialRenderer* renderer, const c8* name = 0) = 0; virtual s32 addMaterialRenderer(IMaterialRenderer* renderer, const c8* name =0) =0;
//! Get access to a material renderer by index. //! Get access to a material renderer by index.
/** \param idx Id of the material renderer. Can be a value of /** \param idx Id of the material renderer. Can be a value of
the E_MATERIAL_TYPE enum or a value which was returned by the E_MATERIAL_TYPE enum or a value which was returned by
addMaterialRenderer(). addMaterialRenderer().
\return Pointer to material renderer or null if not existing. */ \return Pointer to material renderer or null if not existing. */
virtual IMaterialRenderer* getMaterialRenderer(u32 idx) = 0; virtual IMaterialRenderer* getMaterialRenderer(u32 idx) =0;
//! Get amount of currently available material renderers. //! Get amount of currently available material renderers.
/** \return Amount of currently available material renderers. */ /** \return Amount of currently available material renderers. */
virtual u32 getMaterialRendererCount() const = 0; virtual u32 getMaterialRendererCount() const =0;
//! Get name of a material renderer //! Get name of a material renderer
/** This string can, e.g., be used to test if a specific /** This string can, e.g., be used to test if a specific
...@@ -983,7 +986,7 @@ namespace video ...@@ -983,7 +986,7 @@ namespace video
addMaterialRenderer(). addMaterialRenderer().
\return String with the name of the renderer, or 0 if not \return String with the name of the renderer, or 0 if not
exisiting */ exisiting */
virtual const c8* getMaterialRendererName(u32 idx) const = 0; virtual const c8* getMaterialRendererName(u32 idx) const =0;
//! Sets the name of a material renderer. //! Sets the name of a material renderer.
/** Will have no effect on built-in material renderers. /** Will have no effect on built-in material renderers.
...@@ -991,7 +994,7 @@ namespace video ...@@ -991,7 +994,7 @@ namespace video
E_MATERIAL_TYPE enum or a value which was returned by E_MATERIAL_TYPE enum or a value which was returned by
addMaterialRenderer(). addMaterialRenderer().
\param name: New name of the material renderer. */ \param name: New name of the material renderer. */
virtual void setMaterialRendererName(s32 idx, const c8* name) = 0; virtual void setMaterialRendererName(s32 idx, const c8* name) =0;
//! Creates material attributes list from a material //! Creates material attributes list from a material
/** This method is useful for serialization and more. /** This method is useful for serialization and more.
...@@ -1001,7 +1004,7 @@ namespace video ...@@ -1001,7 +1004,7 @@ namespace video
\param material The material to serialize. \param material The material to serialize.
\return The io::IAttributes container holding the material \return The io::IAttributes container holding the material
properties. */ properties. */
virtual io::IAttributes* createAttributesFromMaterial(const video::SMaterial& material) = 0; virtual io::IAttributes* createAttributesFromMaterial(const video::SMaterial& material) =0;
//! Fills an SMaterial structure from attributes. //! Fills an SMaterial structure from attributes.
/** Please note that for setting material types of the /** Please note that for setting material types of the
...@@ -1010,26 +1013,26 @@ namespace video ...@@ -1010,26 +1013,26 @@ namespace video
have been created before calling this method. have been created before calling this method.
\param outMaterial The material to set the properties for. \param outMaterial The material to set the properties for.
\param attributes The attributes to read from. */ \param attributes The attributes to read from. */
virtual void fillMaterialStructureFromAttributes(video::SMaterial& outMaterial, io::IAttributes* attributes) = 0; virtual void fillMaterialStructureFromAttributes(video::SMaterial& outMaterial, io::IAttributes* attributes) =0;
//! Returns driver and operating system specific data about the IVideoDriver. //! Returns driver and operating system specific data about the IVideoDriver.
/** This method should only be used if the engine should be /** This method should only be used if the engine should be
extended without having to modify the source of the engine. extended without having to modify the source of the engine.
\return Collection of device dependent pointers. */ \return Collection of device dependent pointers. */
virtual const SExposedVideoData& getExposedVideoData() = 0; virtual const SExposedVideoData& getExposedVideoData() =0;
//! Get type of video driver //! Get type of video driver
/** \return Type of driver. */ /** \return Type of driver. */
virtual E_DRIVER_TYPE getDriverType() const = 0; virtual E_DRIVER_TYPE getDriverType() const =0;
//! Gets the IGPUProgrammingServices interface. //! Gets the IGPUProgrammingServices interface.
/** \return Pointer to the IGPUProgrammingServices. Returns 0 /** \return Pointer to the IGPUProgrammingServices. Returns 0
if the video driver does not support this. For example the if the video driver does not support this. For example the
Software driver and the Null driver will always return 0. */ Software driver and the Null driver will always return 0. */
virtual IGPUProgrammingServices* getGPUProgrammingServices() = 0; virtual IGPUProgrammingServices* getGPUProgrammingServices() =0;
//! Returns a pointer to the mesh manipulator. //! Returns a pointer to the mesh manipulator.
virtual scene::IMeshManipulator* getMeshManipulator() = 0; virtual scene::IMeshManipulator* getMeshManipulator() =0;
//! Clears the ZBuffer. //! Clears the ZBuffer.
/** Note that you usually need not to call this method, as it /** Note that you usually need not to call this method, as it
...@@ -1038,18 +1041,18 @@ namespace video ...@@ -1038,18 +1041,18 @@ namespace video
you have to render some special things, you can clear the you have to render some special things, you can clear the
zbuffer during the rendering process with this method any time. zbuffer during the rendering process with this method any time.
*/ */
virtual void clearZBuffer() = 0; virtual void clearZBuffer() =0;
//! Make a screenshot of the last rendered frame. //! Make a screenshot of the last rendered frame.
/** \return An image created from the last rendered frame. */ /** \return An image created from the last rendered frame. */
virtual IImage* createScreenShot() = 0; virtual IImage* createScreenShot() =0;
//! Check if the image is already loaded. //! Check if the image is already loaded.
/** Works similar to getTexture(), but does not load the texture /** Works similar to getTexture(), but does not load the texture
if it is not currently loaded. if it is not currently loaded.
\param filename Name of the texture. \param filename Name of the texture.
\return Pointer to loaded texture, or 0 if not found. */ \return Pointer to loaded texture, or 0 if not found. */
virtual video::ITexture* findTexture(const c8* filename) = 0; virtual video::ITexture* findTexture(const c8* filename) =0;
//! Set or unset a clipping plane. //! Set or unset a clipping plane.
/** There are at least 6 clipping planes available for the user /** There are at least 6 clipping planes available for the user
...@@ -1060,7 +1063,7 @@ namespace video ...@@ -1060,7 +1063,7 @@ namespace video
\param enable If true, enable the clipping plane else disable \param enable If true, enable the clipping plane else disable
it. it.
\return True if the clipping plane is usable. */ \return True if the clipping plane is usable. */
virtual bool setClipPlane(u32 index, const core::plane3df& plane, bool enable=false) = 0; virtual bool setClipPlane(u32 index, const core::plane3df& plane, bool enable=false) =0;
//! Enable or disable a clipping plane. //! Enable or disable a clipping plane.
/** There are at least 6 clipping planes available for the user /** There are at least 6 clipping planes available for the user
...@@ -1069,22 +1072,26 @@ namespace video ...@@ -1069,22 +1072,26 @@ namespace video
MaxUserClipPlanes. MaxUserClipPlanes.
\param enable If true, enable the clipping plane else disable \param enable If true, enable the clipping plane else disable
it. */ it. */
virtual void enableClipPlane(u32 index, bool enable) = 0; virtual void enableClipPlane(u32 index, bool enable) =0;
//! Set the minimum number of vertices for which a hw buffer will be created
/** \param count Number of vertices to set as minimum. */
virtual void setMinHardwareBufferVertexCount(u32 count) =0;
//! Returns the graphics card vendor name. //! Returns the graphics card vendor name.
virtual core::stringc getVendorInfo() = 0; virtual core::stringc getVendorInfo() =0;
//! Only used by the engine internally. //! Only used by the engine internally.
/** The ambient color is set in the scene manager, see /** The ambient color is set in the scene manager, see
scene::ISceneManager::setAmbientLight(). scene::ISceneManager::setAmbientLight().
\param color New color of the ambient light. */ \param color New color of the ambient light. */
virtual void setAmbientLight(const SColorf& color) = 0; virtual void setAmbientLight(const SColorf& color) =0;
//! Only used by the engine internally. //! Only used by the engine internally.
/** Passes the global material flag AllowZWriteOnTransparent. /** Passes the global material flag AllowZWriteOnTransparent.
Use the SceneManager attribute to set this value from your app. Use the SceneManager attribute to set this value from your app.
\param flag Default behavior is to disable ZWrite, i.e. false. */ \param flag Default behavior is to disable ZWrite, i.e. false. */
virtual void setAllowZWriteOnTransparent(bool flag) = 0; virtual void setAllowZWriteOnTransparent(bool flag) =0;
}; };
} // end namespace video } // end namespace video
...@@ -1093,5 +1100,3 @@ namespace video ...@@ -1093,5 +1100,3 @@ namespace video
#endif #endif
...@@ -70,7 +70,8 @@ IImageWriter* createImageWriterPPM(); ...@@ -70,7 +70,8 @@ IImageWriter* createImageWriterPPM();
//! constructor //! constructor
CNullDriver::CNullDriver(io::IFileSystem* io, const core::dimension2d<u32>& screenSize) CNullDriver::CNullDriver(io::IFileSystem* io, const core::dimension2d<u32>& screenSize)
: FileSystem(io), MeshManipulator(0), ViewPort(0,0,0,0), ScreenSize(screenSize), : FileSystem(io), MeshManipulator(0), ViewPort(0,0,0,0), ScreenSize(screenSize),
PrimitivesDrawn(0), TextureCreationFlags(0), AllowZWriteOnTransparent(false) PrimitivesDrawn(0), MinVertexCountForVBO(500), TextureCreationFlags(0),
AllowZWriteOnTransparent(false)
{ {
#ifdef _DEBUG #ifdef _DEBUG
setDebugName("CNullDriver"); setDebugName("CNullDriver");
...@@ -1406,7 +1407,7 @@ bool CNullDriver::isHardwareBufferRecommend(const scene::IMeshBuffer* mb) ...@@ -1406,7 +1407,7 @@ bool CNullDriver::isHardwareBufferRecommend(const scene::IMeshBuffer* mb)
if (!mb || (mb->getHardwareMappingHint_Index()==scene::EHM_NEVER && mb->getHardwareMappingHint_Vertex()==scene::EHM_NEVER)) if (!mb || (mb->getHardwareMappingHint_Index()==scene::EHM_NEVER && mb->getHardwareMappingHint_Vertex()==scene::EHM_NEVER))
return false; return false;
if (mb->getVertexCount()<500) //todo: tweak and make user definable if (mb->getVertexCount()<MinVertexCountForVBO)
return false; return false;
return true; return true;
...@@ -1941,9 +1942,6 @@ bool CNullDriver::setClipPlane(u32 index, const core::plane3df& plane, bool enab ...@@ -1941,9 +1942,6 @@ bool CNullDriver::setClipPlane(u32 index, const core::plane3df& plane, bool enab
//! Enable/disable a clipping plane. //! Enable/disable a clipping plane.
//! There are at least 6 clipping planes available for the user to set at will.
//! \param index: The plane index. Must be between 0 and MaxUserClipPlanes.
//! \param enable: If true, enable the clipping plane else disable it.
void CNullDriver::enableClipPlane(u32 index, bool enable) void CNullDriver::enableClipPlane(u32 index, bool enable)
{ {
// not necessary // not necessary
...@@ -1959,5 +1957,11 @@ ITexture* CNullDriver::createRenderTargetTexture(const core::dimension2d<u32>& s ...@@ -1959,5 +1957,11 @@ ITexture* CNullDriver::createRenderTargetTexture(const core::dimension2d<u32>& s
return tex; return tex;
} }
void CNullDriver::setMinHardwareBufferVertexCount(u32 count)
{
MinVertexCountForVBO = count;
}
} // end namespace } // end namespace
} // end namespace } // end namespace
...@@ -523,6 +523,10 @@ namespace video ...@@ -523,6 +523,10 @@ namespace video
//! Returns the graphics card vendor name. //! Returns the graphics card vendor name.
virtual core::stringc getVendorInfo() {return "Not available on this driver.";} virtual core::stringc getVendorInfo() {return "Not available on this driver.";}
//! Set the minimum number of vertices for which a hw buffer will be created
/** \param count Number of vertices to set as minimum. */
virtual void setMinHardwareBufferVertexCount(u32 count);
//! Only used by the engine internally. //! Only used by the engine internally.
virtual void setAllowZWriteOnTransparent(bool flag) virtual void setAllowZWriteOnTransparent(bool flag)
{ AllowZWriteOnTransparent=flag; } { AllowZWriteOnTransparent=flag; }
...@@ -633,6 +637,7 @@ namespace video ...@@ -633,6 +637,7 @@ namespace video
CFPSCounter FPSCounter; CFPSCounter FPSCounter;
u32 PrimitivesDrawn; u32 PrimitivesDrawn;
u32 MinVertexCountForVBO;
u32 TextureCreationFlags; u32 TextureCreationFlags;
...@@ -640,14 +645,13 @@ namespace video ...@@ -640,14 +645,13 @@ namespace video
f32 FogEnd; f32 FogEnd;
f32 FogDensity; f32 FogDensity;
SColor FogColor; SColor FogColor;
SExposedVideoData ExposedData;
bool LinearFog; bool LinearFog;
bool PixelFog; bool PixelFog;
bool RangeFog; bool RangeFog;
bool AllowZWriteOnTransparent; bool AllowZWriteOnTransparent;
SExposedVideoData ExposedData;
bool FeatureEnabled[video::EVDF_COUNT]; bool FeatureEnabled[video::EVDF_COUNT];
}; };
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment