Skip to content

Commit

Permalink
fix: rotation error (#318)
Browse files Browse the repository at this point in the history
  • Loading branch information
luzhuang authored Dec 19, 2024
1 parent 3be869b commit 5ebb8c0
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
6 changes: 3 additions & 3 deletions packages/auxiliary-lines/src/WireframeManager.ts
Original file line number Diff line number Diff line change
Expand Up @@ -350,7 +350,7 @@ export class WireframeManager extends Script {
indices,
this._indicesCount
);
Quaternion.rotationYawPitchRoll(rotation.x, rotation.y, rotation.z, tempRotation);
Quaternion.rotationYawPitchRoll(rotation.y, rotation.x, rotation.z, tempRotation);
this._localRotation(positionsOffset, tempRotation);
Vector3.multiply(position, worldScale, tempVector);
this._localTranslate(positionsOffset, tempVector);
Expand Down Expand Up @@ -382,7 +382,7 @@ export class WireframeManager extends Script {
indices,
this._indicesCount
);
Quaternion.rotationYawPitchRoll(rotation.x, rotation.y, rotation.z, tempRotation);
Quaternion.rotationYawPitchRoll(rotation.y, rotation.x, rotation.z, tempRotation);
this._localRotation(positionsOffset, tempRotation);
Vector3.multiply(position, worldScale, tempVector);
this._localTranslate(positionsOffset, tempVector);
Expand Down Expand Up @@ -431,7 +431,7 @@ export class WireframeManager extends Script {
case ColliderShapeUpAxis.Z:
tempAxis.set(halfSqrt, 0, 0, halfSqrt);
}
Quaternion.rotationYawPitchRoll(rotation.x, rotation.y, rotation.z, tempRotation);
Quaternion.rotationYawPitchRoll(rotation.y, rotation.x, rotation.z, tempRotation);
Quaternion.multiply(tempRotation, tempAxis, tempRotation);
this._localRotation(positionsOffset, tempRotation);
Vector3.multiply(position, worldScale, tempVector);
Expand Down
2 changes: 1 addition & 1 deletion packages/navigation-gizmo/src/SphereScript.ts
Original file line number Diff line number Diff line change
Expand Up @@ -193,7 +193,7 @@ export class SphereScript extends Script {
const { _tempQuat: tempQuat, _tempQuat2: tempQuat2 } = this;

Quaternion.rotationAxisAngle(SphereScript._startAxis, y, tempQuat);
Quaternion.rotationYawPitchRoll(x, 0, 0, tempQuat2);
Quaternion.rotationYawPitchRoll(0, x, 0, tempQuat2);
Quaternion.multiply(tempQuat, tempQuat2, tempQuat);
Vector3.subtract(SphereScript._startPos, this._target, this._rotateVec);

Expand Down

0 comments on commit 5ebb8c0

Please sign in to comment.