From c49971e120db1ccae8bb502b42debc9c9321f45f Mon Sep 17 00:00:00 2001 From: Angelo Scandaliato Date: Sat, 8 Oct 2016 15:36:01 -0700 Subject: [PATCH] fix bug when exporting mRotationKeys data --- code/glTFExporter.cpp | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/code/glTFExporter.cpp b/code/glTFExporter.cpp index 0963ea8a0..b70d0816b 100644 --- a/code/glTFExporter.cpp +++ b/code/glTFExporter.cpp @@ -776,9 +776,12 @@ inline void ExtractAnimationData(Asset& mAsset, std::string& animId, RefmNumRotationKeys > 0) { - C_STRUCT aiQuaternion* rotationData = new aiQuaternion[nodeChannel->mNumRotationKeys]; + vec4* rotationData = new vec4[nodeChannel->mNumRotationKeys]; for (size_t i = 0; i < nodeChannel->mNumRotationKeys; ++i) { - rotationData[i] = nodeChannel->mRotationKeys[i].mValue; + rotationData[i][0] = nodeChannel->mRotationKeys[i].mValue.x; + rotationData[i][1] = nodeChannel->mRotationKeys[i].mValue.y; + rotationData[i][2] = nodeChannel->mRotationKeys[i].mValue.z; + rotationData[i][3] = nodeChannel->mRotationKeys[i].mValue.w; } Ref rotAccessor = ExportData(mAsset, animId, buffer, nodeChannel->mNumRotationKeys, rotationData, AttribType::VEC4, AttribType::VEC4, ComponentType_FLOAT);