TrackEvent
TrackEvent is divided into three categories: onTrackStart, onTrackMove, and onTrackEnd. When each event occurs, an argument is passed to the callback function. It receives the status and location information of the tracking target through the corresponding factor, and updates the status value of the augmented target (XRElment, 3D Object) based on the information to enable augmented reality to operate. The shape of the Event object information delivered to each event callback function is as follows.
onTrackStart
When entity registered as a recognition target and detected within the current camera frame, the tracking engine of Letsee WebAR SDK notifies that recognition and tracking of the entity is started.
When a callback function is registered through the letsee.onTrackStart API, the registered callback function is operated when an entity is detected. The callback function takes an event object as an argument, and the event object has type and trace information.
If the recognition target is continuously detected in the current camera frame after trackstart, the tracking engine of Letsee WebAR SDK tracks the recognized target.
When a callback function is registered through the letsee.onTrackMove API, the registered callback function is executed when the entity is tracking. Likewise, the callback function takes an event object as an argument, and the event object has type and trace information.
If the recognition target is missed within the current camera frame, the tracking engine of Letsee WebAR SDK notifies that recognition and tracking of the entity has stopped.
When a callback function is registered through the letsee.onTrackEnd API, the registered callback function is operated when the entity is stopped tracking. Likewise, the callback function takes an event object as an argument, and the event object has type and trace information.