 |
Irrlicht 3D Engine
|
|
Go to the documentation of this file.
5 #ifndef __I_MESH_MANIPULATOR_H_INCLUDED__
6 #define __I_MESH_MANIPULATOR_H_INCLUDED__
76 bool angleWeighted =
false)
const=0;
83 bool smooth =
false,
bool angleWeighted =
false)
const=0;
93 bool angleWeighted=
false)
const=0;
103 bool angleWeighted=
false)
const=0;
190 f32 resolutionS,
f32 resolutionT,
202 f32 resolutionS,
f32 resolutionT,
303 template <
typename Functor>
306 return apply_(func, buffer, boundingBoxUpdate, func);
315 template <
typename Functor>
316 bool apply(
const Functor& func,
IMesh* mesh,
bool boundingBoxUpdate=
false)
const
325 if (boundingBoxUpdate)
333 if (boundingBoxUpdate)
345 template <
typename Functor>
375 if (boundingBoxUpdate)
383 if (boundingBoxUpdate)
Vertex manipulator to set the alpha value of the vertex color to a fixed value.
@ EAMT_UNKNOWN
Unknown animated mesh type.
Simple implementation of the IMesh interface.
virtual IAnimatedMesh * createAnimatedMesh(IMesh *mesh, scene::E_ANIMATED_MESH_TYPE type=scene::EAMT_UNKNOWN) const =0
Create a new AnimatedMesh and adds the mesh to it.
Vertex manipulator which scales the TCoords of the vertex.
bool apply(const Functor &func, IMeshBuffer *buffer, bool boundingBoxUpdate=false) const
Apply a manipulator on the Meshbuffer.
virtual IMesh * createMeshWith1TCoords(IMesh *mesh) const =0
Creates a copy of the mesh, which will only consist of S3DVertex vertices.
virtual IMesh * createMeshWith2TCoords(IMesh *mesh) const =0
Creates a copy of the mesh, which will only consist of S3DVertex2TCoord vertices.
virtual IMesh * createMeshWelded(IMesh *mesh, f32 tolerance=core::ROUNDING_ERROR_f32) const =0
Creates a copy of a mesh with vertices welded.
void setVertexColorAlpha(IMesh *mesh, s32 alpha) const
Sets the alpha vertex color value of the whole mesh to a new value.
virtual IMeshBuffer * getMeshBuffer(u32 nr) const =0
Get pointer to a mesh buffer.
virtual void flipSurfaces(IMesh *mesh) const =0
Flips the direction of surfaces.
virtual void recalculateTangents(IMesh *mesh, bool recalculateNormals=false, bool smooth=false, bool angleWeighted=false) const =0
Recalculates tangents, requires a tangent mesh.
void reset(T x, T y, T z)
Resets the bounding box to a one-point box.
virtual const void * getVertices() const =0
Get access to vertex data. The data is an array of vertices.
virtual void setBoundingBox(const core::aabbox3df &box)=0
Set user-defined axis aligned bounding box.
standard vertex used by the Irrlicht engine.
void setVertexColors(IMesh *mesh, video::SColor color) const
Sets the colors of all vertices to one color.
@ EVT_STANDARD
Standard vertex type used by the Irrlicht engine, video::S3DVertex.
virtual void makePlanarTextureMapping(IMesh *mesh, f32 resolution=0.001f) const =0
Creates a planar texture mapping on the mesh.
Vertex manipulator which scales the position of the vertex.
virtual SMesh * createMeshCopy(IMesh *mesh) const =0
Clones a static IMesh into a modifiable SMesh.
Vertex with two texture coordinates.
virtual void setBoundingBox(const core::aabbox3df &box)=0
Set axis aligned bounding box.
void transform(IMesh *mesh, const core::matrix4 &m) const
Applies a transformation to a mesh.
void scaleTCoords(scene::IMeshBuffer *buffer, const core::vector2df &factor, u32 level=1) const
Scale the texture coords of a meshbuffer.
virtual const core::vector3df & getPosition(u32 i) const =0
returns position of vertex i
void setVertexColors(IMeshBuffer *buffer, video::SColor color) const
Sets the colors of all vertices to one color.
E_ANIMATED_MESH_TYPE
Possible types of (animated) meshes.
Interface for vertex manipulators.
Interface for an animated mesh.
An interface for easy manipulation of meshes.
signed int s32
32 bit signed variable.
4x4 matrix. Mostly used as transformation matrix for 3d calculations.
@ EVT_TANGENTS
Vertex with a tangent and binormal vector, video::S3DVertexTangents.
void transform(IMeshBuffer *buffer, const core::matrix4 &m) const
Applies a transformation to a meshbuffer.
@ EVT_2TCOORDS
Vertex with two texture coordinates, video::S3DVertex2TCoords.
Base class of most objects of the Irrlicht Engine.
bool apply_(const Functor &func, IMeshBuffer *buffer, bool boundingBoxUpdate, const IVertexManipulator &typeTest) const
Apply a manipulator based on the type of the functor.
void scaleTCoords(scene::IMesh *mesh, const core::vector2df &factor, u32 level=1) const
Scale the texture coords of a mesh.
float f32
32 bit floating point variable.
bool apply(const Functor &func, IMesh *mesh, bool boundingBoxUpdate=false) const
Apply a manipulator on the Mesh.
virtual IMesh * createForsythOptimizedMesh(const IMesh *mesh) const =0
Vertex cache optimization according to the Forsyth paper.
virtual s32 getPolyCount(IMesh *mesh) const =0
Get amount of polygons in mesh.
void addInternalBox(const aabbox3d< T > &b)
Adds another bounding box.
virtual IMesh * createMeshUniquePrimitives(IMesh *mesh) const =0
Creates a copy of a mesh with all vertices unwelded.
virtual video::E_VERTEX_TYPE getVertexType() const =0
Get type of vertex data which is stored in this meshbuffer.
_IRR_DEPRECATED_ void scaleMesh(IMesh *mesh, const core::vector3df &factor) const
Scales the actual mesh, not a scene node.
virtual const core::aabbox3df & getBoundingBox() const =0
Get the axis aligned bounding box of this meshbuffer.
Class which holds the geometry of an object.
const f32 ROUNDING_ERROR_f32
void scale(IMesh *mesh, const core::vector3df &factor) const
Scales the actual mesh, not a scene node.
Everything in the Irrlicht Engine can be found in this namespace.
void setVertexColorAlpha(IMeshBuffer *buffer, s32 alpha) const
Sets the alpha vertex color value of the whole mesh to a new value.
virtual void recalculateNormals(IMesh *mesh, bool smooth=false, bool angleWeighted=false) const =0
Recalculates all normals of the mesh.
void scale(IMeshBuffer *buffer, const core::vector3df &factor) const
Scales the actual meshbuffer, not a scene node.
unsigned int u32
32 bit unsigned variable.
void addInternalPoint(const vector3d< T > &p)
Adds a point to the bounding box.
virtual u32 getMeshBufferCount() const =0
Get the amount of mesh buffers.
virtual IMesh * createMeshWithTangents(IMesh *mesh, bool recalculateNormals=false, bool smooth=false, bool angleWeighted=false, bool recalculateTangents=true) const =0
Creates a copy of the mesh, which will only consist of S3DVertexTangents vertices.
virtual _IRR_DEPRECATED_ void transformMesh(IMesh *mesh, const core::matrix4 &m) const
Applies a transformation to a mesh.
virtual u32 getVertexCount() const =0
Get amount of vertices in meshbuffer.
#define _IRR_DEPRECATED_
Defines a deprecated macro which generates a warning at compile time.
Struct for holding a mesh with a single material.
Class representing a 32 bit ARGB color.
Vertex with a tangent and binormal vector.
Vertex manipulator to set color to a fixed color for all vertices.
unsigned char u8
8 bit unsigned variable.