From 69abac59d213cf19a778d43d046fedbfb0e659b2 Mon Sep 17 00:00:00 2001 From: haroonq <29288912+haroonq@users.noreply.github.com> Date: Thu, 1 Nov 2018 08:49:06 -0700 Subject: [PATCH] Update glTF2Exporter.cpp --- code/glTF2Exporter.cpp | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/code/glTF2Exporter.cpp b/code/glTF2Exporter.cpp index ee71188d5..40db27264 100644 --- a/code/glTF2Exporter.cpp +++ b/code/glTF2Exporter.cpp @@ -979,9 +979,9 @@ inline void ExtractTranslationSampler(Asset& asset, std::string& animId, RefmPositionKeys[i]; // mTime is measured in ticks, but GLTF time is measured in seconds, so convert. times[i] = static_cast(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& const aiVectorKey& key = nodeChannel->mScalingKeys[i]; // mTime is measured in ticks, but GLTF time is measured in seconds, so convert. times[i] = static_cast(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, RefmRotationKeys[i]; // mTime is measured in ticks, but GLTF time is measured in seconds, so convert. times[i] = static_cast(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);