[ODE] Mixing simulation with basic keyframe data.

Roel van Dijk roelvandijk at home.nl
Thu Jul 3 00:11:01 2003


On Thursday 03 July 2003 01:24, George McBay wrote:
> My end goal is just a simple way to transfer the
> position and rotation information from my animated
> geometry nodes back into my ODE geoms.  I don't want
> the ODE geoms I'm moving to really be impacted by the
> simulation (I don't want gravity acting on them, which
> is easy enough to disable, but I also don't want my
> vehicle smashing into them to move them, which is a
> fair bit harder, it seems).  But I also want my
> vehicle to be able to impact with them, and ride on
> these geoms as it currently can when they are static.
You could check in your nearCallback funcion what geoms are colliding. If a 
geom belongs to the scenery then you only attach a contact joint to the car 
and to the static environment.

if (!(o1 is scenery && o2 is scenery))
{
  if (o1 is car && o2 is scenery) 
  {
    ...
    ...
    dJointAttach(
      c, // contact joint
      dGeomGetBody(contact[i].geom.g1), // car body
      0); // static environment
  }
}

This way the scenery objects aren't affected by collisions. I have tried it in 
my program and it works.