Intersection and Penetration Depth

So it has been two weeks since I started translating C++ SOLID code into Java code. Over the Thanksgiving weekend I intensely debugged my code such that it now runs reasonablely. One notable bug I have is that within the subroutine I cannot simply reassign the argument variable to a new object.

void test() {
Vector3d v = new Vector3d();
foo(v);
System.out.println(v.x + " " + v.y + " " + v.z); // still (0.0, 0.0, 0.0)
}

void foo(Vector3d v) {
Vector3d a = new Vector3d(1.0, 2.0, 3.0);
v = a; // this has no effect on v
}

When checking the results from Penetration.java, it is found that the calculation of penetration depth is soemewhat unstable and slow. My to-do list will just have to expand:
  • To understand the GJK algorithm more deeply.
  • To thoroughly test my current implementation.

I think it is quite reasonable to assume only one contact point when two convex objects contact or intersect/impact. Thus the penetration depth and the impact normal can be conveniently calculated from the GJK subroutines. I implemented this idea by modifying BoxBoxCollider.java today and the test results are satisfactory so far with minor observed intersections. The results certainly look better than the ODE implementation, which I don't fully understand either. Let's assume now the convex problems are resolved. Then I still need to investigate the complex/trimesh problems. More items on to-do list:
  • Check SOLID complex package and try to implement a corresponding one for my trimesh. Can RAPID code be integrated here?
  • Try two packaging and delivery methods - applet and web start.

Comments