2022-10-09 05:13:17 +00:00
|
|
|
#ifndef _COBBOX
|
|
|
|
#define _COBBOX
|
2022-10-07 04:23:10 +00:00
|
|
|
|
|
|
|
#include "Kyoto/Math/CAABox.hpp"
|
|
|
|
#include "Kyoto/Math/CTransform4f.hpp"
|
|
|
|
#include "Kyoto/Math/CVector3f.hpp"
|
|
|
|
|
|
|
|
class CInputStream;
|
|
|
|
class CMRay;
|
|
|
|
class COBBox {
|
|
|
|
public:
|
|
|
|
COBBox(const CTransform4f& xf, const CVector3f& extents);
|
|
|
|
COBBox(CInputStream& in);
|
|
|
|
|
|
|
|
CAABox CalculateAABox(const CTransform4f& xf) const;
|
|
|
|
|
|
|
|
static COBBox FromAABox(const CAABox& box, const CTransform4f& xf);
|
|
|
|
|
|
|
|
bool LineIntersectsBox(const CMRay& ray, float& penetration) const;
|
|
|
|
bool AABoxIntersectsBox(const CAABox& box) const;
|
|
|
|
bool OBBIntersectsBox(const COBBox& box) const;
|
2022-10-09 05:13:17 +00:00
|
|
|
|
2022-11-26 04:02:24 +00:00
|
|
|
const CTransform4f& GetTransform() const { return mTransform; }
|
|
|
|
const CVector3f& GetSize() const { return mExtents; }
|
|
|
|
|
2022-10-07 04:23:10 +00:00
|
|
|
private:
|
|
|
|
CTransform4f mTransform;
|
|
|
|
CVector3f mExtents;
|
|
|
|
};
|
|
|
|
|
2022-10-09 05:13:17 +00:00
|
|
|
#endif // _COBBOX
|