metaforce/Runtime/Collision/CRayCastResult.hpp

52 lines
1.3 KiB
C++
Raw Normal View History

2018-10-07 03:42:33 +00:00
#pragma once
2016-04-22 20:22:45 +00:00
#include "CMaterialList.hpp"
#include "zeus/zeus.hpp"
namespace urde
{
class CRayCastResult
{
public:
2016-04-27 02:41:00 +00:00
enum class EInvalid : u8
2016-04-22 20:22:45 +00:00
{
2016-04-27 02:41:00 +00:00
Invalid,
Valid
2016-04-22 20:22:45 +00:00
};
private:
float x0_t = 0.f;
2016-04-27 02:41:00 +00:00
zeus::CVector3f x4_point;
zeus::CPlane x10_plane;
EInvalid x20_invalid = EInvalid::Invalid;
2018-02-11 05:27:00 +00:00
CMaterialList x28_material;
2016-04-22 20:22:45 +00:00
public:
2016-05-21 03:02:09 +00:00
CRayCastResult() = default;
2016-04-27 02:41:00 +00:00
CRayCastResult(const CRayCastResult& other, EInvalid invalid)
: x0_t(other.x0_t),
2016-04-27 02:41:00 +00:00
x4_point(other.x4_point),
x10_plane(other.x10_plane),
x20_invalid(invalid),
2018-02-11 05:27:00 +00:00
x28_material(other.x28_material)
2016-04-27 02:41:00 +00:00
{
}
CRayCastResult(float t, const zeus::CVector3f& point,
const zeus::CPlane& plane, const CMaterialList& matList)
: x0_t(t), x4_point(point), x10_plane(plane),
2018-02-11 05:27:00 +00:00
x20_invalid(EInvalid::Valid), x28_material(matList)
2016-04-22 20:22:45 +00:00
{}
2016-04-27 00:26:02 +00:00
void MakeInvalid();
2016-04-27 02:41:00 +00:00
bool IsInvalid() const { return x20_invalid == EInvalid::Invalid; }
2017-06-12 04:23:34 +00:00
bool IsValid() const { return x20_invalid == EInvalid::Valid; }
float GetT() const { return x0_t; }
const zeus::CVector3f& GetPoint() const { return x4_point; }
const zeus::CPlane& GetPlane() const { return x10_plane; }
2018-02-11 05:27:00 +00:00
const CMaterialList& GetMaterial() const { return x28_material; }
2016-04-27 02:41:00 +00:00
2016-04-27 00:26:02 +00:00
void Transform(const zeus::CTransform&);
2016-04-22 20:22:45 +00:00
};
}