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;
155 if ( normalsUpdate == 1 )
158 if (
m.getInverse(invT) )
176 if ( normalsUpdate == 1 )
179 if (
m.getInverse(invT) )
216 f32 resolutionS,
f32 resolutionT,
228 f32 resolutionS,
f32 resolutionT,
355 template <
typename Functor>
367 template <
typename Functor>
377 if (boundingBoxUpdate)
385 if (boundingBoxUpdate)
397 template <
typename Functor>
404 for (
u32 i=0; i<
buffer->getVertexCount(); ++i)
406 switch (
buffer->getVertexType())
427 if (boundingBoxUpdate)
435 if (boundingBoxUpdate)
436 buffer->setBoundingBox(bufferbox);
virtual IMesh * createMeshWith2TCoords(IMesh *mesh) const =0
Creates a copy of the mesh, which will only consist of S3DVertex2TCoord vertices.
#define _IRR_DEPRECATED_
Defines a deprecated macro which generates a warning at compile time.
virtual void flipSurfaces(IMesh *mesh) const =0
Flips the direction of surfaces.
virtual const core::aabbox3df & getBoundingBox() const =0
Get the axis aligned bounding box of this meshbuffer.
CMatrix4< T > getTransposed() const
Gets transposed matrix.
float f32
32 bit floating point variable.
E_ANIMATED_MESH_TYPE
Possible types of meshes.
Unknown animated mesh type.
void transform(IMeshBuffer *buffer, const core::matrix4 &m, u32 normalsUpdate=0) const
Applies a transformation to a meshbuffer.
virtual s32 getPolyCount(IMesh *mesh) const =0
Get amount of polygons in mesh.
Everything in the Irrlicht Engine can be found in this namespace.
Simple implementation of the IMesh interface.
virtual void recalculateTangents(IMesh *mesh, bool recalculateNormals=false, bool smooth=false, bool angleWeighted=false) const =0
Recalculates tangents, requires a tangent mesh.
Vertex manipulator which scales the position of the vertex.
Vertex with two texture coordinates, video::S3DVertex2TCoords.
GLfloat GLfloat GLfloat alpha
void reset(T x, T y, T z)
Resets the bounding box to a one-point box.
void scale(IMeshBuffer *buffer, const core::vector3df &factor) const
Scales the actual meshbuffer, not a scene node.
virtual IMeshBuffer * getMeshBuffer(u32 nr) const =0
Get pointer to a mesh buffer.
Class which holds the geometry of an object.
unsigned char u8
8 bit unsigned variable.
virtual void makePlanarTextureMapping(IMesh *mesh, f32 resolution=0.001f) const =0
Creates a planar texture mapping on the mesh.
const f32 ROUNDING_ERROR_f32
Vertex with two texture coordinates.
virtual u32 getMeshBufferCount() const =0
Get the amount of mesh buffers.
signed int s32
32 bit signed variable.
Struct for holding a mesh with a single material.
void addInternalBox(const aabbox3d< T > &b)
Adds another bounding box.
Vertex with a tangent and binormal vector, video::S3DVertexTangents.
bool apply(const Functor &func, IMeshBuffer *buffer, bool boundingBoxUpdate=false) const
Apply a manipulator on the Meshbuffer.
void setVertexColorAlpha(IMeshBuffer *buffer, s32 alpha) const
Sets the alpha vertex color value of the whole mesh to a new value.
virtual IMesh * createMeshWith1TCoords(IMesh *mesh) const =0
Creates a copy of the mesh, which will only consist of S3DVertex vertices.
unsigned int u32
32 bit unsigned variable.
Standard vertex type used by the Irrlicht engine, video::S3DVertex.
Interface for vertex manipulators.
virtual _IRR_DEPRECATED_ void transformMesh(IMesh *mesh, const core::matrix4 &m) const
Applies a transformation to a mesh.
bool apply_(const Functor &func, IMeshBuffer *buffer, bool boundingBoxUpdate, const IVertexManipulator &typeTest) const
Apply a manipulator based on the type of the functor.
Vertex manipulator to set the alpha value of the vertex color to a fixed value.
virtual void recalculateNormals(IMesh *mesh, bool smooth=false, bool angleWeighted=false) const =0
Recalculates all normals of the mesh.
virtual IMesh * createMeshWelded(IMesh *mesh, f32 tolerance=core::ROUNDING_ERROR_f32) const =0
Creates a copy of a mesh with vertices welded.
standard vertex used by the Irrlicht engine.
virtual void setBoundingBox(const core::aabbox3df &box)=0
Set user-defined axis aligned bounding box.
bool apply(const Functor &func, IMesh *mesh, bool boundingBoxUpdate=false) const
Apply a manipulator on the Mesh.
void transform(IMesh *mesh, const core::matrix4 &m, u32 normalsUpdate=0) const
Applies a transformation to a mesh.
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.
void setVertexColorAlpha(IMesh *mesh, s32 alpha) const
Sets the alpha vertex color value of the whole mesh to a new value.
virtual IMesh * createMeshUniquePrimitives(IMesh *mesh) const =0
Creates a copy of a mesh with all vertices unwelded.
Vertex manipulator which scales the TCoords of the vertex.
Class representing a 32 bit ARGB color.
4x4 matrix. Mostly used as transformation matrix for 3d calculations.
void setVertexColors(IMeshBuffer *buffer, video::SColor color) const
Sets the colors of all vertices to one color.
void addInternalPoint(const vector3d< T > &p)
Adds a point to the bounding box.
void scale(IMesh *mesh, const core::vector3df &factor) const
Scales the actual mesh, not a scene node.
_IRR_DEPRECATED_ void scaleMesh(IMesh *mesh, const core::vector3df &factor) const
Scales the actual mesh, not a scene node.
void scaleTCoords(scene::IMeshBuffer *buffer, const core::vector2df &factor, u32 level=1) const
Scale the texture coords of a meshbuffer.
void setVertexColors(IMesh *mesh, video::SColor color) const
Sets the colors of all vertices to one color.
Base class of most objects of the Irrlicht Engine.
GLuint GLuint GLsizei GLenum type
Vertex manipulator to set color to a fixed color for all vertices.
Interface for an animated mesh.
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.
An interface for easy manipulation of meshes.
void scaleTCoords(scene::IMesh *mesh, const core::vector2df &factor, u32 level=1) const
Scale the texture coords of a mesh.
virtual void heightmapOptimizeMesh(IMesh *const mesh, const f32 tolerance=core::ROUNDING_ERROR_f32) const =0
Optimize the mesh with an algorithm tuned for heightmaps.
Vertex with a tangent and binormal vector.
virtual SMesh * createMeshCopy(IMesh *mesh) const =0
Clones a static IMesh into a modifiable SMesh.
virtual IMesh * createForsythOptimizedMesh(const IMesh *mesh) const =0
Vertex cache optimization according to the Forsyth paper.