mirror of
https://github.com/PHIDIAS0303/ExpCluster.git
synced 2026-07-26 18:36:23 +09:00
Add AABB.size (#445)
This commit is contained in:
@@ -17,6 +17,13 @@ function AABB.valid(aabb)
|
||||
return aabb.left_top.x < aabb.right_bottom.x and aabb.left_top.y < aabb.right_bottom.y
|
||||
end
|
||||
|
||||
--- Returns the size of the area contained within an AABB
|
||||
--- @param aabb BoundingBox
|
||||
--- @return number
|
||||
function AABB.size(aabb)
|
||||
return (aabb.right_bottom.x - aabb.left_top.x) * (aabb.right_bottom.y - aabb.left_top.y)
|
||||
end
|
||||
|
||||
--- Clone an area, allows for safe mutation of an input value
|
||||
--- @param aabb BoundingBox
|
||||
--- @return BoundingBox
|
||||
|
||||
Reference in New Issue
Block a user