feat: unified loader

This commit is contained in:
TrèsAbhi committed 2024-01-05 15:01:45 -06:00
1 parent 884531700b
commit cb6ce4f183
7 files changed
+63 -37

No files matched your search

@@ -1,29 +0,0 @@
import { Html, useProgress } from '@react-three/drei';
import { theme } from '../../../../../stitches.config';
export function Loader() {
const { progress } = useProgress();
return (
<Html center>
<div
style={{
width: 160,
height: 16,
backgroundColor: theme.colors.appBackground1_light,
borderRadius: 8,
overflow: 'hidden',
}}
>
<div
style={{
width: `${Math.round(progress)}%`,
height: '100%',
backgroundColor: theme.colors.solidBackground_purple,
transition: 'width 0.1s',
}}
></div>
</div>
</Html>
);
}
@@ -64,7 +64,7 @@ export const TankModel = forwardRef<Group, TankModelProps>(
return (
<HullContainer
objects={gltf.scene.children[0].children}
objects={Object.values(gltf.nodes)}
yaw={model.hullYaw}
ref={hullContainer}
onYawStart={() =>
@@ -93,7 +93,7 @@ export const TankModel = forwardRef<Group, TankModelProps>(
initialTurretRotation={tankModelDefinition.turretRotation}
gunOrigin={gunOrigin}
ref={turretContainer}
objects={gltf.scene.children[0].children}
objects={Object.values(gltf.nodes)}
model={turretModelDefinition.model}
onYawStart={() =>
mutateTankopedia((state) => {
@@ -136,7 +136,7 @@ export const TankModel = forwardRef<Group, TankModelProps>(
gunOrigin={gunOrigin}
pitch={model.gunPitch}
model={gunModelDefinition.model}
objects={gltf.scene.children[0].children}
objects={Object.values(gltf.nodes)}
turretOrigin={turretOrigin}
/>
</TurretContainer>