@@ -46,7 +46,7 @@ private static void point(@NotNull FloatCollection target, List<VectorPoint> poi
4646 return sum (position , rotation , scale , set );
4747 }
4848
49- public static @ NotNull List <AnimationPoint > sum (@ NotNull List <VectorPoint > position , @ NotNull List <VectorPoint > rotation , @ NotNull List <VectorPoint > scale , FloatCollection points ) {
49+ public static @ NotNull List <AnimationPoint > sum (@ NotNull List <VectorPoint > position , @ NotNull List <VectorPoint > rotation , @ NotNull List <VectorPoint > scale , @ NotNull FloatCollection points ) {
5050 var list = new ArrayList <AnimationPoint >();
5151 var pp = putPoint (position , points );
5252 var rp = putPoint (rotation , points );
@@ -95,9 +95,9 @@ public static void insertRotationFrame(@NotNull FloatSet frames, @NotNull List<V
9595 for (int i = 0 ; i < vectorPoints .size () - 1 ; i ++) {
9696 var before = vectorPoints .get (i );
9797 var after = vectorPoints .get (i + 1 );
98- var angle = ( float ) Math . ceil ( Math . toDegrees ( MathUtil . toQuaternion ( after . vector ())
99- . mul ( MathUtil . toQuaternion ( before . vector ()). invert ())
100- . angle ()) / 45F );
98+ var sub = after . vector (). sub ( before . vector (), new Vector3f ()). absolute ();
99+ var max = Math . max ( sub . x , Math . max ( sub . y , sub . z )) / 30F ;
100+ var angle = ( float ) Math . ceil ( max );
101101 if (angle > 1 ) {
102102 for (float t = 1 ; t < angle ; t ++) {
103103 frames .add (linear (before .time (), after .time (), t / angle ));
0 commit comments