From a62c08b097b8b4f828266830efb573fa25afd7ca Mon Sep 17 00:00:00 2001 From: D4rkr34lm Date: Sat, 6 Jul 2024 12:54:09 +0200 Subject: [PATCH] fix(tracer): Fixed first point of advanced flag incorrect calc order --- .../bausystem/features/tracer/rendering/ViewFlag.java | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/BauSystem_Main/src/de/steamwar/bausystem/features/tracer/rendering/ViewFlag.java b/BauSystem_Main/src/de/steamwar/bausystem/features/tracer/rendering/ViewFlag.java index 088aee4e..9aa83f13 100644 --- a/BauSystem_Main/src/de/steamwar/bausystem/features/tracer/rendering/ViewFlag.java +++ b/BauSystem_Main/src/de/steamwar/bausystem/features/tracer/rendering/ViewFlag.java @@ -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) {