Compare commits

..

No commits in common. "987270e073d94b55a507b0e143dc06fd31b18f95" and "ad14e4e51f031a3aeced300aeca41a0f1e380813" have entirely different histories.

2 changed files with 6 additions and 38 deletions

View File

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

View File

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