-
Notifications
You must be signed in to change notification settings - Fork 10
/
Copy pathIOffsetProvider.cs
34 lines (27 loc) · 1.04 KB
/
IOffsetProvider.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
using System.Numerics;
namespace SimpleHeels;
public interface IOffsetProvider {
public Vector3 GetOffset();
public float GetRotation();
public PitchRoll GetPitchRoll(); // Pitch, Yaw, Roll
public void Deconstruct(out float x, out float y, out float z, out float r, out float roll, out float pitch) {
var o = GetOffset();
x = o.X;
y = o.Y;
z = o.Z;
r = GetRotation();
(roll, pitch) = GetPitchRoll();
}
public bool Is(IOffsetProvider other) {
if (this is RelativeEmoteOffsetProvider t && other is RelativeEmoteOffsetProvider o) {
return Equals(o.EmoteOffset, t.EmoteOffset) && Equals(o.BaseOffset, t.BaseOffset);
}
if (this is RelativeEmoteOffsetProvider t2) {
return Equals(t2.BaseOffset, other) || Equals(t2.EmoteOffset, other);
}
if (other is RelativeEmoteOffsetProvider o2) {
return Equals(o2.BaseOffset, this) || Equals(o2.EmoteOffset, other);
}
return Equals(other);
}
}