mirror of
https://github.com/minetest/irrlicht.git
synced 2025-06-28 06:20:21 +02:00
Remove more unused code (#87)
This commit is contained in:
@ -1,133 +0,0 @@
|
||||
// Copyright (C) 2008-2012 Nikolaus Gebhardt
|
||||
// This file is part of the "Irrlicht Engine".
|
||||
// For conditions of distribution and use, see copyright notice in irrlicht.h
|
||||
|
||||
#ifndef __C_DYNAMIC_MESHBUFFER_H_INCLUDED__
|
||||
#define __C_DYNAMIC_MESHBUFFER_H_INCLUDED__
|
||||
|
||||
#include "IDynamicMeshBuffer.h"
|
||||
|
||||
#include "CVertexBuffer.h"
|
||||
#include "CIndexBuffer.h"
|
||||
|
||||
namespace irr
|
||||
{
|
||||
namespace scene
|
||||
{
|
||||
|
||||
class CDynamicMeshBuffer: public IDynamicMeshBuffer
|
||||
{
|
||||
public:
|
||||
//! constructor
|
||||
CDynamicMeshBuffer(video::E_VERTEX_TYPE vertexType, video::E_INDEX_TYPE indexType)
|
||||
: PrimitiveType(EPT_TRIANGLES)
|
||||
{
|
||||
VertexBuffer=new CVertexBuffer(vertexType);
|
||||
IndexBuffer=new CIndexBuffer(indexType);
|
||||
}
|
||||
|
||||
//! destructor
|
||||
virtual ~CDynamicMeshBuffer()
|
||||
{
|
||||
if (VertexBuffer)
|
||||
VertexBuffer->drop();
|
||||
if (IndexBuffer)
|
||||
IndexBuffer->drop();
|
||||
}
|
||||
|
||||
virtual IVertexBuffer& getVertexBuffer() const _IRR_OVERRIDE_
|
||||
{
|
||||
return *VertexBuffer;
|
||||
}
|
||||
|
||||
virtual IIndexBuffer& getIndexBuffer() const _IRR_OVERRIDE_
|
||||
{
|
||||
return *IndexBuffer;
|
||||
}
|
||||
|
||||
virtual void setVertexBuffer(IVertexBuffer *newVertexBuffer) _IRR_OVERRIDE_
|
||||
{
|
||||
if (newVertexBuffer)
|
||||
newVertexBuffer->grab();
|
||||
if (VertexBuffer)
|
||||
VertexBuffer->drop();
|
||||
|
||||
VertexBuffer=newVertexBuffer;
|
||||
}
|
||||
|
||||
virtual void setIndexBuffer(IIndexBuffer *newIndexBuffer) _IRR_OVERRIDE_
|
||||
{
|
||||
if (newIndexBuffer)
|
||||
newIndexBuffer->grab();
|
||||
if (IndexBuffer)
|
||||
IndexBuffer->drop();
|
||||
|
||||
IndexBuffer=newIndexBuffer;
|
||||
}
|
||||
|
||||
//! Get Material of this buffer.
|
||||
virtual const video::SMaterial& getMaterial() const _IRR_OVERRIDE_
|
||||
{
|
||||
return Material;
|
||||
}
|
||||
|
||||
//! Get Material of this buffer.
|
||||
virtual video::SMaterial& getMaterial() _IRR_OVERRIDE_
|
||||
{
|
||||
return Material;
|
||||
}
|
||||
|
||||
//! Get bounding box
|
||||
virtual const core::aabbox3d<f32>& getBoundingBox() const _IRR_OVERRIDE_
|
||||
{
|
||||
return BoundingBox;
|
||||
}
|
||||
|
||||
//! Set bounding box
|
||||
virtual void setBoundingBox( const core::aabbox3df& box) _IRR_OVERRIDE_
|
||||
{
|
||||
BoundingBox = box;
|
||||
}
|
||||
|
||||
//! Recalculate bounding box
|
||||
virtual void recalculateBoundingBox() _IRR_OVERRIDE_
|
||||
{
|
||||
if (!getVertexBuffer().size())
|
||||
BoundingBox.reset(0,0,0);
|
||||
else
|
||||
{
|
||||
BoundingBox.reset(getVertexBuffer()[0].Pos);
|
||||
for (u32 i=1; i<getVertexBuffer().size(); ++i)
|
||||
BoundingBox.addInternalPoint(getVertexBuffer()[i].Pos);
|
||||
}
|
||||
}
|
||||
|
||||
//! Describe what kind of primitive geometry is used by the meshbuffer
|
||||
virtual void setPrimitiveType(E_PRIMITIVE_TYPE type) _IRR_OVERRIDE_
|
||||
{
|
||||
PrimitiveType = type;
|
||||
}
|
||||
|
||||
//! Get the kind of primitive geometry which is used by the meshbuffer
|
||||
virtual E_PRIMITIVE_TYPE getPrimitiveType() const _IRR_OVERRIDE_
|
||||
{
|
||||
return PrimitiveType;
|
||||
}
|
||||
|
||||
video::SMaterial Material;
|
||||
core::aabbox3d<f32> BoundingBox;
|
||||
//! Primitive type used for rendering (triangles, lines, ...)
|
||||
E_PRIMITIVE_TYPE PrimitiveType;
|
||||
private:
|
||||
CDynamicMeshBuffer(const CDynamicMeshBuffer&); // = delete in c++11, prevent copying
|
||||
|
||||
IVertexBuffer *VertexBuffer;
|
||||
IIndexBuffer *IndexBuffer;
|
||||
};
|
||||
|
||||
|
||||
} // end namespace scene
|
||||
} // end namespace irr
|
||||
|
||||
#endif
|
||||
|
@ -121,71 +121,6 @@ namespace video
|
||||
texture which will not reflect can be set as second texture.*/
|
||||
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 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 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 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.
|
||||
/** 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 like EMT_PARALLAX_MAP_SOLID, but transparent.
|
||||
/** Using EMT_TRANSPARENT_ADD_COLOR as base material. */
|
||||
EMT_PARALLAX_MAP_TRANSPARENT_ADD_COLOR,
|
||||
|
||||
//! A material like EMT_PARALLAX_MAP_SOLID, but 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 first texture. Generic blending method.
|
||||
The blend function is set to SMaterial::MaterialTypeParam with
|
||||
@ -216,12 +151,6 @@ namespace video
|
||||
"trans_alphach_ref",
|
||||
"trans_vertex_alpha",
|
||||
"trans_reflection_2layer",
|
||||
"normalmap_solid",
|
||||
"normalmap_trans_add",
|
||||
"normalmap_trans_vertexalpha",
|
||||
"parallaxmap_solid",
|
||||
"parallaxmap_trans_add",
|
||||
"parallaxmap_trans_vertexalpha",
|
||||
"onetexture_blend",
|
||||
0
|
||||
};
|
||||
|
@ -1,36 +0,0 @@
|
||||
// Copyright (C) 2002-2012 Nikolaus Gebhardt
|
||||
// This file is part of the "Irrlicht Engine".
|
||||
// For conditions of distribution and use, see copyright notice in irrlicht.h
|
||||
|
||||
#ifndef __E_TERRAIN_ELEMENTS_H__
|
||||
#define __E_TERRAIN_ELEMENTS_H__
|
||||
|
||||
namespace irr
|
||||
{
|
||||
namespace scene
|
||||
{
|
||||
|
||||
//! enumeration for patch sizes specifying the size of patches in the TerrainSceneNode
|
||||
enum E_TERRAIN_PATCH_SIZE
|
||||
{
|
||||
//! patch size of 9, at most, use 4 levels of detail with this patch size.
|
||||
ETPS_9 = 9,
|
||||
|
||||
//! patch size of 17, at most, use 5 levels of detail with this patch size.
|
||||
ETPS_17 = 17,
|
||||
|
||||
//! patch size of 33, at most, use 6 levels of detail with this patch size.
|
||||
ETPS_33 = 33,
|
||||
|
||||
//! patch size of 65, at most, use 7 levels of detail with this patch size.
|
||||
ETPS_65 = 65,
|
||||
|
||||
//! patch size of 129, at most, use 8 levels of detail with this patch size.
|
||||
ETPS_129 = 129
|
||||
};
|
||||
|
||||
} // end namespace scene
|
||||
} // end namespace irr
|
||||
|
||||
#endif
|
||||
|
@ -1,211 +0,0 @@
|
||||
// Copyright (C) 2008-2012 Nikolaus Gebhardt
|
||||
// This file is part of the "Irrlicht Engine".
|
||||
// For conditions of distribution and use, see copyright notice in irrlicht.h
|
||||
|
||||
#ifndef __I_DYNAMIC_MESH_BUFFER_H_INCLUDED__
|
||||
#define __I_DYNAMIC_MESH_BUFFER_H_INCLUDED__
|
||||
|
||||
#include "IMeshBuffer.h"
|
||||
#include "IVertexBuffer.h"
|
||||
#include "IIndexBuffer.h"
|
||||
|
||||
namespace irr
|
||||
{
|
||||
namespace scene
|
||||
{
|
||||
|
||||
/** a dynamic meshBuffer */
|
||||
class IDynamicMeshBuffer : public IMeshBuffer
|
||||
{
|
||||
public:
|
||||
virtual IVertexBuffer &getVertexBuffer() const =0;
|
||||
virtual IIndexBuffer &getIndexBuffer() const =0;
|
||||
|
||||
virtual void setVertexBuffer(IVertexBuffer *vertexBuffer) =0;
|
||||
virtual void setIndexBuffer(IIndexBuffer *indexBuffer) =0;
|
||||
|
||||
//! Get the material of this meshbuffer
|
||||
/** \return Material of this buffer. */
|
||||
virtual video::SMaterial& getMaterial() _IRR_OVERRIDE_ =0;
|
||||
|
||||
//! Get the material of this meshbuffer
|
||||
/** \return Material of this buffer. */
|
||||
virtual const video::SMaterial& getMaterial() const _IRR_OVERRIDE_ =0;
|
||||
|
||||
//! Get the axis aligned bounding box of this meshbuffer.
|
||||
/** \return Axis aligned bounding box of this buffer. */
|
||||
virtual const core::aabbox3df& getBoundingBox() const _IRR_OVERRIDE_ =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) _IRR_OVERRIDE_ =0;
|
||||
|
||||
//! Recalculates the bounding box. Should be called if the mesh changed.
|
||||
virtual void recalculateBoundingBox() _IRR_OVERRIDE_ =0;
|
||||
|
||||
//! 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) _IRR_OVERRIDE_
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
//! 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) _IRR_OVERRIDE_
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
// ------------------- To be removed? ------------------- //
|
||||
|
||||
//! get the current hardware mapping hint
|
||||
virtual E_HARDWARE_MAPPING getHardwareMappingHint_Vertex() const _IRR_OVERRIDE_
|
||||
{
|
||||
return getVertexBuffer().getHardwareMappingHint();
|
||||
}
|
||||
|
||||
//! get the current hardware mapping hint
|
||||
virtual E_HARDWARE_MAPPING getHardwareMappingHint_Index() const _IRR_OVERRIDE_
|
||||
{
|
||||
return getIndexBuffer().getHardwareMappingHint();
|
||||
}
|
||||
|
||||
//! set the hardware mapping hint, for driver
|
||||
virtual void setHardwareMappingHint( E_HARDWARE_MAPPING NewMappingHint, E_BUFFER_TYPE Buffer=EBT_VERTEX_AND_INDEX ) _IRR_OVERRIDE_
|
||||
{
|
||||
if (Buffer==EBT_VERTEX_AND_INDEX || Buffer==EBT_VERTEX)
|
||||
getVertexBuffer().setHardwareMappingHint(NewMappingHint);
|
||||
if (Buffer==EBT_VERTEX_AND_INDEX || Buffer==EBT_INDEX)
|
||||
getIndexBuffer().setHardwareMappingHint(NewMappingHint);
|
||||
}
|
||||
|
||||
//! flags the mesh as changed, reloads hardware buffers
|
||||
virtual void setDirty(E_BUFFER_TYPE Buffer=EBT_VERTEX_AND_INDEX) _IRR_OVERRIDE_
|
||||
{
|
||||
if (Buffer==EBT_VERTEX_AND_INDEX || Buffer==EBT_VERTEX)
|
||||
getVertexBuffer().setDirty();
|
||||
if (Buffer==EBT_VERTEX_AND_INDEX || Buffer==EBT_INDEX)
|
||||
getIndexBuffer().setDirty();
|
||||
}
|
||||
|
||||
virtual u32 getChangedID_Vertex() const _IRR_OVERRIDE_
|
||||
{
|
||||
return getVertexBuffer().getChangedID();
|
||||
}
|
||||
|
||||
virtual u32 getChangedID_Index() const _IRR_OVERRIDE_
|
||||
{
|
||||
return getIndexBuffer().getChangedID();
|
||||
}
|
||||
|
||||
// ------------------- Old interface ------------------- //
|
||||
|
||||
//! Get type of vertex data which is stored in this meshbuffer.
|
||||
/** \return Vertex type of this buffer. */
|
||||
virtual video::E_VERTEX_TYPE getVertexType() const _IRR_OVERRIDE_
|
||||
{
|
||||
return getVertexBuffer().getType();
|
||||
}
|
||||
|
||||
//! 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 _IRR_OVERRIDE_
|
||||
{
|
||||
return getVertexBuffer().getData();
|
||||
}
|
||||
|
||||
//! 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() _IRR_OVERRIDE_
|
||||
{
|
||||
return getVertexBuffer().getData();
|
||||
}
|
||||
|
||||
//! Get amount of vertices in meshbuffer.
|
||||
/** \return Number of vertices in this buffer. */
|
||||
virtual u32 getVertexCount() const _IRR_OVERRIDE_
|
||||
{
|
||||
return getVertexBuffer().size();
|
||||
}
|
||||
|
||||
//! Get type of index data which is stored in this meshbuffer.
|
||||
/** \return Index type of this buffer. */
|
||||
virtual video::E_INDEX_TYPE getIndexType() const _IRR_OVERRIDE_
|
||||
{
|
||||
return getIndexBuffer().getType();
|
||||
}
|
||||
|
||||
//! Get access to indices.
|
||||
/** \return Pointer to indices array. */
|
||||
virtual const u16* getIndices() const _IRR_OVERRIDE_
|
||||
{
|
||||
return (u16*)getIndexBuffer().getData();
|
||||
}
|
||||
|
||||
//! Get access to indices.
|
||||
/** \return Pointer to indices array. */
|
||||
virtual u16* getIndices() _IRR_OVERRIDE_
|
||||
{
|
||||
return (u16*)getIndexBuffer().getData();
|
||||
}
|
||||
|
||||
//! Get amount of indices in this meshbuffer.
|
||||
/** \return Number of indices in this buffer. */
|
||||
virtual u32 getIndexCount() const _IRR_OVERRIDE_
|
||||
{
|
||||
return getIndexBuffer().size();
|
||||
}
|
||||
|
||||
//! returns position of vertex i
|
||||
virtual const core::vector3df& getPosition(u32 i) const _IRR_OVERRIDE_
|
||||
{
|
||||
return getVertexBuffer()[i].Pos;
|
||||
}
|
||||
|
||||
//! returns position of vertex i
|
||||
virtual core::vector3df& getPosition(u32 i) _IRR_OVERRIDE_
|
||||
{
|
||||
return getVertexBuffer()[i].Pos;
|
||||
}
|
||||
|
||||
//! returns texture coords of vertex i
|
||||
virtual const core::vector2df& getTCoords(u32 i) const _IRR_OVERRIDE_
|
||||
{
|
||||
return getVertexBuffer()[i].TCoords;
|
||||
}
|
||||
|
||||
//! returns texture coords of vertex i
|
||||
virtual core::vector2df& getTCoords(u32 i) _IRR_OVERRIDE_
|
||||
{
|
||||
return getVertexBuffer()[i].TCoords;
|
||||
}
|
||||
|
||||
//! returns normal of vertex i
|
||||
virtual const core::vector3df& getNormal(u32 i) const _IRR_OVERRIDE_
|
||||
{
|
||||
return getVertexBuffer()[i].Normal;
|
||||
}
|
||||
|
||||
//! returns normal of vertex i
|
||||
virtual core::vector3df& getNormal(u32 i) _IRR_OVERRIDE_
|
||||
{
|
||||
return getVertexBuffer()[i].Normal;
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
} // end namespace scene
|
||||
} // end namespace irr
|
||||
|
||||
#endif
|
||||
|
||||
|
@ -12,7 +12,6 @@
|
||||
#include "vector3d.h"
|
||||
#include "dimension2d.h"
|
||||
#include "SColor.h"
|
||||
#include "ETerrainElements.h"
|
||||
#include "ESceneNodeTypes.h"
|
||||
#include "EMeshWriterEnums.h"
|
||||
#include "SceneParameters.h"
|
||||
|
@ -509,20 +509,6 @@ namespace video
|
||||
core::position2d<s32> colorKeyPixelPos,
|
||||
bool zeroTexels = false) const =0;
|
||||
|
||||
//! Creates a normal map from a height map texture.
|
||||
/** As input is considered to be a height map the texture is read like:
|
||||
- For a 32-bit texture only the red channel is regarded
|
||||
- For a 16-bit texture the rgb-values are averaged.
|
||||
Output channels red/green for X/Y and blue for up (Z).
|
||||
For a 32-bit texture we store additionally the height value in the
|
||||
alpha channel. This value is used by the video::EMT_PARALLAX_MAP_SOLID
|
||||
material and similar materials.
|
||||
On the borders the texture is considered to repeat.
|
||||
\param texture Height map texture which is converted to a normal map.
|
||||
\param amplitude Constant value by which the height
|
||||
information is multiplied.*/
|
||||
virtual void makeNormalMapTexture(video::ITexture* texture, f32 amplitude=1.0f) const =0;
|
||||
|
||||
//! Set a render target.
|
||||
/** This will only work if the driver supports the
|
||||
EVDF_RENDER_TO_TARGET feature, which can be queried with
|
||||
|
@ -1,43 +0,0 @@
|
||||
// Copyright (C) 2002-2012 Nikolaus Gebhardt
|
||||
// This file is part of the "Irrlicht Engine".
|
||||
// For conditions of distribution and use, see copyright notice in irrlicht.h
|
||||
|
||||
#ifndef __S_KEY_MAP_H_INCLUDED__
|
||||
#define __S_KEY_MAP_H_INCLUDED__
|
||||
|
||||
#include "Keycodes.h"
|
||||
|
||||
namespace irr
|
||||
{
|
||||
|
||||
//! enumeration for key actions. Used for example in the FPS Camera.
|
||||
enum EKEY_ACTION
|
||||
{
|
||||
EKA_MOVE_FORWARD = 0,
|
||||
EKA_MOVE_BACKWARD,
|
||||
EKA_STRAFE_LEFT,
|
||||
EKA_STRAFE_RIGHT,
|
||||
EKA_JUMP_UP,
|
||||
EKA_CROUCH,
|
||||
EKA_ROTATE_LEFT,
|
||||
EKA_ROTATE_RIGHT,
|
||||
EKA_COUNT,
|
||||
|
||||
//! This value is not used. It only forces this enumeration to compile in 32 bit.
|
||||
EKA_FORCE_32BIT = 0x7fffffff
|
||||
};
|
||||
|
||||
//! Struct storing which key belongs to which action.
|
||||
struct SKeyMap
|
||||
{
|
||||
SKeyMap() {}
|
||||
SKeyMap(EKEY_ACTION action, EKEY_CODE keyCode) : Action(action), KeyCode(keyCode) {}
|
||||
|
||||
EKEY_ACTION Action;
|
||||
EKEY_CODE KeyCode;
|
||||
};
|
||||
|
||||
} // end namespace irr
|
||||
|
||||
#endif
|
||||
|
@ -355,7 +355,7 @@ namespace video
|
||||
f32 Shininess;
|
||||
|
||||
//! Free parameter, dependent on the material type.
|
||||
/** Mostly ignored, used for example in EMT_PARALLAX_MAP_SOLID,
|
||||
/** Mostly ignored, used for example in
|
||||
EMT_TRANSPARENT_ALPHA_CHANNEL and EMT_ONETEXTURE_BLEND. */
|
||||
f32 MaterialTypeParam;
|
||||
|
||||
|
@ -1,260 +0,0 @@
|
||||
// Copyright (C) 2002-2012 Nikolaus Gebhardt
|
||||
// This file is part of the "Irrlicht Engine".
|
||||
// For conditions of distribution and use, see copyright notice in irrlicht.h
|
||||
|
||||
#ifndef __S_SHARED_MESH_BUFFER_H_INCLUDED__
|
||||
#define __S_SHARED_MESH_BUFFER_H_INCLUDED__
|
||||
|
||||
#include "irrArray.h"
|
||||
#include "IMeshBuffer.h"
|
||||
|
||||
namespace irr
|
||||
{
|
||||
namespace scene
|
||||
{
|
||||
//! Implementation of the IMeshBuffer interface with shared vertex list
|
||||
struct SSharedMeshBuffer : public IMeshBuffer
|
||||
{
|
||||
//! constructor
|
||||
SSharedMeshBuffer()
|
||||
: IMeshBuffer()
|
||||
, Vertices(0), ChangedID_Vertex(1), ChangedID_Index(1)
|
||||
, MappingHintVertex(EHM_NEVER), MappingHintIndex(EHM_NEVER)
|
||||
, PrimitiveType(EPT_TRIANGLES)
|
||||
{
|
||||
#ifdef _DEBUG
|
||||
setDebugName("SSharedMeshBuffer");
|
||||
#endif
|
||||
}
|
||||
|
||||
//! constructor
|
||||
SSharedMeshBuffer(core::array<video::S3DVertex> *vertices) : IMeshBuffer(), Vertices(vertices), ChangedID_Vertex(1), ChangedID_Index(1), MappingHintVertex(EHM_NEVER), MappingHintIndex(EHM_NEVER)
|
||||
{
|
||||
#ifdef _DEBUG
|
||||
setDebugName("SSharedMeshBuffer");
|
||||
#endif
|
||||
}
|
||||
|
||||
//! returns the material of this meshbuffer
|
||||
virtual const video::SMaterial& getMaterial() const _IRR_OVERRIDE_
|
||||
{
|
||||
return Material;
|
||||
}
|
||||
|
||||
//! returns the material of this meshbuffer
|
||||
virtual video::SMaterial& getMaterial() _IRR_OVERRIDE_
|
||||
{
|
||||
return Material;
|
||||
}
|
||||
|
||||
//! returns pointer to vertices
|
||||
virtual const void* getVertices() const _IRR_OVERRIDE_
|
||||
{
|
||||
if (Vertices)
|
||||
return Vertices->const_pointer();
|
||||
else
|
||||
return 0;
|
||||
}
|
||||
|
||||
//! returns pointer to vertices
|
||||
virtual void* getVertices() _IRR_OVERRIDE_
|
||||
{
|
||||
if (Vertices)
|
||||
return Vertices->pointer();
|
||||
else
|
||||
return 0;
|
||||
}
|
||||
|
||||
//! returns amount of vertices
|
||||
virtual u32 getVertexCount() const _IRR_OVERRIDE_
|
||||
{
|
||||
if (Vertices)
|
||||
return Vertices->size();
|
||||
else
|
||||
return 0;
|
||||
}
|
||||
|
||||
//! returns pointer to indices
|
||||
virtual const u16* getIndices() const _IRR_OVERRIDE_
|
||||
{
|
||||
return Indices.const_pointer();
|
||||
}
|
||||
|
||||
//! returns pointer to indices
|
||||
virtual u16* getIndices() _IRR_OVERRIDE_
|
||||
{
|
||||
return Indices.pointer();
|
||||
}
|
||||
|
||||
//! returns amount of indices
|
||||
virtual u32 getIndexCount() const _IRR_OVERRIDE_
|
||||
{
|
||||
return Indices.size();
|
||||
}
|
||||
|
||||
//! Get type of index data which is stored in this meshbuffer.
|
||||
virtual video::E_INDEX_TYPE getIndexType() const _IRR_OVERRIDE_
|
||||
{
|
||||
return video::EIT_16BIT;
|
||||
}
|
||||
|
||||
//! returns an axis aligned bounding box
|
||||
virtual const core::aabbox3d<f32>& getBoundingBox() const _IRR_OVERRIDE_
|
||||
{
|
||||
return BoundingBox;
|
||||
}
|
||||
|
||||
//! set user axis aligned bounding box
|
||||
virtual void setBoundingBox( const core::aabbox3df& box) _IRR_OVERRIDE_
|
||||
{
|
||||
BoundingBox = box;
|
||||
}
|
||||
|
||||
//! returns which type of vertex data is stored.
|
||||
virtual video::E_VERTEX_TYPE getVertexType() const _IRR_OVERRIDE_
|
||||
{
|
||||
return video::EVT_STANDARD;
|
||||
}
|
||||
|
||||
//! recalculates the bounding box. should be called if the mesh changed.
|
||||
virtual void recalculateBoundingBox() _IRR_OVERRIDE_
|
||||
{
|
||||
if (!Vertices || Vertices->empty() || Indices.empty())
|
||||
BoundingBox.reset(0,0,0);
|
||||
else
|
||||
{
|
||||
BoundingBox.reset((*Vertices)[Indices[0]].Pos);
|
||||
for (u32 i=1; i<Indices.size(); ++i)
|
||||
BoundingBox.addInternalPoint((*Vertices)[Indices[i]].Pos);
|
||||
}
|
||||
}
|
||||
|
||||
//! returns position of vertex i
|
||||
virtual const core::vector3df& getPosition(u32 i) const _IRR_OVERRIDE_
|
||||
{
|
||||
_IRR_DEBUG_BREAK_IF(!Vertices);
|
||||
return (*Vertices)[Indices[i]].Pos;
|
||||
}
|
||||
|
||||
//! returns position of vertex i
|
||||
virtual core::vector3df& getPosition(u32 i) _IRR_OVERRIDE_
|
||||
{
|
||||
_IRR_DEBUG_BREAK_IF(!Vertices);
|
||||
return (*Vertices)[Indices[i]].Pos;
|
||||
}
|
||||
|
||||
//! returns normal of vertex i
|
||||
virtual const core::vector3df& getNormal(u32 i) const _IRR_OVERRIDE_
|
||||
{
|
||||
_IRR_DEBUG_BREAK_IF(!Vertices);
|
||||
return (*Vertices)[Indices[i]].Normal;
|
||||
}
|
||||
|
||||
//! returns normal of vertex i
|
||||
virtual core::vector3df& getNormal(u32 i) _IRR_OVERRIDE_
|
||||
{
|
||||
_IRR_DEBUG_BREAK_IF(!Vertices);
|
||||
return (*Vertices)[Indices[i]].Normal;
|
||||
}
|
||||
|
||||
//! returns texture coord of vertex i
|
||||
virtual const core::vector2df& getTCoords(u32 i) const _IRR_OVERRIDE_
|
||||
{
|
||||
_IRR_DEBUG_BREAK_IF(!Vertices);
|
||||
return (*Vertices)[Indices[i]].TCoords;
|
||||
}
|
||||
|
||||
//! returns texture coord of vertex i
|
||||
virtual core::vector2df& getTCoords(u32 i) _IRR_OVERRIDE_
|
||||
{
|
||||
_IRR_DEBUG_BREAK_IF(!Vertices);
|
||||
return (*Vertices)[Indices[i]].TCoords;
|
||||
}
|
||||
|
||||
//! append the vertices and indices to the current buffer
|
||||
virtual void append(const void* const vertices, u32 numVertices, const u16* const indices, u32 numIndices) _IRR_OVERRIDE_ {}
|
||||
//! append the meshbuffer to the current buffer
|
||||
virtual void append(const IMeshBuffer* const other) _IRR_OVERRIDE_ {}
|
||||
|
||||
//! get the current hardware mapping hint
|
||||
virtual E_HARDWARE_MAPPING getHardwareMappingHint_Vertex() const _IRR_OVERRIDE_
|
||||
{
|
||||
return MappingHintVertex;
|
||||
}
|
||||
|
||||
//! get the current hardware mapping hint
|
||||
virtual E_HARDWARE_MAPPING getHardwareMappingHint_Index() const _IRR_OVERRIDE_
|
||||
{
|
||||
return MappingHintIndex;
|
||||
}
|
||||
|
||||
//! set the hardware mapping hint, for driver
|
||||
virtual void setHardwareMappingHint( E_HARDWARE_MAPPING NewMappingHint, E_BUFFER_TYPE buffer=EBT_VERTEX_AND_INDEX ) _IRR_OVERRIDE_
|
||||
{
|
||||
if (buffer==EBT_VERTEX_AND_INDEX || buffer==EBT_VERTEX)
|
||||
MappingHintVertex=NewMappingHint;
|
||||
if (buffer==EBT_VERTEX_AND_INDEX || buffer==EBT_INDEX)
|
||||
MappingHintIndex=NewMappingHint;
|
||||
}
|
||||
|
||||
//! Describe what kind of primitive geometry is used by the meshbuffer
|
||||
virtual void setPrimitiveType(E_PRIMITIVE_TYPE type) _IRR_OVERRIDE_
|
||||
{
|
||||
PrimitiveType = type;
|
||||
}
|
||||
|
||||
//! Get the kind of primitive geometry which is used by the meshbuffer
|
||||
virtual E_PRIMITIVE_TYPE getPrimitiveType() const _IRR_OVERRIDE_
|
||||
{
|
||||
return PrimitiveType;
|
||||
}
|
||||
|
||||
//! flags the mesh as changed, reloads hardware buffers
|
||||
virtual void setDirty(E_BUFFER_TYPE buffer=EBT_VERTEX_AND_INDEX) _IRR_OVERRIDE_
|
||||
{
|
||||
if (buffer==EBT_VERTEX_AND_INDEX || buffer==EBT_VERTEX)
|
||||
++ChangedID_Vertex;
|
||||
if (buffer==EBT_VERTEX_AND_INDEX || buffer==EBT_INDEX)
|
||||
++ChangedID_Index;
|
||||
}
|
||||
|
||||
//! Get the currently used ID for identification of changes.
|
||||
/** This shouldn't be used for anything outside the VideoDriver. */
|
||||
virtual u32 getChangedID_Vertex() const _IRR_OVERRIDE_ {return ChangedID_Vertex;}
|
||||
|
||||
//! Get the currently used ID for identification of changes.
|
||||
/** This shouldn't be used for anything outside the VideoDriver. */
|
||||
virtual u32 getChangedID_Index() const _IRR_OVERRIDE_ {return ChangedID_Index;}
|
||||
|
||||
//! Material of this meshBuffer
|
||||
video::SMaterial Material;
|
||||
|
||||
//! Shared Array of vertices
|
||||
core::array<video::S3DVertex> *Vertices;
|
||||
|
||||
//! Array of indices
|
||||
core::array<u16> Indices;
|
||||
|
||||
//! ID used for hardware buffer management
|
||||
u32 ChangedID_Vertex;
|
||||
|
||||
//! ID used for hardware buffer management
|
||||
u32 ChangedID_Index;
|
||||
|
||||
//! Bounding box
|
||||
core::aabbox3df BoundingBox;
|
||||
|
||||
//! hardware mapping hint
|
||||
E_HARDWARE_MAPPING MappingHintVertex;
|
||||
E_HARDWARE_MAPPING MappingHintIndex;
|
||||
|
||||
//! Primitive type used for rendering (triangles, lines, ...)
|
||||
E_PRIMITIVE_TYPE PrimitiveType;
|
||||
};
|
||||
|
||||
|
||||
} // end namespace scene
|
||||
} // end namespace irr
|
||||
|
||||
#endif
|
||||
|
@ -31,7 +31,6 @@
|
||||
|
||||
#include "IrrCompileConfig.h"
|
||||
#include "aabbox3d.h"
|
||||
#include "CDynamicMeshBuffer.h"
|
||||
#include "CIndexBuffer.h"
|
||||
#include "CMeshBuffer.h"
|
||||
#include "coreutil.h"
|
||||
@ -50,7 +49,6 @@
|
||||
#include "EMeshWriterEnums.h"
|
||||
#include "EMessageBoxFlags.h"
|
||||
#include "ESceneNodeTypes.h"
|
||||
#include "ETerrainElements.h"
|
||||
#include "fast_atof.h"
|
||||
#include "heapsort.h"
|
||||
#include "IAnimatedMesh.h"
|
||||
@ -63,7 +61,6 @@
|
||||
#include "IContextManager.h"
|
||||
#include "ICursorControl.h"
|
||||
#include "IDummyTransformationSceneNode.h"
|
||||
#include "IDynamicMeshBuffer.h"
|
||||
#include "IEventReceiver.h"
|
||||
#include "IFileList.h"
|
||||
#include "IFileSystem.h"
|
||||
@ -150,12 +147,10 @@
|
||||
#include "SColor.h"
|
||||
#include "SExposedVideoData.h"
|
||||
#include "SIrrCreationParameters.h"
|
||||
#include "SKeyMap.h"
|
||||
#include "SLight.h"
|
||||
#include "SMaterial.h"
|
||||
#include "SMesh.h"
|
||||
#include "SMeshBuffer.h"
|
||||
#include "SSharedMeshBuffer.h"
|
||||
#include "SSkinMeshBuffer.h"
|
||||
#include "SVertexIndex.h"
|
||||
#include "SViewFrustum.h"
|
||||
|
Reference in New Issue
Block a user