TwoD
12-05-2007 23:22:01
I've got a bunch of objects grouped into spaces depending on what should collide with what, and each frame I call space.collide(otherSpace) for each set of spaces which should collide.
I use a simple collision listener from a demo which simply checks if the colliding bodies are connected by a joint. If connected, false is returned, otherwise a large amount of Coulomb friction and a low bouncyness is set before returning true. (Which creates a contact joint between the bodies, according to the ogreODE source)
Sometimes I need to check if two specific geometries collide (for instance, a "grappling hook" and a box). The objects are located in different spaces, which I don't run .collide() on so the hook won't bounce off the box instead of going through it. I do this by running hookGeometry.collide(boxGeometry) and check if the number of contact points are >0.
Since running .collide on a geometry will create contact joints between the bodies I'm wondering how this will affect the system. I specifically placed the hook and box(es) in different spaces to not get collision joints generated for them but I now realise I might be working against my own design by colliding the geometries and returning true in the collision listener.
I know I could just switch to a different listener, which will always return false, when checking if non-colliding geometries intersect. But since I've not noticed any weirdness going on between the hook and the objects it picks up I'm wondering if it's neccessary. I just don't want this thing to come back and bite me in the ass later on...
Is there already an easy way to just check for intersections in ogreODE without generating contact joints (no collision listener needed) which I have missed?
I guess it would be something like calling dCollide for geometries in ODE and just not do anything about the generated contacts. But that feels like going around the wrapper, which I don't like. I prefer working through the same API for all things which belong to it.
I'm doing this in Python in case it matters.
I use a simple collision listener from a demo which simply checks if the colliding bodies are connected by a joint. If connected, false is returned, otherwise a large amount of Coulomb friction and a low bouncyness is set before returning true. (Which creates a contact joint between the bodies, according to the ogreODE source)
Sometimes I need to check if two specific geometries collide (for instance, a "grappling hook" and a box). The objects are located in different spaces, which I don't run .collide() on so the hook won't bounce off the box instead of going through it. I do this by running hookGeometry.collide(boxGeometry) and check if the number of contact points are >0.
Since running .collide on a geometry will create contact joints between the bodies I'm wondering how this will affect the system. I specifically placed the hook and box(es) in different spaces to not get collision joints generated for them but I now realise I might be working against my own design by colliding the geometries and returning true in the collision listener.
I know I could just switch to a different listener, which will always return false, when checking if non-colliding geometries intersect. But since I've not noticed any weirdness going on between the hook and the objects it picks up I'm wondering if it's neccessary. I just don't want this thing to come back and bite me in the ass later on...
Is there already an easy way to just check for intersections in ogreODE without generating contact joints (no collision listener needed) which I have missed?
I guess it would be something like calling dCollide for geometries in ODE and just not do anything about the generated contacts. But that feels like going around the wrapper, which I don't like. I prefer working through the same API for all things which belong to it.
I'm doing this in Python in case it matters.