mirror of
https://github.com/blitzkit/blitzkit.git
synced 2026-11-19 11:53:25 +01:00
feat: unified loader
This commit is contained in:
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>
|
||||
|
||||
Reference in new issue
Block a user