2016-04-17 22:38:05 +00:00
|
|
|
#ifndef __URDE_CCOLLIDABLEOBBTREEGROUP_HPP__
|
|
|
|
#define __URDE_CCOLLIDABLEOBBTREEGROUP_HPP__
|
|
|
|
|
2016-04-20 21:44:18 +00:00
|
|
|
#include "IOStreams.hpp"
|
|
|
|
#include "CFactoryMgr.hpp"
|
2016-04-27 00:26:02 +00:00
|
|
|
#include "COBBTree.hpp"
|
|
|
|
#include "zeus/CAABox.hpp"
|
|
|
|
#include "CCollisionPrimitive.hpp"
|
|
|
|
|
2016-04-17 22:38:05 +00:00
|
|
|
namespace urde
|
|
|
|
{
|
2017-03-03 22:13:23 +00:00
|
|
|
class CCollidableOBBTreeGroupContainer
|
2016-04-17 22:38:05 +00:00
|
|
|
{
|
2017-03-03 22:13:23 +00:00
|
|
|
friend class CCollidableOBBTreeGroup;
|
2016-04-27 00:26:02 +00:00
|
|
|
std::vector<std::unique_ptr<COBBTree>> x0_trees;
|
|
|
|
std::vector<zeus::CAABox> x10_aabbs;
|
2017-03-03 22:13:23 +00:00
|
|
|
zeus::CAABox x20_aabox;
|
|
|
|
public:
|
|
|
|
CCollidableOBBTreeGroupContainer(CInputStream& in);
|
|
|
|
CCollidableOBBTreeGroupContainer(const zeus::CVector3f&, const zeus::CVector3f&);
|
|
|
|
};
|
2017-01-04 04:08:30 +00:00
|
|
|
|
2017-03-03 22:13:23 +00:00
|
|
|
class CCollidableOBBTreeGroup : public CCollisionPrimitive
|
|
|
|
{
|
|
|
|
static const Type sType;
|
|
|
|
static u32 sTableIndex;
|
|
|
|
const CCollidableOBBTreeGroupContainer* x10_container;
|
2016-04-20 21:44:18 +00:00
|
|
|
public:
|
|
|
|
CCollidableOBBTreeGroup(CInputStream& in);
|
2017-03-03 22:13:23 +00:00
|
|
|
CCollidableOBBTreeGroup(const CCollidableOBBTreeGroupContainer*, const CMaterialList&);
|
2016-04-27 00:26:02 +00:00
|
|
|
virtual ~CCollidableOBBTreeGroup() {}
|
|
|
|
|
|
|
|
void ResetTestStats() const;
|
|
|
|
virtual u32 GetTableIndex() const;
|
|
|
|
virtual zeus::CAABox CalculateAABox(const zeus::CTransform&) const;
|
|
|
|
virtual zeus::CAABox CalculateLocalAABox() const;
|
|
|
|
virtual FourCC GetPrimType() const;
|
|
|
|
virtual CRayCastResult CastRayInternal(const CInternalRayCastStructure&) const;
|
|
|
|
|
2016-06-24 20:09:38 +00:00
|
|
|
static const Type& GetType();
|
2016-04-27 00:26:02 +00:00
|
|
|
static void SetStaticTableIndex(u32 index);
|
2017-01-04 04:08:30 +00:00
|
|
|
/* Sphere Collide */
|
|
|
|
static bool SphereCollide(const CInternalCollisionStructure&, CCollisionInfoList&);
|
|
|
|
static bool SphereCollideBoolean(const CInternalCollisionStructure&);
|
|
|
|
static bool CollideMovingSphere(const CInternalCollisionStructure&, const zeus::CVector3f&, double&,
|
|
|
|
CCollisionInfo&);
|
|
|
|
/* AABox Collide */
|
|
|
|
static bool AABoxCollide(const CInternalCollisionStructure&, CCollisionInfoList&);
|
|
|
|
static bool AABoxCollideBoolean(const CInternalCollisionStructure&);
|
|
|
|
static bool CollideMovingAABox(const CInternalCollisionStructure&, const zeus::CVector3f&, double&,
|
|
|
|
CCollisionInfo&);
|
2016-04-17 22:38:05 +00:00
|
|
|
};
|
|
|
|
|
2017-01-04 04:08:30 +00:00
|
|
|
CFactoryFnReturn FCollidableOBBTreeGroupFactory(const SObjectTag& tag, CInputStream& in, const CVParamTransfer& vparms,
|
2016-09-02 19:32:57 +00:00
|
|
|
CObjectReference* selfRef);
|
2016-04-17 22:38:05 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
#endif // __URDE_CCOLLIDABLEOBBTREEGROUP_HPP__
|