mirror of
https://github.com/blitzkit/blitzkit.git
synced 2026-10-23 19:49:50 +02:00
fix: heat doesn't actually ricochet lol
This commit is contained in:
1 parent
8e2302a6d4
commit
82933aaf1e
6 files changed
+14
-11
No files matched your search
@@ -311,7 +311,7 @@ export function Characteristics() {
|
|||||||
<InfoWithDelta name="Normalization" decimals={0} unit="°">
|
<InfoWithDelta name="Normalization" decimals={0} unit="°">
|
||||||
{stats.shellNormalization}
|
{stats.shellNormalization}
|
||||||
</InfoWithDelta>
|
</InfoWithDelta>
|
||||||
{shell.type !== 'he' && (
|
{!isExplosive(shell.type) && (
|
||||||
<InfoWithDelta
|
<InfoWithDelta
|
||||||
name="Ricochet"
|
name="Ricochet"
|
||||||
decimals={0}
|
decimals={0}
|
||||||
|
|||||||
@@ -60,7 +60,9 @@ export function CoreArmorSceneComponent({
|
|||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
async function handleShellChange(shell: ShellDefinition) {
|
async function handleShellChange(shell: ShellDefinition) {
|
||||||
material.uniforms.caliber.value = shell.caliber;
|
material.uniforms.caliber.value = shell.caliber;
|
||||||
material.uniforms.ricochet.value = degToRad(shell.ricochet ?? 90);
|
material.uniforms.ricochet.value = degToRad(
|
||||||
|
isExplosive(shell.type) ? 90 : shell.ricochet!,
|
||||||
|
);
|
||||||
material.uniforms.normalization.value = degToRad(
|
material.uniforms.normalization.value = degToRad(
|
||||||
shell.normalization ?? 0,
|
shell.normalization ?? 0,
|
||||||
);
|
);
|
||||||
|
|||||||
+4
-1
@@ -7,6 +7,7 @@ import {
|
|||||||
} from 'three';
|
} from 'three';
|
||||||
import { degToRad } from 'three/src/math/MathUtils';
|
import { degToRad } from 'three/src/math/MathUtils';
|
||||||
import { ArmorUserData } from '../..';
|
import { ArmorUserData } from '../..';
|
||||||
|
import { isExplosive } from '../../../../../../core/blitz/isExplosive';
|
||||||
import { resolveNearPenetration } from '../../../../../../core/blitz/resolveNearPenetration';
|
import { resolveNearPenetration } from '../../../../../../core/blitz/resolveNearPenetration';
|
||||||
import { hasEquipment } from '../../../../../../core/blitzkit/hasEquipment';
|
import { hasEquipment } from '../../../../../../core/blitzkit/hasEquipment';
|
||||||
import { jsxTree } from '../../../../../../core/blitzkit/jsxTree';
|
import { jsxTree } from '../../../../../../core/blitzkit/jsxTree';
|
||||||
@@ -53,7 +54,9 @@ export function SpacedArmorSubSpaced({
|
|||||||
shell.penetration,
|
shell.penetration,
|
||||||
);
|
);
|
||||||
material.uniforms.caliber.value = shell.caliber;
|
material.uniforms.caliber.value = shell.caliber;
|
||||||
material.uniforms.ricochet.value = degToRad(shell.ricochet ?? 90);
|
material.uniforms.ricochet.value = degToRad(
|
||||||
|
isExplosive(shell.type) ? 90 : shell.ricochet!,
|
||||||
|
);
|
||||||
material.uniforms.normalization.value = degToRad(
|
material.uniforms.normalization.value = degToRad(
|
||||||
shell.normalization ?? 0,
|
shell.normalization ?? 0,
|
||||||
);
|
);
|
||||||
|
|||||||
@@ -268,7 +268,9 @@ export function SpacedArmorSceneComponent({
|
|||||||
} else {
|
} else {
|
||||||
const type = intersection.object.userData.type;
|
const type = intersection.object.userData.type;
|
||||||
const angle = surfaceNormal.angleTo(shellNormal);
|
const angle = surfaceNormal.angleTo(shellNormal);
|
||||||
const ricochet = degToRad(shell.ricochet ?? 90);
|
const ricochet = degToRad(
|
||||||
|
isExplosive(shell.type) ? 90 : shell.ricochet!,
|
||||||
|
);
|
||||||
const normalization = degToRad(shell.normalization ?? 0);
|
const normalization = degToRad(shell.normalization ?? 0);
|
||||||
const threeCalibersRule =
|
const threeCalibersRule =
|
||||||
shell.caliber > thickness * 3 || layerIndex > 0;
|
shell.caliber > thickness * 3 || layerIndex > 0;
|
||||||
|
|||||||
@@ -1,7 +0,0 @@
|
|||||||
import { ShellDefinition } from '../blitzkit/tankDefinitions';
|
|
||||||
|
|
||||||
export function canRicochet(
|
|
||||||
type: ShellDefinition['type'],
|
|
||||||
): type is Exclude<ShellDefinition['type'], 'he'> {
|
|
||||||
return type !== 'he';
|
|
||||||
}
|
|
||||||
@@ -1,5 +1,8 @@
|
|||||||
import { useEffect, useState } from 'react';
|
import { useEffect, useState } from 'react';
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @deprecated DO NOT USE; CAUSES NEXT JS HYDRATION ISSUES
|
||||||
|
*/
|
||||||
export function useWideFormat(size = 880) {
|
export function useWideFormat(size = 880) {
|
||||||
function hasWideFormat() {
|
function hasWideFormat() {
|
||||||
return typeof window !== 'undefined' && window.innerWidth > size;
|
return typeof window !== 'undefined' && window.innerWidth > size;
|
||||||
|
|||||||
Reference in new issue
Block a user