Update glTF2Exporter.cpp

pull/2191/head
haroonq 2018-11-01 08:49:06 -07:00 committed by GitHub
parent b33054e05a
commit 69abac59d2
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 10 additions and 10 deletions

View File

@ -979,9 +979,9 @@ inline void ExtractTranslationSampler(Asset& asset, std::string& animId, Ref<Buf
const aiVectorKey& key = nodeChannel->mPositionKeys[i];
// mTime is measured in ticks, but GLTF time is measured in seconds, so convert.
times[i] = static_cast<float>(key.mTime / ticksPerSecond);
values[i * 3][0] = key.mValue.x;
values[i * 3][1] = key.mValue.y;
values[i * 3][2] = key.mValue.z;
values[(i * 3) + 0] = key.mValue.x;
values[(i * 3) + 1] = key.mValue.y;
values[(i * 3) + 2] = key.mValue.z;
}
sampler.input = GetSamplerInputRef(asset, animId, buffer, times);
@ -1002,9 +1002,9 @@ inline void ExtractScaleSampler(Asset& asset, std::string& animId, Ref<Buffer>&
const aiVectorKey& key = nodeChannel->mScalingKeys[i];
// mTime is measured in ticks, but GLTF time is measured in seconds, so convert.
times[i] = static_cast<float>(key.mTime / ticksPerSecond);
values[i * 3][0] = key.mValue.x;
values[i * 3][1] = key.mValue.y;
values[i * 3][2] = key.mValue.z;
values[(i * 3) + 0] = key.mValue.x;
values[(i * 3) + 1] = key.mValue.y;
values[(i * 3) + 2] = key.mValue.z;
}
sampler.input = GetSamplerInputRef(asset, animId, buffer, times);
@ -1025,10 +1025,10 @@ inline void ExtractRotationSampler(Asset& asset, std::string& animId, Ref<Buffer
const aiQuatKey& key = nodeChannel->mRotationKeys[i];
// mTime is measured in ticks, but GLTF time is measured in seconds, so convert.
times[i] = static_cast<float>(key.mTime / ticksPerSecond);
values[i * 4][0] = key.mValue.x;
values[i * 4][1] = key.mValue.y;
values[i * 4][2] = key.mValue.z;
values[i * 4][3] = key.mValue.w;
values[(i * 4) + 0] = key.mValue.x;
values[(i * 4) + 1] = key.mValue.y;
values[(i * 4) + 2] = key.mValue.z;
values[(i * 4) + 3] = key.mValue.w;
}
sampler.input = GetSamplerInputRef(asset, animId, buffer, times);