Compare commits

..

3 Commits

2 changed files with 38 additions and 6 deletions

View File

@ -1740,7 +1740,10 @@ function moveAsLowLevelMoves({ move, nextMove, startingPos, numProgessions }: {
beats: move.beats - 4,
endPosition: endingPos,
// TODO Is bend the line just linear?
movementPattern: { kind: SemanticAnimationKind.Linear },
movementPattern: {
kind: SemanticAnimationKind.Linear,
minRotation: startingPos.which.isLeft() ? -1 : +1
},
}], startingPos);
});
@ -1858,12 +1861,14 @@ function moveAsLowLevelMoves({ move, nextMove, startingPos, numProgessions }: {
}
case "pass through":
if (move.parameters.dir !== "along") {
throw new Error("Unsupported pass through direction: " + move.parameters.dir);
if (move.parameters.dir === "left diagonal" || move.parameters.dir === "right diagonal") {
// TODO There's logic for this below, but unsure it's right.
throw new Error(move.move + " with dir of " + move.parameters.dir + " is unsupported.");
}
const alongSet = move.parameters.dir === "along";
const passShoulder = move.parameters.shoulder ? Hand.Right : Hand.Left;
return handleMove(({ startPos }) => {
if (startPos.kind === PositionKind.Circle) {
if (alongSet && startPos.kind === PositionKind.Circle) {
const facing = startPos.which.facingUpOrDown();
const endPos: SemanticPosition = {
kind: PositionKind.Circle,
@ -1885,7 +1890,31 @@ function moveAsLowLevelMoves({ move, nextMove, startingPos, numProgessions }: {
otherPath: "Swap",
},
}], startPos);
} else {
} else if (!alongSet && startPos.kind === PositionKind.Circle) {
const facing = startPos.which.facingAcross();
const endPos: SemanticPosition = {
kind: PositionKind.Circle,
which: startPos.which.swapAcross(),
facing,
setOffset: (startPos.setOffset ?? 0) + (move.parameters.dir === "across"
? 0
: (move.parameters.dir === "left diagonal") === startPos.which.isLeft() ? -1 : +1),
lineOffset: startPos.lineOffset,
};
return combine([{
beats: move.beats,
endPosition: endPos,
movementPattern: {
kind: SemanticAnimationKind.PassBy,
around: startPos.which.topBottomSide(),
side: passShoulder,
withHands: false,
facing: "Forward",
otherPath: "Swap",
},
}], startPos);
} else if (alongSet && startPos.kind === PositionKind.ShortLines) {
// TODO This assumes short *wavy* lines.
const endPos: SemanticPosition = {
@ -1901,6 +1930,8 @@ function moveAsLowLevelMoves({ move, nextMove, startingPos, numProgessions }: {
endPosition: endPos,
movementPattern: { kind: SemanticAnimationKind.Linear },
}], startPos);
} else {
throw new Error(move.move + " with dir of " + move.parameters.dir + " starting from " + startPos.kind + " is unsupported.");
}
});

View File

@ -763,6 +763,7 @@ function animateLowLevelMoveWithoutSlide(move: LowLevelMove): animation.Animatio
const twirlCenter =
CenterOf(move.movementPattern.around, move.startPosition.setOffset, move.startPosition.lineOffset);
const aroundTopOrBottom = move.movementPattern.around === CircleSide.Top || move.movementPattern.around === CircleSide.Bottom;
const inShortLines = move.startPosition.kind === PositionKind.ShortLines;
return [
new animation.TransitionAnimationSegment({
actualAnimation: new animation.RotationAnimationSegment({
@ -779,7 +780,7 @@ function animateLowLevelMoveWithoutSlide(move: LowLevelMove): animation.Animatio
around: {
center: twirlCenter,
width: aroundTopOrBottom ? setWidth : setWidth / 4,
height: aroundTopOrBottom ? setHeight / 4 : setHeight,
height: aroundTopOrBottom || inShortLines ? setHeight / 4 : setHeight,
},
facing: animation.RotationAnimationFacing.Linear,
hands: new Map<Hand, animation.HandAnimation>([