Merge branch 'development2' of https://athene2.informatik.unibw-muenchen.de/progproj/gruppen-ht24/Gruppe-01 into development2
This commit is contained in:
@@ -305,16 +305,18 @@ private float getRotationMove(Vector3f prev, Vector3f next) {
|
|||||||
private void movePieceRek(UUID uuid, int curIndex, int moveIndex){
|
private void movePieceRek(UUID uuid, int curIndex, int moveIndex){
|
||||||
if (curIndex == moveIndex) return;
|
if (curIndex == moveIndex) return;
|
||||||
|
|
||||||
curIndex = (curIndex + 1) % infield.size();
|
int nextIndex = (curIndex + 1) % infield.size();
|
||||||
|
|
||||||
PieceControl pieceControl = pieces.get(uuid);
|
PieceControl pieceControl = pieces.get(uuid);
|
||||||
NodeControl nodeControl = infield.get(curIndex);
|
NodeControl nodeCur = infield.get(curIndex);
|
||||||
|
NodeControl nodeMove = infield.get(nextIndex);
|
||||||
|
|
||||||
pieceControl.setRotation(getRotationMove(pieceControl.getLocation(),nodeControl.getLocation()));
|
pieceControl.setRotation(getRotationMove(nodeCur.getLocation(),nodeMove.getLocation()));
|
||||||
|
|
||||||
movePieceToNode(pieceControl, nodeControl);
|
movePieceToNode(pieceControl, nodeMove);
|
||||||
|
|
||||||
movePieceRek(uuid, curIndex, moveIndex);
|
|
||||||
|
movePieceRek(uuid, nextIndex, moveIndex);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -760,6 +762,7 @@ private <K, V> K getKeyByValue(Map<K, V> map, V value) {
|
|||||||
* @param moveIndex the target index to animate the piece to
|
* @param moveIndex the target index to animate the piece to
|
||||||
*/
|
*/
|
||||||
public void movePieceAnim(UUID uuid, int curIndex, int moveIndex){
|
public void movePieceAnim(UUID uuid, int curIndex, int moveIndex){
|
||||||
|
|
||||||
pieces.get(uuid).getSpatial().addControl(new MoveControl(
|
pieces.get(uuid).getSpatial().addControl(new MoveControl(
|
||||||
infield.get(curIndex).getLocation(),
|
infield.get(curIndex).getLocation(),
|
||||||
infield.get(moveIndex).getLocation(),
|
infield.get(moveIndex).getLocation(),
|
||||||
|
|||||||
Reference in New Issue
Block a user