Jump to content
gc8

Checking for terrain angle

Recommended Posts

Hi

I ran to bit of math problem when I wanted the check if terrain is flat enough for helicopter to land.

 

 

I am trying to get the terrain's angle (at players position) like this:

 

_angle = [0,0,1] vectorCos (surfaceNormal getpos player) 

 

But I'm unsure if that math is valid?

 

then I would like to convert the angle to degress. I tried this:

_degrees = _angle * (180 / pi)

 

Any help is appreciated 🙂

thx

Share this post


Link to post
Share on other sites

_degree = aCos ([0,0,1] vectorCos (surfaceNormal getPos player));

  • Like 4
  • Thanks 1

Share this post


Link to post
Share on other sites
23 hours ago, target_practice said:

There is also the (somewhat buggy) isFlatEmpty command, although I am yet to test it myself.

 

Yeah I have used it before and had some problems and I don't remember if checking even terrain worked.

I made my own little function for finding even terrain, no big deal

Share this post


Link to post
Share on other sites

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now

×