50 #include "SkeletonTransform.hh"
83 if ( _pose == refPose_){
86 for (
unsigned int iFrame = 0; iFrame < skeleton_.
animation(a)->frameCount(); iFrame++){
90 if ( pose == refPose_ )
122 if ( _pose == refPose_ ){
126 for (
unsigned int iFrame = 0; iFrame < skeleton_.
animation(a)->frameCount(); iFrame++){
130 if ( pose == refPose_ )
159 if ( _pose == refPose_ ){
163 for (
unsigned int iFrame = 0; iFrame < skeleton_.
animation(a)->frameCount(); iFrame++){
167 if ( pose == refPose_ )
229 for (
unsigned int iFrame = 0; iFrame < skeleton_.
animation(a)->frameCount(); iFrame++){
274 transformation.
translate( _translation );
297 std::cerr <<
"Cannot rotate joint. Matrix is not a rotation matrix (det:" <<
determinant(_rotation) <<
")" << std::endl;
320 if ( (_pose == refPose_) || !_applyToWholeAnimation ){
336 if ( _applyToWholeAnimation ){
339 for (
unsigned int iFrame = 0; iFrame < skeleton_.
animation(a)->frameCount(); iFrame++){
367 _m(0,3) * _m(1,2) * _m(2,1) * _m(3,0)-_m(0,2) * _m(1,3) * _m(2,1) * _m(3,0)-_m(0,3) * _m(1,1) * _m(2,2) * _m(3,0)+_m(0,1) * _m(1,3) * _m(2,2) * _m(3,0)+
368 _m(0,2) * _m(1,1) * _m(2,3) * _m(3,0)-_m(0,1) * _m(1,2) * _m(2,3) * _m(3,0)-_m(0,3) * _m(1,2) * _m(2,0) * _m(3,1)+_m(0,2) * _m(1,3) * _m(2,0) * _m(3,1)+
369 _m(0,3) * _m(1,0) * _m(2,2) * _m(3,1)-_m(0,0) * _m(1,3) * _m(2,2) * _m(3,1)-_m(0,2) * _m(1,0) * _m(2,3) * _m(3,1)+_m(0,0) * _m(1,2) * _m(2,3) * _m(3,1)+
370 _m(0,3) * _m(1,1) * _m(2,0) * _m(3,2)-_m(0,1) * _m(1,3) * _m(2,0) * _m(3,2)-_m(0,3) * _m(1,0) * _m(2,1) * _m(3,2)+_m(0,0) * _m(1,3) * _m(2,1) * _m(3,2)+
371 _m(0,1) * _m(1,0) * _m(2,3) * _m(3,2)-_m(0,0) * _m(1,1) * _m(2,3) * _m(3,2)-_m(0,2) * _m(1,1) * _m(2,0) * _m(3,3)+_m(0,1) * _m(1,2) * _m(2,0) * _m(3,3)+
372 _m(0,2) * _m(1,0) * _m(2,1) * _m(3,3)-_m(0,0) * _m(1,2) * _m(2,1) * _m(3,3)-_m(0,1) * _m(1,0) * _m(2,2) * _m(3,3)+_m(0,0) * _m(1,1) * _m(2,2) * _m(3,3);
virtual Matrix globalMatrixInv(unsigned int _joint) const
Simply returns the inverse of the global matrix.
void setGlobalTranslation(unsigned int _joint, const Vector &_position, bool _keepGlobalChildPositions=true)
Sets the global translation vector.
Vector localTranslation(unsigned int _joint)
Returns the local translation vector.
Pose * referencePose()
Returns a pointer to the reference pose.
Animation * animation(std::string _name)
Returns a pointer to the animation to the given name.
A general pose, used to store the frames of the animation.
Iterator end()
Compare an iterator with the return value of this method to test if it is done.
Iterator class for the skeleton.
void translate(Scalar _x, Scalar _y, Scalar _z, MultiplyFrom _mult_from=MULT_FROM_RIGHT)
multiply self with translation matrix (x,y,z)
static double determinant(Matrix4x4 &_m)
compute determinant to check if matrix is rotation matrix
Iterator begin()
Iterator over joints of the skeletal tree in TOP-DOWN order (from root to leafs)
void translateSkeleton(ACG::Vec3d _translation, Skeleton::Pose *_pose=0)
translate the skeleton
const Matrix & localMatrix(unsigned int _joint) const
Returns the local matrix for the given joint.
Joint * parent()
Returns the parent joint.
unsigned int animationCount()
Returns the number of animations stored in this skeleton.
void setLocalTranslation(unsigned int _joint, const Vector &_position, bool _keepLocalChildPositions=true)
Sets the local translation vector.
Vector globalTranslation(unsigned int _joint)
Returns the global translation vector.
Matrix localMatrixInv(unsigned int _joint) const
Simply returns the inverse of the local matrix.
Functions for geometric operations related to angles.
void identity()
setup an identity matrix
unsigned int id()
returns the joint id
void setLocalMatrix(unsigned int _joint, const Matrix &_local, bool _keepLocalChildPositions=true)
Sets the local coordinate system.
void transformSkeleton(Matrix4x4 _transformation, Skeleton::Pose *_pose=0)
transform the skeleton
SkeletonTransform(Skeleton &_skeleton)
Le constructeur.
const Matrix & globalMatrix(unsigned int _joint) const
Returns the global matrix for the given joint.
void transformJoint(Skeleton::Joint *_joint, Matrix4x4 _matrix, bool _keepChildPositions=true)
apply a transformation to a joint in the refPose
void rotateJoint(Skeleton::Joint *_joint, Skeleton::Pose *_pose, Matrix4x4 _rotation, bool _applyToWholeAnimation=true)
rotate a joint in an arbitrary Pose
Represents a single joint in the skeleton.
void translateJoint(Skeleton::Joint *_joint, ACG::Vec3d _translation, bool _keepChildPositions=true)
apply a translation to a joint in the refPose
void scaleSkeleton(double _factor, Skeleton::Pose *_pose=0)
scale all bones of the skeleton by the given factor