void Matrix44f::rotateZ( const float &angle ) { *this = *this * RotationMatrixZ( angle ); //*this = RotationMatrixZ( angle ) * *this; }
void MS3DToMesh::Joint( const MS3D::Joint & joint ) { Matrix< 4, 4, float > transform = MultiplicitiveIdentity< Matrix< 4, 4, float > >::Identity( ); Sub< 3, 3 >::Matrix( transform ) = RotationMatrixX( joint.rotation[ 0 ] ) * RotationMatrixY( joint.rotation[ 1 ] ) * RotationMatrixZ( joint.rotation[ 2 ] ); Sub< 3, 1 >::Matrix( transform, 0, 3 ) = Vec< 3 >::Tor( joint.position ); bonematrices.push_back( transform ); int parentindex = -1; for( size_t i = 0; i < jointnames.size( ); i++ ) { if( std::string( joint.parentName ) == jointnames[ i ] ) { parentindex = i; } } jointnames.push_back( std::string( joint.name ) ); parentindices.push_back( parentindex ); std::vector< JointAnimation::Keyframe > rotationKeyframes( joint.numKeyFramesRot ); for( int i = 0; i < joint.numKeyFramesRot; i++ ) { rotationKeyframes[ i ] = JointAnimation::Keyframe( joint.keyFramesRot[ i ].time, joint.keyFramesRot[ i ].rotation ); } std::vector< JointAnimation::Keyframe > positionKeyframes( joint.numKeyFramesPos ); for( int i = 0; i < joint.numKeyFramesPos; i++ ) { positionKeyframes[ i ] = JointAnimation::Keyframe( joint.keyFramesPos[ i ].time, joint.keyFramesPos[ i ].position ); } jointanimations.push_back( JointAnimation( rotationKeyframes.begin( ), rotationKeyframes.end( ), positionKeyframes.begin( ), positionKeyframes.end( ) ) ); }