Navigation
API > API/Runtime > API/Runtime/Core
An octree.
| Name | TOctree2 |
| Type | class |
| Header File | /Engine/Source/Runtime/Core/Public/Math/GenericOctree.h |
| Include Path | #include "Math/GenericOctree.h" |
Syntax
template<typename ElementType, typename OctreeSemantics>
class TOctree2
Derived Classes
Constructors
| Name | Remarks | Include Path | Unreal Specifiers |
|---|---|---|---|
TOctree2 () |
DO NOT USE. This constructor is for internal usage only for hot-reload purposes. | Math/GenericOctree.h | |
TOctree2
(
const FVector& InOrigin, |
Initialization constructor. | Math/GenericOctree.h |
Classes
| Name | Remarks |
|---|---|
| FFreeList |
Structs
| Name | Remarks |
|---|---|
| COctreeSemanticsV2 | Concept definition for the new octree semantics, which adds a new TOctree parameter. |
| FNode |
Typedefs
| Name | Type | Remarks | Include Path |
|---|---|---|---|
| ElementArrayType | TArray< ElementType, typename OctreeSemantics::ElementAllocator > | Math/GenericOctree.h | |
| FNodeIndex | uint32 | Math/GenericOctree.h | |
| FReal | FVector::FReal | Math/GenericOctree.h |
Variables
Protected
| Name | Type | Remarks | Include Path | Unreal Specifiers |
|---|---|---|---|---|
| FreeList | TArray< FNodeIndex > | Math/GenericOctree.h | ||
| MinLeafExtent | FVector::FReal | The extent of a leaf at the maximum allowed depth of the tree. | Math/GenericOctree.h | |
| ParentLinks | TArray< FNodeIndex > | Math/GenericOctree.h | ||
| RootNodeContext | FOctreeNodeContext | Math/GenericOctree.h | ||
| TreeElements | TArray< ElementArrayType, TAlignedHeapAllocator< alignof(ElementArrayType)> > | Math/GenericOctree.h | ||
| TreeNodes | TArray< FNode > | Math/GenericOctree.h |
Functions
Public
| Name | Remarks | Include Path | Unreal Specifiers |
|---|---|---|---|
void AddElement
(
typename TCallTraits< ElementType >::ConstReference Element |
Adds an element to the octree. | Math/GenericOctree.h | |
void ApplyOffset
(
const FVector& InOffset, |
Apply an arbitrary offset to all elements in the tree InOffset - offset to apply bGlobalOctree - hint that this octree is used as a boundless global volume, so only content will be shifted but not origin of the octree | Math/GenericOctree.h | |
void Destroy() |
This function resets the octree to empty. | Math/GenericOctree.h | |
void DumpStats() |
Writes stats for the octree to the log. | Math/GenericOctree.h | |
void FindAllElements
(
const IterateAllElementsFunc& Func |
This function will call the passed in function for all elements in the Octree in node by node in no specified order. | Math/GenericOctree.h | |
void FindElementsWithBoundsTest
(
const FBoxCenterAndExtent& BoxBounds, |
This function will traverse the Octree using a fast box-box intersection this should be the preferred way of traversing the tree. | Math/GenericOctree.h | |
void FindElementsWithPredicate
(
const PredicateFunc& Predicate, |
This function will traverse the Octree starting from the root in depth first order and the predicate can be used to implement custom culling for each node. | Math/GenericOctree.h | |
FOctreeElementId2 FindFirstElementWithBoundsTest
(
const FBoxCenterAndExtent& BoxBounds, |
This function will traverse the Octree using a fast box-box intersection and aborts traversal as soon as the Element function returns false. | Math/GenericOctree.h | |
void FindNearbyElements
(
const FVector& Position, |
This function will traverse the Octree using a tryint to find nearby nodes that contain any elements. | Math/GenericOctree.h | |
void FindNodesWithPredicate
(
const PredicateFunc& Predicate, |
This function will traverse the Octree starting from the root in depth first order and the predicate can be used to implement custom culling for each node. | Math/GenericOctree.h | |
ElementType & GetElementById
(
FOctreeElementId2 ElementId |
Accesses an octree element by ID. | Math/GenericOctree.h | |
const ElementType & GetElementById
(
FOctreeElementId2 ElementId |
Accesses an octree element by ID. | Math/GenericOctree.h | |
TArrayView< const ElementType > GetElementsForNode
(
FNodeIndex NodeIndex |
Return all elements for a given node. | Math/GenericOctree.h | |
FReal GetNodeLevelExtent
(
int32 Level |
Math/GenericOctree.h | ||
int32 GetNumNodes() |
Math/GenericOctree.h | ||
FBoxCenterAndExtent GetRootBounds() |
Math/GenericOctree.h | ||
SIZE_T GetSizeBytes() |
Math/GenericOctree.h | ||
bool IsValidElementId
(
FOctreeElementId2 ElementId |
Check if a FOctreeElementId2 is valid. | Math/GenericOctree.h | |
void RemoveElement
(
FOctreeElementId2 ElementId |
Removes an element from the octree. | Math/GenericOctree.h | |
void ShrinkElements() |
Math/GenericOctree.h |
Protected
| Name | Remarks | Include Path | Unreal Specifiers |
|---|---|---|---|
void SetElementId
(
const ElementType& Element, |
Redirects SetElementId call to the proper implementation | Math/GenericOctree.h |