[joode] TriMesh

Hi

I’m currently trying to implement TriMesh colliders for Sphere and so on, but I just happend to have found a bug, I produced into the TriMesh code, when transforming it away from javax.vecmath to the Joode vector classes. That bug is corrected, but it’s still not correct (but a lot better).
To get the buggy test-case, you’ll have to change the lines in TriMeshTriMeshTest specifying, what TriMeshes to collide, to make it collide two Pyramids.

Could someone please tell me, if that bug already existed before my changes removing the javax.vecmath dependency?

Arne

I have no idea, all that code was done by Art Pope.

Art answered me, seems the bug already existed before puh (or not, so it’s now much harder to fix :frowning: )

collision works, when the sphere hits a plane of the trimesh, but it behaves oddly, when it hits an edge. The response is way to high, and in collisions with that triangle-ball thingi it even gets the solver to hang (or something).

trimesh-sphere works now :slight_smile: At least I haven’t found testcases speaking against that :slight_smile:

Great ! A billion thanks, Arne !

TriMeshBox is implemented now, too. I just convert the Box into a TriMesh in the Collider. There may be some bugs in it though (espacially with not 2x2x2 boxes), because I use some crude trick (I misuse the rotation matrix to also contain scaling) to set the size of the box, so I don’t have to set the vertices all the time.

Come on, that’s a clever trick and if simple I hadn’t thought of it. But why in the world do you need to hack the rotation matrix to contain scaling, and how is it difficult to generate the triangles for a box ??
Ah, you mean a box dimension can change and that’s the problem ?

it was simply easier then resetting the vertices of the box (which isn’t that difficult easier), and I simply was to lazy, to test, if that improves the results.