2
Copyright (c) 2008-2009 NetAllied Systems GmbH
4
This file is part of COLLADAFramework.
6
Licensed under the MIT Open Source License,
7
for details please see LICENSE file or the website
8
http://www.opensource.org/licenses/mit-license.php
11
#ifndef __COLLADAFW_SKINCONTROLLERDATA_H__
12
#define __COLLADAFW_SKINCONTROLLERDATA_H__
14
#include "COLLADAFWPrerequisites.h"
15
#include "COLLADAFWObject.h"
16
#include "COLLADAFWTypes.h"
17
#include "COLLADAFWUniqueId.h"
18
#include "COLLADAFWFloatOrDoubleArray.h"
20
#include "Math/COLLADABUMathMatrix4.h"
26
/** Holds the data of a skin controller, i.e. the weights per vertex per joint */
27
class SkinControllerData : public ObjectTemplate<COLLADA_TYPE::SKIN_DATA>
32
* The original object id, if it in the original file format exist.
36
/** The name of the skin controller.*/
39
/** The number of joints this controller can use.*/
42
/** Provides extra information about the position and orientation of the base mesh before binding.*/
43
COLLADABU::Math::Matrix4 mBindShapeMatrix;
45
/** Array of the inverse bind matrices. One for each joint.*/
46
Matrix4Array mInverseBindMatrices;
48
/** The weights of the skin controller. */
49
FloatOrDoubleArray mWeights;
51
/** Defines how many joints are connected to a vertex. The length must be equal to mVertexCount.
52
The i'th index corresponds to the i'th vertex of the source.*/
53
UIntValuesArray mJointsPerVertex;
55
/** Indices of weights assigned to a joint/vertex pair. The number of pairs for the i'th vertex is
56
given by the i'th value in mJointsPerVertex.*/
57
UIntValuesArray mWeightIndices;
59
/** Indices of joints assigned to a joint/vertex pair. The number of pairs for the i'th vertex is
60
given by the i'th value in mJointsPerVertex.*/
61
IntValuesArray mJointIndices;
66
SkinControllerData( const UniqueId& uniqueId );
69
virtual ~SkinControllerData();
72
* The original object id, if it in the original file format exist.
74
const String& getOriginalId () const { return mOriginalId; }
77
* The original object id, if it in the original file format exist.
79
void setOriginalId ( const String& val ) { mOriginalId = val; }
81
/** Returns name of the controller.*/
82
const String& getName() const { return mName; }
84
/** Sets name of the controller.*/
85
void setName(const String& name) { mName = name; }
87
/** Provides extra information about the position and orientation of the base mesh before binding.*/
88
const COLLADABU::Math::Matrix4& getBindShapeMatrix() const { return mBindShapeMatrix; }
90
/** Provides extra information about the position and orientation of the base mesh before binding.*/
91
void setBindShapeMatrix( const COLLADABU::Math::Matrix4& bindShapeMatrix) { mBindShapeMatrix = bindShapeMatrix; }
93
/** Array of the inverse bind matrices. One for each joint.*/
94
Matrix4Array& getInverseBindMatrices() { return mInverseBindMatrices; }
96
/** Array of the inverse bind matrices. One for each joint.*/
97
const Matrix4Array& getInverseBindMatrices() const { return mInverseBindMatrices; }
99
/** Returns the number of joints this controller can use.*/
100
size_t getJointsCount() const { return mJointsCount; }
102
/** Sets the number of joints this controller can use.*/
103
void setJointsCount(size_t jointsCount) { mJointsCount = jointsCount; }
105
/** Returns the number of vertices of the mesh modified by this controller.*/
106
size_t getVertexCount() const { return mJointsPerVertex.getCount(); }
108
/** Returns the weights of the skin controller. */
109
const FloatOrDoubleArray& getWeights() const { return mWeights; }
110
FloatOrDoubleArray& getWeights() { return mWeights; }
112
/** Returns the array defining how many joints are connected to a vertex. The length must be equal to mVertexCount.
113
The i'th index corresponds to the i'th vertex of the source.*/
114
const UIntValuesArray& getJointsPerVertex() const { return mJointsPerVertex; }
115
UIntValuesArray& getJointsPerVertex() { return mJointsPerVertex; }
117
/** Returns the indices of weights assigned to a joint/vertex pair. The number of pairs for the i'th vertex is
118
given by the i'th value in mJointsPerVertex.*/
119
const UIntValuesArray& getWeightIndices() const { return mWeightIndices; }
120
UIntValuesArray& getWeightIndices() { return mWeightIndices; }
122
/** Returns the indices of joints assigned to a joint/vertex pair. The number of pairs for the i'th vertex is
123
given by the i'th value in mJointsPerVertex.*/
124
const IntValuesArray& getJointIndices() const { return mJointIndices; }
125
IntValuesArray& getJointIndices() { return mJointIndices; }
129
/** Disable default copy ctor. */
130
SkinControllerData( const SkinControllerData& pre );
132
/** Disable default assignment operator. */
133
const SkinControllerData& operator= ( const SkinControllerData& pre );
137
} // namespace COLLADAFW
139
#endif // __COLLADAFW_SKINCONTROLLERDATA_H__