mirror of
https://github.com/blitzkit/blitzkit.git
synced 2026-10-21 02:37:05 +02:00
feat: some cleaning up
This commit is contained in:
1 parent
f5c589373d
commit
06c878dd2c
5 files changed
+12
-24
No files matched your search
@@ -195,9 +195,7 @@ export function TankSandbox() {
|
||||
<SceneProps />
|
||||
|
||||
<Suspense fallback={<ModelLoader />}>
|
||||
{/* <ShotDisplay />
|
||||
|
||||
*/}
|
||||
{/* <ShotDisplay /> */}
|
||||
{/* <SpacedArmorScene /> */}
|
||||
<Lighting />
|
||||
<TankModel />
|
||||
|
||||
@@ -9,7 +9,6 @@ import {
|
||||
import { nameToArmorId } from '../../../core/blitzkrieg/nameToArmorId';
|
||||
import { resolveArmor } from '../../../core/blitzkrieg/resolveThickness';
|
||||
import { useArmor } from '../../../hooks/useArmor';
|
||||
import { useModel } from '../../../hooks/useModel';
|
||||
import { useModelDefinitions } from '../../../hooks/useModelDefinitions';
|
||||
import { useDuel } from '../../../stores/duel';
|
||||
import { useTankopediaPersistent } from '../../../stores/tankopedia';
|
||||
@@ -117,7 +116,6 @@ export const CoreArmorScene = memo<CoreArmorSceneProps>(
|
||||
});
|
||||
|
||||
const armorGltf = useArmor(protagonist.tank.id);
|
||||
const { gltf: modelGltf } = useModel(protagonist.tank.id);
|
||||
|
||||
const armorNodes = Object.values(armorGltf.nodes);
|
||||
const tankModelDefinition = modelDefinitions[protagonist.tank.id];
|
||||
|
||||
+10
-11
@@ -19,12 +19,19 @@ export function SpacedArmorSubExternal({
|
||||
node,
|
||||
thickness,
|
||||
}: SpacedArmorSubExternalProps) {
|
||||
const penetration = resolveNearPenetration(
|
||||
useDuel.getState().antagonist!.shell.penetration,
|
||||
);
|
||||
const shell = useDuel((state) => state.antagonist!.shell);
|
||||
const penetration = resolveNearPenetration(shell.penetration);
|
||||
|
||||
return (
|
||||
<>
|
||||
{jsxTree(node, {
|
||||
renderOrder: 3,
|
||||
material: new MeshBasicMaterial({
|
||||
colorWrite: false,
|
||||
depthTest: true,
|
||||
depthWrite: true,
|
||||
}),
|
||||
})}
|
||||
{jsxTree(node, {
|
||||
renderOrder: 4,
|
||||
material: new ShaderMaterial({
|
||||
@@ -41,14 +48,6 @@ export function SpacedArmorSubExternal({
|
||||
},
|
||||
}),
|
||||
})}
|
||||
{jsxTree(node, {
|
||||
renderOrder: 3,
|
||||
material: new MeshBasicMaterial({
|
||||
colorWrite: false,
|
||||
depthTest: true,
|
||||
depthWrite: true,
|
||||
}),
|
||||
})}
|
||||
</>
|
||||
);
|
||||
}
|
||||
+1
-1
@@ -15,7 +15,7 @@ export function SpacedArmorSubSpaced({
|
||||
node,
|
||||
thickness,
|
||||
}: SpacedArmorSubSpacedProps) {
|
||||
const { shell } = useDuel.getState().antagonist!;
|
||||
const shell = useDuel((state) => state.antagonist!.shell);
|
||||
const penetration = resolveNearPenetration(shell.penetration);
|
||||
|
||||
return jsxTree(node, {
|
||||
|
||||
@@ -1,7 +1,5 @@
|
||||
import { MeshBasicMaterial, Object3D } from 'three';
|
||||
import { resolveNearPenetration } from '../../../../core/blitz/resolveNearPenetration';
|
||||
import { jsxTree } from '../../../../core/blitzkrieg/jsxTree';
|
||||
import { useDuel } from '../../../../stores/duel';
|
||||
import { ArmorType } from '../SpacedArmorScene';
|
||||
import { SpacedArmorSubExternal } from './components/SpacedArmorSubExternal';
|
||||
import { SpacedArmorSubSpaced } from './components/SpacedArmorSubSpaced';
|
||||
@@ -18,11 +16,6 @@ const omitMaterial = new MeshBasicMaterial({
|
||||
});
|
||||
|
||||
export function SpacedArmor({ node, type, thickness }: SpacedArmorProps) {
|
||||
const penetrationRaw = useDuel(
|
||||
(state) => state.antagonist!.shell.penetration,
|
||||
);
|
||||
const penetration = resolveNearPenetration(penetrationRaw);
|
||||
|
||||
/**
|
||||
* Render orders allocations:
|
||||
* - 0 : core omission
|
||||
|
||||
Reference in new issue
Block a user