mirror of
https://github.com/cyberarm/i-mic-fps.git
synced 2025-12-16 08:02:36 +00:00
Collision stuff
This commit is contained in:
@@ -42,8 +42,14 @@ class IMICFPS
|
||||
return temp
|
||||
end
|
||||
|
||||
# does this bounding box envelop other bounding box? (inclusive of border)
|
||||
def contains?(other)
|
||||
other.min.x >= min.x && other.min.y >= min.y && other.min.z >= min.z &&
|
||||
other.max.x <= max.x && other.max.y <= max.y && other.max.z <= max.z
|
||||
end
|
||||
|
||||
# returns whether the vector is inside of the bounding box
|
||||
def contains(vector)
|
||||
def point?(vector)
|
||||
vector.x.between?(@min.x, @max.x) &&
|
||||
vector.y.between?(@min.y, @max.y) &&
|
||||
vector.z.between?(@min.z, @max.z)
|
||||
|
||||
Reference in New Issue
Block a user