Java interpolate interpolateRotation(float prevRotation, float nextRotation, float partialTick)

Here you can find the source of interpolateRotation(float prevRotation, float nextRotation, float partialTick)

Description

interpolate Rotation

License

Open Source License

Declaration

public static float interpolateRotation(float prevRotation, float nextRotation, float partialTick) 

Method Source Code

//package com.java2s;
/*******************************************************************************
 * HellFirePvP / Astral Sorcery 2017//from   w  w  w . j  a  va  2s . c o  m
 *
 * This project is licensed under GNU GENERAL PUBLIC LICENSE Version 3.
 * The source code is available on github: https://github.com/HellFirePvP/AstralSorcery
 * For further details, see the License file there.
 ******************************************************************************/

public class Main {
    public static float interpolateRotation(float prevRotation, float nextRotation, float partialTick) {
        float rot = nextRotation - prevRotation;
        while (rot >= 180.0F) {
            rot -= 360.0F;
        }
        while (rot >= 180.0F) {
            rot -= 360.0F;
        }
        return prevRotation + partialTick * rot;
    }
}

Related

  1. interpolateFloat(float t, float a, float b)
  2. interpolateLinear(final float a, final float b, final float t)
  3. interpolateLinear(float lastState, float currentState, float ip)
  4. interpolateProp(final String source, final String propName, final String defValue)
  5. interpolateRotation(float par1, float par2, float par3)
  6. interpolateRound(double a, double b, double t)
  7. interpolateSmoothly(final float position, final float startPosition, final float endPosition, final float startValue, final float endValue)
  8. interpolateValue(double current, double prev, float partialTickTime)
  9. interpolateValues(float prevVal, float nextVal, float partialTick)