mirror of
https://github.com/Creators-of-Create/Create.git
synced 2024-12-29 08:27:03 +01:00
fix gantry cogs skipping every half rotation
This commit is contained in:
parent
d2e30eeab5
commit
7aa175dd9c
1 changed files with 8 additions and 1 deletions
|
@ -5,6 +5,7 @@ import com.simibubi.create.AllBlockPartials;
|
|||
import com.simibubi.create.content.contraptions.base.KineticTileEntity;
|
||||
import com.simibubi.create.content.contraptions.base.KineticTileEntityRenderer;
|
||||
import com.simibubi.create.foundation.utility.AngleHelper;
|
||||
import com.simibubi.create.foundation.utility.AnimationTickHolder;
|
||||
import com.simibubi.create.foundation.utility.Iterate;
|
||||
import com.simibubi.create.foundation.utility.MatrixStacker;
|
||||
|
||||
|
@ -59,7 +60,7 @@ public class GantryPinionRenderer extends KineticTileEntityRenderer {
|
|||
.rotateY(alongFirst ^ facing.getAxis() == Axis.Z ? 90 : 0);
|
||||
|
||||
ms.translate(0, -9 / 16f, 0);
|
||||
ms.multiply(Vector3f.POSITIVE_X.getRadialQuaternion(-angleForTe / 2f));
|
||||
ms.multiply(Vector3f.POSITIVE_X.getRadialQuaternion(-angleForTe));
|
||||
ms.translate(0, 9 / 16f, 0);
|
||||
|
||||
msr.unCentre();
|
||||
|
@ -70,6 +71,12 @@ public class GantryPinionRenderer extends KineticTileEntityRenderer {
|
|||
ms.pop();
|
||||
}
|
||||
|
||||
public static float getAngleForTe(KineticTileEntity te, final BlockPos pos, Axis axis) {
|
||||
float time = AnimationTickHolder.getRenderTick();
|
||||
float offset = getRotationOffsetForPosition(te, pos, axis);
|
||||
return ((time * te.getSpeed() * 3f / 20 + offset) % 360) / 180 * (float) Math.PI;
|
||||
}
|
||||
|
||||
@Override
|
||||
protected BlockState getRenderedBlockState(KineticTileEntity te) {
|
||||
return shaft(getRotationAxisOf(te));
|
||||
|
|
Loading…
Reference in a new issue