mirror of
https://github.com/blitzkit/blitzkit.git
synced 2026-10-21 18:57:03 +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;
|
||||
return state.protagonist;
|
||||
});
|
||||
const controlsEnabled = useTankopedia((state) => state.model.controlsEnabled);
|
||||
|
||||
if (!protagonist) return null;
|
||||
|
||||
@@ -133,7 +134,7 @@ export function TankDisplay() {
|
||||
}
|
||||
>
|
||||
<TankModel />
|
||||
{mode === 'armor' && <TankArmor />}
|
||||
{mode === 'armor' && controlsEnabled && <TankArmor />}
|
||||
</Suspense>
|
||||
</Canvas>
|
||||
</div>
|
||||
|
||||
@@ -94,7 +94,7 @@ export function TankArmor() {
|
||||
key={node.uuid}
|
||||
geometry={(node as Mesh).geometry}
|
||||
thickness={thickness}
|
||||
penetration={225}
|
||||
penetration={252}
|
||||
ricochet={antagonist.shell.ricochet}
|
||||
caliber={antagonist.shell.caliber}
|
||||
normalization={antagonist.shell.normalization}
|
||||
@@ -121,7 +121,7 @@ export function TankArmor() {
|
||||
position={turretOrigin}
|
||||
geometry={(node as Mesh).geometry}
|
||||
thickness={thickness}
|
||||
penetration={225}
|
||||
penetration={252}
|
||||
ricochet={antagonist.shell.ricochet}
|
||||
caliber={antagonist.shell.caliber}
|
||||
normalization={antagonist.shell.normalization}
|
||||
@@ -155,7 +155,7 @@ export function TankArmor() {
|
||||
position={turretOrigin.clone().add(gunOrigin)}
|
||||
geometry={(node as Mesh).geometry}
|
||||
thickness={thickness}
|
||||
penetration={225}
|
||||
penetration={252}
|
||||
ricochet={antagonist.shell.ricochet}
|
||||
caliber={antagonist.shell.caliber}
|
||||
normalization={antagonist.shell.normalization}
|
||||
|
||||
@@ -370,33 +370,6 @@ export function TankModel() {
|
||||
);
|
||||
})}
|
||||
</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>
|
||||
);
|
||||
|
||||
Reference in new issue
Block a user