Skip to content

Commit

Permalink
fix: animation rotation angle and speed
Browse files Browse the repository at this point in the history
  • Loading branch information
Jeronimo97 committed Oct 7, 2024
1 parent 3ba6bb1 commit 7ecec38
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 13 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -50,13 +50,11 @@ public void updateAnimation() {

public boolean isAnimationFinished() {
if (step > 0) {
if (progress < max) {
if (progress < max)
return false;
}
} else {
if (max < progress) {
if (max < progress)
return false;
}
}
return true;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,8 @@

public class SignalAnimationRotation implements SignalAnimation {

private static float factor = 3.49065f;

private AnimationRotionCalc calc;

private final Predicate<Map<SEProperty, String>> predicate;
Expand Down Expand Up @@ -39,15 +41,15 @@ public void setUpAnimationValues(final ModelTranslation currentTranslation) {
Vector3f maxPos = new Vector3f(0, 0, 0);
switch (axis) {
case X: {
maxPos = new Vector3f(-rotation * 0.005f * animationSpeed, 0, 0);
maxPos = new Vector3f(rotation * 0.005f * factor, 0, 0);
break;
}
case Y: {
maxPos = new Vector3f(0, -rotation * 0.005f * animationSpeed, 0);
maxPos = new Vector3f(0, rotation * 0.005f * factor, 0);
break;
}
case Z: {
maxPos = new Vector3f(0, 0, -rotation * 0.005f * animationSpeed);
maxPos = new Vector3f(0, 0, rotation * 0.005f * factor);
break;
}
default:
Expand All @@ -58,7 +60,7 @@ public void setUpAnimationValues(final ModelTranslation currentTranslation) {

@Override
public ModelTranslation getFinalModelTranslation() {
return new ModelTranslation(pivot, axis.getForAxis(-rotation * 0.005f * animationSpeed));
return new ModelTranslation(pivot, axis.getForAxis(rotation * 0.005f * factor));
}

@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
"predicate": "config(BARRIER_OPEN.TRUE)",
"mode": "ROTATION",
"rotationAxis": "Z",
"rotation": -310,
"rotation": 90,
"pivotX": 0,
"pivotY": 0,
"pivotZ": 0
Expand All @@ -43,7 +43,7 @@
"predicate": "config(BARRIER_OPEN.TRUE)",
"mode": "ROTATION",
"rotationAxis": "Z",
"rotation": -310,
"rotation": 90,
"pivotX": 0,
"pivotY": 0,
"pivotZ": 0
Expand All @@ -68,7 +68,7 @@
"predicate": "config(BARRIER_OPEN.TRUE)",
"mode": "ROTATION",
"rotationAxis": "Z",
"rotation": -310,
"rotation": 90,
"pivotX": 0,
"pivotY": 0,
"pivotZ": 0
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
"translationX": 0.15,
"translationY": 6.95,
"translationZ": -0.5,

"animationConfigs": [
{
"predicate": "config(WING1.FALSE)",
Expand All @@ -18,7 +19,7 @@
"predicate": "config(WING1.TRUE)",
"mode": "ROTATION",
"rotationAxis": "Z",
"rotation": 155,
"rotation": -45,
"pivotX": -0.65,
"pivotY": -4.45,
"pivotZ": 0
Expand All @@ -40,7 +41,7 @@
"predicate": "config(WING2.TRUE)",
"mode": "ROTATION",
"rotationAxis": "Z",
"rotation": -100,
"rotation": 45,
"pivotX": 0,
"pivotY": 0,
"pivotZ": 0
Expand Down

0 comments on commit 7ecec38

Please sign in to comment.