[ODE] High density sphere passes into plane?
Elijah Taylor
eatmailinglists at gmail.com
Mon Aug 7 17:16:00 MST 2006
Oops, meant to send this to the list...
------------------
Aside from the usual response of fiddling with CFM and ERP values so that
only a particular amount of penetration is allowed, I beleve that there's an
different solution to your problem.
Since you're creating the sphere geom/body without setting its position,
it's likely created at the origin, and thus immediately penetrating the
plane (in fact, the plane would split it in half). Try setting the geom
position to some positive height (greater than the radius) and see if that
works.
Also, to set the sphere's mass by value rather than by density, use
dMassSetSphereTotal, the *Total versions of these functions accept total
mass as an argument.
-Elijah
On 8/7/06, Anna-Beth Fox <anna_beth_fox at yahoo.com.au> wrote:
>
> Hello again all,
>
> I have setup a simple ODE test bed for experiments and the like and when I
> create a plane (for the floor/ground representation) and a sphere, the
> sphere "sinks" into the plane under gravity. For example:
>
> ...
> dMass m;
>
> my_world = dWorldCreate();
> my_space = dHashSpaceCreate(NULL);
> contact_group = dJointGroupCreate(0);
> dWorldSetGravity(my_world, 0.0f, -9.81f, 0.0f);
> dWorldSetCFM(my_world, 0.0001f);
> dWorldSetContactMaxCorrectingVel(my_world, 0.1f);
> dWorldSetContactSurfaceLayer(my_world, 0.0001f);
> dCreatePlane(my_space, 0.0f, 1.0f, 0.0f, 0.0f); // Floor
>
> the_ball.body = dBodyCreate(my_world);
> the_ball.geom = dCreateSphere(my_space, 0.5f);
> dGeomSetBody(the_ball.geom, the_ball.body);
>
> dMassSetZero(&m);
> dMassSetSphere(&m, 5.0f, 0.5f); // Really any density greater than
> 2.0!!!
> dBodySetMass(the_ball.body, &m);
>
> What's the issue here? What am I missing or stuffed up? And how do I set
> the mass of the sphere to be like 21Kg.
>
> TIA peeps.
>
> Anna-Beth
>
> Send instant messages to your online friends http://au.messenger.yahoo.com
>
> _______________________________________________
> ODE mailing list
> ODE at q12.org
> http://q12.org/mailman/listinfo/ode
>
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://q12.org/pipermail/ode/attachments/20060807/28aeeb90/attachment.htm
More information about the ODE
mailing list