|
@@ -22,7 +22,6 @@ import static xyz.tbvns.GDConstant.*;
|
|
@Slf4j
|
|
@Slf4j
|
|
public class Render {
|
|
public class Render {
|
|
public double currentPercent;
|
|
public double currentPercent;
|
|
- public double currentDistance;
|
|
|
|
public HashMap<GDInstance, Integer> animationToCurrentframe = new HashMap<>();
|
|
public HashMap<GDInstance, Integer> animationToCurrentframe = new HashMap<>();
|
|
|
|
|
|
public String fullRender(double fps) throws CloneNotSupportedException {
|
|
public String fullRender(double fps) throws CloneNotSupportedException {
|
|
@@ -35,9 +34,8 @@ public class Render {
|
|
double realDistancePerFrame = (speed / fps) * 30;
|
|
double realDistancePerFrame = (speed / fps) * 30;
|
|
double distancePerFramePercent = realDistancePerFrame / LevelInfo.getLevel().getMaxPos() / 30;
|
|
double distancePerFramePercent = realDistancePerFrame / LevelInfo.getLevel().getMaxPos() / 30;
|
|
currentPercent += distancePerFramePercent;
|
|
currentPercent += distancePerFramePercent;
|
|
- currentDistance += realDistancePerFrame;
|
|
|
|
|
|
|
|
- Vector3f cameraTranslation = new Vector3f((float) (currentPercent * LevelInfo.getLevel().getMaxPos()), 0, 5); //TODO: make that move with the player
|
|
|
|
|
|
+ Vector3f cameraTranslation = new Vector3f((float) -(currentPercent * LevelInfo.getLevel().getMaxPos()), 0, 30); //TODO: make that move with the player
|
|
camera.translation(cameraTranslation); //TODO: make that follow a new camera path editor
|
|
camera.translation(cameraTranslation); //TODO: make that follow a new camera path editor
|
|
builder.add(1, 1, X_PROPERTY_ID, projectPoint(camera, new Vector4f(cameraTranslation.x, cameraTranslation.y, cameraTranslation.z - 1, 1)).x, Y_PROPERTY_ID,projectPoint(camera, new Vector4f(cameraTranslation.x, cameraTranslation.y, cameraTranslation.z - 1, 1)).y);
|
|
builder.add(1, 1, X_PROPERTY_ID, projectPoint(camera, new Vector4f(cameraTranslation.x, cameraTranslation.y, cameraTranslation.z - 1, 1)).x, Y_PROPERTY_ID,projectPoint(camera, new Vector4f(cameraTranslation.x, cameraTranslation.y, cameraTranslation.z - 1, 1)).y);
|
|
|
|
|
|
@@ -70,7 +68,7 @@ public class Render {
|
|
Vector3 translation = instance.getInstance().transform.getTranslation(Vector3.Zero);
|
|
Vector3 translation = instance.getInstance().transform.getTranslation(Vector3.Zero);
|
|
vector.add(translation.x * 30, translation.y * 30, translation.z * 30, 0);
|
|
vector.add(translation.x * 30, translation.y * 30, translation.z * 30, 0);
|
|
Vector4f projected = projectPoint(camera, vector);
|
|
Vector4f projected = projectPoint(camera, vector);
|
|
- builder.add(1, POINT_OBJECT_ID, X_PROPERTY_ID, projected.x * 30, Y_PROPERTY_ID, projected.y * 30);
|
|
|
|
|
|
+ builder.add(1, POINT_OBJECT_ID, X_PROPERTY_ID, projected.x, Y_PROPERTY_ID, projected.y);
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|