@@ -33,10 +33,13 @@ Node size is not stored within the nodes. It will be calculated ad-hoc every tim
3333#define ORTHOTREE__DISABLED_NODESIZE
3434
3535// PMR is used with MSVC only by default. To use PMR anyway
36- ORTHOTREE__USE_PMR
36+ #define ORTHOTREE__USE_PMR
3737
3838// To disable PMR on all platforms use:
39- ORTHOTREE__DISABLE_PMR
39+ #define ORTHOTREE__DISABLE_PMR
40+
41+ // If the depth is less than 10, 32bit location code is enough (otherwise 64bit will be used)
42+ #define ORTHOTREE__LOCATIONCODE_32
4043
4144// Contiguous container of geometry data does not have specified index type. Octree lib uses index_t for it, it can specified to int or std::size_t.
4245ORTHOTREE_INDEX_T__INT / ORTHOTREE_INDEX_T__SIZE_T / ORTHOTREE_INDEX_T__UINT_FAST32_T
@@ -1966,7 +1969,11 @@ namespace OrthoTree
19661969 template <dim_t DIMENSION_NO>
19671970 struct MortonSpaceIndexing
19681971 {
1969- static auto constexpr IS_32BIT_LOCATION = DIMENSION_NO < 4 ;
1972+ #ifdef ORTHOTREE__LOCATIONCODE_32
1973+ static auto constexpr IS_32BIT_LOCATION = DIMENSION_NO <= 3 ;
1974+ #else
1975+ static auto constexpr IS_32BIT_LOCATION = DIMENSION_NO <= 2 ;
1976+ #endif
19701977 static auto constexpr IS_64BIT_LOCATION = !IS_32BIT_LOCATION && DIMENSION_NO < 15 ;
19711978
19721979 // Indexing can be solved with integral types (above this, internal container will be changed to std::map)
@@ -4593,7 +4600,8 @@ namespace OrthoTree
45934600 }
45944601 }
45954602
4596- if (stuckedAndNonSplittableEndLocationNo){
4603+ if (stuckedAndNonSplittableEndLocationNo)
4604+ {
45974605 if constexpr (std::is_trivially_copyable_v<TEntityID>)
45984606 std::memcpy (entityIDs.data () + splitEntityNoFromParent, &(*locationIt.GetSecond ()), stuckedAndNonSplittableEndLocationNo * sizeof (TEntityID));
45994607 else
@@ -5094,7 +5102,7 @@ namespace OrthoTree
50945102 };
50955103
50965104 public:
5097- // Client-defined Collision detector based on indices . AABB intersection is executed independently from this checker.
5105+ // Client-defined Collision detector based on indexes . AABB intersection is executed independently from this checker.
50985106 using FCollisionDetector = std::function<bool (TEntityID, TEntityID)>;
50995107
51005108 // Collision detection: Returns all overlapping boxes from the source trees.
0 commit comments