Search the Community
Showing results for tags 'Physics P2'.
-
What is the recommended way of temporarily disabling physics for sprites? I have an object pool that non active sprites are stored in and I want to make sure the physics don't run at all when sprites are in the pool. At this moment I have: this.body.data.gravityScale = 0;this.body.data.shapes[0].sensor = true;this.currentState = this.BUBBLESTATE.DEAD;And I disable the Sprites Update function on BUBBLESTATE.DEAD If I look at the debugger I see a high ms on update -> physics when I have a lot of sprites active and pooled. So my assumption is that even the pooled sprites are still running physics. Some way to force them sleep and wake up would be perfect because I have control over when they should go to sleep and wake up.
-
Is there a way to limit the rotation a body will do? i mean, i dont want to turn rotation off, but i dont want it to flip upsidown..
-
Hello ! I would like to know how can I get the bounds from a body ? I'm using Physics.P2 and I can't figure out how to get them. On top of that, I would like to get the Width and Height of a body (but coordinates would be nice too). Thank you in advance for your answers.
- 11 replies
-
- body bounds polygon position
- physics p2
-
(and 1 more)
Tagged with: