mirror of
https://athene2.informatik.unibw-muenchen.de/progproj/gruppen-ht24/Gruppe-02.git
synced 2024-11-24 23:59:44 +01:00
added small boat model
This commit is contained in:
parent
05618c0793
commit
cf780f0995
@ -34,7 +34,8 @@ 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 KING_GEORGE_V_MODEL = "Models/KingGeorgeV/KingGeorgeV.j3o";//NON-NLS
|
||||
private static final String SMALL_BOAT_MODEL = "Models/BoatSmall/BoatSmall.j3o";
|
||||
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,9 +142,24 @@ 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);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* Creates a simple box to represent a battleship that is not of the "King George V" type.
|
||||
*
|
||||
@ -196,6 +212,17 @@ class SeaSynchronizer extends ShipMapSynchronizer {
|
||||
return model;
|
||||
}
|
||||
|
||||
private Spatial createSmallShip(Battleship ship) {
|
||||
final Spatial model = app.getAssetManager().loadModel(SMALL_BOAT_MODEL);
|
||||
|
||||
model.rotate(-HALF_PI, calculateRotationAngle(ship.getRot()), 0f);
|
||||
model.scale(0.0005f);
|
||||
model.setShadowMode(ShadowMode.CastAndReceive);
|
||||
|
||||
return model;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Calculates the rotation angle for the specified rotation.
|
||||
*
|
||||
|
@ -0,0 +1,104 @@
|
||||
# 3ds Max Wavefront OBJ Exporter v0.97b - (c)2007 guruware
|
||||
# File Created: 16.12.2011 14:18:52
|
||||
|
||||
newmtl white
|
||||
Ns 53.0000
|
||||
Ni 1.5000
|
||||
d 1.0000
|
||||
Tr 0.0000
|
||||
Tf 1.0000 1.0000 1.0000
|
||||
illum 2
|
||||
Ka 0.6667 0.6667 0.6667
|
||||
Kd 0.6667 0.6667 0.6667
|
||||
Ks 0.1800 0.1800 0.1800
|
||||
Ke 0.0000 0.0000 0.0000
|
||||
|
||||
newmtl boat_elements_black
|
||||
Ns 55.0000
|
||||
Ni 1.5000
|
||||
d 1.0000
|
||||
Tr 0.0000
|
||||
Tf 1.0000 1.0000 1.0000
|
||||
illum 2
|
||||
Ka 0.0000 0.0000 0.0000
|
||||
Kd 0.0000 0.0000 0.0000
|
||||
Ks 0.3600 0.3600 0.3600
|
||||
Ke 0.0000 0.0000 0.0000
|
||||
|
||||
newmtl boat_glass
|
||||
Ns 60.0000
|
||||
Ni 7.0000
|
||||
d 0.4000
|
||||
Tr 0.6000
|
||||
Tf 0.4000 0.4000 0.4000
|
||||
illum 2
|
||||
Ka 0.1059 0.1569 0.1451
|
||||
Kd 0.1059 0.1569 0.1451
|
||||
Ks 0.6750 0.6750 0.6750
|
||||
Ke 0.0000 0.0000 0.0000
|
||||
|
||||
newmtl boat_screw_hooks_bronze
|
||||
Ns 80.0000
|
||||
Ni 1.5000
|
||||
d 1.0000
|
||||
Tr 0.0000
|
||||
Tf 1.0000 1.0000 1.0000
|
||||
illum 2
|
||||
Ka 0.2941 0.2157 0.0510
|
||||
Kd 0.2941 0.2157 0.0510
|
||||
Ks 0.7200 0.7200 0.7200
|
||||
Ke 0.0000 0.0000 0.0000
|
||||
|
||||
newmtl boat_silver
|
||||
Ns 80.0000
|
||||
Ni 1.5000
|
||||
d 1.0000
|
||||
Tr 0.0000
|
||||
Tf 1.0000 1.0000 1.0000
|
||||
illum 2
|
||||
Ka 0.3333 0.3333 0.3333
|
||||
Kd 0.3333 0.3333 0.3333
|
||||
Ks 0.7200 0.7200 0.7200
|
||||
Ke 0.0000 0.0000 0.0000
|
||||
|
||||
newmtl boat_buffer
|
||||
Ns 10.0000
|
||||
Ni 1.5000
|
||||
d 1.0000
|
||||
Tr 0.0000
|
||||
Tf 1.0000 1.0000 1.0000
|
||||
illum 2
|
||||
Ka 1.0000 1.0000 1.0000
|
||||
Kd 1.0000 1.0000 1.0000
|
||||
Ks 0.2700 0.2700 0.2700
|
||||
Ke 0.0000 0.0000 0.0000
|
||||
map_Ka boat_buffer_diffuse.jpg
|
||||
map_Kd boat_buffer_diffuse.jpg
|
||||
|
||||
newmtl boat_roof_accessory
|
||||
Ns 15.0000
|
||||
Ni 1.5000
|
||||
d 1.0000
|
||||
Tr 0.0000
|
||||
Tf 1.0000 1.0000 1.0000
|
||||
illum 2
|
||||
Ka 1.0000 1.0000 1.0000
|
||||
Kd 1.0000 1.0000 1.0000
|
||||
Ks 0.3600 0.3600 0.3600
|
||||
Ke 0.0000 0.0000 0.0000
|
||||
map_Ka boat_roof_accessory_diffuse.jpg
|
||||
map_Kd boat_roof_accessory_diffuse.jpg
|
||||
|
||||
newmtl boat_body
|
||||
Ns 55.0000
|
||||
Ni 1.5000
|
||||
d 1.0000
|
||||
Tr 0.0000
|
||||
Tf 1.0000 1.0000 1.0000
|
||||
illum 2
|
||||
Ka 1.0000 1.0000 1.0000
|
||||
Kd 1.0000 1.0000 1.0000
|
||||
Ks 0.3600 0.3600 0.3600
|
||||
Ke 0.0000 0.0000 0.0000
|
||||
map_Ka boat_body_diffuse.jpg
|
||||
map_Kd boat_body_diffuse.jpg
|
File diff suppressed because it is too large
Load Diff
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 |
Loading…
Reference in New Issue
Block a user