Whitespace
parent
288a638a83
commit
aee292e367
|
@ -514,34 +514,34 @@ void XFileImporter::CreateAnimations( aiScene* pScene, const XFile::Scene* pData
|
||||||
// separate key sequences for position, rotation, scaling
|
// separate key sequences for position, rotation, scaling
|
||||||
nbone->mNumPositionKeys = (unsigned int)bone->mPosKeys.size();
|
nbone->mNumPositionKeys = (unsigned int)bone->mPosKeys.size();
|
||||||
if (nbone->mNumPositionKeys != 0) {
|
if (nbone->mNumPositionKeys != 0) {
|
||||||
nbone->mPositionKeys = new aiVectorKey[nbone->mNumPositionKeys];
|
nbone->mPositionKeys = new aiVectorKey[nbone->mNumPositionKeys];
|
||||||
for( unsigned int c = 0; c < nbone->mNumPositionKeys; ++c ) {
|
for( unsigned int c = 0; c < nbone->mNumPositionKeys; ++c ) {
|
||||||
aiVector3D pos = bone->mPosKeys[c].mValue;
|
aiVector3D pos = bone->mPosKeys[c].mValue;
|
||||||
|
|
||||||
nbone->mPositionKeys[c].mTime = bone->mPosKeys[c].mTime;
|
nbone->mPositionKeys[c].mTime = bone->mPosKeys[c].mTime;
|
||||||
nbone->mPositionKeys[c].mValue = pos;
|
nbone->mPositionKeys[c].mValue = pos;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// rotation
|
// rotation
|
||||||
nbone->mNumRotationKeys = (unsigned int)bone->mRotKeys.size();
|
nbone->mNumRotationKeys = (unsigned int)bone->mRotKeys.size();
|
||||||
if (nbone->mNumRotationKeys != 0) {
|
if (nbone->mNumRotationKeys != 0) {
|
||||||
nbone->mRotationKeys = new aiQuatKey[nbone->mNumRotationKeys];
|
nbone->mRotationKeys = new aiQuatKey[nbone->mNumRotationKeys];
|
||||||
for( unsigned int c = 0; c < nbone->mNumRotationKeys; ++c ) {
|
for( unsigned int c = 0; c < nbone->mNumRotationKeys; ++c ) {
|
||||||
aiMatrix3x3 rotmat = bone->mRotKeys[c].mValue.GetMatrix();
|
aiMatrix3x3 rotmat = bone->mRotKeys[c].mValue.GetMatrix();
|
||||||
|
|
||||||
nbone->mRotationKeys[c].mTime = bone->mRotKeys[c].mTime;
|
nbone->mRotationKeys[c].mTime = bone->mRotKeys[c].mTime;
|
||||||
nbone->mRotationKeys[c].mValue = aiQuaternion( rotmat);
|
nbone->mRotationKeys[c].mValue = aiQuaternion( rotmat);
|
||||||
nbone->mRotationKeys[c].mValue.w *= -1.0f; // needs quat inversion
|
nbone->mRotationKeys[c].mValue.w *= -1.0f; // needs quat inversion
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// scaling
|
// scaling
|
||||||
nbone->mNumScalingKeys = (unsigned int)bone->mScaleKeys.size();
|
nbone->mNumScalingKeys = (unsigned int)bone->mScaleKeys.size();
|
||||||
if (nbone->mNumScalingKeys != 0) {
|
if (nbone->mNumScalingKeys != 0) {
|
||||||
nbone->mScalingKeys = new aiVectorKey[nbone->mNumScalingKeys];
|
nbone->mScalingKeys = new aiVectorKey[nbone->mNumScalingKeys];
|
||||||
for( unsigned int c = 0; c < nbone->mNumScalingKeys; c++)
|
for( unsigned int c = 0; c < nbone->mNumScalingKeys; c++)
|
||||||
nbone->mScalingKeys[c] = bone->mScaleKeys[c];
|
nbone->mScalingKeys[c] = bone->mScaleKeys[c];
|
||||||
}
|
}
|
||||||
|
|
||||||
// longest lasting key sequence determines duration
|
// longest lasting key sequence determines duration
|
||||||
|
|
Loading…
Reference in New Issue