Home | Namespaces | Hierarchy | Alphabetical List | Class list | Files | Namespace Members | Class members | File members

irr::scene::IMeshManipulator Class Reference

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

#include <IMeshManipulator.h>

Inheritance diagram for irr::scene::IMeshManipulator:

irr::IReferenceCounted List of all members.

Public Member Functions

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.
virtual SMeshcreateMeshCopy (IMesh *mesh) const =0
 Clones a static IMesh into a modifiable SMesh.
virtual IMeshcreateMeshUniquePrimitives (IMesh *mesh) const =0
 Creates a copy of a mesh with all vertices unwelded.
virtual IMeshcreateMeshWelded (IMesh *mesh, f32 tolerance=core::ROUNDING_ERROR_32) const =0
 Creates a copy of a mesh with vertices welded.
virtual IMeshcreateMeshWith2TCoords (IMesh *mesh) const =0
 Creates a copy of the mesh, which will only consist of S3DVertex2TCoord vertices.
virtual IMeshcreateMeshWithTangents (IMesh *mesh) const =0
 Creates a copy of the mesh, which will only consist of S3DVertexTangents vertices.
virtual void flipSurfaces (IMesh *mesh) const =0
 Flips the direction of surfaces.
virtual s32 getPolyCount (IAnimatedMesh *mesh) const =0
 Get amount of polygons in mesh.
virtual s32 getPolyCount (IMesh *mesh) const =0
 Get amount of polygons in mesh.
virtual void makePlanarTextureMapping (IMesh *mesh, f32 resolution=0.001f) const =0
 Creates a planar texture mapping on the mesh.
virtual void recalculateNormals (IMeshBuffer *buffer, bool smooth=false) const =0
 Recalculates all normals of the mesh buffer.
virtual void recalculateNormals (IMesh *mesh, bool smooth=false) const =0
 Recalculates all normals of the mesh.
virtual void scaleMesh (IMesh *mesh, const core::vector3df &scale) const =0
 Scales the whole mesh.
virtual void setVertexColorAlpha (IMesh *mesh, s32 alpha) const =0
 Sets the alpha vertex color value of the whole mesh to a new value.
virtual void setVertexColors (IMesh *mesh, video::SColor color) const =0
 Sets the colors of all vertices to one color.
virtual void transformMesh (IMesh *mesh, const core::matrix4 &m) const =0
 Applies a transformation.
virtual ~IMeshManipulator ()
 Destructor.

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 30 of file IMeshManipulator.h.


Constructor & Destructor Documentation

virtual irr::scene::IMeshManipulator::~IMeshManipulator  )  [inline, virtual]
 

Destructor.

Definition at line 35 of file IMeshManipulator.h.


Member Function Documentation

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:
mesh Input mesh
type The type of the animated mesh to create.
Returns:
Newly created animated mesh with mesh as it's only content. When you don't need the animated mesh anymore, you should call IAnimatedMesh::drop(). See IReferenceCounted::drop() for more information.

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:
mesh,: Mesh to copy.
Returns:
Returns the cloned mesh. If you no longer need the cloned mesh, you should call SMesh::drop(). See IReferenceCounted::drop() for more information.

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

Creates a copy of a mesh with all vertices unwelded.

Parameters:
mesh Input 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.

virtual IMesh* irr::scene::IMeshManipulator::createMeshWelded IMesh mesh,
f32  tolerance = core::ROUNDING_ERROR_32
const [pure virtual]
 

Creates a copy of a mesh with vertices welded.

Parameters:
mesh Input mesh
tolerance The 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.

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:
mesh Input 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.

virtual IMesh* irr::scene::IMeshManipulator::createMeshWithTangents IMesh mesh  )  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:
mesh Input mesh
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.

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:
mesh Mesh on which the operation is performed.

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

Get amount of polygons in mesh.

Parameters:
mesh Input mesh
Returns:
Number of polygons in mesh.

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

Get amount of polygons in mesh.

Parameters:
mesh Input mesh
Returns:
Number of polygons in mesh.

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

Creates a planar texture mapping on the mesh.

Parameters:
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.

virtual void irr::scene::IMeshManipulator::recalculateNormals IMeshBuffer buffer,
bool  smooth = false
const [pure virtual]
 

Recalculates all normals of the mesh buffer.

Parameters:
buffer,: Mesh buffer on which the operation is performed.
smooth,: If the normals shall be smoothed.

virtual void irr::scene::IMeshManipulator::recalculateNormals IMesh mesh,
bool  smooth = false
const [pure virtual]
 

Recalculates all normals of the mesh.

Parameters:
mesh,: Mesh on which the operation is performed.
smooth,: If the normals shall be smoothed.

virtual void irr::scene::IMeshManipulator::scaleMesh IMesh mesh,
const core::vector3df scale
const [pure virtual]
 

Scales the whole mesh.

Parameters:
mesh,: Mesh on which the operation is performed.
scale,: Scale factor.

virtual void irr::scene::IMeshManipulator::setVertexColorAlpha IMesh mesh,
s32  alpha
const [pure virtual]
 

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

Parameters:
mesh Mesh on which the operation is performed.
alpha New alpha value. Must be a value between 0 and 255.

virtual void irr::scene::IMeshManipulator::setVertexColors IMesh mesh,
video::SColor  color
const [pure virtual]
 

Sets the colors of all vertices to one color.

Parameters:
mesh Mesh on which the operation is performed.
color New color.

virtual void irr::scene::IMeshManipulator::transformMesh IMesh mesh,
const core::matrix4 m
const [pure virtual]
 

Applies a transformation.

Parameters:
mesh,: Mesh on which the operation is performed.
m,: transformation matrix.


The documentation for this class was generated from the following file:
The Irrlicht Engine
The Irrlicht Engine Documentation © 2003-2008 by Nikolaus Gebhardt. Generated on Sun Jun 1 07:59:18 2008 by Doxygen (1.4.2)