@Override public void setRotationAngles( float f, float f1, float f2, float f3, float f4, float f5, Entity e) { super.setRotationAngles(f, f1, f2, f3, f4, f5, e); if ((e instanceof EntityBunny && ((EntityBunny) e).isSitting())) { Body.rotateAngleX = 0.95993f; Leg1.rotateAngleX = Leg2.rotateAngleX = -1.5708f; Leg3.rotateAngleX = Leg4.rotateAngleX = -0.2818f; Leg1.rotationPointY = Leg2.rotationPointY = 23; Leg1.rotationPointZ = Leg2.rotationPointZ = 2; } else { Leg1.rotationPointY = Leg2.rotationPointY = 19; Leg1.rotationPointZ = Leg2.rotationPointZ = 3; this.Body.rotateAngleX = ((float) Math.PI / 2F); this.Leg1.rotateAngleX = MathHelper.cos(f * 0.6662F) * 1.4F * f1; this.Leg2.rotateAngleX = MathHelper.cos(f * 0.6662F + (float) Math.PI) * 1.4F * f1; this.Leg3.rotateAngleX = MathHelper.cos(f * 0.6662F + (float) Math.PI) * 1.4F * f1; this.Leg4.rotateAngleX = MathHelper.cos(f * 0.6662F) * 1.4F * f1; } this.Head.rotateAngleX = f4 / (180F / (float) Math.PI); this.Head.rotateAngleY = f3 / (180F / (float) Math.PI); this.Ear1.rotateAngleX = f4 / (180F / (float) Math.PI); this.Ear1.rotateAngleY = f3 / (180F / (float) Math.PI); this.Ear2.rotateAngleX = f4 / (180F / (float) Math.PI); this.Ear2.rotateAngleY = f3 / (180F / (float) Math.PI); this.tail.rotateAngleX = ((float) Math.PI / 2F); }
protected void convertToChild(ModelRenderer parParent, ModelRenderer parChild) { parChild.rotationPointX -= parParent.rotationPointX; parChild.rotationPointY -= parParent.rotationPointY; parChild.rotationPointZ -= parParent.rotationPointZ; parChild.rotateAngleX -= parParent.rotateAngleX; parChild.rotateAngleY -= parParent.rotateAngleY; parChild.rotateAngleZ -= parParent.rotateAngleZ; parParent.addChild(parChild); }
public void setRotationAngles( float f, float f1, float f2, float f3, float f4, float f5, Entity entity) { super.setRotationAngles(f, f1, f2, f3, f4, f5, entity); this.TurretHead.rotateAngleY = this.TurretAntennaI.rotateAngleY = this.TurretAntennaII.rotateAngleY = this.RightBarrel.rotateAngleY = this.LeftBarrel.rotateAngleY = f3 / (180F / (float) Math.PI); this.TurretHead.rotateAngleX = this.TurretAntennaI.rotateAngleX = this.TurretAntennaII.rotateAngleX = this.RightBarrel.rotateAngleX = this.LeftBarrel.rotateAngleX = f4 / (180F / (float) Math.PI); setStaticBody(f3); EntityTurret_T2Revolver turret = (EntityTurret_T2Revolver) entity; float healthRot = -((float) Math.PI / 2F) * ((float) (turret.getMaxHealth() - turret.getSrvHealth()) / (float) turret.getMaxHealth()); this.HealthBar.rotateAngleZ = healthRot; float ammoRot = ((float) Math.PI / 2F) * ((float) (turret.getMaxAmmo() - turret.getAmmo()) / (float) turret.getMaxAmmo()); if (TurretUpgrades.hasUpgrade(TUpgInfAmmo.class, turret.upgrades) && turret.getAmmo() > 0) { ammoRot = 0F; } this.AmmoBar.rotateAngleZ = ammoRot; double xR = Math.sin(turret.rotationYawHead / (180D / Math.PI)) * ((double) (turret.getRightBarrelOffset()) / (double) turret.getMaxShootTicks()); double zR = Math.cos(turret.rotationYawHead / (180D / Math.PI)) * ((double) (turret.getRightBarrelOffset()) / (double) turret.getMaxShootTicks()); double yR = -Math.sin(turret.rotationPitch / (180F / (float) Math.PI)) * ((double) (turret.getRightBarrelOffset()) / (double) turret.getMaxShootTicks()); double xL = Math.sin(turret.rotationYawHead / (180D / Math.PI)) * ((double) (turret.getLeftBarrelOffset()) / (double) turret.getMaxShootTicks()); double zL = Math.cos(turret.rotationYawHead / (180D / Math.PI)) * ((double) (turret.getLeftBarrelOffset()) / (double) turret.getMaxShootTicks()); double yL = -Math.sin(turret.rotationPitch / (180F / (float) Math.PI)) * ((double) (turret.getLeftBarrelOffset()) / (double) turret.getMaxShootTicks()); xR *= (Math.cos(turret.rotationPitch / (180F / (float) Math.PI))); zR *= (Math.cos(turret.rotationPitch / (180F / (float) Math.PI))); xL *= (Math.cos(turret.rotationPitch / (180F / (float) Math.PI))); zL *= (Math.cos(turret.rotationPitch / (180F / (float) Math.PI))); if (turret.getAmmo() <= 0) { xR = 0D; yR = 0D; zR = 0D; xL = 0D; yL = 0D; zL = 0D; } RightBarrel.rotationPointX = (float) xR * 3F; RightBarrel.rotationPointZ = (float) zR * 3F; RightBarrel.rotationPointY = (float) yR * 3F; LeftBarrel.rotationPointX = (float) xL * 3F; LeftBarrel.rotationPointZ = (float) zL * 3F; LeftBarrel.rotationPointY = (float) yL * 3F; }
public void setAngles() { // reset the rotation point each render tick body.rotationPointY = 24F; }