Skip to content
This repository has been archived by the owner on Mar 5, 2021. It is now read-only.

Commit

Permalink
Browse files Browse the repository at this point in the history
arcadePhysics2D: Fix a bug on actorPosition computation
  • Loading branch information
bilou84 committed Jan 15, 2016
1 parent f1403a7 commit 887aec5
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions plugins/default/arcadePhysics2D/components/ArcadeBody2D.ts
@@ -1,4 +1,5 @@
let THREE = SupEngine.THREE;
let tmpVector3 = new THREE.Vector3();

export default class ArcadeBody2D extends SupEngine.ActorComponent {
type: string;
Expand Down Expand Up @@ -107,10 +108,9 @@ export default class ArcadeBody2D extends SupEngine.ActorComponent {
}

refreshActorPosition() {
this.actor.getGlobalPosition(this.actorPosition);
this.actorPosition.x = this.position.x - this.offsetX;
this.actorPosition.y = this.position.y - this.offsetY;
this.actor.setGlobalPosition(this.actorPosition);
this.actor.setGlobalPosition(tmpVector3.copy(this.actorPosition));
}

_destroy() {
Expand Down

0 comments on commit 887aec5

Please sign in to comment.