From ae2a4ed2a710de1d6805a4bb4e472207fa5950fc Mon Sep 17 00:00:00 2001 From: Robert Dorn Date: Wed, 8 Jan 2025 12:55:33 +0100 Subject: [PATCH] fixed wrong quaternion components order in get/set rotation pointer --- src/BasicBehaveEngine/decorators/BabylonDecorator.ts | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/BasicBehaveEngine/decorators/BabylonDecorator.ts b/src/BasicBehaveEngine/decorators/BabylonDecorator.ts index 0f44c04..23ceb74 100644 --- a/src/BasicBehaveEngine/decorators/BabylonDecorator.ts +++ b/src/BasicBehaveEngine/decorators/BabylonDecorator.ts @@ -261,13 +261,13 @@ export class BabylonDecorator extends ADecorator { this.registerJsonPointer(`/nodes/${maxGltfNode}/rotation`, (path) => { const parts: string[] = path.split("/"); return [ - (this.world.glTFNodes[Number(parts[2])] as AbstractMesh).rotationQuaternion?.w, (this.world.glTFNodes[Number(parts[2])] as AbstractMesh).rotationQuaternion?.x, (this.world.glTFNodes[Number(parts[2])] as AbstractMesh).rotationQuaternion?.y, - (this.world.glTFNodes[Number(parts[2])] as AbstractMesh).rotationQuaternion?.z]; + (this.world.glTFNodes[Number(parts[2])] as AbstractMesh).rotationQuaternion?.z, + (this.world.glTFNodes[Number(parts[2])] as AbstractMesh).rotationQuaternion?.w]; }, (path, value) => { const parts: string[] = path.split("/"); - (this.world.glTFNodes[Number(parts[2])] as AbstractMesh).rotationQuaternion = new Quaternion(value[1], value[2], value[3], value[0]); + (this.world.glTFNodes[Number(parts[2])] as AbstractMesh).rotationQuaternion = new Quaternion(value[0], value[1], value[2], value[3]); }, "float4", false); this.registerJsonPointer(`/activeCamera/rotation`, (path) => {