summaryrefslogtreecommitdiffstats
path: root/src/core/Collision.cpp
diff options
context:
space:
mode:
authorNikolay Korolev <nickvnuk@gmail.com>2020-05-06 18:04:52 +0200
committerNikolay Korolev <nickvnuk@gmail.com>2020-05-06 18:04:52 +0200
commitd5e76471ae48bd3a31edb987d1c5366e7a67b3e2 (patch)
tree07a8ff3df033c62c58b6d27dfb94227e92b384c9 /src/core/Collision.cpp
parentMerge remote-tracking branch 'upstream/miami' into miami (diff)
parentCSphere and CBox for CColModel (diff)
downloadre3-d5e76471ae48bd3a31edb987d1c5366e7a67b3e2.tar
re3-d5e76471ae48bd3a31edb987d1c5366e7a67b3e2.tar.gz
re3-d5e76471ae48bd3a31edb987d1c5366e7a67b3e2.tar.bz2
re3-d5e76471ae48bd3a31edb987d1c5366e7a67b3e2.tar.lz
re3-d5e76471ae48bd3a31edb987d1c5366e7a67b3e2.tar.xz
re3-d5e76471ae48bd3a31edb987d1c5366e7a67b3e2.tar.zst
re3-d5e76471ae48bd3a31edb987d1c5366e7a67b3e2.zip
Diffstat (limited to 'src/core/Collision.cpp')
-rw-r--r--src/core/Collision.cpp8
1 files changed, 4 insertions, 4 deletions
diff --git a/src/core/Collision.cpp b/src/core/Collision.cpp
index 61cb14db..48abbd9a 100644
--- a/src/core/Collision.cpp
+++ b/src/core/Collision.cpp
@@ -130,14 +130,14 @@ CCollision::LoadCollisionScreen(eLevelName level)
bool
-CCollision::TestSphereSphere(const CColSphere &s1, const CColSphere &s2)
+CCollision::TestSphereSphere(const CSphere &s1, const CSphere &s2)
{
float d = s1.radius + s2.radius;
return (s1.center - s2.center).MagnitudeSqr() < d*d;
}
bool
-CCollision::TestSphereBox(const CColSphere &sph, const CColBox &box)
+CCollision::TestSphereBox(const CSphere &sph, const CBox &box)
{
if(sph.center.x + sph.radius < box.min.x) return false;
if(sph.center.x - sph.radius > box.max.x) return false;
@@ -149,7 +149,7 @@ CCollision::TestSphereBox(const CColSphere &sph, const CColBox &box)
}
bool
-CCollision::TestLineBox(const CColLine &line, const CColBox &box)
+CCollision::TestLineBox(const CColLine &line, const CBox &box)
{
float t, x, y, z;
// If either line point is in the box, we have a collision
@@ -234,7 +234,7 @@ CCollision::TestLineBox(const CColLine &line, const CColBox &box)
}
bool
-CCollision::TestVerticalLineBox(const CColLine &line, const CColBox &box)
+CCollision::TestVerticalLineBox(const CColLine &line, const CBox &box)
{
if(line.p0.x <= box.min.x) return false;
if(line.p0.y <= box.min.y) return false;