Climbing hills

Hello jMonkeys!



Is it possible to find the angle of intersection between a ray & a model? I fire a ray down towards the center of a planet to determine where to position my player on the surface but I'd like to make it harder to walk up slopes. I'm using JME2.0 & don't use jme-Physics at the moment.



Thanks  :D.

Good idea. I'll try using two rays and calculating the slope that way  :D.

So you already to intersection with TrianglePick? If yes you get a bunch (0…n) intersections that the ray hits. If using checkDistance(true) they are sorted from the lowest to the farest. On this TrianglePickDatas you can call .getIntersectionPoint() which should be the triangle of the model that is hit by the ray. 



To the slopes…That is a good question. I once made something like walking around for a 3rd person-test and I used 2 rays. On a bit in front of my character and one directly above my character. Both using with a ray (0,-1,0) from the same height. Then I calculated the distance of both rays to the ground and calculated the delta. So you could even see if the character is awalking up and down. Actually it worked quite ok.



Maybe that helped.