mirror of
https://athene2.informatik.unibw-muenchen.de/progproj/gruppen-ht24/Gruppe-02.git
synced 2025-08-06 05:25:44 +02:00
added small boat
This commit is contained in:
@@ -35,6 +35,7 @@ import static pp.util.FloatMath.PI;
|
||||
class SeaSynchronizer extends ShipMapSynchronizer {
|
||||
private static final String UNSHADED = "Common/MatDefs/Misc/Unshaded.j3md"; //NON-NLS
|
||||
private static final String KING_GEORGE_V_MODEL = "Models/KingGeorgeV/KingGeorgeV.j3o"; //NON-NLS
|
||||
private static final String BOAT_SMALL_MODEL = "Models/BoatSmall/12219_boat_v2_L2.j3o"; //NON-NLS
|
||||
private static final String COLOR = "Color"; //NON-NLS
|
||||
private static final String SHIP = "ship"; //NON-NLS
|
||||
private static final String SHOT = "shot"; //NON-NLS
|
||||
@@ -141,7 +142,16 @@ class SeaSynchronizer extends ShipMapSynchronizer {
|
||||
* @return the spatial representing the battleship
|
||||
*/
|
||||
private Spatial createShip(Battleship ship) {
|
||||
return ship.getLength() == 4 ? createBattleship(ship) : createBox(ship);
|
||||
switch (ship.getLength()) {
|
||||
case 4:
|
||||
return createBattleship(ship);
|
||||
|
||||
case 1:
|
||||
return createSmallship(ship);
|
||||
|
||||
default:
|
||||
return createBox(ship);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -191,6 +201,17 @@ class SeaSynchronizer extends ShipMapSynchronizer {
|
||||
|
||||
model.rotate(-HALF_PI, calculateRotationAngle(ship.getRot()), 0f);
|
||||
model.scale(1.48f);
|
||||
// model.scale(0.0007f);
|
||||
model.setShadowMode(ShadowMode.CastAndReceive);
|
||||
|
||||
return model;
|
||||
}
|
||||
|
||||
private Spatial createSmallship(Battleship ship) {
|
||||
final Spatial model = app.getAssetManager().loadModel(BOAT_SMALL_MODEL);
|
||||
|
||||
model.rotate(-HALF_PI, calculateRotationAngle(ship.getRot()), 0f);
|
||||
model.scale(0.0005f);
|
||||
model.setShadowMode(ShadowMode.CastAndReceive);
|
||||
|
||||
return model;
|
||||
|
Binary file not shown.
Binary file not shown.
After Width: | Height: | Size: 56 KiB |
Binary file not shown.
After Width: | Height: | Size: 166 KiB |
Binary file not shown.
After Width: | Height: | Size: 98 KiB |
Reference in New Issue
Block a user