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