public static PolarCoords LerpUnclamped(PolarCoords from, PolarCoords to, float t) { return(new PolarCoords( Radian.Lerp(from.radAngle, to.radAngle, t), Mathf.LerpUnclamped(from.height, to.height, t), false )); }
public static PolarCoords SmoothDamp(PolarCoords from, PolarCoords to, ref PolarCoords currentVelocity, float smoothTime, float deltaTime) { return(new PolarCoords( Radian.SmoothDamp(from.radAngle, to.radAngle, ref currentVelocity.radAngle, smoothTime, deltaTime), Mathf.SmoothDamp(from.height, to.height, ref currentVelocity.height, smoothTime, Mathf.Infinity, deltaTime), false )); }
private void LateUpdate() { Coordinates = PolarCoords.SmoothDamp(Coordinates, TargetPos, ref currentVelocity, smoothTime); transform.rotation = Quaternion.LookRotation(target.WorldPosition - WorldPosition, Vector3.up); }
public void Translate(Vector2 movement) { coords += new PolarCoords(movement, Tower.Radius + Separation); UpdatePosition(); }
public static PolarCoords SmoothDamp(PolarCoords from, PolarCoords to, ref PolarCoords currentVelocity, float smoothTime) { return(SmoothDamp(from, to, ref currentVelocity, smoothTime, Time.deltaTime)); }
public static PolarCoords Lerp(PolarCoords from, PolarCoords to, float t) { return(LerpUnclamped(from, to, Mathf.Clamp01(t))); }
public static IEnumerable <RaycastHitPolar> RaycastAll(PolarCoords origin, Vector2 direction) { yield return(new RaycastHitPolar()); }
public static RaycastHitPolar Raycast(PolarCoords origin, Vector2 direction) { return(RaycastAll(origin, direction).FirstOrDefault()); }