[ODE] Sphere to Cube?

Jon Watte (ODE) hplus-ode at mindcontrol.org
Tue Sep 12 10:33:38 MST 2006

The easiest thing to do is to remove the sphere geom from the body and 
destroy it, and create a new geom that's a cube and attach that to the 
body. You probably want the cube to be sized so it has identical volume 
to the sphere.

However, depending on how the sphere interacts with the world, the cube 
may be significantly penetrating something where the sphere isn't, which 
would generate a huge penalty force. You could possibly fix this up by 
running collision detection for the new cube only, and moving the object 
by the depth of detected penetration as a one-time thing, if any. It's 
not guaranteed that there will be a solution, however.


          / h+

David Perry wrote:
> Hi.
> I've created a sphere and have it rolling around my world quite happily.
> What I'm wanting to do is read a keypress and convert this sphere to a 
> cube (or if it's already been converted to a cube, convert it back to 
> a sphere).
> The problem is I want it to have all the attributes that the previous 
> shape did ie. mass, rotation, velocity etc.
> Is this even possible? I've tried looking online for an answer but I'm 
> not really sure what I should be looking for exactly.
> Thanks in advance.
> ------------------------------------------------------------------------
> Be one of the first to try Windows Live Mail. 
> <http://ideas.live.com/programpage.aspx?versionId=5d21c51a-b161-4314-9b0e-4911fb2b2e6d> 
> ------------------------------------------------------------------------
> _______________________________________________
> ODE mailing list
> ODE at q12.org
> http://q12.org/mailman/listinfo/ode

More information about the ODE mailing list