2016-04-17 22:38:05 +00:00
|
|
|
#ifndef __URDE_CCOLLISIONINFO_HPP__
|
|
|
|
#define __URDE_CCOLLISIONINFO_HPP__
|
|
|
|
|
2016-07-26 22:45:01 +00:00
|
|
|
#include "RetroTypes.hpp"
|
|
|
|
#include "CMaterialList.hpp"
|
2016-06-26 01:11:09 +00:00
|
|
|
#include "zeus/CAABox.hpp"
|
2017-06-18 01:58:13 +00:00
|
|
|
#include "zeus/CMatrix3f.hpp"
|
2016-06-26 01:11:09 +00:00
|
|
|
|
2016-04-17 22:38:05 +00:00
|
|
|
namespace urde
|
|
|
|
{
|
|
|
|
class CCollisionInfo
|
|
|
|
{
|
2017-06-18 01:58:13 +00:00
|
|
|
zeus::CVector3f x0_point;
|
|
|
|
zeus::CVector3f xc_;
|
2016-07-26 22:45:01 +00:00
|
|
|
zeus::CVector3f x18_;
|
|
|
|
zeus::CVector3f x24_;
|
2017-06-18 01:58:13 +00:00
|
|
|
bool x30_valid = false;
|
2016-07-26 22:45:01 +00:00
|
|
|
bool x31_ = false;
|
2017-06-18 01:58:13 +00:00
|
|
|
CMaterialList x38_materialLeft;
|
|
|
|
CMaterialList x40_materialRight;
|
|
|
|
zeus::CVector3f x48_normalLeft;
|
|
|
|
zeus::CVector3f x54_normalRight;
|
2016-06-26 01:11:09 +00:00
|
|
|
public:
|
2016-07-26 22:45:01 +00:00
|
|
|
CCollisionInfo() = default;
|
2017-06-18 01:58:13 +00:00
|
|
|
CCollisionInfo(const zeus::CVector3f& point, const CMaterialList& list1, const CMaterialList& list2,
|
|
|
|
const zeus::CVector3f& normalLeft, const zeus::CVector3f& normalRight)
|
|
|
|
: x0_point(point), x30_valid(true), x31_(false), x38_materialLeft(list2), x40_materialRight(list1),
|
|
|
|
x48_normalLeft(normalLeft), x54_normalRight(normalRight) {}
|
|
|
|
CCollisionInfo(const zeus::CVector3f& point, const CMaterialList& list1, const CMaterialList& list2,
|
|
|
|
const zeus::CVector3f& normal)
|
|
|
|
: x0_point(point), x30_valid(true), x31_(false), x38_materialLeft(list2), x40_materialRight(list1),
|
|
|
|
x48_normalLeft(normal), x54_normalRight(-normal) {}
|
2016-07-26 22:45:01 +00:00
|
|
|
CCollisionInfo(const zeus::CAABox& aabox, const CMaterialList& list1, const CMaterialList& list2,
|
2017-06-18 01:58:13 +00:00
|
|
|
const zeus::CVector3f& normalLeft, const zeus::CVector3f& normalRight)
|
|
|
|
: x0_point(aabox.min),
|
|
|
|
xc_(aabox.max.x - aabox.min.x, 0.f, 0.f),
|
|
|
|
x18_(0.f, aabox.max.y - aabox.min.y, 0.f),
|
|
|
|
x24_(0.f, 0.f, aabox.max.z - aabox.min.z),
|
|
|
|
x30_valid(true), x31_(true), x38_materialLeft(list2),
|
|
|
|
x40_materialRight(list1), x48_normalLeft(normalLeft),
|
|
|
|
x54_normalRight(normalRight)
|
2016-07-26 22:45:01 +00:00
|
|
|
{}
|
|
|
|
|
2017-06-18 01:58:13 +00:00
|
|
|
CCollisionInfo GetSwapped() const;
|
|
|
|
bool IsValid() const { return x30_valid; }
|
|
|
|
const CMaterialList& GetMaterialLeft() const { return x38_materialLeft; }
|
|
|
|
const CMaterialList& GetMaterialRight() const { return x40_materialRight; }
|
2017-01-04 04:08:30 +00:00
|
|
|
zeus::CVector3f GetExtreme() const;
|
2016-07-26 22:45:01 +00:00
|
|
|
void Swap();
|
|
|
|
void Transform(const zeus::CTransform&);
|
2017-06-18 01:58:13 +00:00
|
|
|
zeus::CVector3f GetNormalLeft() const { return x48_normalLeft; }
|
|
|
|
zeus::CVector3f GetNormalRight() const { return x54_normalRight; }
|
2016-07-26 22:45:01 +00:00
|
|
|
zeus::CVector3f GetOrigin() const;
|
2017-06-18 01:58:13 +00:00
|
|
|
zeus::CVector3f GetPoint() const { return x0_point; }
|
2016-04-17 22:38:05 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
#endif // __URDE_CCOLLISIONINFO_HPP__
|