Page 1 of 1

Simple collision against heightmap

Posted: Tue Feb 24, 2009 3:44 pm
by Valmond
Hi !

I'd like to check for collisions in a "manual" way and decide what should happen to my camera when that happens.

What would the easiest way be to check say an ellipse (or circle) against a height map ?

Secondary, same question but with an arbitrary mesh.

Posted: Wed Feb 25, 2009 2:48 am
by Moo
You can take a look at:
Tutorial #12. Take a specific look at the part that says
If you need access to the terrain data you can also do this directly via the following code fragment.
. Good luck!

Posted: Wed Feb 25, 2009 6:32 am
by Brainsaw
There is a function in the terrain scenenode that gives you the height on a specific (x,z) position. That should help you.

Posted: Wed Feb 25, 2009 8:45 am
by Valmond
I'm already using the height() making my player go up hills and so but the terrain->getMeshBufferForLOD(...) is probably what I need, thanks for the helps !