From e4da4d466ff524d4e9a4fd567dde77381f20a2de Mon Sep 17 00:00:00 2001 From: gjj Date: Thu, 29 Aug 2024 21:56:28 +0800 Subject: [PATCH] subdivision --- algoim/organizer/organizer.hpp | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/algoim/organizer/organizer.hpp b/algoim/organizer/organizer.hpp index caecf50..ae363aa 100644 --- a/algoim/organizer/organizer.hpp +++ b/algoim/organizer/organizer.hpp @@ -178,4 +178,17 @@ void basicTask(const std::vector>& primitives, in void quadratureTask(const Scene& scene) {} void buildOctree(const Scene& scene, std::vector& nodes, const uvector3& min, const uvector3& max) {} + +void build(const Scene& scene, std::vector& nodes, int nowNodeIdx, const uvector3& nowNodeMin, const uvector3& nowNodeMax) +{ + const std::vector& polyIntersectIndices = nodes[nowNodeIdx].polyIntersectIndices; + if (polyIntersectIndices.size() == 1) { + // TODO 相交很少时 + } + buildOctree(scene, nodes, nowNodeMin, nowNodeMax); + nodes.resize(nodes.size() + 8); + for (int i = 0; i < polyIntersectIndices.size(); ++i) { + for (int faceAxis = 0; faceAxis < 3; ++faceAxis) { restrictToFace } + } +} }; // namespace algoim::Organizer