Make collision code placement more like original (+ small fixes)

# Conflicts:
#	premake5.lua
#	src/CMakeLists.txt
#	src/collision/Collision.cpp
#	src/core/Collision.h
This commit is contained in:
Sergeanur
2020-11-14 22:13:32 +02:00
parent 26c6908d25
commit 9bb8ebaa10
26 changed files with 953 additions and 873 deletions

21
src/collision/ColSphere.h Normal file
View File

@@ -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;
};