adjusted the ModernBattleShip to be a j30 object and load withc its corresponding texture
This commit is contained in:
		@@ -7,6 +7,9 @@
 | 
			
		||||
 | 
			
		||||
package pp.battleship.client.gui;
 | 
			
		||||
 | 
			
		||||
import com.jme3.material.Material;
 | 
			
		||||
import com.jme3.material.RenderState;
 | 
			
		||||
import com.jme3.renderer.queue.RenderQueue;
 | 
			
		||||
import com.jme3.renderer.queue.RenderQueue.ShadowMode;
 | 
			
		||||
import com.jme3.scene.Node;
 | 
			
		||||
import com.jme3.scene.Spatial;
 | 
			
		||||
@@ -24,9 +27,11 @@
 | 
			
		||||
 * logic for the sea map.
 | 
			
		||||
 */
 | 
			
		||||
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";
 | 
			
		||||
    private static final String UBOAT = "Models/UBoat/14084_WWII_Ship_German_Type_II_U-boat_v2_L1.obj"; //NON-NLS
 | 
			
		||||
    private static final String BATTLE_SHIP_MODERN = "Models/BattleShipModern/10619_Battleship.obj";
 | 
			
		||||
    private static final String BATTLE_SHIP_MODERN = "Models/BattleShipModern/Destroyer.j3o";
 | 
			
		||||
    private static final String BATTLE_SHIP_MODERN_TEXTURE = "Models/BattleShipModern/BattleshipC.jpg";
 | 
			
		||||
    private static final String PATROL_BOAT = "Models/PatrolBoat/12219_boat_v2_L2.obj";
 | 
			
		||||
    private static final String SHELL_ROCKET = "Models/Rocket/Rocket.obj";
 | 
			
		||||
    private static final String SHIP = "ship"; //NON-NLS
 | 
			
		||||
@@ -196,12 +201,20 @@ private Spatial createUBoat(Battleship ship) {
 | 
			
		||||
    private Spatial createModernBattleship(Battleship ship) {
 | 
			
		||||
        final Spatial model = app.getAssetManager().loadModel(BATTLE_SHIP_MODERN);
 | 
			
		||||
 | 
			
		||||
        model.rotate(-HALF_PI, calculateRotationAngle(ship.getRot()) + HALF_PI, 0f);
 | 
			
		||||
        model.scale(0.00008f);
 | 
			
		||||
        Material mat = new Material(app.getAssetManager(), UNSHADED);
 | 
			
		||||
        mat.setTexture("ColorMap", app.getAssetManager().loadTexture(BATTLE_SHIP_MODERN_TEXTURE));
 | 
			
		||||
        mat.getAdditionalRenderState().setBlendMode(RenderState.BlendMode.Off);
 | 
			
		||||
        model.setMaterial(mat);
 | 
			
		||||
 | 
			
		||||
        model.setQueueBucket(RenderQueue.Bucket.Opaque);
 | 
			
		||||
 | 
			
		||||
        model.rotate(-HALF_PI, calculateRotationAngle(ship.getRot()), 0f);
 | 
			
		||||
        model.scale(0.08f);
 | 
			
		||||
        model.setLocalTranslation(0f, 0.25f, 0f);
 | 
			
		||||
        model.setShadowMode(ShadowMode.CastAndReceive);
 | 
			
		||||
        model.move(0, 0.2f, 0);
 | 
			
		||||
 | 
			
		||||
        return model;
 | 
			
		||||
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    /**
 | 
			
		||||
 
 | 
			
		||||
										
											Binary file not shown.
										
									
								
							
		Reference in New Issue
	
	Block a user