Ejemplo n.º 1
0
    private void FixedUpdate()
    {
        Vector3 euler = transform.eulerAngles;

        euler.z = UtilMath.ApproachAngleDegrees(euler.z,
                                                upDirection.GetUpAngle() - 90.0f, rotationSpeed * timeScale.DeltaTime());
        transform.rotation = Quaternion.Euler(euler);
    }
Ejemplo n.º 2
0
    private void FixedUpdate()
    {
        Vector3 euler = transform.eulerAngles;

        euler.z = Angle.FromDegrees(euler.z).ApproachCoterminal(
            upDirection.GetUpAngle().AddDegrees(-90.0f),
            rotationSpeed * timeScale.DeltaTime())
                  .GetDegrees();
        transform.rotation = Quaternion.Euler(euler);
    }
Ejemplo n.º 3
0
    private void FixedUpdate()
    {
        Vector3 euler = transform.eulerAngles;

        euler.z = Angle.FromDegrees(euler.z).Approach(
            upDirection.GetUpAngle().AddDegrees(-90.0f),
            Angle.FromDegrees(rotationSpeed * timeScale.DeltaTime()))
                  .GetDegrees();
        //UtilPeriodic.Approach()

        /*
         *  UtilApproach.AngleDegrees(euler.z,
         *  upDirection.GetUpAngle() - 90.0f, rotationSpeed * timeScale.DeltaTime());
         */
        transform.rotation = Quaternion.Euler(euler);
    }
Ejemplo n.º 4
0
 // Gets the angle that corresponds to the current up direction.
 private Angle GetUpAngle()
 {
     return(upDirection.GetUpAngle());
 }
Ejemplo n.º 5
0
 // Gets the angle that corresponds to the current up direction.
 private float GetUpAngle()
 {
     return(upDirection.GetUpAngle());
 }