arsa  2.7
Public Member Functions | Protected Member Functions | List of all members
irr::scene::IMeshManipulator Class Referenceabstract

An interface for easy manipulation of meshes. More...

#include <IMeshManipulator.h>

Inheritance diagram for irr::scene::IMeshManipulator:
irr::IReferenceCounted

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 SMeshcreateMeshCopy (IMesh *mesh) const =0
 Clones a static IMesh into a modifiable SMesh. More...
 
virtual IMeshcreateMeshWithTangents (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 IMeshcreateMeshWith2TCoords (IMesh *mesh) const =0
 Creates a copy of the mesh, which will only consist of S3DVertex2TCoord vertices. More...
 
virtual IMeshcreateMeshWith1TCoords (IMesh *mesh) const =0
 Creates a copy of the mesh, which will only consist of S3DVertex vertices. More...
 
virtual IMeshcreateMeshUniquePrimitives (IMesh *mesh) const =0
 Creates a copy of a mesh with all vertices unwelded. More...
 
virtual IMeshcreateMeshWelded (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 IAnimatedMeshcreateAnimatedMesh (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 IMeshcreateForsythOptimizedMesh (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 c8getDebugName () 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...
 

Detailed Description

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.

Member Function Documentation

◆ apply() [1/2]

template<typename Functor >
bool irr::scene::IMeshManipulator::apply ( const Functor &  func,
IMeshBuffer buffer,
bool  boundingBoxUpdate = false 
) const
inline

Apply a manipulator on the Meshbuffer.

Parameters
funcA functor defining the mesh manipulation.
bufferThe Meshbuffer to apply the manipulator to.
boundingBoxUpdateSpecifies if the bounding box should be updated during manipulation.
Returns
True if the functor was successfully applied, else false.

Definition at line 356 of file IMeshManipulator.h.

357  {
358  return apply_(func, buffer, boundingBoxUpdate, func);
359  }
bool apply_(const Functor &func, IMeshBuffer *buffer, bool boundingBoxUpdate, const IVertexManipulator &typeTest) const
Apply a manipulator based on the type of the functor.
GLenum func
GLuint buffer

◆ apply() [2/2]

template<typename Functor >
bool irr::scene::IMeshManipulator::apply ( const Functor &  func,
IMesh mesh,
bool  boundingBoxUpdate = false 
) const
inline

Apply a manipulator on the Mesh.

Parameters
funcA functor defining the mesh manipulation.
meshThe Mesh to apply the manipulator to.
boundingBoxUpdateSpecifies if the bounding box should be updated during manipulation.
Returns
True if the functor was successfully applied, else false.

Definition at line 368 of file IMeshManipulator.h.

369  {
370  if (!mesh)
371  return true;
372  bool result = true;
373  core::aabbox3df bufferbox;
374  for (u32 i=0; i<mesh->getMeshBufferCount(); ++i)
375  {
376  result &= apply(func, mesh->getMeshBuffer(i), boundingBoxUpdate);
377  if (boundingBoxUpdate)
378  {
379  if (0==i)
380  bufferbox.reset(mesh->getMeshBuffer(i)->getBoundingBox());
381  else
382  bufferbox.addInternalBox(mesh->getMeshBuffer(i)->getBoundingBox());
383  }
384  }
385  if (boundingBoxUpdate)
386  mesh->setBoundingBox(bufferbox);
387  return result;
388  }
GLuint64EXT * result
aabbox3d< f32 > aabbox3df
Typedef for a f32 3d bounding box.
Definition: aabbox3d.h:361
bool apply(const Functor &func, IMeshBuffer *buffer, bool boundingBoxUpdate=false) const
Apply a manipulator on the Meshbuffer.
unsigned int u32
32 bit unsigned variable.
Definition: irrTypes.h:62
GLenum func

◆ apply_()

template<typename Functor >
bool irr::scene::IMeshManipulator::apply_ ( const Functor &  func,
IMeshBuffer buffer,
bool  boundingBoxUpdate,
const IVertexManipulator typeTest 
) const
inlineprotected

Apply a manipulator based on the type of the functor.

Parameters
funcA functor defining the mesh manipulation.
bufferThe Meshbuffer to apply the manipulator to.
boundingBoxUpdateSpecifies if the bounding box should be updated during manipulation.
typeTestUnused parameter, which handles the proper call selection based on the type of the Functor which is passed in two times.
Returns
True if the functor was successfully applied, else false.

Definition at line 398 of file IMeshManipulator.h.

399  {
400  if (!buffer)
401  return true;
402 
403  core::aabbox3df bufferbox;
404  for (u32 i=0; i<buffer->getVertexCount(); ++i)
405  {
406  switch (buffer->getVertexType())
407  {
408  case video::EVT_STANDARD:
409  {
410  video::S3DVertex* verts = (video::S3DVertex*)buffer->getVertices();
411  func(verts[i]);
412  }
413  break;
414  case video::EVT_2TCOORDS:
415  {
416  video::S3DVertex2TCoords* verts = (video::S3DVertex2TCoords*)buffer->getVertices();
417  func(verts[i]);
418  }
419  break;
420  case video::EVT_TANGENTS:
421  {
422  video::S3DVertexTangents* verts = (video::S3DVertexTangents*)buffer->getVertices();
423  func(verts[i]);
424  }
425  break;
426  }
427  if (boundingBoxUpdate)
428  {
429  if (0==i)
430  bufferbox.reset(buffer->getPosition(0));
431  else
432  bufferbox.addInternalPoint(buffer->getPosition(i));
433  }
434  }
435  if (boundingBoxUpdate)
436  buffer->setBoundingBox(bufferbox);
437  return true;
438  }
Vertex with two texture coordinates, video::S3DVertex2TCoords.
Definition: S3DVertex.h:25
aabbox3d< f32 > aabbox3df
Typedef for a f32 3d bounding box.
Definition: aabbox3d.h:361
Vertex with a tangent and binormal vector, video::S3DVertexTangents.
Definition: S3DVertex.h:31
unsigned int u32
32 bit unsigned variable.
Definition: irrTypes.h:62
Standard vertex type used by the Irrlicht engine, video::S3DVertex.
Definition: S3DVertex.h:21
GLenum func
GLuint buffer

◆ createAnimatedMesh()

virtual IAnimatedMesh* irr::scene::IMeshManipulator::createAnimatedMesh ( IMesh mesh,
scene::E_ANIMATED_MESH_TYPE  type = scene::EAMT_UNKNOWN 
) const
pure virtual

Create a new AnimatedMesh and adds the mesh to it.

Parameters
meshInput mesh
typeThe type of the animated mesh to create.
Returns
Newly created animated mesh with mesh as its only content. When you don't need the animated mesh anymore, you should call IAnimatedMesh::drop(). See IReferenceCounted::drop() for more information.

◆ createForsythOptimizedMesh()

virtual IMesh* irr::scene::IMeshManipulator::createForsythOptimizedMesh ( const IMesh mesh) const
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).

Parameters
meshSource mesh for the operation.
Returns
A new mesh optimized for the vertex cache.

◆ createMeshCopy()

virtual SMesh* irr::scene::IMeshManipulator::createMeshCopy ( IMesh mesh) const
pure virtual

Clones a static IMesh into a modifiable SMesh.

All meshbuffers in the returned SMesh are of type SMeshBuffer or SMeshBufferLightMap.

Parameters
meshMesh to copy.
Returns
Cloned mesh. If you no longer need the cloned mesh, you should call SMesh::drop(). See IReferenceCounted::drop() for more information.

◆ createMeshUniquePrimitives()

virtual IMesh* irr::scene::IMeshManipulator::createMeshUniquePrimitives ( IMesh mesh) const
pure virtual

Creates a copy of a mesh with all vertices unwelded.

Parameters
meshInput mesh
Returns
Mesh consisting only of unique faces. All vertices which were previously shared are now duplicated. If you no longer need the cloned mesh, you should call IMesh::drop(). See IReferenceCounted::drop() for more information.

◆ createMeshWelded()

virtual IMesh* irr::scene::IMeshManipulator::createMeshWelded ( IMesh mesh,
f32  tolerance = core::ROUNDING_ERROR_f32 
) const
pure virtual

Creates a copy of a mesh with vertices welded.

Parameters
meshInput mesh
toleranceThe threshold for vertex comparisons.
Returns
Mesh without redundant vertices. If you no longer need the cloned mesh, you should call IMesh::drop(). See IReferenceCounted::drop() for more information.

◆ createMeshWith1TCoords()

virtual IMesh* irr::scene::IMeshManipulator::createMeshWith1TCoords ( IMesh mesh) const
pure virtual

Creates a copy of the mesh, which will only consist of S3DVertex vertices.

Parameters
meshInput mesh
Returns
Mesh consisting only of S3DVertex vertices. If you no longer need the cloned mesh, you should call IMesh::drop(). See IReferenceCounted::drop() for more information.

◆ createMeshWith2TCoords()

virtual IMesh* irr::scene::IMeshManipulator::createMeshWith2TCoords ( IMesh mesh) const
pure virtual

Creates a copy of the mesh, which will only consist of S3DVertex2TCoord vertices.

Parameters
meshInput mesh
Returns
Mesh consisting only of S3DVertex2TCoord vertices. If you no longer need the cloned mesh, you should call IMesh::drop(). See IReferenceCounted::drop() for more information.

◆ createMeshWithTangents()

virtual IMesh* irr::scene::IMeshManipulator::createMeshWithTangents ( IMesh mesh,
bool  recalculateNormals = false,
bool  smooth = false,
bool  angleWeighted = false,
bool  recalculateTangents = true 
) const
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.

Parameters
meshInput mesh
recalculateNormalsThe 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.
smoothThe normals/tangents are smoothed across the meshbuffer's faces if this flag is set.
angleWeightedImproved smoothing calculation used
recalculateTangentsWhether are actually calculated, or just the mesh with proper type is created.
Returns
Mesh consisting only of S3DVertexTangents vertices. If you no longer need the cloned mesh, you should call IMesh::drop(). See IReferenceCounted::drop() for more information.

◆ flipSurfaces()

virtual void irr::scene::IMeshManipulator::flipSurfaces ( IMesh mesh) const
pure virtual

Flips the direction of surfaces.

Changes backfacing triangles to frontfacing triangles and vice versa.

Parameters
meshMesh on which the operation is performed.

◆ getPolyCount() [1/2]

virtual s32 irr::scene::IMeshManipulator::getPolyCount ( IMesh mesh) const
pure virtual

Get amount of polygons in mesh.

Parameters
meshInput mesh
Returns
Number of polygons in mesh.

◆ getPolyCount() [2/2]

virtual s32 irr::scene::IMeshManipulator::getPolyCount ( IAnimatedMesh mesh) const
pure virtual

Get amount of polygons in mesh.

Parameters
meshInput mesh
Returns
Number of polygons in mesh.

◆ heightmapOptimizeMesh() [1/2]

virtual void irr::scene::IMeshManipulator::heightmapOptimizeMesh ( IMesh *const  mesh,
const f32  tolerance = core::ROUNDING_ERROR_f32 
) const
pure virtual

Optimize the mesh with an algorithm tuned for heightmaps.

This differs from usual simplification methods in two ways:

  • it's intended to be lossless
  • it has special care for the borders, which are useful with heightmap tiles

This function is thread-safe. Remember to weld afterwards - this function only moves vertices, it does not weld.

Parameters
meshMesh to operate on.

◆ heightmapOptimizeMesh() [2/2]

virtual void irr::scene::IMeshManipulator::heightmapOptimizeMesh ( IMeshBuffer *const  mb,
const f32  tolerance = core::ROUNDING_ERROR_f32 
) const
pure virtual

Optimize the meshbuffer with an algorithm tuned for heightmaps.

This differs from usual simplification methods in two ways:

  • it's intended to be lossless
  • it has special care for the borders, which are useful with heightmap tiles

This function is thread-safe. Remember to weld afterward - this function only moves vertices, it does not weld.

Parameters
mbMeshbuffer to operate on.

◆ makePlanarTextureMapping() [1/4]

virtual void irr::scene::IMeshManipulator::makePlanarTextureMapping ( IMesh mesh,
f32  resolution = 0.001f 
) const
pure virtual

Creates a planar texture mapping on the mesh.

Parameters
meshMesh on which the operation is performed.
resolutionresolution of the planar mapping. This is the value specifying which is the relation between world space and texture coordinate space.

◆ makePlanarTextureMapping() [2/4]

virtual void irr::scene::IMeshManipulator::makePlanarTextureMapping ( scene::IMeshBuffer meshbuffer,
f32  resolution = 0.001f 
) const
pure virtual

Creates a planar texture mapping on the meshbuffer.

Parameters
meshbufferBuffer on which the operation is performed.
resolutionresolution of the planar mapping. This is the value specifying which is the relation between world space and texture coordinate space.

◆ makePlanarTextureMapping() [3/4]

virtual void irr::scene::IMeshManipulator::makePlanarTextureMapping ( scene::IMesh mesh,
f32  resolutionS,
f32  resolutionT,
u8  axis,
const core::vector3df offset 
) const
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.

Parameters
meshMesh on which the operation is performed.
resolutionSResolution of the planar mapping in horizontal direction. This is the ratio between object space and texture space.
resolutionTResolution of the planar mapping in vertical direction. This is the ratio between object space and texture space.
axisThe axis along which the texture is projected. The allowed values are 0 (X), 1(Y), and 2(Z).
offsetVector added to the vertex positions (in object coordinates).

◆ makePlanarTextureMapping() [4/4]

virtual void irr::scene::IMeshManipulator::makePlanarTextureMapping ( scene::IMeshBuffer buffer,
f32  resolutionS,
f32  resolutionT,
u8  axis,
const core::vector3df offset 
) const
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.

Parameters
bufferBuffer on which the operation is performed.
resolutionSResolution of the planar mapping in horizontal direction. This is the ratio between object space and texture space.
resolutionTResolution of the planar mapping in vertical direction. This is the ratio between object space and texture space.
axisThe axis along which the texture is projected. The allowed values are 0 (X), 1(Y), and 2(Z).
offsetVector added to the vertex positions (in object coordinates).

◆ recalculateNormals() [1/2]

virtual void irr::scene::IMeshManipulator::recalculateNormals ( IMesh mesh,
bool  smooth = false,
bool  angleWeighted = false 
) const
pure virtual

Recalculates all normals of the mesh.

Parameters
meshMesh on which the operation is performed.
smoothIf the normals shall be smoothed.
angleWeightedIf the normals shall be smoothed in relation to their angles. More expensive, but also higher precision.

◆ recalculateNormals() [2/2]

virtual void irr::scene::IMeshManipulator::recalculateNormals ( IMeshBuffer buffer,
bool  smooth = false,
bool  angleWeighted = false 
) const
pure virtual

Recalculates all normals of the mesh buffer.

Parameters
bufferMesh buffer on which the operation is performed.
smoothIf the normals shall be smoothed.
angleWeightedIf the normals shall be smoothed in relation to their angles. More expensive, but also higher precision.

◆ recalculateTangents() [1/2]

virtual void irr::scene::IMeshManipulator::recalculateTangents ( IMesh mesh,
bool  recalculateNormals = false,
bool  smooth = false,
bool  angleWeighted = false 
) const
pure virtual

Recalculates tangents, requires a tangent mesh.

Parameters
meshMesh on which the operation is performed.
recalculateNormalsIf the normals shall be recalculated, otherwise original normals of the mesh are used unchanged.
smoothIf the normals shall be smoothed.
angleWeightedIf the normals shall be smoothed in relation to their angles. More expensive, but also higher precision.

◆ recalculateTangents() [2/2]

virtual void irr::scene::IMeshManipulator::recalculateTangents ( IMeshBuffer buffer,
bool  recalculateNormals = false,
bool  smooth = false,
bool  angleWeighted = false 
) const
pure virtual

Recalculates tangents, requires a tangent mesh buffer.

Parameters
bufferMeshbuffer on which the operation is performed.
recalculateNormalsIf the normals shall be recalculated, otherwise original normals of the buffer are used unchanged.
smoothIf the normals shall be smoothed.
angleWeightedIf the normals shall be smoothed in relation to their angles. More expensive, but also higher precision.

◆ scale() [1/2]

void irr::scene::IMeshManipulator::scale ( IMesh mesh,
const core::vector3df factor 
) const
inline

Scales the actual mesh, not a scene node.

Parameters
meshMesh on which the operation is performed.
factorScale factor for each axis.

Definition at line 108 of file IMeshManipulator.h.

109  {
110  apply(SVertexPositionScaleManipulator(factor), mesh, true);
111  }
bool apply(const Functor &func, IMeshBuffer *buffer, bool boundingBoxUpdate=false) const
Apply a manipulator on the Meshbuffer.

◆ scale() [2/2]

void irr::scene::IMeshManipulator::scale ( IMeshBuffer buffer,
const core::vector3df factor 
) const
inline

Scales the actual meshbuffer, not a scene node.

Parameters
bufferMeshbuffer on which the operation is performed.
factorScale factor for each axis.

Definition at line 116 of file IMeshManipulator.h.

117  {
118  apply(SVertexPositionScaleManipulator(factor), buffer, true);
119  }
bool apply(const Functor &func, IMeshBuffer *buffer, bool boundingBoxUpdate=false) const
Apply a manipulator on the Meshbuffer.
GLuint buffer

◆ scaleMesh()

_IRR_DEPRECATED_ void irr::scene::IMeshManipulator::scaleMesh ( IMesh mesh,
const core::vector3df factor 
) const
inline

Scales the actual mesh, not a scene node.

Deprecated:
Use scale() instead. This method may be removed by Irrlicht 1.9
Parameters
meshMesh on which the operation is performed.
factorScale factor for each axis.

Definition at line 125 of file IMeshManipulator.h.

125 {return scale(mesh,factor);}
void scale(IMesh *mesh, const core::vector3df &factor) const
Scales the actual mesh, not a scene node.

◆ scaleTCoords() [1/2]

void irr::scene::IMeshManipulator::scaleTCoords ( scene::IMesh mesh,
const core::vector2df factor,
u32  level = 1 
) const
inline

Scale the texture coords of a mesh.

Parameters
meshMesh on which the operation is performed.
factorVector which defines the scale for each axis.
levelNumber of texture coord, starting from 1. Support for level 2 exists for LightMap buffers.

Definition at line 131 of file IMeshManipulator.h.

132  {
133  apply(SVertexTCoordsScaleManipulator(factor, level), mesh);
134  }
GLint level
Definition: SDL_opengl.h:1572
bool apply(const Functor &func, IMeshBuffer *buffer, bool boundingBoxUpdate=false) const
Apply a manipulator on the Meshbuffer.

◆ scaleTCoords() [2/2]

void irr::scene::IMeshManipulator::scaleTCoords ( scene::IMeshBuffer buffer,
const core::vector2df factor,
u32  level = 1 
) const
inline

Scale the texture coords of a meshbuffer.

Parameters
bufferMeshbuffer on which the operation is performed.
factorVector which defines the scale for each axis.
levelNumber of texture coord, starting from 1. Support for level 2 exists for LightMap buffers.

Definition at line 140 of file IMeshManipulator.h.

141  {
142  apply(SVertexTCoordsScaleManipulator(factor, level), buffer);
143  }
GLint level
Definition: SDL_opengl.h:1572
bool apply(const Functor &func, IMeshBuffer *buffer, bool boundingBoxUpdate=false) const
Apply a manipulator on the Meshbuffer.
GLuint buffer

◆ setVertexColorAlpha() [1/2]

void irr::scene::IMeshManipulator::setVertexColorAlpha ( IMesh mesh,
s32  alpha 
) const
inline

Sets the alpha vertex color value of the whole mesh to a new value.

Parameters
meshMesh on which the operation is performed.
alphaNew alpha value. Must be a value between 0 and 255.

Definition at line 42 of file IMeshManipulator.h.

43  {
44  apply(scene::SVertexColorSetAlphaManipulator(alpha), mesh);
45  }
GLfloat GLfloat GLfloat alpha
bool apply(const Functor &func, IMeshBuffer *buffer, bool boundingBoxUpdate=false) const
Apply a manipulator on the Meshbuffer.

◆ setVertexColorAlpha() [2/2]

void irr::scene::IMeshManipulator::setVertexColorAlpha ( IMeshBuffer buffer,
s32  alpha 
) const
inline

Sets the alpha vertex color value of the whole mesh to a new value.

Parameters
bufferMeshbuffer on which the operation is performed.
alphaNew alpha value. Must be a value between 0 and 255.

Definition at line 50 of file IMeshManipulator.h.

51  {
52  apply(scene::SVertexColorSetAlphaManipulator(alpha), buffer);
53  }
GLfloat GLfloat GLfloat alpha
bool apply(const Functor &func, IMeshBuffer *buffer, bool boundingBoxUpdate=false) const
Apply a manipulator on the Meshbuffer.
GLuint buffer

◆ setVertexColors() [1/2]

void irr::scene::IMeshManipulator::setVertexColors ( IMesh mesh,
video::SColor  color 
) const
inline

Sets the colors of all vertices to one color.

Parameters
meshMesh on which the operation is performed.
colorNew color.

Definition at line 58 of file IMeshManipulator.h.

59  {
60  apply(scene::SVertexColorSetManipulator(color), mesh);
61  }
bool apply(const Functor &func, IMeshBuffer *buffer, bool boundingBoxUpdate=false) const
Apply a manipulator on the Meshbuffer.
GLuint color

◆ setVertexColors() [2/2]

void irr::scene::IMeshManipulator::setVertexColors ( IMeshBuffer buffer,
video::SColor  color 
) const
inline

Sets the colors of all vertices to one color.

Parameters
bufferMeshbuffer on which the operation is performed.
colorNew color.

Definition at line 66 of file IMeshManipulator.h.

67  {
68  apply(scene::SVertexColorSetManipulator(color), buffer);
69  }
bool apply(const Functor &func, IMeshBuffer *buffer, bool boundingBoxUpdate=false) const
Apply a manipulator on the Meshbuffer.
GLuint color
GLuint buffer

◆ transform() [1/2]

void irr::scene::IMeshManipulator::transform ( IMesh mesh,
const core::matrix4 m,
u32  normalsUpdate = 0 
) const
inline

Applies a transformation to a mesh.

Parameters
meshMesh on which the operation is performed.
mtransformation matrix.
normalsUpdateWhen 0 - don't update normals. When 1 - update normals with inverse transposed of the transformation matrix

Definition at line 151 of file IMeshManipulator.h.

152  {
153  apply(SVertexPositionTransformManipulator(m), mesh, true);
154 
155  if ( normalsUpdate == 1 )
156  {
157  core::matrix4 invT;
158  if ( m.getInverse(invT) )
159  {
160  invT = invT.getTransposed();
161  apply(SVertexNormalTransformManipulator(invT), mesh, false);
162  }
163  }
164  }
const GLfloat * m
bool apply(const Functor &func, IMeshBuffer *buffer, bool boundingBoxUpdate=false) const
Apply a manipulator on the Meshbuffer.
CMatrix4< f32 > matrix4
Typedef for f32 matrix.
Definition: matrix4.h:2377

◆ transform() [2/2]

void irr::scene::IMeshManipulator::transform ( IMeshBuffer buffer,
const core::matrix4 m,
u32  normalsUpdate = 0 
) const
inline

Applies a transformation to a meshbuffer.

Parameters
bufferMeshbuffer on which the operation is performed.
mtransformation matrix.
normalsUpdateWhen 0 - don't update normals. When 1 - update normals with inverse transposed of the transformation matrix

Definition at line 172 of file IMeshManipulator.h.

173  {
174  apply(SVertexPositionTransformManipulator(m), buffer, true);
175 
176  if ( normalsUpdate == 1 )
177  {
178  core::matrix4 invT;
179  if ( m.getInverse(invT) )
180  {
181  invT = invT.getTransposed();
182  apply(SVertexNormalTransformManipulator(invT), buffer, false);
183  }
184  }
185  }
const GLfloat * m
bool apply(const Functor &func, IMeshBuffer *buffer, bool boundingBoxUpdate=false) const
Apply a manipulator on the Meshbuffer.
GLuint buffer
CMatrix4< f32 > matrix4
Typedef for f32 matrix.
Definition: matrix4.h:2377

◆ transformMesh()

virtual _IRR_DEPRECATED_ void irr::scene::IMeshManipulator::transformMesh ( IMesh mesh,
const core::matrix4 m 
) const
inlinevirtual

Applies a transformation to a mesh.

Deprecated:
Use transform() instead. This method may be removed by Irrlicht 1.9
Parameters
meshMesh on which the operation is performed.
mtransformation matrix.

Definition at line 191 of file IMeshManipulator.h.

191 {return transform(mesh,m);}
const GLfloat * m
void transform(IMesh *mesh, const core::matrix4 &m, u32 normalsUpdate=0) const
Applies a transformation to a mesh.

The documentation for this class was generated from the following file: