ARSceneTrackerBaseBehaviour Class

Inherits: DeviceUserAbstractBehaviour

Description

EasyAR implements SLAM on Android and iOS devices with special optimizations, it is not recommended to run SLAM on Windows or Mac. The algorithm effects will be totally different. SLAM for Windows and Mac is only for development purpose, to ease content creation.

ARSceneTrackerBaseBehaviour is the component to control ARSceneTracker in the AR scene.

ARSceneTracker is used for SLAM. You can call StartTrack/StopTrack to enable/disable the track process. StartTrack and StopTrack are very lightweight calls.

ARSceneTrackerBaseBehaviour should Bind to a DeviceAbstractBehaviour. This will be automatically done by the ARBuilder if you put ARSceneTrackerBaseBehaviour in the scene before everything start. If you add the component later in the scene, make sure to Bind it to a DeviceAbstractBehaviour, for example, Bind to a CameraDeviceBaseBehaviour.

It is not recommended to put ARSceneTrackerBaseBehaviour in the scene before everything start like the other trackers. Usually manually Bind it to a DeviceAbstractBehaviour and start the tracker when the user points to their desired position would be a better chocie, which makes the tracker initialize the target location to the place user points. If ARSceneTrackerBaseBehaviour is in the scene and Bind to the DeviceAbstractBehaviour by ARBuilder, it will start and initialize the target location when the camera starts, which is usually not the user desired place.

An ARSceneBaseBehaviour must be put into the scene before its target can be tracked.

You will receive TargetAbstractBehaviour.TargetFound / TargetAbstractBehaviour.TargetLost and ARCameraBaseBehaviour.TargetFound / ARCameraBaseBehaviour.TargetLost events when a target is found or lost.

You can get a Frame from ARCameraBaseBehaviour.FrameUpdate which contains current camera image and tracked TargetInstance.

Public Functions

bool StartTrack()
bool StopTrack()

Overwritten MonoBahaviour Functions

protected virtual void Awake()
protected virtual void OnDestroy()
protected virtual void Start()

bool StartTrack()

Starts the track algorithm. The track will start only after the behaviour is Bind to a DeviceAbstractBehaviour. This will be automatically done by the ARBuilder if you put ARSceneTrackerBaseBehaviour in the scene before everything start.

bool StopTrack()

Stops the track algorithm. Call StartTrack to start the track again.