Reset collision tag on visualiser boat after displaying collision
- Modified View3D to index subjects rather than shapes by source ID - Enforced one collision per boat on server to reduce rendering load - Changed collision radius to less than bounce radius - Fixed game-breaking null command bug #story[1195]
This commit is contained in:
@@ -29,17 +29,18 @@ public class CollisionCommand extends ObserverCommand {
|
||||
public void execute() {
|
||||
this.azimuth = Azimuth.fromDegrees(boat.getBearing().degrees() - 180d);
|
||||
this.startingPosition = boat.getPosition();
|
||||
this.distance = 30;
|
||||
this.distance = 60;
|
||||
boat.setVelocityDefault(false);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void update(Observable o, Object arg) {
|
||||
if(GPSCoordinate.calculateDistanceMeters(boat.getPosition(), startingPosition) < distance) {
|
||||
boat.setPosition(GPSCoordinate.calculateNewPosition(boat.getPosition(), 2, azimuth));
|
||||
boat.setPosition(GPSCoordinate.calculateNewPosition(boat.getPosition(), 3, azimuth));
|
||||
} else {
|
||||
race.deleteObserver(this);
|
||||
boat.setVelocityDefault(true);
|
||||
boat.setColliding(false);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user