Advertisement
sumguytwitches

Untitled

Mar 14th, 2021
120
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.61 KB | None | 0 0
  1. function norm {
  2. parameter p0 is v(0,0,0).
  3. set u to (p0-body:position):normalized.
  4. set p1 to vxcl(u,facing:vector):normalized * (bnds:size:mag + 5).
  5. set g2 to body:geopositionof(angleaxis(120, u) * p1 + p0). set p2 to choose g2:position if g2:terrainheight > 0 else g2:altitudeposition(0).
  6. set g3 to body:geopositionof(angleaxis(-120, u) * p1 + p0). set p3 to choose g3:position if g3:terrainheight > 0 else g3:altitudeposition(0).
  7. set g1 to body:geopositionof(p1 + p0). set p1 to choose g1:position if g1:terrainheight > 0 else g1:altitudeposition(0).
  8. return vcrs(p1-p2,p1-p3):normalized.
  9. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement