TriMesh buggy?

I’ve created a small test case in Xith3D with an avatar controlled with the mouse and a four-walls-room. The walls are joode-represended by boxes, which works pretty well. The avatar is a Capsule (the same behavior for a sphere). Now when I create a TriMesh for the walls from the exact same vertex data, I can walk through the very right end of each wall. Is the TriMesh possibly buggy?

If you want to have a look at my test case, go to org.xith3d.test.input.FirstPersonInputHandlerTest (xith-tk).

Marvin

Its not a collider I have debugged, or developed.

I’ve talked to Arne and we found the reason for this problem. The TriMesh only works, if the triangles have a certain vertex/index order. If the colliding geom is coming from the wrong/unexpected direction, the collision normal is calculated to head in the wrong direction. I’ve already tried to fix that, but it doesn’t behave precisely correct, if I simply flip this normal. Would be very cool, if you could have look at it.

My thought to solve it was to calculate the angle between the linear velocity of the colliding geom and the TriMesh’es colliding face’s normal. And if, this angle is greater than 90°, the collision normal would have to be flipped.

Marvin