64 template<
typename Po
intT>
67 assert(_skeleton != 0);
81 template<
typename Po
intT>
96 template<
typename Po
intT>
109 template<
typename Po
intT>
125 template<
typename Po
intT>
144 template<
typename Po
intT>
149 for(
int i = 0; i < 3; ++i)
166 template<
typename Po
intT>
170 for(
int i = 0; i < 3; ++i)
171 mat(i, 3) = _position[i];
181 template<
typename Po
intT>
198 template<
typename Po
intT>
216 template<
typename Po
intT>
232 template<
typename Po
intT>
237 for(
int i = 0; i < 3; ++i)
254 template<
typename Po
intT>
258 for(
int i = 0; i < 3; ++i)
259 mat(i, 3) = _position[i];
272 template<
typename Po
intT>
275 if (_joint >=
global_.size()) {
276 std::cerr <<
"Illegal joint number: " << _joint << std::endl;
286 template<
typename Po
intT>
303 template<
typename Po
intT>
320 template<
typename Po
intT>
330 Matrix matRefGlobalInv =
skeleton_->referencePose()->globalMatrix(_joint);
337 if (_keepChildPositions) {
339 for(
unsigned int i = 0; i <
skeleton_->childCount(_joint); ++i) {
358 template<
typename Po
intT>
368 Matrix matRefGlobalInv =
skeleton_->referencePose()->globalMatrix(_joint);
375 if (_keepChildPositions) {
376 for(
unsigned int i = 0; i <
skeleton_->childCount(_joint); ++i) {
402 template<
typename Po
intT>
420 template<
typename Po
intT>
436 template<
typename Po
intT>
DualQuaternion class for representing rigid motions in 3d.
virtual void removeJointAt(unsigned int _index)
Called by the skeleton/animation as a joint is removed.
PoseT(SkeletonT< Point > *_skeleton)
Constructor.
void setGlobalTranslation(unsigned int _joint, const Vector &_position, bool _keepGlobalChildPositions=true)
Sets the global translation vector.
void updateFromLocal(unsigned int _joint, bool _keepChildPositions=true)
This method propagates the change in the local coordinate system to the global system and all childre...
const Quaternion & unifiedRotation(unsigned int _joint)
Returns a quaternion holding the rotational part of the unified matrix.
virtual Matrix globalMatrixInv(unsigned int _joint) const
Simply returns the inverse of the global matrix.
void updateFromGlobal(unsigned int _joint, bool _keepChildPositions=true)
This method propagates the change in the global coordinate system to the local system and all childre...
std::vector< DualQuaternion > unifiedDualQuaternion_
Vector globalTranslation(unsigned int _joint)
Returns the global translation vector.
std::vector< Matrix > local_
the pose in local coordinates
SkeletonT< PointT > * skeleton_
a pointer to the skeleton
const Matrix & globalMatrix(unsigned int _joint) const
Returns the global matrix for the given joint.
A general pose, used to store the frames of the animation.
const Matrix & localMatrix(unsigned int _joint) const
Returns the local matrix for the given joint.
void identity()
setup an identity matrix
Matrix localMatrixInv(unsigned int _joint) const
Simply returns the inverse of the local matrix.
Vector localTranslation(unsigned int _joint)
Returns the local translation vector.
virtual void insertJointAt(unsigned int _index)
Called by the skeleton/animation as a new joint is inserted.
void setLocalTranslation(unsigned int _joint, const Vector &_position, bool _keepLocalChildPositions=true)
Sets the local translation vector.
const DualQuaternion & unifiedDualQuaternion(unsigned int _joint)
Returns a dual quaternion holding the unified matrix represented as dual quaternion.
std::vector< Matrix > unified_
the global pose matrix left-multiplied to the inverse global reference matrix:
bool invert()
matrix inversion (returns true on success)
const Matrix & unifiedMatrix(unsigned int _joint)
Returns the unified matrix.
static DualQuaternion identity()
identity dual quaternion [ R(1, 0, 0, 0), D(0,0,0,0) ]
std::vector< Matrix > global_
the pose in global coordinates
void setGlobalMatrix(unsigned int _joint, const Matrix &_global, bool _keepGlobalChildPositions=true)
Sets the global coordinate system.
virtual ~PoseT()
Destructor.
void setLocalMatrix(unsigned int _joint, const Matrix &_local, bool _keepLocalChildPositions=true)
Sets the local coordinate system.