Advertisement
Guest User

Untitled

a guest
Feb 22nd, 2020
123
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.25 KB | None | 0 0
  1. function isInArea(target: vector, loc1: vector, loc2: vector) :: boolean:
  2. set {_xt} to x-coord of {_target}
  3. set {_yt} to y-coord of {_target}
  4. set {_zt} to z-coord of {_target}
  5. set {_x1} to x-coord of {_loc1}
  6. set {_y1} to y-coord of {_loc1}
  7. set {_z1} to z-coord of {_loc1}
  8. set {_x2} to x-coord of {_loc2}
  9. set {_y2} to y-coord of {_loc2}
  10. set {_z2} to z-coord of {_loc2}
  11. if check [{_xt} <= {_x1}] -> [{_xt} >= {_x2}]:
  12. if check [{_yt} <= {_y1}] -> [{_yt} >= {_y2}]:
  13. if check [{_zt} <= {_z1}] -> [{_zt} >= {_z2}]:
  14. return true
  15. else if check [{_zt} >= {_z1}] -> [{_zt} <= {_z2}]:
  16. return true
  17. else if check [{_yt} >= {_y1}] -> [{_yt} <= {_y2}]:
  18. if check [{_zt} <= {_z1}] -> [{_zt} >= {_z2}]:
  19. return true
  20. else if check [{_zt} >= {_z1}] -> [{_zt} <= {_z2}]:
  21. return true
  22. else if check [{_xt} >= {_x1}] -> [{_xt} <= {_x2}]:
  23. if check [{_yt} <= {_y1}] -> [{_yt} >= {_y2}]:
  24. if check [{_zt} <= {_z1}] -> [{_zt} >= {_z2}]:
  25. return true
  26. else if check [{_zt} >= {_z1}] -> [{_zt} <= {_z2}]:
  27. return true
  28. else if check [{_yt} >= {_y1}] -> [{_yt} <= {_y2}]:
  29. if check [{_zt} <= {_z1}] -> [{_zt} >= {_z2}]:
  30. return true
  31. else if check [{_zt} >= {_z1}] -> [{_zt} <= {_z2}]:
  32. return true
  33. return false
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement