added u-boat model

This commit is contained in:
Yvonne Schmidt
2024-10-08 00:43:02 +02:00
parent fe1bf7746b
commit 141d817421
5 changed files with 203129 additions and 0 deletions

View File

@@ -36,6 +36,7 @@ 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 SMALL_BOAT_MODEL = "Models/BoatSmall/12219_boat_v2_L2.j3o";
private static final String UBOAT_MODEL = "Models/UBoat/14084_WWII_Ship_German_Type_II_U-boat_v2_L1.j30";
private static final String COLOR = "Color"; //NON-NLS
private static final String SHIP = "ship"; //NON-NLS
private static final String SHOT = "shot"; //NON-NLS
@@ -145,6 +146,8 @@ class SeaSynchronizer extends ShipMapSynchronizer {
switch (ship.getLength()) {
case 4:
return createBattleship(ship);
case 2:
return createUBoat(ship);
case 1:
return createSmallShip(ship);
@@ -222,6 +225,16 @@ class SeaSynchronizer extends ShipMapSynchronizer {
return model;
}
private Spatial createUBoat(Battleship ship) {
final Spatial model = app.getAssetManager().loadModel(UBOAT_MODEL);
model.rotate(-HALF_PI, calculateRotationAngle(ship.getRot()), 0f);
model.scale(1.48f);
model.setShadowMode(ShadowMode.CastAndReceive);
return model;
}
/**
* Calculates the rotation angle for the specified rotation.