mirror of
https://github.com/blitzkit/blitzkit.git
synced 2026-11-21 12:53:56 +01:00
feat: persistant tankopedia
This commit is contained in:
1 parent
f51e365ec4
commit
a70100c835
17 files changed
+156
-126
No files matched your search
@@ -7,7 +7,7 @@ import { OrbitControls as OrbitControlsClass } from 'three-stdlib';
|
||||
import { applyPitchYawLimits } from '../../../../../core/blitz/applyPitchYawLimits';
|
||||
import { modelDefinitions } from '../../../../../core/blitzkrieg/modelDefinitions';
|
||||
import { Pose, poseEvent } from '../../../../../core/blitzkrieg/pose';
|
||||
import { useTankopedia } from '../../../../../stores/tankopedia';
|
||||
import { useTankopediaTemporary } from '../../../../../stores/tankopedia';
|
||||
import { Duel } from '../page';
|
||||
|
||||
const poseDistances: Record<Pose, number> = {
|
||||
@@ -55,7 +55,7 @@ export function Controls({ duel }: ControlsProps) {
|
||||
camera.position.set(-4, 4, -16);
|
||||
orbitControls.current?.target.set(0, antagonistGunHeight / 2, 0);
|
||||
|
||||
const unsubscribeTankopedia = useTankopedia.subscribe(
|
||||
const unsubscribeTankopedia = useTankopediaTemporary.subscribe(
|
||||
(state) => state.model.visual.controlsEnabled,
|
||||
(enabled) => {
|
||||
if (orbitControls.current) orbitControls.current.enabled = enabled;
|
||||
@@ -144,7 +144,7 @@ export function Controls({ duel }: ControlsProps) {
|
||||
return (
|
||||
<OrbitControls
|
||||
ref={orbitControls}
|
||||
enabled={useTankopedia.getState().model.visual.controlsEnabled}
|
||||
enabled={useTankopediaTemporary.getState().model.visual.controlsEnabled}
|
||||
rotateSpeed={0.25}
|
||||
enableDamping={false}
|
||||
/>
|
||||
|
||||
Reference in new issue
Block a user