Wind Turbine spinning animation is now much smoother and dependent only on height

This commit is contained in:
Aidan C. Brady 2015-03-24 10:53:45 -04:00
parent 0a14d064f3
commit 1cc277f2d9
3 changed files with 5 additions and 5 deletions

View file

@ -111,7 +111,7 @@ public class ModelWindTurbine extends ModelBase
setRotation(BladeBaseA, 0F, 0F, getRotation(240));
}
public void render(float size, int angle)
public void render(float size, double angle)
{
Base.render(size);
TowerFront.render(size);
@ -132,12 +132,12 @@ public class ModelWindTurbine extends ModelBase
BladeBaseA.render(size);
}
public float getRotation(int angle)
public float getRotation(double angle)
{
return ((float)angle/(float)180)*(float)Math.PI;
}
public int getAbsoluteAngle(int angle)
public double getAbsoluteAngle(double angle)
{
return angle % 360;
}

View file

@ -40,7 +40,7 @@ public class RenderWindTurbine extends TileEntitySpecialRenderer
if(!Mekanism.proxy.isPaused() &&
tileEntity.getWorldObj().canBlockSeeTheSky(tileEntity.xCoord, tileEntity.yCoord+4, tileEntity.zCoord))
{
tileEntity.angle = (tileEntity.angle+((int)(tileEntity.getMultiplier() * partialTick))) % 360;
tileEntity.angle = (tileEntity.angle+((tileEntity.yCoord+4)/256F)*8) % 360;
}
model.render(0.0625F, tileEntity.angle);

View file

@ -19,7 +19,7 @@ import dan200.computercraft.api.peripheral.IComputerAccess;
public class TileEntityWindTurbine extends TileEntityGenerator implements IBoundingBlock
{
/** The angle the blades of this Wind Turbine are currently at. */
public int angle;
public double angle;
public TileEntityWindTurbine()
{