feanor91
08-08-2008 13:06:03
Hi
I use sceneparser to parse all my scene.
In my ogre scene manager, I can hide object, but their "physics body" from newton are always here so, I collide with them, even if I don't seen it.
Is ther a way to hide also their "pysics body"?
Edit : Just in case...I'm using MogreNewt...
If you do not want to delete it, i think you have to use collision callbacks to cancel the collision
feanor91
08-08-2008 16:14:07
Yeah, but how can I get body of the object to act with it?
walaber
08-08-2008 16:43:13
the sceneparser includes a filter callback that you can implement, to choose which bodies to include, and which not to. you could use the callback filter to "ignore" the hidden bodies.
feanor91
08-08-2008 17:43:11
Ah, OK, fine, I will remember that, but it's not the purpose. What I want, is parse all my scene and then choose to hide or show body.
I see in sample a body iterator that I think can do the job (if I well understand) but I haven't manage to find it's implementation under mogre newt.
walaber
09-08-2008 00:12:29
there is no way to simply "hide" a Body in Newton... the easiest thing to do is remove the Body when not visible, and recreate it when visible.
or, like mentioned above, you can use the Material Contact Callback system to ignore all collisions with bodies that are hidden.
you can do this in the "contactBegin" to reduce overhead on the physics side.
feanor91
09-08-2008 06:39:56
OK, so what I have to do, if I understand, is to remove object from my scen, before parsing it, then recreate then in my logre scen and calculate their body, and if i hide them, I destroy body, recreating it if I show them.
Therefore, it is what I have to do if I want to have dynamic objects elsewhere all is static. It is the conclusion that I achieve.
Thanks.