SHARE
TWEET

Untitled

a guest Sep 22nd, 2019 91 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1.     public float SCALE = 0.0625F;
  2.  
  3.     protected float getWingAngle(float maxAngle, int totalTime, double d) {
  4.         float angle = 0.0F;
  5.         float deltaTime = getAnimationTime(totalTime, d);
  6.         if (deltaTime <= 0.5F) {
  7.             angle = Sigmoid(-4.0F + deltaTime * 2.0F * 8.0F);
  8.         } else {
  9.             angle = 1.0F - Sigmoid(-4.0F + (deltaTime * 2.0F - 1.0F) * 8.0F);
  10.         }
  11.         angle *= maxAngle;
  12.         return angle;
  13.     }
  14.  
  15.     protected void setRotation(ModelRenderer model, float y) {
  16.         model.rotateAngleY = y;
  17.     }
  18.  
  19.     private static float Sigmoid(double value) {
  20.         return 1.0F / (1.0F + (float)Math.exp(-value));
  21.     }
  22.  
  23.     private float getAnimationTime(int totalTime, double d) {
  24.         float time = (float)((System.currentTimeMillis() + d) % totalTime);
  25.         return time / totalTime;
  26.     }
  27. }
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top