Ark Server API (ASA) - Wiki
Loading...
Searching...
No Matches
GenericOctreePublic.h
Go to the documentation of this file.
1// Copyright Epic Games, Inc. All Rights Reserved.
2
3/*=============================================================================
4 GenericOctreePublic.h: Generic octree definition.
5=============================================================================*/
6
7#pragma once
8
9#include "CoreMinimal.h"
10
11/**
12 * An identifier for an element in the octree.
13 */
14class FOctreeElementId2
15{
16public:
17
18 template<typename, typename>
19 friend class TOctree2;
20
21 /** Default constructor. */
22 FOctreeElementId2()
23 : NodeIndex(INDEX_NONE)
24 , ElementIndex(INDEX_NONE)
25 {}
26
27 /** @return a boolean value representing whether the id is NULL. */
28 bool IsValidId() const
29 {
30 return NodeIndex != INDEX_NONE;
31 }
32
33 uint32 GetNodeIndex() const { return NodeIndex; }
34
35private:
36
37 /** The node the element is in. */
38 uint32 NodeIndex;
39
40 /** The index of the element in the node's element array. */
41 int32 ElementIndex;
42
43 /** Initialization constructor. */
44 FOctreeElementId2(uint32 InNodeIndex, int32 InElementIndex)
45 : NodeIndex(InNodeIndex)
46 , ElementIndex(InElementIndex)
47 {}
48
49 /** Implicit conversion to the element index. */
50 operator int32() const
51 {
52 return ElementIndex;
53 }
54};
55
56/**
57 * An identifier for an element in the octree.
58 */
60{
61public:
62
63 template<typename, typename>
64 friend class TOctree_DEPRECATED;
65
66 /** Default constructor. */
68 : Node(NULL)
70 {}
71
72 /** @return a boolean value representing whether the id is NULL. */
73 bool IsValidId() const
74 {
75 return Node != NULL;
76 }
77
78private:
79
80 /** The node the element is in. */
81 const void* Node;
82
83 /** The index of the element in the node's element array. */
85
86 /** Initialization constructor. */
87 FOctreeElementId(const void* InNode, int32 InElementIndex)
88 : Node(InNode)
89 , ElementIndex(InElementIndex)
90 {}
91
92 /** Implicit conversion to the element index. */
93 operator int32() const
94 {
95 return ElementIndex;
96 }
97};
@ INDEX_NONE
FOctreeElementId(const void *InNode, int32 InElementIndex)