mirror of
https://github.com/blitzkit/blitzkit.git
synced 2026-10-23 19:49:50 +02:00
feat: hide armor when rotating
This commit is contained in:
1 parent
dd8875e951
commit
2f6b186ea8
3 files changed
+5
-31
No files matched your search
@@ -33,6 +33,7 @@ export function TankDisplay() {
|
|||||||
if (!state.areTanksAssigned) return;
|
if (!state.areTanksAssigned) return;
|
||||||
return state.protagonist;
|
return state.protagonist;
|
||||||
});
|
});
|
||||||
|
const controlsEnabled = useTankopedia((state) => state.model.controlsEnabled);
|
||||||
|
|
||||||
if (!protagonist) return null;
|
if (!protagonist) return null;
|
||||||
|
|
||||||
@@ -133,7 +134,7 @@ export function TankDisplay() {
|
|||||||
}
|
}
|
||||||
>
|
>
|
||||||
<TankModel />
|
<TankModel />
|
||||||
{mode === 'armor' && <TankArmor />}
|
{mode === 'armor' && controlsEnabled && <TankArmor />}
|
||||||
</Suspense>
|
</Suspense>
|
||||||
</Canvas>
|
</Canvas>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@@ -94,7 +94,7 @@ export function TankArmor() {
|
|||||||
key={node.uuid}
|
key={node.uuid}
|
||||||
geometry={(node as Mesh).geometry}
|
geometry={(node as Mesh).geometry}
|
||||||
thickness={thickness}
|
thickness={thickness}
|
||||||
penetration={225}
|
penetration={252}
|
||||||
ricochet={antagonist.shell.ricochet}
|
ricochet={antagonist.shell.ricochet}
|
||||||
caliber={antagonist.shell.caliber}
|
caliber={antagonist.shell.caliber}
|
||||||
normalization={antagonist.shell.normalization}
|
normalization={antagonist.shell.normalization}
|
||||||
@@ -121,7 +121,7 @@ export function TankArmor() {
|
|||||||
position={turretOrigin}
|
position={turretOrigin}
|
||||||
geometry={(node as Mesh).geometry}
|
geometry={(node as Mesh).geometry}
|
||||||
thickness={thickness}
|
thickness={thickness}
|
||||||
penetration={225}
|
penetration={252}
|
||||||
ricochet={antagonist.shell.ricochet}
|
ricochet={antagonist.shell.ricochet}
|
||||||
caliber={antagonist.shell.caliber}
|
caliber={antagonist.shell.caliber}
|
||||||
normalization={antagonist.shell.normalization}
|
normalization={antagonist.shell.normalization}
|
||||||
@@ -155,7 +155,7 @@ export function TankArmor() {
|
|||||||
position={turretOrigin.clone().add(gunOrigin)}
|
position={turretOrigin.clone().add(gunOrigin)}
|
||||||
geometry={(node as Mesh).geometry}
|
geometry={(node as Mesh).geometry}
|
||||||
thickness={thickness}
|
thickness={thickness}
|
||||||
penetration={225}
|
penetration={252}
|
||||||
ricochet={antagonist.shell.ricochet}
|
ricochet={antagonist.shell.ricochet}
|
||||||
caliber={antagonist.shell.caliber}
|
caliber={antagonist.shell.caliber}
|
||||||
normalization={antagonist.shell.normalization}
|
normalization={antagonist.shell.normalization}
|
||||||
|
|||||||
@@ -370,33 +370,6 @@ export function TankModel() {
|
|||||||
);
|
);
|
||||||
})}
|
})}
|
||||||
</group>
|
</group>
|
||||||
|
|
||||||
{/* <GunContainer
|
|
||||||
ref={gunContainer}
|
|
||||||
armorObjects={Object.values(armorGltf.nodes)}
|
|
||||||
initialTurretRotation={tankModelDefinition.turretRotation}
|
|
||||||
onPitchStart={() => {
|
|
||||||
mutateTankopedia((state) => {
|
|
||||||
state.model.controlsEnabled = false;
|
|
||||||
});
|
|
||||||
}}
|
|
||||||
pitchLimits={gunModelDefinition.pitch}
|
|
||||||
turretContainer={turretContainer}
|
|
||||||
yaw={model.turretYaw}
|
|
||||||
onPitchEnd={(pitch, yaw) => {
|
|
||||||
mutateTankopedia((state) => {
|
|
||||||
state.model.controlsEnabled = true;
|
|
||||||
state.model.gunPitch = pitch;
|
|
||||||
state.model.turretYaw = yaw;
|
|
||||||
});
|
|
||||||
}}
|
|
||||||
yawLimits={turretModelDefinition.yaw}
|
|
||||||
gunOrigin={gunOrigin}
|
|
||||||
pitch={model.gunPitch}
|
|
||||||
model={gunModelDefinition.model}
|
|
||||||
modelObjects={Object.values(modelGltf.nodes)}
|
|
||||||
turretOrigin={turretOrigin}
|
|
||||||
/> */}
|
|
||||||
</group>
|
</group>
|
||||||
</group>
|
</group>
|
||||||
);
|
);
|
||||||
|
|||||||
Reference in new issue
Block a user