public static Angles FromAtVector(Vec3f at) { var angles = new Angles(); angles.SetByAtVector(at); return(angles); }
/// <summary> Returns the signed difference on a [-pi, pi] scale between two angles. </summary> public static Angles Difference(Angles angles1, Angles angles2) { return(new Angles() { Pitch = Difference(angles1.Pitch, angles2.Pitch), Yaw = Difference(angles1.Yaw, angles2.Yaw), Roll = Difference(angles1.Roll, angles2.Roll) }); }
// for npc updates public bool DifferenceIsBigger(Angles angles2, float maxDiff) { if (Math.Abs(Difference(Yaw, angles2.Yaw)) > maxDiff) { return(true); } else if (Math.Abs(Difference(Pitch, angles2.Pitch)) > maxDiff) { return(true); } else if (Math.Abs(Difference(Roll, angles2.Roll)) > maxDiff) { return(true); } return(false); }
public PosAng(Vec3f position, Angles angles) { this.Position = position; this.Angles = angles; }