skeledance/set-camera-position.sh
2026-07-19 14:58:47 -03:00

24 lines
578 B
Bash
Executable file

#!/usr/bin/env bash
AZIMUTH_FILE=/tmp/skeledance-camera-azimuth
ROTATION_FILE=/tmp/skeledance-camera-rotation
POSITION=${1:-leste}
case "$POSITION" in
norte|north) AZIMUTH=0 ;;
leste|east) AZIMUTH=90 ;;
sul|south) AZIMUTH=180 ;;
oeste|west) AZIMUTH=270 ;;
*)
if [[ "$POSITION" =~ ^-?[0-9]+([.][0-9]+)?$ ]]; then
AZIMUTH=$POSITION
else
printf 'Uso: %s norte|leste|sul|oeste|GRAUS\n' "$0" >&2
exit 2
fi
;;
esac
printf '%s\n' "$AZIMUTH" > "$AZIMUTH_FILE"
printf '0\n' > "$ROTATION_FILE"
printf 'Câmera fixa em %s°\n' "$AZIMUTH"