metaforce/Runtime/Graphics/CPVSVisOctree.hpp

35 lines
1.0 KiB
C++
Raw Permalink Normal View History

2018-10-07 03:42:33 +00:00
#pragma once
2016-07-27 23:06:57 +00:00
#include "Runtime/RetroTypes.hpp"
#include "Runtime/Graphics/CPVSVisSet.hpp"
#include <zeus/CAABox.hpp>
#include <zeus/CVector3f.hpp>
2016-07-27 23:06:57 +00:00
2021-04-10 08:42:06 +00:00
namespace metaforce {
2018-12-08 05:30:43 +00:00
class CPVSVisOctree {
zeus::CAABox x0_aabb;
u32 x18_numObjects = 0;
u32 x1c_numLights = 0;
bool x20_bufferFlag = false;
const u8* x24_octreeData = nullptr;
2018-12-08 05:30:43 +00:00
zeus::CAABox x2c_searchAabb;
2016-07-27 23:06:57 +00:00
public:
2018-12-08 05:30:43 +00:00
static CPVSVisOctree MakePVSVisOctree(const u8* data);
CPVSVisOctree() = default;
CPVSVisOctree(const zeus::CAABox& aabb, u32 numObjects, u32 numLights, const u8* c);
u32 GetNumChildren(u8 byte) const;
u32 GetChildIndex(const u8*, const zeus::CVector3f&) const;
const zeus::CAABox& GetBounds() const { return x0_aabb; }
const u8* GetOctreeData() const { return x24_octreeData; }
2017-02-19 09:27:01 +00:00
2018-12-08 05:30:43 +00:00
u32 GetNumObjects() const { return x18_numObjects; }
u32 GetNumLights() const { return x1c_numLights; }
void ResetSearch() const { const_cast<CPVSVisOctree&>(*this).x2c_searchAabb = x0_aabb; }
s32 IterateSearch(u8 nodeData, const zeus::CVector3f& tp) const;
2016-07-27 23:06:57 +00:00
};
2021-04-10 08:42:06 +00:00
} // namespace metaforce