arsa
2.7
|
An interface for easy manipulation of meshes. More...
#include <IMeshManipulator.h>
Public Member Functions | |
virtual void | flipSurfaces (IMesh *mesh) const =0 |
Flips the direction of surfaces. More... | |
void | setVertexColorAlpha (IMesh *mesh, s32 alpha) const |
Sets the alpha vertex color value of the whole mesh to a new value. More... | |
void | setVertexColorAlpha (IMeshBuffer *buffer, s32 alpha) const |
Sets the alpha vertex color value of the whole mesh to a new value. More... | |
void | setVertexColors (IMesh *mesh, video::SColor color) const |
Sets the colors of all vertices to one color. More... | |
void | setVertexColors (IMeshBuffer *buffer, video::SColor color) const |
Sets the colors of all vertices to one color. More... | |
virtual void | recalculateNormals (IMesh *mesh, bool smooth=false, bool angleWeighted=false) const =0 |
Recalculates all normals of the mesh. More... | |
virtual void | recalculateNormals (IMeshBuffer *buffer, bool smooth=false, bool angleWeighted=false) const =0 |
Recalculates all normals of the mesh buffer. More... | |
virtual void | recalculateTangents (IMesh *mesh, bool recalculateNormals=false, bool smooth=false, bool angleWeighted=false) const =0 |
Recalculates tangents, requires a tangent mesh. More... | |
virtual void | recalculateTangents (IMeshBuffer *buffer, bool recalculateNormals=false, bool smooth=false, bool angleWeighted=false) const =0 |
Recalculates tangents, requires a tangent mesh buffer. More... | |
void | scale (IMesh *mesh, const core::vector3df &factor) const |
Scales the actual mesh, not a scene node. More... | |
void | scale (IMeshBuffer *buffer, const core::vector3df &factor) const |
Scales the actual meshbuffer, not a scene node. More... | |
_IRR_DEPRECATED_ void | scaleMesh (IMesh *mesh, const core::vector3df &factor) const |
Scales the actual mesh, not a scene node. More... | |
void | scaleTCoords (scene::IMesh *mesh, const core::vector2df &factor, u32 level=1) const |
Scale the texture coords of a mesh. More... | |
void | scaleTCoords (scene::IMeshBuffer *buffer, const core::vector2df &factor, u32 level=1) const |
Scale the texture coords of a meshbuffer. More... | |
void | transform (IMesh *mesh, const core::matrix4 &m, u32 normalsUpdate=0) const |
Applies a transformation to a mesh. More... | |
void | transform (IMeshBuffer *buffer, const core::matrix4 &m, u32 normalsUpdate=0) const |
Applies a transformation to a meshbuffer. More... | |
virtual _IRR_DEPRECATED_ void | transformMesh (IMesh *mesh, const core::matrix4 &m) const |
Applies a transformation to a mesh. More... | |
virtual void | makePlanarTextureMapping (IMesh *mesh, f32 resolution=0.001f) const =0 |
Creates a planar texture mapping on the mesh. More... | |
virtual void | makePlanarTextureMapping (scene::IMeshBuffer *meshbuffer, f32 resolution=0.001f) const =0 |
Creates a planar texture mapping on the meshbuffer. More... | |
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. More... | |
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. More... | |
virtual SMesh * | createMeshCopy (IMesh *mesh) const =0 |
Clones a static IMesh into a modifiable SMesh. More... | |
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. More... | |
virtual IMesh * | createMeshWith2TCoords (IMesh *mesh) const =0 |
Creates a copy of the mesh, which will only consist of S3DVertex2TCoord vertices. More... | |
virtual IMesh * | createMeshWith1TCoords (IMesh *mesh) const =0 |
Creates a copy of the mesh, which will only consist of S3DVertex vertices. More... | |
virtual IMesh * | createMeshUniquePrimitives (IMesh *mesh) const =0 |
Creates a copy of a mesh with all vertices unwelded. More... | |
virtual IMesh * | createMeshWelded (IMesh *mesh, f32 tolerance=core::ROUNDING_ERROR_f32) const =0 |
Creates a copy of a mesh with vertices welded. More... | |
virtual s32 | getPolyCount (IMesh *mesh) const =0 |
Get amount of polygons in mesh. More... | |
virtual s32 | getPolyCount (IAnimatedMesh *mesh) const =0 |
Get amount of polygons in mesh. More... | |
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. More... | |
virtual IMesh * | createForsythOptimizedMesh (const IMesh *mesh) const =0 |
Vertex cache optimization according to the Forsyth paper. More... | |
virtual void | heightmapOptimizeMesh (IMesh *const mesh, const f32 tolerance=core::ROUNDING_ERROR_f32) const =0 |
Optimize the mesh with an algorithm tuned for heightmaps. More... | |
virtual void | heightmapOptimizeMesh (IMeshBuffer *const mb, const f32 tolerance=core::ROUNDING_ERROR_f32) const =0 |
Optimize the meshbuffer with an algorithm tuned for heightmaps. More... | |
template<typename Functor > | |
bool | apply (const Functor &func, IMeshBuffer *buffer, bool boundingBoxUpdate=false) const |
Apply a manipulator on the Meshbuffer. More... | |
template<typename Functor > | |
bool | apply (const Functor &func, IMesh *mesh, bool boundingBoxUpdate=false) const |
Apply a manipulator on the Mesh. More... | |
Public Member Functions inherited from irr::IReferenceCounted | |
IReferenceCounted () | |
Constructor. More... | |
virtual | ~IReferenceCounted () |
Destructor. More... | |
void | grab () const |
Grabs the object. Increments the reference counter by one. More... | |
bool | drop () const |
Drops the object. Decrements the reference counter by one. More... | |
s32 | getReferenceCount () const |
Get the reference count. More... | |
const c8 * | getDebugName () const |
Returns the debug name of the object. More... | |
Protected Member Functions | |
template<typename Functor > | |
bool | apply_ (const Functor &func, IMeshBuffer *buffer, bool boundingBoxUpdate, const IVertexManipulator &typeTest) const |
Apply a manipulator based on the type of the functor. More... | |
Protected Member Functions inherited from irr::IReferenceCounted | |
void | setDebugName (const c8 *newName) |
Sets the debug name of the object. More... | |
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.
Definition at line 29 of file IMeshManipulator.h.
|
inline |
Apply a manipulator on the Meshbuffer.
func | A functor defining the mesh manipulation. |
buffer | The Meshbuffer to apply the manipulator to. |
boundingBoxUpdate | Specifies if the bounding box should be updated during manipulation. |
Definition at line 356 of file IMeshManipulator.h.
|
inline |
Apply a manipulator on the Mesh.
func | A functor defining the mesh manipulation. |
mesh | The Mesh to apply the manipulator to. |
boundingBoxUpdate | Specifies if the bounding box should be updated during manipulation. |
Definition at line 368 of file IMeshManipulator.h.
|
inlineprotected |
Apply a manipulator based on the type of the functor.
func | A functor defining the mesh manipulation. |
buffer | The Meshbuffer to apply the manipulator to. |
boundingBoxUpdate | Specifies if the bounding box should be updated during manipulation. |
typeTest | Unused parameter, which handles the proper call selection based on the type of the Functor which is passed in two times. |
Definition at line 398 of file IMeshManipulator.h.
|
pure virtual |
Create a new AnimatedMesh and adds the mesh to it.
mesh | Input mesh |
type | The type of the animated mesh to create. |
|
pure virtual |
Vertex cache optimization according to the Forsyth paper.
More information can be found at http://home.comcast.net/~tom_forsyth/papers/fast_vert_cache_opt.html
The function is thread-safe (read: you can optimize several meshes in different threads).
mesh | Source mesh for the operation. |
Clones a static IMesh into a modifiable SMesh.
All meshbuffers in the returned SMesh are of type SMeshBuffer or SMeshBufferLightMap.
mesh | Mesh to copy. |
|
pure virtual |
Creates a copy of a mesh with all vertices unwelded.
mesh | Input mesh |
|
pure virtual |
Creates a copy of a mesh with vertices welded.
mesh | Input mesh |
tolerance | The threshold for vertex comparisons. |
|
pure virtual |
Creates a copy of the mesh, which will only consist of S3DVertex vertices.
mesh | Input mesh |
|
pure virtual |
Creates a copy of the mesh, which will only consist of S3DVertex2TCoord vertices.
mesh | Input mesh |
|
pure virtual |
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.
mesh | Input mesh |
recalculateNormals | The normals are recalculated if set, otherwise the original ones are kept. Note that keeping the normals may introduce inaccurate tangents if the normals are very different to those calculated from the faces. |
smooth | The normals/tangents are smoothed across the meshbuffer's faces if this flag is set. |
angleWeighted | Improved smoothing calculation used |
recalculateTangents | Whether are actually calculated, or just the mesh with proper type is created. |
Flips the direction of surfaces.
Changes backfacing triangles to frontfacing triangles and vice versa.
mesh | Mesh on which the operation is performed. |
Get amount of polygons in mesh.
mesh | Input mesh |
|
pure virtual |
Get amount of polygons in mesh.
mesh | Input mesh |
|
pure virtual |
Optimize the mesh with an algorithm tuned for heightmaps.
This differs from usual simplification methods in two ways:
This function is thread-safe. Remember to weld afterwards - this function only moves vertices, it does not weld.
mesh | Mesh to operate on. |
|
pure virtual |
Optimize the meshbuffer with an algorithm tuned for heightmaps.
This differs from usual simplification methods in two ways:
This function is thread-safe. Remember to weld afterward - this function only moves vertices, it does not weld.
mb | Meshbuffer to operate on. |
|
pure virtual |
Creates a planar texture mapping on the mesh.
mesh | Mesh on which the operation is performed. |
resolution | resolution of the planar mapping. This is the value specifying which is the relation between world space and texture coordinate space. |
|
pure virtual |
Creates a planar texture mapping on the meshbuffer.
meshbuffer | Buffer on which the operation is performed. |
resolution | resolution of the planar mapping. This is the value specifying which is the relation between world space and texture coordinate space. |
|
pure virtual |
Creates a planar texture mapping on the buffer.
This method is currently implemented towards the LWO planar mapping. A more general biasing might be required.
mesh | Mesh on which the operation is performed. |
resolutionS | Resolution of the planar mapping in horizontal direction. This is the ratio between object space and texture space. |
resolutionT | Resolution of the planar mapping in vertical direction. This is the ratio between object space and texture space. |
axis | The axis along which the texture is projected. The allowed values are 0 (X), 1(Y), and 2(Z). |
offset | Vector added to the vertex positions (in object coordinates). |
|
pure virtual |
Creates a planar texture mapping on the meshbuffer.
This method is currently implemented towards the LWO planar mapping. A more general biasing might be required.
buffer | Buffer on which the operation is performed. |
resolutionS | Resolution of the planar mapping in horizontal direction. This is the ratio between object space and texture space. |
resolutionT | Resolution of the planar mapping in vertical direction. This is the ratio between object space and texture space. |
axis | The axis along which the texture is projected. The allowed values are 0 (X), 1(Y), and 2(Z). |
offset | Vector added to the vertex positions (in object coordinates). |
|
pure virtual |
Recalculates all normals of the mesh.
mesh | Mesh on which the operation is performed. |
smooth | If the normals shall be smoothed. |
angleWeighted | If the normals shall be smoothed in relation to their angles. More expensive, but also higher precision. |
|
pure virtual |
Recalculates all normals of the mesh buffer.
buffer | Mesh buffer on which the operation is performed. |
smooth | If the normals shall be smoothed. |
angleWeighted | If the normals shall be smoothed in relation to their angles. More expensive, but also higher precision. |
|
pure virtual |
Recalculates tangents, requires a tangent mesh.
mesh | Mesh on which the operation is performed. |
recalculateNormals | If the normals shall be recalculated, otherwise original normals of the mesh are used unchanged. |
smooth | If the normals shall be smoothed. |
angleWeighted | If the normals shall be smoothed in relation to their angles. More expensive, but also higher precision. |
|
pure virtual |
Recalculates tangents, requires a tangent mesh buffer.
buffer | Meshbuffer on which the operation is performed. |
recalculateNormals | If the normals shall be recalculated, otherwise original normals of the buffer are used unchanged. |
smooth | If the normals shall be smoothed. |
angleWeighted | If the normals shall be smoothed in relation to their angles. More expensive, but also higher precision. |
|
inline |
Scales the actual mesh, not a scene node.
mesh | Mesh on which the operation is performed. |
factor | Scale factor for each axis. |
Definition at line 108 of file IMeshManipulator.h.
|
inline |
Scales the actual meshbuffer, not a scene node.
buffer | Meshbuffer on which the operation is performed. |
factor | Scale factor for each axis. |
Definition at line 116 of file IMeshManipulator.h.
|
inline |
Scales the actual mesh, not a scene node.
mesh | Mesh on which the operation is performed. |
factor | Scale factor for each axis. |
Definition at line 125 of file IMeshManipulator.h.
|
inline |
Scale the texture coords of a mesh.
mesh | Mesh on which the operation is performed. |
factor | Vector which defines the scale for each axis. |
level | Number of texture coord, starting from 1. Support for level 2 exists for LightMap buffers. |
Definition at line 131 of file IMeshManipulator.h.
|
inline |
Scale the texture coords of a meshbuffer.
buffer | Meshbuffer on which the operation is performed. |
factor | Vector which defines the scale for each axis. |
level | Number of texture coord, starting from 1. Support for level 2 exists for LightMap buffers. |
Definition at line 140 of file IMeshManipulator.h.
Sets the alpha vertex color value of the whole mesh to a new value.
mesh | Mesh on which the operation is performed. |
alpha | New alpha value. Must be a value between 0 and 255. |
Definition at line 42 of file IMeshManipulator.h.
|
inline |
Sets the alpha vertex color value of the whole mesh to a new value.
buffer | Meshbuffer on which the operation is performed. |
alpha | New alpha value. Must be a value between 0 and 255. |
Definition at line 50 of file IMeshManipulator.h.
|
inline |
Sets the colors of all vertices to one color.
mesh | Mesh on which the operation is performed. |
color | New color. |
Definition at line 58 of file IMeshManipulator.h.
|
inline |
Sets the colors of all vertices to one color.
buffer | Meshbuffer on which the operation is performed. |
color | New color. |
Definition at line 66 of file IMeshManipulator.h.
|
inline |
Applies a transformation to a mesh.
mesh | Mesh on which the operation is performed. |
m | transformation matrix. |
normalsUpdate | When 0 - don't update normals. When 1 - update normals with inverse transposed of the transformation matrix |
Definition at line 151 of file IMeshManipulator.h.
|
inline |
Applies a transformation to a meshbuffer.
buffer | Meshbuffer on which the operation is performed. |
m | transformation matrix. |
normalsUpdate | When 0 - don't update normals. When 1 - update normals with inverse transposed of the transformation matrix |
Definition at line 172 of file IMeshManipulator.h.
|
inlinevirtual |
Applies a transformation to a mesh.
mesh | Mesh on which the operation is performed. |
m | transformation matrix. |
Definition at line 191 of file IMeshManipulator.h.