Merge pull request #42 from s-ol/bound2-fix

fix bound2:contains()
This commit is contained in:
mcclure 2019-11-01 10:43:07 -04:00 committed by GitHub
commit 6c49915112
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 4 additions and 2 deletions

View File

@ -54,6 +54,8 @@ local files = {
"utils",
"vec2",
"vec3",
"bound2",
"bound3",
}
for _, file in ipairs(files) do

View File

@ -148,8 +148,8 @@ end
-- @tparam vec2 point to test
-- @treturn boolean true if point in bounding box
function bound2.contains(a, v)
return a.min.x <= v.x and a.min.y <= v.y and a.min.z <= v.z
and a.max.x >= v.x and a.max.y >= v.y and a.max.z >= v.z
return a.min.x <= v.x and a.min.y <= v.y
and a.max.x >= v.x and a.max.y >= v.y
end
bound2_mt.__index = bound2