Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function isInArea(target: vector, loc1: vector, loc2: vector) :: boolean:
- set {_xt} to x-coord of {_target}
- set {_yt} to y-coord of {_target}
- set {_zt} to z-coord of {_target}
- set {_x1} to x-coord of {_loc1}
- set {_y1} to y-coord of {_loc1}
- set {_z1} to z-coord of {_loc1}
- set {_x2} to x-coord of {_loc2}
- set {_y2} to y-coord of {_loc2}
- set {_z2} to z-coord of {_loc2}
- if check [{_xt} <= {_x1}] -> [{_xt} >= {_x2}]:
- if check [{_yt} <= {_y1}] -> [{_yt} >= {_y2}]:
- if check [{_zt} <= {_z1}] -> [{_zt} >= {_z2}]:
- return true
- else if check [{_zt} >= {_z1}] -> [{_zt} <= {_z2}]:
- return true
- else if check [{_yt} >= {_y1}] -> [{_yt} <= {_y2}]:
- if check [{_zt} <= {_z1}] -> [{_zt} >= {_z2}]:
- return true
- else if check [{_zt} >= {_z1}] -> [{_zt} <= {_z2}]:
- return true
- else if check [{_xt} >= {_x1}] -> [{_xt} <= {_x2}]:
- if check [{_yt} <= {_y1}] -> [{_yt} >= {_y2}]:
- if check [{_zt} <= {_z1}] -> [{_zt} >= {_z2}]:
- return true
- else if check [{_zt} >= {_z1}] -> [{_zt} <= {_z2}]:
- return true
- else if check [{_yt} >= {_y1}] -> [{_yt} <= {_y2}]:
- if check [{_zt} <= {_z1}] -> [{_zt} >= {_z2}]:
- return true
- else if check [{_zt} >= {_z1}] -> [{_zt} <= {_z2}]:
- return true
- return false
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement