diff options
author | Tiger Wang <ziwei.tiger@outlook.com> | 2022-07-11 00:55:11 +0200 |
---|---|---|
committer | Tiger Wang <ziwei.tiger@outlook.com> | 2022-07-19 23:33:09 +0200 |
commit | cd97aa83307ce33068082dc57deee8d922fec432 (patch) | |
tree | 7ea02bf81e102e80df32d527a085c3ecd3f66d44 /src/BoundingBox.cpp | |
parent | ClientHandle: fix incorrect position floor (diff) | |
download | cuberite-Pickups.tar cuberite-Pickups.tar.gz cuberite-Pickups.tar.bz2 cuberite-Pickups.tar.lz cuberite-Pickups.tar.xz cuberite-Pickups.tar.zst cuberite-Pickups.zip |
Diffstat (limited to '')
-rw-r--r-- | src/BoundingBox.cpp | 16 |
1 files changed, 6 insertions, 10 deletions
diff --git a/src/BoundingBox.cpp b/src/BoundingBox.cpp index 1356e165c..649850267 100644 --- a/src/BoundingBox.cpp +++ b/src/BoundingBox.cpp @@ -101,7 +101,7 @@ void cBoundingBox::Expand(double a_ExpandX, double a_ExpandY, double a_ExpandZ) -bool cBoundingBox::DoesIntersect(const cBoundingBox & a_Other) +bool cBoundingBox::DoesIntersect(const cBoundingBox & a_Other) const { return ( ((a_Other.m_Min.x <= m_Max.x) && (a_Other.m_Max.x >= m_Min.x)) && // X coords intersect @@ -114,7 +114,7 @@ bool cBoundingBox::DoesIntersect(const cBoundingBox & a_Other) -cBoundingBox cBoundingBox::Union(const cBoundingBox & a_Other) +cBoundingBox cBoundingBox::Union(const cBoundingBox & a_Other) const { return cBoundingBox( std::min(m_Min.x, a_Other.m_Min.x), @@ -130,7 +130,7 @@ cBoundingBox cBoundingBox::Union(const cBoundingBox & a_Other) -bool cBoundingBox::IsInside(Vector3d a_Point) +bool cBoundingBox::IsInside(Vector3d a_Point) const { return IsInside(m_Min, m_Max, a_Point); } @@ -139,7 +139,7 @@ bool cBoundingBox::IsInside(Vector3d a_Point) -bool cBoundingBox::IsInside(double a_X, double a_Y, double a_Z) +bool cBoundingBox::IsInside(double a_X, double a_Y, double a_Z) const { return IsInside(m_Min, m_Max, a_X, a_Y, a_Z); } @@ -148,7 +148,7 @@ bool cBoundingBox::IsInside(double a_X, double a_Y, double a_Z) -bool cBoundingBox::IsInside(cBoundingBox & a_Other) +bool cBoundingBox::IsInside(cBoundingBox & a_Other) const { // If both a_Other's coords are inside this, then the entire a_Other is inside return (IsInside(a_Other.m_Min) && IsInside(a_Other.m_Max)); @@ -158,7 +158,7 @@ bool cBoundingBox::IsInside(cBoundingBox & a_Other) -bool cBoundingBox::IsInside(Vector3d a_Min, Vector3d a_Max) +bool cBoundingBox::IsInside(Vector3d a_Min, Vector3d a_Max) const { // If both coords are inside this, then the entire a_Other is inside return (IsInside(a_Min) && IsInside(a_Max)); @@ -287,7 +287,3 @@ bool cBoundingBox::Intersect(const cBoundingBox & a_Other, cBoundingBox & a_Inte a_Intersection.m_Max.z = std::min(m_Max.z, a_Other.m_Max.z); return (a_Intersection.m_Min.z < a_Intersection.m_Max.z); } - - - - |