Exemplo n.º 1
0
 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
                ));
 }
Exemplo n.º 2
0
 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
                ));
 }
Exemplo n.º 3
0
 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();
 }
Exemplo n.º 5
0
 public static PolarCoords SmoothDamp(PolarCoords from, PolarCoords to, ref PolarCoords currentVelocity,
                                      float smoothTime)
 {
     return(SmoothDamp(from, to, ref currentVelocity, smoothTime, Time.deltaTime));
 }
Exemplo n.º 6
0
 public static PolarCoords Lerp(PolarCoords from, PolarCoords to, float t)
 {
     return(LerpUnclamped(from, to, Mathf.Clamp01(t)));
 }
Exemplo n.º 7
0
 public static IEnumerable <RaycastHitPolar> RaycastAll(PolarCoords origin, Vector2 direction)
 {
     yield return(new RaycastHitPolar());
 }
Exemplo n.º 8
0
 public static RaycastHitPolar Raycast(PolarCoords origin, Vector2 direction)
 {
     return(RaycastAll(origin, direction).FirstOrDefault());
 }