From f26e5d41d3f7bbffd5651ae7e4586664c452cf6e Mon Sep 17 00:00:00 2001 From: Phillip Stephens Date: Sun, 12 Feb 2023 11:20:24 -0800 Subject: [PATCH] Add CPVSVisOctree --- configure.py | 2 +- include/Kyoto/PVS/CPVSVisOctree.hpp | 22 ++++++++++++++++++++++ src/Kyoto/PVS/CPVSVisOctree.cpp | 8 ++++++++ 3 files changed, 31 insertions(+), 1 deletion(-) create mode 100644 include/Kyoto/PVS/CPVSVisOctree.hpp create mode 100644 src/Kyoto/PVS/CPVSVisOctree.cpp diff --git a/configure.py b/configure.py index a7823166..674742e7 100755 --- a/configure.py +++ b/configure.py @@ -578,7 +578,7 @@ LIBS = [ ["Kyoto/Alloc/CCircularBuffer", True], ["Kyoto/Alloc/CMemory", True], ["Kyoto/Alloc/IAllocator", True], - "Kyoto/PVS/CPVSVisOctree", + ["Kyoto/PVS/CPVSVisOctree", False], "Kyoto/PVS/CPVSVisSet", ["Kyoto/Particles/CColorElement", False], "Kyoto/Particles/CElementGen", diff --git a/include/Kyoto/PVS/CPVSVisOctree.hpp b/include/Kyoto/PVS/CPVSVisOctree.hpp new file mode 100644 index 00000000..f63518fe --- /dev/null +++ b/include/Kyoto/PVS/CPVSVisOctree.hpp @@ -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 diff --git a/src/Kyoto/PVS/CPVSVisOctree.cpp b/src/Kyoto/PVS/CPVSVisOctree.cpp new file mode 100644 index 00000000..8c64956b --- /dev/null +++ b/src/Kyoto/PVS/CPVSVisOctree.cpp @@ -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]; +}