Skip to content

AR HitTest anchor update incompatible with non-HitTest anchors #5314

@hi-liang

Description

@hi-liang

Description: The scene ar-hit-test component keeps a Map anchorToObject3D corresponding to previous hit-test result .

Every ar-hit-test tick, the HitTest.updateAnchorPoses function is called to try to update the pose of aforementioned object3D from the list of XRFrame.trackedAnchors . However, if a tracked anchor is not mapped from a hit-test result, such as an anchor created by the user from some other means, Map lookup will fail and object3DOptions will be undefined.

if (anchorPose) {
object3DOptions = HitTest.prototype.anchorToObject3D.get(anchor);
offset = object3DOptions.offset;
object3D = object3DOptions.object3D;
applyPose(anchorPose, object3D, offset);

Could be addressed just by adding a check for object3DOptions before attempting to access its properties and apply the pose

  • A-Frame Version: 1.4.2 1.5.0
  • Platform / Device: Any device supporting immersive-ar persistent anchors and hit-test
  • Reproducible Code Snippet or URL:

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