Skip to content

Commit

Permalink
feat: collider shape rotation change radians to degrees
Browse files Browse the repository at this point in the history
  • Loading branch information
luzhuang committed Jan 2, 2025
1 parent 62ffcfc commit b43af4d
Showing 1 changed file with 20 additions and 4 deletions.
24 changes: 20 additions & 4 deletions packages/auxiliary-lines/src/WireframeManager.ts
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,8 @@ import {
CircleShape,
ConeShape,
HemisphereShape,
SphereShape
SphereShape,
MathUtil
} from "@galacean/engine";
import { PlainColorMaterial } from "@galacean/engine-toolkit-custom-material";
import { WireframePrimitive } from "./WireframePrimitive";
Expand Down Expand Up @@ -350,7 +351,12 @@ export class WireframeManager extends Script {
indices,
this._indicesCount
);
Quaternion.rotationYawPitchRoll(rotation.y, rotation.x, rotation.z, tempRotation);
Quaternion.rotationYawPitchRoll(
MathUtil.degreeToRadian(rotation.y),
MathUtil.degreeToRadian(rotation.x),
MathUtil.degreeToRadian(rotation.z),
tempRotation
);
this._localRotation(positionsOffset, tempRotation);
Vector3.multiply(position, worldScale, tempVector);
this._localTranslate(positionsOffset, tempVector);
Expand Down Expand Up @@ -382,7 +388,12 @@ export class WireframeManager extends Script {
indices,
this._indicesCount
);
Quaternion.rotationYawPitchRoll(rotation.y, rotation.x, rotation.z, tempRotation);
Quaternion.rotationYawPitchRoll(
MathUtil.degreeToRadian(rotation.y),
MathUtil.degreeToRadian(rotation.x),
MathUtil.degreeToRadian(rotation.z),
tempRotation
);
this._localRotation(positionsOffset, tempRotation);
Vector3.multiply(position, worldScale, tempVector);
this._localTranslate(positionsOffset, tempVector);
Expand Down Expand Up @@ -431,7 +442,12 @@ export class WireframeManager extends Script {
case ColliderShapeUpAxis.Z:
tempAxis.set(halfSqrt, 0, 0, halfSqrt);
}
Quaternion.rotationYawPitchRoll(rotation.y, rotation.x, rotation.z, tempRotation);
Quaternion.rotationYawPitchRoll(
MathUtil.degreeToRadian(rotation.y),
MathUtil.degreeToRadian(rotation.x),
MathUtil.degreeToRadian(rotation.z),
tempRotation
);
Quaternion.multiply(tempRotation, tempAxis, tempRotation);
this._localRotation(positionsOffset, tempRotation);
Vector3.multiply(position, worldScale, tempVector);
Expand Down

0 comments on commit b43af4d

Please sign in to comment.