[ODE] ODE .NET

Manox manoxik at seznam.cz
Fri Jun 8 03:46:15 MST 2007


Hi

I'm using .NET wrapper for c#. But I have some problems :

I have :

static void CollideCallback(IntPtr space, IntPtr o1, IntPtr o2)
    {
      IntPtr b1 = d.GeomGetBody(o1);
      IntPtr b2 = d.GeomGetBody(o2);

      if (b1 != IntPtr.Zero && b2 != IntPtr.Zero && d.AreConnected(b1, b2))
        return;

      int count = d.Collide(o1, o2, MAX_CONTACTS, contacts, 
d.ContactGeom.SizeOf);
      for (int i = 0; i < count; ++i)
      {
        contact.geom = contacts[i];
        IntPtr joint = d.JointCreateContact(_world, _contactgroup, ref 
contact);
        d.JointAttach(joint, b1, b2);
      }
    }


When I use trimesh geom, it throws : AccesViolationException - Attempted 
to read or write protected memory ....
on line - int count = d.Collide(o1, o2, MAX_CONTACTS, contacts, 
d.ContactGeom.SizeOf);

If I use plane, it's ok. The second geom is sphere.

I create trimesh :
        vrcholy = new double[count * 9];
        indices = new int[count * 3];

        temp = d.GeomTriMeshDataCreate();

      d.GeomTriMeshDataBuildDouble(temp, vrcholy, 24, vrcholy.Length / 
3, indices, indices.Length, 12);
      d.GeomTriMeshDataPreprocess(temp);

      geom = d.CreateTriMesh(this._space, temp, tricall, arraycall, 
raycall);

And the second problem is, I have hinge2 joint between car body and 
wheel. After collision of wheel and terrain, it will change on contact 
joint and I don't know why :-(

Thanks, and sorry for my english, it isn't perfect :-(


More information about the ODE mailing list