Wind Turbine spinning animation is now much smoother and dependent only on height
This commit is contained in:
parent
0a14d064f3
commit
1cc277f2d9
3 changed files with 5 additions and 5 deletions
|
@ -111,7 +111,7 @@ public class ModelWindTurbine extends ModelBase
|
||||||
setRotation(BladeBaseA, 0F, 0F, getRotation(240));
|
setRotation(BladeBaseA, 0F, 0F, getRotation(240));
|
||||||
}
|
}
|
||||||
|
|
||||||
public void render(float size, int angle)
|
public void render(float size, double angle)
|
||||||
{
|
{
|
||||||
Base.render(size);
|
Base.render(size);
|
||||||
TowerFront.render(size);
|
TowerFront.render(size);
|
||||||
|
@ -132,12 +132,12 @@ public class ModelWindTurbine extends ModelBase
|
||||||
BladeBaseA.render(size);
|
BladeBaseA.render(size);
|
||||||
}
|
}
|
||||||
|
|
||||||
public float getRotation(int angle)
|
public float getRotation(double angle)
|
||||||
{
|
{
|
||||||
return ((float)angle/(float)180)*(float)Math.PI;
|
return ((float)angle/(float)180)*(float)Math.PI;
|
||||||
}
|
}
|
||||||
|
|
||||||
public int getAbsoluteAngle(int angle)
|
public double getAbsoluteAngle(double angle)
|
||||||
{
|
{
|
||||||
return angle % 360;
|
return angle % 360;
|
||||||
}
|
}
|
||||||
|
|
|
@ -40,7 +40,7 @@ public class RenderWindTurbine extends TileEntitySpecialRenderer
|
||||||
if(!Mekanism.proxy.isPaused() &&
|
if(!Mekanism.proxy.isPaused() &&
|
||||||
tileEntity.getWorldObj().canBlockSeeTheSky(tileEntity.xCoord, tileEntity.yCoord+4, tileEntity.zCoord))
|
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);
|
model.render(0.0625F, tileEntity.angle);
|
||||||
|
|
|
@ -19,7 +19,7 @@ import dan200.computercraft.api.peripheral.IComputerAccess;
|
||||||
public class TileEntityWindTurbine extends TileEntityGenerator implements IBoundingBlock
|
public class TileEntityWindTurbine extends TileEntityGenerator implements IBoundingBlock
|
||||||
{
|
{
|
||||||
/** The angle the blades of this Wind Turbine are currently at. */
|
/** The angle the blades of this Wind Turbine are currently at. */
|
||||||
public int angle;
|
public double angle;
|
||||||
|
|
||||||
public TileEntityWindTurbine()
|
public TileEntityWindTurbine()
|
||||||
{
|
{
|
||||||
|
|
Loading…
Reference in a new issue