[ODE] Can't seem to make parallel opposing planes

John Miles jmiles at pop.net
Sat Nov 13 15:35:44 MST 2004


The way different systems deal with the sign of their plane D-coefficients
can require some trial and error to get right.  Here's what works for me,
with positive X/Z_0/1 limits...

-- jm


if (boundary_texture != 0)
      {
      //
      // Use planes for boundary physics representation (higher collision
quality
      // than trimesh)
      //
      // Boundary planes are placed one meter inside the space's borders to
keep
      // epsilon problems and collision penetration from allowing vertices
to protrude
      // out of the space.  If we didn't do this, we'd need a lot of extra
clamping checks
      // in L_CACHE, among other things
      //

      dReal planes[5][4] =
         {{ -1.0F, 0.0F,  0.0F, -X1_limit },       // R
          {  1.0F, 0.0F,  0.0F,  X0_limit },       // L
          {  0.0F, 0.0F, -1.0F, -Z1_limit },       // B
          {  0.0F, 0.0F,  1.0F,  Z0_limit },       // T
          {  0.0F, 1.0F,  0.0F,  boundary_Y  }};   // floor

      S32 a,d,p;

      for (p=0; p < 5; p++)
         {
         boundary_planes[p] = dCreatePlane(collision_set,
                                           planes[p][0],
                                           planes[p][1],
                                           planes[p][2],
                                           planes[p][3]);

         dGeomSetCategoryBits(boundary_planes[p],
                              1);

         dGeomSetCollideBits(boundary_planes[p],
                             0);
         }



More information about the ODE mailing list