SteamWar/BauSystem2.0
Archiviert
12
0

Fix Trace stuff for 'überspitze Winkel'
Alle Prüfungen waren erfolgreich
SteamWarCI Build successful

Signed-off-by: yoyosource <yoyosource@nidido.de>
Dieser Commit ist enthalten in:
yoyosource 2022-04-09 22:44:20 +02:00
Ursprung aa121bb5e8
Commit 73bae34535
4 geänderte Dateien mit 7 neuen und 6 gelöschten Zeilen

Datei anzeigen

@ -63,7 +63,7 @@ public class ProcessingTracesState implements LaufbauState {
} else {
Vector movement = location.clone().subtract(previousLocation);
cuboidList.add(new Cuboid(previousLocation.getX() - 0.49, Math.min(previousLocation.getY(), location.getY()), previousLocation.getZ() - 0.49, 0.98, Math.abs(movement.getY()) + 0.98, 0.98));
if (Math.abs(movement.getX()) > Math.abs(movement.getZ())) {
if (Math.abs(tntPosition.getVelocity().getX()) > Math.abs(tntPosition.getVelocity().getZ())) {
cuboidList.add(new Cuboid(Math.min(previousLocation.getX(), location.getX()) - 0.49, location.getY(), previousLocation.getZ() - 0.49, Math.abs(movement.getX()) + 0.98, 0.98, 0.98));
cuboidList.add(new Cuboid(location.getX() - 0.49, location.getY(), Math.min(previousLocation.getZ(), location.getZ()) - 0.49, 0.98, 0.98, Math.abs(movement.getZ()) + 0.98));
} else {

Datei anzeigen

@ -31,13 +31,15 @@ public class TNTPosition extends Position {
private final Record.TNTRecord record;
private final int fuseTicks;
private final Vector previousLocation;
private final Vector velocity;
private final boolean exploded;
public TNTPosition(Record.TNTRecord record, TNTPrimed entity, Vector previousLocation, boolean exploded) {
public TNTPosition(Record.TNTRecord record, TNTPrimed entity, Vector previousLocation, Vector velocity, boolean exploded) {
super(entity.getLocation().toVector());
this.record = record;
this.fuseTicks = entity.getFuseTicks();
this.previousLocation = previousLocation;
this.velocity = velocity;
this.exploded = exploded;
}

Datei anzeigen

@ -98,9 +98,9 @@ public class Record {
private void add(TNTPrimed tntPrimed, boolean exploded) {
TNTPosition position;
if (positions.isEmpty()) {
position = new TNTPosition(this, tntPrimed, null, exploded);
position = new TNTPosition(this, tntPrimed, null, tntPrimed.getVelocity(), exploded);
} else {
position = new TNTPosition(this, tntPrimed, positions.get(positions.size() - 1).getLocation(), exploded);
position = new TNTPosition(this, tntPrimed, positions.get(positions.size() - 1).getLocation(), tntPrimed.getVelocity(), exploded);
}
positions.add(position);
TraceShowManager.show(position);

Datei anzeigen

@ -109,8 +109,7 @@ public abstract class FactoredEntityShowMode implements ShowMode<TNTPosition> {
}
if (showModeParameter.isInterpolate_XZ()) {
Vector movement = position.getLocation().clone().subtract(position.getPreviousLocation());
Vector updatePointXZ = Math.abs(movement.getX()) > Math.abs(movement.getZ())
Vector updatePointXZ = Math.abs(position.getVelocity().getX()) > Math.abs(position.getVelocity().getZ())
? position.getLocation().clone().setZ(position.getPreviousLocation().getZ())
: position.getLocation().clone().setX(position.getPreviousLocation().getX());
if (!position.getLocation().equals(updatePointXZ)) {