Skip to content

[iOS][ViroARPlaneSelector] Object not placed in exact tap position in Landscape mode #518

Description

@suriyakishoreks

ISSUE:

In iOS Landscape mode, the Object is not placed in exact tap position in ViroARPlaneSelector.
The World-space position for tap given on onPlaneSelected callback itself is wrong for the same anchor id and tap position in portrait and landscape mode.

Tested on android portrait and landscape mode, the object is placed properly in tap position
Tested on iphone and ipad portrait mode, the object is placed properly in tap position

On iphone and ipad landscape mode, the object is NOT placed in correct tap position, it is placed randomly, sometimes even outside the anchor boundary

Sample Code

const onAnchorFound = useCallback((anchor: ViroAnchor) => {
        ARPlaneSelectorRef.current?.handleAnchorFound(anchor)
    }, []);

    const onAnchorRemove = useCallback((anchor: ViroAnchor | undefined) => {
        !!anchor && ARPlaneSelectorRef.current?.handleAnchorRemoved(anchor)
    }, []);

    const onAnchorUpdated = useCallback((anchor: ViroAnchor) => {
        ARPlaneSelectorRef.current?.handleAnchorUpdated(anchor)
    }, [])

<ViroARScene
            anchorDetectionTypes={["PlanesHorizontal"]}
            onAnchorFound={onAnchorFound}
            onAnchorUpdated={onAnchorUpdated}
            onAnchorRemoved={onAnchorRemove}
            onCameraTransformUpdate={onCameraTransform}
        >
<ViroARPlaneSelector ref={ARPlaneSelectorRef} onPlaneSelected={onPlaneSelect} onPlaneRemoved={onPlaneRemove}>
                <ObjectNode ref={objectRef} />
</ViroARPlaneSelector>
</ViroARScene>

Package Versions
"@reactvision/react-viro": "2.57.3",
"react-native": "0.83.6",

iOS Version - 26.6

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions