1 decade ago by anaish
Hi, I've noticed that the Box2d plugin's body class does not contain a method called SetAngle(<number>). I would like to rotate one of my box2d entities (and it's related animation). After looking through the forums I have tried the following:
The problem is that the call to this.parent() sets the body.angle property to that of this.body.GetAngle() which is always 0. See /lib/plugins/box2d/entity.js line 52 in the physics demo.
How do you rotate both an animation and its related body?
//this is part of the update() function in my box2dentity this.anims.idle.angle += 0.17; this.body.angle += 0.17; //call update this.parent();
The problem is that the call to this.parent() sets the body.angle property to that of this.body.GetAngle() which is always 0. See /lib/plugins/box2d/entity.js line 52 in the physics demo.
How do you rotate both an animation and its related body?