From 9bb8ebaa1011dc1dc70e3d5bf70c9a55c44b976c Mon Sep 17 00:00:00 2001 From: Sergeanur Date: Sat, 14 Nov 2020 22:13:32 +0200 Subject: Make collision code placement more like original (+ small fixes) # Conflicts: # premake5.lua # src/CMakeLists.txt # src/collision/Collision.cpp # src/core/Collision.h --- src/collision/ColSphere.h | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) create mode 100644 src/collision/ColSphere.h (limited to 'src/collision/ColSphere.h') 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 ¢er) { this->center = center; this->radius = radius; } +}; + +struct CColSphere : public CSphere +{ + uint8 surface; + uint8 piece; + + void Set(float radius, const CVector ¢er, 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 -- cgit v1.2.3