-
Notifications
You must be signed in to change notification settings - Fork 97
/
VectorConverter.cs
42 lines (41 loc) · 1.31 KB
/
VectorConverter.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
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace SaintCoinach.Graphics.Viewer {
public static class VectorConverter {
public static SharpDX.Vector3 ToDx(this Graphics.Vector3 self) {
return new SharpDX.Vector3 {
X = self.X,
Y = self.Y,
Z = self.Z
};
}
public static SharpDX.Vector3 ToDx(this Graphics.Vector3? self, SharpDX.Vector3 defaultValue) {
if (self.HasValue)
return self.Value.ToDx();
return defaultValue;
}
public static SharpDX.Vector4 ToDx(this Graphics.Vector4 self) {
return new SharpDX.Vector4 {
X = self.X,
Y = self.Y,
Z = self.Z,
W = self.W
};
}
public static SharpDX.Vector3 ToDx3(this Graphics.Vector4 self) {
return new SharpDX.Vector3 {
X = self.X,
Y = self.Y,
Z = self.Z
};
}
public static SharpDX.Vector4 ToDx(this Graphics.Vector4? self, SharpDX.Vector4 defaultValue) {
if (self.HasValue)
return self.Value.ToDx();
return defaultValue;
}
}
}