2022-10-09 05:13:17 +00:00
|
|
|
#ifndef _CRAYCASTRESULT
|
|
|
|
#define _CRAYCASTRESULT
|
2022-09-18 05:55:13 +00:00
|
|
|
|
|
|
|
#include "types.h"
|
|
|
|
|
|
|
|
#include "Kyoto/Math/CPlane.hpp"
|
|
|
|
#include "Kyoto/Math/CVector3f.hpp"
|
|
|
|
|
|
|
|
#include "Collision/CMaterialList.hpp"
|
|
|
|
|
|
|
|
class CRayCastResult {
|
|
|
|
public:
|
|
|
|
enum EInvalid {
|
|
|
|
kI_Invalid,
|
|
|
|
kI_Valid,
|
|
|
|
};
|
2023-01-10 06:51:58 +00:00
|
|
|
CRayCastResult(float time, const CVector3f& point, const CPlane& plane, const CMaterialList& list)
|
|
|
|
: x0_time(time), x4_point(point), x10_plane(plane), x20_valid(kI_Valid), x28_material(list) {}
|
2024-09-26 05:54:05 +00:00
|
|
|
CRayCastResult(EInvalid invalid = kI_Invalid)
|
2023-01-10 06:51:58 +00:00
|
|
|
: x0_time(0)
|
|
|
|
, x4_point(CVector3f(0.f, 0.f, 0.f))
|
|
|
|
, x10_plane(CPlane(0.f, CUnitVector3f(1.f, 0.f, 0.f, CUnitVector3f::kN_Yes)))
|
|
|
|
, x20_valid(invalid) {}
|
|
|
|
|
|
|
|
float GetTime() const { return x0_time; }
|
|
|
|
const CVector3f& GetPoint() const { return x4_point; }
|
|
|
|
const CPlane& GetPlane() const { return x10_plane; }
|
2022-11-03 17:09:58 +00:00
|
|
|
bool IsValid() const { return x20_valid != kI_Invalid; }
|
2022-10-30 19:47:50 +00:00
|
|
|
// TODO: figure out what's going on here
|
|
|
|
bool IsInvalid() const { return x20_valid == kI_Invalid; }
|
2023-01-10 06:51:58 +00:00
|
|
|
const CMaterialList& GetMaterial() const { return x28_material; }
|
|
|
|
void Transform(const CTransform4f& xf);
|
2022-09-29 05:30:20 +00:00
|
|
|
|
2023-01-10 06:51:58 +00:00
|
|
|
static CRayCastResult MakeInvalid() {
|
|
|
|
return CRayCastResult(kI_Invalid);
|
|
|
|
}
|
2022-09-29 05:30:20 +00:00
|
|
|
|
2022-09-18 05:55:13 +00:00
|
|
|
private:
|
2023-01-10 06:51:58 +00:00
|
|
|
float x0_time;
|
2022-09-18 05:55:13 +00:00
|
|
|
CVector3f x4_point;
|
|
|
|
CPlane x10_plane;
|
2022-09-29 05:30:20 +00:00
|
|
|
bool x20_valid;
|
2022-09-18 05:55:13 +00:00
|
|
|
CMaterialList x28_material;
|
|
|
|
};
|
2023-01-10 06:51:58 +00:00
|
|
|
|
2022-09-18 05:55:13 +00:00
|
|
|
CHECK_SIZEOF(CRayCastResult, 0x30)
|
|
|
|
|
2022-10-09 05:13:17 +00:00
|
|
|
#endif // _CRAYCASTRESULT
|