Neo  0.5.0
Developer Documentation
MorphingData.h
Go to the documentation of this file.
1 //========================================================================
2 // Copyright (c) 2003-2011 Anael Seghezzi <www.maratis3d.com>
3 //
4 // This software is provided 'as-is', without any express or implied
5 // warranty. In no event will the authors be held liable for any damages
6 // arising from the use of this software.
7 //
8 // Permission is granted to anyone to use this software for any purpose,
9 // including commercial applications, and to alter it and redistribute it
10 // freely, subject to the following restrictions:
11 //
12 // 1. The origin of this software must not be misrepresented; you must not
13 // claim that you wrote the original software. If you use this software
14 // in a product, an acknowledgment in the product documentation would
15 // be appreciated but is not required.
16 //
17 // 2. Altered source versions must be plainly marked as such, and must not
18 // be misrepresented as being the original software.
19 //
20 // 3. This notice may not be removed or altered from any source
21 // distribution.
22 //
23 //========================================================================
24 
25 
26 #ifndef __MORPHING_DATA_H
27 #define __MORPHING_DATA_H
28 
29 namespace Neo
30 {
31 // Buffer
32 class NEO_ENGINE_EXPORT MorphingPoint
33 {
34 public:
35 
36  MorphingPoint(void);
37  ~MorphingPoint(void);
38 
39 private:
40 
41  // vertex id
42  unsigned int m_vertexId;
43 
44  // dif vector
45  Vector3 m_difVector;
46 
47 public:
48 
49  // get vertex id
50  inline unsigned int getVertexId(void){ return m_vertexId; }
51 };
52 
53 
54 // Pose
55 class NEO_ENGINE_EXPORT MorphingPose
56 {
57 public:
58 
59  MorphingPose(void);
60  ~MorphingPose(void);
61 
62 private:
63 
64  // factor
65  float m_factor;
66 
67  // points
68  unsigned int m_pointsNumber;
69  MorphingPoint * m_points;
70 
71 public:
72 
73  // points
74  void clearPoints(void);
75  MorphingPoint * allocPoints(unsigned int size);
76  inline unsigned int getPointsNumber(void){ return m_pointsNumber; }
77  inline MorphingPoint * getPoint(unsigned int id){ return &m_points[id]; }
78 };
79 
80 
81 // Morphing Data
82 class NEO_ENGINE_EXPORT MorphingData
83 {
84 public:
85 
86  MorphingData(void);
87  ~MorphingData(void);
88 
89 private:
90 
91  unsigned int m_posesNumber;
92  MorphingPose ** m_poses;
93 
94 public:
95 
96  void allocPoses(unsigned int size);
97  void clearPoses(void);
98  void addPose(MorphingPose * pose);
99  inline unsigned int getPosesNumber(void){ return m_posesNumber; }
100  inline MorphingPose * getPose(unsigned int id){ return m_poses[id]; }
101 };
102 }
103 
104 #endif
Definition: Vector3.h:31
Definition: MorphingData.h:82
MorphingPoint * getPoint(unsigned int id)
Definition: MorphingData.h:77
Definition: MorphingData.h:55
unsigned int getVertexId(void)
Definition: MorphingData.h:50
unsigned int getPosesNumber(void)
Definition: MorphingData.h:99
unsigned int getPointsNumber(void)
Definition: MorphingData.h:76
MorphingPose * getPose(unsigned int id)
Definition: MorphingData.h:100
Definition: Color.h:29
Definition: MorphingData.h:32