aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/src/others/irrlicht-1.8.1/source/Irrlicht/CMeshManipulator.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/others/irrlicht-1.8.1/source/Irrlicht/CMeshManipulator.h')
-rw-r--r--src/others/irrlicht-1.8.1/source/Irrlicht/CMeshManipulator.h95
1 files changed, 95 insertions, 0 deletions
diff --git a/src/others/irrlicht-1.8.1/source/Irrlicht/CMeshManipulator.h b/src/others/irrlicht-1.8.1/source/Irrlicht/CMeshManipulator.h
new file mode 100644
index 0000000..c8029be
--- /dev/null
+++ b/src/others/irrlicht-1.8.1/source/Irrlicht/CMeshManipulator.h
@@ -0,0 +1,95 @@
1// Copyright (C) 2002-2012 Nikolaus Gebhardt
2// This file is part of the "Irrlicht Engine".
3// For conditions of distribution and use, see copyright notice in irrlicht.h
4
5#ifndef __C_MESH_MANIPULATOR_H_INCLUDED__
6#define __C_MESH_MANIPULATOR_H_INCLUDED__
7
8#include "IMeshManipulator.h"
9
10namespace irr
11{
12namespace scene
13{
14
15//! An interface for easy manipulation of meshes.
16/** Scale, set alpha value, flip surfaces, and so on. This exists for fixing
17problems with wrong imported or exported meshes quickly after loading. It is
18not intended for doing mesh modifications and/or animations during runtime.
19*/
20class CMeshManipulator : public IMeshManipulator
21{
22public:
23 //! Flips the direction of surfaces.
24 /** Changes backfacing triangles to frontfacing triangles and vice versa.
25 \param mesh: Mesh on which the operation is performed. */
26 virtual void flipSurfaces(scene::IMesh* mesh) const;
27
28 //! Recalculates all normals of the mesh.
29 /** \param mesh: Mesh on which the operation is performed.
30 \param smooth: Whether to use smoothed normals. */
31 virtual void recalculateNormals(scene::IMesh* mesh, bool smooth = false, bool angleWeighted = false) const;
32
33 //! Recalculates all normals of the mesh buffer.
34 /** \param buffer: Mesh buffer on which the operation is performed.
35 \param smooth: Whether to use smoothed normals. */
36 virtual void recalculateNormals(IMeshBuffer* buffer, bool smooth = false, bool angleWeighted = false) const;
37
38 //! Clones a static IMesh into a modifiable SMesh.
39 virtual SMesh* createMeshCopy(scene::IMesh* mesh) const;
40
41 //! Creates a planar texture mapping on the mesh
42 /** \param mesh: Mesh on which the operation is performed.
43 \param resolution: resolution of the planar mapping. This is the value
44 specifying which is the relation between world space and
45 texture coordinate space. */
46 virtual void makePlanarTextureMapping(scene::IMesh* mesh, f32 resolution=0.001f) const;
47
48 //! Creates a planar texture mapping on the meshbuffer
49 virtual void makePlanarTextureMapping(scene::IMeshBuffer* meshbuffer, f32 resolution=0.001f) const;
50
51 //! Creates a planar texture mapping on the meshbuffer
52 void makePlanarTextureMapping(scene::IMeshBuffer* buffer, f32 resolutionS, f32 resolutionT, u8 axis, const core::vector3df& offset) const;
53
54 //! Creates a planar texture mapping on the mesh
55 void makePlanarTextureMapping(scene::IMesh* mesh, f32 resolutionS, f32 resolutionT, u8 axis, const core::vector3df& offset) const;
56
57 //! Recalculates tangents, requires a tangent mesh buffer
58 virtual void recalculateTangents(IMeshBuffer* buffer, bool recalculateNormals=false, bool smooth=false, bool angleWeighted=false) const;
59
60 //! Recalculates tangents, requires a tangent mesh
61 virtual void recalculateTangents(IMesh* mesh, bool recalculateNormals=false, bool smooth=false, bool angleWeighted=false) const;
62
63 //! Creates a copy of the mesh, which will only consist of S3DVertexTangents vertices.
64 virtual IMesh* createMeshWithTangents(IMesh* mesh, bool recalculateNormals=false, bool smooth=false, bool angleWeighted=false, bool recalculateTangents=true) const;
65
66 //! Creates a copy of the mesh, which will only consist of S3D2TCoords vertices.
67 virtual IMesh* createMeshWith2TCoords(IMesh* mesh) const;
68
69 //! Creates a copy of the mesh, which will only consist of S3DVertex vertices.
70 virtual IMesh* createMeshWith1TCoords(IMesh* mesh) const;
71
72 //! Creates a copy of the mesh, which will only consist of unique triangles, i.e. no vertices are shared.
73 virtual IMesh* createMeshUniquePrimitives(IMesh* mesh) const;
74
75 //! Creates a copy of the mesh, which will have all duplicated vertices removed, i.e. maximal amount of vertices are shared via indexing.
76 virtual IMesh* createMeshWelded(IMesh *mesh, f32 tolerance=core::ROUNDING_ERROR_f32) const;
77
78 //! Returns amount of polygons in mesh.
79 virtual s32 getPolyCount(scene::IMesh* mesh) const;
80
81 //! Returns amount of polygons in mesh.
82 virtual s32 getPolyCount(scene::IAnimatedMesh* mesh) const;
83
84 //! create a new AnimatedMesh and adds the mesh to it
85 virtual IAnimatedMesh * createAnimatedMesh(scene::IMesh* mesh,scene::E_ANIMATED_MESH_TYPE type) const;
86
87 //! create a mesh optimized for the vertex cache
88 virtual IMesh* createForsythOptimizedMesh(const scene::IMesh *mesh) const;
89};
90
91} // end namespace scene
92} // end namespace irr
93
94
95#endif