Jump to content

P2 Physics world sleeping


charlie_says
 Share

Recommended Posts

Hi,

I'm just working with P2 and have hit a bit of a wall. I need to check whether all the bodies in the world are at rest (i.e. no longer moving)... in Box2D (as far as I recall) there was either a world.sleeping property (or perhaps world.active) so you could check when/if this had happened.

There doesn't seem to be an obvious way of doing this in P2.

One solution would be to loop thru all the bodies checking for velocity == 0, but this seems a little cumbersome.

Have I missed an obvious way to do this?

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...