added boat with length 1 and 3

This commit is contained in:
Tamino Mueller
2024-10-11 02:23:59 +02:00
parent d5450df77c
commit 70ed981ea2
30 changed files with 108626 additions and 3 deletions

View File

@@ -35,7 +35,10 @@ 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 UX23 = "Models/UX23/UX23.j3o";
private static final String ALIENSHIP = "Models/Alienship/Alienship.j3o";
private static final String MARLOW66 = "Models/Marlow66/Marlow66.j3o";
private static final String KING_GEORGE_V_MODEL = "Models/KingGeorgeV/KingGeorgeV.j3o"; //NON-NLS
private static final String COLOR = "Color"; //NON-NLS
private static final String SHIP = "ship"; //NON-NLS
@@ -144,6 +147,12 @@ class SeaSynchronizer extends ShipMapSynchronizer {
*/
private Spatial createShip(Battleship ship) {
switch (ship.getLength()) {
case 1:
return createUX23(ship);
case 3:
return createMarlow66(ship);
case 4:
return createBattleship(ship);
case 5:
@@ -161,9 +170,32 @@ class SeaSynchronizer extends ShipMapSynchronizer {
model.setShadowMode(ShadowMode.CastAndReceive);
return model;}
private Spatial createUX23(Battleship ship) {
final Spatial model = app.getAssetManager().loadModel(UX23);
model.rotate(-HALF_PI, calculateRotationAngle(ship.getRot()), 0f);
// model.move(0f, -0.05f, 0f);
model.scale(0.0027f);
model.setShadowMode(ShadowMode.CastAndReceive);
return model;
}
/**
private Spatial createMarlow66(Battleship ship) {
final Spatial model = app.getAssetManager().loadModel(MARLOW66);
model.rotate(0f, calculateRotationAngle(ship.getRot()), 0f);
model.move(0f, 0.25f, 0f);
model.scale(0.0085f);
model.setShadowMode(ShadowMode.CastAndReceive);
return model;
}
/**
* Creates a simple box to represent a battleship that is not of the "King George V" type.
*
* @param ship the battleship to be represented

Binary file not shown.

After

Width:  |  Height:  |  Size: 235 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 76 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 127 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 70 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 142 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.1 MiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.2 MiB