-
Notifications
You must be signed in to change notification settings - Fork 1
/
PotreeNode.cs
52 lines (44 loc) · 1.02 KB
/
PotreeNode.cs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
using Fusee.Math.Core;
using System;
using System.IO;
namespace PotreeSharp
{
public class PotreeNode
{
public PotreeNode()
{
}
public string Name = "";
public AABBd Aabb;
public PotreeNode Parent;
public PotreeNode[] children = new PotreeNode[8];
public NodeType NodeType = NodeType.UNSET;
public long ByteOffset;
public long ByteSize;
public long NumPoints;
public bool IsLoaded = false;
public PotreePoint[] points;
public int Level()
{
return Name.Length - 1;
}
public void Traverse(Action<PotreeNode> callback)
{
callback(this);
foreach (var child in children)
{
if (child != null)
{
child.Traverse(callback);
}
}
}
}
public enum NodeType : int
{
NORMAL = 0,
LEAF = 1,
PROXY = 2,
UNSET = -1
}
}