Skip to content
This repository has been archived by the owner on Aug 21, 2024. It is now read-only.

Commit

Permalink
fix viewport freeze on redocking (#10810)
Browse files Browse the repository at this point in the history
  • Loading branch information
SYBIOTE authored Aug 2, 2024
1 parent ef63e70 commit 6da082d
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion packages/spatial/src/input/systems/ClientInputSystem.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -229,7 +229,8 @@ const execute = () => {
for (const eid of pointers()) {
const pointer = getComponent(eid, InputPointerComponent)
const inputSource = getComponent(eid, InputSourceComponent)
const camera = getComponent(pointer.cameraEntity, CameraComponent)
const camera = getOptionalComponent(pointer.cameraEntity, CameraComponent)
if (!camera) continue //when we reparent viewport we lose the camera temporarily
pointer.movement.copy(pointer.position).sub(pointer.lastPosition)
pointer.lastPosition.copy(pointer.position)
inputSource.raycaster.setFromCamera(pointer.position, camera)
Expand Down

0 comments on commit 6da082d

Please sign in to comment.