fix: auto clear

This commit is contained in:
TrèsAbhi committed 2024-08-25 19:23:13 -05:00
1 parent ece0791a08
commit 633090f967
2 files changed
+11

No files matched your search

@@ -0,0 +1,9 @@
import { useFrame } from '@react-three/fiber';
export function AutoClear() {
useFrame(({ gl }) => {
gl.clear();
}, 0);
return null;
}
@@ -25,6 +25,7 @@ import { TankopediaDisplay } from '../../../../../../stores/tankopediaPersistent
import { Controls } from '../Control';
import { Lighting } from '../Lighting';
import { SceneProps } from '../SceneProps';
import { AutoClear } from './AutoClear';
import { ModelLoader } from './components/ModelLoader';
import { TankModel } from './components/TankModel';
@@ -178,6 +179,7 @@ export const TankSandbox = forwardRef<HTMLCanvasElement, TankSandboxProps>(
<ShotDisplay />
<ArmorPlateDisplay />
<AutoClear />
{/* idk why the shot display doesn't work without suspense here lol */}
<Suspense fallback={<ModelLoader />}>