-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathNode.cs
More file actions
46 lines (36 loc) · 1.03 KB
/
Copy pathNode.cs
File metadata and controls
46 lines (36 loc) · 1.03 KB
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
using OpenTK.Mathematics;
using System.Collections.Generic;
namespace Project3D
{
public class Node
{
public string Name;
public Vector3 Position = Vector3.Zero;
public Vector3 Scale = Vector3.One;
public Quaternion Rotation = Quaternion.Identity;
public Vector3Sequence PositionSequence;
public Vector3Sequence ScaleSequence;
public QuaternionSequence RotationSequence;
public Vector3 Color = Vector3.One;
public Vertex[] Vertices;
public int[] Indices;
public List<Node> Children = new List<Node>();
public Matrix4 Model;
public Node FindNode(string name)
{
if (name == Name)
{
return this;
}
foreach (var child in Children)
{
var node = child.FindNode(name);
if (node != null)
{
return node;
}
}
return null;
}
}
}