mirror of
https://github.com/blitzkit/blitzkit.git
synced 2026-10-24 20:19:49 +02:00
feat: cooler header
This commit is contained in:
1 parent
f0295079cc
commit
9d916a588d
10 files changed
+99
-38
No files matched your search
@@ -1,14 +1,19 @@
|
||||
import type { ProvisionDefinitions, TankDefinition } from '@blitzkit/core';
|
||||
import type {
|
||||
ModelDefinition,
|
||||
ProvisionDefinitions,
|
||||
TankDefinition,
|
||||
} from '@blitzkit/core';
|
||||
import { uniqueId } from 'lodash-es';
|
||||
import type { CompareMember } from '../../stores/compareEphemeral';
|
||||
import { tankToDuelMember } from './tankToDuelMember';
|
||||
|
||||
export function tankToCompareMember(
|
||||
tank: TankDefinition,
|
||||
model: ModelDefinition,
|
||||
provisionDefinitions: ProvisionDefinitions,
|
||||
) {
|
||||
return {
|
||||
...tankToDuelMember(tank, provisionDefinitions),
|
||||
...tankToDuelMember(tank, model, provisionDefinitions),
|
||||
key: uniqueId(),
|
||||
} satisfies CompareMember;
|
||||
}
|
||||
@@ -1,17 +1,30 @@
|
||||
import {
|
||||
createDefaultProvisions,
|
||||
ModelDefinition,
|
||||
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,
|
||||
model: ModelDefinition,
|
||||
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,
|
||||
@@ -24,8 +37,8 @@ export function tankToDuelMember(
|
||||
shell: tank.turrets.at(-1)!.guns.at(-1)!.gun_type!.value.base.shells[0],
|
||||
tank,
|
||||
track: tank.tracks.at(-1)!,
|
||||
yaw: 0,
|
||||
pitch: 0,
|
||||
yaw,
|
||||
pitch,
|
||||
turret,
|
||||
} satisfies DuelMember;
|
||||
}
|
||||
Reference in new issue
Block a user