]> git.lizzy.rs Git - irrlicht.git/blob - include/SVertexManipulator.h
Merge branch 'master' into opengl3
[irrlicht.git] / include / SVertexManipulator.h
1 // Copyright (C) 2009-2012 Christian Stehno\r
2 // This file is part of the "Irrlicht Engine".\r
3 // For conditions of distribution and use, see copyright notice in irrlicht.h\r
4 \r
5 #ifndef __S_VERTEX_MANIPULATOR_H_INCLUDED__\r
6 #define __S_VERTEX_MANIPULATOR_H_INCLUDED__\r
7 \r
8 #include "matrix4.h"\r
9 #include "S3DVertex.h"\r
10 #include "SColor.h"\r
11 \r
12 namespace irr\r
13 {\r
14 namespace scene\r
15 {\r
16 \r
17         class IMesh;\r
18         class IMeshBuffer;\r
19         struct SMesh;\r
20 \r
21         //! Interface for vertex manipulators.\r
22         /** You should derive your manipulator from this class if it shall be called for every vertex, getting as parameter just the vertex.\r
23         */\r
24         struct IVertexManipulator\r
25         {\r
26         };\r
27 \r
28         //! Vertex manipulator which scales the position of the vertex\r
29         class SVertexPositionScaleManipulator : public IVertexManipulator\r
30         {\r
31         public:\r
32                 SVertexPositionScaleManipulator(const core::vector3df& factor) : Factor(factor) {}\r
33                 template <typename VType>\r
34                 void operator()(VType& vertex) const\r
35                 {\r
36                         vertex.Pos *= Factor;\r
37                 }\r
38         private:\r
39                 core::vector3df Factor;\r
40         };\r
41 \r
42 } // end namespace scene\r
43 } // end namespace irr\r
44 \r
45 \r
46 #endif\r