mirror of
https://github.com/VolmitSoftware/Iris.git
synced 2025-07-19 10:43:14 +00:00
Patch rotation glitch
This commit is contained in:
parent
a669fcba7a
commit
3e30994541
@ -228,12 +228,15 @@ public class PlannedStructure {
|
|||||||
|
|
||||||
private boolean generateRotatedPiece(PlannedPiece piece, IrisJigsawPieceConnector pieceConnector, IrisJigsawPiece idea, IrisObjectRotation rotation) {
|
private boolean generateRotatedPiece(PlannedPiece piece, IrisJigsawPieceConnector pieceConnector, IrisJigsawPiece idea, IrisObjectRotation rotation) {
|
||||||
if (!idea.getPlacementOptions().getRotation().isEnabled())
|
if (!idea.getPlacementOptions().getRotation().isEnabled())
|
||||||
rotation = piece.getRotation(); //Inherit parent rotation
|
{
|
||||||
|
rotation = piece.getRotation();
|
||||||
|
}
|
||||||
|
|
||||||
PlannedPiece test = new PlannedPiece(this, piece.getPosition(), idea, rotation);
|
PlannedPiece test = new PlannedPiece(this, piece.getPosition(), idea, rotation);
|
||||||
|
|
||||||
for (IrisJigsawPieceConnector j : test.getPiece().getConnectors().shuffleCopy(rng)) {
|
for (IrisJigsawPieceConnector j : test.getPiece().getConnectors().shuffleCopy(rng)) {
|
||||||
if (generatePositionedPiece(piece, pieceConnector, test, j)) {
|
if (generatePositionedPiece(piece, pieceConnector, test, j)) {
|
||||||
|
Iris.info("PLACED " + piece.getPiece().getLoadKey() + " -> " + test.getPiece().getLoadKey() + " on " + pieceConnector.getName() + "#" + pieceConnector.getTargetName());
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -33,6 +33,7 @@ import lombok.experimental.Accessors;
|
|||||||
public class IrisAxisRotationClamp {
|
public class IrisAxisRotationClamp {
|
||||||
@Desc("Should this axis be rotated at all?")
|
@Desc("Should this axis be rotated at all?")
|
||||||
private boolean enabled = false;
|
private boolean enabled = false;
|
||||||
|
|
||||||
private transient boolean forceLock = false;
|
private transient boolean forceLock = false;
|
||||||
|
|
||||||
@Required
|
@Required
|
||||||
@ -72,7 +73,7 @@ public class IrisAxisRotationClamp {
|
|||||||
|
|
||||||
public double getRadians(int rng) {
|
public double getRadians(int rng) {
|
||||||
if (forceLock) {
|
if (forceLock) {
|
||||||
return Math.toRadians(max);
|
return Math.toRadians(Math.ceil(Math.abs((max % 360D))));
|
||||||
}
|
}
|
||||||
|
|
||||||
if (isUnlimited()) {
|
if (isUnlimited()) {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user