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