[ODE] geoms having the same position

Megan Fox shalinor at gmail.com
Tue Oct 4 08:51:07 MST 2005


... and even if you are already creating static geometry, make SURE
you have something like this in your collision callback:

    // Early-out chance - ditches disabled bodies colliding with other
disabled bodies, as well
    // as disabled bodies vs world.  Also catches world vs world.
    dBodyID o1Body = nOpende::GeomGetBody(o1);
    dBodyID o2Body = nOpende::GeomGetBody(o2);

    bool o1Enabled = false;
    bool o2Enabled = false;

    if (o1Body)
        o1Enabled = nOpende::BodyIsEnabled(o1Body);
    if (o2Body)
        o2Enabled = nOpende::BodyIsEnabled(o2Body);

    // Two disabled bodies have no forces, and so can not collide
    // (this also catches static/static)
    if (!o1Enabled && !o2Enabled)
        return;


... otherwise, you'll spend horrible amounts of time in dCollide or
elsewhere on collisions that can't possibly generate contacts anyways.
 This was a big win in my test scene.

I haven't tested it, but it also seems as if it might end up being
faster if you were to use the collision groups to set it up such that
the world collided with everything but itself (since I think that
rejection would happen earlier in the code than the dCollide function,
right?) - but even this simple little mod will help a lot.

On 10/4/05, Rodrigo Hernandez <kwizatz at aeongames.com> wrote:
>
> Are you creating bodies for your level walls and floors? for static
> geometry, you shouldnt create bodies, just the geometry.
>
> Jorrit Tyberghein wrote:
>
> >I'm the original person with the problem. The 1223 geoms are not in
> >the same place. They just connect with each other. i.e. the 1223 geoms
> >represent walls and floors for a big maze like level.
> >
> >This should be a very common situation. I don't understand how ODE
> >cannot cope with this.
> >
> >Greetings,
> >
> >
>
> _______________________________________________
> ODE mailing list
> ODE at q12.org
> http://q12.org/mailman/listinfo/ode
>


--
-Megan Fox
Lead Developer, Elium Project
http://www.elium.tk



More information about the ODE mailing list