Hey, gang!
Quick semi-noobish question for you. Let's say I've got a box2d project with a whole bunch of objects in 'em. And let's say that, for some reason, I want to temporarily have an object completely not interact with any object in the scene at all. For example, maybe I want to click-and-drag something around the scene without worrying about it colliding with bodies that are already there. What's the best way to do this?
Yeah, I know often the answer to these kinds of questions is to do some kind of collision filtering. But this seems like an exception in that a) I want to temporarily turn off and on the "collidability" of the object, and filtering seems to be designed for objects that don't change their collidability features mid-stream, b) I'm making the object not collide with anything in the world at all, instead of a subset of objects, and filtering in this case seems kinda overkill, and also c) I'm lazy, and don't really want to go back and add category bits and mask bits to every freakin' object in the scene.
Some solutions I've thought of are... a) Destroying the underlying physics body when I start dragging the object and then recreating again when I stop, b) Temporarily moving the underlying physics body to some far-off location and then bring it back again, or c) Bite the bullet and use filtering. But I guess I was hoping there was a more elegant solution than any of the ones I've considered so far.
Thoughts? Help me, Box2DFlash forum list! You're my only hope!
Quick semi-noobish question for you. Let's say I've got a box2d project with a whole bunch of objects in 'em. And let's say that, for some reason, I want to temporarily have an object completely not interact with any object in the scene at all. For example, maybe I want to click-and-drag something around the scene without worrying about it colliding with bodies that are already there. What's the best way to do this?
Yeah, I know often the answer to these kinds of questions is to do some kind of collision filtering. But this seems like an exception in that a) I want to temporarily turn off and on the "collidability" of the object, and filtering seems to be designed for objects that don't change their collidability features mid-stream, b) I'm making the object not collide with anything in the world at all, instead of a subset of objects, and filtering in this case seems kinda overkill, and also c) I'm lazy, and don't really want to go back and add category bits and mask bits to every freakin' object in the scene.
Some solutions I've thought of are... a) Destroying the underlying physics body when I start dragging the object and then recreating again when I stop, b) Temporarily moving the underlying physics body to some far-off location and then bring it back again, or c) Bite the bullet and use filtering. But I guess I was hoping there was a more elegant solution than any of the ones I've considered so far.
Thoughts? Help me, Box2DFlash forum list! You're my only hope!