Skip to content

Commit

Permalink
fix: lite box collider scale bug (#759)
Browse files Browse the repository at this point in the history
* fix: lite box collider shape should scale the size of box instead use transform
  • Loading branch information
yangfengzzz authored Apr 26, 2022
1 parent 989abdc commit c222a15
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion packages/physics-lite/src/shape/LiteBoxColliderShape.ts
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,8 @@ export class LiteBoxColliderShape extends LiteColliderShape implements IBoxColli
* {@inheritDoc IColliderShape.setWorldScale }
*/
setWorldScale(scale: Vector3): void {
this._transform.setScale(scale.x, scale.y, scale.z);
this._transform.position = this._transform.position.multiply(scale);
this._halfSize.multiply(scale);
}

/**
Expand Down

0 comments on commit c222a15

Please sign in to comment.