mirror of
https://github.com/blitzkit/blitzkit.git
synced 2026-10-23 19:49:50 +02:00
feat: transition and continous
This commit is contained in:
1 parent
291395718f
commit
897da9479d
2 files changed
+35
-25
No files matched your search
@@ -6,6 +6,8 @@ import {
|
||||
import { clamp } from 'lodash-es';
|
||||
import { degToRad } from 'three/src/math/MathUtils.js';
|
||||
|
||||
export const DEFAULT_PITCH_TRANSITION = 15;
|
||||
|
||||
export function applyPitchYawLimits(
|
||||
pitch: number, // rad
|
||||
yaw: number, // rad
|
||||
@@ -28,7 +30,9 @@ export function applyPitchYawLimits(
|
||||
const elevationBuff = verticalStabilizer ? degToRad(4) : 0;
|
||||
let lowerPitch = -degToRad(pitchLimits.max) - depressionBuff;
|
||||
let upperPitch = -degToRad(pitchLimits.min) + elevationBuff;
|
||||
const transition = degToRad(pitchLimits.transition ?? 15);
|
||||
const transition = degToRad(
|
||||
pitchLimits.transition ?? DEFAULT_PITCH_TRANSITION,
|
||||
);
|
||||
|
||||
if (pitchLimits.back) {
|
||||
const range = degToRad(pitchLimits.back.range);
|
||||
|
||||
Reference in new issue
Block a user