mirror of
https://github.com/blitzkit/blitzkit.git
synced 2026-10-21 02:37:05 +02:00
fix: synced armor states 2
This commit is contained in:
1 parent
de2d9a1a3e
commit
40b6f30092
3 files changed
+5
-3
No files matched your search
@@ -20,6 +20,7 @@ export const CoreArmorScene = memo(() => {
|
||||
const turretContainer = useRef<Group>(null);
|
||||
const gunContainer = useRef<Group>(null);
|
||||
const initialTankopediaState = useTankopediaPersistent.getState();
|
||||
const protagonist = useDuel((draft) => draft.protagonist!);
|
||||
|
||||
useEffect(() => {
|
||||
if (!modelDefinitions) return;
|
||||
@@ -88,7 +89,7 @@ export const CoreArmorScene = memo(() => {
|
||||
turretContainer.current?.rotation.copy(turretRotation);
|
||||
}
|
||||
|
||||
handleModelTransform(useDuel.getState().protagonist!);
|
||||
handleModelTransform(protagonist);
|
||||
modelTransformEvent.on(handleModelTransform);
|
||||
|
||||
return () => {
|
||||
|
||||
@@ -123,7 +123,7 @@ export function CoreArmorSceneComponent({
|
||||
return () => {
|
||||
unsubscribes.forEach((unsubscribe) => unsubscribe());
|
||||
};
|
||||
}, []);
|
||||
});
|
||||
|
||||
useFrame(({ gl, camera }) => {
|
||||
gl.getSize(material.uniforms.resolution.value).multiplyScalar(
|
||||
|
||||
@@ -31,6 +31,7 @@ export const SpacedArmorScene = memo<SpacedArmorSceneProps>(({ scene }) => {
|
||||
const turretContainer = useRef<Group>(null);
|
||||
const gunContainer = useRef<Group>(null);
|
||||
const initialTankopediaState = useTankopediaPersistent.getState();
|
||||
const protagonist = useDuel((draft) => draft.protagonist!);
|
||||
|
||||
useEffect(() => {
|
||||
if (!modelDefinitions) return;
|
||||
@@ -99,7 +100,7 @@ export const SpacedArmorScene = memo<SpacedArmorSceneProps>(({ scene }) => {
|
||||
turretContainer.current?.rotation.copy(turretRotation);
|
||||
}
|
||||
|
||||
handleModelTransform(useDuel.getState().protagonist!);
|
||||
handleModelTransform(protagonist);
|
||||
modelTransformEvent.on(handleModelTransform);
|
||||
|
||||
return () => {
|
||||
|
||||
Reference in new issue
Block a user