How can i create areas with different gravity vector or it is imposible?
Different gravity vectors
FlashYou can get this effect a couple of ways. One would be to create a sensor and detect when things collide with that sensor and apply a force or impulse accordingly. The other would be to use a Query and then apply the force to the shapes it returns. The Query method might be faster, but you can only have rectangular areas, whereas sensors can be pretty much any shape. You could probably do this with shape raycasts too in 2.0, but the documentation isn't done yet. Actually sensors aren't technically in 1.4.3 either, but it's very easy to add them in. If you need more information please include what version you are using.
BTW there's actually a sensors example in 2.0, which doesn't do exactly what you're talking about, but it does do something very similar.
BTW there's actually a sensors example in 2.0, which doesn't do exactly what you're talking about, but it does do something very similar.
Thanks Brainclog for reply. I understand how to use queries (While it is enough for me) But you tell me about engine version 2.0 - where i can download it?
Well it is not technically released yet, but is feature complete in the SVN. You need an SVN client to download, you can find the information here. I don't know if you've used an SVN client before, but I have RapidSVN for instance and I go to the "Repository" menu, and then "Checkout...". Then I put for the URL:
Then I just tell it what directory to download to and hit ok.
Code:
https://box2d.svn.sourceforge.net/svnroot/box2d
Then I just tell it what directory to download to and hit ok.
Random plug: I've been very fond of TortoiseSVN lately, as it integrates very nicely with Windows Explorer: http://tortoisesvn.tigris.org/
I've had some Explorer crashes on Vista, I'm not sure if it's TortoiseSVN's fault or just Vista being buggy. Seems okay on XP, though.
I've had some Explorer crashes on Vista, I'm not sure if it's TortoiseSVN's fault or just Vista being buggy. Seems okay on XP, though.
I have one more question. For example i have a dynamic body with specific boolean property, let's say "noclip". If that property set to true the body must ignore SOME specific static bodies (As though they do not exist), but if that property set to false we have normal collisions with that static bodies. Question: how can i realized this behaviour?
p.s. Sory for my bad English.. 🙄
p.s. Sory for my bad English.. 🙄
You'll want to look at collision filtering in the manual. Also there is some good information on this if you search for bit mask and groupindex on the forums.
Original thread: https://box2d.org/forum/viewtopic.php?t=392