Apel is a library that brings particle animations to the table with flexible behaviour and a clean developer interface. It promises also lots of predefined shapes & paths to help the developer on their particle scene
Other
0
stars
0
forks
source link
`LinearAnimator` does not convert from `renderingInterval` to `renderingSteps` correctly #48
LinearAnimator linearAnimator =new LinearAnimator(1, new Vector3f[]{
offset(user, 10, 0, 2), offset(user, -10, 0, 2), offset(user, 9, 0, 2), offset(user, -9, 0, 2),
}, polygon, .04f);
private Vector3f offset(PlayerEntity user, int x, int y, int z) {
return user.getPos().toVector3f().add(x, y, z);
}
The total distance is clearly (10 to -10) + (-10 to 9) + (9 to -9), or 20 + 19 + 18 == 57. However, it's computed as 40, which, when divided by the interval of .04f, gives 1000 steps. It should be 57 / .04f == 1425. Specifically, it should have 500 steps on the first interval, 475 steps on the second, and 450 on the third.
This points to a deeper problem with steps and interval calculation. It should be done during the constructor, and immediately when any rendering steps or interval is changed. It also begs the question of what should happen once the animation starts: should the steps or interval be able to change? Given the current approach of pre-creating all steps, positions, and runnables to draw, making changes to those will be difficult, so we should start without allowing changes (only cancellation).
Given the following:
The total distance is clearly (10 to -10) + (-10 to 9) + (9 to -9), or 20 + 19 + 18 == 57. However, it's computed as 40, which, when divided by the interval of
.04f
, gives 1000 steps. It should be57 / .04f == 1425
. Specifically, it should have 500 steps on the first interval, 475 steps on the second, and 450 on the third.This points to a deeper problem with steps and interval calculation. It should be done during the constructor, and immediately when any rendering steps or interval is changed. It also begs the question of what should happen once the animation starts: should the steps or interval be able to change? Given the current approach of pre-creating all steps, positions, and runnables to draw, making changes to those will be difficult, so we should start without allowing changes (only cancellation).