feat: 1 more decimal in pitch and yaw

This commit is contained in:
TrèsAbhi committed 2024-03-12 17:40:58 -05:00
1 parent fd408d6777
commit 01c491aee0
1 file changed
+4 -4
@@ -28,12 +28,12 @@ export function RotationInputs({ isFullScreen }: RotationInputsProps) {
const initialGunPitch = tankModelDefinition.turretRotation?.pitch ?? 0; const initialGunPitch = tankModelDefinition.turretRotation?.pitch ?? 0;
useEffect(() => { useEffect(() => {
turretYawInput.current!.value = radToDeg(protagonist.yaw).toFixed(0); turretYawInput.current!.value = radToDeg(protagonist.yaw).toFixed(1);
}, [protagonist.yaw]); }, [protagonist.yaw]);
useEffect(() => { useEffect(() => {
gunPitchInput.current!.value = ( gunPitchInput.current!.value = (
-radToDeg(protagonist.pitch) + initialGunPitch -radToDeg(protagonist.pitch) + initialGunPitch
).toFixed(0); ).toFixed(1);
}, [protagonist.pitch]); }, [protagonist.pitch]);
return ( return (
@@ -80,7 +80,7 @@ export function RotationInputs({ isFullScreen }: RotationInputsProps) {
state.protagonist!.yaw = yaw; state.protagonist!.yaw = yaw;
}); });
turretYawInput.current!.value = radToDeg(protagonist.yaw).toFixed( turretYawInput.current!.value = radToDeg(protagonist.yaw).toFixed(
0, 1,
); );
}} }}
onKeyDown={(event) => { onKeyDown={(event) => {
@@ -130,7 +130,7 @@ export function RotationInputs({ isFullScreen }: RotationInputsProps) {
}); });
gunPitchInput.current!.value = ( gunPitchInput.current!.value = (
-radToDeg(protagonist.pitch) + initialGunPitch -radToDeg(protagonist.pitch) + initialGunPitch
).toFixed(0); ).toFixed(1);
}} }}
onKeyDown={(event) => { onKeyDown={(event) => {
if (event.key === 'Enter') { if (event.key === 'Enter') {