Neo  0.5.0
Developer Documentation
SkinData.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 __SKIN_DATA_H
27 #define __SKIN_DATA_H
28 
29 namespace Neo
30 {
31 // Skin Point
32 class NEO_ENGINE_EXPORT SkinPoint
33 {
34 public:
35 
36  SkinPoint(void);
37  ~SkinPoint(void);
38 
39 private:
40 
41  // bones
42  unsigned int m_bonesNumber;
43  unsigned short * m_bonesIds;
44  float * m_bonesWeights;
45 
46  // vertex id
47  unsigned int m_vertexId;
48 
49 public:
50 
51  // bones
52  void clearBonesLinks(void);
53  bool allocateBonesLinks(unsigned int size);
54 
55  inline unsigned int getBonesNumber(void){ return m_bonesNumber; }
56  inline unsigned short * getBonesIds(void){ return m_bonesIds; }
57  inline float * getBonesWeights(void){ return m_bonesWeights; }
58 
59  // vertex id
60  inline void setVertexId(unsigned int vertexId){ m_vertexId = vertexId; }
61  inline unsigned int getVertexId(void){ return m_vertexId; }
62 };
63 
64 
65 // Skin Data
66 class NEO_ENGINE_EXPORT SkinData
67 {
68 public:
69 
70  SkinData(void);
71  ~SkinData(void);
72 
73 private:
74 
75  // points
76  unsigned int m_pointsNumber;
77  SkinPoint * m_points;
78 
79 public:
80 
81  // points
82  void clearPoints(void);
83  SkinPoint * allocPoints(unsigned int size);
84  inline unsigned int getPointsNumber(void){ return m_pointsNumber; }
85  inline SkinPoint * getPoint(unsigned int id){ return &m_points[id]; }
86 };
87 }
88 #endif
Definition: SkinData.h:66
unsigned int getBonesNumber(void)
Definition: SkinData.h:55
void setVertexId(unsigned int vertexId)
Definition: SkinData.h:60
unsigned int getVertexId(void)
Definition: SkinData.h:61
Definition: SkinData.h:32
unsigned int getPointsNumber(void)
Definition: SkinData.h:84
float * getBonesWeights(void)
Definition: SkinData.h:57
unsigned short * getBonesIds(void)
Definition: SkinData.h:56
Definition: Color.h:29
SkinPoint * getPoint(unsigned int id)
Definition: SkinData.h:85