mirror of
https://github.com/blitzkit/blitzkit.git
synced 2026-10-23 19:49:50 +02:00
Merge branch 'main' into ue
This commit is contained in:
commit
d9c7d31017
17 files changed
+228
-43
No files matched your search
@@ -1,5 +1,5 @@
|
||||
---
|
||||
import { assertSecret } from '@blitzkit/core';
|
||||
import { assertSecret } from "@blitzkit/core";
|
||||
|
||||
const PUBLIC_GOOGLE_TAG_MANAGER_ID = assertSecret(
|
||||
import.meta.env.PUBLIC_GOOGLE_TAG_MANAGER_ID,
|
||||
@@ -19,7 +19,7 @@ const PUBLIC_GOOGLE_TAG_MANAGER_ID = assertSecret(
|
||||
dataLayer.push(arguments);
|
||||
}
|
||||
|
||||
gtag('js', new Date());
|
||||
gtag("js", new Date());
|
||||
|
||||
gtag('config', PUBLIC_GOOGLE_TAG_MANAGER_ID);
|
||||
gtag("config", PUBLIC_GOOGLE_TAG_MANAGER_ID);
|
||||
</script>
|
||||
+13
-14
@@ -21,19 +21,20 @@ export function QuickInputs() {
|
||||
const turretModelDefinition =
|
||||
tankModelDefinition.turrets[protagonist.turret.id];
|
||||
const gunModelDefinition = turretModelDefinition.guns[protagonist.gun.id];
|
||||
const initialGunPitch =
|
||||
const initialTurretPitch =
|
||||
tankModelDefinition.initial_turret_rotation?.pitch ?? 0;
|
||||
const hasImprovedVerticalStabilizer = useEquipment(122);
|
||||
const hasDownImprovedVerticalStabilizer = useEquipment(124);
|
||||
|
||||
function displayPitch(pitch: number) {
|
||||
return radToDeg(pitch) - initialTurretPitch;
|
||||
}
|
||||
|
||||
useEffect(() => {
|
||||
function syncInputValues(data: ModelTransformEventData) {
|
||||
if (!pitchInput.current || !yawInput.current) return;
|
||||
|
||||
pitchInput.current.value = (
|
||||
radToDeg(data.pitch) +
|
||||
(tankModelDefinition.initial_turret_rotation?.pitch ?? 0)
|
||||
).toFixed(1);
|
||||
pitchInput.current.value = displayPitch(data.pitch).toFixed(1);
|
||||
yawInput.current.value = radToDeg(data.yaw).toFixed(1);
|
||||
}
|
||||
|
||||
@@ -49,7 +50,7 @@ export function QuickInputs() {
|
||||
return () => {
|
||||
modelTransformEvent.off(handleTransformEvent);
|
||||
};
|
||||
}, [initialGunPitch]);
|
||||
}, [initialTurretPitch]);
|
||||
|
||||
return (
|
||||
<Flex
|
||||
@@ -115,19 +116,17 @@ export function QuickInputs() {
|
||||
size="1"
|
||||
radius="full"
|
||||
style={{ flex: 1, textAlign: "right" }}
|
||||
defaultValue={(
|
||||
radToDeg(modelTransformEvent.last!.pitch) + initialGunPitch
|
||||
).toFixed(1)}
|
||||
defaultValue={displayPitch(modelTransformEvent.last!.pitch).toFixed(1)}
|
||||
onBlur={() => {
|
||||
const value = Number(pitchInput.current!.value);
|
||||
if (isNaN(value)) {
|
||||
pitchInput.current!.value = (
|
||||
radToDeg(modelTransformEvent.last!.pitch) + initialGunPitch
|
||||
pitchInput.current!.value = displayPitch(
|
||||
modelTransformEvent.last!.pitch,
|
||||
).toFixed(1);
|
||||
return;
|
||||
}
|
||||
const [pitch, yaw] = applyPitchYawLimits(
|
||||
degToRad(value + initialGunPitch),
|
||||
degToRad(value + initialTurretPitch),
|
||||
modelTransformEvent.last!.yaw,
|
||||
gunModelDefinition.pitch!,
|
||||
turretModelDefinition.yaw,
|
||||
@@ -135,8 +134,8 @@ export function QuickInputs() {
|
||||
hasDownImprovedVerticalStabilizer,
|
||||
);
|
||||
modelTransformEvent.dispatch({ pitch, yaw });
|
||||
pitchInput.current!.value = (
|
||||
radToDeg(modelTransformEvent.last!.pitch) + initialGunPitch
|
||||
pitchInput.current!.value = displayPitch(
|
||||
modelTransformEvent.last!.pitch,
|
||||
).toFixed(1);
|
||||
}}
|
||||
onKeyDown={(event) => {
|
||||
|
||||
+4
-4
@@ -38,19 +38,19 @@ export function Lighting() {
|
||||
draft.revealed = true;
|
||||
});
|
||||
|
||||
t0.current = clock.elapsedTime - REVEAL_ANIMATION_TIME;
|
||||
t0.current = performance.now() / 1000 - REVEAL_ANIMATION_TIME;
|
||||
}, []);
|
||||
|
||||
useFrame(({ invalidate }) => {
|
||||
if (transition.current) {
|
||||
transition.current = false;
|
||||
t0.current = clock.elapsedTime;
|
||||
t0.current = performance.now() / 1000;
|
||||
}
|
||||
|
||||
const x = clamp(
|
||||
(clock.elapsedTime - t0.current) / animationTime.current,
|
||||
(performance.now() / 1000 - t0.current) / animationTime.current,
|
||||
0,
|
||||
2
|
||||
2,
|
||||
);
|
||||
const t = (0.5 * Math.sin(Math.PI * (x + 0.5)) + 0.5) ** 2;
|
||||
|
||||
|
||||
@@ -183,11 +183,12 @@ export function tankCharacteristics(
|
||||
(coefficient([hasGunRammer, -0.05]) *
|
||||
coefficient([true, degressiveStat(loaderMastery)])) /
|
||||
coefficient([hasAdrenaline && gun.gun_type!.$case === "regular", 0.17]);
|
||||
const penetrationCoefficient =
|
||||
coefficient([
|
||||
hasCalibratedShells,
|
||||
resolvePenetrationCoefficient(true, equalize, shell.type, equalizer) - 1,
|
||||
]) * equalizer.penetration;
|
||||
const penetrationCoefficient = resolvePenetrationCoefficient(
|
||||
hasCalibratedShells,
|
||||
equalize,
|
||||
shell.type,
|
||||
equalizer,
|
||||
);
|
||||
const healthCoefficient =
|
||||
coefficient(
|
||||
[hasSandbagArmor, 0.03],
|
||||
|
||||
Reference in new issue
Block a user