SteamWar/BauSystem2.0
Archiviert
12
0

fix(tracer): Fixed first point of advanced flag incorrect calc order
Alle Prüfungen waren erfolgreich
SteamWarCI Build successful

Dieser Commit ist enthalten in:
D4rkr34lm 2024-07-06 12:54:09 +02:00
Ursprung 442ba6f483
Commit a62c08b097

Datei anzeigen

@ -34,6 +34,9 @@ import java.util.stream.Stream;
* A settable flag that changes how a trace is rendered
*/
public abstract class ViewFlag {
public static final Vector GRAVATY = new Vector(0.0, -0.04, 0.0);
public static final Vector DRAG_FACTOR = new Vector(0.98, 0.98, 0.98);
/**
* Static registry of static flags
*/
@ -122,9 +125,8 @@ public abstract class ViewFlag {
if (prev.isEmpty()) continue;
TNTPoint previous = prev.get();
Vector previousVelocity = previous.getVelocity();
Location delta = representative.getLocation().clone().subtract(previous.getLocation());
Vector previousVelocity = previous.isAfterFirstExplosion() ? previous.getVelocity() : delta.toVector().clone().divide(DRAG_FACTOR).subtract(GRAVATY);
Location yLocation = previous.getLocation().clone().add(0, delta.getY(), 0);
if (yLocation.distanceSquared(representative.getLocation()) >= 1.0 / 256.0 && yLocation.distanceSquared(previous.getLocation()) >= 1.0 / 256.0) {