mirror of
https://github.com/blitzkit/blitzkit.git
synced 2026-10-22 11:17:05 +02:00
fix: hide on rotate
This commit is contained in:
1 parent
92c81d60db
commit
99123b733d
2 files changed
+7
-7
No files matched your search
@@ -42,7 +42,6 @@ export function TankDisplay() {
|
||||
if (!state.areTanksAssigned) return;
|
||||
return state.protagonist;
|
||||
});
|
||||
const controlsEnabled = useTankopedia((state) => state.model.controlsEnabled);
|
||||
|
||||
if (!protagonist) return null;
|
||||
|
||||
@@ -143,11 +142,7 @@ export function TankDisplay() {
|
||||
}
|
||||
>
|
||||
<TankModel />
|
||||
{mode === 'armor' && (
|
||||
<group visible={controlsEnabled}>
|
||||
<TankArmor />
|
||||
</group>
|
||||
)}
|
||||
{mode === 'armor' && <TankArmor />}
|
||||
</Suspense>
|
||||
</Canvas>
|
||||
</div>
|
||||
|
||||
@@ -17,6 +17,7 @@ import { Lighting } from '../../Lighting';
|
||||
interface TankArmorProps extends GroupProps {}
|
||||
|
||||
export function TankArmor({ ...props }: TankArmorProps) {
|
||||
const controlsEnabled = useTankopedia((state) => state.model.controlsEnabled);
|
||||
const [awaitedModelDefinitions, setAwaitedModelDefinitions] = useState<
|
||||
ModelDefinitions | undefined
|
||||
>(undefined);
|
||||
@@ -86,7 +87,11 @@ export function TankArmor({ ...props }: TankArmorProps) {
|
||||
<HeadsUpDisplay>
|
||||
<Lighting />
|
||||
|
||||
<group {...props} rotation={[-Math.PI / 2, 0, model.hullYaw]}>
|
||||
<group
|
||||
{...props}
|
||||
rotation={[-Math.PI / 2, 0, model.hullYaw]}
|
||||
visible={controlsEnabled}
|
||||
>
|
||||
{nodes.map((node) => {
|
||||
const isHull = node.name.startsWith('hull_');
|
||||
const armorId = parseInt(node.name.match(/.+_armor_(\d+)/)![1]);
|
||||
|
||||
Reference in new issue
Block a user