diff --git a/configure.py b/configure.py index cc5846d4..a8abb782 100755 --- a/configure.py +++ b/configure.py @@ -41,6 +41,7 @@ COMPLETE_OBJECTS = [ "Kyoto/Math/CVector3d", "Kyoto/Math/CVector3i", "Kyoto/Math/CloseEnough", + "Kyoto/Math/CSphere", "Kyoto/CRandom16", "Kyoto/CCrc32", "Kyoto/Alloc/CCircularBuffer", diff --git a/include/Kyoto/Math/CSphere.hpp b/include/Kyoto/Math/CSphere.hpp index cb206eaf..e925a2e5 100644 --- a/include/Kyoto/Math/CSphere.hpp +++ b/include/Kyoto/Math/CSphere.hpp @@ -4,12 +4,13 @@ #include "types.h" #include "Kyoto/Math/CVector3f.hpp" +#include "Kyoto/Math/CUnitVector3f.hpp" class CSphere { public: CSphere(const CVector3f& pos, f32 radius) : x0_pos(pos), xc_radius(radius) {} - // TODO + CUnitVector3f GetSurfaceNormal(const CVector3f& v) const; private: CVector3f x0_pos; diff --git a/obj_files.mk b/obj_files.mk index e12aa592..7a9d3473 100644 --- a/obj_files.mk +++ b/obj_files.mk @@ -544,7 +544,7 @@ KYOTO_1 :=\ $(BUILD_DIR)/asm/Kyoto/Particles/CVectorElement.o\ $(BUILD_DIR)/src/Kyoto/Particles/CWarp.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/CFactoryMgr.o\ $(BUILD_DIR)/asm/Kyoto/CResFactory.o\ diff --git a/src/Kyoto/Math/CSphere.cpp b/src/Kyoto/Math/CSphere.cpp new file mode 100644 index 00000000..e9c6d470 --- /dev/null +++ b/src/Kyoto/Math/CSphere.cpp @@ -0,0 +1,5 @@ +#include "Kyoto/Math/CSphere.hpp" + +CUnitVector3f CSphere::GetSurfaceNormal(const CVector3f& vec) const { + return CUnitVector3f(vec - x0_pos); +}