mirror of
https://github.com/blitzkit/blitzkit.git
synced 2026-10-23 11:39:50 +02:00
feat: remove reactive pitch and yaw
This commit is contained in:
1 parent
4ddf77fc7f
commit
94cba0c9ba
12 files changed
+141
-190
No files matched your search
@@ -1,8 +1,11 @@
|
||||
import { Quicklime } from 'quicklime';
|
||||
|
||||
export interface ModelTransformEventData {
|
||||
yaw?: number;
|
||||
yaw: number;
|
||||
pitch: number;
|
||||
}
|
||||
|
||||
export const modelTransformEvent = new Quicklime<ModelTransformEventData>();
|
||||
export const modelTransformEvent = new Quicklime<ModelTransformEventData>({
|
||||
pitch: 0,
|
||||
yaw: 0,
|
||||
});
|
||||
@@ -4,10 +4,8 @@ import {
|
||||
type ProvisionDefinitions,
|
||||
type TankDefinition,
|
||||
} from '@blitzkit/core';
|
||||
import { degToRad } from 'three/src/math/MathUtils.js';
|
||||
import type { DuelMember } from '../../stores/duel';
|
||||
import { genericDefaultEquipmentMatrix } from '../../stores/duel/constants';
|
||||
import { applyPitchYawLimits } from '../blitz/applyPitchYawLimits';
|
||||
|
||||
export function tankToDuelMember(
|
||||
tank: TankDefinition,
|
||||
@@ -15,16 +13,7 @@ export function tankToDuelMember(
|
||||
provisionDefinitions: ProvisionDefinitions,
|
||||
) {
|
||||
const turret = tank.turrets.at(-1)!;
|
||||
const turretModel = model.turrets[turret.id];
|
||||
const gun = turret.guns.at(-1)!;
|
||||
const gunModel = turretModel.guns[gun.gun_type!.value.base.id];
|
||||
|
||||
const [pitch, yaw] = applyPitchYawLimits(
|
||||
degToRad(8),
|
||||
degToRad(25),
|
||||
gunModel.pitch,
|
||||
turretModel.yaw,
|
||||
);
|
||||
|
||||
return {
|
||||
camouflage: true,
|
||||
@@ -37,8 +26,6 @@ export function tankToDuelMember(
|
||||
shell: tank.turrets.at(-1)!.guns.at(-1)!.gun_type!.value.base.shells[0],
|
||||
tank,
|
||||
track: tank.tracks.at(-1)!,
|
||||
yaw,
|
||||
pitch,
|
||||
turret,
|
||||
assaultDistance:
|
||||
(gun.gun_type!.value.base.assault_ranges?.ranges[0].distance ?? 0) / 2,
|
||||
|
||||
Reference in new issue
Block a user