Terrain Collision!

BlitzMax Forums/BlitzMax Beginners Area/Terrain Collision!

Link(Posted 2008) [#1]
So I loaded a terrain called (none other than) terrain, and a different one that "hugs" it (goes around it), so that when you go to that terrain you cant leave the terrain. problem is, im going by the example that comes with the loadterrain command, SO what im thinking is is there a way that i can make each terrain's properties different, or is there a different way to do it, if you have an idea on how to stop when the terrain gets too steep that would be sooooooooOOOOoOOoOOoOo helpful

Txs!


-Link!


Dreamora(Posted 2008) [#2]
there are different possibilities:

1. Use terrainy at your current position and the position you would have on the next frame (x,z) and use that to calculate the steepness -> fastest most likely

2. make it pickable, do a vertical line pick and use PickedNY. the smaller it is, the steeper the surface is.


Link(Posted 2008) [#3]
could you give me an example on how to use it wit h a terrain plz?
txs


Dreamora(Posted 2008) [#4]
sure

 y = terrainy( terrain, entityx(player), entityz(player))
 tformpoint 0,0,steplength, player, 0
 dy = terrainy( terrain, entityx(player)+tformedx(), entityz(player)+tformedz() ) ; height after the next step
 if abs(y-dy) > maxStepHeight
  ; do not allow the step
 endif


but I just realized that this is in the totally wrong board, could someone move it to b3d?


Link(Posted 2008) [#5]
:( aww man