121 const uint T_size = node->mNumPositionKeys;
122 const uint R_size = node->mNumRotationKeys;
123 const uint S_size = node->mNumScalingKeys;
124 data.
m_name = assimpToCore( node->mNodeName );
127 if ( T_size == 0 && R_size == 0 && S_size == 0 ) {
return; }
134 keyFrame.
insert( time + timeOffset );
136 assimpToCore( node->mPositionKeys[0].mValue ) );
137 time = Scalar( node->mRotationKeys[0].mTime );
140 assimpToCore( node->mRotationKeys[0].mValue ) );
141 time = Scalar( node->mScalingKeys[0].mTime );
144 assimpToCore( node->mScalingKeys[0].mValue ) );
147 for ( uint i = 1; i < T_size; ++i ) {
148 time = Scalar( node->mPositionKeys[i].mTime ) + timeOffset;
149 tr.
insertKeyFrame( time, assimpToCore( node->mPositionKeys[i].mValue ) );
153 for ( uint i = 1; i < R_size; ++i ) {
154 time = Scalar( node->mRotationKeys[i].mTime ) + timeOffset;
155 rot.
insertKeyFrame( time, assimpToCore( node->mRotationKeys[i].mValue ) );
159 for ( uint i = 1; i < S_size; ++i ) {
160 time = Scalar( node->mScalingKeys[i].mTime ) + timeOffset;
161 s.
insertKeyFrame( time, assimpToCore( node->mScalingKeys[i].mValue ) );
167 for (
const auto& t : keyFrame ) {
169 T.fromPositionOrientationScale( tr.
at( t, linearInterpolate<Core::Vector3> ),
170 rot.
at( t, linearInterpolate<Core::Quaternion> ),
171 s.
at( t, linearInterpolate<Core::Vector3> ) );
std::enable_if<!std::numeric_limits< T >::is_integer, bool >::type areApproxEqual(T x, T y, T espilonBoostFactor=T(10))
Compare two numbers such that |x-y| < espilon*epsilonBoostFactor.