i have a scene with multiple active cameras, each having a set viewport
(e.g. two cameras as split-screen) and that works fine.
const cameraOne = new ArcRotateCamera('one', 0, 0, 90, new Vector3(0.5, 0.5, 0.5), scene);
cameraOne.viewport = new Viewport(0.0, 0.0, 0.5, 1.0);
const cameraTwo = new ArcRotateCamera('two', 0, 0, 90, new Vector3(0.5, 0.5, 0.5), scene);
cameraTwo.viewport = new Viewport(0.5, 0.0, 0.5, 1.0);
scene.activeCameras = [poseScene.camerasOne, poseScene.camerasTwo];
but when listening for mouse events, pickInfo
only gets set for camera with last viewport and is null otherwise.
scene.onPointerObservable.add((pointerInfo) => {
if (pointerInfo.type === PointerEventTypes.POINTERDOWN) console.log(pointerInfo.pickInfo?.hit)
}
when clicking on mesh in first viewport, it returns false
and when clicking on the same mesh in second viewport, it returns true
if i have single camera/viewport - seems like pickInfo
is only looking at last set camera?
changing with camera is attached doesn’t make a different
environment: babylonjs 5.0.0.beta4 on chrome 97