com.supermap.ar.areffect.component

Class ARTrackingStateDetector

  • java.lang.Object
    • com.supermap.ar.areffect.component.ARTrackingStateDetector


  • public class ARTrackingStateDetector
    extends java.lang.Object
    Tracking state detector

    Used to check whether the AR is in the tracing state

             TrackingStateDetector trackingStateDetector = new TrackingStateDetector(efView);
             trackingStateDetector.open();
             efView.addOnUpdateListener(() -> {
                 //Desc - When the value is false, the tracking state is lost, and true indicates that the AR camera is still tracking
                 boolean detect = trackingStateDetector.detect(efView);
             });
    
             //trackingStateDetector.close();
     
    • Constructor Detail

      • ARTrackingStateDetector

        public ARTrackingStateDetector(AREffectView effectView)
        Constructor
        Parameters:
        effectView - AR view
      • ARTrackingStateDetector

        public ARTrackingStateDetector(HmsAREffectView effectView)
        Constructor
        Parameters:
        effectView - AR view
    • Method Detail

      • open

        public void open()
        Turn detector on
      • close

        public void close()
        Shut-off detector
      • detect

        public boolean detect(AREffectView effectView)
        Real-time detection
        Parameters:
        effectView -
        Returns:
        state (true: tracing state)
      • detect

        public boolean detect(HmsAREffectView effectView)
        Real-time detection
        Parameters:
        effectView -
        Returns:
        state (true: tracing state)