mirror of
https://github.com/blitzkit/blitzkit.git
synced 2026-12-04 23:32:54 +01:00
Merge branch 'main' into data-driven
This commit is contained in:
5 files changed
+68
-32
No files matched your search
@@ -122,7 +122,7 @@ export function SpacedArmorSceneComponent({
|
||||
const antagonist = getDuelModules("antagonist").tank;
|
||||
|
||||
const { customShell } = Tankopedia.state;
|
||||
const shell = customShell ?? getDuelModules("protagonist").shell;
|
||||
const shell = customShell ?? getDuelModules("antagonist").shell;
|
||||
const { equalize } = Tankopedia.state.environment;
|
||||
const protagonistEqualizer =
|
||||
(equalize ? protagonist.equalizer : undefined) ?? defaultEqualizer;
|
||||
|
||||
@@ -0,0 +1,19 @@
|
||||
import { MeshBasicMaterial } from "three";
|
||||
import type { ArmorPlate } from "../../hooks/useArmorPlates";
|
||||
import { usePlateItems } from "../../hooks/usePlateItems";
|
||||
import { Batch } from "../Batch";
|
||||
|
||||
interface SpacedArmorSubPrimaryProps {
|
||||
plates: ArmorPlate[];
|
||||
}
|
||||
|
||||
const omitMaterial = new MeshBasicMaterial({
|
||||
colorWrite: false,
|
||||
depthWrite: true,
|
||||
});
|
||||
|
||||
export function SpacedArmorSubPrimary({ plates }: SpacedArmorSubPrimaryProps) {
|
||||
const items = usePlateItems(plates);
|
||||
|
||||
return <Batch items={items} material={omitMaterial} renderOrder={0} />;
|
||||
}
|
||||
@@ -0,0 +1,27 @@
|
||||
import { ContactShadows } from "@react-three/drei";
|
||||
import { Tankopedia } from "../../stores/tankopedia";
|
||||
import { TankopediaDisplay } from "../../stores/tankopediaPersistent/constants";
|
||||
|
||||
/**
|
||||
* drei's ContactShadows, but only redrawn when the scene changes instead of
|
||||
* every frame. drei resets its frame count on every render, so re-rendering
|
||||
* with frames={1} draws it once more.
|
||||
*/
|
||||
export function TankopediaContactShadows() {
|
||||
const display = Tankopedia.use((state) => state.loaders.display.loaded);
|
||||
|
||||
if (display === TankopediaDisplay.StaticArmor) return null;
|
||||
|
||||
return (
|
||||
<ContactShadows
|
||||
frames={1}
|
||||
width={1.5}
|
||||
height={1.5}
|
||||
near={0}
|
||||
far={1}
|
||||
opacity={2 ** 1}
|
||||
blur={2 ** 1}
|
||||
resolution={2 ** 6}
|
||||
/>
|
||||
);
|
||||
}
|
||||
Reference in new issue
Block a user