mirror of
https://github.com/blitzkit/blitzkit.git
synced 2026-10-21 02:37:05 +02:00
fix: turret angles round back to \pm 180deg
This commit is contained in:
1 parent
a0b81bfb83
commit
bae7ca2720
1 file changed
+4
-4
@@ -2,9 +2,9 @@ import {
|
||||
normalizeAngleRad,
|
||||
type PitchLimits,
|
||||
type YawLimits,
|
||||
} from '@blitzkit/core';
|
||||
import { clamp } from 'lodash-es';
|
||||
import { degToRad } from 'three/src/math/MathUtils.js';
|
||||
} from "@blitzkit/core";
|
||||
import { clamp } from "lodash-es";
|
||||
import { degToRad } from "three/src/math/MathUtils.js";
|
||||
|
||||
export const DEFAULT_PITCH_TRANSITION = 15;
|
||||
|
||||
@@ -87,5 +87,5 @@ export function applyPitchYawLimits(
|
||||
|
||||
newPitch = clamp(newPitch, lowerPitch, upperPitch);
|
||||
|
||||
return [newPitch, newYaw] as const;
|
||||
return [newPitch, normalizeAngleRad(newYaw)] as const;
|
||||
}
|
||||
Reference in new issue
Block a user