-
Notifications
You must be signed in to change notification settings - Fork 13
/
CSGNode.cs
27 lines (23 loc) · 868 Bytes
/
CSGNode.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
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Diagnostics;
namespace RealtimeCSG
{
[DebuggerDisplay("{Operator}")]
public sealed class CSGNode
{
public CSGNode(string id, CSGNodeType branchOperator) { this.NodeType = branchOperator; this.Left = null; this.Right = null; }
public CSGNode(string id, CSGNodeType branchOperator, CSGNode left, CSGNode right) { this.NodeType = branchOperator; this.Left = left; this.Right = right; }
public CSGNode(string id, IEnumerable<Plane> planes) { this.NodeType = CSGNodeType.Brush; Planes = planes.ToArray(); }
public readonly AABB Bounds = new AABB();
public readonly CSGNodeType NodeType;
public CSGNode Left;
public CSGNode Right;
public CSGNode Parent;
public Vector3 LocalTranslation;
public Vector3 Translation;
public Plane[] Planes;
}
}