mirror of
https://athene2.informatik.unibw-muenchen.de/progproj/gruppen-ht24/Gruppe-02.git
synced 2025-01-18 18:23:44 +01:00
Karten add
This commit is contained in:
parent
1db2d9ebac
commit
36a9a7addf
@ -77,11 +77,11 @@ public class BoardAppState extends MonopolyAppState {
|
|||||||
*/
|
*/
|
||||||
private PopUpManager popUpManager;;
|
private PopUpManager popUpManager;;
|
||||||
|
|
||||||
private Vector3f currentTarget = new Vector3f(-10f,0,-10f);
|
private Vector3f currentTarget;
|
||||||
|
|
||||||
private float modelHeight = -5f;
|
private float modelHeight = -5f;
|
||||||
private final float targetHeight = 0f;
|
private final float targetHeight = 0f;
|
||||||
private final float animationSpeed = 0.01389f;
|
private final float animationSpeed = 0.001389f;
|
||||||
private Node modelNode;
|
private Node modelNode;
|
||||||
private boolean startAnimation = false;
|
private boolean startAnimation = false;
|
||||||
private CameraController cameraController;
|
private CameraController cameraController;
|
||||||
@ -220,22 +220,43 @@ public class BoardAppState extends MonopolyAppState {
|
|||||||
|
|
||||||
private Node createCardDeck() {
|
private Node createCardDeck() {
|
||||||
Node cardDeck = new Node("cardDeck");
|
Node cardDeck = new Node("cardDeck");
|
||||||
Spatial card = getApp().getAssetManager().loadModel("models/Kartendecks/Ereigniskarten.j3o");
|
|
||||||
card.setLocalTranslation(5.5f, 0, 2.7f);
|
// Ereigniskarten
|
||||||
card.setLocalScale(4.1f);
|
Vector3f basePosition1 = new Vector3f(3.1f, 0.4f, 3.8f); // Basisposition für Ereigniskarten
|
||||||
card.setLocalRotation(new Quaternion().fromAngleAxis(FastMath.QUARTER_PI, Vector3f.UNIT_Y));
|
float baseRotation1 = -60; // Basisrotation in Grad
|
||||||
|
for (int i = 0; i < 6; i++) {
|
||||||
Spatial card2 = getApp().getAssetManager().loadModel("models/Kartendecks/Gemeinschaftskarten.j3o");
|
Box box = new Box(1.2f, 0.05f, 1.8f); // Sehr flaches Rechteck
|
||||||
card2.setLocalTranslation(-1.4f, 0, -3.8f);
|
Geometry flatCard = new Geometry("Ereigniskarten_" + i, box);
|
||||||
card2.setLocalScale(4.1f);
|
Material mat = new Material(getApp().getAssetManager(), "Common/MatDefs/Misc/Unshaded.j3md");
|
||||||
card2.setLocalRotation(new Quaternion().fromAngleAxis(FastMath.QUARTER_PI , Vector3f.UNIT_Y));
|
mat.setTexture("ColorMap", getApp().getAssetManager().loadTexture("Textures/Ereigniskarten.png"));
|
||||||
|
flatCard.setMaterial(mat);
|
||||||
//TODO insert card deck
|
|
||||||
// cardDeck.attachChild(card);
|
// Position und Rotation für die Karte
|
||||||
// cardDeck.attachChild(card2);
|
flatCard.setLocalTranslation(basePosition1.x, basePosition1.y - (i * 0.08f), basePosition1.z);
|
||||||
|
flatCard.setLocalRotation(new Quaternion().fromAngleAxis(FastMath.DEG_TO_RAD * (baseRotation1 - (i * 5)), Vector3f.UNIT_Y));
|
||||||
|
|
||||||
|
cardDeck.attachChild(flatCard);
|
||||||
|
}
|
||||||
|
|
||||||
|
// Gemeinschaftskarten
|
||||||
|
Vector3f basePosition2 = new Vector3f(-3.3f, 0.4f, -3.8f); // Basisposition für Gemeinschaftskarten
|
||||||
|
float baseRotation2 = -220; // Basisrotation in Grad
|
||||||
|
for (int i = 0; i < 6; i++) {
|
||||||
|
Box box = new Box(1.2f, 0.04f, 1.8f); // Sehr flaches Rechteck
|
||||||
|
Geometry flatCard = new Geometry("Gemeinschaftskarten_" + i, box);
|
||||||
|
Material mat = new Material(getApp().getAssetManager(), "Common/MatDefs/Misc/Unshaded.j3md");
|
||||||
|
mat.setTexture("ColorMap", getApp().getAssetManager().loadTexture("Textures/Gemeinschaftskarten.png"));
|
||||||
|
flatCard.setMaterial(mat);
|
||||||
|
|
||||||
|
// Position und Rotation für die Karte
|
||||||
|
flatCard.setLocalTranslation(basePosition2.x, basePosition2.y - (i * 0.08f), basePosition2.z);
|
||||||
|
flatCard.setLocalRotation(new Quaternion().fromAngleAxis(FastMath.DEG_TO_RAD * (baseRotation2 - (i * 5)), Vector3f.UNIT_Y));
|
||||||
|
|
||||||
|
cardDeck.attachChild(flatCard);
|
||||||
|
}
|
||||||
|
|
||||||
return cardDeck;
|
return cardDeck;
|
||||||
}
|
}
|
||||||
|
|
||||||
public Vector3f getCurrentTarget(){
|
public Vector3f getCurrentTarget(){
|
||||||
return currentTarget;
|
return currentTarget;
|
||||||
}
|
}
|
||||||
|
@ -293,6 +293,8 @@ public class MonopolyApp extends SimpleApplication implements MonopolyClient, Ga
|
|||||||
stateManager.attach(stats);
|
stateManager.attach(stats);
|
||||||
}
|
}
|
||||||
flyCam.setEnabled(true);
|
flyCam.setEnabled(true);
|
||||||
|
flyCam.setMoveSpeed(4f); // Setzt die Bewegungsgeschwindigkeit der Kamera (Standardwert ist 1f)
|
||||||
|
|
||||||
stateManager.detach(stateManager.getState(StatsAppState.class));
|
stateManager.detach(stateManager.getState(StatsAppState.class));
|
||||||
stateManager.detach(stateManager.getState(DebugKeysAppState.class));
|
stateManager.detach(stateManager.getState(DebugKeysAppState.class));
|
||||||
|
|
||||||
|
Binary file not shown.
After Width: | Height: | Size: 215 KiB |
Binary file not shown.
After Width: | Height: | Size: 60 KiB |
Loading…
Reference in New Issue
Block a user