Add CPVSVisOctree

This commit is contained in:
Phillip Stephens 2023-02-12 11:20:24 -08:00
parent b3617b556d
commit f26e5d41d3
3 changed files with 31 additions and 1 deletions

View File

@ -578,7 +578,7 @@ LIBS = [
["Kyoto/Alloc/CCircularBuffer", True], ["Kyoto/Alloc/CCircularBuffer", True],
["Kyoto/Alloc/CMemory", True], ["Kyoto/Alloc/CMemory", True],
["Kyoto/Alloc/IAllocator", True], ["Kyoto/Alloc/IAllocator", True],
"Kyoto/PVS/CPVSVisOctree", ["Kyoto/PVS/CPVSVisOctree", False],
"Kyoto/PVS/CPVSVisSet", "Kyoto/PVS/CPVSVisSet",
["Kyoto/Particles/CColorElement", False], ["Kyoto/Particles/CColorElement", False],
"Kyoto/Particles/CElementGen", "Kyoto/Particles/CElementGen",

View File

@ -0,0 +1,22 @@
#ifndef _CPVSVISOCTREE
#define _CPVSVISOCTREE
#include "Kyoto/Math/CAABox.hpp"
#include "Kyoto/Math/CVector3f.hpp"
#include "rstl/auto_ptr.hpp"
class CPVSVisOctree {
public:
int IterateSearch(uchar a, const CVector3f& pos) const;
uint GetNumChildren(uchar a) const;
private:
CAABox mBounds;
uint mNumObjects;
uint mNumLights;
rstl::auto_ptr< uchar > mOctreeData;
uint _28;
CAABox mSearchBounds;
};
#endif // _CPVSVISOCTREE

View File

@ -0,0 +1,8 @@
#include "Kyoto/PVS/CPVSVisOctree.hpp"
int CPVSVisOctree::IterateSearch(uchar octant, const CVector3f& pos) const {}
uint CPVSVisOctree::GetNumChildren(uchar octant) const {
static const uint childCount[8] = {0, 2, 2, 4, 2, 4, 4, 8};
return childCount[octant & 7];
}