public static Pose TrimPoseUpdate(this ProxyForceMotionType mt, Pose oldPose, Pose newPose) { Pose result; if (mt == ProxyForceMotionType.NotForced) { result = oldPose; } else if (mt == ProxyForceMotionType.MoveAndRotateFreely) { result = newPose; } else if (mt == ProxyForceMotionType.MoveAndRotateY) { result = newPose; var newAngles = newPose.rotation.eulerAngles; result.rotation = Quaternion.Euler(0, newAngles.y, 0); } else if (mt == ProxyForceMotionType.MoveAndRotateZ) { result = newPose; var newAngles = newPose.rotation.eulerAngles; result.rotation = Quaternion.Euler(0, 0, newAngles.z); } else { throw new System.NotImplementedException("TODO: " + mt); } return(result); }
internal static ProxyForceFieldMotion TrimMotionUpdate(this ProxyForceMotionType mt, ProxyForceFieldMotion oldMotion, ProxyForceFieldMotion newMotion) { var newPose = mt.TrimPoseUpdate(oldMotion.location, newMotion.location); var ans = newMotion; ans.location = newPose; return(ans); }
public static bool IsMoving(this ProxyForceMotionType mt) { return(mt != ProxyForceMotionType.NotForced); }