Skip to content

Commit

Permalink
fixed wrong quaternion components order in get/set rotation pointer
Browse files Browse the repository at this point in the history
  • Loading branch information
pfcDorn committed Jan 8, 2025
1 parent 5444f28 commit ae2a4ed
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/BasicBehaveEngine/decorators/BabylonDecorator.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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) => {
Expand Down

0 comments on commit ae2a4ed

Please sign in to comment.