Skylicht Engine
Loading...
Searching...
No Matches
irr::scene::IMeshManipulator Class Referenceabstract

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

#include <C:/Projects/skylicht-engine/Projects/Irrlicht/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.
virtual void setVertexColorAlpha (IMeshBuffer *meshBuffer, s32 alpha) const =0
 Sets the alpha vertex color value of the whole mesh to a new value.
void setVertexColorAlpha (IMesh *mesh, s32 alpha) const
 Sets the alpha vertex color value of the whole mesh to a new value.
virtual void setVertexColors (IMeshBuffer *meshBuffer, video::SColor color) const =0
 Sets the colors of all vertices to one color.
void setVertexColors (IMesh *mesh, video::SColor color) const
 Sets the colors of all vertices to one color.
virtual void scale (IMeshBuffer *meshBuffer, const core::vector3df &factor) const =0
 Scales the actual meshbuffer, not a scene node.
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.
virtual void scaleTCoords (IMeshBuffer *meshBuffer, const core::vector2df &factor, u32 level=0) const =0
 Scale the texture coords of a meshbuffer.
void scaleTCoords (scene::IMesh *mesh, const core::vector2df &factor, u32 level=0) const
 Scale the texture coords of a mesh.
virtual void transform (IMeshBuffer *meshBuffer, const core::matrix4 &mat) const =0
 Applies a transformation to a meshbuffer.
void transform (IMesh *mesh, const core::matrix4 &m) const
 Applies a transformation to a mesh.
virtual _IRR_DEPRECATED_ void transformMesh (IMesh *mesh, const core::matrix4 &m) const
 Applies a transformation to a mesh.
virtual void recalculateNormals (IMeshBuffer *meshBuffer, bool smooth=false, bool angleWeighted=false) const =0
 Recalculates all normals of the mesh buffer.
void recalculateNormals (IMesh *mesh, bool smooth=false, bool angleWeighted=false) const
 Recalculates all normals of the mesh.
virtual void recalculateTangents (IMeshBuffer *meshBuffer, bool recalculateNormals=false, bool smooth=false, bool angleWeighted=false) const =0
void recalculateTangents (IMesh *mesh, bool recNormals=false, bool smooth=false, bool angleWeighted=false) const
virtual void makePlanarTextureMapping (IMeshBuffer *meshBuffer, f32 resolution=0.001f) const =0
 Creates a planar texture mapping on the meshbuffer.
void makePlanarTextureMapping (IMesh *mesh, f32 resolution=0.001f) const
 Creates a planar texture mapping on the mesh.
virtual void makePlanarTextureMapping (IMeshBuffer *meshBuffer, f32 resolutionS, f32 resolutionT, u8 axis, const core::vector3df &offset) const =0
 Creates a planar texture mapping on the meshbuffer.
void makePlanarTextureMapping (scene::IMesh *mesh, f32 resolutionS, f32 resolutionT, u8 axis, const core::vector3df &offset) const
 Creates a planar texture mapping on the buffer.
virtual bool copyIndices (IIndexBuffer *srcBuffer, IIndexBuffer *dstBuffer) const =0
virtual bool copyVertices (IVertexBuffer *srcBuffer, u32 srcDescriptionBufferID, video::IVertexDescriptor *srcDescriptor, IVertexBuffer *dstBuffer, u32 dstDescriptionBufferID, video::IVertexDescriptor *dstDescriptor, bool copyCustomAttribute) const =0
virtual bool createTangents (IMeshBuffer *srcBuffer, IMeshBuffer *dstBuffer, bool copyCustomAttribute, bool recalculateNormals=false, bool smooth=false, bool angleWeighted=false)=0
virtual bool createUniquePrimitives (IMeshBuffer *srcBuffer, IMeshBuffer *dstBuffer) const =0
virtual bool createWelded (IMeshBuffer *srcBuffer, IMeshBuffer *dstBuffer, f32 tolerance=core::ROUNDING_ERROR_f32, bool check4Component=true, bool check3Component=true, bool check2Component=true, bool check1Component=true) const =0
template<class T>
bool convertVertices (IMeshBuffer *buffer, video::IVertexDescriptor *descriptor, bool copyCustomAttribute=false)
template<class T>
bool createTangents (IMeshBuffer *buffer, video::IVertexDescriptor *descriptor, bool copyCustomAttribute=false)
template<class T>
SMeshcreateMeshCopy (IMesh *mesh, video::IVertexDescriptor *descriptor, bool copyCustomAttribute=false)
virtual s32 getPolyCount (IMesh *mesh) const =0
 Get amount of polygons in mesh.
virtual IMesh * createForsythOptimizedMesh (const IMesh *mesh) const =0
 Vertex cache optimization according to the Forsyth paper.
Public Member Functions inherited from irr::IReferenceCounted
 IReferenceCounted ()
 Constructor.
virtual ~IReferenceCounted ()
 Destructor.
void grab () const
 Grabs the object. Increments the reference counter by one.
bool drop () const
 Drops the object. Decrements the reference counter by one.
s32 getReferenceCount () const
 Get the reference count.
const c8getDebugName () const
 Returns the debug name of the object.

Additional Inherited Members

Protected Member Functions inherited from irr::IReferenceCounted
void setDebugName (const c8 *newName)
 Sets the debug name of the object.

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.

Member Function Documentation

◆ 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.

◆ 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()

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.

◆ makePlanarTextureMapping() [1/4]

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

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 ( 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 ( IMeshBuffer * meshBuffer,
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).

◆ makePlanarTextureMapping() [4/4]

void irr::scene::IMeshManipulator::makePlanarTextureMapping ( scene::IMesh * mesh,
f32 resolutionS,
f32 resolutionT,
u8 axis,
const core::vector3df & offset ) const
inline

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).

◆ recalculateNormals() [1/2]

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

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 * meshBuffer,
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.

◆ 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.

◆ scale() [2/2]

virtual void irr::scene::IMeshManipulator::scale ( IMeshBuffer * meshBuffer,
const core::vector3df & factor ) const
pure virtual

Scales the actual meshbuffer, not a scene node.

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

◆ 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.

◆ scaleTCoords() [1/2]

virtual void irr::scene::IMeshManipulator::scaleTCoords ( IMeshBuffer * meshBuffer,
const core::vector2df & factor,
u32 level = 0 ) const
pure virtual

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.

◆ scaleTCoords() [2/2]

void irr::scene::IMeshManipulator::scaleTCoords ( scene::IMesh * mesh,
const core::vector2df & factor,
u32 level = 0 ) 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.

◆ 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.

◆ setVertexColorAlpha() [2/2]

virtual void irr::scene::IMeshManipulator::setVertexColorAlpha ( IMeshBuffer * meshBuffer,
s32 alpha ) const
pure virtual

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.

◆ 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.

◆ setVertexColors() [2/2]

virtual void irr::scene::IMeshManipulator::setVertexColors ( IMeshBuffer * meshBuffer,
video::SColor color ) const
pure virtual

Sets the colors of all vertices to one color.

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

◆ transform() [1/2]

void irr::scene::IMeshManipulator::transform ( IMesh * mesh,
const core::matrix4 & m ) const
inline

Applies a transformation to a mesh.

Parameters
meshMesh on which the operation is performed.
mtransformation matrix.

◆ transform() [2/2]

virtual void irr::scene::IMeshManipulator::transform ( IMeshBuffer * meshBuffer,
const core::matrix4 & mat ) const
pure virtual

Applies a transformation to a meshbuffer.

Parameters
bufferMeshbuffer on which the operation is performed.
mtransformation matrix.

◆ 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.

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