2022-10-09 05:13:17 +00:00
|
|
|
#ifndef _CSPHERE
|
|
|
|
#define _CSPHERE
|
2022-09-29 23:55:38 +00:00
|
|
|
|
|
|
|
#include "types.h"
|
|
|
|
|
2022-10-05 23:45:48 +00:00
|
|
|
#include "Kyoto/Math/CUnitVector3f.hpp"
|
2022-10-09 05:13:17 +00:00
|
|
|
#include "Kyoto/Math/CVector3f.hpp"
|
2022-09-29 23:55:38 +00:00
|
|
|
|
|
|
|
class CSphere {
|
|
|
|
public:
|
2022-12-31 22:07:51 +00:00
|
|
|
CSphere(const CVector3f& pos, float radius) : x0_center(pos), xc_radius(radius) {}
|
2022-09-29 23:55:38 +00:00
|
|
|
|
2024-10-14 05:00:50 +00:00
|
|
|
const CVector3f& GetCenter() const { return x0_center; }
|
|
|
|
const float GetRadius() const { return xc_radius; }
|
2022-10-05 23:45:48 +00:00
|
|
|
CUnitVector3f GetSurfaceNormal(const CVector3f& v) const;
|
2022-09-29 23:55:38 +00:00
|
|
|
|
|
|
|
private:
|
2022-12-31 22:07:51 +00:00
|
|
|
CVector3f x0_center;
|
2022-10-09 05:37:23 +00:00
|
|
|
float xc_radius;
|
2022-09-29 23:55:38 +00:00
|
|
|
};
|
|
|
|
CHECK_SIZEOF(CSphere, 0x10)
|
|
|
|
|
2022-10-09 05:13:17 +00:00
|
|
|
#endif // _CSPHERE
|