mirror of
https://github.com/blitzkit/blitzkit.git
synced 2026-10-24 03:59:50 +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,
|
normalizeAngleRad,
|
||||||
type PitchLimits,
|
type PitchLimits,
|
||||||
type YawLimits,
|
type YawLimits,
|
||||||
} from '@blitzkit/core';
|
} from "@blitzkit/core";
|
||||||
import { clamp } from 'lodash-es';
|
import { clamp } from "lodash-es";
|
||||||
import { degToRad } from 'three/src/math/MathUtils.js';
|
import { degToRad } from "three/src/math/MathUtils.js";
|
||||||
|
|
||||||
export const DEFAULT_PITCH_TRANSITION = 15;
|
export const DEFAULT_PITCH_TRANSITION = 15;
|
||||||
|
|
||||||
@@ -87,5 +87,5 @@ export function applyPitchYawLimits(
|
|||||||
|
|
||||||
newPitch = clamp(newPitch, lowerPitch, upperPitch);
|
newPitch = clamp(newPitch, lowerPitch, upperPitch);
|
||||||
|
|
||||||
return [newPitch, newYaw] as const;
|
return [newPitch, normalizeAngleRad(newYaw)] as const;
|
||||||
}
|
}
|
||||||
Reference in new issue
Block a user