engine
 
载入中...
搜索中...
未找到
Public 成员函数 | 所有成员列表
TOctree2< ElementType, OctreeSemantics > 模板类 参考

An octree. 更多...

#include <GenericOctree.h>

Public 成员函数

void AddElement (typename TCallTraits< ElementType >::ConstReference Element)
 Adds an element to the octree. 更多...
 
void ApplyOffset (const FVector &InOffset, bool bGlobalOctree=false)
 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
 
void Destroy ()
 this function resets the octree to empty.
 
void DumpStats () const
 Writes stats for the octree to the log.
 
template<typename IterateAllElementsFunc >
void FindAllElements (const IterateAllElementsFunc &Func) const
 this function will call the passed in function for all elements in the Octree in node by node in no specified order. 更多...
 
template<typename IterateBoundsFunc >
void FindElementsWithBoundsTest (const FBoxCenterAndExtent &BoxBounds, const IterateBoundsFunc &Func) const
 this function will traverse the Octree using a fast box-box interssection this should be the preferred way of traversing the tree. 更多...
 
template<typename PredicateFunc , typename IterateFunc >
void FindElementsWithPredicate (const PredicateFunc &Predicate, const IterateFunc &Func) const
 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. 更多...
 
template<typename IterateBoundsFunc >
void FindFirstElementWithBoundsTest (const FBoxCenterAndExtent &BoxBounds, const IterateBoundsFunc &Func) const
 this function will traverse the Octree using a fast box-box intersection and aborts traversal as soon as the Element function returns false. 更多...
 
template<typename IterateBoundsFunc >
void FindNearbyElements (const FVector &Position, const IterateBoundsFunc &Func) const
 this function will traverse the Octree using a tryint to find nearby nodes that contain any elements. 更多...
 
template<typename PredicateFunc , typename IterateFunc >
void FindNodesWithPredicate (const PredicateFunc &Predicate, const IterateFunc &Func) const
 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. 更多...
 
ElementType & GetElementById (FOctreeElementId2 ElementId)
 Accesses an octree element by ID.
 
const ElementType & GetElementById (FOctreeElementId2 ElementId) const
 Accesses an octree element by ID.
 
TArrayView< const ElementType > GetElementsForNode (FNodeIndex NodeIndex) const
 return all elements for a given node. 更多...
 
bool IsValidElementId (FOctreeElementId2 ElementId) const
 check if a FOctreeElementId2 is valid. 更多...
 
void RemoveElement (FOctreeElementId2 ElementId)
 Removes an element from the octree. 更多...
 
 TOctree2 ()
 DO NOT USE. 更多...
 
 TOctree2 (const FVector &InOrigin, float InExtent)
 Initialization constructor.
 

详细描述

template<typename ElementType, typename OctreeSemantics>
class TOctree2< ElementType, OctreeSemantics >

An octree.

构造及析构函数说明

◆ TOctree2()

template<typename ElementType , typename OctreeSemantics >
TOctree2< ElementType, OctreeSemantics >::TOctree2 ( )
inline

DO NOT USE.

This constructor is for internal usage only for hot-reload purposes.

成员函数说明

◆ AddElement()

template<typename ElementType , typename OctreeSemantics >
void TOctree2< ElementType, OctreeSemantics >::AddElement ( typename TCallTraits< ElementType >::ConstReference  Element)
inline

Adds an element to the octree.

参数
Element- The element to add.

◆ FindAllElements()

template<typename ElementType , typename OctreeSemantics >
template<typename IterateAllElementsFunc >
void TOctree2< ElementType, OctreeSemantics >::FindAllElements ( const IterateAllElementsFunc &  Func) const
inline

this function will call the passed in function for all elements in the Octree in node by node in no specified order.

参数
Func- Function to call with each Element.

◆ FindElementsWithBoundsTest()

template<typename ElementType , typename OctreeSemantics >
template<typename IterateBoundsFunc >
void TOctree2< ElementType, OctreeSemantics >::FindElementsWithBoundsTest ( const FBoxCenterAndExtent &  BoxBounds,
const IterateBoundsFunc &  Func 
) const
inline

this function will traverse the Octree using a fast box-box interssection this should be the preferred way of traversing the tree.

参数
BoxBounds- the bounds to test if a node is traversed or skipped.
Func- Function to call with each Element for nodes that passed bounds test.

◆ FindElementsWithPredicate()

template<typename ElementType , typename OctreeSemantics >
template<typename PredicateFunc , typename IterateFunc >
void TOctree2< ElementType, OctreeSemantics >::FindElementsWithPredicate ( const PredicateFunc &  Predicate,
const IterateFunc &  Func 
) const
inline

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.

参数
Predicate- a Function when given the bounds of the currently traversed node that returns true if traversal should continue or false to skip that branch.
Func- Function to call with each Element for nodes that passed the predicate.

◆ FindFirstElementWithBoundsTest()

template<typename ElementType , typename OctreeSemantics >
template<typename IterateBoundsFunc >
void TOctree2< ElementType, OctreeSemantics >::FindFirstElementWithBoundsTest ( const FBoxCenterAndExtent &  BoxBounds,
const IterateBoundsFunc &  Func 
) const
inline

this function will traverse the Octree using a fast box-box intersection and aborts traversal as soon as the Element function returns false.

参数
BoxBounds- the bounds to test if a node is traversed or skipped.
Func- Function to call with each Element for nodes that passed bounds test.

◆ FindNearbyElements()

template<typename ElementType , typename OctreeSemantics >
template<typename IterateBoundsFunc >
void TOctree2< ElementType, OctreeSemantics >::FindNearbyElements ( const FVector &  Position,
const IterateBoundsFunc &  Func 
) const
inline

this function will traverse the Octree using a tryint to find nearby nodes that contain any elements.

参数
Position- the position to look nearby.
Func- Function to call with each Element for nodes that passed bounds test.

◆ FindNodesWithPredicate()

template<typename ElementType , typename OctreeSemantics >
template<typename PredicateFunc , typename IterateFunc >
void TOctree2< ElementType, OctreeSemantics >::FindNodesWithPredicate ( const PredicateFunc &  Predicate,
const IterateFunc &  Func 
) const
inline

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.

参数
Predicate- a Function when given the bounds of the currently traversed node that returns true if traversal should continue or false to skip that branch.
Func- Function that will receive the node ID which can be stored and later used to get the elements using GetElementsForNode for all nodes that passed the predicate.

◆ GetElementsForNode()

template<typename ElementType , typename OctreeSemantics >
TArrayView< const ElementType > TOctree2< ElementType, OctreeSemantics >::GetElementsForNode ( FNodeIndex  NodeIndex) const
inline

return all elements for a given node.

参数
NodeIndex- The the index of the node can be obtained using FindNodesWithPredicate.

◆ IsValidElementId()

template<typename ElementType , typename OctreeSemantics >
bool TOctree2< ElementType, OctreeSemantics >::IsValidElementId ( FOctreeElementId2  ElementId) const
inline

check if a FOctreeElementId2 is valid.

参数
ElementId- The ElementId to check.

◆ RemoveElement()

template<typename ElementType , typename OctreeSemantics >
void TOctree2< ElementType, OctreeSemantics >::RemoveElement ( FOctreeElementId2  ElementId)
inline

Removes an element from the octree.

参数
ElementId- The element to remove from the octree.

该类的文档由以下文件生成: