summaryrefslogtreecommitdiffstats
path: root/src/collision/ColSphere.h
diff options
context:
space:
mode:
authorSergeanur <s.anureev@yandex.ua>2020-11-14 21:13:32 +0100
committerSergeanur <s.anureev@yandex.ua>2020-11-15 23:36:54 +0100
commit9bb8ebaa1011dc1dc70e3d5bf70c9a55c44b976c (patch)
tree3dcbab653ba34fa1fdc273887bd377603c4ff4f2 /src/collision/ColSphere.h
parentcar AI revision (diff)
downloadre3-9bb8ebaa1011dc1dc70e3d5bf70c9a55c44b976c.tar
re3-9bb8ebaa1011dc1dc70e3d5bf70c9a55c44b976c.tar.gz
re3-9bb8ebaa1011dc1dc70e3d5bf70c9a55c44b976c.tar.bz2
re3-9bb8ebaa1011dc1dc70e3d5bf70c9a55c44b976c.tar.lz
re3-9bb8ebaa1011dc1dc70e3d5bf70c9a55c44b976c.tar.xz
re3-9bb8ebaa1011dc1dc70e3d5bf70c9a55c44b976c.tar.zst
re3-9bb8ebaa1011dc1dc70e3d5bf70c9a55c44b976c.zip
Diffstat (limited to 'src/collision/ColSphere.h')
-rw-r--r--src/collision/ColSphere.h21
1 files changed, 21 insertions, 0 deletions
diff --git a/src/collision/ColSphere.h b/src/collision/ColSphere.h
new file mode 100644
index 00000000..f86b282a
--- /dev/null
+++ b/src/collision/ColSphere.h
@@ -0,0 +1,21 @@
+#pragma once
+
+#include "SurfaceTable.h"
+
+struct CSphere
+{
+ // NB: this has to be compatible with a CVuVector
+ CVector center;
+ float radius;
+ void Set(float radius, const CVector &center) { this->center = center; this->radius = radius; }
+};
+
+struct CColSphere : public CSphere
+{
+ uint8 surface;
+ uint8 piece;
+
+ void Set(float radius, const CVector &center, uint8 surf, uint8 piece);
+ bool IntersectRay(CVector const &from, CVector const &dir, CVector &entry, CVector &exit);
+ using CSphere::Set;
+}; \ No newline at end of file