Heightfield collision

Crashy

19-03-2012 12:26:00

Hello,

I'm using an heightfield collision to manage collisions with Ogre terrain, I use newton 2 and ogrenewt 2, both last version, and I'm facing two problems:

-Sometimes objects fall through the terrain.
-ray casting quite never works.

My world is quite big and moving objects are fast and relatively small, the newton world is 100 000 units wide, the terrain is 50 000 units wide (I need to have some extra space around the terrain), moving objects are 20 units long and moves at 100 units / seconds.

Moving object versus moving object collision are working good, but not moving object against terrain, and I don't know why sometimes it works and sometimes not.

Also notice that I've got the same issues when I use double precision.


Thanks for any help.

Crashy

21-03-2012 12:45:57

Okay I think I've found the problem.

In Ogrenewt the horizontal scale was computed like this

Ogre::Real horizontalScale = (terrain->getWorldSize()
/ (terrain->getSize() -2 ));



And I've replaced this by this code

Ogre::Real horizontalScale = (terrain->getWorldSize()
/ (terrain->getSize() ));


Now after a few tests I've never seen collision problems.