Ver Fonte

bruh imma ask chatgpt

____tbvns____ há 5 meses atrás
pai
commit
7bf56422d9

+ 5 - 5
PowerGDEditor/src/main/java/xyz/tbvns/Models/GDInstance.java

@@ -36,14 +36,14 @@ public class GDInstance {
 
     //TODO: This doesn't work, repair later
     public Model getFrameOnPercent(double percent) {
-        double usablePercent = percent - start;
+        double usablePercent = percent - (start / 100);
         if (usablePercent > 0) {
             float max = LevelInfo.getLevel().getMaxPos();
-            double pos = max * percent;
             double speed = LevelInfo.getLevel().getSpeedAt((float) percent);
-            double time = speed / fps;
-
-            int frame = (int) (pos / time);
+            //Animation length in second
+            //TODO: MAKE THIS WORK + add a function to convert percentage to time with correct estimation pf speed (
+            double fullTime = (double) animationObject.getFrames().size() / 24;
+            int frame = 0;
             if (!(frame > animationObject.getModelFrames().size() - 1)) {
                 System.out.println(frame);
                 return animationObject.getModelFrames().get(frame);

+ 4 - 0
PowerGDEditor/src/main/java/xyz/tbvns/Utils.java

@@ -23,4 +23,8 @@ public class Utils {
     public static float getCameraPercent() {
         return Main.getCamera().position.x / (LevelInfo.getLevel().getMaxPos() / 30);
     }
+
+    public static float percentToTime() {
+        //TODO: add that
+    }
 }