Why TransformGeometry collide with Geometry?

kongkana

05-02-2007 04:38:05

I have a Geometry that was encapsulated by TransformGeometry.
But in Collision callback it returns contact which TransformGeometry and Geometry collide together for 2 times.

And when it collide, frame rate drops greatly T_T.
So, is there any way to make the TransformGeometry not collide with Geometry?

And when collide with other Geometry it callback in collision many times (3 times if I create 3 level of TransformGeometry), how to make it call just once?

Thanks.

termit7577

05-02-2007 20:35:39

What exactly are you doing? Transform geometry completely replaces ordinary geometry, thus I'm not quite sure how you got, what you got. But one tip - are you sure you need that transform geometry? Might be it is unnecessary, thus you can get rid of it, and thus get a better performance :!:

kongkana

06-02-2007 04:51:54

I just make a walking character as in the "OgreOde Walking Character" tutorial. And I think TransformGeometry is the only way to offset position of the Geometry, Am I right?

I get contact with TransformGeometry and Geometry when collide with a TriangleMeshGeometry wall but don't get contact when collide with a TriangleMeshGeometry floor. I don't know wht?

Ah I misunderstand about number of level of TransformGeometry and nuber of callback in collision. There are no relation.

But I wonder, some time a BoxGeometry collide with a BoxGeometry generate just one collision, but some time generate many?

termit7577

06-02-2007 08:00:18

1) Walking char. tutorial: the use of transfer geometry, AFAIK, is really to help to fine-tune the position of your physics body geometry vs Ogre graphics body (your character in this case). However, this is no the only way. Alternatively, use 2 scene nodes. The top one (parent) is for you to connect your OgreOde::Body and OgreOde::Geometry (well, geom is connected to body, not scene node, of course :D ). And the child node is to connect your Ogre's graphical entity. Now, to fine-tune your positions, just translate the child node, and voila! No transform geometry needed, no mess, no collision problems, no extra coding...

2) If you want to change the position of geometry, use Body::setPosition or Body::setLinearVelocity. Its much more neat that way.

3) It just appears, that this number of collisions, that you get... Well, might be a feature of ODE itself. Try using capsule to box instead... Or try to find a hack around in your particular case... Or increase your stepper (not free, but...)

kongkana

12-02-2007 03:49:11

I tried the new OgreODE SDK [12 jan 2007]. It didn't give contacts between TransformGeometry and encapsulated Geometry anymore. :D

1) Walking char. tutorial: the use of transfer geometry, AFAIK, is really to help to fine-tune the position of your physics body geometry vs Ogre graphics body (your character in this case). However, this is no the only way. Alternatively, use 2 scene nodes. The top one (parent) is for you to connect your OgreOde::Body and OgreOde::Geometry (well, geom is connected to body, not scene node, of course ). And the child node is to connect your Ogre's graphical entity. Now, to fine-tune your positions, just translate the child node, and voila! No transform geometry needed, no mess, no collision problems, no extra coding...

Walking character tutorial used 2 bodies connected with joint. If I don't use TransformGeometry, the bodies will attach at the conter of each body.
And if I set anchor point, the bodies orbit around the anchor point. :(