So, I have built a simple .egg cube:
everything is working as expected My Ball can collide with it for ever and ever and the surfacenormal is normal.
but as soon as I go back to the game environment --built in Blender and chikened to egg-- My Ball,after hitting the box there for some events throws a wrong surfaceNormal.
It’s a normal for a different face. The box in the environment is a cube one face on the x,y Plane and one other on the x,z plane. I bounce the sphere for some time on the x,z plane and suddenly I get the normal for the upper x,y Plane.
At the moment I’m checking the .egg for faults.
By the way does anybody know how the magnitude of the normal is computed?
Well, are you certain that the sphere didn’t intersect with the upper x,y face? The collision that you’re reporting might well indicate a collision with that face. You can check entry.getInto() to return the particular CollisionSolid that it detected a collision with; check to see whether it is the CollisionPolygon that corresponds to the upper face.
Note that a certain amount of error in collision detection is normal. It is designed to be fast and reasonably accurate, but it cannot be 100% accurate. This means you may occasionally detect collisions where there should have been none; or you may occasionally miss collisions where they should have been detected.