Help with Android Pinch Inertia

Hi all,

I am building a .NET Maui android app with CesiumJS.
Is it possible to have inertia with rotational panning and zooming via pinch?

Here are my current settings…

        // Configure camera controller for smooth inertia on all devices
        const controller = viewer.scene.screenSpaceCameraController;

        // Enable all camera movements
        controller.enableZoom = true;
        controller.enableRotate = true;
        controller.enableTranslate = true;
        controller.enableTilt = true;
        controller.enableLook = true;

        controller.zoomFactor = 12.0;  

        // Set inertia values (0.0 = no inertia, 0.99 = maximum inertia)
        controller.inertiaZoom = 0.82;        // Pinch-to-zoom and wheel inertia
        controller.inertiaSpin = 0.9;         // Rotation
        controller.inertiaTranslate = 0.9;    // Panning


        // Configure zoom event types 
        controller.zoomEventTypes = [
            Cesium.CameraEventType.WHEEL,
            Cesium.CameraEventType.PINCH
        ];

        // Configure tilt events
        controller.tiltEventTypes = [
            Cesium.CameraEventType.MIDDLE_DRAG,
            Cesium.CameraEventType.PINCH,
            {
                eventType: Cesium.CameraEventType.LEFT_DRAG,
                modifier: Cesium.KeyboardEventModifier.CTRL
            },
            {
                eventType: Cesium.CameraEventType.RIGHT_DRAG,
                modifier: Cesium.KeyboardEventModifier.CTRL
            }
        ];

        // Set zoom limits
        controller.minimumZoomDistance = 1.0;
        controller.maximumZoomDistance = 40000000.0;

Thank you!

Team,

Any updates on this?

Hi @Bmillerx94, welcome to the community!

I don’t know of a way to get this working. If you want to dig into the code to see what is happening, you may want to track ScreenSpaceEventType.PINCH_END. This is used in ScreenSpaceCameraController indirectly, via CameraEventAggregator.

One possibly related PR: Avoid transitioning from pinch until all fingers have been released. by puckey · Pull Request #6479 · CesiumGS/cesium · GitHub