CAreaOctTree stubs

This commit is contained in:
Phillip Stephens 2016-07-26 15:45:01 -07:00
parent 08e59aca4c
commit eacf7b3822
3 changed files with 100 additions and 7 deletions

View File

@ -1,14 +1,45 @@
#ifndef __URDE_CCOLLISIONINFO_HPP__
#define __URDE_CCOLLISIONINFO_HPP__
#include "RetroTypes.hpp"
#include "CMaterialList.hpp"
#include "zeus/CAABox.hpp"
namespace urde
{
class CMaterialList;
class CCollisionInfo
{
zeus::CAABox x0_aabox = zeus::CAABox::skNullBox;
zeus::CVector3f x18_;
zeus::CVector3f x24_;
bool x30_ = false;
bool x31_ = false;
/* u32 x34_; */
CMaterialList x38_;
CMaterialList x40_;
zeus::CVector3f x48_;
zeus::CVector3f x54_;
public:
CCollisionInfo() = default;
CCollisionInfo(const zeus::CVector3f& v1, const CMaterialList& list1, const CMaterialList& list2,
const zeus::CVector3f& v2, const zeus::CVector3f& v3);
CCollisionInfo(const zeus::CVector3f& v1, const CMaterialList& list1, const CMaterialList& list2,
zeus::CVector3f const& v2);
CCollisionInfo(const zeus::CAABox& aabox, const CMaterialList& list1, const CMaterialList& list2,
const zeus::CVector3f& v1, const zeus::CVector3f& v2)
: x0_aabox(aabox)
{}
bool IsValid() const;
void GetMaterialLeft() const;
void GetMaterialRight() const;
void GetExtreme() const;
void Swap();
void Transform(const zeus::CTransform&);
zeus::CVector3f GetNormalLeft() const;
zeus::CVector3f GetNormalRight() const;
zeus::CVector3f GetOrigin() const;
zeus::CVector3f GetPoint() const;
};
}

View File

@ -77,11 +77,9 @@ public:
static u32 BitPosition(u64 flag)
{
u32 high = *((u32*)(&flag)[0]);
u32 low = *((u32*)(&flag)[1]);
for (u32 i = 0; i < 8; ++i)
{
}
for (u32 i = 0; i < 63; ++i)
if ((flag & (1ull << i)) != 0)
return i;
return -1;
}

View File

@ -1,11 +1,75 @@
#ifndef __URDE_CAREAOCTTREE_HPP__
#define __URDE_CAREAOCTTREE_HPP__
#include "RetroTypes.hpp"
#include "zeus/CAABox.hpp"
namespace urde
{
class CCollisionEdge;
class CMaterialFilter;
class CAreaOctTree
{
public:
struct SRayResult
{
};
class TriListReference
{
public:
TriListReference(const void*);
TriListReference(const u16*);
void GetAt(s32) const;
void GetSize() const;
};
class Node
{
public:
enum class ETreeType
{
Invalid,
Branch,
Leaf
};
private:
public:
Node(const void*, const zeus::CAABox&, const CAreaOctTree& owner, ETreeType);
#if 0
void LineTestEx(const zeus::CLine&, const CMaterialFilter&, SRayResult&, float) const;
void LineTestExInternal(const zeus::CLine&, const CMaterialFilter&, SRayResult&, float, float, float,
const zeus::CVector3f&) const;
#endif
const CAreaOctTree& GetOwner() const;
const zeus::CAABox& GetBoundingBox() const;
u32 GetChildFlags() const;
const Node* GetChild(s32) const;
TriListReference GetTriangleArray() const;
ETreeType GetChildType(s32) const;
ETreeType GetTreeType(s32) const;
};
public:
CAreaOctTree(const zeus::CAABox& box, Node::ETreeType treeType, u8*, void*, u32, u32*, u8*, u8*, u8*, u32,
CCollisionEdge*, u32, u16*, u32, zeus::CVector3f*);
const Node* GetRootNode() const;
void GetTreeMemory() const;
zeus::CVector3f GetVert(s32) const;
CCollisionEdge GetEdge(s32) const;
void GetEdgeMaterial();
void GetTriangleMaterial();
u32 GetNumEdges() const;
u32 GetNumVerts() const;
void GetNumTriangles() const;
void GetMasterListTriangle(u16);
void GetTriangleVertexIndices(u16);
void GetTriangleEdgeIndices(u16);
static void MakeFromMemory(void*, unsigned int, CAreaOctTree*, bool*);
};
}