Match and link CSphere

Former-commit-id: 68616cba51
This commit is contained in:
Phillip Stephens 2022-10-05 16:45:48 -07:00
parent 8346d160f6
commit 96236df954
4 changed files with 9 additions and 2 deletions

View File

@ -41,6 +41,7 @@ COMPLETE_OBJECTS = [
"Kyoto/Math/CVector3d", "Kyoto/Math/CVector3d",
"Kyoto/Math/CVector3i", "Kyoto/Math/CVector3i",
"Kyoto/Math/CloseEnough", "Kyoto/Math/CloseEnough",
"Kyoto/Math/CSphere",
"Kyoto/CRandom16", "Kyoto/CRandom16",
"Kyoto/CCrc32", "Kyoto/CCrc32",
"Kyoto/Alloc/CCircularBuffer", "Kyoto/Alloc/CCircularBuffer",

View File

@ -4,12 +4,13 @@
#include "types.h" #include "types.h"
#include "Kyoto/Math/CVector3f.hpp" #include "Kyoto/Math/CVector3f.hpp"
#include "Kyoto/Math/CUnitVector3f.hpp"
class CSphere { class CSphere {
public: public:
CSphere(const CVector3f& pos, f32 radius) : x0_pos(pos), xc_radius(radius) {} CSphere(const CVector3f& pos, f32 radius) : x0_pos(pos), xc_radius(radius) {}
// TODO CUnitVector3f GetSurfaceNormal(const CVector3f& v) const;
private: private:
CVector3f x0_pos; CVector3f x0_pos;

View File

@ -544,7 +544,7 @@ KYOTO_1 :=\
$(BUILD_DIR)/asm/Kyoto/Particles/CVectorElement.o\ $(BUILD_DIR)/asm/Kyoto/Particles/CVectorElement.o\
$(BUILD_DIR)/src/Kyoto/Particles/CWarp.o\ $(BUILD_DIR)/src/Kyoto/Particles/CWarp.o\
$(BUILD_DIR)/src/Kyoto/Math/CPlane.o\ $(BUILD_DIR)/src/Kyoto/Math/CPlane.o\
$(BUILD_DIR)/asm/Kyoto/Math/CSphere.o\ $(BUILD_DIR)/src/Kyoto/Math/CSphere.o\
$(BUILD_DIR)/asm/Kyoto/Math/CAABox.o\ $(BUILD_DIR)/asm/Kyoto/Math/CAABox.o\
$(BUILD_DIR)/asm/Kyoto/CFactoryMgr.o\ $(BUILD_DIR)/asm/Kyoto/CFactoryMgr.o\
$(BUILD_DIR)/asm/Kyoto/CResFactory.o\ $(BUILD_DIR)/asm/Kyoto/CResFactory.o\

View File

@ -0,0 +1,5 @@
#include "Kyoto/Math/CSphere.hpp"
CUnitVector3f CSphere::GetSurfaceNormal(const CVector3f& vec) const {
return CUnitVector3f(vec - x0_pos);
}