Merge from branch 1.4, revisions 1344:1352, which are the doc updates from the 1.4.1 release.
git-svn-id: http://svn.code.sf.net/p/irrlicht/code/trunk@1353 dfc29bdd-3216-0410-991c-e03cc46cb475
This commit is contained in:
parent
f37939a4c0
commit
5e04a990eb
@ -53,7 +53,9 @@ Changes in version 1.5 (... 2008)
|
||||
- Finally added StarSonata patch with table element and TabControl additions. Table is based on MultiColor listbox by Acki, and has loads of changes by CuteAlien.
|
||||
|
||||
-------------------------------------------
|
||||
Changes in version 1.4.1 (??.4.2008)
|
||||
Changes in version 1.4.1 (??.5.2008)
|
||||
|
||||
- MD3 meshes are movable again.
|
||||
|
||||
- New JPG image writer version by Vitek.
|
||||
|
||||
|
@ -1,4 +1,4 @@
|
||||
// Copyright (C) 2002-2007 Nikolaus Gebhardt
|
||||
// Copyright (C) 2002-2008 Nikolaus Gebhardt
|
||||
// This file is part of the "Irrlicht Engine".
|
||||
// For conditions of distribution and use, see copyright notice in irrlicht.h
|
||||
|
||||
@ -17,7 +17,7 @@ namespace scene
|
||||
class CMeshBuffer : public IMeshBuffer
|
||||
{
|
||||
public:
|
||||
//! constructor
|
||||
//! Default constructor for empty meshbuffer
|
||||
CMeshBuffer():ChangedID(1),MappingHint(EHM_NEVER) // everything's default constructed
|
||||
{
|
||||
#ifdef _DEBUG
|
||||
@ -25,60 +25,81 @@ namespace scene
|
||||
#endif
|
||||
}
|
||||
|
||||
//! returns the material of this meshbuffer
|
||||
|
||||
//! Get material of this meshbuffer
|
||||
/** \return Material of this buffer */
|
||||
virtual const video::SMaterial& getMaterial() const
|
||||
{
|
||||
return Material;
|
||||
}
|
||||
|
||||
//! returns the material of this meshbuffer
|
||||
|
||||
//! Get material of this meshbuffer
|
||||
/** \return Material of this buffer */
|
||||
virtual video::SMaterial& getMaterial()
|
||||
{
|
||||
return Material;
|
||||
}
|
||||
|
||||
//! returns pointer to vertices
|
||||
|
||||
//! Get pointer to vertices
|
||||
/** \return Pointer to vertices. */
|
||||
virtual const void* getVertices() const
|
||||
{
|
||||
return Vertices.const_pointer();
|
||||
}
|
||||
|
||||
//! returns pointer to vertices
|
||||
|
||||
//! Get pointer to vertices
|
||||
/** \return Pointer to vertices. */
|
||||
virtual void* getVertices()
|
||||
{
|
||||
return Vertices.pointer();
|
||||
}
|
||||
|
||||
//! returns amount of vertices
|
||||
|
||||
//! Get number of vertices
|
||||
/** \return Number of vertices. */
|
||||
virtual u32 getVertexCount() const
|
||||
{
|
||||
return Vertices.size();
|
||||
}
|
||||
|
||||
//! returns pointer to Indices
|
||||
|
||||
//! Get pointer to indices
|
||||
/** \return Pointer to indices. */
|
||||
virtual const u16* getIndices() const
|
||||
{
|
||||
return Indices.const_pointer();
|
||||
}
|
||||
|
||||
//! returns pointer to Indices
|
||||
|
||||
//! Get pointer to indices
|
||||
/** \return Pointer to indices. */
|
||||
virtual u16* getIndices()
|
||||
{
|
||||
return Indices.pointer();
|
||||
}
|
||||
|
||||
//! returns amount of indices
|
||||
|
||||
//! Get number of indices
|
||||
/** \return Number of indices. */
|
||||
virtual u32 getIndexCount() const
|
||||
{
|
||||
return Indices.size();
|
||||
}
|
||||
|
||||
//! returns an axis aligned bounding box
|
||||
|
||||
//! Get the axis aligned bounding box
|
||||
/** \return Axis aligned bounding box of this buffer. */
|
||||
virtual const core::aabbox3d<f32>& getBoundingBox() const
|
||||
{
|
||||
return BoundingBox;
|
||||
}
|
||||
|
||||
|
||||
//! Set the axis aligned bounding box
|
||||
/** \param box New axis aligned bounding box for this buffer. */
|
||||
//! set user axis aligned bounding box
|
||||
virtual void setBoundingBox(const core::aabbox3df& box)
|
||||
{
|
||||
@ -86,7 +107,8 @@ namespace scene
|
||||
}
|
||||
|
||||
|
||||
//! recalculates the bounding box. should be called if the mesh changed.
|
||||
//! Recalculate the bounding box.
|
||||
/** should be called if the mesh changed. */
|
||||
virtual void recalculateBoundingBox()
|
||||
{
|
||||
if (Vertices.empty())
|
||||
@ -99,7 +121,9 @@ namespace scene
|
||||
}
|
||||
}
|
||||
|
||||
//! returns which type of vertex data is stored.
|
||||
|
||||
//! Get type of vertex data stored in this buffer.
|
||||
/** \return Type of vertex data. */
|
||||
virtual video::E_VERTEX_TYPE getVertexType() const
|
||||
{
|
||||
return T().getType();
|
||||
@ -130,7 +154,11 @@ namespace scene
|
||||
}
|
||||
|
||||
|
||||
//! append the vertices and indices to the current buffer
|
||||
//! Append the vertices and indices to the current buffer
|
||||
/** Only works for compatible types, i.e. either the same type
|
||||
or the main buffer is of standard type. Otherwise, behavior is
|
||||
undefined.
|
||||
*/
|
||||
virtual void append(const void* const vertices, u32 numVertices, const u16* const indices, u32 numIndices)
|
||||
{
|
||||
if (vertices == getVertices())
|
||||
@ -153,7 +181,13 @@ namespace scene
|
||||
}
|
||||
}
|
||||
|
||||
//! append the meshbuffer to the current buffer
|
||||
|
||||
//! Append the meshbuffer to the current buffer
|
||||
/** Only works for compatible types, i.e. either the same type
|
||||
or the main buffer is of standard type. Otherwise, behavior is
|
||||
undefined.
|
||||
\param other Meshbuffer to be appended to this one.
|
||||
*/
|
||||
virtual void append(const IMeshBuffer* const other)
|
||||
{
|
||||
if (this==other)
|
||||
@ -209,8 +243,11 @@ namespace scene
|
||||
core::aabbox3d<f32> BoundingBox;
|
||||
};
|
||||
|
||||
//! Standard meshbuffer
|
||||
typedef CMeshBuffer<video::S3DVertex> SMeshBuffer;
|
||||
//! Meshbuffer with two texture coords per vertex, e.g. for lightmaps
|
||||
typedef CMeshBuffer<video::S3DVertex2TCoords> SMeshBufferLightMap;
|
||||
//! Meshbuffer with vertices having tangents stored, e.g. for normal mapping
|
||||
typedef CMeshBuffer<video::S3DVertexTangents> SMeshBufferTangents;
|
||||
} // end namespace scene
|
||||
} // end namespace irr
|
||||
|
@ -1,4 +1,4 @@
|
||||
// Copyright (C) 2002-2007 Nikolaus Gebhardt
|
||||
// Copyright (C) 2002-2008 Nikolaus Gebhardt
|
||||
// This file is part of the "Irrlicht Engine".
|
||||
// For conditions of distribution and use, see copyright notice in irrlicht.h
|
||||
|
||||
|
@ -1,4 +1,4 @@
|
||||
// Copyright (C) 2002-2007 Nikolaus Gebhardt
|
||||
// Copyright (C) 2002-2008 Nikolaus Gebhardt
|
||||
// This file is part of the "Irrlicht Engine".
|
||||
// For conditions of distribution and use, see copyright notice in irrlicht.h
|
||||
|
||||
@ -14,13 +14,13 @@ namespace scene
|
||||
enum E_DEBUG_SCENE_TYPE
|
||||
{
|
||||
//! No Debug Data ( Default )
|
||||
EDS_OFF = 0,
|
||||
EDS_OFF = 0,
|
||||
|
||||
//! Show Bounding Boxes of SceneNode
|
||||
EDS_BBOX = 1,
|
||||
|
||||
//! Show Vertex Normals
|
||||
EDS_NORMALS = 2,
|
||||
EDS_NORMALS = 2,
|
||||
|
||||
//! Shows Skeleton/Tags
|
||||
EDS_SKELETON = 4,
|
||||
|
@ -1,4 +1,4 @@
|
||||
// Copyright (C) 2002-2007 Nikolaus Gebhardt
|
||||
// Copyright (C) 2002-2008 Nikolaus Gebhardt
|
||||
// This file is part of the "Irrlicht Engine".
|
||||
// For conditions of distribution and use, see copyright notice in irrlicht.h
|
||||
|
||||
|
@ -1,4 +1,4 @@
|
||||
// Copyright (C) 2002-2007 Nikolaus Gebhardt
|
||||
// Copyright (C) 2002-2008 Nikolaus Gebhardt
|
||||
// This file is part of the "Irrlicht Engine".
|
||||
// For conditions of distribution and use, see copyright notice in irrlicht.h
|
||||
|
||||
@ -13,38 +13,44 @@ namespace video
|
||||
//! An enum for all types of drivers the Irrlicht Engine supports.
|
||||
enum E_DRIVER_TYPE
|
||||
{
|
||||
//! Null device, useful for applications to run the engine without visualisation.
|
||||
//! The null device is able to load textures, but does not render and display
|
||||
//! any graphics.
|
||||
//! Null driver, useful for applications to run the engine
|
||||
//! without visualisation. The null device is able to load
|
||||
//! textures, but does not render and display any graphics.
|
||||
EDT_NULL,
|
||||
|
||||
//! The Irrlicht Engine Software renderer, runs on all platforms,
|
||||
//! with every hardware. It should only be used for 2d graphics,
|
||||
//! but it can also perform some primitive 3d functions. These 3d drawing
|
||||
//! functions are quite fast, but very inaccurate, and don't even support
|
||||
//! clipping in 3D mode.
|
||||
//! The Irrlicht Engine Software renderer, runs on all
|
||||
//! platforms, with every hardware. It should only be used for
|
||||
//! 2d graphics, but it can also perform some primitive 3d
|
||||
//! functions. These 3d drawing functions are quite fast, but
|
||||
//! very inaccurate, and don't even support clipping in 3D mode.
|
||||
EDT_SOFTWARE,
|
||||
|
||||
//! The Burning's Software Renderer, an alternative software renderer for Irrlicht.
|
||||
//! Basically it can be described as the Irrlicht Software renderer on steroids. It rasterizes
|
||||
//! 3D geometry perfectly: It is able to perform correct 3d clipping, perspective
|
||||
//! correct texture mapping, perspective correct color mapping, and renders
|
||||
//! sub pixel correct, sub texel correct primitives. In addition, it does
|
||||
//! bilinear texel filtering and supports more materials than the EDT_SOFTWARE driver.
|
||||
//! This renderer has been written entirely by Thomas Alten, thanks a lot for this huge
|
||||
//! The Burning's Software Renderer, an alternative software
|
||||
//! renderer for Irrlicht. Basically it can be described as the
|
||||
//! Irrlicht Software renderer on steroids. It rasterizes 3D
|
||||
//! geometry perfectly: It is able to perform correct 3d
|
||||
//! clipping, perspective correct texture mapping, perspective
|
||||
//! correct color mapping, and renders sub pixel correct, sub
|
||||
//! texel correct primitives. In addition, it does bilinear
|
||||
//! texel filtering and supports more materials than the
|
||||
//! EDT_SOFTWARE driver. This renderer has been written
|
||||
//! entirely by Thomas Alten, thanks a lot for this huge
|
||||
//! contribution.
|
||||
EDT_BURNINGSVIDEO,
|
||||
|
||||
//! Direct3D 8 device, only available on Win32 platforms.
|
||||
//! Performs hardware accelerated rendering of 3D and 2D primitives.
|
||||
//! Direct3D8 device, only available on Win32 platforms.
|
||||
//! Performs hardware accelerated rendering of 3D and 2D
|
||||
//! primitives.
|
||||
EDT_DIRECT3D8,
|
||||
|
||||
//! Direct3D 9 device, only available on Win32 platforms.
|
||||
//! Performs hardware accelerated rendering of 3D and 2D primitives.
|
||||
//! Performs hardware accelerated rendering of 3D and 2D
|
||||
//! primitives.
|
||||
EDT_DIRECT3D9,
|
||||
|
||||
//! OpenGL device, available on most platforms.
|
||||
//! Performs hardware accelerated rendering of 3D and 2D primitives.
|
||||
//! Performs hardware accelerated rendering of 3D and 2D
|
||||
//! primitives.
|
||||
EDT_OPENGL
|
||||
};
|
||||
|
||||
|
@ -1,4 +1,4 @@
|
||||
// Copyright (C) 2002-2007 Nikolaus Gebhardt
|
||||
// Copyright (C) 2002-2008 Nikolaus Gebhardt
|
||||
// This file is part of the "Irrlicht Engine".
|
||||
// For conditions of distribution and use, see copyright notice in irrlicht.h
|
||||
|
||||
|
@ -1,4 +1,4 @@
|
||||
// Copyright (C) 2002-2007 Nikolaus Gebhardt
|
||||
// Copyright (C) 2002-2008 Nikolaus Gebhardt
|
||||
// This file is part of the "Irrlicht Engine".
|
||||
// For conditions of distribution and use, see copyright notice in irrlicht.h
|
||||
|
||||
|
@ -1,4 +1,4 @@
|
||||
// Copyright (C) 2002-2007 Nikolaus Gebhardt
|
||||
// Copyright (C) 2002-2008 Nikolaus Gebhardt
|
||||
// This file is part of the "Irrlicht Engine".
|
||||
// For conditions of distribution and use, see copyright notice in irrlicht.h
|
||||
|
||||
@ -13,37 +13,37 @@ namespace video
|
||||
//! Abstracted and easy to use fixed function/programmable pipeline material modes.
|
||||
enum E_MATERIAL_TYPE
|
||||
{
|
||||
//! Standard solid material. Only first texture is used, which is
|
||||
//! supposed to be the diffuse material.
|
||||
//! Standard solid material. Only first texture is used, which
|
||||
//! is supposed to be the diffuse material.
|
||||
EMT_SOLID = 0,
|
||||
|
||||
//! Solid material with 2 texture layers. The second is blended onto the
|
||||
//! first using the alpha value of the vertex colors.
|
||||
//! This material is currently not implemented in OpenGL, but it
|
||||
//! works with DirectX.
|
||||
//! Solid material with 2 texture layers. The second is blended
|
||||
//! onto the first using the alpha value of the vertex colors.
|
||||
//! This material is currently not implemented in OpenGL.
|
||||
EMT_SOLID_2_LAYER,
|
||||
|
||||
//! Material type with standard lightmap technique:
|
||||
//! There should be 2 textures: The first texture layer is a diffuse map,
|
||||
//! the second is a light map. Vertex light is ignored.
|
||||
//! There should be 2 textures: The first texture layer is a
|
||||
//! diffuse map, the second is a light map. Dynamic light is
|
||||
//! ignored.
|
||||
EMT_LIGHTMAP,
|
||||
|
||||
//! Material type with lightmap technique like EMT_LIGHTMAP, but
|
||||
//! lightmap and diffuse texture are not modulated, but added instead.
|
||||
//! Material type with lightmap technique like EMT_LIGHTMAP. But
|
||||
//! lightmap and diffuse texture are added instead of modulated.
|
||||
EMT_LIGHTMAP_ADD,
|
||||
|
||||
//! Material type with standard lightmap technique:
|
||||
//! There should be 2 textures: The first texture layer is a diffuse map,
|
||||
//! the second is a light map. Vertex light is ignored.
|
||||
//! The texture colors are effectively multiplyied by 2 for brightening.
|
||||
//! like known in DirectX as D3DTOP_MODULATE2X.
|
||||
//! There should be 2 textures: The first texture layer is a
|
||||
//! diffuse map, the second is a light map. Dynamic light is
|
||||
//! ignored. The texture colors are effectively multiplied by 2
|
||||
//! for brightening. Like known in DirectX as D3DTOP_MODULATE2X.
|
||||
EMT_LIGHTMAP_M2,
|
||||
|
||||
//! Material type with standard lightmap technique:
|
||||
//! There should be 2 textures: The first texture layer is a diffuse map,
|
||||
//! the second is a light map. Vertex light is ignored.
|
||||
//! The texture colors are effectively multiplyied by 4 for brightening.
|
||||
//! like known in DirectX as D3DTOP_MODULATE4X.
|
||||
//! There should be 2 textures: The first texture layer is a
|
||||
//! diffuse map, the second is a light map. Dynamic light is
|
||||
//! ignored. The texture colors are effectively multiplyied by 4
|
||||
//! for brightening. Like known in DirectX as D3DTOP_MODULATE4X.
|
||||
EMT_LIGHTMAP_M4,
|
||||
|
||||
//! Like EMT_LIGHTMAP, but also supports dynamic lighting.
|
||||
@ -55,133 +55,153 @@ namespace video
|
||||
//! Like EMT_LIGHTMAP_4, but also supports dynamic lighting.
|
||||
EMT_LIGHTMAP_LIGHTING_M4,
|
||||
|
||||
//! Detail mapped material. The first texture is diffuse color map, the
|
||||
//! second is added to this and usually displayed with a bigger scale value
|
||||
//! so that it adds more detail. The detail map is added to the diffuse map using
|
||||
//! ADD_SIGNED, so that it is possible to add and substract color from the diffuse
|
||||
//! map. For example a value of (127,127,127) will not change the appearance of
|
||||
//! the diffuse map at all.
|
||||
//! Often used for terrain rendering.
|
||||
//! Detail mapped material. The first texture is diffuse color
|
||||
//! map, the second is added to this and usually displayed with
|
||||
//! a bigger scale value so that it adds more detail. The
|
||||
//! detail map is added to the diffuse map using ADD_SIGNED, so
|
||||
//! that it is possible to add and substract color from the
|
||||
//! diffuse map. For example a value of (127,127,127) will not
|
||||
//! change the appearance of the diffuse map at all. Often used
|
||||
//! for terrain rendering.
|
||||
EMT_DETAIL_MAP,
|
||||
|
||||
//! Makes the material look like it was reflection the environment
|
||||
//! around it. To make this possible, a texture called 'sphere map'
|
||||
//! is used, which must be set as Textures[0].
|
||||
//! Makes the material look like it was reflection the
|
||||
//! environment around it. To make this possible, a texture
|
||||
//! called 'sphere map' is used, which must be set as the first
|
||||
//! texture.
|
||||
EMT_SPHERE_MAP,
|
||||
|
||||
//! A reflecting material with an
|
||||
//! optional additional non reflecting texture layer. The reflection
|
||||
//! map should be set as Texture 1.
|
||||
//! A reflecting material with an optional additional non
|
||||
//! reflecting texture layer. The reflection map should be set
|
||||
//! as first texture.
|
||||
EMT_REFLECTION_2_LAYER,
|
||||
|
||||
//! A transparent material. Only the first texture is used.
|
||||
//! The new color is calculated by simply adding the source color and
|
||||
//! the dest color. This means if for example a billboard using a texture with
|
||||
//! black background and a red circle on it is drawn with this material, the
|
||||
//! result is that only the red circle will be drawn a little bit transparent,
|
||||
//! and everything which was black is 100% transparent and not visible.
|
||||
//! This material type is useful for e.g. particle effects.
|
||||
//! The new color is calculated by simply adding the source
|
||||
//! color and the dest color. This means if for example a
|
||||
//! billboard using a texture with black background and a red
|
||||
//! circle on it is drawn with this material, the result is
|
||||
//! that only the red circle will be drawn a little bit
|
||||
//! transparent, and everything which was black is 100%
|
||||
//! transparent and not visible. This material type is useful
|
||||
//! for particle effects.
|
||||
EMT_TRANSPARENT_ADD_COLOR,
|
||||
|
||||
//! Makes the material transparent based on the texture alpha channel.
|
||||
//! The final color is blended together from the destination color and the
|
||||
//! texture color, using the alpha channel value as blend factor.
|
||||
//! Only first texture is used. If you are using this material with small
|
||||
//! textures, it is a good idea to load the texture in 32 bit
|
||||
//! mode (video::IVideoDriver::setTextureCreationFlag()).
|
||||
//! Also, an alpha ref is used, which can be manipulated using SMaterial::MaterialTypeParam.
|
||||
//! If set to 0, the alpha ref gets its default value which is 0.5f and which means
|
||||
//! that pixels with an alpha value >127 will be written, others not. In other, simple
|
||||
//! words: this value controls how sharp the edges become when going from a
|
||||
//! transparent to a solid spot on the texture.
|
||||
//! Makes the material transparent based on the texture alpha
|
||||
//! channel. The final color is blended together from the
|
||||
//! destination color and the texture color, using the alpha
|
||||
//! channel value as blend factor. Only first texture is used.
|
||||
//! If you are using this material with small textures, it is a
|
||||
//! good idea to load the texture in 32 bit mode
|
||||
//! (video::IVideoDriver::setTextureCreationFlag()). Also, an
|
||||
//! alpha ref is used, which can be manipulated using
|
||||
//! SMaterial::MaterialTypeParam. If set to 0, the alpha ref
|
||||
//! gets its default value which is 0.5f and means that
|
||||
//! pixels with an alpha value >127 will be written, others not.
|
||||
//! In other, simple words: this value controls how sharp the
|
||||
//! edges become when going from a transparent to a solid spot
|
||||
//! on the texture.
|
||||
EMT_TRANSPARENT_ALPHA_CHANNEL,
|
||||
|
||||
//! Makes the material transparent based on the texture alpha channel.
|
||||
//! If the alpha channel value is greater than 127, a pixel is written to the
|
||||
//! target, otherwise not. This material does not use alpha blending
|
||||
//! and is a lot faster than EMT_TRANSPARENT_ALPHA_CHANNEL. It
|
||||
//! is ideal for drawing stuff like leafes of plants, because the borders
|
||||
//! are not blurry but sharp.
|
||||
//! Only first texture is used. If you are using this material with small
|
||||
//! textures and 3d object, it is a good idea to load the texture in 32 bit
|
||||
//! mode (video::IVideoDriver::setTextureCreationFlag()).
|
||||
//! Makes the material transparent based on the texture alpha
|
||||
//! channel. If the alpha channel value is greater than 127, a
|
||||
//! pixel is written to the target, otherwise not. This
|
||||
//! material does not use alpha blending and is a lot faster
|
||||
//! than EMT_TRANSPARENT_ALPHA_CHANNEL. It is ideal for drawing
|
||||
//! stuff like leafes of plants, because the borders are not
|
||||
//! blurry but sharp. Only first texture is used. If you are
|
||||
//! using this material with small textures and 3d object, it
|
||||
//! is a good idea to load the texture in 32 bit mode
|
||||
//! (video::IVideoDriver::setTextureCreationFlag()).
|
||||
EMT_TRANSPARENT_ALPHA_CHANNEL_REF,
|
||||
|
||||
//! Makes the material transparent based on the vertex alpha value.
|
||||
//! Makes the material transparent based on the vertex alpha
|
||||
//! value.
|
||||
EMT_TRANSPARENT_VERTEX_ALPHA,
|
||||
|
||||
//! A transparent reflecting material with an
|
||||
//! optional additional non reflecting texture layer. The reflection
|
||||
//! map should be set as Texture 1. The transparency depends on the
|
||||
//! alpha value in the vertex colors. A texture which will not reflect
|
||||
//! can be set als Texture 2.
|
||||
//! Please note that this material type is currently not 100% implemented
|
||||
//! in OpenGL. It works in Direct3D.
|
||||
//! A transparent reflecting material with an optional
|
||||
//! additional non reflecting texture layer. The reflection map
|
||||
//! should be set as first texture. The transparency depends on
|
||||
//! the alpha value in the vertex colors. A texture which will
|
||||
//! not reflect can be set as second texture. Please note that
|
||||
//! this material type is currently not 100% implemented in
|
||||
//! OpenGL.
|
||||
EMT_TRANSPARENT_REFLECTION_2_LAYER,
|
||||
|
||||
//! A solid normal map renderer. First texture is the color map, the
|
||||
//! second should be the normal map. Note that you should use this material
|
||||
//! only when drawing geometry consisting of vertices of type S3DVertexTangents
|
||||
//! (EVT_TANGENTS). You can convert any mesh into this format using
|
||||
//! IMeshManipulator::createMeshWithTangents() (See SpecialFX2 Tutorial).
|
||||
//! This shader runs on vertex shader 1.1 and pixel shader 1.1 capable hardware and
|
||||
//! falls back on a fixed function lighted material if this hardware is not available.
|
||||
//! Only two lights are supported by this shader, if there are more, the nearest two
|
||||
//! are chosen. Currently, this shader is only implemented for the D3D8 and D3D9 renderers.
|
||||
//! A solid normal map renderer. First texture is the color
|
||||
//! map, the second should be the normal map. Note that you
|
||||
//! should use this material only when drawing geometry
|
||||
//! consisting of vertices of type S3DVertexTangents
|
||||
//! (EVT_TANGENTS). You can convert any mesh into this format
|
||||
//! using IMeshManipulator::createMeshWithTangents() (See
|
||||
//! SpecialFX2 Tutorial). This shader runs on vertex shader
|
||||
//! 1.1 and pixel shader 1.1 capable hardware and falls back to
|
||||
//! a fixed function lighted material if this hardware is not
|
||||
//! available. Only two lights are supported by this shader,
|
||||
//! if there are more, the nearest two are chosen.
|
||||
EMT_NORMAL_MAP_SOLID,
|
||||
|
||||
//! A transparent normal map renderer. First texture is the color map, the
|
||||
//! second should be the normal map. Note that you should use this material
|
||||
//! only when drawing geometry consisting of vertices of type S3DVertexTangents
|
||||
//! (EVT_TANGENTS). You can convert any mesh into this format using
|
||||
//! IMeshManipulator::createMeshWithTangents() (See SpecialFX2 Tutorial).
|
||||
//! This shader runs on vertex shader 1.1 and pixel shader 1.1 capable hardware and
|
||||
//! falls back on a fixed function lighted material if this hardware is not available.
|
||||
//! Only two lights are supported by this shader, if there are more, the nearest two
|
||||
//! are chosen. Currently, this shader is only implemented for the D3D8 and D3D9 renderers.
|
||||
//! A transparent normal map renderer. First texture is the
|
||||
//! color map, the second should be the normal map. Note that
|
||||
//! you should use this material only when drawing geometry
|
||||
//! consisting of vertices of type S3DVertexTangents
|
||||
//! (EVT_TANGENTS). You can convert any mesh into this format
|
||||
//! using IMeshManipulator::createMeshWithTangents() (See
|
||||
//! SpecialFX2 Tutorial). This shader runs on vertex shader
|
||||
//! 1.1 and pixel shader 1.1 capable hardware and falls back to
|
||||
//! a fixed function lighted material if this hardware is not
|
||||
//! available. Only two lights are supported by this shader,
|
||||
//! if there are more, the nearest two are chosen.
|
||||
EMT_NORMAL_MAP_TRANSPARENT_ADD_COLOR,
|
||||
|
||||
//! A transparent (based on the vertex alpha value) normal map renderer.
|
||||
//! First texture is the color map, the
|
||||
//! second should be the normal map. Note that you should use this material
|
||||
//! only when drawing geometry consisting of vertices of type S3DVertexTangents
|
||||
//! (EVT_TANGENTS). You can convert any mesh into this format using
|
||||
//! IMeshManipulator::createMeshWithTangents() (See SpecialFX2 Tutorial).
|
||||
//! This shader runs on vertex shader 1.1 and pixel shader 1.1 capable hardware and
|
||||
//! falls back on a fixed function lighted material if this hardware is not available.
|
||||
//! Only two lights are supported by this shader, if there are more, the nearest two
|
||||
//! are chosen. Currently, this shader is only implemented for the D3D8 and D3D9 renderers.
|
||||
//! A transparent (based on the vertex alpha value) normal map
|
||||
//! renderer. First texture is the color map, the second
|
||||
//! should be the normal map. Note that you should use this
|
||||
//! material only when drawing geometry consisting of vertices
|
||||
//! of type S3DVertexTangents (EVT_TANGENTS). You can convert
|
||||
//! any mesh into this format using
|
||||
//! IMeshManipulator::createMeshWithTangents() (See SpecialFX2
|
||||
//! Tutorial). This shader runs on vertex shader 1.1 and pixel
|
||||
//! shader 1.1 capable hardware and falls back to a fixed
|
||||
//! function lighted material if this hardware is not available.
|
||||
//! Only two lights are supported by this shader, if there are
|
||||
//! more, the nearest two are chosen.
|
||||
EMT_NORMAL_MAP_TRANSPARENT_VERTEX_ALPHA,
|
||||
|
||||
//! Just like EMT_NORMAL_MAP_SOLID, but uses parallax mapping too, which
|
||||
//! looks a lot more realistic. This only works when the hardware supports at
|
||||
//! least vertex shader 1.1 and pixel shader 1.4.
|
||||
//! First texture is the color map, the second should be the normal map.
|
||||
//! The normal map texture should contain the height value in the
|
||||
//! alpha component. The IVideoDriver::makeNormalMapTexture() method writes
|
||||
//! this value automaticly when creating normal maps from a heightmap when using a 32 bit
|
||||
//! texture.
|
||||
//! The height scale of the material (affecting the bumpiness) is being controlled
|
||||
//! by the SMaterial::MaterialTypeParam member.
|
||||
//! If set to zero, the default value (0.02f) will be applied. Otherwise
|
||||
//! the value set in SMaterial::MaterialTypeParam is taken. This value depends on with which
|
||||
//! scale the texture is mapped on the material. Too high or low values of MaterialTypeParam
|
||||
//! Just like EMT_NORMAL_MAP_SOLID, but uses parallax mapping
|
||||
//! too, which looks a lot more realistic. This only works when
|
||||
//! the hardware supports at least vertex shader 1.1 and pixel
|
||||
//! shader 1.4. First texture is the color map, the second
|
||||
//! should be the normal map. The normal map texture should
|
||||
//! contain the height value in the alpha component. The
|
||||
//! IVideoDriver::makeNormalMapTexture() method writes this
|
||||
//! value automatically when creating normal maps from a
|
||||
//! heightmap when using a 32 bit texture. The height scale of
|
||||
//! the material (affecting the bumpiness) is being controlled
|
||||
//! by the SMaterial::MaterialTypeParam member. If set to
|
||||
//! zero, the default value (0.02f) will be applied. Otherwise
|
||||
//! the value set in SMaterial::MaterialTypeParam is taken. This
|
||||
//! value depends on with which scale the texture is mapped on
|
||||
//! the material. Too high or low values of MaterialTypeParam
|
||||
//! can result in strange artifacts.
|
||||
EMT_PARALLAX_MAP_SOLID,
|
||||
|
||||
//! A material just like EMT_PARALLAX_MAP_SOLID, but it is transparent, using
|
||||
//! EMT_TRANSPARENT_ADD_COLOR as base material.
|
||||
//! A material just like EMT_PARALLAX_MAP_SOLID, but it is
|
||||
//! transparent, using EMT_TRANSPARENT_ADD_COLOR as base
|
||||
//! material.
|
||||
EMT_PARALLAX_MAP_TRANSPARENT_ADD_COLOR,
|
||||
|
||||
//! A material just like EMT_PARALLAX_MAP_SOLID, but it is transparent, using
|
||||
//! EMT_TRANSPARENT_VERTEX_ALPHA as base material.
|
||||
//! A material just like EMT_PARALLAX_MAP_SOLID, but it is
|
||||
//! transparent, using EMT_TRANSPARENT_VERTEX_ALPHA as base
|
||||
//! material.
|
||||
EMT_PARALLAX_MAP_TRANSPARENT_VERTEX_ALPHA,
|
||||
|
||||
//! BlendFunc = source * sourceFactor + dest * destFactor ( E_BLEND_FUNC )
|
||||
//! Using only Textures[0]. generic Blender
|
||||
//! Using only first texture. Generic blending method.
|
||||
EMT_ONETEXTURE_BLEND,
|
||||
|
||||
//! This value is not used. It only forces this enumeration to compile in 32 bit.
|
||||
//! This value is not used. It only forces this enumeration to
|
||||
//! compile in 32 bit.
|
||||
EMT_FORCE_32BIT = 0x7fffffff
|
||||
};
|
||||
|
||||
|
@ -1,4 +1,4 @@
|
||||
// Copyright (C) 2002-2007 Nikolaus Gebhardt
|
||||
// Copyright (C) 2002-2008 Nikolaus Gebhardt
|
||||
// This file is part of the "Irrlicht Engine".
|
||||
// For conditions of distribution and use, see copyright notice in irrlicht.h
|
||||
|
||||
|
@ -1,4 +1,4 @@
|
||||
// Copyright (C) 2002-2007 Nikolaus Gebhardt
|
||||
// Copyright (C) 2002-2008 Nikolaus Gebhardt
|
||||
// This file is part of the "Irrlicht Engine".
|
||||
// For conditions of distribution and use, see copyright notice in irrlicht.h
|
||||
|
||||
@ -26,7 +26,7 @@ enum EMESSAGE_BOX_FLAG
|
||||
EMBF_NO = 0x8,
|
||||
|
||||
//! This value is not used. It only forces this enumeration to compile in 32 bit.
|
||||
EMBF_FORCE_32BIT = 0x7fffffff
|
||||
EMBF_FORCE_32BIT = 0x7fffffff
|
||||
};
|
||||
|
||||
} // namespace gui
|
||||
|
@ -1,4 +1,4 @@
|
||||
// Copyright (C) 2002-2007 Nikolaus Gebhardt
|
||||
// Copyright (C) 2002-2008 Nikolaus Gebhardt
|
||||
// This file is part of the "Irrlicht Engine".
|
||||
// For conditions of distribution and use, see copyright notice in irrlicht.h
|
||||
|
||||
|
@ -1,4 +1,4 @@
|
||||
// Copyright (C) 2002-2007 Nikolaus Gebhardt
|
||||
// Copyright (C) 2002-2008 Nikolaus Gebhardt
|
||||
// This file is part of the "Irrlicht Engine".
|
||||
// For conditions of distribution and use, see copyright notice in irrlicht.h
|
||||
|
||||
@ -67,7 +67,7 @@ namespace scene
|
||||
ESNT_PARTICLE_SYSTEM = MAKE_IRR_ID('p','t','c','l'),
|
||||
|
||||
//! Quake3 Model Scene Node ( has tag to link to )
|
||||
ESNT_MD3_SCENE_NODE = MAKE_IRR_ID('m','d','3','_'),
|
||||
ESNT_MD3_SCENE_NODE = MAKE_IRR_ID('m','d','3','_'),
|
||||
|
||||
//! Unknown scene node
|
||||
ESNT_UNKNOWN = MAKE_IRR_ID('u','n','k','n'),
|
||||
|
@ -1,4 +1,4 @@
|
||||
// Copyright (C) 2002-2007 Nikolaus Gebhardt
|
||||
// Copyright (C) 2002-2008 Nikolaus Gebhardt
|
||||
// This file is part of the "Irrlicht Engine".
|
||||
// For conditions of distribution and use, see copyright notice in irrlicht.h
|
||||
|
||||
|
@ -1,4 +1,4 @@
|
||||
// Copyright (C) 2002-2007 Nikolaus Gebhardt
|
||||
// Copyright (C) 2002-2008 Nikolaus Gebhardt
|
||||
// This file is part of the "Irrlicht Engine".
|
||||
// For conditions of distribution and use, see copyright notice in irrlicht.h
|
||||
|
||||
@ -12,7 +12,7 @@ namespace irr
|
||||
{
|
||||
namespace scene
|
||||
{
|
||||
|
||||
//! Possible types of (animated) meshes.
|
||||
enum E_ANIMATED_MESH_TYPE
|
||||
{
|
||||
//! Unknown animated mesh type.
|
||||
@ -36,16 +36,15 @@ namespace scene
|
||||
//! My3D Mesh, the file format by Zhuck Dimitry
|
||||
EAMT_MY3D,
|
||||
|
||||
//! Pulsar LMTools .lmts file. This Irrlicht loader was
|
||||
//! written by Jonas Petersen
|
||||
//! Pulsar LMTools .lmts file. This Irrlicht loader was written by Jonas Petersen
|
||||
EAMT_LMTS,
|
||||
|
||||
//! Cartography Shop .csm file. This loader was created by Saurav Mohapatra.
|
||||
EAMT_CSM,
|
||||
|
||||
//! .oct file for Paul Nette's FSRad or from Murphy McCauley's
|
||||
//! Blender .oct exporter. The oct file format contains 3D
|
||||
//! geometry and lightmaps and can be loaded directly by Irrlicht
|
||||
//! .oct file for Paul Nette's FSRad or from Murphy McCauley's Blender .oct exporter.
|
||||
/** The oct file format contains 3D geometry and lightmaps and
|
||||
can be loaded directly by Irrlicht */
|
||||
EAMT_OCT,
|
||||
|
||||
//! generic skinned mesh
|
||||
@ -61,7 +60,7 @@ namespace scene
|
||||
{
|
||||
public:
|
||||
|
||||
//! destructor
|
||||
//! Destructor
|
||||
virtual ~IAnimatedMesh() { }
|
||||
|
||||
//! Gets the frame count of the animated mesh.
|
||||
@ -81,7 +80,7 @@ namespace scene
|
||||
outside of this loop.
|
||||
If startFrameLoop and endFrameLoop are both -1, they are ignored.
|
||||
\param endFrameLoop: see startFrameLoop.
|
||||
\return Returns the animated mesh based on a detail level. */
|
||||
\return Returns the animated mesh based on a detail level. */
|
||||
virtual IMesh* getMesh(s32 frame, s32 detailLevel=255, s32 startFrameLoop=-1, s32 endFrameLoop=-1) = 0;
|
||||
|
||||
//! Returns the type of the animated mesh.
|
||||
|
@ -1,4 +1,4 @@
|
||||
// Copyright (C) 2002-2007 Nikolaus Gebhardt
|
||||
// Copyright (C) 2002-2008 Nikolaus Gebhardt
|
||||
// This file is part of the "Irrlicht Engine".
|
||||
// For conditions of distribution and use, see copyright notice in irrlicht.h
|
||||
|
||||
@ -46,29 +46,29 @@ namespace scene
|
||||
{
|
||||
public:
|
||||
|
||||
// Get frame loop data for a default MD2 animation type.
|
||||
//! \param l: The EMD2_ANIMATION_TYPE to get the frames for.
|
||||
//! \param outBegin: The returned beginning frame for animation type specified.
|
||||
//! \param outEnd: The returned ending frame for the animation type specified.
|
||||
//! \param outFPS: The number of frames per second, this animation should be played at.
|
||||
//! \return Returns the beginframe, endframe and frames per second for a default MD2 animation type.
|
||||
//! Get frame loop data for a default MD2 animation type.
|
||||
/** \param l The EMD2_ANIMATION_TYPE to get the frames for.
|
||||
\param outBegin The returned beginning frame for animation type specified.
|
||||
\param outEnd The returned ending frame for the animation type specified.
|
||||
\param outFPS The number of frames per second, this animation should be played at.
|
||||
\return beginframe, endframe and frames per second for a default MD2 animation type. */
|
||||
virtual void getFrameLoop(EMD2_ANIMATION_TYPE l, s32& outBegin,
|
||||
s32& outEnd, s32& outFPS) const = 0;
|
||||
|
||||
// Get frame loop data for a special MD2 animation type, identified by name.
|
||||
//! \param name: Name of the animation.
|
||||
//! \param outBegin: The returned beginning frame for animation type specified.
|
||||
//! \param outEnd: The returned ending frame for the animation type specified.
|
||||
//! \param outFPS: The number of frames per second, this animation should be played at.
|
||||
//! \return Returns the beginframe, endframe and frames per second for a special MD2 animation type.
|
||||
virtual bool getFrameLoop(const c8* name,
|
||||
//! Get frame loop data for a special MD2 animation type, identified by name.
|
||||
/** \param name Name of the animation.
|
||||
\param outBegin The returned beginning frame for animation type specified.
|
||||
\param outEnd The returned ending frame for the animation type specified.
|
||||
\param outFPS The number of frames per second, this animation should be played at.
|
||||
\return beginframe, endframe and frames per second for a special MD2 animation type. */
|
||||
virtual bool getFrameLoop(const c8* name,
|
||||
s32& outBegin, s32& outEnd, s32& outFPS) const = 0;
|
||||
|
||||
//! Returns amount of md2 animations in this file.
|
||||
//! Get amount of md2 animations in this file.
|
||||
virtual s32 getAnimationCount() const = 0;
|
||||
|
||||
//! Returns name of md2 animation.
|
||||
//! \param nr: Zero based index of animation.
|
||||
//! Get name of md2 animation.
|
||||
/** \param nr: Zero based index of animation. */
|
||||
virtual const c8* getAnimationName(s32 nr) const = 0;
|
||||
};
|
||||
|
||||
|
@ -1,4 +1,4 @@
|
||||
// Copyright (C) 2002-2007 Nikolaus Gebhardt / Thomas Alten
|
||||
// Copyright (C) 2007-2008 Nikolaus Gebhardt / Thomas Alten
|
||||
// This file is part of the "Irrlicht Engine".
|
||||
// For conditions of distribution and use, see copyright notice in irrlicht.h
|
||||
|
||||
@ -23,8 +23,7 @@ namespace scene
|
||||
EMD3_NUMMODELS
|
||||
};
|
||||
|
||||
|
||||
// Animation list
|
||||
//! Animation list
|
||||
enum EMD3_ANIMATION_TYPE
|
||||
{
|
||||
// Animations for both lower and upper parts of the player
|
||||
@ -64,15 +63,19 @@ namespace scene
|
||||
|
||||
struct SMD3AnimationInfo
|
||||
{
|
||||
s32 first; // First frame
|
||||
s32 num; // Last frame
|
||||
s32 looping; // Looping frames
|
||||
s32 fps; // Frames per second
|
||||
//! First frame
|
||||
s32 first;
|
||||
//! Last frame
|
||||
s32 num;
|
||||
//! Looping frames
|
||||
s32 looping;
|
||||
//! Frames per second
|
||||
s32 fps;
|
||||
};
|
||||
|
||||
|
||||
// byte-align structures
|
||||
#if defined(_MSC_VER) || defined(__BORLANDC__) || defined (__BCPLUSPLUS__)
|
||||
#if defined(_MSC_VER) || defined(__BORLANDC__) || defined (__BCPLUSPLUS__)
|
||||
# pragma pack( push, packing )
|
||||
# pragma pack( 1 )
|
||||
# define PACK_STRUCT
|
||||
@ -82,36 +85,37 @@ namespace scene
|
||||
# error compiler not supported
|
||||
#endif
|
||||
|
||||
// this holds the header info of the MD3 file
|
||||
//! this holds the header info of the MD3 file
|
||||
struct SMD3Header
|
||||
{
|
||||
c8 headerID[4]; //id of file, always "IDP3"
|
||||
s32 Version; //this is a version number, always 15
|
||||
s8 fileName[68]; //sometimes left Blank... 65 chars, 32bit aligned == 68 chars
|
||||
c8 headerID[4]; //id of file, always "IDP3"
|
||||
s32 Version; //this is a version number, always 15
|
||||
s8 fileName[68]; //sometimes left Blank... 65 chars, 32bit aligned == 68 chars
|
||||
s32 numFrames; //number of KeyFrames
|
||||
s32 numTags; //number of 'tags' per frame
|
||||
s32 numMeshes; //number of meshes/skins
|
||||
s32 numMaxSkins; //maximum number of unique skins used in md3 file
|
||||
s32 headerSize; //always equal to the length of this header
|
||||
s32 tagStart; //starting position of tag-structures
|
||||
s32 tagEnd; //ending position of tag-structures/starting position of mesh-structures
|
||||
s32 numMeshes; //number of meshes/skins
|
||||
s32 numMaxSkins; //maximum number of unique skins used in md3 file
|
||||
s32 headerSize; //always equal to the length of this header
|
||||
s32 tagStart; //starting position of tag-structures
|
||||
s32 tagEnd; //ending position of tag-structures/starting position of mesh-structures
|
||||
s32 fileSize;
|
||||
};
|
||||
|
||||
//! this holds the header info of an MD3 mesh section
|
||||
struct SMD3MeshHeader
|
||||
{
|
||||
c8 meshID[4]; //id, must be IDP3
|
||||
c8 meshID[4]; //id, must be IDP3
|
||||
c8 meshName[68]; //name of mesh 65 chars, 32 bit aligned == 68 chars
|
||||
|
||||
s32 numFrames; //number of meshframes in mesh
|
||||
s32 numShader; //number of skins in mesh
|
||||
s32 numVertices; //number of vertices
|
||||
s32 numTriangles; //number of Triangles
|
||||
s32 numFrames; //number of meshframes in mesh
|
||||
s32 numShader; //number of skins in mesh
|
||||
s32 numVertices; //number of vertices
|
||||
s32 numTriangles; //number of Triangles
|
||||
|
||||
s32 offset_triangles; //starting position of Triangle data, relative to start of Mesh_Header
|
||||
s32 offset_shaders; //size of header
|
||||
s32 offset_st; //starting position of texvector data, relative to start of Mesh_Header
|
||||
s32 vertexStart; //starting position of vertex data,relative to start of Mesh_Header
|
||||
s32 offset_triangles; //starting position of Triangle data, relative to start of Mesh_Header
|
||||
s32 offset_shaders; //size of header
|
||||
s32 offset_st; //starting position of texvector data, relative to start of Mesh_Header
|
||||
s32 vertexStart; //starting position of vertex data,relative to start of Mesh_Header
|
||||
s32 offset_end;
|
||||
};
|
||||
|
||||
@ -123,7 +127,7 @@ namespace scene
|
||||
u8 normal[2];
|
||||
};
|
||||
|
||||
//! Texure Coordinate
|
||||
//! Texture Coordinate
|
||||
struct SMD3TexCoord
|
||||
{
|
||||
f32 u;
|
||||
@ -138,7 +142,7 @@ namespace scene
|
||||
|
||||
|
||||
// Default alignment
|
||||
#if defined(_MSC_VER) || defined(__BORLANDC__) || defined (__BCPLUSPLUS__)
|
||||
#if defined(_MSC_VER) || defined(__BORLANDC__) || defined (__BCPLUSPLUS__)
|
||||
# pragma pack( pop, packing )
|
||||
#endif
|
||||
|
||||
@ -156,7 +160,7 @@ namespace scene
|
||||
};
|
||||
|
||||
//! hold a tag info for connecting meshes
|
||||
//! basically its an alternate way to describe a transformation
|
||||
/** Basically its an alternate way to describe a transformation. */
|
||||
struct SMD3QuaterionTag
|
||||
{
|
||||
SMD3QuaterionTag() {}
|
||||
@ -196,7 +200,7 @@ namespace scene
|
||||
core::quaternion rotation;
|
||||
};
|
||||
|
||||
// holds a assoziative list of named quaternions
|
||||
//! holds a associative list of named quaternions
|
||||
struct SMD3QuaterionTagList : public virtual IReferenceCounted
|
||||
{
|
||||
SMD3QuaterionTag* get ( const core::stringc& name )
|
||||
@ -243,11 +247,13 @@ namespace scene
|
||||
{
|
||||
public:
|
||||
|
||||
//! tune how many frames you want to render inbetween
|
||||
//! tune how many frames you want to render inbetween.
|
||||
virtual void setInterpolationShift ( u32 shift, u32 loopMode ) = 0;
|
||||
|
||||
//! get the tag list of the mesh.
|
||||
virtual SMD3QuaterionTagList *getTagList(s32 frame, s32 detailLevel, s32 startFrameLoop, s32 endFrameLoop) = 0;
|
||||
|
||||
//! get the original md3 mesh.
|
||||
virtual SMD3Mesh * getOriginalMesh () = 0;
|
||||
};
|
||||
|
||||
|
@ -1,4 +1,4 @@
|
||||
// Copyright (C) 2002-2007 Nikolaus Gebhardt
|
||||
// Copyright (C) 2002-2008 Nikolaus Gebhardt
|
||||
// This file is part of the "Irrlicht Engine".
|
||||
// For conditions of distribution and use, see copyright notice in irrlicht.h
|
||||
|
||||
@ -18,13 +18,13 @@ namespace scene
|
||||
|
||||
enum E_JOINT_UPDATE_ON_RENDER
|
||||
{
|
||||
// do nothing
|
||||
//! do nothing
|
||||
EJUOR_NONE = 0,
|
||||
|
||||
// get joints positions from the mesh (for attached nodes, etc)
|
||||
//! get joints positions from the mesh (for attached nodes, etc)
|
||||
EJUOR_READ,
|
||||
|
||||
// control joint positions in the mesh (eg. ragdolls, or set the animation from animateJoints() )
|
||||
//! control joint positions in the mesh (eg. ragdolls, or set the animation from animateJoints() )
|
||||
EJUOR_CONTROL,
|
||||
|
||||
//! count of all available interpolation modes
|
||||
@ -32,28 +32,27 @@ namespace scene
|
||||
};
|
||||
|
||||
|
||||
|
||||
class IAnimatedMeshSceneNode;
|
||||
|
||||
//! Callback interface for catching events of ended animations.
|
||||
/** Implement this interface and use
|
||||
IAnimatedMeshSceneNode::setAnimationEndCallback to be able to
|
||||
be notified if an animation playback has ended.
|
||||
IAnimatedMeshSceneNode::setAnimationEndCallback to be able to
|
||||
be notified if an animation playback has ended.
|
||||
**/
|
||||
class IAnimationEndCallBack : public virtual IReferenceCounted
|
||||
{
|
||||
public:
|
||||
|
||||
//! Will be called when the animation playback has ended.
|
||||
//! See IAnimatedMeshSceneNode::setAnimationEndCallback for
|
||||
//! more informations.
|
||||
//! \param node: Node of which the animation has ended.
|
||||
/** See IAnimatedMeshSceneNode::setAnimationEndCallback for
|
||||
more informations.
|
||||
\param node: Node of which the animation has ended. */
|
||||
virtual void OnAnimationEnd(IAnimatedMeshSceneNode* node) = 0;
|
||||
};
|
||||
|
||||
//! Scene node capable of displaying an animated mesh and its shadow.
|
||||
/** The shadow is optional: If a shadow should be displayed too, just invoke
|
||||
the IAnimatedMeshSceneNode::createShadowVolumeSceneNode().*/
|
||||
/** The shadow is optional: If a shadow should be displayed too, just
|
||||
invoke the IAnimatedMeshSceneNode::createShadowVolumeSceneNode().*/
|
||||
class IAnimatedMeshSceneNode : public ISceneNode
|
||||
{
|
||||
public:
|
||||
@ -69,92 +68,95 @@ namespace scene
|
||||
virtual ~IAnimatedMeshSceneNode() {}
|
||||
|
||||
//! Sets the current frame number.
|
||||
//! From now on the animation is played from this frame.
|
||||
//! \param frame: Number of the frame to let the animation be started from.
|
||||
//! The frame number must be a valid frame number of the IMesh used by this
|
||||
//! scene node. Set IAnimatedMesh::getMesh() for details.
|
||||
/** From now on the animation is played from this frame.
|
||||
\param frame: Number of the frame to let the animation be started from.
|
||||
The frame number must be a valid frame number of the IMesh used by this
|
||||
scene node. Set IAnimatedMesh::getMesh() for details. */
|
||||
virtual void setCurrentFrame(f32 frame) = 0;
|
||||
|
||||
//! Sets the frame numbers between the animation is looped.
|
||||
//! The default is 0 - MaximalFrameCount of the mesh.
|
||||
//! \param begin: Start frame number of the loop.
|
||||
//! \param end: End frame number of the loop.
|
||||
//! \return Returns true if successful, false if not.
|
||||
/** The default is 0 - MaximalFrameCount of the mesh.
|
||||
\param begin: Start frame number of the loop.
|
||||
\param end: End frame number of the loop.
|
||||
\return True if successful, false if not. */
|
||||
virtual bool setFrameLoop(s32 begin, s32 end) = 0;
|
||||
|
||||
//! Sets the speed with witch the animation is played.
|
||||
//! \param framesPerSecond: Frames per second played.
|
||||
/** \param framesPerSecond: Frames per second played. */
|
||||
virtual void setAnimationSpeed(f32 framesPerSecond) = 0;
|
||||
|
||||
//! Creates shadow volume scene node as child of this node
|
||||
//! and returns a pointer to it. The shadow can be rendered using the ZPass
|
||||
//! or the zfail method. ZPass is a little bit faster because the shadow volume
|
||||
//! creation is easier, but with this method there occur ugly looking artifacs
|
||||
//! when the camera is inside the shadow volume. These error do not occur
|
||||
//! with the ZFail method.
|
||||
//! \param id: Id of the shadow scene node. This id can be used to identify
|
||||
//! the node later.
|
||||
//! \param zfailmethod: If set to true, the shadow will use the zfail method,
|
||||
//! if not, zpass is used.
|
||||
//! \param infinity: Value used by the shadow volume algorithm to scale the
|
||||
//! shadow volume.
|
||||
//! \return Returns pointer to the created shadow scene node.
|
||||
//! This pointer should not be dropped. See IReferenceCounted::drop() for more information.
|
||||
//! Creates shadow volume scene node as child of this node.
|
||||
/** The shadow can be rendered using the ZPass or the zfail
|
||||
method. ZPass is a little bit faster because the shadow volume
|
||||
creation is easier, but with this method there occur ugly
|
||||
looking artifacs when the camera is inside the shadow volume.
|
||||
These error do not occur with the ZFail method.
|
||||
\param id: Id of the shadow scene node. This id can be used to
|
||||
identify the node later.
|
||||
\param zfailmethod: If set to true, the shadow will use the
|
||||
zfail method, if not, zpass is used.
|
||||
\param infinity: Value used by the shadow volume algorithm to
|
||||
scale the shadow volume.
|
||||
\return Pointer to the created shadow scene node. This pointer
|
||||
should not be dropped. See IReferenceCounted::drop() for more
|
||||
information. */
|
||||
virtual IShadowVolumeSceneNode* addShadowVolumeSceneNode(s32 id=-1,
|
||||
bool zfailmethod=true, f32 infinity=10000.0f) = 0;
|
||||
|
||||
|
||||
//! Returns a pointer to a joint in the mesh (if the mesh is a bone based mesh)
|
||||
//! With this method it is possible to attach scene nodes to joints
|
||||
//! for example possible to attach a weapon to the left hand of an
|
||||
//! animated model. This example shows how:
|
||||
//! \code
|
||||
//! ISceneNode* hand =
|
||||
//! yourAnimatedMeshSceneNode->getJointNode("LeftHand");
|
||||
//! hand->addChild(weaponSceneNode);
|
||||
//! \endcode
|
||||
//! Please note that the joint returned by this method may not exist
|
||||
//! before this call and the joints in the node were created by it.
|
||||
//! \param jointName: Name of the joint.
|
||||
//! \return Returns a pointer to the scene node which represents the joint
|
||||
//! with the specified name. Returns 0 if the contained mesh is not an
|
||||
//! skinned mesh or the name of the joint could not be found.
|
||||
//! Get a pointer to a joint in the mesh (if the mesh is a bone based mesh).
|
||||
/** With this method it is possible to attach scene nodes to
|
||||
joints for example possible to attach a weapon to the left hand
|
||||
of an animated model. This example shows how:
|
||||
\code
|
||||
ISceneNode* hand =
|
||||
yourAnimatedMeshSceneNode->getJointNode("LeftHand");
|
||||
hand->addChild(weaponSceneNode);
|
||||
\endcode
|
||||
Please note that the joint returned by this method may not exist
|
||||
before this call and the joints in the node were created by it.
|
||||
\param jointName: Name of the joint.
|
||||
\return Pointer to the scene node which represents the joint
|
||||
with the specified name. Returns 0 if the contained mesh is not
|
||||
an skinned mesh or the name of the joint could not be found. */
|
||||
virtual IBoneSceneNode* getJointNode(const c8* jointName)=0;
|
||||
|
||||
//! same as getJointNode(const c8* jointName), but based on id
|
||||
virtual IBoneSceneNode* getJointNode(u32 jointID) = 0;
|
||||
|
||||
//! Gets joint count.
|
||||
//! \return Returns amount of joints in the mesh.
|
||||
/** \return Amount of joints in the mesh. */
|
||||
virtual u32 getJointCount() const = 0;
|
||||
|
||||
//! Redundant command, please use getJointNode (only for backwards compatibility)
|
||||
//! Deprecated command, please use getJointNode
|
||||
virtual ISceneNode* getMS3DJointNode(const c8* jointName) = 0;
|
||||
|
||||
//! Redundant command, please use getJointNode (only for backwards compatibility)
|
||||
//! Deprecated command, please use getJointNode
|
||||
virtual ISceneNode* getXJointNode(const c8* jointName) = 0;
|
||||
|
||||
//! Starts a default MD2 animation.
|
||||
//! With this method it is easily possible to start a Run, Attack,
|
||||
//! Die or whatever animation, if the mesh contained in this scene
|
||||
//! node is an md2 mesh. Otherwise, nothing happens.
|
||||
//! \param anim: An MD2 animation type, which should be played, for
|
||||
//! example EMAT_STAND for the standing animation.
|
||||
//! \return Returns true if successful, and false if not, for example
|
||||
//! if the mesh in the scene node is not a md2 mesh.
|
||||
/** With this method it is easily possible to start a Run,
|
||||
Attack, Die or whatever animation, if the mesh contained in
|
||||
this scene node is an md2 mesh. Otherwise, nothing happens.
|
||||
\param anim: An MD2 animation type, which should be played, for
|
||||
example EMAT_STAND for the standing animation.
|
||||
\return True if successful, and false if not, for example if
|
||||
the mesh in the scene node is not a md2 mesh. */
|
||||
virtual bool setMD2Animation(EMD2_ANIMATION_TYPE anim) = 0;
|
||||
|
||||
//! Starts a special MD2 animation.
|
||||
//! With this method it is easily possible to start a Run, Attack,
|
||||
//! Die or whatever animation, if the mesh contained in this scene
|
||||
//! node is an md2 mesh. Otherwise, nothing happens. This method uses
|
||||
//! a character string to identify the animation. If the animation is a
|
||||
//! standard md2 animation, you might want to start this animation
|
||||
//! with the EMD2_ANIMATION_TYPE enumeration instead.
|
||||
//! \param animationName: Name of the animation which should be played.
|
||||
//! \return Returns true if successful, and false if not, for example
|
||||
//! if the mesh in the scene node is not an md2 mesh, or no animation
|
||||
//! with this name could be found.
|
||||
/** With this method it is easily possible to start a Run,
|
||||
Attack, Die or whatever animation, if the mesh contained in
|
||||
this scene node is an md2 mesh. Otherwise, nothing happens.
|
||||
This method uses a character string to identify the animation.
|
||||
If the animation is a standard md2 animation, you might want to
|
||||
start this animation with the EMD2_ANIMATION_TYPE enumeration
|
||||
instead.
|
||||
\param animationName: Name of the animation which should be
|
||||
played.
|
||||
\return Returns true if successful, and false if not, for
|
||||
example if the mesh in the scene node is not an md2 mesh, or no
|
||||
animation with this name could be found. */
|
||||
virtual bool setMD2Animation(const c8* animationName) = 0;
|
||||
|
||||
//! Returns the current displayed frame number.
|
||||
@ -164,19 +166,20 @@ namespace scene
|
||||
//! Returns the current end frame number.
|
||||
virtual s32 getEndFrame() const = 0;
|
||||
|
||||
//! Sets looping mode which is on by default. If set to false,
|
||||
//! animations will not be played looped.
|
||||
//! Sets looping mode which is on by default.
|
||||
/** If set to false, animations will not be played looped. */
|
||||
virtual void setLoopMode(bool playAnimationLooped) = 0;
|
||||
|
||||
//! Sets a callback interface which will be called if an animation
|
||||
//! playback has ended. Set this to 0 to disable the callback again.
|
||||
//! Please note that this will only be called when in non looped mode,
|
||||
//! see IAnimatedMeshSceneNode::setLoopMode().
|
||||
//! Sets a callback interface which will be called if an animation playback has ended.
|
||||
/** Set this to 0 to disable the callback again.
|
||||
Please note that this will only be called when in non looped
|
||||
mode, see IAnimatedMeshSceneNode::setLoopMode(). */
|
||||
virtual void setAnimationEndCallback(IAnimationEndCallBack* callback=0) = 0;
|
||||
|
||||
//! Sets if the scene node should not copy the materials of the mesh but use them in a read only style.
|
||||
/* In this way it is possible to change the materials a mesh causing all mesh scene nodes
|
||||
referencing this mesh to change too. */
|
||||
/* In this way it is possible to change the materials a mesh
|
||||
causing all mesh scene nodes referencing this mesh to change
|
||||
too. */
|
||||
virtual void setReadOnlyMaterials(bool readonly) = 0;
|
||||
|
||||
//! Returns if the scene node should not copy the materials of the mesh but use them in a read only style
|
||||
@ -188,24 +191,24 @@ namespace scene
|
||||
//! Returns the current mesh
|
||||
virtual IAnimatedMesh* getMesh(void) = 0;
|
||||
|
||||
//! returns the absolute transformation for a special MD3 Tag if the mesh is a md3 mesh,
|
||||
//! or the absolutetransformation if it's a normal scenenode
|
||||
//! Get the absolute transformation for a special MD3 Tag if the mesh is a md3 mesh, or the absolutetransformation if it's a normal scenenode
|
||||
virtual const SMD3QuaterionTag& getMD3TagTransformation( const core::stringc & tagname) = 0;
|
||||
|
||||
//! Set how the joints should be updated on render
|
||||
//! 0-do nothing
|
||||
//! 1-get joints positions from the mesh (for attached nodes, etc)
|
||||
//! 2-control joint positions in the mesh (eg. ragdolls, or set the animation from animateJoints() )
|
||||
virtual void setJointMode(E_JOINT_UPDATE_ON_RENDER mode)=0;
|
||||
|
||||
//! Sets the transition time in seconds (note: This needs to enable joints, and setJointmode maybe set to 2)
|
||||
//! you must call animateJoints(), or the mesh will not ani\mate
|
||||
//! Sets the transition time in seconds
|
||||
/** Note: This needs to enable joints, and setJointmode set to
|
||||
EJUOR_CONTROL. You must call animateJoints(), or the mesh will
|
||||
not animate. */
|
||||
virtual void setTransitionTime(f32 Time) =0;
|
||||
|
||||
//! animates the joints in the mesh based on the current frame (also takes in to account transitions)
|
||||
//! animates the joints in the mesh based on the current frame.
|
||||
/** Also takes in to account transitions. */
|
||||
virtual void animateJoints(bool CalculateAbsolutePositions=true) = 0;
|
||||
|
||||
//! render mesh ignoring it's transformation. Used with ragdolls. (culling is unaffected)
|
||||
//! render mesh ignoring it's transformation.
|
||||
/** Used with ragdolls. Culling is unaffected. */
|
||||
virtual void setRenderFromIdentity( bool On )=0;
|
||||
};
|
||||
|
||||
|
@ -1,4 +1,4 @@
|
||||
// Copyright (C) 2002-2007 Nikolaus Gebhardt
|
||||
// Copyright (C) 2002-2008 Nikolaus Gebhardt
|
||||
// This file is part of the "Irrlicht Engine".
|
||||
// For conditions of distribution and use, see copyright notice in irrlicht.h
|
||||
|
||||
@ -16,7 +16,7 @@ namespace io
|
||||
|
||||
class IAttributes;
|
||||
|
||||
//! Enumation flags passed through SAttributeReadWriteOptions to the IAttributeExchangingObject object
|
||||
//! Enumeration flags passed through SAttributeReadWriteOptions to the IAttributeExchangingObject object
|
||||
enum E_ATTRIBUTE_READ_WRITE_FLAGS
|
||||
{
|
||||
//! Serialization/Deserializion is done for an xml file
|
||||
@ -30,19 +30,19 @@ enum E_ATTRIBUTE_READ_WRITE_FLAGS
|
||||
};
|
||||
|
||||
|
||||
//! struct holding data describing options
|
||||
//! struct holding data describing options
|
||||
struct SAttributeReadWriteOptions
|
||||
{
|
||||
//! constructor
|
||||
//! Constructor
|
||||
SAttributeReadWriteOptions()
|
||||
: Flags(0), Filename(0)
|
||||
{
|
||||
}
|
||||
|
||||
//! Combination of E_ATTRIBUTE_READ_WRITE_FLAGS or other, custom ones
|
||||
s32 Flags;
|
||||
s32 Flags;
|
||||
|
||||
//! optional filename
|
||||
//! Optional filename
|
||||
const c8* Filename;
|
||||
};
|
||||
|
||||
@ -53,13 +53,13 @@ class IAttributeExchangingObject : virtual public IReferenceCounted
|
||||
public:
|
||||
|
||||
//! Writes attributes of the object.
|
||||
//! Implement this to expose the attributes of your scene node animator for
|
||||
//! scripting languages, editors, debuggers or xml serialization purposes.
|
||||
/** Implement this to expose the attributes of your scene node animator for
|
||||
scripting languages, editors, debuggers or xml serialization purposes. */
|
||||
virtual void serializeAttributes(io::IAttributes* out, io::SAttributeReadWriteOptions* options=0) const {}
|
||||
|
||||
//! Reads attributes of the object.
|
||||
//! Implement this to set the attributes of your scene node animator for
|
||||
//! scripting languages, editors, debuggers or xml deserialization purposes.
|
||||
/** Implement this to set the attributes of your scene node animator for
|
||||
scripting languages, editors, debuggers or xml deserialization purposes. */
|
||||
virtual void deserializeAttributes(io::IAttributes* in, io::SAttributeReadWriteOptions* options=0) {}
|
||||
|
||||
};
|
||||
|
@ -1,4 +1,4 @@
|
||||
// Copyright (C) 2002-2007 Nikolaus Gebhardt
|
||||
// Copyright (C) 2002-2008 Nikolaus Gebhardt
|
||||
// This file is part of the "Irrlicht Engine".
|
||||
// For conditions of distribution and use, see copyright notice in irrlicht.h
|
||||
|
||||
@ -124,7 +124,7 @@ public:
|
||||
//! Returns amount of attributes in this collection of attributes.
|
||||
virtual u32 getAttributeCount() const = 0;
|
||||
|
||||
//! Returns attribute name by index.
|
||||
//! Returns attribute name by index.
|
||||
//! \param index: Index value, must be between 0 and getAttributeCount()-1.
|
||||
virtual const c8* getAttributeName(s32 index) = 0;
|
||||
|
||||
@ -132,7 +132,7 @@ public:
|
||||
//! \param attributeName: Name for the attribute
|
||||
virtual E_ATTRIBUTE_TYPE getAttributeType(const c8* attributeName) = 0;
|
||||
|
||||
//! Returns attribute type by index.
|
||||
//! Returns attribute type by index.
|
||||
//! \param index: Index value, must be between 0 and getAttributeCount()-1.
|
||||
virtual E_ATTRIBUTE_TYPE getAttributeType(s32 index) = 0;
|
||||
|
||||
@ -140,7 +140,7 @@ public:
|
||||
//! \param attributeName: String for the attribute type
|
||||
virtual const wchar_t* getAttributeTypeString(const c8* attributeName) = 0;
|
||||
|
||||
//! Returns the type string of the attribute by index.
|
||||
//! Returns the type string of the attribute by index.
|
||||
//! \param index: Index value, must be between 0 and getAttributeCount()-1.
|
||||
virtual const wchar_t* getAttributeTypeString(s32 index) = 0;
|
||||
|
||||
@ -154,9 +154,10 @@ public:
|
||||
virtual void clear() = 0;
|
||||
|
||||
//! Reads attributes from a xml file.
|
||||
//! \param readCurrentElementOnly: If set to true, reading only works if current element has the name 'attributes' or
|
||||
//! \param reader The XML reader to read from
|
||||
//! \param readCurrentElementOnly If set to true, reading only works if current element has the name 'attributes' or
|
||||
//! the name specified using elementName.
|
||||
//! \param elementName: The surrounding element name. If it is null, the default one, "attributes" will be taken.
|
||||
//! \param elementName The surrounding element name. If it is null, the default one, "attributes" will be taken.
|
||||
//! If set to false, the first appearing list of attributes are read.
|
||||
virtual bool read(io::IXMLReader* reader, bool readCurrentElementOnly=false, const wchar_t* elementName=0) = 0;
|
||||
|
||||
@ -224,28 +225,29 @@ public:
|
||||
//! Adds an attribute as string
|
||||
virtual void addString(const c8* attributeName, const c8* value) = 0;
|
||||
|
||||
//! Sets an attribute value as string.
|
||||
//! Sets an attribute value as string.
|
||||
//! \param attributeName: Name for the attribute
|
||||
//! \param value: Value for the attribute. Set this to 0 to delete the attribute
|
||||
virtual void setAttribute(const c8* attributeName, const c8* value) = 0;
|
||||
|
||||
//! Gets an attribute as string.
|
||||
//! \param attributeName: Name of the attribute to get.
|
||||
//! \return Returns value of the attribute previously set by setAttribute()
|
||||
//! \return Returns value of the attribute previously set by setAttribute()
|
||||
//! or 0 if attribute is not set.
|
||||
virtual core::stringc getAttributeAsString(const c8* attributeName) = 0;
|
||||
|
||||
//! Gets an attribute as string.
|
||||
//! \param attributeName: Name of the attribute to get.
|
||||
//! \param target: Buffer where the string is copied to.
|
||||
//! \param attributeName Name of the attribute to get.
|
||||
//! \param target Buffer where the string is copied to.
|
||||
virtual void getAttributeAsString(const c8* attributeName, c8* target) = 0;
|
||||
|
||||
//! Returns attribute value as string by index.
|
||||
//! \param index: Index value, must be between 0 and getAttributeCount()-1.
|
||||
//! Returns attribute value as string by index.
|
||||
//! \param index Index value, must be between 0 and getAttributeCount()-1.
|
||||
virtual core::stringc getAttributeAsString(s32 index) = 0;
|
||||
|
||||
//! Sets an attribute value as string.
|
||||
//! \param attributeName: Name for the attribute
|
||||
//! Sets an attribute value as string.
|
||||
//! \param index Index value, must be between 0 and getAttributeCount()-1.
|
||||
//! \param value String to which the attribute is set.
|
||||
virtual void setAttribute(s32 index, const c8* value) = 0;
|
||||
|
||||
// wide strings
|
||||
@ -253,14 +255,14 @@ public:
|
||||
//! Adds an attribute as string
|
||||
virtual void addString(const c8* attributeName, const wchar_t* value) = 0;
|
||||
|
||||
//! Sets an attribute value as string.
|
||||
//! Sets an attribute value as string.
|
||||
//! \param attributeName: Name for the attribute
|
||||
//! \param value: Value for the attribute. Set this to 0 to delete the attribute
|
||||
virtual void setAttribute(const c8* attributeName, const wchar_t* value) = 0;
|
||||
|
||||
//! Gets an attribute as string.
|
||||
//! \param attributeName: Name of the attribute to get.
|
||||
//! \return Returns value of the attribute previously set by setAttribute()
|
||||
//! \return Returns value of the attribute previously set by setAttribute()
|
||||
//! or 0 if attribute is not set.
|
||||
virtual core::stringw getAttributeAsStringW(const c8* attributeName) = 0;
|
||||
|
||||
@ -269,12 +271,13 @@ public:
|
||||
//! \param target: Buffer where the string is copied to.
|
||||
virtual void getAttributeAsStringW(const c8* attributeName, wchar_t* target) = 0;
|
||||
|
||||
//! Returns attribute value as string by index.
|
||||
//! Returns attribute value as string by index.
|
||||
//! \param index: Index value, must be between 0 and getAttributeCount()-1.
|
||||
virtual core::stringw getAttributeAsStringW(s32 index) = 0;
|
||||
|
||||
//! Sets an attribute value as string.
|
||||
//! \param attributeName: Name for the attribute
|
||||
//! Sets an attribute value as string.
|
||||
//! \param index Index value, must be between 0 and getAttributeCount()-1.
|
||||
//! \param value String to which the attribute is set.
|
||||
virtual void setAttribute(s32 index, const wchar_t* value) = 0;
|
||||
|
||||
/*
|
||||
@ -290,11 +293,17 @@ public:
|
||||
virtual void setAttribute(const c8* attributeName, void* data, s32 dataSizeInBytes ) = 0;
|
||||
|
||||
//! Gets an attribute as binary data
|
||||
//! \param attributeName: Name of the attribute to get.
|
||||
/** \param attributeName: Name of the attribute to get.
|
||||
\param outData Pointer to buffer where data shall be stored.
|
||||
\param maxSizeInBytes Maximum number of bytes to write into outData.
|
||||
*/
|
||||
virtual void getAttributeAsBinaryData(const c8* attributeName, void* outData, s32 maxSizeInBytes) = 0;
|
||||
|
||||
//! Gets an attribute as binary data
|
||||
//! \param index: Index value, must be between 0 and getAttributeCount()-1.
|
||||
/** \param index: Index value, must be between 0 and getAttributeCount()-1.
|
||||
\param outData Pointer to buffer where data shall be stored.
|
||||
\param maxSizeInBytes Maximum number of bytes to write into outData.
|
||||
*/
|
||||
virtual void getAttributeAsBinaryData(s32 index, void* outData, s32 maxSizeInBytes) = 0;
|
||||
|
||||
//! Sets an attribute as binary data
|
||||
@ -302,26 +311,24 @@ public:
|
||||
|
||||
|
||||
/*
|
||||
|
||||
Array Attribute
|
||||
|
||||
*/
|
||||
|
||||
//! Adds an attribute as wide string array
|
||||
virtual void addArray(const c8* attributeName, core::array<core::stringw> value) = 0;
|
||||
|
||||
//! Sets an attribute value as a wide string array.
|
||||
//! Sets an attribute value as a wide string array.
|
||||
//! \param attributeName: Name for the attribute
|
||||
//! \param value: Value for the attribute. Set this to 0 to delete the attribute
|
||||
virtual void setAttribute(const c8* attributeName, const core::array<core::stringw> value) = 0;
|
||||
|
||||
//! Gets an attribute as an array of wide strings.
|
||||
//! \param attributeName: Name of the attribute to get.
|
||||
//! \return Returns value of the attribute previously set by setAttribute()
|
||||
//! \return Returns value of the attribute previously set by setAttribute()
|
||||
//! or 0 if attribute is not set.
|
||||
virtual core::array<core::stringw> getAttributeAsArray(const c8* attributeName) = 0;
|
||||
|
||||
//! Returns attribute value as an array of wide strings by index.
|
||||
//! Returns attribute value as an array of wide strings by index.
|
||||
//! \param index: Index value, must be between 0 and getAttributeCount()-1.
|
||||
virtual core::array<core::stringw> getAttributeAsArray(s32 index) = 0;
|
||||
|
||||
@ -343,7 +350,7 @@ public:
|
||||
|
||||
//! Gets an attribute as boolean value
|
||||
//! \param attributeName: Name of the attribute to get.
|
||||
//! \return Returns value of the attribute previously set by setAttribute()
|
||||
//! \return Returns value of the attribute previously set by setAttribute()
|
||||
virtual bool getAttributeAsBool(const c8* attributeName) = 0;
|
||||
|
||||
//! Gets an attribute as boolean value
|
||||
@ -374,27 +381,37 @@ public:
|
||||
virtual const c8* getAttributeAsEnumeration(const c8* attributeName) = 0;
|
||||
|
||||
//! Gets an attribute as enumeration
|
||||
//! \param attributeName: Name of the attribute to get.
|
||||
//! \param enumerationLiteralsToUse: Use these enumeration literals to get the index value instead of the set ones.
|
||||
//! This is useful when the attribute list maybe was read from an xml file, and only contains the enumeration string, but
|
||||
//! no information about its index.
|
||||
//! \return Returns value of the attribute previously set by setAttribute()
|
||||
/** \param attributeName: Name of the attribute to get.
|
||||
\param enumerationLiteralsToUse: Use these enumeration literals to get
|
||||
the index value instead of the set ones. This is useful when the
|
||||
attribute list maybe was read from an xml file, and only contains the
|
||||
enumeration string, but no information about its index.
|
||||
\return Returns value of the attribute previously set by setAttribute()
|
||||
*/
|
||||
virtual s32 getAttributeAsEnumeration(const c8* attributeName, const c8* const* enumerationLiteralsToUse) = 0;
|
||||
|
||||
//! Gets an attribute as enumeration
|
||||
//! \param index: Index value, must be between 0 and getAttributeCount()-1.
|
||||
/** \param index: Index value, must be between 0 and getAttributeCount()-1.
|
||||
\param enumerationLiteralsToUse: Use these enumeration literals to get
|
||||
the index value instead of the set ones. This is useful when the
|
||||
attribute list maybe was read from an xml file, and only contains the
|
||||
enumeration string, but no information about its index.
|
||||
\return Returns value of the attribute previously set by setAttribute()
|
||||
*/
|
||||
virtual s32 getAttributeAsEnumeration(s32 index, const c8* const* enumerationLiteralsToUse) = 0;
|
||||
|
||||
//! Gets an attribute as enumeration
|
||||
//! \param index: Index value, must be between 0 and getAttributeCount()-1.
|
||||
virtual const c8* getAttributeAsEnumeration(s32 index) = 0;
|
||||
|
||||
//! Gets the list of enumeration literals of an enumeration attribute
|
||||
//! \param attributeName: Name of the attribute to get.
|
||||
//! Gets the list of enumeration literals of an enumeration attribute
|
||||
//! \param attributeName Name of the attribute to get.
|
||||
//! \param outLiterals Set of strings to choose the enum name from.
|
||||
virtual void getAttributeEnumerationLiteralsOfEnumeration(const c8* attributeName, core::array<core::stringc>& outLiterals) = 0;
|
||||
|
||||
//! Gets the list of enumeration literals of an enumeration attribute
|
||||
//! Gets the list of enumeration literals of an enumeration attribute
|
||||
//! \param index: Index value, must be between 0 and getAttributeCount()-1.
|
||||
//! \param outLiterals Set of strings to choose the enum name from.
|
||||
virtual void getAttributeEnumerationLiteralsOfEnumeration(s32 index, core::array<core::stringc>& outLiterals) = 0;
|
||||
|
||||
//! Sets an attribute as enumeration
|
||||
@ -471,7 +488,7 @@ public:
|
||||
//! Gets an attribute as 3d vector
|
||||
//! \param index: Index value, must be between 0 and getAttributeCount()-1.
|
||||
virtual core::vector3df getAttributeAsVector3d(s32 index) = 0;
|
||||
|
||||
|
||||
//! Sets an attribute as vector
|
||||
virtual void setAttribute(s32 index, core::vector3df v) = 0;
|
||||
|
||||
@ -525,10 +542,8 @@ public:
|
||||
|
||||
|
||||
/*
|
||||
|
||||
matrix attribute
|
||||
|
||||
*/
|
||||
*/
|
||||
|
||||
//! Adds an attribute as matrix
|
||||
virtual void addMatrix(const c8* attributeName, const core::matrix4& v) = 0;
|
||||
|
@ -1,4 +1,4 @@
|
||||
// Copyright (C) 2002-2007 Nikolaus Gebhardt
|
||||
// Copyright (C) 2002-2008 Nikolaus Gebhardt
|
||||
// This file is part of the "Irrlicht Engine".
|
||||
// For conditions of distribution and use, see copyright notice in irrlicht.h
|
||||
|
||||
@ -21,8 +21,8 @@ class IBillboardSceneNode : virtual public ISceneNode
|
||||
{
|
||||
public:
|
||||
|
||||
//! constructor
|
||||
IBillboardSceneNode(ISceneNode* parent, ISceneManager* mgr, s32 id,
|
||||
//! Constructor
|
||||
IBillboardSceneNode(ISceneNode* parent, ISceneManager* mgr, s32 id,
|
||||
const core::vector3df& position = core::vector3df(0,0,0))
|
||||
: ISceneNode(parent, mgr, id, position) {}
|
||||
|
||||
@ -33,17 +33,17 @@ public:
|
||||
virtual const core::dimension2d<f32>& getSize() const = 0;
|
||||
|
||||
//! Set the color of all vertices of the billboard
|
||||
//! \param overallColor: the color to set
|
||||
/** \param overallColor: the color to set */
|
||||
virtual void setColor(const video::SColor & overallColor) = 0;
|
||||
|
||||
//! Set the color of the top and bottom vertices of the billboard
|
||||
//! \param topColor: the color to set the top vertices
|
||||
//! \param bottomColor: the color to set the bottom vertices
|
||||
/** \param topColor: the color to set the top vertices
|
||||
\param bottomColor: the color to set the bottom vertices */
|
||||
virtual void setColor(const video::SColor & topColor, const video::SColor & bottomColor) = 0;
|
||||
|
||||
//! Gets the color of the top and bottom vertices of the billboard
|
||||
//! \param topColor: stores the color of the top vertices
|
||||
//! \param bottomColor: stores the color of the bottom vertices
|
||||
/** \param topColor: stores the color of the top vertices
|
||||
\param bottomColor: stores the color of the bottom vertices */
|
||||
virtual void getColor(video::SColor & topColor, video::SColor & bottomColor) const = 0;
|
||||
|
||||
};
|
||||
|
@ -1,8 +1,10 @@
|
||||
// Copyright (C) 2002-2008 Nikolaus Gebhardt
|
||||
// This file is part of the "Irrlicht Engine".
|
||||
// For conditions of distribution and use, see copyright notice in irrlicht.h
|
||||
|
||||
#ifndef __I_BONE_SCENE_NODE_H_INCLUDED__
|
||||
#define __I_BONE_SCENE_NODE_H_INCLUDED__
|
||||
|
||||
// Used with ISkinnedMesh and IAnimatedMeshSceneNode, for boned meshes
|
||||
|
||||
#include "ISceneNode.h"
|
||||
|
||||
namespace irr
|
||||
@ -16,8 +18,7 @@ namespace scene
|
||||
//! The bone is usually animated, unless it's parent is not animated
|
||||
EBAM_AUTOMATIC=0,
|
||||
|
||||
//! The bone is animated by the skin, if it's parent is not animated
|
||||
//! then animation will resume from this bone onward
|
||||
//! The bone is animated by the skin, if it's parent is not animated then animation will resume from this bone onward
|
||||
EBAM_ANIMATED,
|
||||
|
||||
//! The bone is not animated by the skin
|
||||
@ -49,6 +50,8 @@ namespace scene
|
||||
};
|
||||
|
||||
|
||||
//! Interface for bones used for skeletal animation.
|
||||
/** Used with ISkinnedMesh and IAnimatedMeshSceneNode. */
|
||||
class IBoneSceneNode : public ISceneNode
|
||||
{
|
||||
public:
|
||||
@ -56,27 +59,30 @@ namespace scene
|
||||
IBoneSceneNode(ISceneNode* parent, ISceneManager* mgr, s32 id=-1) :
|
||||
ISceneNode(parent, mgr, id),positionHint(-1),scaleHint(-1),rotationHint(-1) { }
|
||||
|
||||
//! Returns the name of the bone
|
||||
//! Get the name of the bone
|
||||
virtual const c8* getBoneName() const = 0;
|
||||
|
||||
//! Returns the index of the bone
|
||||
//! Get the index of the bone
|
||||
virtual u32 getBoneIndex() const = 0;
|
||||
|
||||
//! Sets the animation mode of the bone. Returns true if successful. (Unused)
|
||||
//! Sets the animation mode of the bone.
|
||||
/** \return True if successful. (Unused) */
|
||||
virtual bool setAnimationMode(E_BONE_ANIMATION_MODE mode) = 0;
|
||||
|
||||
//! Gets the current animation mode of the bone
|
||||
virtual E_BONE_ANIMATION_MODE getAnimationMode() const = 0;
|
||||
|
||||
//! returns the axis aligned bounding box of this node
|
||||
//! Get the axis aligned bounding box of this node
|
||||
virtual const core::aabbox3d<f32>& getBoundingBox() const = 0;
|
||||
|
||||
//! Returns the relative transformation of the scene node.
|
||||
//virtual core::matrix4 getRelativeTransformation() const = 0;
|
||||
|
||||
//! The animation method.
|
||||
virtual void OnAnimate(u32 timeMs) =0;
|
||||
|
||||
//! Does nothing as bones are not visible
|
||||
//! The render method.
|
||||
/** Does nothing as bones are not visible. */
|
||||
virtual void render() { }
|
||||
|
||||
//! How the relative transformation of the bone is used
|
||||
@ -85,7 +91,7 @@ namespace scene
|
||||
//! How the relative transformation of the bone is used
|
||||
virtual E_BONE_SKINNING_SPACE getSkinningSpace() const =0;
|
||||
|
||||
//! updates the absolute position based on the relative and the parents position
|
||||
//! Updates the absolute position based on the relative and the parents position
|
||||
virtual void updateAbsolutePositionOfAllChildren()=0;
|
||||
|
||||
s32 positionHint;
|
||||
|
@ -1,4 +1,4 @@
|
||||
// Copyright (C) 2002-2007 Nikolaus Gebhardt
|
||||
// Copyright (C) 2002-2008 Nikolaus Gebhardt
|
||||
// This file is part of the "Irrlicht Engine".
|
||||
// For conditions of distribution and use, see copyright notice in irrlicht.h
|
||||
|
||||
@ -25,7 +25,7 @@ namespace scene
|
||||
public:
|
||||
|
||||
//! Constructor
|
||||
ICameraSceneNode(ISceneNode* parent, ISceneManager* mgr, s32 id,
|
||||
ICameraSceneNode(ISceneNode* parent, ISceneManager* mgr, s32 id,
|
||||
const core::vector3df& position = core::vector3df(0,0,0),
|
||||
const core::vector3df& rotation = core::vector3df(0,0,0),
|
||||
const core::vector3df& scale = core::vector3df(1.0f,1.0f,1.0f))
|
||||
@ -34,12 +34,12 @@ namespace scene
|
||||
//! Destructor
|
||||
virtual ~ICameraSceneNode() {}
|
||||
|
||||
//! Sets the projection matrix of the camera.
|
||||
//! Sets the projection matrix of the camera.
|
||||
/** The core::matrix4 class has some methods
|
||||
to build a projection matrix. e.g: core::matrix4::buildProjectionMatrixPerspectiveFovLH.
|
||||
Note that the matrix will only stay as set by this method until one of
|
||||
Note that the matrix will only stay as set by this method until one of
|
||||
the following Methods are called: setNearValue, setFarValue, setAspectRatio, setFOV.
|
||||
\param projection: The new projection matrix of the camera. */
|
||||
\param projection: The new projection matrix of the camera. */
|
||||
virtual void setProjectionMatrix(const core::matrix4& projection) = 0;
|
||||
|
||||
//! Gets the current projection matrix of the camera.
|
||||
@ -52,10 +52,10 @@ namespace scene
|
||||
|
||||
//! It is possible to send mouse and key events to the camera.
|
||||
/** Most cameras
|
||||
may ignore this input, but camera scene nodes which are created for
|
||||
may ignore this input, but camera scene nodes which are created for
|
||||
example with ISceneManager::addMayaCameraSceneNode or
|
||||
ISceneManager::addMeshViewerCameraSceneNode, may want to get this input
|
||||
for changing their position, look at target or whatever. */
|
||||
for changing their position, look at target or whatever. */
|
||||
virtual bool OnEvent(const SEvent& event) = 0;
|
||||
|
||||
//! Sets the look at target of the camera
|
||||
@ -106,27 +106,27 @@ namespace scene
|
||||
/** \param fovy: New field of view in radiants. */
|
||||
virtual void setFOV(f32 fovy) = 0;
|
||||
|
||||
//! Returns the view frustum.
|
||||
//! Returns the view frustum.
|
||||
/** Needed sometimes by bspTree or LOD render nodes.
|
||||
\return Returns the current view frustum. */
|
||||
virtual const SViewFrustum* getViewFrustum() const = 0;
|
||||
|
||||
//! Disables or enables the camera to get key or mouse inputs.
|
||||
/** If this is set to true, the camera will respond to key inputs
|
||||
otherwise not. */
|
||||
otherwise not. */
|
||||
virtual void setInputReceiverEnabled(bool enabled) = 0;
|
||||
|
||||
//! Returns if the input receiver of the camera is currently enabled.
|
||||
virtual bool isInputReceiverEnabled() const = 0;
|
||||
|
||||
//! Returns if a camera is orthogonal.
|
||||
virtual bool isOrthogonal() const
|
||||
virtual bool isOrthogonal() const
|
||||
{
|
||||
_IRR_IMPLEMENT_MANAGED_MARSHALLING_BUGFIX;
|
||||
return IsOrthogonal;
|
||||
}
|
||||
}
|
||||
|
||||
//! Sets if this camera should return that it is orthogonal.
|
||||
//! Sets if this camera should return that it is orthogonal.
|
||||
/** This setting does not change anything of the view or
|
||||
projection matrix. However, the kind of camera
|
||||
influences how collision detection and picking is done
|
||||
|
@ -1,4 +1,4 @@
|
||||
// Copyright (C) 2002-2007 Nikolaus Gebhardt
|
||||
// Copyright (C) 2002-2008 Nikolaus Gebhardt
|
||||
// This file is part of the "Irrlicht Engine".
|
||||
// For conditions of distribution and use, see copyright notice in irrlicht.h
|
||||
|
||||
@ -25,22 +25,24 @@ namespace gui
|
||||
virtual void setVisible(bool visible) = 0;
|
||||
|
||||
//! Returns if the cursor is currently visible.
|
||||
/** \return Returns true if the cursor is visible, false if not. */
|
||||
/** \return True if the cursor is visible, false if not. */
|
||||
virtual bool isVisible() const = 0;
|
||||
|
||||
/** Sets the new position of the cursor. The position must be
|
||||
between (0.0f, 0.0f) and (1.0f, 1.0f), where (0.0f, 0.0f) is
|
||||
//! Sets the new position of the cursor.
|
||||
/** The position must be
|
||||
between (0.0f, 0.0f) and (1.0f, 1.0f), where (0.0f, 0.0f) is
|
||||
the top left corner and (1.0f, 1.0f) is the bottom right corner of the
|
||||
render window. */
|
||||
//! \param pos: New position of the cursor.
|
||||
render window.
|
||||
\param pos New position of the cursor. */
|
||||
virtual void setPosition(const core::position2d<f32> &pos) = 0;
|
||||
|
||||
/** Sets the new position of the cursor. The position must be
|
||||
between (0.0f, 0.0f) and (1.0f, 1.0f), where (0.0f, 0.0f) is
|
||||
//! Sets the new position of the cursor.
|
||||
/** The position must be
|
||||
between (0.0f, 0.0f) and (1.0f, 1.0f), where (0.0f, 0.0f) is
|
||||
the top left corner and (1.0f, 1.0f) is the bottom right corner of the
|
||||
render window. */
|
||||
//! \param x: New x-coord of the cursor.
|
||||
//! \param y: New x-coord of the cursor.
|
||||
render window.
|
||||
\param x New x-coord of the cursor.
|
||||
\param y New x-coord of the cursor. */
|
||||
virtual void setPosition(f32 x, f32 y) = 0;
|
||||
|
||||
//! Sets the new position of the cursor.
|
||||
@ -48,8 +50,8 @@ namespace gui
|
||||
virtual void setPosition(const core::position2d<s32> &pos) = 0;
|
||||
|
||||
//! Sets the new position of the cursor.
|
||||
/** \param x: New x-coord of the cursor. The coordinates are pixel units. */
|
||||
/** \param y: New y-coord of the cursor. The coordinates are pixel units. */
|
||||
/** \param x New x-coord of the cursor. The coordinates are pixel units.
|
||||
\param y New y-coord of the cursor. The coordinates are pixel units. */
|
||||
virtual void setPosition(s32 x, s32 y) = 0;
|
||||
|
||||
//! Returns the current position of the mouse cursor.
|
||||
@ -59,16 +61,16 @@ namespace gui
|
||||
|
||||
//! Returns the current position of the mouse cursor.
|
||||
/** \return Returns the current position of the cursor. The returned position
|
||||
is a value between (0.0f, 0.0f) and (1.0f, 1.0f), where (0.0f, 0.0f) is
|
||||
the top left corner and (1.0f, 1.0f) is the bottom right corner of the
|
||||
render window. */
|
||||
is a value between (0.0f, 0.0f) and (1.0f, 1.0f), where (0.0f, 0.0f) is
|
||||
the top left corner and (1.0f, 1.0f) is the bottom right corner of the
|
||||
render window. */
|
||||
virtual core::position2d<f32> getRelativePosition() = 0;
|
||||
|
||||
//! Sets an absolute reference rect for setting and retrieving the cursor position.
|
||||
/** If this rect is set, the cursor position is not being calculated relative to
|
||||
the rendering window but to this rect. You can set the rect pointer to 0 to disable
|
||||
this feature again. This feature is useful when rendering into parts of foreign windows
|
||||
for example in an editor.
|
||||
for example in an editor.
|
||||
\param rect: A pointer to an reference rectangle or 0 to disable the reference rectangle.*/
|
||||
virtual void setReferenceRect(core::rect<s32>* rect=0) = 0;
|
||||
};
|
||||
|
@ -1,4 +1,4 @@
|
||||
// Copyright (C) 2002-2007 Nikolaus Gebhardt
|
||||
// Copyright (C) 2002-2008 Nikolaus Gebhardt
|
||||
// This file is part of the "Irrlicht Engine".
|
||||
// For conditions of distribution and use, see copyright notice in irrlicht.h
|
||||
|
||||
@ -14,7 +14,7 @@ namespace scene
|
||||
|
||||
//! Dummy scene node for adding additional transformations to the scene graph.
|
||||
/** 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
|
||||
anywhere into the scene graph.
|
||||
This scene node is for example used by the IAnimatedMeshSceneNode for emulating
|
||||
@ -24,13 +24,13 @@ class IDummyTransformationSceneNode : public ISceneNode
|
||||
{
|
||||
public:
|
||||
|
||||
//! constructor
|
||||
//! Constructor
|
||||
IDummyTransformationSceneNode(ISceneNode* parent, ISceneManager* mgr, s32 id)
|
||||
: ISceneNode(parent, mgr, id) {}
|
||||
|
||||
//! Returns a reference to the current relative transformation matrix.
|
||||
//! This is the matrix, this scene node uses instead of scale, translation
|
||||
//! and rotation.
|
||||
/** This is the matrix, this scene node uses instead of scale, translation
|
||||
and rotation. */
|
||||
virtual core::matrix4& getRelativeTransformationMatrix() = 0;
|
||||
};
|
||||
|
||||
|
@ -1,4 +1,4 @@
|
||||
// Copyright (C) 2002-2007 Nikolaus Gebhardt
|
||||
// Copyright (C) 2002-2008 Nikolaus Gebhardt
|
||||
// This file is part of the "Irrlicht Engine".
|
||||
// For conditions of distribution and use, see copyright notice in irrlicht.h
|
||||
|
||||
@ -16,14 +16,14 @@ namespace irr
|
||||
{
|
||||
//! An event of the graphical user interface.
|
||||
/** GUI events are created by the GUI environment or the GUI elements in response
|
||||
to mouse or keyboard events. When a GUI element receives an event it will either
|
||||
to mouse or keyboard events. When a GUI element receives an event it will either
|
||||
process it and return true, or pass the event to its parent. If an event is not absorbed
|
||||
before it reaches the root element then it will then be passed to the user receiver. */
|
||||
EET_GUI_EVENT = 0,
|
||||
|
||||
//! A mouse input event.
|
||||
/** Mouse events are created by the device and passed to IrrlichtDevice::postEventFromUser
|
||||
in response to mouse input received from the operating system.
|
||||
/** Mouse events are created by the device and passed to IrrlichtDevice::postEventFromUser
|
||||
in response to mouse input received from the operating system.
|
||||
Mouse events are first passed to the user receiver, then to the GUI environment (and possibly
|
||||
many GUI elements), then finally the input receiving scene manager (and possibly the active
|
||||
camera) */
|
||||
@ -39,8 +39,9 @@ namespace irr
|
||||
user receiver then no text will be sent to the console. */
|
||||
EET_LOG_TEXT_EVENT,
|
||||
|
||||
//! A user event with user data. This is not used by Irrlicht and can be used
|
||||
//! to send user specific data though the system.
|
||||
//! A user event with user data.
|
||||
/** This is not used by Irrlicht and can be used
|
||||
to send user specific data though the system. */
|
||||
EET_USER_EVENT
|
||||
};
|
||||
|
||||
@ -68,7 +69,7 @@ namespace irr
|
||||
//! The mouse cursor changed its position.
|
||||
EMIE_MOUSE_MOVED,
|
||||
|
||||
//! The mouse wheel was moved. Use Wheel value in event data to find out
|
||||
//! The mouse wheel was moved. Use Wheel value in event data to find out
|
||||
//! in what direction and how fast.
|
||||
EMIE_MOUSE_WHEEL,
|
||||
|
||||
@ -85,12 +86,12 @@ namespace irr
|
||||
enum EGUI_EVENT_TYPE
|
||||
{
|
||||
//! A gui element has lost its focus.
|
||||
//! GUIEvent.Caller is losing the focus to GUIEvent.Element.
|
||||
//! If the event is absorbed then the focus will not be changed.
|
||||
/** GUIEvent.Caller is losing the focus to GUIEvent.Element.
|
||||
If the event is absorbed then the focus will not be changed. */
|
||||
EGET_ELEMENT_FOCUS_LOST = 0,
|
||||
|
||||
//! A gui element has got the focus.
|
||||
//! If the event is absorbed then the focus will not be changed.
|
||||
/** If the event is absorbed then the focus will not be changed. */
|
||||
EGET_ELEMENT_FOCUSED,
|
||||
|
||||
//! The mouse cursor hovered over a gui element.
|
||||
@ -100,8 +101,8 @@ namespace irr
|
||||
EGET_ELEMENT_LEFT,
|
||||
|
||||
//! An element would like to close.
|
||||
//! Windows and context menus use this event when they would like to close,
|
||||
//! this can be cancelled by absorbing the event.
|
||||
/** Windows and context menus use this event when they would like to close,
|
||||
this can be cancelled by absorbing the event. */
|
||||
EGET_ELEMENT_CLOSED,
|
||||
|
||||
//! A button was clicked.
|
||||
@ -114,10 +115,10 @@ namespace irr
|
||||
EGET_CHECKBOX_CHANGED,
|
||||
|
||||
//! A new item in a listbox was seleted.
|
||||
EGET_LISTBOX_CHANGED,
|
||||
EGET_LISTBOX_CHANGED,
|
||||
|
||||
//! An item in the listbox was selected, which was already selected.
|
||||
EGET_LISTBOX_SELECTED_AGAIN,
|
||||
EGET_LISTBOX_SELECTED_AGAIN,
|
||||
|
||||
//! A file has been selected in the file dialog
|
||||
EGET_FILE_SELECTED,
|
||||
@ -151,7 +152,6 @@ namespace irr
|
||||
|
||||
//! The value of a spin box has changed
|
||||
EGET_SPINBOX_CHANGED,
|
||||
|
||||
//! A table has changed
|
||||
EGET_TABLE_CHANGED,
|
||||
EGET_TABLE_HEADER_CHANGED,
|
||||
@ -164,6 +164,7 @@ namespace irr
|
||||
//! SEvents hold information about an event. See irr::IEventReceiver for details on event handling.
|
||||
struct SEvent
|
||||
{
|
||||
//! Any kind of GUI event.
|
||||
struct SGUIEvent
|
||||
{
|
||||
//! IGUIElement who called the event
|
||||
@ -177,6 +178,7 @@ struct SEvent
|
||||
|
||||
};
|
||||
|
||||
//! Any kind of mouse event.
|
||||
struct SMouseInput
|
||||
{
|
||||
//! X position of mouse cursor
|
||||
@ -187,49 +189,52 @@ struct SEvent
|
||||
|
||||
//! mouse wheel delta, usually 1.0 or -1.0.
|
||||
/** Only valid if event was EMIE_MOUSE_WHEEL */
|
||||
f32 Wheel;
|
||||
f32 Wheel;
|
||||
|
||||
//! type of mouse event
|
||||
//! Type of mouse event
|
||||
EMOUSE_INPUT_EVENT Event;
|
||||
};
|
||||
|
||||
//! Any kind of keyboard event.
|
||||
struct SKeyInput
|
||||
{
|
||||
//! Character corresponding to the key (0, if not a character)
|
||||
wchar_t Char;
|
||||
wchar_t Char;
|
||||
|
||||
//! Key which has been pressed or released
|
||||
EKEY_CODE Key;
|
||||
EKEY_CODE Key;
|
||||
|
||||
//! if not pressed, then the key was left up
|
||||
bool PressedDown;
|
||||
//! If not true, then the key was left up
|
||||
bool PressedDown;
|
||||
|
||||
//! true if shift was also pressed
|
||||
bool Shift;
|
||||
//! True if shift was also pressed
|
||||
bool Shift;
|
||||
|
||||
//! true if ctrl was also pressed
|
||||
bool Control;
|
||||
//! True if ctrl was also pressed
|
||||
bool Control;
|
||||
};
|
||||
|
||||
//! Any kind of log event.
|
||||
struct SLogEvent
|
||||
{
|
||||
//! pointer to text which has been logged
|
||||
//! Pointer to text which has been logged
|
||||
const c8* Text;
|
||||
|
||||
//! log level in which the text has been logged
|
||||
//! Log level in which the text has been logged
|
||||
ELOG_LEVEL Level;
|
||||
};
|
||||
|
||||
//! Any kind of user event.
|
||||
struct SUserEvent
|
||||
{
|
||||
//! Some user specified data as int
|
||||
s32 UserData1;
|
||||
s32 UserData1;
|
||||
|
||||
//! Another user specified data as int
|
||||
s32 UserData2;
|
||||
s32 UserData2;
|
||||
|
||||
//! Some user specified data as float
|
||||
f32 UserData3;
|
||||
f32 UserData3;
|
||||
};
|
||||
|
||||
EEVENT_TYPE EventType;
|
||||
@ -245,19 +250,20 @@ struct SEvent
|
||||
};
|
||||
|
||||
//! Interface of an object which can receive events.
|
||||
/** Many of the engine's classes inherit IEventReceiver so they are able to process events.
|
||||
Events usually start at a postEventFromUser function and are passed down through a chain of
|
||||
event receivers until OnEvent returns true.
|
||||
See irr::EEVENT_TYPE for a description of where each type of event starts, and the path it takes
|
||||
through the system. */
|
||||
/** Many of the engine's classes inherit IEventReceiver so they are able to
|
||||
process events. Events usually start at a postEventFromUser function and are
|
||||
passed down through a chain of event receivers until OnEvent returns true. See
|
||||
irr::EEVENT_TYPE for a description of where each type of event starts, and the
|
||||
path it takes through the system. */
|
||||
class IEventReceiver
|
||||
{
|
||||
public:
|
||||
|
||||
//! Destructor
|
||||
virtual ~IEventReceiver() {}
|
||||
|
||||
//! called if an event happened.
|
||||
//! \return Returns true if the event was processed
|
||||
//! Called if an event happened.
|
||||
/** \return True if the event was processed. */
|
||||
virtual bool OnEvent(const SEvent& event) = 0;
|
||||
};
|
||||
|
||||
|
@ -1,4 +1,4 @@
|
||||
// Copyright (C) 2002-2007 Nikolaus Gebhardt
|
||||
// Copyright (C) 2002-2008 Nikolaus Gebhardt
|
||||
// This file is part of the "Irrlicht Engine".
|
||||
// For conditions of distribution and use, see copyright notice in irrlicht.h
|
||||
|
||||
@ -17,36 +17,31 @@ class IFileList : public virtual IReferenceCounted
|
||||
{
|
||||
public:
|
||||
|
||||
//! destructor
|
||||
//! Destructor
|
||||
virtual ~IFileList() {}
|
||||
|
||||
//! Returns the amount of files in the filelist.
|
||||
//! \return
|
||||
//! Returns the amount of files and directories in the file list.
|
||||
//! Get the number of files in the filelist.
|
||||
/** \return Amount of files and directories in the file list. */
|
||||
virtual u32 getFileCount() const = 0;
|
||||
|
||||
//! Gets the name of a file in the list, based on an index.
|
||||
//! The path is not included in this name. Use getFullFileName for this.
|
||||
//! \param index is the zero based index of the file which name should
|
||||
//! be returned. The index has to be smaller than the amount getFileCount() returns.
|
||||
//! \return
|
||||
//! Returns the file name of the file. Returns 0, if an error occured.
|
||||
/** The path is not included in this name. Use getFullFileName for this.
|
||||
\param index is the zero based index of the file which name should
|
||||
be returned. The index has to be smaller than the amount getFileCount() returns.
|
||||
\return File name of the file. Returns 0, if an error occured. */
|
||||
virtual const c8* getFileName(u32 index) const = 0;
|
||||
|
||||
//! Gets the full name of a file in the list, path included, based on an index.
|
||||
//! \param index is the zero based index of the file which name should
|
||||
//! be returned. The index has to be smaller than the amount getFileCount() returns.
|
||||
//! \return
|
||||
//! Returns the file name of the file. Returns 0, if an error occured.
|
||||
/** \param index is the zero based index of the file which name should
|
||||
be returned. The index has to be smaller than the amount getFileCount() returns.
|
||||
\return File name of the file. Returns 0, if an error occured. */
|
||||
virtual const c8* getFullFileName(u32 index) = 0;
|
||||
|
||||
//! Returns of the file is a directory
|
||||
//! \param
|
||||
//! index is the zero based index of the file which name should
|
||||
//! be returned. The index has to be smaller than the amount getFileCount() returns.
|
||||
//! \return
|
||||
//! Returns true, if the file is a directory, and false, if it is not.
|
||||
//! If an error occurs, the result is undefined.
|
||||
/** \param index is the zero based index of the file which name should
|
||||
be returned. The index has to be smaller than the amount getFileCount() returns.
|
||||
\return True, if the file is a directory, and false, if it is not.
|
||||
If an error occurs, the result is undefined. */
|
||||
virtual bool isDirectory(u32 index) const = 0;
|
||||
};
|
||||
|
||||
|
@ -1,4 +1,4 @@
|
||||
// Copyright (C) 2002-2007 Nikolaus Gebhardt
|
||||
// Copyright (C) 2002-2008 Nikolaus Gebhardt
|
||||
// This file is part of the "Irrlicht Engine".
|
||||
// For conditions of distribution and use, see copyright notice in irrlicht.h
|
||||
|
||||
@ -25,17 +25,14 @@ class IXMLWriter;
|
||||
class IAttributes;
|
||||
|
||||
//! The FileSystem manages files and archives and provides access to them.
|
||||
/**
|
||||
It manages where files are, so that modules which
|
||||
use the the IO do not need to know where every file is located. A file
|
||||
could be in a .zip-Archive or as file on disk, using the IFileSystem
|
||||
makes no difference to this.
|
||||
*/
|
||||
/** It manages where files are, so that modules which use the the IO do not
|
||||
need to know where every file is located. A file could be in a .zip-Archive or
|
||||
as file on disk, using the IFileSystem makes no difference to this. */
|
||||
class IFileSystem : public virtual IReferenceCounted
|
||||
{
|
||||
public:
|
||||
|
||||
//! destructor
|
||||
//! Destructor
|
||||
virtual ~IFileSystem() {}
|
||||
|
||||
//! Opens a file for read access.
|
||||
@ -50,17 +47,17 @@ public:
|
||||
\param memory: A pointer to the start of the file in memory
|
||||
\param len: The length of the memory in bytes
|
||||
\param fileName: The name given to this file
|
||||
\param deleteMemoryWhenDropped: True if the memory should be deleted
|
||||
\param deleteMemoryWhenDropped: True if the memory should be deleted
|
||||
along with the IReadFile when it is dropped.
|
||||
\return Returns a pointer to the created file interface.
|
||||
The returned pointer should be dropped when no longer needed.
|
||||
See IReferenceCounted::drop() for more information.
|
||||
See IReferenceCounted::drop() for more information.
|
||||
*/
|
||||
virtual IReadFile* createMemoryReadFile(void* memory, s32 len, const c8* fileName, bool deleteMemoryWhenDropped=false) = 0;
|
||||
|
||||
//! Opens a file for write access.
|
||||
/** \param filename: Name of file to open.
|
||||
\param append: If the file already exist, all write operations are
|
||||
\param append: If the file already exist, all write operations are
|
||||
appended to the file.
|
||||
\return Returns a pointer to the created file interface. 0 is returned, if the
|
||||
file could not created or opened for writing.
|
||||
@ -69,9 +66,9 @@ public:
|
||||
virtual IWriteFile* createAndWriteFile(const c8* filename, bool append=false) = 0;
|
||||
|
||||
//! Adds an zip archive to the file system.
|
||||
/** After calling this, the Irrlicht Engine will search and open files directly from this archive too.
|
||||
This is useful for hiding data from the end user, speeding up file access and making it possible to
|
||||
access for example Quake3 .pk3 files, which are nothing different than .zip files.
|
||||
/** After calling this, the Irrlicht Engine will search and open files directly from this archive too.
|
||||
This is useful for hiding data from the end user, speeding up file access and making it possible to
|
||||
access for example Quake3 .pk3 files, which are nothing different than .zip files.
|
||||
\param filename: Filename of the zip archive to add to the file system.
|
||||
\param ignoreCase: If set to true, files in the archive can be accessed without
|
||||
writing all letters in the right case.
|
||||
@ -89,11 +86,11 @@ public:
|
||||
without its complete path.
|
||||
\return Returns true if the archive was added successful, false if not. */
|
||||
virtual bool addFolderFileArchive(const c8* filename, bool ignoreCase = true, bool ignorePaths = true) = 0;
|
||||
|
||||
|
||||
//! Adds an pak archive to the file system.
|
||||
/** After calling this, the Irrlicht Engine will search and open files directly from this archive too.
|
||||
This is useful for hiding data from the end user, speeding up file access and making it possible to
|
||||
access for example Quake2/KingPin/Hexen2 .pak files
|
||||
/** After calling this, the Irrlicht Engine will search and open files directly from this archive too.
|
||||
This is useful for hiding data from the end user, speeding up file access and making it possible to
|
||||
access for example Quake2/KingPin/Hexen2 .pak files
|
||||
\param filename: Filename of the pak archive to add to the file system.
|
||||
\param ignoreCase: If set to true, files in the archive can be accessed without
|
||||
writing all letters in the right case.
|
||||
@ -102,21 +99,25 @@ public:
|
||||
\return Returns true if the archive was added successful, false if not. */
|
||||
virtual bool addPakFileArchive(const c8* filename, bool ignoreCase = true, bool ignorePaths = true) = 0;
|
||||
|
||||
//! Returns the string of the current working directory.
|
||||
//! Get the current working directory.
|
||||
/** \return Current working directory as a string. */
|
||||
virtual const c8* getWorkingDirectory() = 0;
|
||||
|
||||
//! Changes the current Working Directory.
|
||||
//! Changes the current working directory.
|
||||
/** \param newDirectory: A string specifying the new working directory.
|
||||
The string is operating system dependent. Under Windows it has
|
||||
the form "<drive>:\<directory>\<sudirectory>\<..>". An example would be: "C:\Windows\"
|
||||
\return Returns true if successful, otherwise false. */
|
||||
\return True if successful, otherwise false. */
|
||||
virtual bool changeWorkingDirectoryTo(const c8* newDirectory) = 0;
|
||||
|
||||
//! Converts a relative path to an absolute (unique) path, resolving symbolic links if required
|
||||
/** \param filename Possibly relative filename begin queried.
|
||||
\result Absolute filename which points to the same file. */
|
||||
virtual core::stringc getAbsolutePath(const core::stringc& filename) const = 0;
|
||||
|
||||
//! Returns the directory a file is located in.
|
||||
/** \param filename: The file to get the directory from */
|
||||
/** \param filename: The file to get the directory from.
|
||||
\return String containing the directory of the file. */
|
||||
virtual core::stringc getFileDir(const core::stringc& filename) const = 0;
|
||||
|
||||
//! Returns the base part of a filename, i.e. the name without the directory
|
||||
|
@ -1,4 +1,4 @@
|
||||
// Copyright (C) 2002-2007 Nikolaus Gebhardt
|
||||
// Copyright (C) 2002-2008 Nikolaus Gebhardt
|
||||
// This file is part of the "Irrlicht Engine".
|
||||
// For conditions of distribution and use, see copyright notice in irrlicht.h
|
||||
|
||||
@ -16,13 +16,13 @@ namespace io
|
||||
class IReadFile;
|
||||
} // end namespace io
|
||||
|
||||
namespace video
|
||||
namespace video
|
||||
{
|
||||
|
||||
class IVideoDriver;
|
||||
class IShaderConstantSetCallBack;
|
||||
|
||||
//! Compile target enumeration for the addHighLevelShaderMaterial() method.
|
||||
//! Compile target enumeration for the addHighLevelShaderMaterial() method.
|
||||
enum E_VERTEX_SHADER_TYPE
|
||||
{
|
||||
EVST_VS_1_1 = 0,
|
||||
@ -42,12 +42,12 @@ const c8* const VERTEX_SHADER_TYPE_NAMES[] = {
|
||||
"vs_3_0",
|
||||
0 };
|
||||
|
||||
//! Compile target enumeration for the addHighLevelShaderMaterial() method.
|
||||
//! Compile target enumeration for the addHighLevelShaderMaterial() method.
|
||||
enum E_PIXEL_SHADER_TYPE
|
||||
{
|
||||
EPST_PS_1_1 = 0,
|
||||
EPST_PS_1_2,
|
||||
EPST_PS_1_3,
|
||||
EPST_PS_1_3,
|
||||
EPST_PS_1_4,
|
||||
EPST_PS_2_0,
|
||||
EPST_PS_2_a,
|
||||
@ -60,7 +60,7 @@ enum E_PIXEL_SHADER_TYPE
|
||||
|
||||
//! Names for all pixel shader types, each entry corresponds to a E_PIXEL_SHADER_TYPE entry.
|
||||
const c8* const PIXEL_SHADER_TYPE_NAMES[] = {
|
||||
"ps_1_1",
|
||||
"ps_1_1",
|
||||
"ps_1_2",
|
||||
"ps_1_3",
|
||||
"ps_1_4",
|
||||
@ -70,195 +70,229 @@ const c8* const PIXEL_SHADER_TYPE_NAMES[] = {
|
||||
"ps_3_0",
|
||||
0 };
|
||||
|
||||
//! Interface making it possible to create and use programs running on the GPU.
|
||||
//! Interface making it possible to create and use programs running on the GPU.
|
||||
class IGPUProgrammingServices
|
||||
{
|
||||
public:
|
||||
|
||||
//! destructor
|
||||
//! Destructor
|
||||
virtual ~IGPUProgrammingServices() {}
|
||||
|
||||
//! Adds a new material renderer to the VideoDriver, based on a high level shading
|
||||
//! language. Currently only HLSL/D3D9 and GLSL/OpenGL is supported.
|
||||
//! \param vertexShaderProgram: String containing the source of the vertex shader program.
|
||||
//! This can be 0 if no vertex program shall be used.
|
||||
//! \param vertexShaderEntryPointName: Name of the entry function of the vertexShaderProgram
|
||||
//! \param vsCompileTarget: Vertex shader version where the high level shader shall be compiled to.
|
||||
//! \param pixelShaderProgram: String containing the source of the pixel shader program.
|
||||
//! This can be 0 if no pixel shader shall be used.
|
||||
//! \param pixelShaderEntryPointName: Entry name of the function of the pixelShaderEntryPointName
|
||||
//! \param psCompileTarget: Pixel shader version where the high level shader shall be compiled to.
|
||||
//! \param callback: Pointer to an implementation of IShaderConstantSetCallBack in which you
|
||||
//! can set the needed vertex and pixel shader program constants. Set this to 0 if you don't need this.
|
||||
//! \param baseMaterial: Base material which renderstates will be used to shade the
|
||||
//! material.
|
||||
//! \param userData: a user data int. This int can be set to any value and will be set as parameter
|
||||
//! in the callback method when calling OnSetConstants(). In this way it is easily possible to
|
||||
//! use the same callback method for multiple materials and distinguish between them during the call.
|
||||
//! \return Returns the number of the
|
||||
//! material type which can be set in SMaterial::MaterialType to use the renderer.
|
||||
//! -1 is returned if an error occured, e.g. if a vertex or pixel shader
|
||||
//! program could not be compiled or a compile target is not reachable.
|
||||
//! The error strings are then printed to the error log and
|
||||
//! can be catched with a custom event receiver.
|
||||
virtual s32 addHighLevelShaderMaterial(
|
||||
//! Adds a new high-level shading material renderer to the VideoDriver.
|
||||
/** Currently only HLSL/D3D9 and GLSL/OpenGL are supported.
|
||||
\param vertexShaderProgram: String containing the source of the vertex
|
||||
shader program. This can be 0 if no vertex program shall be used.
|
||||
\param vertexShaderEntryPointName: Name of the entry function of the
|
||||
vertexShaderProgram
|
||||
\param vsCompileTarget: Vertex shader version where the high level
|
||||
shader shall be compiled to.
|
||||
\param pixelShaderProgram: String containing the source of the pixel
|
||||
shader program. This can be 0 if no pixel shader shall be used.
|
||||
\param pixelShaderEntryPointName: Entry name of the function of the
|
||||
pixelShaderEntryPointName
|
||||
\param psCompileTarget: Pixel shader version where the high level
|
||||
shader shall be compiled to.
|
||||
\param callback: Pointer to an implementation of
|
||||
IShaderConstantSetCallBack in which you can set the needed vertex and
|
||||
pixel shader program constants. Set this to 0 if you don't need this.
|
||||
\param baseMaterial: Base material which renderstates will be used to
|
||||
shade the material.
|
||||
\param userData: a user data int. This int can be set to any value and
|
||||
will be set as parameter in the callback method when calling
|
||||
OnSetConstants(). In this way it is easily possible to use the same
|
||||
callback method for multiple materials and distinguish between them
|
||||
during the call.
|
||||
\return Returns the number of the material type which can be set in
|
||||
SMaterial::MaterialType to use the renderer. -1 is returned if an
|
||||
error occured, e.g. if a vertex or pixel shader program could not be
|
||||
compiled or a compile target is not reachable. The error strings are
|
||||
then printed to the error log and can be catched with a custom event
|
||||
receiver. */
|
||||
virtual s32 addHighLevelShaderMaterial(
|
||||
const c8* vertexShaderProgram,
|
||||
const c8* vertexShaderEntryPointName = "main",
|
||||
E_VERTEX_SHADER_TYPE vsCompileTarget = EVST_VS_1_1,
|
||||
const c8* pixelShaderProgram = 0,
|
||||
const c8* pixelShaderProgram = 0,
|
||||
const c8* pixelShaderEntryPointName = "main",
|
||||
E_PIXEL_SHADER_TYPE psCompileTarget = EPST_PS_1_1,
|
||||
IShaderConstantSetCallBack* callback = 0,
|
||||
E_MATERIAL_TYPE baseMaterial = video::EMT_SOLID,
|
||||
s32 userData = 0 ) = 0;
|
||||
s32 userData = 0 ) = 0;
|
||||
|
||||
//! Like IGPUProgrammingServices::addShaderMaterial(),
|
||||
//! but tries to load the programs from files.
|
||||
//! \param vertexShaderProgram: Text file containing the source of the vertex shader program.
|
||||
//! Set to 0 if no shader shall be created.
|
||||
//! \param vertexShaderEntryPointName: Name of the entry function of the vertexShaderProgram
|
||||
//! \param vsCompileTarget: Vertex shader version where the high level shader shall be compiled to.
|
||||
//! \param pixelShaderProgram: Text file containing the source of the pixel shader program. Set to
|
||||
//! 0 if no shader shall be created.
|
||||
//! \param vertexShaderEntryPointName: Name of the entry function of the vertexShaderProgram
|
||||
//! \param vsCompileTarget: Vertex shader version where the high level shader shall be compiled to.
|
||||
//! \param pixelShaderProgram: String containing the source of the pixel shader program.
|
||||
//! This can be 0 if no pixel shader shall be used.
|
||||
//! \param pixelShaderEntryPointName: Entry name of the function of the pixelShaderEntryPointName
|
||||
//! \param psCompileTarget: Pixel shader version where the high level shader shall be compiled to.
|
||||
//! \param callback: Pointer to an implementation of IShaderConstantSetCallBack in which you
|
||||
//! can set the needed vertex and pixel shader program constants. Set this to 0 if you don't need this.
|
||||
//! \param baseMaterial: Base material which renderstates will be used to shade the
|
||||
//! material.
|
||||
//! \param userData: a user data int. This int can be set to any value and will be set as parameter
|
||||
//! in the callback method when calling OnSetConstants(). In this way it is easily possible to
|
||||
//! use the same callback method for multiple materials and distinguish between them during the call.
|
||||
//! \return Returns the number of the
|
||||
//! material type which can be set in SMaterial::MaterialType to use the renderer.
|
||||
//! -1 is returned if an error occured, e.g. if a vertex or pixel shader
|
||||
//! program could not be compiled or a compile target is not reachable.
|
||||
//! The error strings are then printed to the error log and
|
||||
//! can be catched with a custom event receiver.
|
||||
//! Like IGPUProgrammingServices::addShaderMaterial(), but loads from files.
|
||||
/** \param vertexShaderProgram: Text file containing the source of the
|
||||
* vertex shader program.
|
||||
Set to 0 if no shader shall be created.
|
||||
\param vertexShaderEntryPointName: Name of the entry function of the
|
||||
vertexShaderProgram
|
||||
\param vsCompileTarget: Vertex shader version where the high level
|
||||
shader shall be compiled to.
|
||||
\param pixelShaderProgram: Text file containing the source of the pixel
|
||||
shader program. Set to 0 if no shader shall be created.
|
||||
\param vertexShaderEntryPointName: Name of the entry function of the
|
||||
vertexShaderProgram
|
||||
\param vsCompileTarget: Vertex shader version where the high level
|
||||
shader shall be compiled to.
|
||||
\param pixelShaderProgram: String containing the source of the pixel
|
||||
shader program. This can be 0 if no pixel shader shall be used.
|
||||
\param pixelShaderEntryPointName: Entry name of the function of the
|
||||
pixelShaderEntryPointName
|
||||
\param psCompileTarget: Pixel shader version where the high level
|
||||
shader shall be compiled to.
|
||||
\param callback: Pointer to an implementation of
|
||||
IShaderConstantSetCallBack in which you can set the needed vertex and
|
||||
pixel shader program constants. Set this to 0 if you don't need this.
|
||||
\param baseMaterial: Base material which renderstates will be used to
|
||||
shade the material.
|
||||
\param userData: a user data int. This int can be set to any value and
|
||||
will be set as parameter in the callback method when calling
|
||||
OnSetConstants(). In this way it is easily possible to use the same
|
||||
callback method for multiple materials and distinguish between them
|
||||
during the call.
|
||||
\return Returns the number of the material type which can be set in
|
||||
SMaterial::MaterialType to use the renderer. -1 is returned if an
|
||||
error occured, e.g. if a vertex or pixel shader program could not be
|
||||
compiled or a compile target is not reachable. The error strings are
|
||||
then printed to the error log and can be catched with a custom event
|
||||
receiver. */
|
||||
virtual s32 addHighLevelShaderMaterialFromFiles(
|
||||
const c8* vertexShaderProgram,
|
||||
const c8* vertexShaderEntryPointName = "main",
|
||||
E_VERTEX_SHADER_TYPE vsCompileTarget = EVST_VS_1_1,
|
||||
const c8* pixelShaderProgram = 0,
|
||||
const c8* pixelShaderProgram = 0,
|
||||
const c8* pixelShaderEntryPointName = "main",
|
||||
E_PIXEL_SHADER_TYPE psCompileTarget = EPST_PS_1_1,
|
||||
IShaderConstantSetCallBack* callback = 0,
|
||||
E_MATERIAL_TYPE baseMaterial = video::EMT_SOLID,
|
||||
s32 userData = 0) = 0;
|
||||
|
||||
|
||||
//! Like IGPUProgrammingServices::addShaderMaterial(),
|
||||
//! but tries to load the programs from files.
|
||||
//! \param vertexShaderProgram: Text file handle containing the source of the vertex shader program.
|
||||
//! Set to 0 if no shader shall be created.
|
||||
//! \param vertexShaderEntryPointName: Name of the entry function of the vertexShaderProgram
|
||||
//! \param vsCompileTarget: Vertex shader version where the high level shader shall be compiled to.
|
||||
//! \param pixelShaderProgram: Text file containing the source of the pixel shader program. Set to
|
||||
//! \param pixelShaderProgram: Text file handle containing the source of the pixel shader program. Set to
|
||||
//! 0 if no shader shall be created.
|
||||
//! \param pixelShaderEntryPointName: Entry name of the function of the pixelShaderEntryPointName
|
||||
//! \param psCompileTarget: Pixel shader version where the high level shader shall be compiled to.
|
||||
//! \param callback: Pointer to an implementation of IShaderConstantSetCallBack in which you
|
||||
//! can set the needed vertex and pixel shader program constants. Set this to 0 if you don't need this.
|
||||
//! \param baseMaterial: Base material which renderstates will be used to shade the
|
||||
//! material.
|
||||
//! \param userData: a user data int. This int can be set to any value and will be set as parameter
|
||||
//! in the callback method when calling OnSetConstants(). In this way it is easily possible to
|
||||
//! use the same callback method for multiple materials and distinguish between them during the call.
|
||||
//! \return Returns the number of the
|
||||
//! material type which can be set in SMaterial::MaterialType to use the renderer.
|
||||
//! -1 is returned if an error occured, e.g. if a vertex or pixel shader
|
||||
//! program could not be compiled or a compile target is not reachable.
|
||||
//! The error strings are then printed to the error log and
|
||||
//! can be catched with a custom event receiver.
|
||||
virtual s32 addHighLevelShaderMaterialFromFiles(
|
||||
io::IReadFile* vertexShaderProgram,
|
||||
const c8* vertexShaderEntryPointName = "main",
|
||||
E_VERTEX_SHADER_TYPE vsCompileTarget = EVST_VS_1_1,
|
||||
io::IReadFile* pixelShaderProgram = 0,
|
||||
const c8* pixelShaderEntryPointName = "main",
|
||||
E_PIXEL_SHADER_TYPE psCompileTarget = EPST_PS_1_1,
|
||||
IShaderConstantSetCallBack* callback = 0,
|
||||
E_MATERIAL_TYPE baseMaterial = video::EMT_SOLID,
|
||||
s32 userData = 0) = 0;
|
||||
|
||||
//! Adds a new material renderer to the VideoDriver, using pixel and/or
|
||||
//! vertex shaders to render geometry.
|
||||
//! Note that it is a good idea to call IVideoDriver::queryFeature() before to check
|
||||
//! if the IVideoDriver supports the vertex and/or pixel shader version your are using.
|
||||
//! The material is added to the VideoDriver like with IVideoDriver::addMaterialRenderer()
|
||||
//! and can be used like it had been added with that method.
|
||||
//! \param vertexShaderProgram: String containing the source of the vertex shader program. This can be
|
||||
//! 0 if no vertex program shall be used.
|
||||
//! For DX8 programs, the will always input registers look like this:
|
||||
//! v0: position, v1: normal,
|
||||
//! v2: color, v3: texture cooridnates, v4: texture coordinates 2 if available.
|
||||
//! For DX9 programs, you can manually set the registers using the dcl_ statements.
|
||||
//! \param pixelShaderProgram: String containing the source of the pixel shader program.
|
||||
//! This can be 0 if you don't want to use a pixel shader.
|
||||
//! \param callback: Pointer to an implementation of IShaderConstantSetCallBack in which you
|
||||
//! can set the needed vertex and pixel shader program constants. Set this to 0 if you don't need this.
|
||||
//! \param baseMaterial: Base material which renderstates will be used to shade the
|
||||
//! material.
|
||||
//! \param userData: a user data int. This int can be set to any value and will be set as parameter
|
||||
//! in the callback method when calling OnSetConstants(). In this way it is easily possible to
|
||||
//! use the same callback method for multiple materials and distinguish between them during the call.
|
||||
//! \return Returns the number of the
|
||||
//! material type which can be set in SMaterial::MaterialType to use the renderer.
|
||||
//! -1 is returned if an error occured. -1 is returned for example if a vertex or pixel shader
|
||||
//! program could not be compiled, the error strings are then printed out into the error log, and
|
||||
//! can be catched with a custom event receiver.
|
||||
virtual s32 addShaderMaterial(const c8* vertexShaderProgram = 0,
|
||||
const c8* pixelShaderProgram = 0,
|
||||
IShaderConstantSetCallBack* callback = 0,
|
||||
E_MATERIAL_TYPE baseMaterial = video::EMT_SOLID,
|
||||
s32 userData = 0) = 0;
|
||||
|
||||
//! Like IGPUProgrammingServices::addShaderMaterial(), but tries to load the
|
||||
//! programs from files.
|
||||
//! \param vertexShaderProgram: Text file containing the source of the vertex shader program.
|
||||
//! Set to 0 if no shader shall be created.
|
||||
//! \param pixelShaderProgram: Text file containing the source of the pixel shader program. Set to
|
||||
//! 0 if no shader shall be created.
|
||||
//! \param callback: Pointer to an IShaderConstantSetCallback object to which the
|
||||
//! OnSetConstants function is called.
|
||||
//! \param baseMaterial: baseMaterial
|
||||
//! \param userData: a user data int. This int can be set to any value and will be set as parameter
|
||||
//! in the callback method when calling OnSetConstants(). In this way it is easily possible to
|
||||
//! use the same callback method for multiple materials and distinguish between them during the call.
|
||||
//! \return Returns the number of the
|
||||
//! material type which can be set in SMaterial::MaterialType to use the renderer.
|
||||
//! -1 is returned if an error occured. -1 is returned for example if a vertex or pixel shader
|
||||
//! program could not be compiled, the error strings are then printed out into the error log, and
|
||||
//! can be catched with a custom event receiver.
|
||||
|
||||
//! Like IGPUProgrammingServices::addShaderMaterial(), but loads from files.
|
||||
/** \param vertexShaderProgram: Text file handle containing the source
|
||||
* of the vertex shader program.
|
||||
Set to 0 if no shader shall be created.
|
||||
\param vertexShaderEntryPointName: Name of the entry function of the
|
||||
vertexShaderProgram
|
||||
\param vsCompileTarget: Vertex shader version where the high level
|
||||
shader shall be compiled to.
|
||||
\param pixelShaderProgram: Text file containing the source of the pixel
|
||||
shader program. Set to
|
||||
\param pixelShaderProgram: Text file handle containing the source of
|
||||
the pixel shader program. Set to 0 if no shader shall be created.
|
||||
\param pixelShaderEntryPointName: Entry name of the function of the
|
||||
pixelShaderEntryPointName
|
||||
\param psCompileTarget: Pixel shader version where the high level
|
||||
shader shall be compiled to.
|
||||
\param callback: Pointer to an implementation of
|
||||
IShaderConstantSetCallBack in which you can set the needed vertex and
|
||||
pixel shader program constants. Set this to 0 if you don't need this.
|
||||
\param baseMaterial: Base material which renderstates will be used to
|
||||
shade the material.
|
||||
\param userData: a user data int. This int can be set to any value and
|
||||
will be set as parameter in the callback method when calling
|
||||
OnSetConstants(). In this way it is easily possible to use the same
|
||||
callback method for multiple materials and distinguish between them
|
||||
during the call.
|
||||
\return Returns the number of the material type which can be set in
|
||||
SMaterial::MaterialType to use the renderer. -1 is returned if an
|
||||
error occured, e.g. if a vertex or pixel shader program could not be
|
||||
compiled or a compile target is not reachable. The error strings are
|
||||
then printed to the error log and can be catched with a custom event
|
||||
receiver. */
|
||||
virtual s32 addHighLevelShaderMaterialFromFiles(
|
||||
io::IReadFile* vertexShaderProgram,
|
||||
const c8* vertexShaderEntryPointName = "main",
|
||||
E_VERTEX_SHADER_TYPE vsCompileTarget = EVST_VS_1_1,
|
||||
io::IReadFile* pixelShaderProgram = 0,
|
||||
const c8* pixelShaderEntryPointName = "main",
|
||||
E_PIXEL_SHADER_TYPE psCompileTarget = EPST_PS_1_1,
|
||||
IShaderConstantSetCallBack* callback = 0,
|
||||
E_MATERIAL_TYPE baseMaterial = video::EMT_SOLID,
|
||||
s32 userData = 0) = 0;
|
||||
|
||||
//! Adds a new ASM shader material renderer to the VideoDriver
|
||||
/** Note that it is a good idea to call IVideoDriver::queryFeature() in
|
||||
advance to check if the IVideoDriver supports the vertex and/or pixel
|
||||
shader version your are using.
|
||||
|
||||
The material is added to the VideoDriver like with
|
||||
IVideoDriver::addMaterialRenderer() and can be used like it had been
|
||||
added with that method.
|
||||
\param vertexShaderProgram: String containing the source of the vertex
|
||||
shader program. This can be 0 if no vertex program shall be used.
|
||||
|
||||
For DX8 programs, the will always input registers look like this: v0:
|
||||
position, v1: normal, v2: color, v3: texture cooridnates, v4: texture
|
||||
coordinates 2 if available.
|
||||
|
||||
For DX9 programs, you can manually set the registers using the dcl_
|
||||
statements.
|
||||
\param pixelShaderProgram: String containing the source of the pixel
|
||||
shader program. This can be 0 if you don't want to use a pixel shader.
|
||||
\param callback: Pointer to an implementation of
|
||||
IShaderConstantSetCallBack in which you can set the needed vertex and
|
||||
pixel shader program constants. Set this to 0 if you don't need this.
|
||||
\param baseMaterial: Base material which renderstates will be used to
|
||||
shade the material.
|
||||
\param userData: a user data int. This int can be set to any value and
|
||||
will be set as parameter in the callback method when calling
|
||||
OnSetConstants(). In this way it is easily possible to use the same
|
||||
callback method for multiple materials and distinguish between them
|
||||
during the call.
|
||||
\return Returns the number of the material type which can be set in
|
||||
SMaterial::MaterialType to use the renderer. -1 is returned if an
|
||||
error occured. -1 is returned for example if a vertex or pixel shader
|
||||
program could not be compiled, the error strings are then printed out
|
||||
into the error log, and can be catched with a custom event receiver. */
|
||||
virtual s32 addShaderMaterial(const c8* vertexShaderProgram = 0,
|
||||
const c8* pixelShaderProgram = 0,
|
||||
IShaderConstantSetCallBack* callback = 0,
|
||||
E_MATERIAL_TYPE baseMaterial = video::EMT_SOLID,
|
||||
s32 userData = 0) = 0;
|
||||
|
||||
//! Like IGPUProgrammingServices::addShaderMaterial(), but loads from files.
|
||||
/** \param vertexShaderProgram: Text file containing the source of the
|
||||
vertex shader program. Set to 0 if no shader shall be created.
|
||||
\param pixelShaderProgram: Text file containing the source of the pixel
|
||||
shader program. Set to 0 if no shader shall be created.
|
||||
\param callback: Pointer to an IShaderConstantSetCallback object to
|
||||
which the OnSetConstants function is called.
|
||||
\param baseMaterial: baseMaterial
|
||||
\param userData: a user data int. This int can be set to any value and
|
||||
will be set as parameter in the callback method when calling
|
||||
OnSetConstants(). In this way it is easily possible to use the same
|
||||
callback method for multiple materials and distinguish between them
|
||||
during the call.
|
||||
\return Returns the number of the material type which can be set in
|
||||
SMaterial::MaterialType to use the renderer. -1 is returned if an
|
||||
error occured. -1 is returned for example if a vertex or pixel shader
|
||||
program could not be compiled, the error strings are then printed out
|
||||
into the error log, and can be catched with a custom event receiver. */
|
||||
virtual s32 addShaderMaterialFromFiles(io::IReadFile* vertexShaderProgram,
|
||||
io::IReadFile* pixelShaderProgram,
|
||||
IShaderConstantSetCallBack* callback = 0,
|
||||
E_MATERIAL_TYPE baseMaterial = video::EMT_SOLID,
|
||||
s32 userData = 0) = 0;
|
||||
|
||||
//! Like IGPUProgrammingServices::addShaderMaterial(), but tries to load the
|
||||
//! programs from files.
|
||||
//! \param vertexShaderProgramFileName: Text file name containing the source of the
|
||||
//! vertex shader program.
|
||||
//! Set to 0 if no shader shall be created.
|
||||
//! \param pixelShaderProgramFileName: Text file name containing the source of the
|
||||
//! pixel shader program. Set to 0 if no shader shall be created.
|
||||
//! \param callback: Pointer to an IShaderConstantSetCallback object on which the
|
||||
//! OnSetConstants function is called.
|
||||
//! \param baseMaterial: baseMaterial
|
||||
//! \param userData: a user data int. This int can be set to any value and will be set as parameter
|
||||
//! in the callback method when calling OnSetConstants(). In this way it is easily possible to
|
||||
//! use the same callback method for multiple materials and distinguish between them during the call.
|
||||
//! \return Returns the number of the
|
||||
//! material type which can be set in SMaterial::MaterialType to use the renderer.
|
||||
//! -1 is returned if an error occured. -1 is returned for example if a vertex or pixel shader
|
||||
//! program could not be compiled, the error strings are then printed out into the error log, and
|
||||
//! can be catched with a custom event receiver.
|
||||
//! Like IGPUProgrammingServices::addShaderMaterial(), but loads from files.
|
||||
/** \param vertexShaderProgramFileName: Text file name containing the
|
||||
source of the vertex shader program. Set to 0 if no shader shall be
|
||||
created.
|
||||
\param pixelShaderProgramFileName: Text file name containing the source
|
||||
of the pixel shader program. Set to 0 if no shader shall be created.
|
||||
\param callback: Pointer to an IShaderConstantSetCallback object on
|
||||
which the OnSetConstants function is called.
|
||||
\param baseMaterial: baseMaterial
|
||||
\param userData: a user data int. This int can be set to any value and
|
||||
will be set as parameter in the callback method when calling
|
||||
OnSetConstants(). In this way it is easily possible to use the same
|
||||
callback method for multiple materials and distinguish between them
|
||||
during the call.
|
||||
\return Returns the number of the material type which can be set in
|
||||
SMaterial::MaterialType to use the renderer. -1 is returned if an
|
||||
error occured. -1 is returned for example if a vertex or pixel shader
|
||||
program could not be compiled, the error strings are then printed out
|
||||
into the error log, and can be catched with a custom event receiver. */
|
||||
virtual s32 addShaderMaterialFromFiles(const c8* vertexShaderProgramFileName,
|
||||
const c8* pixelShaderProgramFileName,
|
||||
IShaderConstantSetCallBack* callback = 0,
|
||||
|
@ -1,4 +1,4 @@
|
||||
// Copyright (C) 2002-2007 Nikolaus Gebhardt
|
||||
// Copyright (C) 2002-2008 Nikolaus Gebhardt
|
||||
// This file is part of the "Irrlicht Engine".
|
||||
// For conditions of distribution and use, see copyright notice in irrlicht.h
|
||||
|
||||
@ -65,27 +65,27 @@ namespace gui
|
||||
|
||||
//! Sets another skin independent font.
|
||||
/** If this is set to zero, the button uses the font of the skin.
|
||||
\param font: New font to set. */
|
||||
\param font: New font to set. */
|
||||
virtual void setOverrideFont(IGUIFont* font=0) = 0;
|
||||
|
||||
//! Sets an image which should be displayed on the button when it is in normal state.
|
||||
//! Sets an image which should be displayed on the button when it is in normal state.
|
||||
/** \param image: Image to be displayed */
|
||||
virtual void setImage(video::ITexture* image) = 0;
|
||||
|
||||
//! Sets a background image for the button when it is in normal state.
|
||||
//! Sets a background image for the button when it is in normal state.
|
||||
/** \param image: Texture containing the image to be displayed
|
||||
\param pos: Position in the texture, where the image is located */
|
||||
\param pos: Position in the texture, where the image is located */
|
||||
virtual void setImage(video::ITexture* image, const core::rect<s32>& pos) = 0;
|
||||
|
||||
//! Sets a background image for the button when it is in pressed state.
|
||||
//! Sets a background image for the button when it is in pressed state.
|
||||
/** If no images is specified for the pressed state via
|
||||
setPressedImage(), this image is also drawn in pressed state.
|
||||
\param image: Image to be displayed */
|
||||
virtual void setPressedImage(video::ITexture* image) = 0;
|
||||
|
||||
//! Sets an image which should be displayed on the button when it is in pressed state.
|
||||
//! Sets an image which should be displayed on the button when it is in pressed state.
|
||||
/** \param image: Texture containing the image to be displayed
|
||||
\param pos: Position in the texture, where the image is located */
|
||||
\param pos: Position in the texture, where the image is located */
|
||||
virtual void setPressedImage(video::ITexture* image, const core::rect<s32>& pos) = 0;
|
||||
|
||||
//! Sets the sprite bank used by the button
|
||||
@ -98,10 +98,10 @@ namespace gui
|
||||
\param color: The color of the sprite
|
||||
\param loop: True if the animation should loop, false if not
|
||||
*/
|
||||
virtual void setSprite(EGUI_BUTTON_STATE state, s32 index,
|
||||
virtual void setSprite(EGUI_BUTTON_STATE state, s32 index,
|
||||
video::SColor color=video::SColor(255,255,255,255), bool loop=false) = 0;
|
||||
|
||||
//! Sets if the button should behave like a push button.
|
||||
//! Sets if the button should behave like a push button.
|
||||
/** Which means it can be in two states: Normal or Pressed. With a click on the button,
|
||||
the user can change the state of the button. */
|
||||
virtual void setIsPushButton(bool isPushButton) = 0;
|
||||
|
@ -1,4 +1,4 @@
|
||||
// Copyright (C) 2002-2007 Nikolaus Gebhardt
|
||||
// Copyright (C) 2002-2008 Nikolaus Gebhardt
|
||||
// This file is part of the "Irrlicht Engine".
|
||||
// For conditions of distribution and use, see copyright notice in irrlicht.h
|
||||
|
||||
|
@ -1,4 +1,4 @@
|
||||
// Copyright (C) 2002-2007 Nikolaus Gebhardt
|
||||
// Copyright (C) 2002-2008 Nikolaus Gebhardt
|
||||
// This file is part of the "Irrlicht Engine".
|
||||
// For conditions of distribution and use, see copyright notice in irrlicht.h
|
||||
|
||||
|
@ -1,4 +1,4 @@
|
||||
// Copyright (C) 2002-2007 Nikolaus Gebhardt
|
||||
// Copyright (C) 2002-2008 Nikolaus Gebhardt
|
||||
// This file is part of the "Irrlicht Engine".
|
||||
// For conditions of distribution and use, see copyright notice in irrlicht.h
|
||||
|
||||
@ -11,6 +11,7 @@ namespace irr
|
||||
{
|
||||
namespace gui
|
||||
{
|
||||
|
||||
//! Combobox widget
|
||||
class IGUIComboBox : public IGUIElement
|
||||
{
|
||||
|
@ -1,4 +1,4 @@
|
||||
// Copyright (C) 2002-2007 Nikolaus Gebhardt
|
||||
// Copyright (C) 2002-2008 Nikolaus Gebhardt
|
||||
// This file is part of the "Irrlicht Engine".
|
||||
// For conditions of distribution and use, see copyright notice in irrlicht.h
|
||||
|
||||
@ -29,15 +29,15 @@ namespace gui
|
||||
|
||||
//! Adds a menu item.
|
||||
/** \param text: Text of menu item. Set this to 0 to create
|
||||
an separator instead of a real item, which is the same like
|
||||
calling addSeparator();
|
||||
\param commandId: Command id of menu item, a simple id you may
|
||||
set to whatever you want.
|
||||
\param enabled: Specifies if the menu item should be enabled.
|
||||
\param hasSubMenu: Set this to true if there should be a submenu
|
||||
at this item. You can acess this submenu via getSubMenu().
|
||||
\param checked: Specifies if the menu item should be initially checked.
|
||||
\return Returns the index of the new item */
|
||||
an separator instead of a real item, which is the same like
|
||||
calling addSeparator();
|
||||
\param commandId: Command id of menu item, a simple id you may
|
||||
set to whatever you want.
|
||||
\param enabled: Specifies if the menu item should be enabled.
|
||||
\param hasSubMenu: Set this to true if there should be a submenu
|
||||
at this item. You can acess this submenu via getSubMenu().
|
||||
\param checked: Specifies if the menu item should be initially checked.
|
||||
\return Returns the index of the new item */
|
||||
virtual u32 addItem(const wchar_t* text, s32 commandId=-1, bool enabled=true,
|
||||
bool hasSubMenu=false,
|
||||
bool checked=false
|
||||
@ -52,7 +52,7 @@ namespace gui
|
||||
|
||||
//! Sets text of the menu item.
|
||||
/** \param idx: Zero based index of the menu item
|
||||
\param text: New text of the item. */
|
||||
\param text: New text of the item. */
|
||||
virtual void setItemText(u32 idx, const wchar_t* text) = 0;
|
||||
|
||||
//! Check if a menu item is enabled
|
||||
@ -61,12 +61,12 @@ namespace gui
|
||||
|
||||
//! Sets if the menu item should be enabled.
|
||||
/** \param idx: Zero based index of the menu item
|
||||
\param enabled: True if it is enabled, otherwise false. */
|
||||
\param enabled: True if it is enabled, otherwise false. */
|
||||
virtual void setItemEnabled(u32 idx, bool enabled) = 0;
|
||||
|
||||
//! Sets if the menu item should be checked.
|
||||
/** \param idx: Zero based index of the menu item
|
||||
\param enabled: True if it is enabled, otherwise false. */
|
||||
\param enabled: True if it is enabled, otherwise false. */
|
||||
virtual void setItemChecked(u32 idx, bool enabled) = 0;
|
||||
|
||||
//! Check if a menu item is checked
|
||||
@ -90,14 +90,14 @@ namespace gui
|
||||
|
||||
//! Sets the command id of a menu item
|
||||
/** \param idx: Zero based index of the menu item
|
||||
\param id: Command id of menu item, a simple id you may
|
||||
set to whatever you want. */
|
||||
\param id: Command id of menu item, a simple id you may
|
||||
set to whatever you want. */
|
||||
virtual void setItemCommandId(u32 idx, s32 id) = 0;
|
||||
|
||||
//! Get a pointer to the submenu of an item.
|
||||
//! Get a pointer to the submenu of an item.
|
||||
/** 0 is returned if there is no submenu
|
||||
\param idx: Zero based index of the menu item
|
||||
\return Returns a pointer to the submenu of an item. */
|
||||
\param idx: Zero based index of the menu item
|
||||
\return Returns a pointer to the submenu of an item. */
|
||||
virtual IGUIContextMenu* getSubMenu(u32 idx) const = 0;
|
||||
};
|
||||
|
||||
|
@ -1,4 +1,4 @@
|
||||
// Copyright (C) 2002-2007 Nikolaus Gebhardt
|
||||
// Copyright (C) 2002-2008 Nikolaus Gebhardt
|
||||
// This file is part of the "Irrlicht Engine".
|
||||
// For conditions of distribution and use, see copyright notice in irrlicht.h
|
||||
|
||||
@ -28,23 +28,23 @@ namespace gui
|
||||
|
||||
//! Sets another skin independent font.
|
||||
/** If this is set to zero, the button uses the font of the skin.
|
||||
\param font: New font to set. */
|
||||
\param font: New font to set. */
|
||||
virtual void setOverrideFont(IGUIFont* font=0) = 0;
|
||||
|
||||
//! Sets another color for the text.
|
||||
/** If set, the edit box does not use the EGDC_BUTTON_TEXT color defined
|
||||
in the skin, but the set color instead. You don't need to call
|
||||
IGUIEditBox::enableOverrrideColor(true) after this, this is done
|
||||
by this function.
|
||||
If you set a color, and you want the text displayed with the color
|
||||
of the skin again, call IGUIEditBox::enableOverrideColor(false);
|
||||
\param color: New color of the text. */
|
||||
in the skin, but the set color instead. You don't need to call
|
||||
IGUIEditBox::enableOverrrideColor(true) after this, this is done
|
||||
by this function.
|
||||
If you set a color, and you want the text displayed with the color
|
||||
of the skin again, call IGUIEditBox::enableOverrideColor(false);
|
||||
\param color: New color of the text. */
|
||||
virtual void setOverrideColor(video::SColor color) = 0;
|
||||
|
||||
//! Sets if the text should use the overide color or the color in the gui skin.
|
||||
/** \param enable: If set to true, the override color, which can be set
|
||||
with IGUIEditBox::setOverrideColor is used, otherwise the
|
||||
EGDC_BUTTON_TEXT color of the skin. */
|
||||
with IGUIEditBox::setOverrideColor is used, otherwise the
|
||||
EGDC_BUTTON_TEXT color of the skin. */
|
||||
virtual void enableOverrideColor(bool enable) = 0;
|
||||
|
||||
//! Turns the border on or off
|
||||
@ -52,15 +52,15 @@ namespace gui
|
||||
virtual void setDrawBorder(bool border) = 0;
|
||||
|
||||
//! Sets text justification mode
|
||||
/** \param horizontal: EGUIA_UPPERLEFT for left justified (default),
|
||||
EGUIA_LOWEERRIGHT for right justified, or EGUIA_CENTER for centered text.
|
||||
\param vertical: EGUIA_UPPERLEFT to align with top edge,
|
||||
EGUIA_LOWEERRIGHT for bottom edge, or EGUIA_CENTER for centered text (default). */
|
||||
/** \param horizontal: EGUIA_UPPERLEFT for left justified (default),
|
||||
EGUIA_LOWEERRIGHT for right justified, or EGUIA_CENTER for centered text.
|
||||
\param vertical: EGUIA_UPPERLEFT to align with top edge,
|
||||
EGUIA_LOWEERRIGHT for bottom edge, or EGUIA_CENTER for centered text (default). */
|
||||
virtual void setTextAlignment(EGUI_ALIGNMENT horizontal, EGUI_ALIGNMENT vertical) = 0;
|
||||
|
||||
//! Enables or disables word wrap.
|
||||
/** \param enable: If set to true, words going over one line are
|
||||
broken to the next line. */
|
||||
/** \param enable: If set to true, words going over one line are
|
||||
broken to the next line. */
|
||||
virtual void setWordWrap(bool enable) = 0;
|
||||
|
||||
//! Checks if word wrap is enabled
|
||||
@ -84,7 +84,7 @@ namespace gui
|
||||
//! \return true if automatic scrolling is enabled, false if not
|
||||
virtual bool isAutoScrollEnabled() const = 0;
|
||||
|
||||
//! Sets whether the edit box is a password box. Setting this to true will
|
||||
//! Sets whether the edit box is a password box. Setting this to true will
|
||||
/** disable MultiLine, WordWrap and the ability to copy with ctrl+c or ctrl+x
|
||||
\param passwordBox: true to enable password, false to disable
|
||||
\param passwordChar: the character that is displayed instead of letters */
|
||||
@ -98,8 +98,8 @@ namespace gui
|
||||
virtual core::dimension2di getTextDimension() = 0;
|
||||
|
||||
//! Sets the maximum amount of characters which may be entered in the box.
|
||||
/** \param max: Maximum amount of characters. If 0, the character amount is
|
||||
infinity. */
|
||||
/** \param max: Maximum amount of characters. If 0, the character amount is
|
||||
infinity. */
|
||||
virtual void setMax(u32 max) = 0;
|
||||
|
||||
//! Returns maximum amount of characters, previously set by setMax();
|
||||
|
@ -1,4 +1,4 @@
|
||||
// Copyright (C) 2002-2007 Nikolaus Gebhardt
|
||||
// Copyright (C) 2002-2008 Nikolaus Gebhardt
|
||||
// This file is part of the "Irrlicht Engine".
|
||||
// For conditions of distribution and use, see copyright notice in irrlicht.h
|
||||
|
||||
@ -111,13 +111,13 @@ public:
|
||||
{
|
||||
if (!Parent)
|
||||
return;
|
||||
|
||||
|
||||
const core::dimension2di& d = Parent->getAbsolutePosition().getSize();
|
||||
|
||||
DesiredRect = core::rect<s32>(
|
||||
core::floor32((f32)d.Width * r.UpperLeftCorner.X),
|
||||
|
||||
DesiredRect = core::rect<s32>(
|
||||
core::floor32((f32)d.Width * r.UpperLeftCorner.X),
|
||||
core::floor32((f32)d.Height * r.UpperLeftCorner.Y),
|
||||
core::floor32((f32)d.Width * r.LowerRightCorner.X),
|
||||
core::floor32((f32)d.Width * r.LowerRightCorner.X),
|
||||
core::floor32((f32)d.Height * r.LowerRightCorner.Y));
|
||||
|
||||
ScaleRect = r;
|
||||
@ -185,7 +185,7 @@ public:
|
||||
if (Parent)
|
||||
{
|
||||
core::rect<s32> r(Parent->getAbsolutePosition());
|
||||
|
||||
|
||||
core::dimension2df d((f32)r.getSize().Width, (f32)r.getSize().Height);
|
||||
|
||||
if (AlignLeft == EGUIA_SCALE)
|
||||
@ -226,7 +226,7 @@ public:
|
||||
|
||||
diffx = parentAbsolute.getWidth() - LastParentRect.getWidth();
|
||||
diffy = parentAbsolute.getHeight() - LastParentRect.getHeight();
|
||||
|
||||
|
||||
if (AlignLeft == EGUIA_SCALE || AlignRight == EGUIA_SCALE)
|
||||
fw = (f32)parentAbsolute.getWidth();
|
||||
|
||||
@ -310,7 +310,7 @@ public:
|
||||
RelativeRect.LowerRightCorner.Y = RelativeRect.UpperLeftCorner.Y + MaxSize.Height;
|
||||
|
||||
RelativeRect.repair();
|
||||
|
||||
|
||||
AbsoluteRect = RelativeRect + parentAbsolute.UpperLeftCorner;
|
||||
|
||||
if (!Parent)
|
||||
@ -352,7 +352,7 @@ public:
|
||||
|
||||
if (IsVisible && isPointInside(point))
|
||||
target = this;
|
||||
|
||||
|
||||
return target;
|
||||
}
|
||||
|
||||
@ -371,10 +371,10 @@ public:
|
||||
if (child)
|
||||
{
|
||||
child->grab();
|
||||
child->remove(); // remove from old parent
|
||||
child->remove(); // remove from old parent
|
||||
child->LastParentRect = getAbsolutePosition();
|
||||
child->Parent = this;
|
||||
Children.push_back(child);
|
||||
Children.push_back(child);
|
||||
}
|
||||
}
|
||||
|
||||
@ -456,8 +456,8 @@ public:
|
||||
}
|
||||
|
||||
|
||||
//! Sets whether this control was created as part of its parent,
|
||||
//! for example when a scrollbar is part of a listbox.
|
||||
//! Sets whether this control was created as part of its parent,
|
||||
//! for example when a scrollbar is part of a listbox.
|
||||
//! SubElements are not saved to disk when calling guiEnvironment->saveGUI()
|
||||
virtual void setSubElement(bool subElement)
|
||||
{
|
||||
@ -465,7 +465,7 @@ public:
|
||||
}
|
||||
|
||||
|
||||
//! If set to true, the focus will visit this element when using
|
||||
//! If set to true, the focus will visit this element when using
|
||||
//! the tab key to cycle through elements.
|
||||
//! If this element is a tab group (see isTabGroup/setTabGroup) then
|
||||
//! ctrl+tab will be used instead.
|
||||
@ -483,7 +483,7 @@ public:
|
||||
}
|
||||
|
||||
|
||||
//! Sets the priority of focus when using the tab key to navigate between a group
|
||||
//! Sets the priority of focus when using the tab key to navigate between a group
|
||||
//! of elements. See setTabGroup, isTabGroup and getTabGroup for information on tab groups.
|
||||
//! Elements with a lower number are focused first
|
||||
void setTabOrder(s32 index)
|
||||
@ -495,7 +495,7 @@ public:
|
||||
IGUIElement *el = getTabGroup();
|
||||
while (IsTabGroup && el && el->Parent)
|
||||
el = el->Parent;
|
||||
|
||||
|
||||
IGUIElement *first=0, *closest=0;
|
||||
if (el)
|
||||
{
|
||||
@ -538,11 +538,11 @@ public:
|
||||
|
||||
|
||||
//! Returns the container element which holds all elements in this element's
|
||||
//! tab group.
|
||||
//! tab group.
|
||||
IGUIElement* getTabGroup()
|
||||
{
|
||||
IGUIElement *ret=this;
|
||||
|
||||
|
||||
while (ret && !ret->isTabGroup())
|
||||
ret = ret->getParent();
|
||||
|
||||
@ -643,11 +643,11 @@ public:
|
||||
|
||||
//! Finds the first element with the given id.
|
||||
/** \param id: Id to search for.
|
||||
\param searchchildren: Set this to true, if also children of this
|
||||
element may contain the element with the searched id and they
|
||||
should be searched too.
|
||||
\return Returns the first element with the given id. If no element
|
||||
with this id was found, 0 is returned. */
|
||||
\param searchchildren: Set this to true, if also children of this
|
||||
element may contain the element with the searched id and they
|
||||
should be searched too.
|
||||
\return Returns the first element with the given id. If no element
|
||||
with this id was found, 0 is returned. */
|
||||
virtual IGUIElement* getElementFromId(s32 id, bool searchchildren=false) const
|
||||
{
|
||||
IGUIElement* e = 0;
|
||||
@ -663,7 +663,7 @@ public:
|
||||
|
||||
if (e)
|
||||
return e;
|
||||
}
|
||||
}
|
||||
|
||||
return e;
|
||||
}
|
||||
@ -675,7 +675,7 @@ public:
|
||||
{
|
||||
if (!child)
|
||||
return false;
|
||||
do
|
||||
do
|
||||
{
|
||||
if (child->Parent)
|
||||
child = child->Parent;
|
||||
@ -695,7 +695,7 @@ public:
|
||||
//! \param closest: the closest match, depending on tab order and direction
|
||||
//! \param includeInvisible: includes invisible elements in the search (default=false)
|
||||
//! \return true if successfully found an element, false to continue searching/fail
|
||||
bool getNextElement(s32 startOrder, bool reverse, bool group,
|
||||
bool getNextElement(s32 startOrder, bool reverse, bool group,
|
||||
IGUIElement*& first, IGUIElement*& closest, bool includeInvisible=false) const
|
||||
{
|
||||
// we'll stop searching if we find this number
|
||||
@ -724,18 +724,18 @@ public:
|
||||
closest = *it;
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
// is it closer than the current closest?
|
||||
if (closest)
|
||||
{
|
||||
closestOrder = closest->getTabOrder();
|
||||
if ( ( reverse && currentOrder > closestOrder && currentOrder < startOrder)
|
||||
if ( ( reverse && currentOrder > closestOrder && currentOrder < startOrder)
|
||||
||(!reverse && currentOrder < closestOrder && currentOrder > startOrder))
|
||||
{
|
||||
closest = *it;
|
||||
}
|
||||
}
|
||||
else
|
||||
else
|
||||
if ( (reverse && currentOrder < startOrder) || (!reverse && currentOrder > startOrder) )
|
||||
{
|
||||
closest = *it;
|
||||
@ -770,7 +770,7 @@ public:
|
||||
}
|
||||
|
||||
|
||||
//! Returns the type of the gui element.
|
||||
//! Returns the type of the gui element.
|
||||
/** This is needed for the .NET wrapper but will be used
|
||||
later for serializing and deserializing.
|
||||
If you wrote your own GUIElements, you need to set the type for your element as first parameter
|
||||
@ -781,8 +781,8 @@ public:
|
||||
}
|
||||
|
||||
|
||||
//! Returns the type name of the gui element.
|
||||
/** This is needed serializing elements. For serializing your own elements, override this function
|
||||
//! Returns the type name of the gui element.
|
||||
/** This is needed serializing elements. For serializing your own elements, override this function
|
||||
and return your own type name which is created by your IGUIElementFactory */
|
||||
virtual const c8* getTypeName() const
|
||||
{
|
||||
@ -858,7 +858,7 @@ protected:
|
||||
//! absolute clipping rect of element
|
||||
core::rect<s32> AbsoluteClippingRect;
|
||||
|
||||
//! the rectangle the element would prefer to be,
|
||||
//! the rectangle the element would prefer to be,
|
||||
//! if it was not constrained by parent or max/min size
|
||||
core::rect<s32> DesiredRect;
|
||||
|
||||
|
@ -1,4 +1,4 @@
|
||||
// Copyright (C) 2002-2007 Nikolaus Gebhardt
|
||||
// Copyright (C) 2002-2008 Nikolaus Gebhardt
|
||||
// This file is part of the "Irrlicht Engine".
|
||||
// For conditions of distribution and use, see copyright notice in irrlicht.h
|
||||
|
||||
@ -11,14 +11,13 @@
|
||||
namespace irr
|
||||
{
|
||||
|
||||
|
||||
namespace gui
|
||||
{
|
||||
class IGUIElement;
|
||||
|
||||
//! Interface making it possible to dynamicly create GUI elements
|
||||
/** To be able to add custom elements to Irrlicht and to make it possible for the
|
||||
scene manager to save and load them, simply implement this interface and register it
|
||||
|
||||
//! Interface making it possible to dynamicly create GUI elements
|
||||
/** To be able to add custom elements to Irrlicht and to make it possible for the
|
||||
scene manager to save and load them, simply implement this interface and register it
|
||||
in your gui environment via IGUIEnvironment::registerGUIElementFactory.
|
||||
Note: When implementing your own element factory, don't call IGUIEnvironment::grab() to
|
||||
increase the reference counter of the environment. This is not necessary because the
|
||||
@ -57,7 +56,7 @@ namespace gui
|
||||
virtual const c8* getCreateableGUIElementTypeName(s32 idx) const = 0;
|
||||
|
||||
//! returns type name of a createable GUI element
|
||||
/** \param type: Type of GUI element.
|
||||
/** \param type: Type of GUI element.
|
||||
\return: Returns name of the type if this factory can create the type, otherwise 0. */
|
||||
virtual const c8* getCreateableGUIElementTypeName(EGUI_ELEMENT_TYPE type) const = 0;
|
||||
};
|
||||
|
@ -1,4 +1,4 @@
|
||||
// Copyright (C) 2002-2007 Nikolaus Gebhardt
|
||||
// Copyright (C) 2002-2008 Nikolaus Gebhardt
|
||||
// This file is part of the "Irrlicht Engine".
|
||||
// For conditions of distribution and use, see copyright notice in irrlicht.h
|
||||
|
||||
@ -65,320 +65,407 @@ public:
|
||||
//! destructor
|
||||
virtual ~IGUIEnvironment() {};
|
||||
|
||||
//! Draws all gui elements.
|
||||
//! Draws all gui elements by traversing the GUI environment starting
|
||||
//! at the root node.
|
||||
virtual void drawAll() = 0;
|
||||
|
||||
//! Sets the focus to an element.
|
||||
/** Causes a EGET_ELEMENT_FOCUS_LOST event followed by a EGET_ELEMENT_FOCUSED event.
|
||||
If someone absorbed either of the events, then the focus will not be changed.
|
||||
\return Returns true on success, false on failure */
|
||||
/** Causes a EGET_ELEMENT_FOCUS_LOST event followed by a
|
||||
EGET_ELEMENT_FOCUSED event. If someone absorbed either of the events,
|
||||
then the focus will not be changed.
|
||||
\param element Pointer to the element which shall get the focus.
|
||||
\return True on success, false on failure */
|
||||
virtual bool setFocus(IGUIElement* element) = 0;
|
||||
|
||||
//! Returns the element with the focus
|
||||
//! Returns the element which holds the focus.
|
||||
//! \return Pointer to the element with focus.
|
||||
virtual IGUIElement* getFocus() const = 0;
|
||||
|
||||
//! Removes the focus from an element.
|
||||
/** Causes a EGET_ELEMENT_FOCUS_LOST event. If the event is absorbed then the focus
|
||||
will not be changed.
|
||||
\return Returns true on success, false on failure */
|
||||
/** Causes a EGET_ELEMENT_FOCUS_LOST event. If the event is absorbed
|
||||
then the focus will not be changed.
|
||||
\param element Pointer to the element which shall lose the focus.
|
||||
\return True on success, false on failure */
|
||||
virtual bool removeFocus(IGUIElement* element) = 0;
|
||||
|
||||
//! Returns if the element has focus
|
||||
//! Returns whether the element has focus
|
||||
/** \param element Pointer to the element which is tested.
|
||||
\return True if the element has focus, else false. */
|
||||
virtual bool hasFocus(IGUIElement* element) const = 0;
|
||||
|
||||
//! Returns the current video driver.
|
||||
//! \return Pointer to the video driver.
|
||||
virtual video::IVideoDriver* getVideoDriver() const = 0;
|
||||
|
||||
//! Returns the file system.
|
||||
//! \return Pointer to the file system.
|
||||
virtual io::IFileSystem* getFileSystem() const = 0;
|
||||
|
||||
//! returns a pointer to the OS operator
|
||||
//! \return Pointer to the OS operator.
|
||||
virtual IOSOperator* getOSOperator() const = 0;
|
||||
|
||||
//! removes all elements from the environment.
|
||||
//! Removes all elements from the environment.
|
||||
virtual void clear() = 0;
|
||||
|
||||
//! Posts an input event to the environment.
|
||||
//! Posts an input event to the environment.
|
||||
/** Usually you do not have to
|
||||
use this method, it is used by the internal engine. */
|
||||
use this method, it is used by the engine internally.
|
||||
\param event The event to post.
|
||||
\return True if succeeded, else false. */
|
||||
virtual bool postEventFromUser(const SEvent& event) = 0;
|
||||
|
||||
//! This sets a new event receiver for gui events.
|
||||
//! This sets a new event receiver for gui events.
|
||||
/** Usually you do not have to
|
||||
use this method, it is used by the internal engine. */
|
||||
use this method, it is used by the engine internally.
|
||||
\param evr Pointer to the new receiver. */
|
||||
virtual void setUserEventReceiver(IEventReceiver* evr) = 0;
|
||||
|
||||
//! Returns pointer to the current gui skin.
|
||||
//! \return Pointer to the GUI skin.
|
||||
virtual IGUISkin* getSkin() const = 0;
|
||||
|
||||
//! Sets a new GUI Skin
|
||||
/** You can use this to change the appearance of the whole GUI Environment. You
|
||||
can set one of the built-in skins or implement your own class derived from
|
||||
IGUISkin and enable it using this method.
|
||||
To set for example the built-in Windows classic skin, use the following code:
|
||||
/** You can use this to change the appearance of the whole GUI
|
||||
Environment. You can set one of the built-in skins or implement your
|
||||
own class derived from IGUISkin and enable it using this method.
|
||||
To set for example the built-in Windows classic skin, use the following
|
||||
code:
|
||||
\code
|
||||
gui::IGUISkin* newskin = environment->createSkin(gui::EGST_WINDOWS_CLASSIC);
|
||||
environment->setSkin(newskin);
|
||||
newskin->drop();
|
||||
\endcode
|
||||
\param skin New skin to use.
|
||||
*/
|
||||
virtual void setSkin(IGUISkin* skin) = 0;
|
||||
|
||||
//! Creates a new GUI Skin based on a template.
|
||||
/** Use setSkin() to set the created skin.
|
||||
\return Returns a pointer to the created skin.
|
||||
\param type The type of the new skin.
|
||||
\return Pointer to the created skin.
|
||||
If you no longer need it, you should call IGUISkin::drop().
|
||||
See IReferenceCounted::drop() for more information. */
|
||||
virtual IGUISkin* createSkin(EGUI_SKIN_TYPE type) = 0;
|
||||
|
||||
//! Returns pointer to the font with the specified file name.
|
||||
/** Loads the font if it was not loaded before. Returns 0 if the font could not be loaded.
|
||||
\return
|
||||
returns a pointer to the font.
|
||||
This pointer should not be dropped. See IReferenceCounted::drop() for more information. */
|
||||
//! Returns pointer to the font with the specified filename.
|
||||
/** Loads the font if it was not loaded before.
|
||||
\param filename Filename of the Font.
|
||||
\return Pointer to the font. Returns 0 if the font could not be loaded.
|
||||
This pointer should not be dropped. See IReferenceCounted::drop() for
|
||||
more information. */
|
||||
virtual IGUIFont* getFont(const c8* filename) = 0;
|
||||
|
||||
//! Returns the default built-in font.
|
||||
/** \return Pointer to the default built-in font.
|
||||
This pointer should not be dropped. See IReferenceCounted::drop() for
|
||||
more information. */
|
||||
virtual IGUIFont* getBuiltInFont() const = 0;
|
||||
|
||||
//! Returns pointer to the sprite bank with the specified file name.
|
||||
/** Loads the bank if it was not loaded before. Returns 0 if it could not be loaded.
|
||||
\return
|
||||
returns a pointer to the sprite bank.
|
||||
//! Returns pointer to the sprite bank with the specified file name.
|
||||
/** Loads the bank if it was not loaded before.
|
||||
\param filename Filename of the sprite bank's origin.
|
||||
\return Pointer to the sprite bank. Returns 0 if it could not be loaded.
|
||||
This pointer should not be dropped. See IReferenceCounted::drop() for more information. */
|
||||
virtual IGUISpriteBank* getSpriteBank(const c8* filename) = 0;
|
||||
|
||||
//! adds an empty sprite bank to the manager
|
||||
//! Adds an empty sprite bank to the manager
|
||||
/** \param name Name of the new sprite bank.
|
||||
\return Pointer to the sprite bank.
|
||||
This pointer should not be dropped. See IReferenceCounted::drop() for more information. */
|
||||
virtual IGUISpriteBank* addEmptySpriteBank(const c8 *name) = 0;
|
||||
|
||||
//! Returns the root gui element.
|
||||
//! Returns the root gui element.
|
||||
/** This is the first gui element, parent of all other
|
||||
gui elements. You'll never need to use this method, unless you are not creating
|
||||
your own gui elements, trying to add them to the gui elements without a parent.
|
||||
The returned pointer should not be dropped. See IReferenceCounted::drop() for more information. */
|
||||
gui elements. You'll never need to use this method, unless you are
|
||||
creating your own gui elements, trying to add them to the gui elements
|
||||
without a parent.
|
||||
\return Pointer to the root element of the GUI. The returned pointer
|
||||
should not be dropped. See IReferenceCounted::drop() for more
|
||||
information. */
|
||||
virtual IGUIElement* getRootGUIElement() = 0;
|
||||
|
||||
//! Adds an button element.
|
||||
/** \return
|
||||
Returns a pointer to the created button. Returns 0 if an error occured.
|
||||
This pointer should not be dropped. See IReferenceCounted::drop() for more information. */
|
||||
//! Adds a button element.
|
||||
/** \param rectangle Position and dimension of the button.
|
||||
\param parent Parent gui element of the button.
|
||||
\param id Id with which the gui element can be identified.
|
||||
\param text Text displayed on the button.
|
||||
\param tooltiptext Text displayed in the tooltip.
|
||||
\return Pointer to the created button. Returns 0 if an error occured.
|
||||
This pointer should not be dropped. See IReferenceCounted::drop() for
|
||||
more information. */
|
||||
virtual IGUIButton* addButton(const core::rect<s32>& rectangle,
|
||||
IGUIElement* parent=0, s32 id=-1, const wchar_t* text=0, const wchar_t* tooltiptext = 0) = 0;
|
||||
|
||||
//! Adds an empty window element.
|
||||
/** \param modal: Defines if the dialog is modal. This means, that all other
|
||||
gui elements which were created before the message box cannot be used
|
||||
until this messagebox is removed.
|
||||
\return
|
||||
Returns a pointer to the created window. Returns 0 if an error occured.
|
||||
This pointer should not be dropped. See IReferenceCounted::drop() for more information. */
|
||||
virtual IGUIWindow* addWindow(const core::rect<s32>& rectangle, bool modal = false,
|
||||
//! Adds an empty window element.
|
||||
/** \param rectangle Position and dimension of the window.
|
||||
\param modal Defines if the dialog is modal. This means, that all other
|
||||
gui elements which were created before the window cannot be used until
|
||||
it is removed.
|
||||
\param text Text displayed as the window title.
|
||||
\param parent Parent gui element of the window.
|
||||
\param id Id with which the gui element can be identified.
|
||||
\return Pointer to the created window. Returns 0 if an error occured.
|
||||
This pointer should not be dropped. See IReferenceCounted::drop() for
|
||||
more information. */
|
||||
virtual IGUIWindow* addWindow(const core::rect<s32>& rectangle, bool modal = false,
|
||||
const wchar_t* text=0, IGUIElement* parent=0, s32 id=-1) = 0;
|
||||
|
||||
//! Adds a modal screen. This control stops its parent's members from being
|
||||
//! able to recieve input until its last child is removed, it then deletes its self.
|
||||
/** \return
|
||||
Returns a pointer to the created window. Returns 0 if an error occured.
|
||||
This pointer should not be dropped. See IReferenceCounted::drop() for more information. */
|
||||
//! Adds a modal screen. This control stops its parent's members from
|
||||
//! being able to recieve input until its last child is removed, it
|
||||
//! then deletes itself.
|
||||
/** \param parent Parent gui element of the modal.
|
||||
\return Pointer to the created modal. Returns 0 if an error occured.
|
||||
This pointer should not be dropped. See IReferenceCounted::drop() for
|
||||
more information. */
|
||||
virtual IGUIElement* addModalScreen(IGUIElement* parent) = 0;
|
||||
|
||||
//! Adds a message box.
|
||||
/** \param caption: Text to be displayed the title of the message box.
|
||||
\param text: Text to be displayed in the body of the message box.
|
||||
\param modal: Defines if the dialog is modal. This means, that all other
|
||||
gui elements which were created before the message box cannot be used
|
||||
until this messagebox is removed.
|
||||
\param flags: Flags specifying the layout of the message box. For example
|
||||
to create a message box with an OK and a CANCEL button on it, set this
|
||||
to (EMBF_OK | EMBF_CANCEL).
|
||||
\param parent: Parent gui element of the message box.
|
||||
\param id: Id with which the gui element can be identified.
|
||||
\return
|
||||
Returns a pointer to the created message box. Returns 0 if an error occured.
|
||||
This pointer should not be dropped. See IReferenceCounted::drop() for more information. */
|
||||
/** \param caption Text to be displayed the title of the message box.
|
||||
\param text Text to be displayed in the body of the message box.
|
||||
\param modal Defines if the dialog is modal. This means, that all other
|
||||
gui elements which were created before the message box cannot be used
|
||||
until this messagebox is removed.
|
||||
\param flags Flags specifying the layout of the message box. For example
|
||||
to create a message box with an OK and a CANCEL button on it, set this
|
||||
to (EMBF_OK | EMBF_CANCEL).
|
||||
\param parent Parent gui element of the message box.
|
||||
\param id Id with which the gui element can be identified.
|
||||
\return Pointer to the created message box. Returns 0 if an error
|
||||
occured. This pointer should not be dropped. See
|
||||
IReferenceCounted::drop() for more information. */
|
||||
virtual IGUIWindow* addMessageBox(const wchar_t* caption, const wchar_t* text=0,
|
||||
bool modal = true, s32 flags = EMBF_OK, IGUIElement* parent=0, s32 id=-1) = 0;
|
||||
|
||||
//! Adds a scrollbar.
|
||||
/** \return
|
||||
Returns a pointer to the created scrollbar. Returns 0 if an error occured.
|
||||
This pointer should not be dropped. See IReferenceCounted::drop() for more information. */
|
||||
//! Adds a scrollbar.
|
||||
/** \param horizontal Specifies if the scroll bar is drawn horizontal
|
||||
or vertical.
|
||||
\param rectangle Position and dimension of the scroll bar.
|
||||
\param parent Parent gui element of the scroll bar.
|
||||
\param id Id to identify the gui element.
|
||||
\return Pointer to the created scrollbar. Returns 0 if an error
|
||||
occured. This pointer should not be dropped. See
|
||||
IReferenceCounted::drop() for more information. */
|
||||
virtual IGUIScrollBar* addScrollBar(bool horizontal, const core::rect<s32>& rectangle,
|
||||
IGUIElement* parent=0, s32 id=-1) = 0;
|
||||
|
||||
//! Adds an image element.
|
||||
/** \param image: Image to be displayed.
|
||||
\param pos: Position of the image. The width and height of the image is taken
|
||||
from the image.
|
||||
\param useAlphaChannel: Sets if the image should use the alpha channel of the texture
|
||||
to draw itself.
|
||||
\return
|
||||
Returns a pointer to the created image element. Returns 0 if an error occured.
|
||||
This pointer should not be dropped. See IReferenceCounted::drop() for more information. */
|
||||
//! Adds an image element.
|
||||
/** \param image Image to be displayed.
|
||||
\param pos Position of the image. The width and height of the image is
|
||||
taken from the image.
|
||||
\param useAlphaChannel Sets if the image should use the alpha channel
|
||||
of the texture to draw itself.
|
||||
\param parent Parent gui element of the image.
|
||||
\param id Id to identify the gui element.
|
||||
\param text Title text of the image.
|
||||
\return Pointer to the created image element. Returns 0 if an error
|
||||
occured. This pointer should not be dropped. See
|
||||
IReferenceCounted::drop() for more information. */
|
||||
virtual IGUIImage* addImage(video::ITexture* image, core::position2d<s32> pos,
|
||||
bool useAlphaChannel=true, IGUIElement* parent=0, s32 id=-1, const wchar_t* text=0) = 0;
|
||||
|
||||
//! Adds an image element.
|
||||
/** Use IGUIImage::setImage later to set the image to be displayed.
|
||||
\return
|
||||
Returns a pointer to the created image element. Returns 0 if an error occured.
|
||||
This pointer should not be dropped. See IReferenceCounted::drop() for more information. */
|
||||
//! Adds an image element.
|
||||
/** Use IGUIImage::setImage later to set the image to be displayed.
|
||||
\param rectangle Position and dimension of the image.
|
||||
\param parent Parent gui element of the image.
|
||||
\param id Id to identify the gui element.
|
||||
\param text Title text of the image.
|
||||
\return Pointer to the created image element. Returns 0 if an error
|
||||
occured. This pointer should not be dropped. See
|
||||
IReferenceCounted::drop() for more information. */
|
||||
virtual IGUIImage* addImage(const core::rect<s32>& rectangle,
|
||||
IGUIElement* parent=0, s32 id=-1, const wchar_t* text=0) = 0;
|
||||
|
||||
//! Adds a checkbox element.
|
||||
/** \return
|
||||
Returns a pointer to the created check box. Returns 0 if an error occured.
|
||||
This pointer should not be dropped. See IReferenceCounted::drop() for more information. */
|
||||
/** \param checked Define the initial state of the check box.
|
||||
\param rectangle Position and dimension of check box.
|
||||
\param parent Parent gui element of the check box.
|
||||
\param id Id to identify the gui element.
|
||||
\param text Title text of the check box.
|
||||
\return Pointer to the created check box. Returns 0 if an error
|
||||
occured. This pointer should not be dropped. See
|
||||
IReferenceCounted::drop() for more information. */
|
||||
virtual IGUICheckBox* addCheckBox(bool checked, const core::rect<s32>& rectangle,
|
||||
IGUIElement* parent=0, s32 id=-1, const wchar_t* text=0) = 0;
|
||||
|
||||
//! Adds a list box element.
|
||||
/** \return
|
||||
Returns a pointer to the created list box. Returns 0 if an error occured.
|
||||
This pointer should not be dropped. See IReferenceCounted::drop() for more information. */
|
||||
virtual IGUIListBox* addListBox(const core::rect<s32>& rectangle,
|
||||
/** \param rectangle Position and dimension of list box.
|
||||
\param parent Parent gui element of the list box.
|
||||
\param id Id to identify the gui element.
|
||||
\param drawBackground Flag whether the background should be drawn.
|
||||
\return Pointer to the created list box. Returns 0 if an error occured.
|
||||
This pointer should not be dropped. See IReferenceCounted::drop() for
|
||||
more information. */
|
||||
virtual IGUIListBox* addListBox(const core::rect<s32>& rectangle,
|
||||
IGUIElement* parent=0, s32 id=-1, bool drawBackground=false) = 0;
|
||||
|
||||
//! Adds an mesh viewer. Not 100% implemented yet.
|
||||
/** \return
|
||||
Returns a pointer to the created mesh viewer. Returns 0 if an error occured.
|
||||
This pointer should not be dropped. See IReferenceCounted::drop() for more information. */
|
||||
//! Adds a mesh viewer. Not 100% implemented yet.
|
||||
/** \param rectangle Position and dimension of mesh viewer.
|
||||
\param parent Parent gui element of the mesh viewer.
|
||||
\param id Id to identify the gui element.
|
||||
\param text Title text of the mesh viewer.
|
||||
\return Pointer to the created mesh viewer. Returns 0 if an error
|
||||
occured. This pointer should not be dropped. See
|
||||
IReferenceCounted::drop() for more information. */
|
||||
virtual IGUIMeshViewer* addMeshViewer(const core::rect<s32>& rectangle,
|
||||
IGUIElement* parent=0, s32 id=-1, const wchar_t* text=0) = 0;
|
||||
|
||||
//! Adds a file open dialog.
|
||||
/** \param modal: Defines if the dialog is modal. This means, that all other
|
||||
gui elements which were created before the message box cannot be used
|
||||
until this messagebox is removed.
|
||||
\return
|
||||
Returns a pointer to the created file open dialog. Returns 0 if an error occured.
|
||||
This pointer should not be dropped. See IReferenceCounted::drop() for more information. */
|
||||
virtual IGUIFileOpenDialog* addFileOpenDialog(const wchar_t* title = 0,
|
||||
/** \param title Text to be displayed as the title of the dialog.
|
||||
\param modal Defines if the dialog is modal. This means, that all other
|
||||
gui elements which were created before the message box cannot be used
|
||||
until this messagebox is removed.
|
||||
\param parent Parent gui element of the dialog.
|
||||
\param id Id to identify the gui element.
|
||||
\return Pointer to the created file open dialog. Returns 0 if an error
|
||||
occured. This pointer should not be dropped. See
|
||||
IReferenceCounted::drop() for more information. */
|
||||
virtual IGUIFileOpenDialog* addFileOpenDialog(const wchar_t* title = 0,
|
||||
bool modal=true, IGUIElement* parent=0, s32 id=-1) = 0;
|
||||
|
||||
//! Adds a color select dialog.
|
||||
/** \param modal: Defines if the dialog is modal. This means, that all other
|
||||
gui elements which were created before the message box cannot be used
|
||||
until this messagebox is removed.
|
||||
\return
|
||||
Returns a pointer to the created file open dialog. Returns 0 if an error occured.
|
||||
This pointer should not be dropped. See IReferenceCounted::drop() for more information. */
|
||||
virtual IGUIColorSelectDialog* addColorSelectDialog(const wchar_t* title = 0,
|
||||
/** \param title The title of the dialog.
|
||||
\param modal Defines if the dialog is modal. This means, that all other
|
||||
gui elements which were created before the dialog cannot be used
|
||||
until it is removed.
|
||||
\param parent The parent of the dialog.
|
||||
\param id The ID of the dialog.
|
||||
\return Pointer to the created file open dialog. Returns 0 if an error
|
||||
occured. This pointer should not be dropped. See
|
||||
IReferenceCounted::drop() for more information. */
|
||||
virtual IGUIColorSelectDialog* addColorSelectDialog(const wchar_t* title = 0,
|
||||
bool modal=true, IGUIElement* parent=0, s32 id=-1) = 0;
|
||||
|
||||
//! Adds a static text.
|
||||
/** The returned pointer must not be dropped.
|
||||
\param text is the text to be displayed. Can be altered after creation with SetText().
|
||||
\param rectangle is the position of the static text.
|
||||
\param border has to be set to true if the static text should have a 3d border.
|
||||
\param wordWrap specifies, if the text should be wrapped into multiple lines.
|
||||
\param parent is the parent item of the element, e.g. a window.
|
||||
Set it to 0 to place the fader directly in the environment.
|
||||
\param id is a s32 to identify the static text element.
|
||||
\param fillBackground specifies if the background will be filled. Default: false.
|
||||
\return
|
||||
Returns a pointer to the created static text. Returns 0 if an error occured.
|
||||
This pointer should not be dropped. See IReferenceCounted::drop() for more information. */
|
||||
virtual IGUIStaticText* addStaticText(const wchar_t* text, const core::rect<s32>& rectangle,
|
||||
bool border=false, bool wordWrap=true, IGUIElement* parent=0, s32 id=-1,
|
||||
//! Adds a static text.
|
||||
/** \param text Text to be displayed. Can be altered after creation by SetText().
|
||||
\param rectangle Position and dimension of the static text.
|
||||
\param border Set to true if the static text should have a 3d border.
|
||||
\param wordWrap Enable if the text should wrap into multiple lines.
|
||||
\param parent Parent item of the element, e.g. a window.
|
||||
\param id The ID of the element.
|
||||
\param fillBackground Enable if the background shall be filled.
|
||||
Defaults to false.
|
||||
\return Pointer to the created static text. Returns 0 if an error
|
||||
occured. This pointer should not be dropped. See
|
||||
IReferenceCounted::drop() for more information. */
|
||||
virtual IGUIStaticText* addStaticText(const wchar_t* text, const core::rect<s32>& rectangle,
|
||||
bool border=false, bool wordWrap=true, IGUIElement* parent=0, s32 id=-1,
|
||||
bool fillBackground = false) = 0;
|
||||
|
||||
//! Adds an edit box.
|
||||
/** Supports unicode input from every keyboard around the world,
|
||||
scrolling, copying and pasting (exchanging data with the clipboard directly), maximum
|
||||
character amount, marking and all shortcuts like ctrl+X, ctrl+V, ctrg+C,
|
||||
shift+Left, shift+Right, Home, End, and so on.
|
||||
\param text is the text to be displayed. Can be altered after creation with setText().
|
||||
\param rectangle is the position of the edit box.
|
||||
\param border has to be set to true if the edit box should have a 3d border.
|
||||
\param parent is the parent item of the element, e.g. a window.
|
||||
Set it to 0 to place the edit box directly in the environment.
|
||||
\param id is a s32 to identify the edit box.
|
||||
\return
|
||||
Returns a pointer to the created edit box. Returns 0 if an error occured.
|
||||
This pointer should not be dropped. See IReferenceCounted::drop() for more information. */
|
||||
virtual IGUIEditBox* addEditBox(const wchar_t* text, const core::rect<s32>& rectangle,
|
||||
//! Adds an edit box.
|
||||
/** Supports unicode input from every keyboard around the world,
|
||||
scrolling, copying and pasting (exchanging data with the clipboard
|
||||
directly), maximum character amount, marking, and all shortcuts like
|
||||
ctrl+X, ctrl+V, ctrl+C, shift+Left, shift+Right, Home, End, and so on.
|
||||
\param text Text to be displayed. Can be altered after creation
|
||||
by setText().
|
||||
\param rectangle Position and dimension of the edit box.
|
||||
\param border Set to true if the edit box should have a 3d border.
|
||||
\param parent Parent item of the element, e.g. a window.
|
||||
Set it to 0 to place the edit box directly in the environment.
|
||||
\param id The ID of the element.
|
||||
\return Pointer to the created edit box. Returns 0 if an error occured.
|
||||
This pointer should not be dropped. See IReferenceCounted::drop() for
|
||||
more information. */
|
||||
virtual IGUIEditBox* addEditBox(const wchar_t* text, const core::rect<s32>& rectangle,
|
||||
bool border=true, IGUIElement* parent=0, s32 id=-1) = 0;
|
||||
|
||||
//! Adds a spin box.
|
||||
/** An edit box with up and down buttons
|
||||
\param text is the text to be displayed. Can be altered after creation with setText().
|
||||
\param rectangle is the position of the spin box.
|
||||
\param parent is the parent item of the element, e.g. a window.
|
||||
Set it to 0 to place the spin box directly in the environment.
|
||||
\param id is a s32 to identify the spin box.
|
||||
\return
|
||||
Returns a pointer to the created spin box. Returns 0 if an error occured.
|
||||
This pointer should not be dropped. See IReferenceCounted::drop() for more information. */
|
||||
virtual IGUISpinBox* addSpinBox(const wchar_t* text, const core::rect<s32>& rectangle,
|
||||
//! Adds a spin box.
|
||||
/** An edit box with up and down buttons
|
||||
\param text Text to be displayed. Can be altered after creation by setText().
|
||||
\param rectangle Position and dimension of the spin box.
|
||||
\param parent Parent item of the element, e.g. a window.
|
||||
Set it to 0 to place the spin box directly in the environment.
|
||||
\param id The ID of the element.
|
||||
\return Pointer to the created spin box. Returns 0 if an error occured.
|
||||
This pointer should not be dropped. See IReferenceCounted::drop() for
|
||||
more information. */
|
||||
virtual IGUISpinBox* addSpinBox(const wchar_t* text, const core::rect<s32>& rectangle,
|
||||
IGUIElement* parent=0, s32 id=-1) = 0;
|
||||
|
||||
//! Adds an element for fading in or out.
|
||||
/* \param rectangle: Pointer to rectangle specifing the borders of the element.
|
||||
If the pointer is NULL, the whole screen is used.
|
||||
\param parent: Parent item of the element, e.g. a window.
|
||||
Set it to 0 to place the static text directly in the environment.
|
||||
\param id: A s32 to identify the text.
|
||||
\return
|
||||
Returns a pointer to the created in-out-fader. Returns 0 if an error occured.
|
||||
This pointer should not be dropped. See IReferenceCounted::drop() for more information. */
|
||||
/* \param rectangle Rectangle specifying the borders of the element.
|
||||
If the pointer is NULL, the whole screen is used.
|
||||
\param parent Parent item of the element, e.g. a window.
|
||||
\param id An identifier for the fader.
|
||||
\return Pointer to the created in-out-fader. Returns 0 if an error
|
||||
occured. This pointer should not be dropped. See
|
||||
IReferenceCounted::drop() for more information. */
|
||||
virtual IGUIInOutFader* addInOutFader(const core::rect<s32>* rectangle=0, IGUIElement* parent=0, s32 id=-1) = 0;
|
||||
|
||||
//! Adds a tab control to the environment.
|
||||
/** \param rectangle is the position of the tab control.
|
||||
\param parent is the parent item of the element, e.g. a window.
|
||||
Set it to 0 to place the tab control directly in the environment.
|
||||
\param fillbackground specifies if the background of the tab control should be drawn to.
|
||||
\param border specifiys if a flat 3d border should be drawn. This is
|
||||
usually not necesarry unless you don't place the control directly into
|
||||
the environment without a window as parent.
|
||||
\param id is a s32 to identify the tab control.
|
||||
\return
|
||||
Returns a pointer to the created tab control element. Returns 0 if an error occured.
|
||||
This pointer should not be dropped. See IReferenceCounted::drop() for more information. */
|
||||
/** \param rectangle Position and dimension of the tab control.
|
||||
\param parent Parent item of the element, e.g. a window.
|
||||
Set it to 0 to place the tab control directly in the environment.
|
||||
\param fillbackground Specifies if the background of the tab control
|
||||
should be drawn.
|
||||
\param border Specifies if a flat 3d border should be drawn. This is
|
||||
usually not necessary unless you place the control directly into
|
||||
the environment without a window as parent.
|
||||
\param id An identifier for the tab control.
|
||||
\return Pointer to the created tab control element. Returns 0 if an
|
||||
error occured. This pointer should not be dropped. See
|
||||
IReferenceCounted::drop() for more information. */
|
||||
virtual IGUITabControl* addTabControl(const core::rect<s32>& rectangle,
|
||||
IGUIElement* parent=0, bool fillbackground=false,
|
||||
bool border=true, s32 id=-1) = 0;
|
||||
|
||||
//! Adds tab to the environment.
|
||||
/** You can use this element to group other elements. This is not used for creating tabs on tab controls,
|
||||
please use IGUITabControl::addTab() for this instead.
|
||||
\param rectangle is the position of the tab.
|
||||
\param parent is the parent item of the element, e.g. a window.
|
||||
Set it to 0 to place the tab directly in the environment.
|
||||
\param id is a s32 to identify the tab. */
|
||||
//! Adds tab to the environment.
|
||||
/** You can use this element to group other elements. This is not used
|
||||
for creating tabs on tab controls, please use IGUITabControl::addTab()
|
||||
for this instead.
|
||||
\param rectangle Position and dimension of the tab.
|
||||
\param parent Parent item of the element, e.g. a window.
|
||||
Set it to 0 to place the tab directly in the environment.
|
||||
\param id An identifier for the tab.
|
||||
\return Pointer to the created tab. Returns 0 if an
|
||||
error occured. This pointer should not be dropped. See
|
||||
IReferenceCounted::drop() for more information. */
|
||||
virtual IGUITab* addTab(const core::rect<s32>& rectangle,
|
||||
IGUIElement* parent=0, s32 id=-1) = 0;
|
||||
|
||||
//! Adds a context menu to the environment.
|
||||
/** \param rectangle is the position of the menu. Note that the menu is
|
||||
resizing itself based on what items you add.
|
||||
\param parent is the parent item of the element, e.g. a window.
|
||||
Set it to 0 to place the menu directly in the environment.
|
||||
\param id is a s32 to identify the menu. */
|
||||
/** \param rectangle Position and dimension of the menu. Note that the
|
||||
menu is resizing itself based on what items you add.
|
||||
\param parent Parent item of the element, e.g. a window.
|
||||
Set it to 0 to place the menu directly in the environment.
|
||||
\param id An identifier for the menu.
|
||||
\return Pointer to the created context menu. Returns 0 if an
|
||||
error occured. This pointer should not be dropped. See
|
||||
IReferenceCounted::drop() for more information. */
|
||||
virtual IGUIContextMenu* addContextMenu(const core::rect<s32>& rectangle,
|
||||
IGUIElement* parent=0, s32 id=-1) = 0;
|
||||
|
||||
//! Adds a menu to the environment.
|
||||
/* This is like the menu you can find on top of most windows in modern graphical user interfaces.
|
||||
\param parent is the parent item of the element, e.g. a window.
|
||||
Set it to 0 to place the menu directly in the environment.
|
||||
\param id is a s32 to identify the menu. */
|
||||
/* This is like the menu you can find on top of most windows in modern
|
||||
graphical user interfaces.
|
||||
\param parent Parent item of the element, e.g. a window.
|
||||
Set it to 0 to place the menu directly in the environment.
|
||||
\param id An identifier for the menu.
|
||||
\return Pointer to the created menu. Returns 0 if an
|
||||
error occured. This pointer should not be dropped. See
|
||||
IReferenceCounted::drop() for more information. */
|
||||
virtual IGUIContextMenu* addMenu(IGUIElement* parent=0, s32 id=-1) = 0;
|
||||
|
||||
//! Adds a toolbar to the environment.
|
||||
/** It is like a menu is always placed on top
|
||||
in its parent, and contains buttons.
|
||||
\param parent is the parent item of the element, e.g. a window.
|
||||
Set it to 0 to place the tool bar directly in the environment.
|
||||
\param id is a s32 to identify the tool bar. */
|
||||
/** It is like a menu that is always placed on top of its parent, and
|
||||
contains buttons.
|
||||
\param parent Parent item of the element, e.g. a window.
|
||||
Set it to 0 to place the tool bar directly in the environment.
|
||||
\param id An identifier for the tool bar.
|
||||
\return Pointer to the created tool bar. Returns 0 if an
|
||||
error occured. This pointer should not be dropped. See
|
||||
IReferenceCounted::drop() for more information. */
|
||||
virtual IGUIToolBar* addToolBar(IGUIElement* parent=0, s32 id=-1) = 0;
|
||||
|
||||
//! Adds a combo box to the environment.
|
||||
/** \param parent is the parent item of the element, e.g. a window.
|
||||
Set it to 0 to place the combo box directly in the environment.
|
||||
\param id is a s32 to identify the combo box. */
|
||||
/** \param rectangle Position and dimension of the combo box.
|
||||
\param parent Parent item of the element, e.g. a window.
|
||||
Set it to 0 to place the combo box directly in the environment.
|
||||
\param id An identifier for the combo box.
|
||||
\return Pointer to the created combo box. Returns 0 if an
|
||||
error occured. This pointer should not be dropped. See
|
||||
IReferenceCounted::drop() for more information. */
|
||||
virtual IGUIComboBox* addComboBox(const core::rect<s32>& rectangle,
|
||||
IGUIElement* parent=0, s32 id=-1) = 0;
|
||||
|
||||
@ -387,14 +474,20 @@ public:
|
||||
IGUIElement* parent=0, s32 id=-1, bool drawBackground = false) = 0;
|
||||
|
||||
//! Returns the default element factory which can create all built in elements
|
||||
/** \return Pointer to the factory.
|
||||
This pointer should not be dropped. See IReferenceCounted::drop() for
|
||||
more information. */
|
||||
virtual IGUIElementFactory* getDefaultGUIElementFactory() const = 0;
|
||||
|
||||
//! Adds an element factory to the gui environment.
|
||||
/** Use this to extend the gui environment with new element types which it should be
|
||||
able to create automaticly, for example when loading data from xml files. */
|
||||
/** Use this to extend the gui environment with new element types which
|
||||
it should be able to create automatically, for example when loading
|
||||
data from xml files.
|
||||
\param factoryToAdd Pointer to new factory. */
|
||||
virtual void registerGUIElementFactory(IGUIElementFactory* factoryToAdd) = 0;
|
||||
|
||||
//! Returns amount of registered gui element factories.
|
||||
//! \return Amount of registered gui element factories.
|
||||
virtual u32 getRegisteredGUIElementFactoryCount() const = 0;
|
||||
|
||||
//! Returns a gui element factory by index
|
||||
@ -404,24 +497,24 @@ public:
|
||||
virtual IGUIElement* addGUIElement(const c8* elementName, IGUIElement* parent=0) = 0;
|
||||
|
||||
//! Saves the current gui into a file.
|
||||
//! \param filename: Name of the file.
|
||||
//! \param start: The GUIElement to start with. Root if 0.
|
||||
//! \param filename Name of the file.
|
||||
//! \param start The GUIElement to start with. Root if 0.
|
||||
virtual bool saveGUI(const c8* filename, IGUIElement* start=0) = 0;
|
||||
|
||||
//! Saves the current gui into a file.
|
||||
//! \param file: The file to write to.
|
||||
//! \param start: The GUIElement to start with. Root if 0.
|
||||
//! \param file The file to write to.
|
||||
//! \param start The GUIElement to start with. Root if 0.
|
||||
virtual bool saveGUI(io::IWriteFile* file, IGUIElement* start=0) = 0;
|
||||
|
||||
//! Loads the gui. Note that the current gui is not cleared before.
|
||||
//! \param filename: Name of the file .
|
||||
//! \param parent: Parent for the loaded GUI, root if 0.
|
||||
//! \param filename Name of the file .
|
||||
//! \param parent Parent for the loaded GUI, root if 0.
|
||||
virtual bool loadGUI(const c8* filename, IGUIElement* parent=0) = 0;
|
||||
|
||||
//! Loads the gui. Note that the current gui is not cleared before.
|
||||
//! \param file: The file to load from.
|
||||
//! \param parent: Parent for the loaded GUI, root if 0.
|
||||
virtual bool loadGUI(io::IReadFile* file, IGUIElement* parent=0) = 0;
|
||||
//! \param file The file to load from.
|
||||
//! \param parent Parent for the loaded GUI, root if 0.
|
||||
virtual bool loadGUI(io::IReadFile* file, IGUIElement* parent=0) = 0;
|
||||
|
||||
//! Writes attributes of the gui environment
|
||||
virtual void serializeAttributes(io::IAttributes* out, io::SAttributeReadWriteOptions* options=0) const =0;
|
||||
|
@ -1,4 +1,4 @@
|
||||
// Copyright (C) 2002-2007 Nikolaus Gebhardt
|
||||
// Copyright (C) 2002-2008 Nikolaus Gebhardt
|
||||
// This file is part of the "Irrlicht Engine".
|
||||
// For conditions of distribution and use, see copyright notice in irrlicht.h
|
||||
|
||||
|
@ -1,4 +1,4 @@
|
||||
// Copyright (C) 2002-2007 Nikolaus Gebhardt
|
||||
// Copyright (C) 2002-2008 Nikolaus Gebhardt
|
||||
// This file is part of the "Irrlicht Engine".
|
||||
// For conditions of distribution and use, see copyright notice in irrlicht.h
|
||||
|
||||
@ -20,8 +20,8 @@ enum EGUI_FONT_TYPE
|
||||
//! Bitmap fonts loaded from an XML file or a texture.
|
||||
EGFT_BITMAP = 0,
|
||||
|
||||
//! Scalable vector fonts loaded from an XML file.
|
||||
//! These fonts reside in system memory and use no video memory
|
||||
//! Scalable vector fonts loaded from an XML file.
|
||||
//! These fonts reside in system memory and use no video memory
|
||||
//! until they are displayed. These are slower than bitmap fonts
|
||||
//! but can be easily scaled and rotated.
|
||||
EGFT_VECTOR,
|
||||
@ -44,19 +44,19 @@ public:
|
||||
|
||||
//! Draws an text and clips it to the specified rectangle if wanted.
|
||||
/** \param text: Text to draw
|
||||
\param position: Rectangle specifying position where to draw the text.
|
||||
\param color: Color of the text
|
||||
\param hcenter: Specifiies if the text should be centered horizontally into the rectangle.
|
||||
\param vcenter: Specifiies if the text should be centered vertically into the rectangle.
|
||||
\param clip: Optional pointer to a rectangle against which the text will be clipped.
|
||||
If the pointer is null, no clipping will be done. */
|
||||
virtual void draw(const wchar_t* text, const core::rect<s32>& position,
|
||||
\param position: Rectangle specifying position where to draw the text.
|
||||
\param color: Color of the text
|
||||
\param hcenter: Specifiies if the text should be centered horizontally into the rectangle.
|
||||
\param vcenter: Specifiies if the text should be centered vertically into the rectangle.
|
||||
\param clip: Optional pointer to a rectangle against which the text will be clipped.
|
||||
If the pointer is null, no clipping will be done. */
|
||||
virtual void draw(const wchar_t* text, const core::rect<s32>& position,
|
||||
video::SColor color, bool hcenter=false, bool vcenter=false,
|
||||
const core::rect<s32>* clip=0) = 0;
|
||||
|
||||
//! Calculates the dimension of a text.
|
||||
/** \return Returns width and height of the area covered by the text if it would be
|
||||
drawn. */
|
||||
/** \return Returns width and height of the area covered by the text if
|
||||
it would be drawn. */
|
||||
virtual core::dimension2d<s32> getDimension(const wchar_t* text) const = 0;
|
||||
|
||||
//! Calculates the index of the character in the text which is on a specific position.
|
||||
@ -79,7 +79,7 @@ public:
|
||||
to the global kerning value. For example, a space might only be one pixel wide, but it may
|
||||
be displayed as several pixels.
|
||||
\param previousLetter: If provided, kerning is calculated for both letters and added to the global
|
||||
kerning value. For example, in a font which supports kerning pairs a string such as 'Wo' may have
|
||||
kerning value. For example, in a font which supports kerning pairs a string such as 'Wo' may have
|
||||
the 'o' tucked neatly under the 'W'.
|
||||
*/
|
||||
virtual s32 getKerningWidth(const wchar_t* thisLetter=0, const wchar_t* previousLetter=0) const = 0;
|
||||
|
@ -1,4 +1,4 @@
|
||||
// Copyright (C) 2002-2007 Nikolaus Gebhardt
|
||||
// Copyright (C) 2002-2008 Nikolaus Gebhardt
|
||||
// This file is part of the "Irrlicht Engine".
|
||||
// For conditions of distribution and use, see copyright notice in irrlicht.h
|
||||
|
||||
|
@ -1,4 +1,4 @@
|
||||
// Copyright (C) 2002-2007 Nikolaus Gebhardt
|
||||
// Copyright (C) 2002-2008 Nikolaus Gebhardt
|
||||
// This file is part of the "Irrlicht Engine".
|
||||
// For conditions of distribution and use, see copyright notice in irrlicht.h
|
||||
|
||||
|
@ -1,4 +1,4 @@
|
||||
// Copyright (C) 2002-2007 Nikolaus Gebhardt
|
||||
// Copyright (C) 2002-2008 Nikolaus Gebhardt
|
||||
// This file is part of the "Irrlicht Engine".
|
||||
// For conditions of distribution and use, see copyright notice in irrlicht.h
|
||||
|
||||
@ -14,7 +14,7 @@ namespace gui
|
||||
{
|
||||
|
||||
//! Element for fading out or in
|
||||
/** Here is a small example on how the class is used. In this example we fade
|
||||
/** Here is a small example on how the class is used. In this example we fade
|
||||
in from a total red screen in the beginning. As you can see, the fader is not
|
||||
only useful for dramatic in and out fading, but also to show that the player
|
||||
is hit in a first person shooter game for example.
|
||||
|
@ -1,4 +1,4 @@
|
||||
// Copyright (C) 2002-2007 Nikolaus Gebhardt
|
||||
// Copyright (C) 2002-2008 Nikolaus Gebhardt
|
||||
// This file is part of the "Irrlicht Engine".
|
||||
// For conditions of distribution and use, see copyright notice in irrlicht.h
|
||||
|
||||
@ -95,22 +95,22 @@ namespace gui
|
||||
//! clear all item colors at index
|
||||
virtual void clearItemOverrideColor(u32 index) = 0;
|
||||
|
||||
//! clear item color at index for given colortype
|
||||
//! clear item color at index for given colortype
|
||||
virtual void clearItemOverrideColor(u32 index, EGUI_LISTBOX_COLOR colorType) = 0;
|
||||
|
||||
//! has the item at index it's color overwritten?
|
||||
virtual bool hasItemOverrideColor(u32 index, EGUI_LISTBOX_COLOR colorType) const = 0;
|
||||
|
||||
//! return the overwrite color at given item index.
|
||||
//! return the overwrite color at given item index.
|
||||
virtual video::SColor getItemOverrideColor(u32 index, EGUI_LISTBOX_COLOR colorType) const = 0;
|
||||
|
||||
//! return the default color which is used for the given colorType
|
||||
virtual video::SColor getItemDefaultColor(EGUI_LISTBOX_COLOR colorType) const = 0;
|
||||
|
||||
//! set the item at the given index
|
||||
//! set the item at the given index
|
||||
virtual void setItem(u32 index, const wchar_t* text, s32 icon) = 0;
|
||||
|
||||
//! Insert the item at the given index
|
||||
//! Insert the item at the given index
|
||||
//! Return the index on success or -1 on failure.
|
||||
virtual s32 insertItem(u32 index, const wchar_t* text, s32 icon) = 0;
|
||||
|
||||
|
@ -1,4 +1,4 @@
|
||||
// Copyright (C) 2002-2007 Nikolaus Gebhardt
|
||||
// Copyright (C) 2002-2008 Nikolaus Gebhardt
|
||||
// This file is part of the "Irrlicht Engine".
|
||||
// For conditions of distribution and use, see copyright notice in irrlicht.h
|
||||
|
||||
|
@ -1,4 +1,4 @@
|
||||
// Copyright (C) 2002-2007 Nikolaus Gebhardt
|
||||
// Copyright (C) 2002-2008 Nikolaus Gebhardt
|
||||
// This file is part of the "Irrlicht Engine".
|
||||
// For conditions of distribution and use, see copyright notice in irrlicht.h
|
||||
|
||||
|
@ -1,4 +1,4 @@
|
||||
// Copyright (C) 2002-2007 Nikolaus Gebhardt
|
||||
// Copyright (C) 2002-2008 Nikolaus Gebhardt
|
||||
// This file is part of the "Irrlicht Engine".
|
||||
// For conditions of distribution and use, see copyright notice in irrlicht.h
|
||||
|
||||
@ -271,7 +271,7 @@ namespace gui
|
||||
"windowRestore",
|
||||
"windowClose",
|
||||
"windowMinimize",
|
||||
"windowResize",
|
||||
"windowResize",
|
||||
"cursorUp",
|
||||
"cursorDown",
|
||||
"cursorLeft",
|
||||
@ -338,7 +338,7 @@ namespace gui
|
||||
//! returns size for the given size type
|
||||
virtual s32 getSize(EGUI_DEFAULT_SIZE size) const = 0;
|
||||
|
||||
//! Returns a default text.
|
||||
//! Returns a default text.
|
||||
/** For example for Message box button captions:
|
||||
"OK", "Cancel", "Yes", "No" and so on. */
|
||||
virtual const wchar_t* getDefaultText(EGUI_DEFAULT_TEXT text) const = 0;
|
||||
@ -368,50 +368,50 @@ namespace gui
|
||||
virtual u32 getIcon(EGUI_DEFAULT_ICON icon) const = 0;
|
||||
|
||||
//! Sets a default icon
|
||||
/** Sets the sprite index used for drawing icons like arrows,
|
||||
close buttons and ticks in checkboxes
|
||||
/** Sets the sprite index used for drawing icons like arrows,
|
||||
close buttons and ticks in checkboxes
|
||||
\param icon: Enum specifying which icon to change
|
||||
\param index: The sprite index used to draw this icon */
|
||||
virtual void setIcon(EGUI_DEFAULT_ICON icon, u32 index) = 0;
|
||||
|
||||
//! draws a standard 3d button pane
|
||||
/** Used for drawing for example buttons in normal state.
|
||||
/** Used for drawing for example buttons in normal state.
|
||||
It uses the colors EGDC_3D_DARK_SHADOW, EGDC_3D_HIGH_LIGHT, EGDC_3D_SHADOW and
|
||||
EGDC_3D_FACE for this. See EGUI_DEFAULT_COLOR for details.
|
||||
EGDC_3D_FACE for this. See EGUI_DEFAULT_COLOR for details.
|
||||
\param element: Pointer to the element which wishes to draw this. This parameter
|
||||
is usually not used by IGUISkin, but can be used for example by more complex
|
||||
implementations to find out how to draw the part exactly.
|
||||
is usually not used by IGUISkin, but can be used for example by more complex
|
||||
implementations to find out how to draw the part exactly.
|
||||
\param rect: Defining area where to draw.
|
||||
\param clip: Clip area. */
|
||||
\param clip: Clip area. */
|
||||
virtual void draw3DButtonPaneStandard(IGUIElement* element,
|
||||
const core::rect<s32>& rect,
|
||||
const core::rect<s32>* clip=0) = 0;
|
||||
|
||||
//! draws a pressed 3d button pane
|
||||
/** Used for drawing for example buttons in pressed state.
|
||||
/** Used for drawing for example buttons in pressed state.
|
||||
It uses the colors EGDC_3D_DARK_SHADOW, EGDC_3D_HIGH_LIGHT, EGDC_3D_SHADOW and
|
||||
EGDC_3D_FACE for this. See EGUI_DEFAULT_COLOR for details.
|
||||
EGDC_3D_FACE for this. See EGUI_DEFAULT_COLOR for details.
|
||||
\param element: Pointer to the element which wishes to draw this. This parameter
|
||||
is usually not used by IGUISkin, but can be used for example by more complex
|
||||
implementations to find out how to draw the part exactly.
|
||||
is usually not used by IGUISkin, but can be used for example by more complex
|
||||
implementations to find out how to draw the part exactly.
|
||||
\param rect: Defining area where to draw.
|
||||
\param clip: Clip area. */
|
||||
virtual void draw3DButtonPanePressed(IGUIElement* element,
|
||||
\param clip: Clip area. */
|
||||
virtual void draw3DButtonPanePressed(IGUIElement* element,
|
||||
const core::rect<s32>& rect,
|
||||
const core::rect<s32>* clip=0) = 0;
|
||||
|
||||
//! draws a sunken 3d pane
|
||||
/** Used for drawing the background of edit, combo or check boxes.
|
||||
\param element: Pointer to the element which wishes to draw this. This parameter
|
||||
is usually not used by IGUISkin, but can be used for example by more complex
|
||||
implementations to find out how to draw the part exactly.
|
||||
is usually not used by IGUISkin, but can be used for example by more complex
|
||||
implementations to find out how to draw the part exactly.
|
||||
\param bgcolor: Background color.
|
||||
\param flat: Specifies if the sunken pane should be flat or displayed as sunken
|
||||
deep into the ground.
|
||||
\param flat: Specifies if the sunken pane should be flat or displayed as sunken
|
||||
deep into the ground.
|
||||
\param fillBackGround: Specifies if the background should be filled with the background
|
||||
color or not be drawn at all.
|
||||
\param rect: Defining area where to draw.
|
||||
\param clip: Clip area. */
|
||||
\param clip: Clip area. */
|
||||
virtual void draw3DSunkenPane(IGUIElement* element,
|
||||
video::SColor bgcolor, bool flat, bool fillBackGround,
|
||||
const core::rect<s32>& rect,
|
||||
@ -420,12 +420,12 @@ namespace gui
|
||||
//! draws a window background
|
||||
/** Used for drawing the background of dialogs and windows.
|
||||
\param element: Pointer to the element which wishes to draw this. This parameter
|
||||
is usually not used by IGUISkin, but can be used for example by more complex
|
||||
implementations to find out how to draw the part exactly.
|
||||
is usually not used by IGUISkin, but can be used for example by more complex
|
||||
implementations to find out how to draw the part exactly.
|
||||
\param titleBarColor: Title color.
|
||||
\param drawTitleBar: True to enable title drawing.
|
||||
\param rect: Defining area where to draw.
|
||||
\param clip: Clip area.
|
||||
\param clip: Clip area.
|
||||
\return Returns rect where it would be good to draw title bar text. */
|
||||
virtual core::rect<s32> draw3DWindowBackground(IGUIElement* element,
|
||||
bool drawTitleBar, video::SColor titleBarColor,
|
||||
@ -433,75 +433,75 @@ namespace gui
|
||||
const core::rect<s32>* clip=0) = 0;
|
||||
|
||||
//! draws a standard 3d menu pane
|
||||
/** Used for drawing for menus and context menus.
|
||||
/** Used for drawing for menus and context menus.
|
||||
It uses the colors EGDC_3D_DARK_SHADOW, EGDC_3D_HIGH_LIGHT, EGDC_3D_SHADOW and
|
||||
EGDC_3D_FACE for this. See EGUI_DEFAULT_COLOR for details.
|
||||
EGDC_3D_FACE for this. See EGUI_DEFAULT_COLOR for details.
|
||||
\param element: Pointer to the element which wishes to draw this. This parameter
|
||||
is usually not used by IGUISkin, but can be used for example by more complex
|
||||
implementations to find out how to draw the part exactly.
|
||||
is usually not used by IGUISkin, but can be used for example by more complex
|
||||
implementations to find out how to draw the part exactly.
|
||||
\param rect: Defining area where to draw.
|
||||
\param clip: Clip area. */
|
||||
\param clip: Clip area. */
|
||||
virtual void draw3DMenuPane(IGUIElement* element,
|
||||
const core::rect<s32>& rect,
|
||||
const core::rect<s32>* clip=0) = 0;
|
||||
|
||||
//! draws a standard 3d tool bar
|
||||
/** Used for drawing for toolbars and menus.
|
||||
/** Used for drawing for toolbars and menus.
|
||||
\param element: Pointer to the element which wishes to draw this. This parameter
|
||||
is usually not used by IGUISkin, but can be used for example by more complex
|
||||
implementations to find out how to draw the part exactly.
|
||||
is usually not used by IGUISkin, but can be used for example by more complex
|
||||
implementations to find out how to draw the part exactly.
|
||||
\param rect: Defining area where to draw.
|
||||
\param clip: Clip area. */
|
||||
\param clip: Clip area. */
|
||||
virtual void draw3DToolBar(IGUIElement* element,
|
||||
const core::rect<s32>& rect,
|
||||
const core::rect<s32>* clip=0) = 0;
|
||||
|
||||
//! draws a tab button
|
||||
/** Used for drawing for tab buttons on top of tabs.
|
||||
/** Used for drawing for tab buttons on top of tabs.
|
||||
\param element: Pointer to the element which wishes to draw this. This parameter
|
||||
is usually not used by IGUISkin, but can be used for example by more complex
|
||||
implementations to find out how to draw the part exactly.
|
||||
is usually not used by IGUISkin, but can be used for example by more complex
|
||||
implementations to find out how to draw the part exactly.
|
||||
\param active: Specifies if the tab is currently active.
|
||||
\param rect: Defining area where to draw.
|
||||
\param clip: Clip area. */
|
||||
\param clip: Clip area. */
|
||||
virtual void draw3DTabButton(IGUIElement* element, bool active,
|
||||
const core::rect<s32>& rect, const core::rect<s32>* clip=0, gui::EGUI_ALIGNMENT alignment=EGUIA_UPPERLEFT) = 0;
|
||||
|
||||
//! draws a tab control body
|
||||
/** \param element: Pointer to the element which wishes to draw this. This parameter
|
||||
is usually not used by IGUISkin, but can be used for example by more complex
|
||||
implementations to find out how to draw the part exactly.
|
||||
/** \param element: Pointer to the element which wishes to draw this. This parameter
|
||||
is usually not used by IGUISkin, but can be used for example by more complex
|
||||
implementations to find out how to draw the part exactly.
|
||||
\param border: Specifies if the border should be drawn.
|
||||
\param background: Specifies if the background should be drawn.
|
||||
\param rect: Defining area where to draw.
|
||||
\param clip: Clip area. */
|
||||
\param clip: Clip area. */
|
||||
virtual void draw3DTabBody(IGUIElement* element, bool border, bool background,
|
||||
const core::rect<s32>& rect, const core::rect<s32>* clip=0, s32 tabHeight=-1, gui::EGUI_ALIGNMENT alignment=EGUIA_UPPERLEFT ) = 0;
|
||||
|
||||
//! draws an icon, usually from the skin's sprite bank
|
||||
/** \param element: Pointer to the element which wishes to draw this icon.
|
||||
This parameter is usually not used by IGUISkin, but can be used for example
|
||||
by more complex implementations to find out how to draw the part exactly.
|
||||
/** \param element: Pointer to the element which wishes to draw this icon.
|
||||
This parameter is usually not used by IGUISkin, but can be used for example
|
||||
by more complex implementations to find out how to draw the part exactly.
|
||||
\param icon: Specifies the icon to be drawn.
|
||||
\param position: The position to draw the icon
|
||||
\param starttime: The time at the start of the animation
|
||||
\param currenttime: The present time, used to calculate the frame number
|
||||
\param loop: Whether the animation should loop or not
|
||||
\param clip: Clip area. */
|
||||
\param clip: Clip area. */
|
||||
virtual void drawIcon(IGUIElement* element, EGUI_DEFAULT_ICON icon,
|
||||
const core::position2di position, u32 starttime=0, u32 currenttime=0,
|
||||
const core::position2di position, u32 starttime=0, u32 currenttime=0,
|
||||
bool loop=false, const core::rect<s32>* clip=0) = 0;
|
||||
|
||||
//! draws a 2d rectangle.
|
||||
/** \param element: Pointer to the element which wishes to draw this icon.
|
||||
This parameter is usually not used by IGUISkin, but can be used for example
|
||||
by more complex implementations to find out how to draw the part exactly.
|
||||
\param color: Color of the rectangle to draw. The alpha component specifies how
|
||||
/** \param element: Pointer to the element which wishes to draw this icon.
|
||||
This parameter is usually not used by IGUISkin, but can be used for example
|
||||
by more complex implementations to find out how to draw the part exactly.
|
||||
\param color: Color of the rectangle to draw. The alpha component specifies how
|
||||
transparent the rectangle will be.
|
||||
\param pos: Position of the rectangle.
|
||||
\param clip: Pointer to rectangle against which the rectangle will be clipped.
|
||||
If the pointer is null, no clipping will be performed. */
|
||||
virtual void draw2DRectangle(IGUIElement* element, const video::SColor &color,
|
||||
virtual void draw2DRectangle(IGUIElement* element, const video::SColor &color,
|
||||
const core::rect<s32>& pos, const core::rect<s32>* clip = 0) = 0;
|
||||
|
||||
//! get the type of this skin
|
||||
|
@ -1,5 +1,6 @@
|
||||
// Copyright (C) 2006 Michael Zeilfelder
|
||||
// This file uses the licence of the Irrlicht Engine.
|
||||
// Copyright (C) 2006-2008 Michael Zeilfelder
|
||||
// This file is part of the "Irrlicht Engine".
|
||||
// For conditions of distribution and use, see copyright notice in irrlicht.h
|
||||
|
||||
#ifndef __I_GUI_SPIN_BOX_H_INCLUDED__
|
||||
#define __I_GUI_SPIN_BOX_H_INCLUDED__
|
||||
@ -26,9 +27,6 @@ namespace gui
|
||||
virtual ~IGUISpinBox() {}
|
||||
|
||||
//! Access the edit box used in the spin control
|
||||
/** \param enable: If set to true, the override color, which can be set
|
||||
with IGUIEditBox::setOverrideColor is used, otherwise the
|
||||
EGDC_BUTTON_TEXT color of the skin. */
|
||||
virtual IGUIEditBox* getEditBox() const = 0;
|
||||
|
||||
//! set the current value of the spinbox
|
||||
|
@ -1,3 +1,6 @@
|
||||
// Copyright (C) 2002-2008 Nikolaus Gebhardt
|
||||
// This file is part of the "Irrlicht Engine".
|
||||
// For conditions of distribution and use, see copyright notice in irrlicht.h
|
||||
|
||||
#ifndef __I_GUI_SPRITE_BANK_H_INCLUDED__
|
||||
#define __I_GUI_SPRITE_BANK_H_INCLUDED__
|
||||
@ -18,12 +21,14 @@ namespace video
|
||||
namespace gui
|
||||
{
|
||||
|
||||
//! A single sprite frame.
|
||||
struct SGUISpriteFrame
|
||||
{
|
||||
u32 textureNumber;
|
||||
u32 rectNumber;
|
||||
};
|
||||
|
||||
//! A sprite composed of several frames.
|
||||
struct SGUISprite
|
||||
{
|
||||
SGUISprite() : Frames(), frameTime(0) { };
|
||||
|
@ -1,4 +1,4 @@
|
||||
// Copyright (C) 2002-2007 Nikolaus Gebhardt
|
||||
// Copyright (C) 2002-2008 Nikolaus Gebhardt
|
||||
// This file is part of the "Irrlicht Engine".
|
||||
// For conditions of distribution and use, see copyright notice in irrlicht.h
|
||||
|
||||
@ -37,12 +37,12 @@ namespace gui
|
||||
|
||||
//! Sets another color for the text.
|
||||
/** If set, the static text does not use the EGDC_BUTTON_TEXT color defined
|
||||
in the skin, but the set color instead. You don't need to call
|
||||
IGUIStaticText::enableOverrrideColor(true) after this, this is done
|
||||
by this function.
|
||||
If you set a color, and you want the text displayed with the color
|
||||
of the skin again, call IGUIStaticText::enableOverrideColor(false);
|
||||
\param color: New color of the text. */
|
||||
in the skin, but the set color instead. You don't need to call
|
||||
IGUIStaticText::enableOverrrideColor(true) after this, this is done
|
||||
by this function.
|
||||
If you set a color, and you want the text displayed with the color
|
||||
of the skin again, call IGUIStaticText::enableOverrideColor(false);
|
||||
\param color: New color of the text. */
|
||||
virtual void setOverrideColor(video::SColor color) = 0;
|
||||
|
||||
//! Gets the override color
|
||||
@ -69,30 +69,30 @@ namespace gui
|
||||
virtual void setDrawBorder(bool draw) = 0;
|
||||
|
||||
//! Sets text justification mode
|
||||
/** \param horizontal: EGUIA_UPPERLEFT for left justified (default),
|
||||
EGUIA_LOWEERRIGHT for right justified, or EGUIA_CENTER for centered text.
|
||||
\param vertical: EGUIA_UPPERLEFT to align with top edge,
|
||||
EGUIA_LOWEERRIGHT for bottom edge, or EGUIA_CENTER for centered text (default). */
|
||||
/** \param horizontal: EGUIA_UPPERLEFT for left justified (default),
|
||||
EGUIA_LOWEERRIGHT for right justified, or EGUIA_CENTER for centered text.
|
||||
\param vertical: EGUIA_UPPERLEFT to align with top edge,
|
||||
EGUIA_LOWEERRIGHT for bottom edge, or EGUIA_CENTER for centered text (default). */
|
||||
virtual void setTextAlignment(EGUI_ALIGNMENT horizontal, EGUI_ALIGNMENT vertical) = 0;
|
||||
|
||||
//! Enables or disables word wrap for using the static text as multiline text control.
|
||||
/** \param enable: If set to true, words going over one line are
|
||||
broken on to the next line. */
|
||||
/** \param enable: If set to true, words going over one line are
|
||||
broken on to the next line. */
|
||||
virtual void setWordWrap(bool enable) = 0;
|
||||
|
||||
//! Checks if word wrap is enabled
|
||||
//! \return true if word wrap is enabled, false otherwise
|
||||
virtual bool isWordWrapEnabled(void) const = 0;
|
||||
|
||||
//! Returns the height of the text in pixels when it is drawn.
|
||||
/** This is useful for adjusting the layout of gui elements based on the height
|
||||
of the multiline text in this element.
|
||||
\return Returns height of text in pixels. */
|
||||
//! Returns the height of the text in pixels when it is drawn.
|
||||
/** This is useful for adjusting the layout of gui elements based on the height
|
||||
of the multiline text in this element.
|
||||
\return Height of text in pixels. */
|
||||
virtual s32 getTextHeight() const = 0;
|
||||
|
||||
//! Returns the width of the current text, in the current font
|
||||
/** If the text is broken, this returns the width of the widest line
|
||||
\return The width of the text, or the widest broken line. */
|
||||
\return The width of the text, or the widest broken line. */
|
||||
virtual s32 getTextWidth(void) const = 0;
|
||||
};
|
||||
|
||||
|
@ -1,4 +1,4 @@
|
||||
// Copyright (C) 2002-2007 Nikolaus Gebhardt
|
||||
// Copyright (C) 2002-2008 Nikolaus Gebhardt
|
||||
// This file is part of the "Irrlicht Engine".
|
||||
// For conditions of distribution and use, see copyright notice in irrlicht.h
|
||||
|
||||
@ -69,17 +69,17 @@ namespace gui
|
||||
//! Returns a tab based on zero based index
|
||||
/** \param idx: zero based index of tab. Is a value betwenn 0 and getTabcount()-1;
|
||||
\return Returns pointer to the Tab. Returns 0 if no tab
|
||||
is corresponding to this tab. */
|
||||
is corresponding to this tab. */
|
||||
virtual IGUITab* getTab(s32 idx) const = 0;
|
||||
|
||||
//! Brings a tab to front.
|
||||
/** \param idx: number of the tab.
|
||||
\return Returns true if successful. */
|
||||
\return Returns true if successful. */
|
||||
virtual bool setActiveTab(s32 idx) = 0;
|
||||
|
||||
//! Brings a tab to front.
|
||||
/** \param tab: pointer to the tab.
|
||||
\return Returns true if successful. */
|
||||
\return Returns true if successful. */
|
||||
virtual bool setActiveTab(IGUIElement *tab) = 0;
|
||||
|
||||
//! Returns which tab is currently active
|
||||
|
@ -1,4 +1,4 @@
|
||||
// Copyright (C) 2002-2007 Nikolaus Gebhardt
|
||||
// Copyright (C) 2002-2008 Nikolaus Gebhardt
|
||||
// This file is part of the "Irrlicht Engine".
|
||||
// For conditions of distribution and use, see copyright notice in irrlicht.h
|
||||
|
||||
|
@ -1,4 +1,4 @@
|
||||
// Copyright (C) 2002-2007 Nikolaus Gebhardt
|
||||
// Copyright (C) 2002-2008 Nikolaus Gebhardt
|
||||
// This file is part of the "Irrlicht Engine".
|
||||
// For conditions of distribution and use, see copyright notice in irrlicht.h
|
||||
|
||||
|
@ -1,4 +1,4 @@
|
||||
// Copyright (C) 2002-2007 Nikolaus Gebhardt
|
||||
// Copyright (C) 2002-2008 Nikolaus Gebhardt
|
||||
// This file is part of the "Irrlicht Engine".
|
||||
// For conditions of distribution and use, see copyright notice in irrlicht.h
|
||||
|
||||
@ -18,9 +18,10 @@ namespace video
|
||||
/** A color format specifies how color information is stored. */
|
||||
enum ECOLOR_FORMAT
|
||||
{
|
||||
//! 16 bit color format used by the software driver, and thus preferred
|
||||
//! by all other irrlicht engine video drivers. There are 5 bits for every
|
||||
//! color component, and a single bit is left for alpha information.
|
||||
//! 16 bit color format used by the software driver.
|
||||
/** It is thus preferred by all other irrlicht engine video drivers.
|
||||
There are 5 bits for every color component, and a single bit is left
|
||||
for alpha information. */
|
||||
ECF_A1R5G5B5 = 0,
|
||||
|
||||
//! Standard 16 bit color format.
|
||||
@ -29,13 +30,12 @@ enum ECOLOR_FORMAT
|
||||
//! 24 bit color, no alpha channel, but 8 bit for red, green and blue.
|
||||
ECF_R8G8B8,
|
||||
|
||||
//! Default 32 bit color format. 8 bits are used for every component:
|
||||
//! red, green, blue and alpha.
|
||||
//! Default 32 bit color format. 8 bits are used for every component: red, green, blue and alpha.
|
||||
ECF_A8R8G8B8
|
||||
};
|
||||
|
||||
|
||||
//! Interface for software image data.
|
||||
//! Interface for software image data.
|
||||
/** Image loaders create these images from files. IVideoDrivers convert
|
||||
these images into their (hardware) textures.
|
||||
*/
|
||||
@ -43,20 +43,20 @@ class IImage : public virtual IReferenceCounted
|
||||
{
|
||||
public:
|
||||
|
||||
//! destructor
|
||||
//! Destructor
|
||||
virtual ~IImage() {}
|
||||
|
||||
//! Lock function. Use this to get a pointer to the image data. After you
|
||||
//! don't need the pointer anymore, you must call unlock().
|
||||
//! \return Returns pointer to the image data. What type of data
|
||||
//! is pointed to depends on the color format of the image. For example
|
||||
//! if the color format is ECF_A8R8G8B8, it is of u32.
|
||||
//! Be sure to call unlock() after you don't need the pointer any more.
|
||||
//! Lock function. Use this to get a pointer to the image data.
|
||||
/** After you don't need the pointer anymore, you must call unlock().
|
||||
\return Pointer to the image data. What type of data is pointed to
|
||||
depends on the color format of the image. For example if the color
|
||||
format is ECF_A8R8G8B8, it is of u32. Be sure to call unlock() after
|
||||
you don't need the pointer any more. */
|
||||
virtual void* lock() = 0;
|
||||
|
||||
//! Unlock function.
|
||||
//! Should be called after the pointer received by lock() is not
|
||||
//! needed anymore.
|
||||
/** Should be called after the pointer received by lock() is not
|
||||
needed anymore. */
|
||||
virtual void unlock() = 0;
|
||||
|
||||
//! Returns width and height of image data.
|
||||
@ -74,34 +74,34 @@ public:
|
||||
//! Returns image data size in pixels
|
||||
virtual u32 getImageDataSizeInPixels() const = 0;
|
||||
|
||||
//! returns a pixel
|
||||
//! Returns a pixel
|
||||
virtual SColor getPixel(u32 x, u32 y) const = 0;
|
||||
|
||||
//! sets a pixel
|
||||
//! Sets a pixel
|
||||
virtual void setPixel(u32 x, u32 y, const SColor &color ) = 0;
|
||||
|
||||
//! returns the color format
|
||||
//! Returns the color format
|
||||
virtual ECOLOR_FORMAT getColorFormat() const = 0;
|
||||
|
||||
//! returns mask for red value of a pixel
|
||||
//! Returns mask for red value of a pixel
|
||||
virtual u32 getRedMask() const = 0;
|
||||
|
||||
//! returns mask for green value of a pixel
|
||||
//! Returns mask for green value of a pixel
|
||||
virtual u32 getGreenMask() const = 0;
|
||||
|
||||
//! returns mask for blue value of a pixel
|
||||
//! Returns mask for blue value of a pixel
|
||||
virtual u32 getBlueMask() const = 0;
|
||||
|
||||
//! returns mask for alpha value of a pixel
|
||||
//! Returns mask for alpha value of a pixel
|
||||
virtual u32 getAlphaMask() const = 0;
|
||||
|
||||
//! returns pitch of image
|
||||
//! Returns pitch of image
|
||||
virtual u32 getPitch() const = 0;
|
||||
|
||||
//! copies the image into the target, scaling the image to fit
|
||||
//! Copies the image into the target, scaling the image to fit
|
||||
virtual void copyToScaling(void* target, s32 width, s32 height, ECOLOR_FORMAT format=ECF_A8R8G8B8, u32 pitch=0) = 0;
|
||||
|
||||
//! copies the image into the target, scaling the image to fit
|
||||
//! Copies the image into the target, scaling the image to fit
|
||||
virtual void copyToScaling(IImage* target) = 0;
|
||||
|
||||
};
|
||||
|
@ -1,4 +1,4 @@
|
||||
// Copyright (C) 2002-2007 Nikolaus Gebhardt
|
||||
// Copyright (C) 2002-2008 Nikolaus Gebhardt
|
||||
// This file is part of the "Irrlicht Engine".
|
||||
// For conditions of distribution and use, see copyright notice in irrlicht.h
|
||||
|
||||
@ -17,26 +17,33 @@ namespace io
|
||||
namespace video
|
||||
{
|
||||
|
||||
//! Class which is able to create a image from a file.
|
||||
/** If you want the Irrlicht Engine be able to load textures of
|
||||
//! Class which is able to create a image from a file.
|
||||
/** If you want the Irrlicht Engine be able to load textures of
|
||||
currently unsupported file formats (e.g .gif), then implement
|
||||
this and add your new Surface loader with
|
||||
this and add your new Surface loader with
|
||||
IVideoDriver::addExternalImageLoader() to the engine. */
|
||||
class IImageLoader : public virtual IReferenceCounted
|
||||
{
|
||||
public:
|
||||
|
||||
//! destructor
|
||||
//! Destructor
|
||||
virtual ~IImageLoader() {}
|
||||
|
||||
//! returns true if the file maybe is able to be loaded by this class
|
||||
//! based on the file extension (e.g. ".tga")
|
||||
//! Check if the file might be loaded by this class
|
||||
/** Check is based on the file extension (e.g. ".tga")
|
||||
\param fileName Name of file to check.
|
||||
\return True if file seems to be loadable. */
|
||||
virtual bool isALoadableFileExtension(const c8* fileName) const = 0;
|
||||
|
||||
//! returns true if the file maybe is able to be loaded by this class
|
||||
//! Check if the file might be loaded by this class
|
||||
/** Check might look into the file.
|
||||
\param file File handle to check.
|
||||
\return True if file seems to be loadable. */
|
||||
virtual bool isALoadableFileFormat(io::IReadFile* file) const = 0;
|
||||
|
||||
//! creates a surface from the file
|
||||
//! Creates a surface from the file
|
||||
/** \param file File handle to check.
|
||||
\return Pointer to newly created image, or 0 upon error. */
|
||||
virtual IImage* loadImage(io::IReadFile* file) const = 0;
|
||||
};
|
||||
|
||||
|
@ -1,3 +1,7 @@
|
||||
// Copyright (C) 2002-2008 Nikolaus Gebhardt
|
||||
// This file is part of the "Irrlicht Engine".
|
||||
// For conditions of distribution and use, see copyright notice in irrlicht.h
|
||||
|
||||
#ifndef _I_IMAGE_WRITER_H_INCLUDED__
|
||||
#define _I_IMAGE_WRITER_H_INCLUDED__
|
||||
|
||||
@ -19,13 +23,19 @@ namespace video
|
||||
class IImageWriter : public IReferenceCounted
|
||||
{
|
||||
public:
|
||||
//! destructor
|
||||
//! Destructor
|
||||
virtual ~IImageWriter() { }
|
||||
|
||||
//! return true if this writer can write a file with the given extension
|
||||
//! Check if this writer can write a file with the given extension
|
||||
/** \param fileName Name of the file to check.
|
||||
\return True if file extension specifies a writable type. */
|
||||
virtual bool isAWriteableFileExtension(const c8* fileName) const = 0;
|
||||
|
||||
//! write image to file
|
||||
//! Write image to file
|
||||
/** \param file File handle to write to.
|
||||
\param image Image to write into file.
|
||||
\param param Writer specific parameter, influencing e.g. quality.
|
||||
\return True if image was successfully written. */
|
||||
virtual bool writeImage(io::IWriteFile *file, IImage *image, u32 param = 0) const = 0;
|
||||
};
|
||||
|
||||
|
@ -1,4 +1,4 @@
|
||||
// Copyright (C) 2002-2007 Nikolaus Gebhardt
|
||||
// Copyright (C) 2002-2008 Nikolaus Gebhardt
|
||||
// This file is part of the "Irrlicht Engine".
|
||||
// For conditions of distribution and use, see copyright notice in irrlicht.h
|
||||
|
||||
@ -13,32 +13,31 @@ namespace irr
|
||||
namespace scene
|
||||
{
|
||||
|
||||
//! Scene node which is a dynamic light.
|
||||
//! Scene node which is a dynamic light.
|
||||
/** You can switch the light on and off by making it visible or not. It can be
|
||||
animated by ordinary scene node animators.
|
||||
If the light type is directional or spot, the direction of the light source
|
||||
is defined by the rotation of the scene node (assuming (0,0,1) as the local
|
||||
direction of the light).
|
||||
animated by ordinary scene node animators. If the light type is directional or
|
||||
spot, the direction of the light source is defined by the rotation of the scene
|
||||
node (assuming (0,0,1) as the local direction of the light).
|
||||
*/
|
||||
class ILightSceneNode : public ISceneNode
|
||||
{
|
||||
public:
|
||||
|
||||
//! constructor
|
||||
ILightSceneNode(ISceneNode* parent, ISceneManager* mgr, s32 id,
|
||||
ILightSceneNode(ISceneNode* parent, ISceneManager* mgr, s32 id,
|
||||
const core::vector3df& position = core::vector3df(0,0,0))
|
||||
: ISceneNode(parent, mgr, id, position) {}
|
||||
|
||||
//! Sets the light data associated with this ILightSceneNode
|
||||
//! \param light The new light data.
|
||||
/** \param light The new light data. */
|
||||
virtual void setLightData(const video::SLight& light) = 0;
|
||||
|
||||
//! Gets the light data associated with this ILightSceneNode
|
||||
//! \return Returns the light data.
|
||||
/** \return The light data. */
|
||||
virtual const video::SLight& getLightData() const = 0;
|
||||
|
||||
//! Gets the light data associated with this ILightSceneNode
|
||||
//! \return Returns the light data.
|
||||
/** \return The light data. */
|
||||
virtual video::SLight& getLightData() = 0;
|
||||
};
|
||||
|
||||
|
@ -1,4 +1,4 @@
|
||||
// Copyright (C) 2002-2007 Nikolaus Gebhardt
|
||||
// Copyright (C) 2002-2008 Nikolaus Gebhardt
|
||||
// This file is part of the "Irrlicht Engine".
|
||||
// For conditions of distribution and use, see copyright notice in irrlicht.h
|
||||
|
||||
@ -10,10 +10,10 @@
|
||||
namespace irr
|
||||
{
|
||||
|
||||
//! Possible log levels.
|
||||
enum ELOG_LEVEL
|
||||
{
|
||||
//! High log level, warnings, errors and important information
|
||||
//! texts are printed out.
|
||||
//! High log level, warnings, errors and important information texts are printed out.
|
||||
ELL_INFORMATION = 0,
|
||||
|
||||
//! Default log level, warnings and errors are printed out
|
||||
@ -32,60 +32,59 @@ class ILogger : public virtual IReferenceCounted
|
||||
{
|
||||
public:
|
||||
|
||||
//! destructor
|
||||
//! Destructor
|
||||
virtual ~ILogger() {}
|
||||
|
||||
//! Returns the current set log level.
|
||||
virtual ELOG_LEVEL getLogLevel() const = 0;
|
||||
|
||||
//! Sets a new log level. With this value, texts which are sent to
|
||||
//! the logger are filtered out. For example setting this value to
|
||||
//! ELL_WARNING, only warnings and
|
||||
//! errors are printed out. Setting it to ELL_INFORMATION, which is
|
||||
//! the default setting, warnings,
|
||||
//! errors and informational texts are printed out.
|
||||
//! \param ll: new log level filter value.
|
||||
//! Sets a new log level.
|
||||
/** With this value, texts which are sent to the logger are filtered
|
||||
out. For example setting this value to ELL_WARNING, only warnings and
|
||||
errors are printed out. Setting it to ELL_INFORMATION, which is the
|
||||
default setting, warnings, errors and informational texts are printed
|
||||
out.
|
||||
\param ll: new log level filter value. */
|
||||
virtual void setLogLevel(ELOG_LEVEL ll) = 0;
|
||||
|
||||
//! Prints out a text into the log
|
||||
//! \param text: Text to print out.
|
||||
//! \param ll: Log level of the text. If the text is an error, set
|
||||
//! it to ELL_ERROR, if it is warning set it to ELL_WARNING, and if it
|
||||
//! is just an informational text, set it to ELL_INFORMATION. Texts are
|
||||
//! filtered with these levels. If you want to be a text displayed,
|
||||
//! independent on what level filter is set, use ELL_NONE.
|
||||
/** \param text: Text to print out.
|
||||
\param ll: Log level of the text. If the text is an error, set
|
||||
it to ELL_ERROR, if it is warning set it to ELL_WARNING, and if it
|
||||
is just an informational text, set it to ELL_INFORMATION. Texts are
|
||||
filtered with these levels. If you want to be a text displayed,
|
||||
independent on what level filter is set, use ELL_NONE. */
|
||||
virtual void log(const c8* text, ELOG_LEVEL ll=ELL_INFORMATION) = 0;
|
||||
|
||||
//! Prints out a text into the log
|
||||
//! \param text: Text to print out.
|
||||
//! \param hint: Additional info. This string is added after a " :" to the
|
||||
//! string.
|
||||
//! \param ll: Log level of the text. If the text is an error, set
|
||||
//! it to ELL_ERROR, if it is warning set it to ELL_WARNING, and if it
|
||||
//! is just an informational text, set it to ELL_INFORMATION. Texts are
|
||||
//! filtered with these levels. If you want to be a text displayed,
|
||||
//! independent on what level filter is set, use ELL_NONE.
|
||||
/** \param text: Text to print out.
|
||||
\param hint: Additional info. This string is added after a " :" to the
|
||||
string.
|
||||
\param ll: Log level of the text. If the text is an error, set
|
||||
it to ELL_ERROR, if it is warning set it to ELL_WARNING, and if it
|
||||
is just an informational text, set it to ELL_INFORMATION. Texts are
|
||||
filtered with these levels. If you want to be a text displayed,
|
||||
independent on what level filter is set, use ELL_NONE. */
|
||||
virtual void log(const c8* text, const c8* hint, ELOG_LEVEL ll=ELL_INFORMATION) = 0;
|
||||
|
||||
//! Prints out a text into the log
|
||||
//! \param text: Text to print out.
|
||||
//! \param hint: Additional info. This string is added after a " :" to the
|
||||
//! string.
|
||||
//! \param ll: Log level of the text. If the text is an error, set
|
||||
//! it to ELL_ERROR, if it is warning set it to ELL_WARNING, and if it
|
||||
//! is just an informational text, set it to ELL_INFORMATION. Texts are
|
||||
//! filtered with these levels. If you want to be a text displayed,
|
||||
//! independent on what level filter is set, use ELL_NONE.
|
||||
/** \param text: Text to print out.
|
||||
\param hint: Additional info. This string is added after a " :" to the
|
||||
string.
|
||||
\param ll: Log level of the text. If the text is an error, set
|
||||
it to ELL_ERROR, if it is warning set it to ELL_WARNING, and if it
|
||||
is just an informational text, set it to ELL_INFORMATION. Texts are
|
||||
filtered with these levels. If you want to be a text displayed,
|
||||
independent on what level filter is set, use ELL_NONE. */
|
||||
virtual void log(const wchar_t* text, const wchar_t* hint, ELOG_LEVEL ll=ELL_INFORMATION) = 0;
|
||||
|
||||
|
||||
//! Prints out a text into the log
|
||||
//! \param text: Text to print out.
|
||||
//! \param ll: Log level of the text. If the text is an error, set
|
||||
//! it to ELL_ERROR, if it is warning set it to ELL_WARNING, and if it
|
||||
//! is just an informational text, set it to ELL_INFORMATION. Texts are
|
||||
//! filtered with these levels. If you want to be a text displayed,
|
||||
//! independent on what level filter is set, use ELL_NONE.
|
||||
/** \param text: Text to print out.
|
||||
\param ll: Log level of the text. If the text is an error, set
|
||||
it to ELL_ERROR, if it is warning set it to ELL_WARNING, and if it
|
||||
is just an informational text, set it to ELL_INFORMATION. Texts are
|
||||
filtered with these levels. If you want to be a text displayed,
|
||||
independent on what level filter is set, use ELL_NONE. */
|
||||
virtual void log(const wchar_t* text, ELOG_LEVEL ll=ELL_INFORMATION) = 0;
|
||||
};
|
||||
|
||||
|
@ -1,4 +1,4 @@
|
||||
// Copyright (C) 2002-2007 Nikolaus Gebhardt
|
||||
// Copyright (C) 2002-2008 Nikolaus Gebhardt
|
||||
// This file is part of the "Irrlicht Engine".
|
||||
// For conditions of distribution and use, see copyright notice in irrlicht.h
|
||||
|
||||
@ -11,24 +11,24 @@
|
||||
|
||||
namespace irr
|
||||
{
|
||||
namespace video
|
||||
namespace video
|
||||
{
|
||||
|
||||
class IVideoDriver;
|
||||
class IMaterialRendererServices;
|
||||
|
||||
//! Interface for material rendering. Can be used to extend the engine with
|
||||
//! new materials. Refer to IVideoDriver::addMaterialRenderer() for more
|
||||
//! informations on how to extend the engine with new materials.
|
||||
//! Interface for material rendering.
|
||||
/** Can be used to extend the engine with new materials. Refer to
|
||||
IVideoDriver::addMaterialRenderer() for more informations on how to extend the
|
||||
engine with new materials. */
|
||||
class IMaterialRenderer : public virtual IReferenceCounted
|
||||
{
|
||||
public:
|
||||
|
||||
//! destructor
|
||||
//! Destructor
|
||||
virtual ~IMaterialRenderer() {}
|
||||
|
||||
//! Called by the IVideoDriver implementation the let the renderer set
|
||||
//! its needed render states.
|
||||
//! Called by the IVideoDriver implementation the let the renderer set its needed render states.
|
||||
/** This is called during the IVideoDriver::setMaterial() call.
|
||||
When overriding this, you can set some renderstates or for example a
|
||||
vertex or pixel shader if you like.
|
||||
@ -53,8 +53,7 @@ public:
|
||||
virtual void OnSetMaterial(const SMaterial& material, const SMaterial& lastMaterial,
|
||||
bool resetAllRenderstates, IMaterialRendererServices* services) {};
|
||||
|
||||
//! Called every time before a new bunch of geometry is being drawn
|
||||
//! using this material with for example drawIndexedTriangleList() call.
|
||||
//! Called every time before a new bunch of geometry is being drawn using this material with for example drawIndexedTriangleList() call.
|
||||
/** OnSetMaterial should normally only be called if the renderer decides
|
||||
that the renderstates should be changed, it won't be called if for
|
||||
example two drawIndexedTriangleList() will be called with the same
|
||||
@ -68,31 +67,30 @@ public:
|
||||
optimized shaders or if this is an incompatible vertex type for this
|
||||
renderer, to refuse rendering for example.
|
||||
\return Returns true if everything is ok, and false if nothing should
|
||||
be rendered. The material renderer can choose to return false for
|
||||
be rendered. The material renderer can choose to return false for
|
||||
example if he doesn't support the specified vertex type. This is
|
||||
actually done in D3D8 and D3D9 when using a normal mapped material with
|
||||
a vertex type other than EVT_TANGENTS. */
|
||||
a vertex type other than EVT_TANGENTS. */
|
||||
virtual bool OnRender(IMaterialRendererServices* service, E_VERTEX_TYPE vtxtype) { return true; };
|
||||
|
||||
//! Called by the IVideoDriver to unset this material.
|
||||
/** Called during the
|
||||
IVideoDriver::setMaterial() call before the new material will get the OnSetMaterial()
|
||||
call. */
|
||||
/** Called during the IVideoDriver::setMaterial() call before the new
|
||||
material will get the OnSetMaterial() call. */
|
||||
virtual void OnUnsetMaterial() {}
|
||||
|
||||
//! Returns if the material is transparent.
|
||||
//! Returns if the material is transparent.
|
||||
/** The scene managment needs to know this
|
||||
for being able to sort the materials by opaque and transparent. */
|
||||
virtual bool isTransparent() const { return false; }
|
||||
|
||||
//! Returns the render capability of the material.
|
||||
//! Returns the render capability of the material.
|
||||
/** Because some more complex materials
|
||||
are implemented in multiple ways and need special hardware capabilities, it is possible
|
||||
to query how the current material renderer is performing on the current hardware with this
|
||||
function.
|
||||
\return Returns 0 if everything is running fine. Any other value is material renderer
|
||||
specific and means for example that the renderer switched back to a fall back material because
|
||||
it cannot use the latest shaders. More specific examples:
|
||||
specific and means for example that the renderer switched back to a fall back material because
|
||||
it cannot use the latest shaders. More specific examples:
|
||||
Fixed function pipeline materials should return 0 in most cases, parallax mapped
|
||||
material will only return 0 when at least pixel shader 1.4 is available on that machine. */
|
||||
virtual s32 getRenderCapability() const { return 0; }
|
||||
|
@ -1,4 +1,4 @@
|
||||
// Copyright (C) 2002-2007 Nikolaus Gebhardt
|
||||
// Copyright (C) 2002-2008 Nikolaus Gebhardt
|
||||
// This file is part of the "Irrlicht Engine".
|
||||
// For conditions of distribution and use, see copyright notice in irrlicht.h
|
||||
|
||||
@ -11,7 +11,7 @@
|
||||
|
||||
namespace irr
|
||||
{
|
||||
namespace video
|
||||
namespace video
|
||||
{
|
||||
|
||||
class IVideoDriver;
|
||||
@ -20,69 +20,80 @@ class IVideoDriver;
|
||||
//! Interface providing some methods for changing advanced, internal states of a IVideoDriver.
|
||||
class IMaterialRendererServices
|
||||
{
|
||||
public:
|
||||
public:
|
||||
|
||||
//! destructor
|
||||
//! Destructor
|
||||
virtual ~IMaterialRendererServices() {}
|
||||
|
||||
//! Can be called by an IMaterialRenderer to make its work easier.
|
||||
//! Sets all basic renderstates if needed.
|
||||
//! Basic render states are diffuse, ambient, specular, and emissive color, specular power,
|
||||
//! bilinear and trilinear filtering, wireframe mode,
|
||||
//! grouraudshading, lighting, zbuffer, zwriteenable, backfaceculling and fog enabling.
|
||||
virtual void setBasicRenderStates(const SMaterial& material,
|
||||
/** Sets all basic renderstates if needed.
|
||||
Basic render states are diffuse, ambient, specular, and emissive color,
|
||||
specular power, bilinear and trilinear filtering, wireframe mode,
|
||||
grouraudshading, lighting, zbuffer, zwriteenable, backfaceculling and
|
||||
fog enabling.
|
||||
\param material The new material to be used.
|
||||
\param lastMaterial The material used until now.
|
||||
\param resetAllRenderstates Set to true if all renderstates should be
|
||||
set, regardless of their current state. */
|
||||
virtual void setBasicRenderStates(const SMaterial& material,
|
||||
const SMaterial& lastMaterial,
|
||||
bool resetAllRenderstates) = 0;
|
||||
|
||||
//! Sets a constant for the vertex shader based on a name. This can be used if you used
|
||||
//! a high level shader language like GLSL or HLSL to create a shader. Example: If you
|
||||
//! created a shader which has variables named 'mWorldViewProj' (containing the
|
||||
//! WorldViewProjection matrix) and another one named 'fTime' containing one float,
|
||||
//! you can set them in your IShaderConstantSetCallBack derived class like this:
|
||||
//! \code
|
||||
//! virtual void OnSetConstants(video::IMaterialRendererServices* services, s32 userData)
|
||||
//! {
|
||||
//! video::IVideoDriver* driver = services->getVideoDriver();
|
||||
//!
|
||||
//! f32 time = (f32)os::Timer::getTime()/100000.0f;
|
||||
//! services->setVertexShaderConstant("fTime", &time, 1);
|
||||
//!
|
||||
//! core::matrix4 worldViewProj(driver->getTransform(video::ETS_PROJECTION));
|
||||
//! worldViewProj *= driver->getTransform(video::ETS_VIEW);
|
||||
//! worldViewProj *= driver->getTransform(video::ETS_WORLD);
|
||||
//! services->setVertexShaderConstant("mWorldViewProj", worldViewProj.M, 16);
|
||||
//! }
|
||||
//! \endcode
|
||||
//! \param name: Name of the variable
|
||||
//! \param floats: Pointer to array of floats
|
||||
//! \param count: Amount of floats in array.
|
||||
//! \return: Returns true if successful.
|
||||
//! Sets a constant for the vertex shader based on a name.
|
||||
/** This can be used if you used a high level shader language like GLSL
|
||||
or HLSL to create a shader. Example: If you created a shader which has
|
||||
variables named 'mWorldViewProj' (containing the WorldViewProjection
|
||||
matrix) and another one named 'fTime' containing one float, you can set
|
||||
them in your IShaderConstantSetCallBack derived class like this:
|
||||
\code
|
||||
virtual void OnSetConstants(video::IMaterialRendererServices* services, s32 userData)
|
||||
{
|
||||
video::IVideoDriver* driver = services->getVideoDriver();
|
||||
|
||||
f32 time = (f32)os::Timer::getTime()/100000.0f;
|
||||
services->setVertexShaderConstant("fTime", &time, 1);
|
||||
|
||||
core::matrix4 worldViewProj(driver->getTransform(video::ETS_PROJECTION));
|
||||
worldViewProj *= driver->getTransform(video::ETS_VIEW);
|
||||
worldViewProj *= driver->getTransform(video::ETS_WORLD);
|
||||
services->setVertexShaderConstant("mWorldViewProj", worldViewProj.M, 16);
|
||||
}
|
||||
\endcode
|
||||
\param name Name of the variable
|
||||
\param floats Pointer to array of floats
|
||||
\param count Amount of floats in array.
|
||||
\return True if successful.
|
||||
*/
|
||||
virtual bool setVertexShaderConstant(const c8* name, const f32* floats, int count) = 0;
|
||||
|
||||
//! Sets a vertex shader constant. Can be used if you created a shader using
|
||||
//! pixel/vertex shader assembler or ARB_fragment_program or ARB_vertex_program.
|
||||
//! \param data: Data to be set in the constants
|
||||
//! \param startRegister: First register to be set
|
||||
//! \param constantAmount: Amount of registers to be set. One register consists of 4 floats.
|
||||
//! Sets a vertex shader constant.
|
||||
/** Can be used if you created a shader using pixel/vertex shader
|
||||
assembler or ARB_fragment_program or ARB_vertex_program.
|
||||
\param data: Data to be set in the constants
|
||||
\param startRegister: First register to be set
|
||||
\param constantAmount: Amount of registers to be set. One register consists of 4 floats. */
|
||||
virtual void setVertexShaderConstant(const f32* data, s32 startRegister, s32 constantAmount=1) = 0;
|
||||
|
||||
//! Sets a constant for the pixel shader based on a name. This can be used if you used
|
||||
//! a high level shader language like GLSL or HLSL to create a shader. See
|
||||
//! setVertexShaderConstant() for an example on how to use this.
|
||||
//! \param name: Name of the variable
|
||||
//! \param floats: Pointer to array of floats
|
||||
//! \param count: Amount of floats in array.
|
||||
//! \return: Returns true if successful.
|
||||
//! Sets a constant for the pixel shader based on a name.
|
||||
/** This can be used if you used a high level shader language like GLSL
|
||||
or HLSL to create a shader. See setVertexShaderConstant() for an
|
||||
example on how to use this.
|
||||
\param name Name of the variable
|
||||
\param floats Pointer to array of floats
|
||||
\param count Amount of floats in array.
|
||||
\return True if successful. */
|
||||
virtual bool setPixelShaderConstant(const c8* name, const f32* floats, int count) = 0;
|
||||
|
||||
//! Sets a pixel shader constant. Can be used if you created a shader using
|
||||
//! pixel/vertex shader assembler or ARB_fragment_program or ARB_vertex_program.
|
||||
//! \param data: Data to be set in the constants
|
||||
//! \param startRegister: First register to be set.
|
||||
//! \param constantAmount: Amount of registers to be set. One register consists of 4 floats.
|
||||
//! Sets a pixel shader constant.
|
||||
/** Can be used if you created a shader using pixel/vertex shader
|
||||
assembler or ARB_fragment_program or ARB_vertex_program.
|
||||
\param data Data to be set in the constants
|
||||
\param startRegister First register to be set.
|
||||
\param constantAmount Amount of registers to be set. One register consists of 4 floats. */
|
||||
virtual void setPixelShaderConstant(const f32* data, s32 startRegister, s32 constantAmount=1) = 0;
|
||||
|
||||
//! Returns a pointer to the IVideoDriver interface
|
||||
//! Get pointer to the IVideoDriver interface
|
||||
/** \return Pointer to the IVideoDriver interface */
|
||||
virtual IVideoDriver* getVideoDriver() = 0;
|
||||
};
|
||||
|
||||
|
@ -1,4 +1,4 @@
|
||||
// Copyright (C) 2002-2007 Nikolaus Gebhardt
|
||||
// Copyright (C) 2002-2008 Nikolaus Gebhardt
|
||||
// This file is part of the "Irrlicht Engine".
|
||||
// For conditions of distribution and use, see copyright notice in irrlicht.h
|
||||
|
||||
@ -15,14 +15,14 @@ namespace scene
|
||||
class IMeshBuffer;
|
||||
|
||||
//! Class for accessing a mesh with multiple mesh buffers.
|
||||
/** An IMesh is nothing more than a collection of some mesh buffers (IMeshBuffer).
|
||||
SMesh is a simple implementation of an IMesh.
|
||||
/** An IMesh is nothing more than a collection of some mesh buffers
|
||||
(IMeshBuffer). SMesh is a simple implementation of an IMesh.
|
||||
*/
|
||||
class IMesh : public virtual IReferenceCounted
|
||||
{
|
||||
public:
|
||||
|
||||
//! destructor
|
||||
//! Destructor
|
||||
virtual ~IMesh() { }
|
||||
|
||||
//! Returns the amount of mesh buffers.
|
||||
@ -30,15 +30,15 @@ namespace scene
|
||||
virtual u32 getMeshBufferCount() const = 0;
|
||||
|
||||
//! Returns pointer to a mesh buffer.
|
||||
/** \param nr: Zero based index of the mesh buffer. The maximum value is
|
||||
/** \param nr: Zero based index of the mesh buffer. The maximum value is
|
||||
getMeshBufferCount() - 1;
|
||||
\return Returns the pointer to the mesh buffer or
|
||||
\return Returns the pointer to the mesh buffer or
|
||||
NULL if there is no such mesh buffer. */
|
||||
virtual IMeshBuffer* getMeshBuffer(u32 nr) const = 0;
|
||||
|
||||
//! Returns pointer to a mesh buffer which fits a material
|
||||
/** \param material: material to search for
|
||||
\return Returns the pointer to the mesh buffer or
|
||||
/** \param material: material to search for
|
||||
\return Returns the pointer to the mesh buffer or
|
||||
NULL if there is no such mesh buffer. */
|
||||
virtual IMeshBuffer* getMeshBuffer( const video::SMaterial &material) const = 0;
|
||||
|
||||
@ -47,11 +47,12 @@ namespace scene
|
||||
virtual const core::aabbox3d<f32>& getBoundingBox() const = 0;
|
||||
|
||||
//! set user axis aligned bounding box
|
||||
/** \param box New bounding box to use for the mesh. */
|
||||
virtual void setBoundingBox( const core::aabbox3df& box) = 0;
|
||||
|
||||
//! Sets a flag of all contained materials to a new value.
|
||||
/** \param flag: Flag to set in all materials.
|
||||
\param newvalue: New value to set in all materials. */
|
||||
\param newvalue: New value to set in all materials. */
|
||||
virtual void setMaterialFlag(video::E_MATERIAL_FLAG flag, bool newvalue) = 0;
|
||||
};
|
||||
|
||||
|
@ -1,4 +1,4 @@
|
||||
// Copyright (C) 2002-2007 Nikolaus Gebhardt
|
||||
// Copyright (C) 2002-2008 Nikolaus Gebhardt
|
||||
// This file is part of the "Irrlicht Engine".
|
||||
// For conditions of distribution and use, see copyright notice in irrlicht.h
|
||||
|
||||
@ -69,45 +69,57 @@ namespace scene
|
||||
{
|
||||
public:
|
||||
|
||||
//! destructor
|
||||
//! Destructor
|
||||
virtual ~IMeshBuffer() { }
|
||||
|
||||
//! returns the material of this meshbuffer
|
||||
//! Get the material of this meshbuffer
|
||||
/** \return Material of this buffer. */
|
||||
virtual video::SMaterial& getMaterial() = 0;
|
||||
|
||||
//! returns the material of this meshbuffer
|
||||
//! Get the material of this meshbuffer
|
||||
/** \return Material of this buffer. */
|
||||
virtual const video::SMaterial& getMaterial() const = 0;
|
||||
|
||||
//! returns which type of vertex data is stored.
|
||||
//! Get type of vertex data which is stored in this meshbuffer.
|
||||
/** \return Vertex type of this buffer. */
|
||||
virtual video::E_VERTEX_TYPE getVertexType() const = 0;
|
||||
|
||||
//! returns pointer to vertex data. The data is an array of vertices. Which vertex
|
||||
//! type is used can be determined with getVertexType().
|
||||
//! Get access to vertex data. The data is an array of vertices.
|
||||
/** Which vertex type is used can be determined by getVertexType().
|
||||
\return Pointer to array of vertices. */
|
||||
virtual const void* getVertices() const = 0;
|
||||
|
||||
//! returns pointer to vertex data. The data is an array of vertices. Which vertex
|
||||
//! type is used can be determined with getVertexType().
|
||||
//! Get access to vertex data. The data is an array of vertices.
|
||||
/** Which vertex type is used can be determined by getVertexType().
|
||||
\return Pointer to array of vertices. */
|
||||
virtual void* getVertices() = 0;
|
||||
|
||||
//! returns amount of vertices
|
||||
//! Get amount of vertices in meshbuffer.
|
||||
/** \return Number of vertices in this buffer. */
|
||||
virtual u32 getVertexCount() const = 0;
|
||||
|
||||
//! returns pointer to Indices
|
||||
//! Get access to Indices.
|
||||
/** \return Pointer to indices array. */
|
||||
virtual const u16* getIndices() const = 0;
|
||||
|
||||
//! returns pointer to Indices
|
||||
//! Get access to Indices.
|
||||
/** \return Pointer to indices array. */
|
||||
virtual u16* getIndices() = 0;
|
||||
|
||||
//! returns amount of indices
|
||||
//! Get amount of indices in this meshbuffer.
|
||||
/** \return Number of indices in this buffer. */
|
||||
virtual u32 getIndexCount() const = 0;
|
||||
|
||||
//! returns an axis aligned bounding box
|
||||
//! Get the axis aligned bounding box of this meshbuffer.
|
||||
/** \return Axis aligned bounding box of this buffer. */
|
||||
virtual const core::aabbox3df& getBoundingBox() const = 0;
|
||||
|
||||
//! set user axis aligned bounding box
|
||||
virtual void setBoundingBox( const core::aabbox3df& box) = 0;
|
||||
//! Set axis aligned bounding box
|
||||
/** \param box User defined axis aligned bounding box to use
|
||||
for this buffer. */
|
||||
virtual void setBoundingBox(const core::aabbox3df& box) = 0;
|
||||
|
||||
//! recalculates the bounding box. should be called if the mesh changed.
|
||||
//! Recalculates the bounding box. Should be called if the mesh changed.
|
||||
virtual void recalculateBoundingBox() = 0;
|
||||
|
||||
//! returns position of vertex i
|
||||
@ -122,12 +134,17 @@ namespace scene
|
||||
//! returns normal of vertex i
|
||||
virtual core::vector3df& getNormal(u32 i) = 0;
|
||||
|
||||
//! append the vertices and indices to the current buffer
|
||||
//! Only works for compatible vertex types
|
||||
//! Append the vertices and indices to the current buffer
|
||||
/** Only works for compatible vertex types.
|
||||
\param vertices Pointer to a vertex array.
|
||||
\param numVertices Number of vertices in the array.
|
||||
\param indices Pointer to index array.
|
||||
\param numIndices Number of indices in array. */
|
||||
virtual void append(const void* const vertices, u32 numVertices, const u16* const indices, u32 numIndices) = 0;
|
||||
|
||||
//! append the meshbuffer to the current buffer
|
||||
//! Only works for compatible vertex types
|
||||
//! Append the meshbuffer to the current buffer
|
||||
/** Only works for compatible vertex types
|
||||
\param other Buffer to append to this one. */
|
||||
virtual void append(const IMeshBuffer* const other) = 0;
|
||||
|
||||
//! get the current hardware mapping hint
|
||||
|
@ -1,4 +1,4 @@
|
||||
// Copyright (C) 2002-2007 Nikolaus Gebhardt
|
||||
// Copyright (C) 2002-2008 Nikolaus Gebhardt
|
||||
// This file is part of the "Irrlicht Engine".
|
||||
// For conditions of distribution and use, see copyright notice in irrlicht.h
|
||||
|
||||
@ -18,107 +18,142 @@ namespace scene
|
||||
class IAnimatedMeshSceneNode;
|
||||
class IMeshLoader;
|
||||
|
||||
//! The mesh cache stores already loaded meshes and provides an interface to them.
|
||||
/** You can access it using ISceneManager::getMeshCache(). All existing scene managers
|
||||
will return a pointer to the same mesh cache, because it is shared between them. With
|
||||
this interface, it is possible to manually add new loaded meshes (if
|
||||
ISceneManager::getMesh() is not sufficient), to remove them and to iterate through
|
||||
already loaded meshes. */
|
||||
//! The mesh cache stores already loaded meshes and provides an interface to them.
|
||||
/** You can access it using ISceneManager::getMeshCache(). All existing
|
||||
scene managers will return a pointer to the same mesh cache, because it
|
||||
is shared between them. With this interface, it is possible to manually
|
||||
add new loaded meshes (if ISceneManager::getMesh() is not sufficient),
|
||||
to remove them and to iterate through already loaded meshes. */
|
||||
class IMeshCache : public virtual IReferenceCounted
|
||||
{
|
||||
public:
|
||||
|
||||
//! destructor
|
||||
//! Destructor
|
||||
virtual ~IMeshCache() {}
|
||||
|
||||
//! Adds a mesh to the internal list of loaded meshes.
|
||||
/** Usually, ISceneManager::getMesh() is called to load a mesh from a file.
|
||||
That method searches the list of loaded meshes if a mesh has already been loaded and
|
||||
returns a pointer to if it is in that list and already in memory. Otherwise it loads
|
||||
the mesh. With IMeshCache::addMesh(), it is possible to pretend that a mesh already
|
||||
has been loaded. This method can be used for example by mesh loaders who need to
|
||||
load more than one mesh with one call. They can add additional meshes with this
|
||||
method to the scene manager. The COLLADA loader for example uses this method.
|
||||
\param filename: Filename of the mesh. When called ISceneManager::getMesh() with this
|
||||
parameter, the method will return the mesh parameter given with this method.
|
||||
\param mesh: Pointer to a mesh which will now be referenced by this name. */
|
||||
/** Usually, ISceneManager::getMesh() is called to load a mesh
|
||||
from a file. That method searches the list of loaded meshes if
|
||||
a mesh has already been loaded and returns a pointer to if it
|
||||
is in that list and already in memory. Otherwise it loads the
|
||||
mesh. With IMeshCache::addMesh(), it is possible to pretend
|
||||
that a mesh already has been loaded. This method can be used
|
||||
for example by mesh loaders who need to load more than one mesh
|
||||
with one call. They can add additional meshes with this method
|
||||
to the scene manager. The COLLADA loader for example uses this
|
||||
method.
|
||||
\param filename Filename of the mesh. When calling
|
||||
ISceneManager::getMesh() with this name it will return the mesh
|
||||
set by this method.
|
||||
\param mesh Pointer to a mesh which will now be referenced by
|
||||
this name. */
|
||||
virtual void addMesh(const c8* filename, IAnimatedMesh* mesh) = 0;
|
||||
|
||||
//! Removes a mesh from the cache.
|
||||
/** After loading a mesh with getMesh(), the mesh can be removed from the cache
|
||||
using this method, freeing a lot of memory. */
|
||||
/** After loading a mesh with getMesh(), the mesh can be
|
||||
removed from the cache using this method, freeing a lot of
|
||||
memory.
|
||||
\param mesh Pointer to the mesh which shall be removed. */
|
||||
virtual void removeMesh(const IAnimatedMesh* const mesh) = 0;
|
||||
|
||||
//! Removes a mesh from the cache.
|
||||
/** After loading a mesh with getMesh(), the mesh can be removed from the cache
|
||||
using this method, freeing a lot of memory. */
|
||||
/** After loading a mesh with getMesh(), the mesh can be
|
||||
removed from the cache using this method, freeing a lot of
|
||||
memory.
|
||||
\param mesh Pointer to the mesh which shall be removed. */
|
||||
virtual void removeMesh(const IMesh* const mesh) = 0;
|
||||
|
||||
//! Returns amount of loaded meshes in the cache.
|
||||
/** You can load new meshes into the cache using getMesh() and addMesh().
|
||||
If you ever need to access the internal mesh cache, you can do this using
|
||||
removeMesh(), getMeshNumber(), getMeshByIndex() and getMeshFilename() */
|
||||
/** You can load new meshes into the cache using getMesh() and
|
||||
addMesh(). If you ever need to access the internal mesh cache,
|
||||
you can do this using removeMesh(), getMeshNumber(),
|
||||
getMeshByIndex() and getMeshFilename().
|
||||
\return Number of meshes in cache. */
|
||||
virtual u32 getMeshCount() const = 0;
|
||||
|
||||
//! Returns current index number of the mesh, and -1 if it is not in the cache.
|
||||
/** \param mesh Pointer to the mesh to search for.
|
||||
\return Index of the mesh in the cache, or -1 if not found. */
|
||||
virtual s32 getMeshIndex(const IAnimatedMesh* const mesh) const = 0;
|
||||
|
||||
//! Returns current index number of the mesh, and -1 if it is not in the cache.
|
||||
/** \param mesh Pointer to the mesh to search for.
|
||||
\return Index of the mesh in the cache, or -1 if not found. */
|
||||
virtual s32 getMeshIndex(const IMesh* const mesh) const = 0;
|
||||
|
||||
//! Returns a mesh based on its index number.
|
||||
/** \param index: Index of the mesh, number between 0 and getMeshCount()-1.
|
||||
Note that this number is only valid until a new mesh is loaded or removed *
|
||||
\return Returns pointer to the mesh or 0 if there is none with this number. */
|
||||
/** \param index: Index of the mesh, number between 0 and
|
||||
getMeshCount()-1.
|
||||
Note that this number is only valid until a new mesh is loaded
|
||||
or removed.
|
||||
\return Pointer to the mesh or 0 if there is none with this
|
||||
number. */
|
||||
virtual IAnimatedMesh* getMeshByIndex(u32 index) = 0;
|
||||
|
||||
//! Returns a mesh based on its file name.
|
||||
/** \return Returns pointer to the mesh or 0 if there is none with this number. */
|
||||
//! Returns a mesh based on its filename.
|
||||
/** \param filename Name of the mesh.
|
||||
\return Pointer to the mesh or 0 if there is none with this number. */
|
||||
virtual IAnimatedMesh* getMeshByFilename(const c8* filename) = 0;
|
||||
|
||||
//! Returns name of a mesh based on its index number.
|
||||
//! Get the filename of a loaded mesh, based on its index.
|
||||
/** \param index: Index of the mesh, number between 0 and getMeshCount()-1.
|
||||
Note that this is only valid until a new mesh is loaded */
|
||||
\return String with name if mesh was found and has a name, else
|
||||
0. */
|
||||
virtual const c8* getMeshFilename(u32 index) const = 0;
|
||||
|
||||
//! Returns the filename of a loaded mesh, if there is any.
|
||||
/** Returns 0 if there is none. */
|
||||
//! Get the filename of a loaded mesh, if there is any.
|
||||
/** \param mesh Pointer to mesh to query.
|
||||
\return String with name if mesh was found and has a name, else
|
||||
0. */
|
||||
virtual const c8* getMeshFilename(const IAnimatedMesh* const mesh) const = 0;
|
||||
|
||||
//! Returns the filename of a loaded mesh, if there is any.
|
||||
/* Returns 0 if there is none.*/
|
||||
//! Get the filename of a loaded mesh, if there is any.
|
||||
/** \param mesh Pointer to mesh to query.
|
||||
\return String with name if mesh was found and has a name, else
|
||||
0. */
|
||||
virtual const c8* getMeshFilename(const IMesh* const mesh) const = 0;
|
||||
|
||||
//! Renames a loaded mesh, if possible.
|
||||
/** Returns true if sucessful. Note that renaming meshes might change
|
||||
the ordering of the meshes, and so the index of the meshes as returned by
|
||||
getMeshIndex() or taken by some methods will change. */
|
||||
//! Renames a loaded mesh.
|
||||
/** Note that renaming meshes might change the ordering of the
|
||||
meshes, and so the index of the meshes as returned by
|
||||
getMeshIndex() or taken by some methods will change.
|
||||
\param index The index of the mesh in the cache.
|
||||
\param filename New name for the mesh.
|
||||
\return True if mesh was renamed. */
|
||||
virtual bool setMeshFilename(u32 index, const c8* filename) = 0;
|
||||
|
||||
//! Renames a loaded mesh, if possible.
|
||||
/** Returns true if sucessful. Note that renaming meshes might change
|
||||
the ordering of the meshes, and so the index of the meshes as returned by
|
||||
getMeshIndex() or taken by some methods will change. */
|
||||
//! Renames a loaded mesh.
|
||||
/** Note that renaming meshes might change the ordering of the
|
||||
meshes, and so the index of the meshes as returned by
|
||||
getMeshIndex() or taken by some methods will change.
|
||||
\param mesh Mesh to be renamed.
|
||||
\param filename New name for the mesh.
|
||||
\return True if mesh was renamed. */
|
||||
virtual bool setMeshFilename(const IAnimatedMesh* const mesh, const c8* filename) = 0;
|
||||
|
||||
//! Renames a loaded mesh, if possible.
|
||||
/** Returns true if sucessful. Note that renaming meshes might change
|
||||
the ordering of the meshes, and so the index of the meshes as returned by
|
||||
getMeshIndex() or taken by some methods will change. */
|
||||
//! Renames a loaded mesh.
|
||||
/** Note that renaming meshes might change the ordering of the
|
||||
meshes, and so the index of the meshes as returned by
|
||||
getMeshIndex() or taken by some methods will change.
|
||||
\param mesh Mesh to be renamed.
|
||||
\param filename New name for the mesh.
|
||||
\return True if mesh was renamed. */
|
||||
virtual bool setMeshFilename(const IMesh* const mesh, const c8* filename) = 0;
|
||||
|
||||
//! returns if a mesh already was loaded
|
||||
//! Check if a mesh was already loaded.
|
||||
/** \param filename Name of the mesh.
|
||||
\return True if the mesh has been loaded, else false. */
|
||||
virtual bool isMeshLoaded(const c8* filename) = 0;
|
||||
|
||||
//! Clears the whole mesh cache, removing all meshes.
|
||||
/** All meshes will be reloaded completely when using ISceneManager::getMesh()
|
||||
after calling this method.
|
||||
Warning: If you have pointers to meshes that were loaded with ISceneManager::getMesh()
|
||||
after calling this method.
|
||||
Warning: If you have pointers to meshes that were loaded with ISceneManager::getMesh()
|
||||
and you did not grab them, then they may become invalid. */
|
||||
virtual void clear() = 0;
|
||||
|
||||
//! Clears all meshes that are held in the mesh cache but not used anywhere else.
|
||||
/** Warning: If you have pointers to meshes that were loaded with ISceneManager::getMesh()
|
||||
/** Warning: If you have pointers to meshes that were loaded with ISceneManager::getMesh()
|
||||
and you did not grab them, then they may become invalid. */
|
||||
virtual void clearUnusedMeshes() = 0;
|
||||
};
|
||||
|
@ -1,4 +1,4 @@
|
||||
// Copyright (C) 2002-2007 Nikolaus Gebhardt
|
||||
// Copyright (C) 2002-2008 Nikolaus Gebhardt
|
||||
// This file is part of the "Irrlicht Engine".
|
||||
// For conditions of distribution and use, see copyright notice in irrlicht.h
|
||||
|
||||
@ -17,24 +17,28 @@ namespace scene
|
||||
{
|
||||
class IAnimatedMesh;
|
||||
|
||||
//! Class which is able to load an animated mesh from a file.
|
||||
/** If you want the Irrlicht Engine be able to load meshes of
|
||||
currently unsupported file formats (e.g .cob), then implement
|
||||
this and add your new Surface loader with
|
||||
//! Class which is able to load an animated mesh from a file.
|
||||
/** If you want Irrlicht be able to load meshes of
|
||||
currently unsupported file formats (e.g. .cob), then implement
|
||||
this and add your new Meshloader with
|
||||
ISceneManager::addExternalMeshLoader() to the engine. */
|
||||
class IMeshLoader : public virtual IReferenceCounted
|
||||
{
|
||||
public:
|
||||
|
||||
//! destructor
|
||||
//! Destructor
|
||||
virtual ~IMeshLoader() {}
|
||||
|
||||
//! Returns true if the file maybe is able to be loaded by this class.
|
||||
/** This decision should be based only on the file extension (e.g. ".cob") */
|
||||
//! Returns true if the file might be loaded by this class.
|
||||
/** This decision should be based on the file extension (e.g. ".cob")
|
||||
only.
|
||||
\param fileName Name of the file to test.
|
||||
\return True if the file might be loaded by this class. */
|
||||
virtual bool isALoadableFileExtension(const c8* fileName) const = 0;
|
||||
|
||||
//! Creates/loads an animated mesh from the file.
|
||||
/** \return Pointer to the created mesh. Returns 0 if loading failed.
|
||||
/** \param file File handler to load the file from.
|
||||
\return Pointer to the created mesh. Returns 0 if loading failed.
|
||||
If you no longer need the mesh, you should call IAnimatedMesh::drop().
|
||||
See IReferenceCounted::drop() for more information. */
|
||||
virtual IAnimatedMesh* createMesh(io::IReadFile* file) = 0;
|
||||
|
@ -1,4 +1,4 @@
|
||||
// Copyright (C) 2002-2007 Nikolaus Gebhardt
|
||||
// Copyright (C) 2002-2008 Nikolaus Gebhardt
|
||||
// This file is part of the "Irrlicht Engine".
|
||||
// For conditions of distribution and use, see copyright notice in irrlicht.h
|
||||
|
||||
@ -21,96 +21,125 @@ namespace scene
|
||||
class IMeshBuffer;
|
||||
struct SMesh;
|
||||
|
||||
//! An interface for easily manipulate meshes.
|
||||
/** Scale, set alpha value, flip surfaces, and so on. This exists for fixing problems
|
||||
with wrong imported or exported meshes quickly after loading. It is not intended for doing mesh
|
||||
modifications and/or animations during runtime.
|
||||
//! An interface for easy manipulation of meshes.
|
||||
/** Scale, set alpha value, flip surfaces, and so on. This exists for
|
||||
fixing problems with wrong imported or exported meshes quickly after
|
||||
loading. It is not intended for doing mesh modifications and/or
|
||||
animations during runtime.
|
||||
*/
|
||||
class IMeshManipulator : public virtual IReferenceCounted
|
||||
{
|
||||
public:
|
||||
|
||||
//! destructor
|
||||
//! Destructor
|
||||
virtual ~IMeshManipulator() {}
|
||||
|
||||
//! Flips the direction of surfaces.
|
||||
//! Flips the direction of surfaces.
|
||||
/** Changes backfacing triangles to frontfacing
|
||||
triangles and vice versa.
|
||||
\param mesh: Mesh on which the operation is performed. */
|
||||
\param mesh Mesh on which the operation is performed. */
|
||||
virtual void flipSurfaces(IMesh* mesh) const = 0;
|
||||
|
||||
//! Sets the alpha vertex color value of the whole mesh to a new value.
|
||||
/** \param mesh: Mesh on which the operation is performed.
|
||||
\param alpha: New alpha value. Must be a value between 0 and 255. */
|
||||
/** \param mesh Mesh on which the operation is performed.
|
||||
\param alpha New alpha value. Must be a value between 0 and 255. */
|
||||
virtual void setVertexColorAlpha(IMesh* mesh, s32 alpha) const = 0;
|
||||
|
||||
//! Sets the colors of all vertices to one color
|
||||
/** \param mesh Mesh on which the operation is performed.
|
||||
\param color New color. */
|
||||
virtual void setVertexColors(IMesh* mesh, video::SColor color) const = 0;
|
||||
|
||||
//! Recalculates all normals of the mesh.
|
||||
/** \param mesh: Mesh on which the operation is performed.
|
||||
\param smooth: If the normals shall be smoothed. */
|
||||
\param smooth: If the normals shall be smoothed. */
|
||||
virtual void recalculateNormals(IMesh* mesh, bool smooth = false) const = 0;
|
||||
|
||||
//! Recalculates all normals of the mesh buffer.
|
||||
/** \param buffer: Mesh buffer on which the operation is performed.
|
||||
\param smooth: If the normals shall be smoothed. */
|
||||
\param smooth: If the normals shall be smoothed. */
|
||||
virtual void recalculateNormals(IMeshBuffer* buffer, bool smooth = false) const = 0;
|
||||
|
||||
//! Scales the whole mesh.
|
||||
/** \param mesh: Mesh on which the operation is performed.
|
||||
\param scale: Scale factor. */
|
||||
\param scale: Scale factor. */
|
||||
virtual void scaleMesh(IMesh* mesh, const core::vector3df& scale) const = 0;
|
||||
|
||||
//! Applies a transformation
|
||||
/** \param mesh: Mesh on which the operation is performed.
|
||||
\param m: transformation matrix. */
|
||||
\param m: transformation matrix. */
|
||||
virtual void transformMesh(IMesh* mesh, const core::matrix4& m) const = 0;
|
||||
|
||||
//! Clones a static IMesh into a modifyable SMesh.
|
||||
//! Clones a static IMesh into a modifiable SMesh.
|
||||
/** All meshbuffers in the returned SMesh
|
||||
are of type SMeshBuffer or SMeshBufferLightMap.
|
||||
\param mesh: Mesh to copy.
|
||||
\return Returns the cloned mesh.
|
||||
If you no longer need the cloned mesh, you should call SMesh::drop().
|
||||
See IReferenceCounted::drop() for more information. */
|
||||
\return Returns the cloned mesh. If you no longer need the
|
||||
cloned mesh, you should call SMesh::drop(). See
|
||||
IReferenceCounted::drop() for more information. */
|
||||
virtual SMesh* createMeshCopy(IMesh* mesh) const = 0;
|
||||
|
||||
|
||||
//! Creates a planar texture mapping on the mesh
|
||||
/** \param mesh: Mesh on which the operation is performed.
|
||||
\param resolution: resolution of the planar mapping. This is the value
|
||||
specifying which is the relation between world space and
|
||||
texture coordinate space. */
|
||||
\param resolution: resolution of the planar mapping. This is
|
||||
the value specifying which is the relation between world space
|
||||
and texture coordinate space. */
|
||||
virtual void makePlanarTextureMapping(IMesh* mesh, f32 resolution=0.001f) const = 0;
|
||||
|
||||
//! Creates a copy of the mesh, which will only consist of S3DVertexTangents vertices.
|
||||
/** This is useful if you want to draw tangent space normal mapped geometry because
|
||||
it calculates the tangent and binormal data which is needed there.
|
||||
\param mesh: Input mesh
|
||||
\return Mesh consiting only of S3DVertexTangents vertices.
|
||||
If you no longer need the cloned mesh, you should call IMesh::drop().
|
||||
See IReferenceCounted::drop() for more information. */
|
||||
/** This is useful if you want to draw tangent space normal
|
||||
mapped geometry because it calculates the tangent and binormal
|
||||
data which is needed there.
|
||||
\param mesh Input mesh
|
||||
\return Mesh consisting only of S3DVertexTangents vertices. If
|
||||
you no longer need the cloned mesh, you should call
|
||||
IMesh::drop(). See IReferenceCounted::drop() for more
|
||||
information. */
|
||||
virtual IMesh* createMeshWithTangents(IMesh* mesh) const = 0;
|
||||
|
||||
//! Creates a copy of the mesh, which will only consist of S3DVertex2TCoord vertices.
|
||||
/** \param mesh Input mesh
|
||||
\return Mesh consisting only of S3DVertex2TCoord vertices. If
|
||||
you no longer need the cloned mesh, you should call
|
||||
IMesh::drop(). See IReferenceCounted::drop() for more
|
||||
information. */
|
||||
virtual IMesh* createMeshWith2TCoords(IMesh* mesh) const = 0;
|
||||
|
||||
//! Creates a copy of a mesh with all vertices unwelded
|
||||
/** \param mesh Input mesh
|
||||
\return Mesh consisting only of unique faces. All vertices
|
||||
which were previously shared are now duplicated. If you no
|
||||
longer need the cloned mesh, you should call IMesh::drop(). See
|
||||
IReferenceCounted::drop() for more information. */
|
||||
virtual IMesh* createMeshUniquePrimitives(IMesh* mesh) const = 0;
|
||||
|
||||
//! Creates a copy of a mesh with vertices welded
|
||||
/** \param mesh Input mesh
|
||||
\param tolerance The threshold for vertex comparisons.
|
||||
\return Mesh without redundant vertices. If you no longer need
|
||||
the cloned mesh, you should call IMesh::drop(). See
|
||||
IReferenceCounted::drop() for more information. */
|
||||
virtual IMesh* createMeshWelded(IMesh* mesh, f32 tolerance=core::ROUNDING_ERROR_32) const = 0;
|
||||
|
||||
//! Returns amount of polygons in mesh.
|
||||
//! Get amount of polygons in mesh.
|
||||
/** \param mesh Input mesh
|
||||
\return Number of polygons in mesh. */
|
||||
virtual s32 getPolyCount(IMesh* mesh) const = 0;
|
||||
|
||||
//! Returns amount of polygons in mesh.
|
||||
//! Get amount of polygons in mesh.
|
||||
/** \param mesh Input mesh
|
||||
\return Number of polygons in mesh. */
|
||||
virtual s32 getPolyCount(IAnimatedMesh* mesh) const = 0;
|
||||
|
||||
//! create a new AnimatedMesh and adds the mesh to it
|
||||
//! Create a new AnimatedMesh and adds the mesh to it
|
||||
/** \param mesh Input mesh
|
||||
\param type The type of the animated mesh to create.
|
||||
\return Newly created animated mesh with mesh as it's only
|
||||
content. When you don't need the animated mesh anymore, you
|
||||
should call IAnimatedMesh::drop(). See
|
||||
IReferenceCounted::drop() for more information. */
|
||||
virtual IAnimatedMesh * createAnimatedMesh(IMesh* mesh,
|
||||
scene::E_ANIMATED_MESH_TYPE type = scene::EAMT_UNKNOWN) const = 0;
|
||||
|
||||
};
|
||||
|
||||
} // end namespace scene
|
||||
|
@ -1,4 +1,4 @@
|
||||
// Copyright (C) 2002-2007 Nikolaus Gebhardt
|
||||
// Copyright (C) 2002-2008 Nikolaus Gebhardt
|
||||
// This file is part of the "Irrlicht Engine".
|
||||
// For conditions of distribution and use, see copyright notice in irrlicht.h
|
||||
|
||||
@ -20,24 +20,32 @@ class IMeshSceneNode : public ISceneNode
|
||||
{
|
||||
public:
|
||||
|
||||
//! constructor
|
||||
IMeshSceneNode(ISceneNode* parent, ISceneManager* mgr, s32 id,
|
||||
const core::vector3df& position, const core::vector3df& rotation,
|
||||
//! Constructor
|
||||
/** Use setMesh() to set the mesh to display.
|
||||
*/
|
||||
IMeshSceneNode(ISceneNode* parent, ISceneManager* mgr, s32 id,
|
||||
const core::vector3df& position,
|
||||
const core::vector3df& rotation,
|
||||
const core::vector3df& scale)
|
||||
: ISceneNode(parent, mgr, id, position, rotation, scale) {}
|
||||
|
||||
//! Sets a new mesh to display
|
||||
/** \param mesh Mesh to display. */
|
||||
virtual void setMesh(IMesh* mesh) = 0;
|
||||
|
||||
//! Returns the current mesh
|
||||
//! Get the currently defined mesh for display.
|
||||
/** \return Pointer to mesh which is displayed by this node. */
|
||||
virtual IMesh* getMesh(void) = 0;
|
||||
|
||||
//! Sets if the scene node should not copy the materials of the mesh but use them in a read only style.
|
||||
/* In this way it is possible to change the materials a mesh causing all mesh scene nodes
|
||||
referencing this mesh to change too. */
|
||||
/** In this way it is possible to change the materials of a mesh
|
||||
causing all mesh scene nodes referencing this mesh to change, too.
|
||||
\param readonly Flag if the materials shall be read-only. */
|
||||
virtual void setReadOnlyMaterials(bool readonly) = 0;
|
||||
|
||||
//! Returns if the scene node should not copy the materials of the mesh but use them in a read only style
|
||||
//! Check if the scene node should not copy the materials of the mesh but use them in a read only style
|
||||
/** This flag can be set by setReadOnlyMaterials().
|
||||
\return Whether the materials are read-only. */
|
||||
virtual bool isReadOnlyMaterials() const = 0;
|
||||
};
|
||||
|
||||
|
@ -1,3 +1,7 @@
|
||||
// Copyright (C) 2002-2008 Nikolaus Gebhardt
|
||||
// This file is part of the "Irrlicht Engine".
|
||||
// For conditions of distribution and use, see copyright notice in irrlicht.h
|
||||
|
||||
#ifndef __IRR_I_MESH_WRITER_H_INCLUDED__
|
||||
#define __IRR_I_MESH_WRITER_H_INCLUDED__
|
||||
|
||||
@ -15,24 +19,30 @@ namespace scene
|
||||
{
|
||||
class IMesh;
|
||||
|
||||
// interface for writing meshes
|
||||
//! Interface for writing meshes
|
||||
class IMeshWriter : public virtual IReferenceCounted
|
||||
{
|
||||
public:
|
||||
|
||||
//! Destructor
|
||||
virtual ~IMeshWriter() {}
|
||||
|
||||
//! Returns the type of the mesh writer
|
||||
/** For own implementations, use MAKE_IRR_ID as shown in the EMESH_WRITER_TYPE
|
||||
enumeration to return your own unique mesh type id.*/
|
||||
//! Get the type of the mesh writer
|
||||
/** For own implementations, use MAKE_IRR_ID as shown in the
|
||||
EMESH_WRITER_TYPE enumeration to return your own unique mesh
|
||||
type id.
|
||||
\return Type of the mesh writer. */
|
||||
virtual EMESH_WRITER_TYPE getType() const = 0;
|
||||
|
||||
//! writes a static mesh
|
||||
/** \return Returns true if sucessful */
|
||||
//! Write a static mesh.
|
||||
/** \param file File handle to write the mesh to.
|
||||
\param mesh Pointer to mesh to be written.
|
||||
\param flags Optional flags to set properties of the writer.
|
||||
\return True if sucessful */
|
||||
virtual bool writeMesh(io::IWriteFile* file, scene::IMesh* mesh,
|
||||
s32 flags=EMWF_NONE) = 0;
|
||||
|
||||
// writes an animated mesh
|
||||
// Writes an animated mesh
|
||||
// for future use, no writer is able to write animated meshes currently
|
||||
/* \return Returns true if sucessful */
|
||||
//virtual bool writeAnimatedMesh(io::IWriteFile* file,
|
||||
|
@ -1,4 +1,4 @@
|
||||
// Copyright (C) 2002-2007 Nikolaus Gebhardt
|
||||
// Copyright (C) 2002-2008 Nikolaus Gebhardt
|
||||
// This file is part of the "Irrlicht Engine".
|
||||
// For conditions of distribution and use, see copyright notice in irrlicht.h
|
||||
|
||||
@ -14,22 +14,21 @@ namespace scene
|
||||
|
||||
//! Interface for making multiple triangle selectors work as one big selector.
|
||||
/** This is nothing more than a collection of one or more triangle selectors
|
||||
providing together the interface of one triangle selector. In this way,
|
||||
providing together the interface of one triangle selector. In this way,
|
||||
collision tests can be done with different triangle soups in one pass.
|
||||
*/
|
||||
class IMetaTriangleSelector : public ITriangleSelector
|
||||
{
|
||||
public:
|
||||
|
||||
//! Adds a triangle selector to the collection of triangle selectors
|
||||
//! in this metaTriangleSelector.
|
||||
//! \param toAdd: Pointer to an triangle selector to add to the list.
|
||||
virtual void addTriangleSelector(ITriangleSelector* toAdd) = 0;
|
||||
//! Adds a triangle selector to the collection of triangle selectors.
|
||||
/** \param toAdd: Pointer to an triangle selector to add to the list. */
|
||||
virtual void addTriangleSelector(ITriangleSelector* toAdd) = 0;
|
||||
|
||||
//! Removes a specific triangle selector which was added before from the collection.
|
||||
//! \param toRemove: Pointer to an triangle selector which is in the list
|
||||
//! but will be removed.
|
||||
//! \return Returns true if successful, false if not.
|
||||
//! Removes a specific triangle selector from the collection.
|
||||
/** \param toRemove: Pointer to an triangle selector which is in the
|
||||
list but will be removed.
|
||||
\return True if successful, false if not. */
|
||||
virtual bool removeTriangleSelector(ITriangleSelector* toRemove) = 0;
|
||||
|
||||
//! Removes all triangle selectors from the collection.
|
||||
|
@ -1,4 +1,4 @@
|
||||
// Copyright (C) 2002-2007 Nikolaus Gebhardt
|
||||
// Copyright (C) 2002-2008 Nikolaus Gebhardt
|
||||
// This file is part of the "Irrlicht Engine".
|
||||
// For conditions of distribution and use, see copyright notice in irrlicht.h
|
||||
|
||||
@ -15,28 +15,28 @@ class IOSOperator : public virtual IReferenceCounted
|
||||
{
|
||||
public:
|
||||
|
||||
//! destructor
|
||||
//! Destructor
|
||||
virtual ~IOSOperator() {}
|
||||
|
||||
//! returns the current operation system version as string.
|
||||
//! Get the current operation system version as string.
|
||||
virtual const wchar_t* getOperationSystemVersion() const = 0;
|
||||
|
||||
//! copies text to the clipboard
|
||||
//! Copies text to the clipboard
|
||||
virtual void copyToClipboard(const c8* text) const = 0;
|
||||
|
||||
//! gets text from the clipboard
|
||||
//! \return Returns 0 if no string is in there.
|
||||
virtual c8* getTextFromClipboard() const = 0;
|
||||
//! Get text from the clipboard
|
||||
/** \return Returns 0 if no string is in there. */
|
||||
virtual c8* getTextFromClipboard() const = 0;
|
||||
|
||||
//! gets the processor speed in megahertz
|
||||
//! \param MHz: The integer variable to store the speed in.
|
||||
//! \return Returns true if successful, false if not
|
||||
//! Get the processor speed in megahertz
|
||||
/** \param MHz The integer variable to store the speed in.
|
||||
\return True if successful, false if not */
|
||||
virtual bool getProcessorSpeedMHz(u32* MHz) const = 0;
|
||||
|
||||
//! gets the total and available system RAM
|
||||
//! \param Total: will contain the total system memory
|
||||
//! \param Avail: will contain the available memory
|
||||
//! \return Returns true if successful, false if not
|
||||
//! Get the total and available system RAM
|
||||
/** \param Total: will contain the total system memory
|
||||
\param Avail: will contain the available memory
|
||||
\return True if successful, false if not */
|
||||
virtual bool getSystemMemory(u32* Total, u32* Avail) const = 0;
|
||||
|
||||
};
|
||||
|
@ -1,4 +1,4 @@
|
||||
// Copyright (C) 2002-2007 Nikolaus Gebhardt
|
||||
// Copyright (C) 2002-2008 Nikolaus Gebhardt
|
||||
// This file is part of the "Irrlicht Engine".
|
||||
// For conditions of distribution and use, see copyright notice in irrlicht.h
|
||||
|
||||
|
@ -1,4 +1,4 @@
|
||||
// Copyright (C) 2002-2007 Nikolaus Gebhardt
|
||||
// Copyright (C) 2002-2008 Nikolaus Gebhardt
|
||||
// This file is part of the "Irrlicht Engine".
|
||||
// For conditions of distribution and use, see copyright notice in irrlicht.h
|
||||
|
||||
@ -28,7 +28,7 @@ public:
|
||||
virtual void setNormalDirectionModifier( f32 normalDirectionModifier ) = 0;
|
||||
|
||||
//! Sets whether to emit min<->max particles for every vertex per
|
||||
//! second, or to pick min<->max vertices every second
|
||||
//! second, or to pick min<->max vertices every second
|
||||
virtual void setEveryMeshVertex( bool everyMeshVertex = true ) = 0;
|
||||
|
||||
//! Get Mesh we're emitting particles from
|
||||
@ -41,7 +41,7 @@ public:
|
||||
virtual f32 getNormalDirectionModifier() const = 0;
|
||||
|
||||
//! Gets whether to emit min<->max particles for every vertex per
|
||||
//! second, or to pick min<->max vertices every second
|
||||
//! second, or to pick min<->max vertices every second
|
||||
virtual bool getEveryMeshVertex() const = 0;
|
||||
|
||||
//! Get emitter type
|
||||
|
@ -1,4 +1,4 @@
|
||||
// Copyright (C) 2002-2007 Nikolaus Gebhardt
|
||||
// Copyright (C) 2002-2008 Nikolaus Gebhardt
|
||||
// This file is part of the "Irrlicht Engine".
|
||||
// For conditions of distribution and use, see copyright notice in irrlicht.h
|
||||
|
||||
|
@ -1,4 +1,4 @@
|
||||
// Copyright (C) 2002-2007 Nikolaus Gebhardt
|
||||
// Copyright (C) 2002-2008 Nikolaus Gebhardt
|
||||
// This file is part of the "Irrlicht Engine".
|
||||
// For conditions of distribution and use, see copyright notice in irrlicht.h
|
||||
|
||||
|
@ -1,4 +1,4 @@
|
||||
// Copyright (C) 2002-2007 Nikolaus Gebhardt
|
||||
// Copyright (C) 2002-2008 Nikolaus Gebhardt
|
||||
// This file is part of the "Irrlicht Engine".
|
||||
// For conditions of distribution and use, see copyright notice in irrlicht.h
|
||||
|
||||
|
@ -1,4 +1,4 @@
|
||||
// Copyright (C) 2002-2007 Nikolaus Gebhardt
|
||||
// Copyright (C) 2002-2008 Nikolaus Gebhardt
|
||||
// This file is part of the "Irrlicht Engine".
|
||||
// For conditions of distribution and use, see copyright notice in irrlicht.h
|
||||
|
||||
|
@ -1,4 +1,4 @@
|
||||
// Copyright (C) 2002-2007 Nikolaus Gebhardt
|
||||
// Copyright (C) 2002-2008 Nikolaus Gebhardt
|
||||
// This file is part of the "Irrlicht Engine".
|
||||
// For conditions of distribution and use, see copyright notice in irrlicht.h
|
||||
|
||||
|
@ -1,4 +1,4 @@
|
||||
// Copyright (C) 2002-2007 Nikolaus Gebhardt
|
||||
// Copyright (C) 2002-2008 Nikolaus Gebhardt
|
||||
// This file is part of the "Irrlicht Engine".
|
||||
// For conditions of distribution and use, see copyright notice in irrlicht.h
|
||||
|
||||
|
@ -1,4 +1,4 @@
|
||||
// Copyright (C) 2002-2007 Nikolaus Gebhardt
|
||||
// Copyright (C) 2002-2008 Nikolaus Gebhardt
|
||||
// This file is part of the "Irrlicht Engine".
|
||||
// For conditions of distribution and use, see copyright notice in irrlicht.h
|
||||
|
||||
@ -27,7 +27,7 @@ public:
|
||||
//! Set the amount that the normal is divided by for getting a particles direction
|
||||
virtual void setNormalDirectionModifier( f32 normalDirectionModifier ) = 0;
|
||||
|
||||
//! Sets whether to emit min<->max particles for every vertex per second, or to pick
|
||||
//! Sets whether to emit min<->max particles for every vertex per second, or to pick
|
||||
//! min<->max vertices every second
|
||||
virtual void setEveryMeshVertex( bool everyMeshVertex = true ) = 0;
|
||||
|
||||
@ -40,7 +40,7 @@ public:
|
||||
//! Get the amount that the normal is divided by for getting a particles direction
|
||||
virtual f32 getNormalDirectionModifier() const = 0;
|
||||
|
||||
//! Gets whether to emit min<->max particles for every vertex per second, or to pick
|
||||
//! Gets whether to emit min<->max particles for every vertex per second, or to pick
|
||||
//! min<->max vertices every second
|
||||
virtual bool getEveryMeshVertex() const = 0;
|
||||
|
||||
|
@ -1,4 +1,4 @@
|
||||
// Copyright (C) 2002-2007 Nikolaus Gebhardt
|
||||
// Copyright (C) 2002-2008 Nikolaus Gebhardt
|
||||
// This file is part of the "Irrlicht Engine".
|
||||
// For conditions of distribution and use, see copyright notice in irrlicht.h
|
||||
|
||||
|
@ -1,4 +1,4 @@
|
||||
// Copyright (C) 2002-2007 Nikolaus Gebhardt
|
||||
// Copyright (C) 2002-2008 Nikolaus Gebhardt
|
||||
// This file is part of the "Irrlicht Engine".
|
||||
// For conditions of distribution and use, see copyright notice in irrlicht.h
|
||||
|
||||
|
@ -1,4 +1,4 @@
|
||||
// Copyright (C) 2002-2007 Nikolaus Gebhardt
|
||||
// Copyright (C) 2002-2008 Nikolaus Gebhardt
|
||||
// This file is part of the "Irrlicht Engine".
|
||||
// For conditions of distribution and use, see copyright notice in irrlicht.h
|
||||
|
||||
|
@ -1,4 +1,4 @@
|
||||
// Copyright (C) 2002-2007 Nikolaus Gebhardt
|
||||
// Copyright (C) 2002-2008 Nikolaus Gebhardt
|
||||
// This file is part of the "Irrlicht Engine".
|
||||
// For conditions of distribution and use, see copyright notice in irrlicht.h
|
||||
|
||||
@ -47,7 +47,7 @@ class IParticleSystemSceneNode : public ISceneNode
|
||||
{
|
||||
public:
|
||||
|
||||
//! constructor
|
||||
//! Constructor
|
||||
IParticleSystemSceneNode(ISceneNode* parent, ISceneManager* mgr, s32 id,
|
||||
const core::vector3df& position = core::vector3df(0,0,0),
|
||||
const core::vector3df& rotation = core::vector3df(0,0,0),
|
||||
@ -58,68 +58,76 @@ public:
|
||||
virtual void setParticleSize(
|
||||
const core::dimension2d<f32> &size = core::dimension2d<f32>(5.0f, 5.0f)) = 0;
|
||||
|
||||
//! Sets if the particles should be global. If it is, the particles are affected by
|
||||
//! the movement of the particle system scene node too, otherwise they completely
|
||||
//! ignore it. Default is true.
|
||||
//! Sets if the particles should be global.
|
||||
/** If it is, the particles are affected by the movement of the
|
||||
particle system scene node too, otherwise they completely ignore it.
|
||||
Default is true. */
|
||||
virtual void setParticlesAreGlobal(bool global) = 0;
|
||||
|
||||
//! Sets the particle emitter, which creates the particles.
|
||||
//! A particle emitter can be created using one of the
|
||||
//! methods. For example to create and use a simple PointEmitter,
|
||||
//! call IParticleEmitter* p = createPointEmitter(); setEmitter(p); p->drop();
|
||||
//! \param emitter: Sets the particle emitter. You can set this to 0
|
||||
//! for removing the current emitter and stopping the particle system
|
||||
//! emitting new particles.
|
||||
/** A particle emitter can be created using one of the methods. For
|
||||
example to create and use a simple PointEmitter, call
|
||||
IParticleEmitter* p = createPointEmitter(); setEmitter(p); p->drop();
|
||||
\param emitter: Sets the particle emitter. You can set this to 0 for
|
||||
removing the current emitter and stopping the particle system emitting
|
||||
new particles. */
|
||||
virtual void setEmitter(IParticleEmitter* emitter) = 0;
|
||||
|
||||
//! Adds new particle effector to the particle system. A particle
|
||||
//! affector modifies the particles. For example, the FadeOut
|
||||
//! affector lets all particles fade out after some time. It is created
|
||||
//! and used in this way: IParticleAffector* p = createFadeOutParticleAffector();
|
||||
//! addAffector(p); p->drop();
|
||||
//! Please note that a affector is not necessary for the particle
|
||||
//! system to work.
|
||||
//! \param affector: New affector.
|
||||
//! Adds new particle effector to the particle system.
|
||||
/** A particle affector modifies the particles. For example, the FadeOut
|
||||
affector lets all particles fade out after some time. It is created and
|
||||
used in this way:
|
||||
\code
|
||||
IParticleAffector* p = createFadeOutParticleAffector();
|
||||
addAffector(p);
|
||||
p->drop();
|
||||
\endcode
|
||||
Please note that a affector is not necessary for the particle system to
|
||||
work.
|
||||
\param affector: New affector. */
|
||||
virtual void addAffector(IParticleAffector* affector) = 0;
|
||||
|
||||
//! Removes all particle affectors in the particle system.
|
||||
virtual void removeAllAffectors() = 0;
|
||||
|
||||
//! Creates a particle emitter for an animated mesh scene node
|
||||
//! \param node: Pointer to the animated mesh scene node to emit particles from
|
||||
//! \param useNormalDirection: If true, the direction of each particle created will
|
||||
//! be the normal of the vertex that it's emitting from. The normal is divided by the
|
||||
//! normalDirectionModifier parameter, which defaults to 100.0f.
|
||||
//! \param direction: Direction and speed of particle emission.
|
||||
//! \param normalDirectionModifier: If the emitter is using the normal direction
|
||||
//! then the normal of the vertex that is being emitted from is divided by this number.
|
||||
//! \param mbNumber: This allows you to specify a specific meshBuffer for the IMesh*
|
||||
//! to emit particles from. The default value is -1, which means a random meshBuffer
|
||||
//! picked from all of the meshes meshBuffers will be selected to pick a random vertex from.
|
||||
//! If the value is 0 or greater, it will only pick random vertices from the meshBuffer
|
||||
//! specified by this value.
|
||||
//! \param everyMeshVertex: If true, the emitter will emit between min/max particles every second,
|
||||
//! for every vertex in the mesh, if false, it will emit between min/max particles from random vertices
|
||||
//! in the mesh.
|
||||
//! \param minParticlesPerSecond: Minimal amount of particles emitted
|
||||
//! per second.
|
||||
//! \param maxParticlesPerSecond: Maximal amount of particles emitted
|
||||
//! per second.
|
||||
//! \param minStartColor: Minimal initial start color of a particle.
|
||||
//! The real color of every particle is calculated as random interpolation
|
||||
//! between minStartColor and maxStartColor.
|
||||
//! \param maxStartColor: Maximal initial start color of a particle.
|
||||
//! The real color of every particle is calculated as random interpolation
|
||||
//! between minStartColor and maxStartColor.
|
||||
//! \param lifeTimeMin: Minimal lifetime of a particle, in milliseconds.
|
||||
//! \param lifeTimeMax: Maximal lifetime of a particle, in milliseconds.
|
||||
//! \param maxAngleDegrees: Maximal angle in degrees, the emitting direction
|
||||
//! of the particle will differ from the orignial direction.
|
||||
//! \return Returns a pointer to the created particle emitter.
|
||||
//! To set this emitter as new emitter of this particle system,
|
||||
//! just call setEmitter(). Note that you'll have to drop() the
|
||||
//! returned pointer, after you don't need it any more, see
|
||||
//! IReferenceCounted::drop() for more informations.
|
||||
/** \param node: Pointer to the animated mesh scene node to emit
|
||||
particles from
|
||||
\param useNormalDirection: If true, the direction of each particle
|
||||
created will be the normal of the vertex that it's emitting from. The
|
||||
normal is divided by the normalDirectionModifier parameter, which
|
||||
defaults to 100.0f.
|
||||
\param direction: Direction and speed of particle emission.
|
||||
\param normalDirectionModifier: If the emitter is using the normal
|
||||
direction then the normal of the vertex that is being emitted from is
|
||||
divided by this number.
|
||||
\param mbNumber: This allows you to specify a specific meshBuffer for
|
||||
the IMesh* to emit particles from. The default value is -1, which
|
||||
means a random meshBuffer picked from all of the meshes meshBuffers
|
||||
will be selected to pick a random vertex from. If the value is 0 or
|
||||
greater, it will only pick random vertices from the meshBuffer
|
||||
specified by this value.
|
||||
\param everyMeshVertex: If true, the emitter will emit between min/max
|
||||
particles every second, for every vertex in the mesh, if false, it will
|
||||
emit between min/max particles from random vertices in the mesh.
|
||||
\param minParticlesPerSecond: Minimal amount of particles emitted per
|
||||
second.
|
||||
\param maxParticlesPerSecond: Maximal amount of particles emitted per
|
||||
second.
|
||||
\param minStartColor: Minimal initial start color of a particle. The
|
||||
real color of every particle is calculated as random interpolation
|
||||
between minStartColor and maxStartColor.
|
||||
\param maxStartColor: Maximal initial start color of a particle. The
|
||||
real color of every particle is calculated as random interpolation
|
||||
between minStartColor and maxStartColor.
|
||||
\param lifeTimeMin: Minimal lifetime of a particle, in milliseconds.
|
||||
\param lifeTimeMax: Maximal lifetime of a particle, in milliseconds.
|
||||
\param maxAngleDegrees: Maximal angle in degrees, the emitting
|
||||
direction of the particle will differ from the original direction.
|
||||
\return Pointer to the created particle emitter. To set this emitter
|
||||
as new emitter of this particle system, just call setEmitter(). Note
|
||||
that you'll have to drop() the returned pointer, after you don't need
|
||||
it any more, see IReferenceCounted::drop() for more informations. */
|
||||
virtual IParticleAnimatedMeshSceneNodeEmitter* createAnimatedMeshSceneNodeEmitter(
|
||||
scene::IAnimatedMeshSceneNode* node, bool useNormalDirection = true,
|
||||
const core::vector3df& direction = core::vector3df(0.0f,0.0f,0.0f),
|
||||
@ -132,27 +140,26 @@ public:
|
||||
s32 maxAngleDegrees = 0 ) = 0;
|
||||
|
||||
//! Creates a box particle emitter.
|
||||
//! \param box: The box for the emitter.
|
||||
//! \param direction: Direction and speed of particle emission.
|
||||
//! \param minParticlesPerSecond: Minimal amount of particles emitted
|
||||
//! per second.
|
||||
//! \param maxParticlesPerSecond: Maximal amount of particles emitted
|
||||
//! per second.
|
||||
//! \param minStartColor: Minimal initial start color of a particle.
|
||||
//! The real color of every particle is calculated as random interpolation
|
||||
//! between minStartColor and maxStartColor.
|
||||
//! \param maxStartColor: Maximal initial start color of a particle.
|
||||
//! The real color of every particle is calculated as random interpolation
|
||||
//! between minStartColor and maxStartColor.
|
||||
//! \param lifeTimeMin: Minimal lifetime of a particle, in milliseconds.
|
||||
//! \param lifeTimeMax: Maximal lifetime of a particle, in milliseconds.
|
||||
//! \param maxAngleDegrees: Maximal angle in degrees, the emitting direction
|
||||
//! of the particle will differ from the orignial direction.
|
||||
//! \return Returns a pointer to the created particle emitter.
|
||||
//! To set this emitter as new emitter of this particle system,
|
||||
//! just call setEmitter(). Note that you'll have to drop() the
|
||||
//! returned pointer, after you don't need it any more, see
|
||||
//! IReferenceCounted::drop() for more informations.
|
||||
/** \param box: The box for the emitter.
|
||||
\param direction: Direction and speed of particle emission.
|
||||
\param minParticlesPerSecond: Minimal amount of particles emitted per
|
||||
second.
|
||||
\param maxParticlesPerSecond: Maximal amount of particles emitted per
|
||||
second.
|
||||
\param minStartColor: Minimal initial start color of a particle. The
|
||||
real color of every particle is calculated as random interpolation
|
||||
between minStartColor and maxStartColor.
|
||||
\param maxStartColor: Maximal initial start color of a particle. The
|
||||
real color of every particle is calculated as random interpolation
|
||||
between minStartColor and maxStartColor.
|
||||
\param lifeTimeMin: Minimal lifetime of a particle, in milliseconds.
|
||||
\param lifeTimeMax: Maximal lifetime of a particle, in milliseconds.
|
||||
\param maxAngleDegrees: Maximal angle in degrees, the emitting
|
||||
direction of the particle will differ from the original direction.
|
||||
\return Pointer to the created particle emitter. To set this emitter
|
||||
as new emitter of this particle system, just call setEmitter(). Note
|
||||
that you'll have to drop() the returned pointer, after you don't need
|
||||
it any more, see IReferenceCounted::drop() for more informations. */
|
||||
virtual IParticleBoxEmitter* createBoxEmitter(
|
||||
const core::aabbox3df& box = core::aabbox3df(-10,28,-10,10,30,10),
|
||||
const core::vector3df& direction = core::vector3df(0.0f,0.03f,0.0f),
|
||||
@ -164,29 +171,31 @@ public:
|
||||
s32 maxAngleDegrees=0) = 0;
|
||||
|
||||
//! Creates a particle emitter for emitting from a cylinder
|
||||
//! \param center: The center of the circle at the base of the cylinder
|
||||
//! \param radius: The thickness of the cylinder
|
||||
//! \param normal: Direction of the length of the cylinder
|
||||
//! \param length: The length of the the cylinder
|
||||
//! \param outlineOnly: Whether or not to put points inside the cylinder or on the outline only
|
||||
//! \param direction: Direction and speed of particle emission.
|
||||
//! \param minParticlesPerSecond: Minimal amount of particles emitted per second.
|
||||
//! \param maxParticlesPerSecond: Maximal amount of particles emitted per second.
|
||||
//! \param minStartColor: Minimal initial start color of a particle.
|
||||
//! The real color of every particle is calculated as random interpolation
|
||||
//! between minStartColor and maxStartColor.
|
||||
//! \param maxStartColor: Maximal initial start color of a particle.
|
||||
//! The real color of every particle is calculated as random interpolation
|
||||
//! between minStartColor and maxStartColor.
|
||||
//! \param lifeTimeMin: Minimal lifetime of a particle, in milliseconds.
|
||||
//! \param lifeTimeMax: Maximal lifetime of a particle, in milliseconds.
|
||||
//! \param maxAngleDegrees: Maximal angle in degrees, the emitting direction
|
||||
//! of the particle will differ from the orignial direction.
|
||||
//! \return Returns a pointer to the created particle emitter.
|
||||
//! To set this emitter as new emitter of this particle system,
|
||||
//! just call setEmitter(). Note that you'll have to drop() the
|
||||
//! returned pointer, after you don't need it any more, see
|
||||
//! IReferenceCounted::drop() for more informations.
|
||||
/** \param center: The center of the circle at the base of the cylinder
|
||||
\param radius: The thickness of the cylinder
|
||||
\param normal: Direction of the length of the cylinder
|
||||
\param length: The length of the the cylinder
|
||||
\param outlineOnly: Whether or not to put points inside the cylinder or
|
||||
on the outline only
|
||||
\param direction: Direction and speed of particle emission.
|
||||
\param minParticlesPerSecond: Minimal amount of particles emitted per
|
||||
second.
|
||||
\param maxParticlesPerSecond: Maximal amount of particles emitted per
|
||||
second.
|
||||
\param minStartColor: Minimal initial start color of a particle. The
|
||||
real color of every particle is calculated as random interpolation
|
||||
between minStartColor and maxStartColor.
|
||||
\param maxStartColor: Maximal initial start color of a particle. The
|
||||
real color of every particle is calculated as random interpolation
|
||||
between minStartColor and maxStartColor.
|
||||
\param lifeTimeMin: Minimal lifetime of a particle, in milliseconds.
|
||||
\param lifeTimeMax: Maximal lifetime of a particle, in milliseconds.
|
||||
\param maxAngleDegrees: Maximal angle in degrees, the emitting
|
||||
direction of the particle will differ from the original direction.
|
||||
\return Pointer to the created particle emitter. To set this emitter
|
||||
as new emitter of this particle system, just call setEmitter(). Note
|
||||
that you'll have to drop() the returned pointer, after you don't need
|
||||
it any more, see IReferenceCounted::drop() for more informations. */
|
||||
virtual IParticleCylinderEmitter* createCylinderEmitter(
|
||||
const core::vector3df& center, f32 radius,
|
||||
const core::vector3df& normal, f32 length,
|
||||
@ -199,38 +208,42 @@ public:
|
||||
s32 maxAngleDegrees = 0 ) = 0;
|
||||
|
||||
//! Creates a mesh particle emitter.
|
||||
//! \param mesh: Pointer to mesh to emit particles from
|
||||
//! \param useNormalDirection: If true, the direction of each particle created will
|
||||
//! be the normal of the vertex that it's emitting from. The normal is divided by the
|
||||
//! normalDirectionModifier parameter, which defaults to 100.0f.
|
||||
//! \param direction: Direction and speed of particle emission.
|
||||
//! \param normalDirectionModifier: If the emitter is using the normal direction
|
||||
//! then the normal of the vertex that is being emitted from is divided by this number.
|
||||
//! \param mbNumber: This allows you to specify a specific meshBuffer for the IMesh*
|
||||
//! to emit particles from. The default value is -1, which means a random meshBuffer
|
||||
//! picked from all of the meshes meshBuffers will be selected to pick a random vertex from.
|
||||
//! If the value is 0 or greater, it will only pick random vertices from the meshBuffer
|
||||
//! specified by this value.
|
||||
//! \param everyMeshVertex: If true, the emitter will emit between min/max particles every second,
|
||||
//! for every vertex in the mesh, if false, it will emit between min/max particles from random vertices
|
||||
//! in the mesh.
|
||||
//! \param minParticlesPerSecond: Minimal amount of particles emitted per second.
|
||||
//! \param maxParticlesPerSecond: Maximal amount of particles emitted per second.
|
||||
//! \param minStartColor: Minimal initial start color of a particle.
|
||||
//! The real color of every particle is calculated as random interpolation
|
||||
//! between minStartColor and maxStartColor.
|
||||
//! \param maxStartColor: Maximal initial start color of a particle.
|
||||
//! The real color of every particle is calculated as random interpolation
|
||||
//! between minStartColor and maxStartColor.
|
||||
//! \param lifeTimeMin: Minimal lifetime of a particle, in milliseconds.
|
||||
//! \param lifeTimeMax: Maximal lifetime of a particle, in milliseconds.
|
||||
//! \param maxAngleDegrees: Maximal angle in degrees, the emitting direction
|
||||
//! of the particle will differ from the orignial direction.
|
||||
//! \return Returns a pointer to the created particle emitter.
|
||||
//! To set this emitter as new emitter of this particle system,
|
||||
//! just call setEmitter(). Note that you'll have to drop() the
|
||||
//! returned pointer, after you don't need it any more, see
|
||||
//! IReferenceCounted::drop() for more informations.
|
||||
/** \param mesh: Pointer to mesh to emit particles from
|
||||
\param useNormalDirection: If true, the direction of each particle
|
||||
created will be the normal of the vertex that it's emitting from. The
|
||||
normal is divided by the normalDirectionModifier parameter, which
|
||||
defaults to 100.0f.
|
||||
\param direction: Direction and speed of particle emission.
|
||||
\param normalDirectionModifier: If the emitter is using the normal
|
||||
direction then the normal of the vertex that is being emitted from is
|
||||
divided by this number.
|
||||
\param mbNumber: This allows you to specify a specific meshBuffer for
|
||||
the IMesh* to emit particles from. The default value is -1, which
|
||||
means a random meshBuffer picked from all of the meshes meshBuffers
|
||||
will be selected to pick a random vertex from. If the value is 0 or
|
||||
greater, it will only pick random vertices from the meshBuffer
|
||||
specified by this value.
|
||||
\param everyMeshVertex: If true, the emitter will emit between min/max
|
||||
particles every second, for every vertex in the mesh, if false, it will
|
||||
emit between min/max particles from random vertices in the mesh.
|
||||
\param minParticlesPerSecond: Minimal amount of particles emitted per
|
||||
second.
|
||||
\param maxParticlesPerSecond: Maximal amount of particles emitted per
|
||||
second.
|
||||
\param minStartColor: Minimal initial start color of a particle. The
|
||||
real color of every particle is calculated as random interpolation
|
||||
between minStartColor and maxStartColor.
|
||||
\param maxStartColor: Maximal initial start color of a particle. The
|
||||
real color of every particle is calculated as random interpolation
|
||||
between minStartColor and maxStartColor.
|
||||
\param lifeTimeMin: Minimal lifetime of a particle, in milliseconds.
|
||||
\param lifeTimeMax: Maximal lifetime of a particle, in milliseconds.
|
||||
\param maxAngleDegrees: Maximal angle in degrees, the emitting
|
||||
direction of the particle will differ from the original direction.
|
||||
\return Pointer to the created particle emitter. To set this emitter
|
||||
as new emitter of this particle system, just call setEmitter(). Note
|
||||
that you'll have to drop() the returned pointer, after you don't need
|
||||
it any more, see IReferenceCounted::drop() for more informations. */
|
||||
virtual IParticleMeshEmitter* createMeshEmitter(
|
||||
scene::IMesh* mesh, bool useNormalDirection = true,
|
||||
const core::vector3df& direction = core::vector3df(0.0f,0.0f,0.0f),
|
||||
@ -243,26 +256,25 @@ public:
|
||||
s32 maxAngleDegrees = 0 ) = 0;
|
||||
|
||||
//! Creates a point particle emitter.
|
||||
//! \param direction: Direction and speed of particle emission.
|
||||
//! \param minParticlesPerSecond: Minimal amount of particles emitted
|
||||
//! per second.
|
||||
//! \param maxParticlesPerSecond: Maximal amount of particles emitted
|
||||
//! per second.
|
||||
//! \param minStartColor: Minimal initial start color of a particle.
|
||||
//! The real color of every particle is calculated as random interpolation
|
||||
//! between minStartColor and maxStartColor.
|
||||
//! \param maxStartColor: Maximal initial start color of a particle.
|
||||
//! The real color of every particle is calculated as random interpolation
|
||||
//! between minStartColor and maxStartColor.
|
||||
//! \param lifeTimeMin: Minimal lifetime of a particle, in milliseconds.
|
||||
//! \param lifeTimeMax: Maximal lifetime of a particle, in milliseconds.
|
||||
//! \param maxAngleDegrees: Maximal angle in degrees, the emitting direction
|
||||
//! of the particle will differ from the orignial direction.
|
||||
//! \return Returns a pointer to the created particle emitter.
|
||||
//! To set this emitter as new emitter of this particle system,
|
||||
//! just call setEmitter(). Note that you'll have to drop() the
|
||||
//! returned pointer, after you don't need it any more, see
|
||||
//! IReferenceCounted::drop() for more informations.
|
||||
/** \param direction: Direction and speed of particle emission.
|
||||
\param minParticlesPerSecond: Minimal amount of particles emitted per
|
||||
second.
|
||||
\param maxParticlesPerSecond: Maximal amount of particles emitted per
|
||||
second.
|
||||
\param minStartColor: Minimal initial start color of a particle. The
|
||||
real color of every particle is calculated as random interpolation
|
||||
between minStartColor and maxStartColor.
|
||||
\param maxStartColor: Maximal initial start color of a particle. The
|
||||
real color of every particle is calculated as random interpolation
|
||||
between minStartColor and maxStartColor.
|
||||
\param lifeTimeMin: Minimal lifetime of a particle, in milliseconds.
|
||||
\param lifeTimeMax: Maximal lifetime of a particle, in milliseconds.
|
||||
\param maxAngleDegrees: Maximal angle in degrees, the emitting
|
||||
direction of the particle will differ from the original direction.
|
||||
\return Pointer to the created particle emitter. To set this emitter
|
||||
as new emitter of this particle system, just call setEmitter(). Note
|
||||
that you'll have to drop() the returned pointer, after you don't need
|
||||
it any more, see IReferenceCounted::drop() for more informations. */
|
||||
virtual IParticlePointEmitter* createPointEmitter(
|
||||
const core::vector3df& direction = core::vector3df(0.0f,0.03f,0.0f),
|
||||
u32 minParticlesPerSecond = 5,
|
||||
@ -273,31 +285,30 @@ public:
|
||||
s32 maxAngleDegrees=0) = 0;
|
||||
|
||||
//! Creates a ring particle emitter.
|
||||
//! \param center: Center of ring
|
||||
//! \param radius: Distance of points from center, points will be rotated around the
|
||||
//! Y axis at a random 360 degrees and will then be shifted by the provided ringThickness
|
||||
//! values in each axis.
|
||||
//! \param ringThickness : thickness of the ring or how wide the ring is
|
||||
//! \param direction: Direction and speed of particle emission.
|
||||
//! \param minParticlesPerSecond: Minimal amount of particles emitted
|
||||
//! per second.
|
||||
//! \param maxParticlesPerSecond: Maximal amount of particles emitted
|
||||
//! per second.
|
||||
//! \param minStartColor: Minimal initial start color of a particle.
|
||||
//! The real color of every particle is calculated as random interpolation
|
||||
//! between minStartColor and maxStartColor.
|
||||
//! \param maxStartColor: Maximal initial start color of a particle.
|
||||
//! The real color of every particle is calculated as random interpolation
|
||||
//! between minStartColor and maxStartColor.
|
||||
//! \param lifeTimeMin: Minimal lifetime of a particle, in milliseconds.
|
||||
//! \param lifeTimeMax: Maximal lifetime of a particle, in milliseconds.
|
||||
//! \param maxAngleDegrees: Maximal angle in degrees, the emitting direction
|
||||
//! of the particle will differ from the orignial direction.
|
||||
//! \return Returns a pointer to the created particle emitter.
|
||||
//! To set this emitter as new emitter of this particle system,
|
||||
//! just call setEmitter(). Note that you'll have to drop() the
|
||||
//! returned pointer, after you don't need it any more, see
|
||||
//! IReferenceCounted::drop() for more informations.
|
||||
/** \param center: Center of ring
|
||||
\param radius: Distance of points from center, points will be rotated
|
||||
around the Y axis at a random 360 degrees and will then be shifted by
|
||||
the provided ringThickness values in each axis.
|
||||
\param ringThickness : thickness of the ring or how wide the ring is
|
||||
\param direction: Direction and speed of particle emission.
|
||||
\param minParticlesPerSecond: Minimal amount of particles emitted per
|
||||
second.
|
||||
\param maxParticlesPerSecond: Maximal amount of particles emitted per
|
||||
second.
|
||||
\param minStartColor: Minimal initial start color of a particle. The
|
||||
real color of every particle is calculated as random interpolation
|
||||
between minStartColor and maxStartColor.
|
||||
\param maxStartColor: Maximal initial start color of a particle. The
|
||||
real color of every particle is calculated as random interpolation
|
||||
between minStartColor and maxStartColor.
|
||||
\param lifeTimeMin: Minimal lifetime of a particle, in milliseconds.
|
||||
\param lifeTimeMax: Maximal lifetime of a particle, in milliseconds.
|
||||
\param maxAngleDegrees: Maximal angle in degrees, the emitting
|
||||
direction of the particle will differ from the original direction.
|
||||
\return Pointer to the created particle emitter. To set this emitter
|
||||
as new emitter of this particle system, just call setEmitter(). Note
|
||||
that you'll have to drop() the returned pointer, after you don't need
|
||||
it any more, see IReferenceCounted::drop() for more informations. */
|
||||
virtual IParticleRingEmitter* createRingEmitter(
|
||||
const core::vector3df& center, f32 radius, f32 ringThickness,
|
||||
const core::vector3df& direction = core::vector3df(0.0f,0.03f,0.0f),
|
||||
@ -309,28 +320,27 @@ public:
|
||||
s32 maxAngleDegrees=0) = 0;
|
||||
|
||||
//! Creates a sphere particle emitter.
|
||||
//! \param center: Center of sphere
|
||||
//! \param radius: Radius of sphere
|
||||
//! \param direction: Direction and speed of particle emission.
|
||||
//! \param minParticlesPerSecond: Minimal amount of particles emitted
|
||||
//! per second.
|
||||
//! \param maxParticlesPerSecond: Maximal amount of particles emitted
|
||||
//! per second.
|
||||
//! \param minStartColor: Minimal initial start color of a particle.
|
||||
//! The real color of every particle is calculated as random interpolation
|
||||
//! between minStartColor and maxStartColor.
|
||||
//! \param maxStartColor: Maximal initial start color of a particle.
|
||||
//! The real color of every particle is calculated as random interpolation
|
||||
//! between minStartColor and maxStartColor.
|
||||
//! \param lifeTimeMin: Minimal lifetime of a particle, in milliseconds.
|
||||
//! \param lifeTimeMax: Maximal lifetime of a particle, in milliseconds.
|
||||
//! \param maxAngleDegrees: Maximal angle in degrees, the emitting direction
|
||||
//! of the particle will differ from the orignial direction.
|
||||
//! \return Returns a pointer to the created particle emitter.
|
||||
//! To set this emitter as new emitter of this particle system,
|
||||
//! just call setEmitter(). Note that you'll have to drop() the
|
||||
//! returned pointer, after you don't need it any more, see
|
||||
//! IReferenceCounted::drop() for more informations.
|
||||
/** \param center: Center of sphere
|
||||
\param radius: Radius of sphere
|
||||
\param direction: Direction and speed of particle emission.
|
||||
\param minParticlesPerSecond: Minimal amount of particles emitted per
|
||||
second.
|
||||
\param maxParticlesPerSecond: Maximal amount of particles emitted per
|
||||
second.
|
||||
\param minStartColor: Minimal initial start color of a particle. The
|
||||
real color of every particle is calculated as random interpolation
|
||||
between minStartColor and maxStartColor.
|
||||
\param maxStartColor: Maximal initial start color of a particle. The
|
||||
real color of every particle is calculated as random interpolation
|
||||
between minStartColor and maxStartColor.
|
||||
\param lifeTimeMin: Minimal lifetime of a particle, in milliseconds.
|
||||
\param lifeTimeMax: Maximal lifetime of a particle, in milliseconds.
|
||||
\param maxAngleDegrees: Maximal angle in degrees, the emitting
|
||||
direction of the particle will differ from the original direction.
|
||||
\return Pointer to the created particle emitter. To set this emitter
|
||||
as new emitter of this particle system, just call setEmitter(). Note
|
||||
that you'll have to drop() the returned pointer, after you don't need
|
||||
it any more, see IReferenceCounted::drop() for more informations. */
|
||||
virtual IParticleSphereEmitter* createSphereEmitter(
|
||||
const core::vector3df& center, f32 radius,
|
||||
const core::vector3df& direction = core::vector3df(0.0f,0.03f,0.0f),
|
||||
@ -341,68 +351,71 @@ public:
|
||||
u32 lifeTimeMin=2000, u32 lifeTimeMax=4000,
|
||||
s32 maxAngleDegrees=0) = 0;
|
||||
|
||||
//! Creates a point attraction affector. This affector modifies the positions of the
|
||||
//! particles and attracts them to a specified point at a specified speed per second.
|
||||
//! \param point: Point to attract particles to.
|
||||
//! \param speed: Speed in units per second, to attract to the specified point.
|
||||
//! \param attract: Whether the particles attract or detract from this point.
|
||||
//! \param affectX: Whether or not this will affect the X position of the particle.
|
||||
//! \param affectY: Whether or not this will affect the Y position of the particle.
|
||||
//! \param affectZ: Whether or not this will affect the Z position of the particle.
|
||||
//! \return Returns a pointer to the created particle affector.
|
||||
//! To add this affector as new affector of this particle system,
|
||||
//! just call addAffector(). Note that you'll have to drop() the
|
||||
//! returned pointer, after you don't need it any more, see
|
||||
//! IReferenceCounted::drop() for more informations.
|
||||
//! Creates a point attraction affector.
|
||||
/** This affector modifies the positions of the particles and attracts
|
||||
them to a specified point at a specified speed per second.
|
||||
\param point: Point to attract particles to.
|
||||
\param speed: Speed in units per second, to attract to the specified
|
||||
point.
|
||||
\param attract: Whether the particles attract or detract from this
|
||||
point.
|
||||
\param affectX: Whether or not this will affect the X position of the
|
||||
particle.
|
||||
\param affectY: Whether or not this will affect the Y position of the
|
||||
particle.
|
||||
\param affectZ: Whether or not this will affect the Z position of the
|
||||
particle.
|
||||
\return Pointer to the created particle affector. To add this affector
|
||||
as new affector of this particle system, just call addAffector(). Note
|
||||
that you'll have to drop() the returned pointer, after you don't need
|
||||
it any more, see IReferenceCounted::drop() for more informations. */
|
||||
virtual IParticleAttractionAffector* createAttractionAffector(
|
||||
const core::vector3df& point, f32 speed = 1.0f, bool attract = true,
|
||||
bool affectX = true, bool affectY = true, bool affectZ = true) = 0;
|
||||
|
||||
//! Creates a fade out particle affector. This affector modifies
|
||||
//! the color of every particle and and reaches the final color
|
||||
//! when the particle dies.
|
||||
//! This affector looks really good, if the EMT_TRANSPARENT_VERTEX_ALPHA
|
||||
//! material is used and the targetColor is video::SColor(0,0,0,0):
|
||||
//! Particles are fading out into void with this setting.
|
||||
//! \param targetColor: Color whereto the color of the particle is changed.
|
||||
//! \param timeNeededToFadeOut: How much time in milli seconds
|
||||
//! should the affector need to change the color to the targetColor.
|
||||
//! \return Returns a pointer to the created particle affector.
|
||||
//! To add this affector as new affector of this particle system,
|
||||
//! just call addAffector(). Note that you'll have to drop() the
|
||||
//! returned pointer, after you don't need it any more, see
|
||||
//! IReferenceCounted::drop() for more informations.
|
||||
//! Creates a fade out particle affector.
|
||||
/** This affector modifies the color of every particle and and reaches
|
||||
the final color when the particle dies. This affector looks really
|
||||
good, if the EMT_TRANSPARENT_VERTEX_ALPHA material is used and the
|
||||
targetColor is video::SColor(0,0,0,0): Particles are fading out into
|
||||
void with this setting.
|
||||
\param targetColor: Color whereto the color of the particle is changed.
|
||||
\param timeNeededToFadeOut: How much time in milli seconds should the
|
||||
affector need to change the color to the targetColor.
|
||||
\return Pointer to the created particle affector. To add this affector
|
||||
as new affector of this particle system, just call addAffector(). Note
|
||||
that you'll have to drop() the returned pointer, after you don't need
|
||||
it any more, see IReferenceCounted::drop() for more informations. */
|
||||
virtual IParticleFadeOutAffector* createFadeOutParticleAffector(
|
||||
const video::SColor& targetColor = video::SColor(0,0,0,0),
|
||||
u32 timeNeededToFadeOut = 1000) = 0;
|
||||
|
||||
//! Creates a gravity affector. This affector modifies the direction
|
||||
//! of the particle. It assumes that the particle is fired out of the
|
||||
//! emitter with huge force, but is loosing this after some time
|
||||
//! and is catched by the gravity then. This affector is ideal for
|
||||
//! creating things like fountains.
|
||||
//! \param gravity: Direction and force of gravity.
|
||||
//! \param timeForceLost: Time in milli seconds when the force
|
||||
//! of the emitter is totally lost and the particle does not move any more.
|
||||
//! This is the time where gravity fully affects the particle.
|
||||
//! \return Returns a pointer to the created particle affector.
|
||||
//! To add this affector as new affector of this particle system,
|
||||
//! just call addAffector(). Note that you'll have to drop() the
|
||||
//! returned pointer, after you don't need it any more, see
|
||||
//! IReferenceCounted::drop() for more informations.
|
||||
//! Creates a gravity affector.
|
||||
/** This affector modifies the direction of the particle. It assumes
|
||||
that the particle is fired out of the emitter with huge force, but is
|
||||
loosing this after some time and is catched by the gravity then. This
|
||||
affector is ideal for creating things like fountains.
|
||||
\param gravity: Direction and force of gravity.
|
||||
\param timeForceLost: Time in milli seconds when the force of the
|
||||
emitter is totally lost and the particle does not move any more. This
|
||||
is the time where gravity fully affects the particle.
|
||||
\return Pointer to the created particle affector. To add this affector
|
||||
as new affector of this particle system, just call addAffector(). Note
|
||||
that you'll have to drop() the returned pointer, after you don't need
|
||||
it any more, see IReferenceCounted::drop() for more informations. */
|
||||
virtual IParticleGravityAffector* createGravityAffector(
|
||||
const core::vector3df& gravity = core::vector3df(0.0f,-0.03f,0.0f),
|
||||
u32 timeForceLost = 1000) = 0;
|
||||
|
||||
//! Creates a rotation affector. This affector modifies the positions of the
|
||||
//! particles and attracts them to a specified point at a specified speed per second.
|
||||
//! \param speed: Rotation in degrees per second
|
||||
//! \param pivotPoint: Point to rotate the particles around
|
||||
//! \return Returns a pointer to the created particle affector.
|
||||
//! To add this affector as new affector of this particle system,
|
||||
//! just call addAffector(). Note that you'll have to drop() the
|
||||
//! returned pointer, after you don't need it any more, see
|
||||
//! IReferenceCounted::drop() for more informations.
|
||||
//! Creates a rotation affector.
|
||||
/** This affector modifies the positions of the particles and attracts
|
||||
them to a specified point at a specified speed per second.
|
||||
\param speed: Rotation in degrees per second
|
||||
\param pivotPoint: Point to rotate the particles around
|
||||
\return Pointer to the created particle affector. To add this affector
|
||||
as new affector of this particle system, just call addAffector(). Note
|
||||
that you'll have to drop() the returned pointer, after you don't need
|
||||
it any more, see IReferenceCounted::drop() for more informations. */
|
||||
virtual IParticleRotationAffector* createRotationAffector(
|
||||
const core::vector3df& speed = core::vector3df(5.0f,5.0f,5.0f),
|
||||
const core::vector3df& pivotPoint = core::vector3df(0.0f,0.0f,0.0f) ) = 0;
|
||||
|
@ -1,4 +1,4 @@
|
||||
// Copyright (C) 2002-2007 Nikolaus Gebhardt
|
||||
// Copyright (C) 2002-2008 Nikolaus Gebhardt
|
||||
// This file is part of the "Irrlicht Engine".
|
||||
// For conditions of distribution and use, see copyright notice in irrlicht.h
|
||||
|
||||
@ -13,7 +13,7 @@ namespace irr
|
||||
namespace scene
|
||||
{
|
||||
//! Interface for a Mesh which can be loaded directly from a Quake3 .bsp-file.
|
||||
/** The Mesh tries to load all textures of the map. There are currently
|
||||
/** The Mesh tries to load all textures of the map. There are currently
|
||||
no additional methods in this class, but maybe there will be some in later
|
||||
releases if there are feature requests. */
|
||||
class IQ3LevelMesh : public IAnimatedMesh
|
||||
@ -24,11 +24,11 @@ namespace scene
|
||||
virtual void releaseMesh ( s32 index ) = 0;
|
||||
|
||||
//! loads the shader definition
|
||||
// either from file ( we assume /scripts on fileNameIsValid == 0 )
|
||||
/** Either from file ( we assume /scripts on fileNameIsValid == 0 ) */
|
||||
virtual const quake3::SShader * getShader ( const c8 * filename, s32 fileNameIsValid ) = 0;
|
||||
|
||||
//! returns a already loaded Shader
|
||||
virtual const quake3::SShader * getShader ( u32 index ) const = 0;
|
||||
virtual const quake3::SShader * getShader ( u32 index ) const = 0;
|
||||
|
||||
//! get's an interface to the entities
|
||||
virtual const quake3::tQ3EntityList & getEntityList () = 0;
|
||||
|
@ -1,4 +1,4 @@
|
||||
// Copyright (C) 2002-2007 Nikolaus Gebhardt / Thomas Alten
|
||||
// Copyright (C) 2006-2008 Nikolaus Gebhardt / Thomas Alten
|
||||
// This file is part of the "Irrlicht Engine".
|
||||
// For conditions of distribution and use, see copyright notice in irrlicht.h
|
||||
|
||||
@ -132,9 +132,7 @@ namespace quake3
|
||||
|
||||
}
|
||||
|
||||
/*
|
||||
Maps Quake3 Blend to Irrlicht Material
|
||||
*/
|
||||
//! A blend function for a q3 shader.
|
||||
struct SBlendFunc
|
||||
{
|
||||
SBlendFunc ()
|
||||
@ -176,7 +174,7 @@ namespace quake3
|
||||
return 1;
|
||||
|
||||
u32 ret = 1;
|
||||
static const c8 * funclist[] = { "lequal","equal" };
|
||||
static const c8 * funclist[] = { "lequal","equal" };
|
||||
|
||||
u32 pos = 0;
|
||||
switch ( isEqual ( string, pos, funclist, 2 ) )
|
||||
@ -467,6 +465,7 @@ namespace quake3
|
||||
core::array < SVarGroup > VariableGroup;
|
||||
};
|
||||
|
||||
|
||||
//! A Parsed Shader Holding Variables ordered in Groups
|
||||
class SShader
|
||||
{
|
||||
@ -495,7 +494,7 @@ namespace quake3
|
||||
// Shader: shader name ( also first variable in first Vargroup )
|
||||
// Entity: classname ( variable in Group(1) )
|
||||
core::stringc name;
|
||||
SVarGroupList *VarGroup; // reference
|
||||
SVarGroupList *VarGroup; // reference
|
||||
};
|
||||
|
||||
typedef SShader SEntity;
|
||||
@ -579,13 +578,12 @@ namespace quake3
|
||||
load one or multiple files stored in name started at startPos to the texture array textures
|
||||
if texture is not loaded 0 will be added ( to find missing textures easier)
|
||||
*/
|
||||
inline void getTextures ( tTexArray &textures ,
|
||||
const core::stringc &name, u32 &startPos,
|
||||
io::IFileSystem *fileSystem,
|
||||
video::IVideoDriver* driver
|
||||
)
|
||||
inline void getTextures(tTexArray &textures,
|
||||
const core::stringc &name, u32 &startPos,
|
||||
io::IFileSystem *fileSystem,
|
||||
video::IVideoDriver* driver)
|
||||
{
|
||||
static const char * extension[2] =
|
||||
static const char * extension[2] =
|
||||
{
|
||||
".jpg",
|
||||
".tga"
|
||||
@ -619,9 +617,7 @@ namespace quake3
|
||||
}
|
||||
|
||||
|
||||
/*!
|
||||
Manages various Quake3 Shader Styles
|
||||
*/
|
||||
//! Manages various Quake3 Shader Styles
|
||||
class IShaderManager : public IReferenceCounted
|
||||
{
|
||||
};
|
||||
|
@ -1,4 +1,4 @@
|
||||
// Copyright (C) 2002-2007 Nikolaus Gebhardt
|
||||
// Copyright (C) 2002-2008 Nikolaus Gebhardt
|
||||
// This file is part of the "Irrlicht Engine".
|
||||
// For conditions of distribution and use, see copyright notice in irrlicht.h
|
||||
|
||||
@ -16,33 +16,33 @@ namespace io
|
||||
class IReadFile : public virtual IReferenceCounted
|
||||
{
|
||||
public:
|
||||
|
||||
//! Destructor
|
||||
virtual ~IReadFile() {}
|
||||
|
||||
//! Reads an amount of bytes from the file.
|
||||
//! \param buffer: Pointer to buffer where to read bytes will be written to.
|
||||
//! \param sizeToRead: Amount of bytes to read from the file.
|
||||
//! \return Returns how much bytes were read.
|
||||
/** \param buffer Pointer to buffer where to read bytes will be written to.
|
||||
\param sizeToRead Amount of bytes to read from the file.
|
||||
\return How much bytes were read. */
|
||||
virtual s32 read(void* buffer, u32 sizeToRead) = 0;
|
||||
|
||||
//! Changes position in file, returns true if successful.
|
||||
//! \param finalPos: Destination position in the file.
|
||||
//! \param relativeMovement: If set to true, the position in the file is
|
||||
//! changed relative to current position. Otherwise the position is changed
|
||||
//! from beginning of file.
|
||||
//! \return Returns true if successful, otherwise false.
|
||||
//! Changes position in file
|
||||
/** \param finalPos: Destination position in the file.
|
||||
\param relativeMovement: If set to true, the position in the file is
|
||||
changed relative to current position. Otherwise the position is changed
|
||||
from beginning of file.
|
||||
\return True if successful, otherwise false. */
|
||||
virtual bool seek(long finalPos, bool relativeMovement = false) = 0;
|
||||
|
||||
//! Returns size of file.
|
||||
//! \return Returns the size of the file in bytes.
|
||||
//! Get size of file.
|
||||
/** \return Size of the file in bytes. */
|
||||
virtual long getSize() const = 0;
|
||||
|
||||
//! Returns the current position in the file.
|
||||
//! \return Returns the current position in the file in bytes.
|
||||
//! Get the current position in the file.
|
||||
/** \return Current position in the file in bytes. */
|
||||
virtual long getPos() const = 0;
|
||||
|
||||
//! Returns name of file.
|
||||
//! \return Returns the file name as zero terminated character string.
|
||||
//! Get name of file.
|
||||
/** \return File name as zero terminated character string. */
|
||||
virtual const c8* getFileName() const = 0;
|
||||
};
|
||||
|
||||
|
@ -1,4 +1,4 @@
|
||||
// Copyright (C) 2002-2007 Nikolaus Gebhardt
|
||||
// Copyright (C) 2002-2008 Nikolaus Gebhardt
|
||||
// This file is part of the "Irrlicht Engine".
|
||||
// For conditions of distribution and use, see copyright notice in irrlicht.h
|
||||
|
||||
@ -18,11 +18,11 @@ namespace irr
|
||||
|
||||
When you create an object in the Irrlicht engine, calling a method
|
||||
which starts with 'create', an object is created, and you get a pointer
|
||||
to the new object. If you no longer need the object, you have
|
||||
to the new object. If you no longer need the object, you have
|
||||
to call drop(). This will destroy the object, if grab() was not called
|
||||
in another part of you program, because this part still needs the object.
|
||||
Note, that you only need to call drop() to the object, if you created it,
|
||||
and the method had a 'create' in it.
|
||||
and the method had a 'create' in it.
|
||||
|
||||
A simple example:
|
||||
|
||||
@ -54,64 +54,69 @@ namespace irr
|
||||
}
|
||||
|
||||
//! Grabs the object. Increments the reference counter by one.
|
||||
//! Someone who calls grab() to an object, should later also call
|
||||
//! drop() to it. If an object never gets as much drop() as grab()
|
||||
//! calls, it will never be destroyed.
|
||||
//! The IReferenceCounted class provides a basic reference counting mechanism
|
||||
//! with its methods grab() and drop(). Most objects of the Irrlicht
|
||||
//! Engine are derived from IReferenceCounted, and so they are reference counted.
|
||||
//!
|
||||
//! When you create an object in the Irrlicht engine, calling a method
|
||||
//! which starts with 'create', an object is created, and you get a pointer
|
||||
//! to the new object. If you no longer need the object, you have
|
||||
//! to call drop(). This will destroy the object, if grab() was not called
|
||||
//! in another part of you program, because this part still needs the object.
|
||||
//! Note, that you only need to call drop() to the object, if you created it,
|
||||
//! and the method had a 'create' in it.
|
||||
//!
|
||||
//! A simple example:
|
||||
//!
|
||||
//! If you want to create a texture, you may want to call an imaginable method
|
||||
//! IDriver::createTexture. You call
|
||||
//! ITexture* texture = driver->createTexture(dimension2d<s32>(128, 128));
|
||||
//! If you no longer need the texture, call texture->drop().
|
||||
//! If you want to load a texture, you may want to call imaginable method
|
||||
//! IDriver::loadTexture. You do this like
|
||||
//! ITexture* texture = driver->loadTexture("example.jpg");
|
||||
//! You will not have to drop the pointer to the loaded texture, because
|
||||
//! the name of the method does not start with 'create'. The texture
|
||||
//! is stored somewhere by the driver.
|
||||
/** Someone who calls grab() to an object, should later also
|
||||
call drop() to it. If an object never gets as much drop() as
|
||||
grab() calls, it will never be destroyed. The
|
||||
IReferenceCounted class provides a basic reference counting
|
||||
mechanism with its methods grab() and drop(). Most objects of
|
||||
the Irrlicht Engine are derived from IReferenceCounted, and so
|
||||
they are reference counted.
|
||||
|
||||
When you create an object in the Irrlicht engine, calling a
|
||||
method which starts with 'create', an object is created, and
|
||||
you get a pointer to the new object. If you no longer need the
|
||||
object, you have to call drop(). This will destroy the object,
|
||||
if grab() was not called in another part of you program,
|
||||
because this part still needs the object. Note, that you only
|
||||
need to call drop() to the object, if you created it, and the
|
||||
method had a 'create' in it.
|
||||
|
||||
A simple example:
|
||||
|
||||
If you want to create a texture, you may want to call an
|
||||
imaginable method IDriver::createTexture. You call
|
||||
ITexture* texture = driver->createTexture(dimension2d<s32>(128, 128));
|
||||
If you no longer need the texture, call texture->drop().
|
||||
If you want to load a texture, you may want to call imaginable
|
||||
method IDriver::loadTexture. You do this like
|
||||
ITexture* texture = driver->loadTexture("example.jpg");
|
||||
You will not have to drop the pointer to the loaded texture,
|
||||
because the name of the method does not start with 'create'.
|
||||
The texture is stored somewhere by the driver. */
|
||||
void grab() const { ++ReferenceCounter; }
|
||||
|
||||
//! Drops the object. Decrements the reference counter by one.
|
||||
//! Returns true, if the object was deleted.
|
||||
//! The IReferenceCounted class provides a basic reference counting mechanism
|
||||
//! with its methods grab() and drop(). Most objects of the Irrlicht
|
||||
//! Engine are derived from IReferenceCounted, and so they are reference counted.
|
||||
//!
|
||||
//! When you create an object in the Irrlicht engine, calling a method
|
||||
//! which starts with 'create', an object is created, and you get a pointer
|
||||
//! to the new object. If you no longer need the object, you have
|
||||
//! to call drop(). This will destroy the object, if grab() was not called
|
||||
//! in another part of you program, because this part still needs the object.
|
||||
//! Note, that you only need to call drop() to the object, if you created it,
|
||||
//! and the method had a 'create' in it.
|
||||
//!
|
||||
//! A simple example:
|
||||
//!
|
||||
//! If you want to create a texture, you may want to call an imaginable method
|
||||
//! IDriver::createTexture. You call
|
||||
//! ITexture* texture = driver->createTexture(dimension2d<s32>(128, 128));
|
||||
//! If you no longer need the texture, call texture->drop().
|
||||
//! If you want to load a texture, you may want to call imaginable method
|
||||
//! IDriver::loadTexture. You do this like
|
||||
//! ITexture* texture = driver->loadTexture("example.jpg");
|
||||
//! You will not have to drop the pointer to the loaded texture, because
|
||||
//! the name of the method does not start with 'create'. The texture
|
||||
//! is stored somewhere by the driver.
|
||||
/** The IReferenceCounted class provides a basic reference
|
||||
counting mechanism with its methods grab() and drop(). Most
|
||||
objects of the Irrlicht Engine are derived from
|
||||
IReferenceCounted, and so they are reference counted.
|
||||
|
||||
When you create an object in the Irrlicht engine, calling a
|
||||
method which starts with 'create', an object is created, and
|
||||
you get a pointer to the new object. If you no longer need the
|
||||
object, you have to call drop(). This will destroy the object,
|
||||
if grab() was not called in another part of you program,
|
||||
because this part still needs the object. Note, that you only
|
||||
need to call drop() to the object, if you created it, and the
|
||||
method had a 'create' in it.
|
||||
|
||||
A simple example:
|
||||
|
||||
If you want to create a texture, you may want to call an
|
||||
imaginable method IDriver::createTexture. You call
|
||||
ITexture* texture = driver->createTexture(dimension2d<s32>(128, 128));
|
||||
If you no longer need the texture, call texture->drop().
|
||||
If you want to load a texture, you may want to call imaginable
|
||||
method IDriver::loadTexture. You do this like
|
||||
ITexture* texture = driver->loadTexture("example.jpg");
|
||||
You will not have to drop the pointer to the loaded texture,
|
||||
because the name of the method does not start with 'create'.
|
||||
The texture is stored somewhere by the driver.
|
||||
\return True, if the object was deleted. */
|
||||
bool drop() const
|
||||
{
|
||||
_IRR_DEBUG_BREAK_IF(ReferenceCounter <= 0) // someone is doing bad reference counting.
|
||||
// someone is doing bad reference counting.
|
||||
_IRR_DEBUG_BREAK_IF(ReferenceCounter <= 0)
|
||||
|
||||
--ReferenceCounter;
|
||||
if (!ReferenceCounter)
|
||||
@ -123,15 +128,17 @@ namespace irr
|
||||
return false;
|
||||
}
|
||||
|
||||
//! Returns the reference counter.
|
||||
//! Get the reference count.
|
||||
/** \return Current value of the reference counter. */
|
||||
s32 getReferenceCount() const
|
||||
{
|
||||
return ReferenceCounter;
|
||||
}
|
||||
|
||||
//! Returns the debug name of the object. The Debugname may only be set and
|
||||
//! changed by the object itself. This method should only be used in Debug mode.
|
||||
//! \return Returns a string, previously set by setDebugName();
|
||||
//! Returns the debug name of the object.
|
||||
/** The Debugname may only be set and changed by the object
|
||||
itself. This method should only be used in Debug mode.
|
||||
\return Returns a string, previously set by setDebugName(); */
|
||||
const c8* getDebugName() const
|
||||
{
|
||||
return DebugName;
|
||||
@ -139,17 +146,19 @@ namespace irr
|
||||
|
||||
protected:
|
||||
|
||||
//! Sets the debug name of the object. The Debugname may only be set and
|
||||
//! changed by the object itself. This method should only be used in Debug mode.
|
||||
//! \param newName: New debug name to set.
|
||||
//! Sets the debug name of the object.
|
||||
/** The Debugname may only be set and changed by the object
|
||||
itself. This method should only be used in Debug mode.
|
||||
\param newName: New debug name to set. */
|
||||
void setDebugName(const c8* newName)
|
||||
{
|
||||
DebugName = newName;
|
||||
}
|
||||
|
||||
private:
|
||||
|
||||
//! The reference counter. Mutable to do reference counting on const objects.
|
||||
mutable s32 ReferenceCounter;
|
||||
//! The debug name.
|
||||
const c8* DebugName;
|
||||
};
|
||||
|
||||
|
@ -1,4 +1,4 @@
|
||||
// Copyright (C) 2002-2007 Nikolaus Gebhardt
|
||||
// Copyright (C) 2002-2008 Nikolaus Gebhardt
|
||||
// This file is part of the "Irrlicht Engine".
|
||||
// For conditions of distribution and use, see copyright notice in irrlicht.h
|
||||
|
||||
@ -14,131 +14,136 @@
|
||||
namespace irr
|
||||
{
|
||||
|
||||
|
||||
namespace scene
|
||||
{
|
||||
class ISceneNode;
|
||||
class ICameraSceneNode;
|
||||
class ITriangleSelector;
|
||||
|
||||
//! The Scene Collision Manager provides methods for performing collision tests and picking on scene nodes.
|
||||
//! The Scene Collision Manager provides methods for performing collision tests and picking on scene nodes.
|
||||
class ISceneCollisionManager : public virtual IReferenceCounted
|
||||
{
|
||||
public:
|
||||
|
||||
//! destructor
|
||||
//! Destructor
|
||||
virtual ~ISceneCollisionManager() {}
|
||||
|
||||
//! Finds the collision point of a line and lots of triangles, if there is one.
|
||||
//! \param ray: Line with witch collisions are tested.
|
||||
//! \param selector: TriangleSelector containing the triangles. It can
|
||||
//! be created for example using ISceneManager::createTriangleSelector() or
|
||||
//! ISceneManager::createTriangleOctTreeSelector().
|
||||
//! \param outCollisionPoint: If a collision is detected, this will contain the
|
||||
//! position of the nearest collision.
|
||||
//! \param outTriangle: If a collision is detected, this will contain the triangle
|
||||
//! with which the ray collided.
|
||||
//! \return Returns true if a collision was detected and false if not.
|
||||
/** \param ray: Line with witch collisions are tested.
|
||||
\param selector: TriangleSelector containing the triangles. It
|
||||
can be created for example using
|
||||
ISceneManager::createTriangleSelector() or
|
||||
ISceneManager::createTriangleOctTreeSelector().
|
||||
\param outCollisionPoint: If a collision is detected, this will
|
||||
contain the position of the nearest collision.
|
||||
\param outTriangle: If a collision is detected, this will
|
||||
contain the triangle with which the ray collided.
|
||||
\return True if a collision was detected and false if not. */
|
||||
virtual bool getCollisionPoint(const core::line3d<f32>& ray,
|
||||
ITriangleSelector* selector, core::vector3df& outCollisionPoint,
|
||||
core::triangle3df& outTriangle) = 0;
|
||||
|
||||
//! Collides a moving ellipsoid with a 3d world with gravity and returns
|
||||
//! the resulting new position of the ellipsoid. This can be used for moving
|
||||
//! a character in a 3d world: The character will slide at walls and is able
|
||||
//! to walk up stairs. The method used how to calculate the collision result
|
||||
//! position is based on the paper "Improved Collision detection and Response"
|
||||
//! by Kasper Fauerby.
|
||||
//! \param selector: TriangleSelector containing the triangles of the world.
|
||||
//! It can be created for example using ISceneManager::createTriangleSelector() or
|
||||
//! ISceneManager::createTriangleOctTreeSelector().
|
||||
//! \param ellipsoidPosition: Position of the ellipsoid.
|
||||
//! \param ellipsoidRadius: Radius of the ellipsoid.
|
||||
//! \param ellipsoidDirectionAndSpeed: Direction and speed of
|
||||
//! the movement of the ellipsoid.
|
||||
//! \param triout: Optional parameter where the last triangle causing a
|
||||
//! collision is stored, if there is a collision.
|
||||
//! \param outFalling: Is set to true if the ellipsoid is falling down, caused
|
||||
//! by gravity.
|
||||
//! \param slidingSpeed: DOCUMENTATION NEEDED.
|
||||
//! \param gravityDirectionAndSpeed: Direction and force of gravity.
|
||||
//! \return Returns the new position of the ellipsoid.
|
||||
//! Collides a moving ellipsoid with a 3d world with gravity and returns the resulting new position of the ellipsoid.
|
||||
/** This can be used for moving a character in a 3d world: The
|
||||
character will slide at walls and is able to walk up stairs.
|
||||
The method used how to calculate the collision result position
|
||||
is based on the paper "Improved Collision detection and
|
||||
Response" by Kasper Fauerby.
|
||||
\param selector: TriangleSelector containing the triangles of
|
||||
the world. It can be created for example using
|
||||
ISceneManager::createTriangleSelector() or
|
||||
ISceneManager::createTriangleOctTreeSelector().
|
||||
\param ellipsoidPosition: Position of the ellipsoid.
|
||||
\param ellipsoidRadius: Radius of the ellipsoid.
|
||||
\param ellipsoidDirectionAndSpeed: Direction and speed of the
|
||||
movement of the ellipsoid.
|
||||
\param triout: Optional parameter where the last triangle
|
||||
causing a collision is stored, if there is a collision.
|
||||
\param outFalling: Is set to true if the ellipsoid is falling
|
||||
down, caused by gravity.
|
||||
\param slidingSpeed: DOCUMENTATION NEEDED.
|
||||
\param gravityDirectionAndSpeed: Direction and force of gravity.
|
||||
\return New position of the ellipsoid. */
|
||||
virtual core::vector3df getCollisionResultPosition(
|
||||
ITriangleSelector* selector,
|
||||
const core::vector3df &ellipsoidPosition,
|
||||
const core::vector3df& ellipsoidRadius,
|
||||
const core::vector3df& ellipsoidRadius,
|
||||
const core::vector3df& ellipsoidDirectionAndSpeed,
|
||||
core::triangle3df& triout,
|
||||
bool& outFalling,
|
||||
f32 slidingSpeed = 0.0005f,
|
||||
const core::vector3df& gravityDirectionAndSpeed
|
||||
const core::vector3df& gravityDirectionAndSpeed
|
||||
= core::vector3df(0.0f, 0.0f, 0.0f)) = 0;
|
||||
|
||||
//! Returns a 3d ray which would go through the 2d screen coodinates.
|
||||
//! \param pos: Screen coordinates in pixels.
|
||||
//! \param camera: Camera from which the ray starts. If null, the
|
||||
//! active camera is used.
|
||||
//! \return Returns a ray starting from the position of the camera
|
||||
//! and ending at a length of the far value of the camera at a position
|
||||
//! which would be behind the 2d screen coodinates.
|
||||
/** \param pos: Screen coordinates in pixels.
|
||||
\param camera: Camera from which the ray starts. If null, the
|
||||
active camera is used.
|
||||
\return Ray starting from the position of the camera and ending
|
||||
at a length of the far value of the camera at a position which
|
||||
would be behind the 2d screen coodinates. */
|
||||
virtual core::line3d<f32> getRayFromScreenCoordinates(
|
||||
core::position2d<s32> pos, ICameraSceneNode* camera = 0) = 0;
|
||||
|
||||
//! Calculates 2d screen position from a 3d position.
|
||||
//! \param pos: 3D position in world space to be transformed into
|
||||
//! 2d.
|
||||
//! \param camera: Camera to be used. If null, the currently active
|
||||
//! camera is used.
|
||||
//! \return Returns the 2d screen coordinates which a object in the
|
||||
//! 3d world would have if it would be rendered to the screen. If the
|
||||
//! 3d position is behind the camera, it is set to (-10000,-10000). In
|
||||
//! most cases you can ignore this fact, because if you use this method
|
||||
//! for drawing a decorator over a 3d object, it will be clipped by the
|
||||
//! screen borders.
|
||||
/** \param pos: 3D position in world space to be transformed
|
||||
into 2d.
|
||||
\param camera: Camera to be used. If null, the currently active
|
||||
camera is used.
|
||||
\return 2d screen coordinates which a object in the 3d world
|
||||
would have if it would be rendered to the screen. If the 3d
|
||||
position is behind the camera, it is set to (-10000,-10000). In
|
||||
most cases you can ignore this fact, because if you use this
|
||||
method for drawing a decorator over a 3d object, it will be
|
||||
clipped by the screen borders. */
|
||||
virtual core::position2d<s32> getScreenCoordinatesFrom3DPosition(
|
||||
core::vector3df pos, ICameraSceneNode* camera=0) = 0;
|
||||
|
||||
//! Returns the scene node, which is currently visible under the overgiven
|
||||
//! screencoordinates, viewed from the currently active camera. The collision
|
||||
//! tests are done using a bounding box for each scene node.
|
||||
//! \param pos: Position in pixel screen coordinates, under which the returned
|
||||
//! scene node will be.
|
||||
//! \param idBitMask: Only scene nodes with an id with bits set like in this mask
|
||||
//! will be tested. If the BitMask is 0, this feature is disabled.
|
||||
//! \param bNoDebugObjects: Doesn't take debug objects into account when true. These
|
||||
// are scene nodes with IsDebugObject() = true.
|
||||
//! \return Returns the visible scene node under screen coordinates with matching
|
||||
//! bits in its id. If there is no scene node under this position, 0 is returned.
|
||||
//! Gets the scene node, which is currently visible under the given screencoordinates, viewed from the currently active camera.
|
||||
/** The collision tests are done using a bounding box for each
|
||||
scene node.
|
||||
\param pos: Position in pixel screen coordinates, under which
|
||||
the returned scene node will be.
|
||||
\param idBitMask: Only scene nodes with an id with bits set
|
||||
like in this mask will be tested. If the BitMask is 0, this
|
||||
feature is disabled.
|
||||
\param bNoDebugObjects: Doesn't take debug objects into account
|
||||
when true. These are scene nodes with IsDebugObject() = true.
|
||||
\return Visible scene node under screen coordinates with
|
||||
matching bits in its id. If there is no scene node under this
|
||||
position, 0 is returned. */
|
||||
virtual ISceneNode* getSceneNodeFromScreenCoordinatesBB(core::position2d<s32> pos,
|
||||
s32 idBitMask=0, bool bNoDebugObjects = false) = 0;
|
||||
|
||||
//! Returns the nearest scene node which collides with a 3d ray and
|
||||
//! which id matches a bitmask. The collision tests are done using a bounding
|
||||
//! box for each scene node.
|
||||
//! \param ray: Line with witch collisions are tested.
|
||||
//! \param idBitMask: Only scene nodes with an id with bits set like in this mask
|
||||
//! will be tested. If the BitMask is 0, this feature is disabled.
|
||||
//! \param bNoDebugObjects: Doesn't take debug objects into account when true. These
|
||||
// are scene nodes with IsDebugObject() = true.
|
||||
//! \return Returns the scene node nearest to ray.start, which collides with the
|
||||
//! ray and matches the idBitMask, if the mask is not null. If no scene
|
||||
//! node is found, 0 is returned.
|
||||
virtual ISceneNode* getSceneNodeFromRayBB(core::line3d<f32> ray,
|
||||
//! Get the nearest scene node which collides with a 3d ray and whose id matches a bitmask.
|
||||
/** The collision tests are done using a bounding box for each
|
||||
scene node.
|
||||
\param ray: Line with witch collisions are tested.
|
||||
\param idBitMask: Only scene nodes with an id with bits set
|
||||
like in this mask will be tested. If the BitMask is 0, this
|
||||
feature is disabled.
|
||||
\param bNoDebugObjects: Doesn't take debug objects into account
|
||||
when true. These are scene nodes with IsDebugObject() = true.
|
||||
\return Scene node nearest to ray.start, which collides with
|
||||
the ray and matches the idBitMask, if the mask is not null. If
|
||||
no scene node is found, 0 is returned. */
|
||||
virtual ISceneNode* getSceneNodeFromRayBB(core::line3d<f32> ray,
|
||||
s32 idBitMask=0, bool bNoDebugObjects = false) = 0;
|
||||
|
||||
//! Returns the scene node, at which the overgiven camera is looking at and
|
||||
//! which id matches the bitmask. A ray is simply casted from the position
|
||||
//! of the camera to the view target position, and all scene nodes are tested
|
||||
//! against this ray. The collision tests are done using a bounding
|
||||
//! box for each scene node.
|
||||
//! \param camera: Camera from which the ray is casted.
|
||||
//! \param idBitMask: Only scene nodes with an id with bits set like in this mask
|
||||
//! will be tested. If the BitMask is 0, this feature is disabled.
|
||||
//! \param bNoDebugObjects: Doesn't take debug objects into account when true. These
|
||||
// are scene nodes with IsDebugObject() = true.
|
||||
//! \return Returns the scene node nearest to the camera, which collides with the
|
||||
//! ray and matches the idBitMask, if the mask is not null. If no scene
|
||||
//! node is found, 0 is returned.
|
||||
//! Get the scene node, which the overgiven camera is looking at and whose id matches the bitmask.
|
||||
/** A ray is simply casted from the position of the camera to
|
||||
the view target position, and all scene nodes are tested
|
||||
against this ray. The collision tests are done using a bounding
|
||||
box for each scene node.
|
||||
\param camera: Camera from which the ray is casted.
|
||||
\param idBitMask: Only scene nodes with an id with bits set
|
||||
like in this mask will be tested. If the BitMask is 0, this
|
||||
feature is disabled.
|
||||
\param bNoDebugObjects: Doesn't take debug objects into account
|
||||
when true. These are scene nodes with IsDebugObject() = true.
|
||||
\return Scene node nearest to the camera, which collides with
|
||||
the ray and matches the idBitMask, if the mask is not null. If
|
||||
no scene node is found, 0 is returned. */
|
||||
virtual ISceneNode* getSceneNodeFromCameraBB(ICameraSceneNode* camera,
|
||||
s32 idBitMask=0, bool bNoDebugObjects = false) = 0;
|
||||
};
|
||||
|
@ -1,4 +1,4 @@
|
||||
// Copyright (C) 2002-2007 Nikolaus Gebhardt
|
||||
// Copyright (C) 2002-2008 Nikolaus Gebhardt
|
||||
// This file is part of the "Irrlicht Engine".
|
||||
// For conditions of distribution and use, see copyright notice in irrlicht.h
|
||||
|
||||
@ -50,8 +50,7 @@ namespace scene
|
||||
specifying when the mode wants to be drawn in relation to the other nodes. */
|
||||
enum E_SCENE_NODE_RENDER_PASS
|
||||
{
|
||||
//! Camera pass. The active view is set up here.
|
||||
//! The very first pass.
|
||||
//! Camera pass. The active view is set up here. The very first pass.
|
||||
ESNRP_CAMERA,
|
||||
|
||||
//! In this pass, lights are transformed into camera space and added to the driver
|
||||
@ -61,15 +60,18 @@ namespace scene
|
||||
ESNRP_SKY_BOX,
|
||||
|
||||
//! All normal objects can use this for registering themselves.
|
||||
//! This value will never be returned by ISceneManager::getSceneNodeRenderPass().
|
||||
//! The scene manager will determine by itself if an object is
|
||||
//! transparent or solid and register the object as SNRT_TRANSPARENT or
|
||||
//! SNRT_SOLD automatically if you call registerNodeForRendering with this
|
||||
//! value (which is default). Note that it will register the node only as ONE type.
|
||||
//! If your scene node has both solid and transparent material types register
|
||||
//! it twice (one time as SNRT_SOLID, the other time as SNRT_TRANSPARENT) and
|
||||
//! in the render() method call getSceneNodeRenderPass() to find out the current
|
||||
//! render pass and render only the corresponding parts of the node.
|
||||
/** This value will never be returned by
|
||||
ISceneManager::getSceneNodeRenderPass(). The scene manager
|
||||
will determine by itself if an object is transparent or solid
|
||||
and register the object as SNRT_TRANSPARENT or SNRT_SOLD
|
||||
automatically if you call registerNodeForRendering with this
|
||||
value (which is default). Note that it will register the node
|
||||
only as ONE type. If your scene node has both solid and
|
||||
transparent material types register it twice (one time as
|
||||
SNRT_SOLID, the other time as SNRT_TRANSPARENT) and in the
|
||||
render() method call getSceneNodeRenderPass() to find out the
|
||||
current render pass and render only the corresponding parts of
|
||||
the node. */
|
||||
ESNRP_AUTOMATIC,
|
||||
|
||||
//! Solid scene nodes or special scene nodes without materials.
|
||||
@ -78,8 +80,7 @@ namespace scene
|
||||
//! Drawn after the transparent nodes, the time for drawing shadow volumes
|
||||
ESNRP_SHADOW,
|
||||
|
||||
//! Transparent scene nodes, drawn after shadow nodes. They are sorted from back
|
||||
//! to front and drawn in that order.
|
||||
//! Transparent scene nodes, drawn after shadow nodes. They are sorted from back to front and drawn in that order.
|
||||
ESNRP_TRANSPARENT,
|
||||
|
||||
//! Never used, value specifing how much parameters there are.
|
||||
@ -117,7 +118,7 @@ namespace scene
|
||||
class SShader;
|
||||
} // end namespace quake3
|
||||
|
||||
//! The Scene Manager manages scene nodes, mesh recources, cameras and all the other stuff.
|
||||
//! The Scene Manager manages scene nodes, mesh recources, cameras and all the other stuff.
|
||||
/** All Scene nodes can be created only here. There is a always growing
|
||||
list of scene nodes for lots of purposes: Indoor rendering scene nodes
|
||||
like the Octree (addOctTreeSceneNode()) or the terrain renderer
|
||||
@ -139,7 +140,7 @@ namespace scene
|
||||
{
|
||||
public:
|
||||
|
||||
//! destructor
|
||||
//! Destructor
|
||||
virtual ~ISceneManager() {}
|
||||
|
||||
//! Returns pointer to an animateable mesh. Loads the file if not loaded already.
|
||||
@ -274,7 +275,7 @@ namespace scene
|
||||
* directory of the SDK. Thanks to Murphy McCauley for
|
||||
* creating all this.</TD>
|
||||
* </TR>
|
||||
* <TR>
|
||||
* <TR>
|
||||
* <TD>OGRE Meshes (.mesh)</TD>
|
||||
* <TD>Ogre .mesh files contain 3D data for the OGRE 3D
|
||||
* engine. Irrlicht can read and display them directly
|
||||
@ -336,14 +337,12 @@ namespace scene
|
||||
virtual IAnimatedMesh* getMesh(const c8* filename) = 0;
|
||||
|
||||
//! Returns pointer to an animateable mesh. Loads the file if not loaded already.
|
||||
/**
|
||||
* Works just as getMesh(const char* filename)
|
||||
* If you want to remove a loaded mesh from the cache again, use removeMesh().
|
||||
* \param file: File handle of the mesh to load.
|
||||
* \return Returns NULL if failed and the pointer to the mesh if
|
||||
* successful.
|
||||
* This pointer should not be dropped. See IReferenceCounted::drop() for more information.
|
||||
**/
|
||||
/** Works just as getMesh(const char* filename). If you want to
|
||||
remove a loaded mesh from the cache again, use removeMesh().
|
||||
\param file File handle of the mesh to load.
|
||||
\return NULL if failed and pointer to the mesh if successful.
|
||||
This pointer should not be dropped. See
|
||||
IReferenceCounted::drop() for more information. */
|
||||
virtual IAnimatedMesh* getMesh(io::IReadFile* file) = 0;
|
||||
|
||||
//! Returns an interface to the mesh cache which is shared beween all existing scene managers.
|
||||
@ -394,8 +393,9 @@ namespace scene
|
||||
scene node will be placed.
|
||||
\param rotation: Initital rotation of the scene node.
|
||||
\param scale: Initial scale of the scene node.
|
||||
\return Returns pointer to the created test scene node.
|
||||
This pointer should not be dropped. See IReferenceCounted::drop() for more information. */
|
||||
\return Returns pointer to the created test scene node. This
|
||||
pointer should not be dropped. See IReferenceCounted::drop()
|
||||
for more information. */
|
||||
virtual IMeshSceneNode* addCubeSceneNode(f32 size=10.0f, ISceneNode* parent=0, s32 id=-1,
|
||||
const core::vector3df& position = core::vector3df(0,0,0),
|
||||
const core::vector3df& rotation = core::vector3df(0,0,0),
|
||||
@ -411,8 +411,9 @@ namespace scene
|
||||
scene node will be placed.
|
||||
\param rotation: Initital rotation of the scene node.
|
||||
\param scale: Initial scale of the scene node.
|
||||
\return Returns pointer to the created test scene node.
|
||||
This pointer should not be dropped. See IReferenceCounted::drop() for more information. */
|
||||
\return Returns pointer to the created test scene node. This
|
||||
pointer should not be dropped. See IReferenceCounted::drop()
|
||||
for more information. */
|
||||
virtual IMeshSceneNode* addSphereSceneNode(f32 radius=5.0f, s32 polyCount=16,
|
||||
ISceneNode* parent=0, s32 id=-1,
|
||||
const core::vector3df& position = core::vector3df(0,0,0),
|
||||
@ -456,19 +457,19 @@ namespace scene
|
||||
|
||||
//! Adds a scene node for rendering a animated water surface mesh.
|
||||
/** Looks really good when the Material type EMT_TRANSPARENT_REFLECTION
|
||||
is used.
|
||||
\param waveHeight: Height of the water waves.
|
||||
\param waveSpeed: Speed of the water waves.
|
||||
\param waveLength: Lenght of a water wave.
|
||||
\param mesh: Pointer to the loaded static mesh to be displayed with water waves on it.
|
||||
\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 position: Position of the space relative to its parent where the
|
||||
scene node will be placed.
|
||||
\param rotation: Initital rotation of the scene node.
|
||||
\param scale: Initial scale of the scene node.
|
||||
\return Returns pointer to the created scene node.
|
||||
This pointer should not be dropped. See IReferenceCounted::drop() for more information. */
|
||||
is used.
|
||||
\param waveHeight: Height of the water waves.
|
||||
\param waveSpeed: Speed of the water waves.
|
||||
\param waveLength: Lenght of a water wave.
|
||||
\param mesh: Pointer to the loaded static mesh to be displayed with water waves on it.
|
||||
\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 position: Position of the space relative to its parent where the
|
||||
scene node will be placed.
|
||||
\param rotation: Initital rotation of the scene node.
|
||||
\param scale: Initial scale of the scene node.
|
||||
\return Pointer to the created scene node.
|
||||
This pointer should not be dropped. See IReferenceCounted::drop() for more information. */
|
||||
virtual ISceneNode* addWaterSurfaceSceneNode(IMesh* mesh,
|
||||
f32 waveHeight=2.0f, f32 waveSpeed=300.0f, f32 waveLength=10.0f,
|
||||
ISceneNode* parent=0, s32 id=-1,
|
||||
@ -488,24 +489,24 @@ namespace scene
|
||||
If a node gets less polys than this value it will not be split into
|
||||
smaller nodes.
|
||||
\param alsoAddIfMeshPointerZero: Add the scene node even if a 0 pointer is passed.
|
||||
\return Returns the 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. */
|
||||
virtual ISceneNode* addOctTreeSceneNode(IAnimatedMesh* mesh, ISceneNode* parent=0,
|
||||
s32 id=-1, s32 minimalPolysPerNode=256, bool alsoAddIfMeshPointerZero=false) = 0;
|
||||
|
||||
//! Adds a scene node for rendering using a octtree to the scene graph.
|
||||
/** This a good method for rendering
|
||||
scenes with lots of geometry. The Octree is built on the fly from the mesh, much
|
||||
faster then a bsp tree.
|
||||
\param mesh: The mesh containing all geometry from which the octtree will be build.
|
||||
\param parent: Parent node of the octtree 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.
|
||||
If a node gets less polys than this value it will not be split into
|
||||
smaller nodes.
|
||||
/** This a good method for rendering scenes with lots of
|
||||
geometry. The Octree is built on the fly from the mesh, much
|
||||
faster then a bsp tree.
|
||||
\param mesh: The mesh containing all geometry from which the octtree will be build.
|
||||
\param parent: Parent node of the octtree 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.
|
||||
If a node gets less polys than this value it will not be split into
|
||||
smaller nodes.
|
||||
\param alsoAddIfMeshPointerZero: Add the scene node even if a 0 pointer is passed.
|
||||
\return Returns the pointer to the octtree if successful, otherwise 0.
|
||||
This pointer should not be dropped. See IReferenceCounted::drop() for more information. */
|
||||
\return Pointer to the octtree if successful, otherwise 0.
|
||||
This pointer should not be dropped. See IReferenceCounted::drop() for more information. */
|
||||
virtual ISceneNode* addOctTreeSceneNode(IMesh* mesh, ISceneNode* parent=0,
|
||||
s32 id=-1, s32 minimalPolysPerNode=256, bool alsoAddIfMeshPointerZero=false) = 0;
|
||||
|
||||
@ -538,8 +539,7 @@ namespace scene
|
||||
f32 rotateSpeed = -1500.0f, f32 zoomSpeed = 200.0f,
|
||||
f32 translationSpeed = 1500.0f, s32 id=-1) = 0;
|
||||
|
||||
//! Adds a camera scene node with an animator which provides
|
||||
//! mouse and keyboard control like in most first person shooters (FPS).
|
||||
//! Adds a camera scene node with an animator which provides mouse and keyboard control like in most first person shooters (FPS).
|
||||
/** Look with the mouse, move with cursor keys. If you do not like the default
|
||||
key layout, you may want to specify your own. For example to make the camera
|
||||
be controlled by the cursor keys AND the keys W,A,S, and D, do something
|
||||
@ -615,7 +615,7 @@ namespace scene
|
||||
\param parent: Parent scene node of the billboard. Can be null. If the parent moves,
|
||||
the billboard will move too.
|
||||
\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
|
||||
width and height.
|
||||
\param id: An id of the node. This id can be used to identify the node.
|
||||
@ -654,10 +654,10 @@ namespace scene
|
||||
\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 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.
|
||||
Value should be between 0 and 2, where 1 is an exact
|
||||
half-sphere and 2 is a full sphere.
|
||||
Value should be between 0 and 2, where 1 is an exact
|
||||
half-sphere and 2 is a full sphere.
|
||||
\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
|
||||
change how it is drawn.
|
||||
@ -707,15 +707,15 @@ namespace scene
|
||||
The patch size of the terrain must always be a size of 2^N+1,
|
||||
i.e. 8+1(9), 16+1(17), etc.
|
||||
The MaxLOD available is directly dependent on the patch size
|
||||
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
|
||||
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
|
||||
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
|
||||
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
|
||||
of 17, is asking the algoritm to generate indices every 2^8 (
|
||||
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 (
|
||||
every 2 vertices ), LOD 2 ( every 4 vertices ), LOD 3 ( every
|
||||
8 vertices ) and LOD 4 ( every 16 vertices ).
|
||||
@ -725,11 +725,11 @@ namespace scene
|
||||
\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 rotation: The absolute rotation of this node. ( NOT YET IMPLEMENTED )
|
||||
\param scale: The scale factor for the terrain. If you're
|
||||
using a heightmap of size 129x129 and would like your terrain
|
||||
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
|
||||
scaling factor of 0.0f, then your terrain will be flat.
|
||||
\param scale: The scale factor for the terrain. If you're
|
||||
using a heightmap of size 129x129 and would like your terrain
|
||||
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
|
||||
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
|
||||
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
|
||||
@ -739,10 +739,10 @@ namespace scene
|
||||
\param smoothFactor: The number of times the vertices are smoothed.
|
||||
\param addAlsoIfHeightmapEmpty: Add terrain node even with empty heightmap.
|
||||
\return Returns pointer to the created scene node. Can be null
|
||||
if the terrain could not be created, for example because the
|
||||
heightmap could not be loaded. The returned pointer should
|
||||
not be dropped. See IReferenceCounted::drop() for more
|
||||
information. */
|
||||
if the terrain could not be created, for example because the
|
||||
heightmap could not be loaded. The returned pointer should
|
||||
not be dropped. See IReferenceCounted::drop() for more
|
||||
information. */
|
||||
virtual ITerrainSceneNode* addTerrainSceneNode(
|
||||
const c8* heightMapFileName,
|
||||
ISceneNode* parent=0, s32 id=-1,
|
||||
@ -763,11 +763,11 @@ namespace scene
|
||||
\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 rotation: The absolute rotation of this node. ( NOT YET IMPLEMENTED )
|
||||
\param scale: The scale factor for the terrain. If you're
|
||||
using a heightmap of size 129x129 and would like your terrain
|
||||
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
|
||||
scaling factor of 0.0f, then your terrain will be flat.
|
||||
\param scale: The scale factor for the terrain. If you're
|
||||
using a heightmap of size 129x129 and would like your terrain
|
||||
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
|
||||
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
|
||||
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
|
||||
@ -777,10 +777,10 @@ namespace scene
|
||||
\param smoothFactor: The number of times the vertices are smoothed.
|
||||
\param addAlsoIfHeightmapEmpty: Add terrain node even with empty heightmap.
|
||||
\return Returns pointer to the created scene node. Can be null
|
||||
if the terrain could not be created, for example because the
|
||||
heightmap could not be loaded. The returned pointer should
|
||||
not be dropped. See IReferenceCounted::drop() for more
|
||||
information. */
|
||||
if the terrain could not be created, for example because the
|
||||
heightmap could not be loaded. The returned pointer should
|
||||
not be dropped. See IReferenceCounted::drop() for more
|
||||
information. */
|
||||
virtual ITerrainSceneNode* addTerrainSceneNode(
|
||||
io::IReadFile* heightMapFile,
|
||||
ISceneNode* parent=0, s32 id=-1,
|
||||
@ -817,11 +817,10 @@ namespace scene
|
||||
virtual IDummyTransformationSceneNode* addDummyTransformationSceneNode(
|
||||
ISceneNode* parent=0, s32 id=-1) = 0;
|
||||
|
||||
//! Adds a text scene node, which is able to display 2d text at
|
||||
//! a position in three dimensional space
|
||||
//! Adds a text scene node, which is able to display 2d text at a position in three dimensional space
|
||||
virtual ITextSceneNode* addTextSceneNode(gui::IGUIFont* font, const wchar_t* text,
|
||||
video::SColor color=video::SColor(100,255,255,255),
|
||||
ISceneNode* parent = 0, const core::vector3df& position = core::vector3df(0,0,0),
|
||||
ISceneNode* parent = 0, const core::vector3df& position = core::vector3df(0,0,0),
|
||||
s32 id=-1) = 0;
|
||||
|
||||
//! Adds a text scene node, which uses billboards
|
||||
@ -860,7 +859,7 @@ namespace scene
|
||||
This pointer should not be dropped. See IReferenceCounted::drop() for more information. */
|
||||
virtual IAnimatedMesh* addHillPlaneMesh(const c8* name,
|
||||
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>& textureRepeatCount = core::dimension2d<f32>(1.0f, 1.0f)) = 0;
|
||||
|
||||
@ -941,7 +940,7 @@ namespace scene
|
||||
and null if no scene node could be found. */
|
||||
virtual ISceneNode* getSceneNodeFromType(scene::ESCENE_NODE_TYPE type, ISceneNode* start=0) = 0;
|
||||
|
||||
//! returns scene nodes by type.
|
||||
//! Get scene nodes by type.
|
||||
/** \param type: Type of scene node to find.
|
||||
\param outNodes: array to be filled with results.
|
||||
\param start: Scene node to start from. All children of this scene
|
||||
@ -951,7 +950,7 @@ namespace scene
|
||||
core::array<scene::ISceneNode*>& outNodes,
|
||||
ISceneNode* start=0) = 0;
|
||||
|
||||
//! Returns the current active camera.
|
||||
//! Get the current active camera.
|
||||
/** \return The active camera is returned. Note that this can be NULL, if there
|
||||
was no camera created yet. */
|
||||
virtual ICameraSceneNode* getActiveCamera() = 0;
|
||||
@ -988,18 +987,18 @@ namespace scene
|
||||
|
||||
//! Creates a rotation animator, which rotates the attached scene node around itself.
|
||||
/** \param rotationPerSecond: Specifies the speed of the animation
|
||||
\return Returns 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.
|
||||
If you no longer need the animator, you should call ISceneNodeAnimator::drop().
|
||||
See IReferenceCounted::drop() for more information. */
|
||||
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 radius: Radius of the circle.
|
||||
\param speed: Specifies the speed of the flight.
|
||||
\param direction: Specifies the upvector used for alignment of the mesh.
|
||||
\return Returns 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.
|
||||
If you no longer need the animator, you should call ISceneNodeAnimator::drop().
|
||||
See IReferenceCounted::drop() for more information. */
|
||||
@ -1007,8 +1006,7 @@ namespace scene
|
||||
f32 radius, f32 speed=0.001f,
|
||||
const core::vector3df& direction=core::vector3df ( 0.f, 1.f, 0.f ) ) = 0;
|
||||
|
||||
//! 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 endPoint: End point of the line.
|
||||
\param timeForWay: Time in milli seconds how long the node should need to
|
||||
@ -1022,8 +1020,7 @@ namespace scene
|
||||
virtual ISceneNodeAnimator* createFlyStraightAnimator(const core::vector3df& startPoint,
|
||||
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 timePerFrame: Time in milliseconds, how long any texture in the list
|
||||
should be visible.
|
||||
@ -1053,7 +1050,7 @@ namespace scene
|
||||
to the scene node, the scene node will not be able to move through walls and is
|
||||
affected by gravity.
|
||||
\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
|
||||
it:
|
||||
\code
|
||||
@ -1086,7 +1083,7 @@ namespace scene
|
||||
It uses a subset of hermite splines: either cardinal splines
|
||||
(tightness != 0.5) or catmull-rom-splines (tightness == 0.5).
|
||||
The animator moves from one control point to the next in
|
||||
1/speed seconds. This code was sent in by Matthias Gall. */
|
||||
1/speed seconds. This code was sent in by Matthias Gall. */
|
||||
virtual ISceneNodeAnimator* createFollowSplineAnimator(s32 startTime,
|
||||
const core::array< core::vector3df >& points,
|
||||
f32 speed = 1.0f, f32 tightness = 0.5f) = 0;
|
||||
@ -1231,8 +1228,7 @@ namespace scene
|
||||
//! Returns a scene node factory by index
|
||||
virtual ISceneNodeFactory* getSceneNodeFactory(u32 index) = 0;
|
||||
|
||||
//! Returns the default scene node animator factory which can
|
||||
//! create all built-in scene node animators
|
||||
//! Returns the default scene node animator factory which can create all built-in scene node animators
|
||||
virtual ISceneNodeAnimatorFactory* getDefaultSceneNodeAnimatorFactory() = 0;
|
||||
|
||||
//! Adds a scene node animator factory to the scene manager.
|
||||
@ -1254,13 +1250,13 @@ namespace scene
|
||||
|
||||
//! Creates a new scene manager.
|
||||
/** This can be used to easily draw and/or store two
|
||||
independent scenes at the same time. The mesh cache will be
|
||||
independent scenes at the same time. The mesh cache will be
|
||||
shared between all existing scene managers, which means if you
|
||||
load a mesh in the original scene manager using for example
|
||||
getMesh(), the mesh will be available in all other scene
|
||||
managers too, without loading.
|
||||
The original/main scene manager will still be there and
|
||||
accessible via IrrlichtDevice::getSceneManager(). If you need
|
||||
accessible via IrrlichtDevice::getSceneManager(). If you need
|
||||
input event in this new scene manager, for example for FPS
|
||||
cameras, you'll need to forward input to this manually: Just
|
||||
implement an IEventReceiver and call
|
||||
|
@ -1,4 +1,4 @@
|
||||
// Copyright (C) 2002-2007 Nikolaus Gebhardt
|
||||
// Copyright (C) 2002-2008 Nikolaus Gebhardt
|
||||
// This file is part of the "Irrlicht Engine".
|
||||
// For conditions of distribution and use, see copyright notice in irrlicht.h
|
||||
|
||||
@ -71,18 +71,18 @@ namespace scene
|
||||
|
||||
//! This method is called just before the rendering process of the whole scene.
|
||||
/** Nodes may register themselves in the render pipeline during this call,
|
||||
precalculate the geometry which should be renderered, and prevent their
|
||||
children from being able to register themselves if they are clipped by simply
|
||||
not calling their OnRegisterSceneNode method.
|
||||
If you are implementing your own scene node, you should overwrite this method
|
||||
with an implementation code looking like this:
|
||||
\code
|
||||
if (IsVisible)
|
||||
precalculate the geometry which should be renderered, and prevent their
|
||||
children from being able to register themselves if they are clipped by simply
|
||||
not calling their OnRegisterSceneNode method.
|
||||
If you are implementing your own scene node, you should overwrite this method
|
||||
with an implementation code looking like this:
|
||||
\code
|
||||
if (IsVisible)
|
||||
SceneManager->registerNodeForRendering(this);
|
||||
|
||||
ISceneNode::OnRegisterSceneNode();
|
||||
\endcode
|
||||
*/
|
||||
ISceneNode::OnRegisterSceneNode();
|
||||
\endcode
|
||||
*/
|
||||
virtual void OnRegisterSceneNode()
|
||||
{
|
||||
if (IsVisible)
|
||||
@ -95,11 +95,11 @@ namespace scene
|
||||
|
||||
|
||||
//! OnAnimate() is called just before rendering the whole scene.
|
||||
//! Nodes may calculate or store animations here, and may do other useful things,
|
||||
//! depending on what they are. Also, OnAnimate() should be called for all
|
||||
//! child scene nodes here. This method will be called once per frame, independent
|
||||
//! of whether the scene node is visible or not.
|
||||
//! \param timeMs Current time in milliseconds.
|
||||
/** Nodes may calculate or store animations here, and may do other useful things,
|
||||
depending on what they are. Also, OnAnimate() should be called for all
|
||||
child scene nodes here. This method will be called once per frame, independent
|
||||
of whether the scene node is visible or not.
|
||||
\param timeMs Current time in milliseconds. */
|
||||
virtual void OnAnimate(u32 timeMs)
|
||||
{
|
||||
if (IsVisible)
|
||||
@ -127,7 +127,7 @@ namespace scene
|
||||
|
||||
|
||||
//! Returns the name of the node.
|
||||
//! \return Name as character string.
|
||||
/** \return Name as character string. */
|
||||
virtual const c8* getName() const
|
||||
{
|
||||
return Name.c_str();
|
||||
@ -135,26 +135,26 @@ namespace scene
|
||||
|
||||
|
||||
//! Sets the name of the node.
|
||||
//! \param name New name of the scene node.
|
||||
/** \param name New name of the scene node. */
|
||||
virtual void setName(const c8* name)
|
||||
{
|
||||
Name = name;
|
||||
}
|
||||
|
||||
|
||||
//! Returns the axis aligned, not transformed bounding box of this node.
|
||||
//! This means that if this node is an animated 3d character, moving in a room,
|
||||
//! the bounding box will always be around the origin. To get the box in
|
||||
//! real world coordinates, just transform it with the matrix you receive with
|
||||
//! getAbsoluteTransformation() or simply use getTransformedBoundingBox(),
|
||||
//! which does the same.
|
||||
//! \return The non-transformed bounding box.
|
||||
//! Get the axis aligned, not transformed bounding box of this node.
|
||||
/** This means that if this node is an animated 3d character,
|
||||
moving in a room, the bounding box will always be around the
|
||||
origin. To get the box in real world coordinates, just
|
||||
transform it with the matrix you receive with
|
||||
getAbsoluteTransformation() or simply use
|
||||
getTransformedBoundingBox(), which does the same.
|
||||
\return The non-transformed bounding box. */
|
||||
virtual const core::aabbox3d<f32>& getBoundingBox() const = 0;
|
||||
|
||||
|
||||
//! Returns the axis aligned, transformed and animated absolute bounding box
|
||||
//! of this node.
|
||||
//! \return The transformed bounding box.
|
||||
//! Get the axis aligned, transformed and animated absolute bounding box of this node.
|
||||
/** \return The transformed bounding box. */
|
||||
virtual const core::aabbox3d<f32> getTransformedBoundingBox() const
|
||||
{
|
||||
core::aabbox3d<f32> box = getBoundingBox();
|
||||
@ -163,7 +163,7 @@ namespace scene
|
||||
}
|
||||
|
||||
|
||||
//! returns the absolute transformation of the node. Is recalculated every OnAnimate()-call.
|
||||
//! Get the absolute transformation of the node. Is recalculated every OnAnimate()-call.
|
||||
//! \return The absolute transformation matrix.
|
||||
virtual const core::matrix4& getAbsoluteTransformation() const
|
||||
{
|
||||
@ -172,10 +172,10 @@ namespace scene
|
||||
|
||||
|
||||
//! Returns the relative transformation of the scene node.
|
||||
//! The relative transformation is stored internally as 3 vectors:
|
||||
//! translation, rotation and scale. To get the relative transformation
|
||||
//! matrix, it is calculated from these values.
|
||||
//! \return The relative transformation matrix.
|
||||
/** The relative transformation is stored internally as 3
|
||||
vectors: translation, rotation and scale. To get the relative
|
||||
transformation matrix, it is calculated from these values.
|
||||
\return The relative transformation matrix. */
|
||||
virtual core::matrix4 getRelativeTransformation() const
|
||||
{
|
||||
core::matrix4 mat;
|
||||
@ -193,9 +193,10 @@ namespace scene
|
||||
}
|
||||
|
||||
|
||||
//! Returns true if the node is visible. This is only an option
|
||||
//! set by the user, but has nothing to do with geometry culling
|
||||
//! \return The visibility of the node, true means visible.
|
||||
//! Returns true if the node is visible.
|
||||
/** This is only an option set by the user, but has nothing to
|
||||
do with geometry culling
|
||||
\return The visibility of the node, true means visible. */
|
||||
virtual bool isVisible() const
|
||||
{
|
||||
_IRR_IMPLEMENT_MANAGED_MARSHALLING_BUGFIX;
|
||||
@ -203,33 +204,38 @@ namespace scene
|
||||
}
|
||||
|
||||
|
||||
//! Sets if the node should be visible or not. All children of this node won't be visible either, when set to true.
|
||||
//! \param isVisisble If the node shall be visible.
|
||||
//! Sets if the node should be visible or not.
|
||||
/** All children of this node won't be visible either, when set
|
||||
to true.
|
||||
\param isVisible If the node shall be visible. */
|
||||
virtual void setVisible(bool isVisible)
|
||||
{
|
||||
IsVisible = isVisible;
|
||||
}
|
||||
|
||||
|
||||
//! Returns the id of the scene node. This id can be used to identify the node.
|
||||
//! \return The id.
|
||||
//! Get the id of the scene node.
|
||||
/** This id can be used to identify the node.
|
||||
\return The id. */
|
||||
virtual s32 getID() const
|
||||
{
|
||||
return ID;
|
||||
}
|
||||
|
||||
|
||||
//! Sets the id of the scene node. This id can be used to identify the node.
|
||||
//! \param id The new id.
|
||||
//! Sets the id of the scene node.
|
||||
/** This id can be used to identify the node.
|
||||
\param id The new id. */
|
||||
virtual void setID(s32 id)
|
||||
{
|
||||
ID = id;
|
||||
}
|
||||
|
||||
|
||||
//! Adds a child to this scene node. If the scene node already
|
||||
//! has a parent it is first removed from the other parent.
|
||||
//! \param child A pointer to the new child.
|
||||
//! Adds a child to this scene node.
|
||||
/** If the scene node already has a parent it is first removed
|
||||
from the other parent.
|
||||
\param child A pointer to the new child. */
|
||||
virtual void addChild(ISceneNode* child)
|
||||
{
|
||||
if (child && (child != this))
|
||||
@ -243,8 +249,9 @@ namespace scene
|
||||
|
||||
|
||||
//! Removes a child from this scene node.
|
||||
//! \param child A pointer to the new child.
|
||||
//! \return True if the child could be removed, and false if not.
|
||||
/** \param child A pointer to the new child.
|
||||
\return True if the child was removed, and false if not,
|
||||
e.g. because it couldn't be found in the children list. */
|
||||
virtual bool removeChild(ISceneNode* child)
|
||||
{
|
||||
core::list<ISceneNode*>::Iterator it = Children.begin();
|
||||
@ -285,7 +292,7 @@ namespace scene
|
||||
|
||||
|
||||
//! Adds an animator which should animate this node.
|
||||
//! \param animator A pointer to the new animator.
|
||||
/** \param animator A pointer to the new animator. */
|
||||
virtual void addAnimator(ISceneNodeAnimator* animator)
|
||||
{
|
||||
if (animator)
|
||||
@ -296,8 +303,8 @@ namespace scene
|
||||
}
|
||||
|
||||
|
||||
//! Returns a const reference to the list of all scene node animators.
|
||||
//! \return The list of animators attached to this node.
|
||||
//! Get a list of all scene node animators.
|
||||
/** \return The list of animators attached to this node. */
|
||||
const core::list<ISceneNodeAnimator*>& getAnimators() const
|
||||
{
|
||||
return Animators;
|
||||
@ -305,7 +312,7 @@ namespace scene
|
||||
|
||||
|
||||
//! Removes an animator from this scene node.
|
||||
//! \param animator A pointer to the animator to be deleted.
|
||||
/** \param animator A pointer to the animator to be deleted. */
|
||||
virtual void removeAnimator(ISceneNodeAnimator* animator)
|
||||
{
|
||||
core::list<ISceneNodeAnimator*>::Iterator it = Animators.begin();
|
||||
@ -330,31 +337,33 @@ namespace scene
|
||||
}
|
||||
|
||||
|
||||
//! Returns the material based on the zero based index i. To get the amount
|
||||
//! of materials used by this scene node, use getMaterialCount().
|
||||
//! This function is needed for inserting the node into the scene hierarchy at an
|
||||
//! optimal position for minimizing renderstate changes, but can also be used
|
||||
//! to directly modify the material of a scene node.
|
||||
//! \param num Zero based index. The maximal value is getMaterialCount() - 1.
|
||||
//! \return The material at that index.
|
||||
//! Returns the material based on the zero based index i.
|
||||
/** To get the amount of materials used by this scene node, use
|
||||
getMaterialCount(). This function is needed for inserting the
|
||||
node into the scene hierarchy at an optimal position for
|
||||
minimizing renderstate changes, but can also be used to
|
||||
directly modify the material of a scene node.
|
||||
\param num Zero based index. The maximal value is getMaterialCount() - 1.
|
||||
\return The material at that index. */
|
||||
virtual video::SMaterial& getMaterial(u32 num)
|
||||
{
|
||||
return *((video::SMaterial*)0);
|
||||
}
|
||||
|
||||
|
||||
//! Returns amount of materials used by this scene node.
|
||||
//! \return Current amount of materials used by this scene node.
|
||||
//! Get amount of materials used by this scene node.
|
||||
/** \return Current amount of materials of this scene node. */
|
||||
virtual u32 getMaterialCount() const
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
//! Sets all material flags at once to a new value. Useful, for
|
||||
//! example, if you want the whole mesh to be affected by light.
|
||||
//! \param flag Which flag of all materials to be set.
|
||||
//! \param newvalue New value of that flag.
|
||||
//! Sets all material flags at once to a new value.
|
||||
/** Useful, for example, if you want the whole mesh to be
|
||||
affected by light.
|
||||
\param flag Which flag of all materials to be set.
|
||||
\param newvalue New value of that flag. */
|
||||
void setMaterialFlag(video::E_MATERIAL_FLAG flag, bool newvalue)
|
||||
{
|
||||
for (u32 i=0; i<getMaterialCount(); ++i)
|
||||
@ -362,11 +371,10 @@ namespace scene
|
||||
}
|
||||
|
||||
|
||||
//! Sets the texture of the specified layer in all materials of this
|
||||
//! scene node to the new texture.
|
||||
//! \param textureLayer Layer of texture to be set. Must be a
|
||||
//! value smaller than MATERIAL_MAX_TEXTURES.
|
||||
//! \param texture New texture to be used.
|
||||
//! Sets the texture of the specified layer in all materials of this scene node to the new texture.
|
||||
/** \param textureLayer Layer of texture to be set. Must be a
|
||||
value smaller than MATERIAL_MAX_TEXTURES.
|
||||
\param texture New texture to be used. */
|
||||
void setMaterialTexture(u32 textureLayer, video::ITexture* texture)
|
||||
{
|
||||
if (textureLayer >= video::MATERIAL_MAX_TEXTURES)
|
||||
@ -377,9 +385,8 @@ namespace scene
|
||||
}
|
||||
|
||||
|
||||
//! Sets the material type of all materials in this scene node
|
||||
//! to a new material type.
|
||||
//! \param newType New type of material to be set.
|
||||
//! Sets the material type of all materials in this scene node to a new material type.
|
||||
/** \param newType New type of material to be set. */
|
||||
void setMaterialType(video::E_MATERIAL_TYPE newType)
|
||||
{
|
||||
for (u32 i=0; i<getMaterialCount(); ++i)
|
||||
@ -440,7 +447,7 @@ namespace scene
|
||||
|
||||
|
||||
//! Gets the abolute position of the node.
|
||||
//! \return The current absolute position of the scene node.
|
||||
/** \return The current absolute position of the scene node. */
|
||||
virtual core::vector3df getAbsolutePosition() const
|
||||
{
|
||||
return AbsoluteTransformation.getTranslation();
|
||||
@ -470,7 +477,7 @@ namespace scene
|
||||
|
||||
//! Sets if debug data like bounding boxes should be drawn.
|
||||
/** A bitwise OR of the types is supported.
|
||||
Please note that not all scene nodes support this feature.
|
||||
Please note that not all scene nodes support this feature.
|
||||
\param state The debug data visibility state to be used. */
|
||||
virtual void setDebugDataVisible(s32 state)
|
||||
{
|
||||
@ -530,29 +537,30 @@ namespace scene
|
||||
|
||||
|
||||
//! Returns the triangle selector attached to this scene node.
|
||||
//! The Selector can be used by the engine for doing collision
|
||||
//! detection. You can create a TriangleSelector with
|
||||
//! ISceneManager::createTriangleSelector() or
|
||||
//! ISceneManager::createOctTreeTriangleSelector and set it with
|
||||
//! ISceneNode::setTriangleSelector(). If a scene node got no triangle
|
||||
//! selector, but collision tests should be done with it, a triangle
|
||||
//! selector is created using the bounding box of the scene node.
|
||||
//! \return A pointer to the TriangleSelector or 0, if there
|
||||
//! is none.
|
||||
/** The Selector can be used by the engine for doing collision
|
||||
detection. You can create a TriangleSelector with
|
||||
ISceneManager::createTriangleSelector() or
|
||||
ISceneManager::createOctTreeTriangleSelector and set it with
|
||||
ISceneNode::setTriangleSelector(). If a scene node got no triangle
|
||||
selector, but collision tests should be done with it, a triangle
|
||||
selector is created using the bounding box of the scene node.
|
||||
\return A pointer to the TriangleSelector or 0, if there
|
||||
is none. */
|
||||
virtual ITriangleSelector* getTriangleSelector() const
|
||||
{
|
||||
return TriangleSelector;
|
||||
}
|
||||
|
||||
|
||||
//! Sets the triangle selector of the scene node. The Selector can be
|
||||
//! used by the engine for doing collision detection. You can create a
|
||||
//! TriangleSelector with ISceneManager::createTriangleSelector() or
|
||||
//! ISceneManager::createOctTreeTriangleSelector(). Some nodes may
|
||||
//! create their own selector by default, so it would be good to
|
||||
//! check if there is already a selector in this node by calling
|
||||
//! ISceneNode::getTriangleSelector().
|
||||
//! \param selector New triangle selector for this scene node.
|
||||
//! Sets the triangle selector of the scene node.
|
||||
/** The Selector can be used by the engine for doing collision
|
||||
detection. You can create a TriangleSelector with
|
||||
ISceneManager::createTriangleSelector() or
|
||||
ISceneManager::createOctTreeTriangleSelector(). Some nodes may
|
||||
create their own selector by default, so it would be good to
|
||||
check if there is already a selector in this node by calling
|
||||
ISceneNode::getTriangleSelector().
|
||||
\param selector New triangle selector for this scene node. */
|
||||
virtual void setTriangleSelector(ITriangleSelector* selector)
|
||||
{
|
||||
if (TriangleSelector)
|
||||
@ -564,7 +572,7 @@ namespace scene
|
||||
}
|
||||
|
||||
|
||||
//! updates the absolute position based on the relative and the parents position
|
||||
//! Updates the absolute position based on the relative and the parents position
|
||||
virtual void updateAbsolutePosition()
|
||||
{
|
||||
if (Parent)
|
||||
@ -578,7 +586,7 @@ namespace scene
|
||||
|
||||
|
||||
//! Returns the parent of this scene node
|
||||
//! \return A pointer to the parent.
|
||||
/** \return A pointer to the parent. */
|
||||
scene::ISceneNode* getParent() const
|
||||
{
|
||||
return Parent;
|
||||
@ -586,7 +594,7 @@ namespace scene
|
||||
|
||||
|
||||
//! Returns type of the scene node
|
||||
//! \return The type of this node.
|
||||
/** \return The type of this node. */
|
||||
virtual ESCENE_NODE_TYPE getType() const
|
||||
{
|
||||
return ESNT_UNKNOWN;
|
||||
@ -594,10 +602,12 @@ namespace scene
|
||||
|
||||
|
||||
//! Writes attributes of the scene node.
|
||||
//! Implement this to expose the attributes of your scene node for
|
||||
//! scripting languages, editors, debuggers or xml serialization purposes.
|
||||
//! \param out The attribute container to write into.
|
||||
//! \param options Additional options which might influence the serialization.
|
||||
/** Implement this to expose the attributes of your scene node
|
||||
for scripting languages, editors, debuggers or xml
|
||||
serialization purposes.
|
||||
\param out The attribute container to write into.
|
||||
\param options Additional options which might influence the
|
||||
serialization. */
|
||||
virtual void serializeAttributes(io::IAttributes* out, io::SAttributeReadWriteOptions* options=0) const
|
||||
{
|
||||
if (!out)
|
||||
@ -617,10 +627,12 @@ namespace scene
|
||||
|
||||
|
||||
//! Reads attributes of the scene node.
|
||||
//! Implement this to set the attributes of your scene node for
|
||||
//! scripting languages, editors, debuggers or xml deserialization purposes.
|
||||
//! \param in The attribute container to read from.
|
||||
//! \param options Additional options which might influence the deserialization.
|
||||
/** Implement this to set the attributes of your scene node for
|
||||
scripting languages, editors, debuggers or xml deserialization
|
||||
purposes.
|
||||
\param in The attribute container to read from.
|
||||
\param options Additional options which might influence the
|
||||
deserialization. */
|
||||
virtual void deserializeAttributes(io::IAttributes* in, io::SAttributeReadWriteOptions* options=0)
|
||||
{
|
||||
if (!in)
|
||||
@ -643,27 +655,28 @@ namespace scene
|
||||
}
|
||||
|
||||
//! Creates a clone of this scene node and its children.
|
||||
//! \param newParent An optional new parent.
|
||||
//! \param newManager An optional new scene manager.
|
||||
//! \return The newly created clone of this node.
|
||||
virtual ISceneNode* clone(ISceneNode* newParent=0, ISceneManager* newManager=0)
|
||||
{
|
||||
/** \param newParent An optional new parent.
|
||||
\param newManager An optional new scene manager.
|
||||
\return The newly created clone of this node. */
|
||||
virtual ISceneNode* clone(ISceneNode* newParent=0, ISceneManager* newManager=0)
|
||||
{
|
||||
return 0; // to be implemented by derived classes
|
||||
}
|
||||
|
||||
protected:
|
||||
|
||||
//! A clone function for the ISceneNode members.
|
||||
//! this method can be used by clone() implementations of derived classes
|
||||
//! \param topCopyFrom The node from which the values are copied
|
||||
//! \param newManager The new scene manager.
|
||||
/** This method can be used by clone() implementations of
|
||||
derived classes
|
||||
\param toCopyFrom The node from which the values are copied
|
||||
\param newManager The new scene manager. */
|
||||
void cloneMembers(ISceneNode* toCopyFrom, ISceneManager* newManager)
|
||||
{
|
||||
Name = toCopyFrom->Name;
|
||||
AbsoluteTransformation = toCopyFrom->AbsoluteTransformation;
|
||||
RelativeTranslation = toCopyFrom->RelativeTranslation;
|
||||
RelativeRotation = toCopyFrom->RelativeRotation;
|
||||
RelativeScale = toCopyFrom->RelativeScale;
|
||||
RelativeScale = toCopyFrom->RelativeScale;
|
||||
ID = toCopyFrom->ID;
|
||||
setTriangleSelector(toCopyFrom->TriangleSelector);
|
||||
AutomaticCullingState = toCopyFrom->AutomaticCullingState;
|
||||
@ -696,19 +709,19 @@ namespace scene
|
||||
}
|
||||
}
|
||||
|
||||
//! name of the scene node.
|
||||
//! Name of the scene node.
|
||||
core::stringc Name;
|
||||
|
||||
//! absolute transformation of the node.
|
||||
//! Absolute transformation of the node.
|
||||
core::matrix4 AbsoluteTransformation;
|
||||
|
||||
//! relative translation of the scene node.
|
||||
//! Relative translation of the scene node.
|
||||
core::vector3df RelativeTranslation;
|
||||
|
||||
//! relative rotation of the scene node.
|
||||
//! Relative rotation of the scene node.
|
||||
core::vector3df RelativeRotation;
|
||||
|
||||
//! relative scale of the scene node.
|
||||
//! Relative scale of the scene node.
|
||||
core::vector3df RelativeScale;
|
||||
|
||||
//! Pointer to the parent
|
||||
@ -720,25 +733,25 @@ namespace scene
|
||||
//! List of all animator nodes
|
||||
core::list<ISceneNodeAnimator*> Animators;
|
||||
|
||||
//! id of the node.
|
||||
//! ID of the node.
|
||||
s32 ID;
|
||||
|
||||
//! pointer to the scene manager
|
||||
//! Pointer to the scene manager
|
||||
ISceneManager* SceneManager;
|
||||
|
||||
//! pointer to the triangle selector
|
||||
//! Pointer to the triangle selector
|
||||
ITriangleSelector* TriangleSelector;
|
||||
|
||||
//! automatic culling
|
||||
//! Automatic culling state
|
||||
E_CULLING_TYPE AutomaticCullingState;
|
||||
|
||||
//! is the node visible?
|
||||
//! Is the node visible?
|
||||
bool IsVisible;
|
||||
|
||||
//! flag if debug data should be drawn, such as Bounding Boxes.
|
||||
//! Flag if debug data should be drawn, such as Bounding Boxes.
|
||||
s32 DebugDataVisible;
|
||||
|
||||
//! is debug object?
|
||||
//! Is debug object?
|
||||
bool IsDebugObject;
|
||||
};
|
||||
|
||||
|
@ -1,4 +1,4 @@
|
||||
// Copyright (C) 2002-2007 Nikolaus Gebhardt
|
||||
// Copyright (C) 2002-2008 Nikolaus Gebhardt
|
||||
// This file is part of the "Irrlicht Engine".
|
||||
// For conditions of distribution and use, see copyright notice in irrlicht.h
|
||||
|
||||
@ -31,18 +31,19 @@ namespace scene
|
||||
{
|
||||
public:
|
||||
|
||||
//! destructor
|
||||
//! Destructor
|
||||
virtual ~ISceneNodeAnimator() {}
|
||||
|
||||
//! Animates a scene node.
|
||||
//! \param node: Node to animate.
|
||||
//! \param timeMs: Current time in milli seconds.
|
||||
/** \param node Node to animate.
|
||||
\param timeMs Current time in milli seconds. */
|
||||
virtual void animateNode(ISceneNode* node, u32 timeMs) = 0;
|
||||
|
||||
//! Creates a clone of this animator.
|
||||
/** Please note that you will have to drop (IReferenceCounted::drop())
|
||||
the returned pointer after calling this. */
|
||||
virtual ISceneNodeAnimator* createClone(ISceneNode* node, ISceneManager* newManager=0)
|
||||
//! Creates a clone of this animator.
|
||||
/** Please note that you will have to drop
|
||||
(IReferenceCounted::drop()) the returned pointer after calling
|
||||
this. */
|
||||
virtual ISceneNodeAnimator* createClone(ISceneNode* node, ISceneManager* newManager=0)
|
||||
{
|
||||
return 0; // to be implemented by derived classes.
|
||||
}
|
||||
|
@ -1,4 +1,4 @@
|
||||
// Copyright (C) 2002-2007 Nikolaus Gebhardt
|
||||
// Copyright (C) 2002-2008 Nikolaus Gebhardt
|
||||
// This file is part of the "Irrlicht Engine".
|
||||
// For conditions of distribution and use, see copyright notice in irrlicht.h
|
||||
|
||||
@ -13,77 +13,79 @@ namespace scene
|
||||
{
|
||||
|
||||
//! Special scene node animator for doing automatic collision detection and response.
|
||||
/** This scene node animator can be attached to any scene node modifying it in that
|
||||
way, that it cannot move through walls of the world, is influenced by gravity and
|
||||
acceleration. This animator is useful for example for first person shooter
|
||||
games. Attach it for example to a first person shooter camera, and the camera will
|
||||
behave as the player control in a first person shooter game: The camera stops and
|
||||
slides at walls, walks up stairs, falls down if there is no floor under it, and so on.
|
||||
*/
|
||||
/** This scene node animator can be attached to any scene node
|
||||
modifying it in that way, that it cannot move through walls of the
|
||||
world, is influenced by gravity and acceleration. This animator is
|
||||
useful for example for first person shooter games. Attach it for
|
||||
example to a first person shooter camera, and the camera will behave as
|
||||
the player control in a first person shooter game: The camera stops and
|
||||
slides at walls, walks up stairs, falls down if there is no floor under
|
||||
it, and so on. */
|
||||
class ISceneNodeAnimatorCollisionResponse : public ISceneNodeAnimator
|
||||
{
|
||||
public:
|
||||
|
||||
//! destructor
|
||||
//! Destructor
|
||||
virtual ~ISceneNodeAnimatorCollisionResponse() {}
|
||||
|
||||
//! Returns if the attached scene node is falling, which means that
|
||||
//! there is no blocking wall from the scene node in the direction of
|
||||
//! the gravity. The implementation of this method is very fast,
|
||||
//! no collision detection is done when invoking it.
|
||||
//! \return Returns true if the scene node is falling, false if not.
|
||||
//! Check if the attached scene node is falling.
|
||||
/** Falling means that there is no blocking wall from the scene
|
||||
node in the direction of the gravity. The implementation of
|
||||
this method is very fast, no collision detection is done when
|
||||
invoking it.
|
||||
\return True if the scene node is falling, false if not. */
|
||||
virtual bool isFalling() const = 0;
|
||||
|
||||
//! Sets the radius of the ellipsoid with which collision detection and
|
||||
//! 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
|
||||
//! it:
|
||||
//! \code
|
||||
//! core::aabbox<f32> box = yourSceneNode->getBoundingBox();
|
||||
//! core::vector3df radius = box.MaxEdge - box.getCenter();
|
||||
//! \endcode
|
||||
//! \param radius: New radius of the ellipsoid.
|
||||
//! Sets the radius of the ellipsoid for collision detection and response.
|
||||
/** If you have a scene node, and you are unsure about how big
|
||||
the radius should be, you could use the following code to
|
||||
determine it:
|
||||
\code
|
||||
core::aabbox<f32> box = yourSceneNode->getBoundingBox();
|
||||
core::vector3df radius = box.MaxEdge - box.getCenter();
|
||||
\endcode
|
||||
\param radius: New radius of the ellipsoid. */
|
||||
virtual void setEllipsoidRadius(const core::vector3df& radius) = 0;
|
||||
|
||||
//! Returns the radius of the ellipsoid with which the collision detection and
|
||||
//! response is done.
|
||||
//! \return Radius of the ellipsoid.
|
||||
//! Returns the radius of the ellipsoid for collision detection and response.
|
||||
/** \return Radius of the ellipsoid. */
|
||||
virtual core::vector3df getEllipsoidRadius() const = 0;
|
||||
|
||||
//! Sets the gravity of the environment. A good example value would be
|
||||
//! core::vector3df(0,-100.0f,0) for letting gravity affect all object to
|
||||
//! fall down. For bigger gravity, make increase the length of the vector.
|
||||
//! You can disable gravity by setting it to core::vector3df(0,0,0);
|
||||
//! \param gravity: New gravity vector.
|
||||
//! Sets the gravity of the environment.
|
||||
/** A good example value would be core::vector3df(0,-100.0f,0)
|
||||
for letting gravity affect all object to fall down. For bigger
|
||||
gravity, make increase the length of the vector. You can
|
||||
disable gravity by setting it to core::vector3df(0,0,0);
|
||||
\param gravity: New gravity vector. */
|
||||
virtual void setGravity(const core::vector3df& gravity) = 0;
|
||||
|
||||
//! Returns current vector of gravity.
|
||||
//! \return Returns the gravity vector.
|
||||
//! Get current vector of gravity.
|
||||
//! \return Gravity vector. */
|
||||
virtual core::vector3df getGravity() const = 0;
|
||||
|
||||
//! By default, the ellipsoid for collision detection is created around
|
||||
//! 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
|
||||
//! for the ellipsoid.
|
||||
//! \param translation: Translation of the ellipsoid relative
|
||||
//! to the position of the scene node.
|
||||
//! Set translation of the collision ellipsoid.
|
||||
/** By default, the ellipsoid for collision detection is
|
||||
created around 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 for the ellipsoid.
|
||||
\param translation: Translation of the ellipsoid relative
|
||||
to the position of the scene node. */
|
||||
virtual void setEllipsoidTranslation(const core::vector3df &translation) = 0;
|
||||
|
||||
//! Returns the translation of the ellipsoid for collision detection. See
|
||||
//! ISceneNodeAnimatorCollisionResponse::setEllipsoidTranslation() for
|
||||
//! more details.
|
||||
//! \return Returns the tranlation of the ellipsoid relative to the position
|
||||
//! of the scene node.
|
||||
//! Get the translation of the ellipsoid for collision detection.
|
||||
/** See
|
||||
ISceneNodeAnimatorCollisionResponse::setEllipsoidTranslation()
|
||||
for more details.
|
||||
\return Translation of the ellipsoid relative to the position
|
||||
of the scene node. */
|
||||
virtual core::vector3df getEllipsoidTranslation() const = 0;
|
||||
|
||||
//! Sets a triangle selector holding all triangles of the world with which
|
||||
//! the scene node may collide.
|
||||
//! \param newWorld: New triangle selector containing triangles to let the
|
||||
//! scene node collide with.
|
||||
//! Sets a triangle selector holding all triangles of the world with which the scene node may collide.
|
||||
/** \param newWorld: New triangle selector containing triangles
|
||||
to let the scene node collide with. */
|
||||
virtual void setWorld(ITriangleSelector* newWorld) = 0;
|
||||
|
||||
//! Returns the current triangle selector containing all triangles for
|
||||
//! collision detection.
|
||||
//! Get the current triangle selector containing all triangles for collision detection.
|
||||
virtual ITriangleSelector* getWorld() const = 0;
|
||||
};
|
||||
} // end namespace scene
|
||||
|
@ -1,4 +1,4 @@
|
||||
// Copyright (C) 2002-2007 Nikolaus Gebhardt
|
||||
// Copyright (C) 2002-2008 Nikolaus Gebhardt
|
||||
// This file is part of the "Irrlicht Engine".
|
||||
// For conditions of distribution and use, see copyright notice in irrlicht.h
|
||||
|
||||
@ -14,9 +14,9 @@ namespace scene
|
||||
{
|
||||
class ISceneNode;
|
||||
class ISceneNodeAnimator;
|
||||
|
||||
//! Interface making it possible to dynamicly create scene nodes animators
|
||||
/** To be able to add custom scene node animators to Irrlicht and to make it possible for the
|
||||
|
||||
//! Interface for dynamic creation of scene node animators
|
||||
/** To be able to add custom scene node animators to Irrlicht and to make it possible for the
|
||||
scene manager to save and load those external animators, simply implement this
|
||||
interface and register it in you scene manager via ISceneManager::registerSceneNodeAnimatorFactory.
|
||||
Note: When implementing your own scene node factory, don't call ISceneNodeManager::grab() to
|
||||
@ -52,13 +52,13 @@ namespace scene
|
||||
getCreatableSceneNodeTypeCount() */
|
||||
virtual ESCENE_NODE_ANIMATOR_TYPE getCreateableSceneNodeAnimatorType(u32 idx) const = 0;
|
||||
|
||||
//! returns type name of a createable scene node animator type
|
||||
//! returns type name of a createable scene node animator type
|
||||
/** \param idx: Index of scene node animator type in this factory. Must be a value between 0 and
|
||||
getCreatableSceneNodeAnimatorTypeCount() */
|
||||
virtual const c8* getCreateableSceneNodeAnimatorTypeName(u32 idx) const = 0;
|
||||
|
||||
//! returns type name of a createable scene node animator type
|
||||
/** \param type: Type of scene node animator.
|
||||
//! returns type name of a createable scene node animator type
|
||||
/** \param type: Type of scene node animator.
|
||||
\return: Returns name of scene node animator type if this factory can create the type, otherwise 0. */
|
||||
virtual const c8* getCreateableSceneNodeAnimatorTypeName(ESCENE_NODE_ANIMATOR_TYPE type) const = 0;
|
||||
};
|
||||
|
@ -1,4 +1,4 @@
|
||||
// Copyright (C) 2002-2007 Nikolaus Gebhardt
|
||||
// Copyright (C) 2002-2008 Nikolaus Gebhardt
|
||||
// This file is part of the "Irrlicht Engine".
|
||||
// For conditions of distribution and use, see copyright notice in irrlicht.h
|
||||
|
||||
@ -11,13 +11,12 @@
|
||||
namespace irr
|
||||
{
|
||||
|
||||
|
||||
namespace scene
|
||||
{
|
||||
class ISceneNode;
|
||||
|
||||
//! Interface making it possible to dynamicly create scene nodes
|
||||
/** To be able to add custom scene nodes to Irrlicht and to make it possible for the
|
||||
|
||||
//! Interface for dynamic creation of scene nodes
|
||||
/** To be able to add custom scene nodes to Irrlicht and to make it possible for the
|
||||
scene manager to save and load those external scene nodes, simply implement this
|
||||
interface and register it in you scene manager via ISceneManager::registerSceneNodeFactory.
|
||||
Note: When implementing your own scene node factory, don't call ISceneNodeManager::grab() to
|
||||
@ -56,8 +55,8 @@ namespace scene
|
||||
getCreatableSceneNodeTypeCount() */
|
||||
virtual const c8* getCreateableSceneNodeTypeName(u32 idx) const = 0;
|
||||
|
||||
//! returns type name of a createable scene node type
|
||||
/** \param type: Type of scene node.
|
||||
//! returns type name of a createable scene node type
|
||||
/** \param type: Type of scene node.
|
||||
\return: Returns name of scene node type if this factory can create the type, otherwise 0. */
|
||||
virtual const c8* getCreateableSceneNodeTypeName(ESCENE_NODE_TYPE type) const = 0;
|
||||
};
|
||||
|
@ -1,4 +1,4 @@
|
||||
// Copyright (C) 2002-2007 Nikolaus Gebhardt
|
||||
// Copyright (C) 2002-2008 Nikolaus Gebhardt
|
||||
// This file is part of the "Irrlicht Engine".
|
||||
// For conditions of distribution and use, see copyright notice in irrlicht.h
|
||||
|
||||
@ -18,7 +18,7 @@ namespace scene
|
||||
class ISceneNode;
|
||||
|
||||
//! Interface to read and write user data to and from .irr files.
|
||||
/** This interface is to be imlpemented by the user, to make it possible to read
|
||||
/** This interface is to be imlpemented by the user, to make it possible to read
|
||||
and write user data when reading or writing .irr files via ISceneManager.
|
||||
To be used with ISceneManager::loadScene() and ISceneManager::saveScene() */
|
||||
class ISceneUserDataSerializer
|
||||
@ -34,7 +34,7 @@ public:
|
||||
|
||||
//! Called when the scene manager is writing a scene node to an xml file for example.
|
||||
/** Implement this method and return a list of attributes containing the user data
|
||||
you want to be saved together with the scene node. Return 0 if no user data should
|
||||
you want to be saved together with the scene node. Return 0 if no user data should
|
||||
be added. Please note that the scene manager will call drop() to the returned pointer
|
||||
after it no longer needs it, so if you didn't create a new object for the return value
|
||||
and returning a longer existing IAttributes object, simply call grab() before returning it. */
|
||||
|
@ -1,4 +1,4 @@
|
||||
// Copyright (C) 2002-2007 Nikolaus Gebhardt
|
||||
// Copyright (C) 2002-2008 Nikolaus Gebhardt
|
||||
// This file is part of the "Irrlicht Engine".
|
||||
// For conditions of distribution and use, see copyright notice in irrlicht.h
|
||||
|
||||
@ -14,9 +14,9 @@ namespace video
|
||||
class IMaterialRendererServices;
|
||||
|
||||
//! Interface making it possible to set constants for gpu programs every frame.
|
||||
/** Implement this interface in an own class and pass a pointer to it to one of the methods in
|
||||
IGPUProgrammingServices when creating a shader. The OnSetConstants method will be called
|
||||
every frame now. */
|
||||
/** Implement this interface in an own class and pass a pointer to it to one of
|
||||
the methods in IGPUProgrammingServices when creating a shader. The
|
||||
OnSetConstants method will be called every frame now. */
|
||||
class IShaderConstantSetCallBack : public virtual IReferenceCounted
|
||||
{
|
||||
public:
|
||||
@ -48,34 +48,34 @@ public:
|
||||
|
||||
//! Called by the engine when the vertex and/or pixel shader constants for an material renderer should be set.
|
||||
/**
|
||||
Implement the IShaderConstantSetCallBack in an own class and implement your own
|
||||
OnSetConstants method using the given IMaterialRendererServices interface.
|
||||
Pass a pointer to this class to one of the methods in IGPUProgrammingServices
|
||||
when creating a shader. The OnSetConstants method will now be called every time
|
||||
before geometry is being drawn using your shader material. A sample implementation
|
||||
would look like this:
|
||||
\code
|
||||
virtual void OnSetConstants(video::IMaterialRendererServices* services, s32 userData)
|
||||
{
|
||||
video::IVideoDriver* driver = services->getVideoDriver();
|
||||
Implement the IShaderConstantSetCallBack in an own class and implement your own
|
||||
OnSetConstants method using the given IMaterialRendererServices interface.
|
||||
Pass a pointer to this class to one of the methods in IGPUProgrammingServices
|
||||
when creating a shader. The OnSetConstants method will now be called every time
|
||||
before geometry is being drawn using your shader material. A sample implementation
|
||||
would look like this:
|
||||
\code
|
||||
virtual void OnSetConstants(video::IMaterialRendererServices* services, s32 userData)
|
||||
{
|
||||
video::IVideoDriver* driver = services->getVideoDriver();
|
||||
|
||||
// set clip matrix at register 4
|
||||
core::matrix4 worldViewProj(driver->getTransform(video::ETS_PROJECTION));
|
||||
worldViewProj *= driver->getTransform(video::ETS_VIEW);
|
||||
worldViewProj *= driver->getTransform(video::ETS_WORLD);
|
||||
services->setVertexShaderConstant(&worldViewProj.M[0], 4, 4);
|
||||
// for high level shading languages, this would be another solution:
|
||||
//services->setVertexShaderConstant("mWorldViewProj", worldViewProj.M, 16);
|
||||
// set clip matrix at register 4
|
||||
core::matrix4 worldViewProj(driver->getTransform(video::ETS_PROJECTION));
|
||||
worldViewProj *= driver->getTransform(video::ETS_VIEW);
|
||||
worldViewProj *= driver->getTransform(video::ETS_WORLD);
|
||||
services->setVertexShaderConstant(&worldViewProj.M[0], 4, 4);
|
||||
// for high level shading languages, this would be another solution:
|
||||
//services->setVertexShaderConstant("mWorldViewProj", worldViewProj.M, 16);
|
||||
|
||||
// set some light color at register 9
|
||||
video::SColorf col(0.0f,1.0f,1.0f,0.0f);
|
||||
services->setVertexShaderConstant(reinterpret_cast<const f32*>(&col), 9, 1);
|
||||
// for high level shading languages, this would be another solution:
|
||||
//services->setVertexShaderConstant("myColor", reinterpret_cast<f32*>(&col), 4);
|
||||
}
|
||||
\endcode
|
||||
\param services: Pointer to an interface providing methods to set the constants for the shader.
|
||||
\param userData: Userdata int which can be specified when creating the shader.
|
||||
// set some light color at register 9
|
||||
video::SColorf col(0.0f,1.0f,1.0f,0.0f);
|
||||
services->setVertexShaderConstant(reinterpret_cast<const f32*>(&col), 9, 1);
|
||||
// for high level shading languages, this would be another solution:
|
||||
//services->setVertexShaderConstant("myColor", reinterpret_cast<f32*>(&col), 4);
|
||||
}
|
||||
\endcode
|
||||
\param services: Pointer to an interface providing methods to set the constants for the shader.
|
||||
\param userData: Userdata int which can be specified when creating the shader.
|
||||
*/
|
||||
virtual void OnSetConstants(IMaterialRendererServices* services, s32 userData) = 0;
|
||||
};
|
||||
|
@ -1,4 +1,4 @@
|
||||
// Copyright (C) 2002-2007 Nikolaus Gebhardt
|
||||
// Copyright (C) 2002-2008 Nikolaus Gebhardt
|
||||
// This file is part of the "Irrlicht Engine".
|
||||
// For conditions of distribution and use, see copyright notice in irrlicht.h
|
||||
|
||||
|
@ -1,4 +1,4 @@
|
||||
// Copyright (C) 2002-2007 Nikolaus Gebhardt
|
||||
// Copyright (C) 2002-2008 Nikolaus Gebhardt
|
||||
// This file is part of the "Irrlicht Engine".
|
||||
// For conditions of distribution and use, see copyright notice in irrlicht.h
|
||||
|
||||
@ -96,19 +96,21 @@ namespace scene
|
||||
};
|
||||
|
||||
|
||||
//! Animation keyframe which describes a new position, scale or rotation
|
||||
//! Animation keyframe which describes a new position
|
||||
struct SPositionKey
|
||||
{
|
||||
f32 frame;
|
||||
core::vector3df position;
|
||||
};
|
||||
|
||||
//! Animation keyframe which describes a new scale
|
||||
struct SScaleKey
|
||||
{
|
||||
f32 frame;
|
||||
core::vector3df scale;
|
||||
};
|
||||
|
||||
//! Animation keyframe which describes a new rotation
|
||||
struct SRotationKey
|
||||
{
|
||||
f32 frame;
|
||||
@ -116,10 +118,10 @@ namespace scene
|
||||
};
|
||||
|
||||
//! Joints
|
||||
struct SJoint
|
||||
struct SJoint
|
||||
{
|
||||
SJoint() : UseAnimationFrom(0), LocalAnimatedMatrix_Animated(false), GlobalSkinningSpace(false),
|
||||
positionHint(-1),scaleHint(-1),rotationHint(-1)
|
||||
positionHint(-1),scaleHint(-1),rotationHint(-1)
|
||||
{
|
||||
}
|
||||
|
||||
|
@ -1,11 +1,11 @@
|
||||
// Copyright (C) 2002-2007 Nikolaus Gebhardt
|
||||
// Copyright (C) 2002-2008 Nikolaus Gebhardt
|
||||
// This file is part of the "Irrlicht Engine".
|
||||
// For conditions of distribution and use, see copyright notice in irrlicht.h
|
||||
|
||||
// The code for the TerrainSceneNode is based on the terrain renderer by Soconne and
|
||||
// the GeoMipMapSceneNode developed by Spintz. They made their code available for Irrlicht
|
||||
// and allowed it to be distributed under this licence. I only modified some parts.
|
||||
// A lot of thanks go to them.
|
||||
// The code for the TerrainSceneNode is based on the terrain renderer by
|
||||
// Soconne and the GeoMipMapSceneNode developed by Spintz. They made their
|
||||
// code available for Irrlicht and allowed it to be distributed under this
|
||||
// licence. I only modified some parts. A lot of thanks go to them.
|
||||
|
||||
#ifndef __I_TERRAIN_SCENE_NODE_H__
|
||||
#define __I_TERRAIN_SCENE_NODE_H__
|
||||
@ -24,48 +24,52 @@ namespace scene
|
||||
//! A scene node for displaying terrain using the geo mip map algorithm.
|
||||
/** The code for the TerrainSceneNode is based on the Terrain renderer by Soconne and
|
||||
* the GeoMipMapSceneNode developed by Spintz. They made their code available for Irrlicht
|
||||
* and allowed it to be distributed under this licence. I only modified some parts.
|
||||
* and allowed it to be distributed under this licence. I only modified some parts.
|
||||
* A lot of thanks go to them.
|
||||
*
|
||||
* This scene node is capable of very quickly loading
|
||||
* terrains and updating the indices at runtime to enable viewing very large terrains. It uses a
|
||||
* terrains and updating the indices at runtime to enable viewing very large terrains. It uses a
|
||||
* CLOD ( Continuous Level of Detail ) algorithm which updates the indices for each patch based on
|
||||
* a LOD ( Level of Detail ) which is determined based on a patch's distance from the camera.
|
||||
*
|
||||
* The Patch Size of the terrain must always be a size of ( 2^N+1, i.e. 8+1(9), 16+1(17), etc. ).
|
||||
* The MaxLOD available is directly dependent on the patch size 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 up by 1
|
||||
* The MaxLOD available is directly dependent on the patch size 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 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 taken is 4, LOD 3 - 8, etc. The step can be no larger than the size of the patch,
|
||||
* LOD 2, the step 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 of 17, is asking the algoritm to generate indices every
|
||||
* 2^8 ( 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, with a MaxLOD of 5, you'll have LOD 0 ( full detail ), LOD 1 ( every
|
||||
* 2^8 ( 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, 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 8 vertices ) and LOD 4 ( every 16 vertices ).
|
||||
**/
|
||||
class ITerrainSceneNode : public ISceneNode
|
||||
{
|
||||
public:
|
||||
|
||||
//! constructor
|
||||
//! Constructor
|
||||
ITerrainSceneNode(ISceneNode* parent, ISceneManager* mgr, s32 id,
|
||||
const core::vector3df& position = core::vector3df(0.0f, 0.0f, 0.0f),
|
||||
const core::vector3df& rotation = core::vector3df(0.0f, 0.0f, 0.0f),
|
||||
const core::vector3df& scale = core::vector3df(1.0f, 1.0f, 1.0f) )
|
||||
: ISceneNode (parent, mgr, id, position, rotation, scale) {}
|
||||
|
||||
//! destructor
|
||||
//! Destructor
|
||||
virtual ~ITerrainSceneNode() {}
|
||||
|
||||
//! \return: Returns the bounding box of the entire terrain.
|
||||
virtual const core::aabbox3d<f32>& getBoundingBox ( ) const = 0;
|
||||
//! Get the bounding box of the terrain.
|
||||
/** \return The bounding box of the entire terrain. */
|
||||
virtual const core::aabbox3d<f32>& getBoundingBox() const = 0;
|
||||
|
||||
//! Returns the bounding box of a patch
|
||||
virtual const core::aabbox3d<f32>& getBoundingBox (s32 patchX, s32 patchZ) const = 0;
|
||||
//! Get the bounding box of a patch
|
||||
/** \return The bounding box of the chosen patch. */
|
||||
virtual const core::aabbox3d<f32>& getBoundingBox(s32 patchX, s32 patchZ) const = 0;
|
||||
|
||||
//! Returns the number of indices currently in the meshbuffer for this scene node.
|
||||
//! Get the number of indices currently in the meshbuffer
|
||||
/** \return The index count. */
|
||||
virtual u32 getIndexCount() const = 0;
|
||||
|
||||
//! Returns pointer to the mesh
|
||||
//! Get pointer to the mesh
|
||||
/** \return Pointer to the mesh. */
|
||||
virtual IMesh* getMesh() = 0;
|
||||
|
||||
|
||||
@ -74,46 +78,48 @@ namespace scene
|
||||
|
||||
|
||||
//! Gets the meshbuffer data based on a specified level of detail.
|
||||
/** \param mb: A reference to an SMeshBuffer object
|
||||
\param LOD: the level of detail you want the indices from. */
|
||||
/** \param mb A reference to an SMeshBuffer object
|
||||
\param LOD The level of detail you want the indices from. */
|
||||
virtual void getMeshBufferForLOD(SMeshBufferLightMap& mb, s32 LOD) const = 0;
|
||||
|
||||
//! Gets the indices for a specified patch at a specified Level of Detail.
|
||||
/** \param indices: A reference to an array of u32 indices.
|
||||
\param patchX: Patch x coordinate.
|
||||
\param patchZ: Patch z coordinate.
|
||||
\param LOD: The level of detail to get for that patch. If -1, then get
|
||||
the CurrentLOD. If the CurrentLOD is set to -1, meaning it's not shown,
|
||||
then it will retrieve the triangles at the highest LOD ( 0 ).
|
||||
\return: Number if indices put into the buffer. */
|
||||
/** \param indices A reference to an array of u32 indices.
|
||||
\param patchX Patch x coordinate.
|
||||
\param patchZ Patch z coordinate.
|
||||
\param LOD The level of detail to get for that patch. If -1,
|
||||
then get the CurrentLOD. If the CurrentLOD is set to -1,
|
||||
meaning it's not shown, then it will retrieve the triangles at
|
||||
the highest LOD ( 0 ).
|
||||
\return Number of indices put into the buffer. */
|
||||
virtual s32 getIndicesForPatch(core::array<u32>& indices,
|
||||
s32 patchX, s32 patchZ, s32 LOD = 0 ) = 0;
|
||||
|
||||
//! Populates an array with the CurrentLOD of each patch.
|
||||
/** \param LODs: A reference to a core::array<s32> to hold the values
|
||||
\return: Returns the number of elements in the array */
|
||||
/** \param LODs A reference to a core::array<s32> to hold the
|
||||
values
|
||||
\return Number of elements in the array */
|
||||
virtual s32 getCurrentLODOfPatches(core::array<s32>& LODs) const = 0;
|
||||
|
||||
//! Manually sets the LOD of a patch
|
||||
/** \param patchX: Patch x coordinate.
|
||||
\param patchZ: Patch z coordinate.
|
||||
\param LOD: The level of detail to set the patch to. */
|
||||
/** \param patchX Patch x coordinate.
|
||||
\param patchZ Patch z coordinate.
|
||||
\param LOD The level of detail to set the patch to. */
|
||||
virtual void setLODOfPatch( s32 patchX, s32 patchZ, s32 LOD ) = 0;
|
||||
|
||||
//! Returns center of terrain.
|
||||
//! Get center of terrain.
|
||||
virtual const core::vector3df& getTerrainCenter() const = 0;
|
||||
|
||||
//! Returns height of a point of the terrain.
|
||||
//! Get height of a point of the terrain.
|
||||
virtual f32 getHeight( f32 x, f32 y ) const = 0;
|
||||
|
||||
//! Sets the movement camera threshold.
|
||||
/** It is used to determine when to recalculate
|
||||
indices for the scene node. The default value is 10.0f. */
|
||||
indices for the scene node. The default value is 10.0f. */
|
||||
virtual void setCameraMovementDelta(f32 delta) = 0;
|
||||
|
||||
//! Sets the rotation camera threshold.
|
||||
/** It is used to determine when to recalculate
|
||||
indices for the scene node. The default value is 1.0f. */
|
||||
indices for the scene node. The default value is 1.0f. */
|
||||
virtual void setCameraRotationDelta(f32 delta) = 0;
|
||||
|
||||
//! Sets whether or not the node should dynamically update its associated selector when the geomipmap data changes.
|
||||
@ -121,20 +127,23 @@ namespace scene
|
||||
virtual void setDynamicSelectorUpdate(bool bVal) = 0;
|
||||
|
||||
//! Override the default generation of distance thresholds.
|
||||
/** For determining the LOD a patch
|
||||
is rendered at. If any LOD is overridden, then the scene node will no longer apply
|
||||
scaling factors to these values. If you override these distances, and then apply
|
||||
a scale to the scene node, it is your responsibility to update the new distances to
|
||||
work best with your new terrain size. */
|
||||
/** For determining the LOD a patch is rendered at. If any LOD
|
||||
is overridden, then the scene node will no longer apply scaling
|
||||
factors to these values. If you override these distances, and
|
||||
then apply a scale to the scene node, it is your responsibility
|
||||
to update the new distances to work best with your new terrain
|
||||
size. */
|
||||
virtual bool overrideLODDistance(s32 LOD, f64 newDistance) = 0;
|
||||
|
||||
//! Scales the base texture, similar to makePlanarTextureMapping.
|
||||
/** \param scale: The scaling amount. Values above 1.0 increase the number of time the
|
||||
texture is drawn on the terrain. Values below 0 will decrease the number of times the
|
||||
texture is drawn on the terrain. Using negative values will flip the texture, as
|
||||
well as still scaling it.
|
||||
\param scale2: If set to 0 (default value), this will set the second texture coordinate set
|
||||
to the same values as in the first set. If this is another value than zero, it will scale
|
||||
/** \param scale The scaling amount. Values above 1.0
|
||||
increase the number of time the texture is drawn on the
|
||||
terrain. Values below 0 will decrease the number of times the
|
||||
texture is drawn on the terrain. Using negative values will
|
||||
flip the texture, as well as still scaling it.
|
||||
\param scale2 If set to 0 (default value), this will set the
|
||||
second texture coordinate set to the same values as in the
|
||||
first set. If this is another value than zero, it will scale
|
||||
the second texture coordinate set by this value. */
|
||||
virtual void scaleTexture(f32 scale = 1.0f, f32 scale2 = 0.0f) = 0;
|
||||
};
|
||||
@ -143,4 +152,5 @@ namespace scene
|
||||
} // end namespace irr
|
||||
|
||||
|
||||
#endif // __IGEOMIPMAPSCENENODE_H__
|
||||
#endif // __I_TERRAIN_SCENE_NODE_H__
|
||||
|
||||
|
@ -1,4 +1,4 @@
|
||||
// Copyright (C) 2002-2007 Nikolaus Gebhardt
|
||||
// Copyright (C) 2002-2008 Nikolaus Gebhardt
|
||||
// This file is part of the "Irrlicht Engine".
|
||||
// For conditions of distribution and use, see copyright notice in irrlicht.h
|
||||
|
||||
@ -18,7 +18,7 @@ class ITextSceneNode : virtual public ISceneNode
|
||||
public:
|
||||
|
||||
//! constructor
|
||||
ITextSceneNode(ISceneNode* parent, ISceneManager* mgr, s32 id,
|
||||
ITextSceneNode(ISceneNode* parent, ISceneManager* mgr, s32 id,
|
||||
const core::vector3df& position = core::vector3df(0,0,0))
|
||||
: ISceneNode(parent, mgr, id, position) {}
|
||||
|
||||
|
@ -1,4 +1,4 @@
|
||||
// Copyright (C) 2002-2007 Nikolaus Gebhardt
|
||||
// Copyright (C) 2002-2008 Nikolaus Gebhardt
|
||||
// This file is part of the "Irrlicht Engine".
|
||||
// For conditions of distribution and use, see copyright notice in irrlicht.h
|
||||
|
||||
@ -25,7 +25,7 @@ enum E_TEXTURE_CREATION_FLAG
|
||||
//! Forces the driver to create 16 bit textures always, independent of
|
||||
//! which format the file on disk has. When choosing this you may loose
|
||||
//! some color detail, but gain much speed and memory. 16 bit textures
|
||||
//! can be transferred twice as fast as 32 bit textures and only use
|
||||
//! can be transferred twice as fast as 32 bit textures and only use
|
||||
//! half of the space in memory.
|
||||
//! When using this flag, it does not make sense to use the flags
|
||||
//! ETCF_ALWAYS_32_BIT, ETCF_OPTIMIZED_FOR_QUALITY,
|
||||
@ -33,7 +33,7 @@ enum E_TEXTURE_CREATION_FLAG
|
||||
ETCF_ALWAYS_16_BIT = 0x00000001,
|
||||
|
||||
//! Forces the driver to create 32 bit textures always, independent of
|
||||
//! which format the file on disk has. Please note that some drivers
|
||||
//! which format the file on disk has. Please note that some drivers
|
||||
//! (like the software device) will ignore this, because they are only
|
||||
//! able to create and use 16 bit textures.
|
||||
//! When using this flag, it does not make sense to use the flags
|
||||
@ -45,9 +45,9 @@ enum E_TEXTURE_CREATION_FLAG
|
||||
//! tries to make the textures look as good as possible.
|
||||
//! Usually it simply chooses the format in which the texture was stored on disk.
|
||||
//! When using this flag, it does not make sense to use the flags
|
||||
//! ETCF_ALWAYS_16_BIT, ETCF_ALWAYS_32_BIT,
|
||||
//! ETCF_ALWAYS_16_BIT, ETCF_ALWAYS_32_BIT,
|
||||
//! or ETCF_OPTIMIZED_FOR_SPEED at the same time.
|
||||
ETCF_OPTIMIZED_FOR_QUALITY = 0x00000004,
|
||||
ETCF_OPTIMIZED_FOR_QUALITY = 0x00000004,
|
||||
|
||||
//! Lets the driver decide in which format the textures are created and
|
||||
//! tries to create them maximizing render speed.
|
||||
@ -62,7 +62,7 @@ enum E_TEXTURE_CREATION_FLAG
|
||||
//! Discard any alpha layer and use non-alpha color format.
|
||||
ETCF_NO_ALPHA_CHANNEL = 0x00000020,
|
||||
|
||||
//! This flag is never used, it only forces the compiler to
|
||||
//! This flag is never used, it only forces the compiler to
|
||||
//! compile these enumeration values to 32 bit.
|
||||
ETCF_FORCE_32_BIT_DO_NOT_USE = 0x7fffffff
|
||||
};
|
||||
@ -107,8 +107,8 @@ public:
|
||||
//! destructor
|
||||
virtual ~ITexture() {}
|
||||
|
||||
//! Lock function.
|
||||
/** Locks the Texture and returns a pointer to access the
|
||||
//! Lock function.
|
||||
/** Locks the Texture and returns a pointer to access the
|
||||
pixels. After lock() has been called and all operations on the pixels
|
||||
are done, you must call unlock().
|
||||
\return Returns a pointer to the pixel data. The format of the pixel can
|
||||
@ -125,7 +125,7 @@ public:
|
||||
of the texture file it was loaded from was not a power of two. This returns
|
||||
the size of the texture, it had before it was scaled. Can be useful
|
||||
when drawing 2d images on the screen, which should have the exact size
|
||||
of the original texture. Use ITexture::getSize() if you want to know
|
||||
of the original texture. Use ITexture::getSize() if you want to know
|
||||
the real size it has now stored in the system.
|
||||
\return Returns the original size of the texture. */
|
||||
virtual const core::dimension2d<s32>& getOriginalSize() const = 0;
|
||||
@ -134,7 +134,7 @@ public:
|
||||
/** \return Returns the size of the texture. */
|
||||
virtual const core::dimension2d<s32>& getSize() const = 0;
|
||||
|
||||
//! Returns driver type of texture.
|
||||
//! Returns driver type of texture.
|
||||
/** This is the driver, which created the texture.
|
||||
This method is used internally by the video devices, to check, if they may
|
||||
use a texture because textures may be incompatible between different
|
||||
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
x
Reference in New Issue
Block a user