Log in or register to post comments

Where to call `PersistExtendedTracking()` from?

November 29, 2015 - 11:10pm #1
 
I found the following lines of code to activate the persistent extended tracking, as opposed to the normal extended tracking.
ObjectTracker tracker = TrackerManager.Instance.GetTracker<ObjectTracker>(); 
bool success = tracker.PersistExtendedTracking(true); 

But I can't figure out where/when to call it from? I tried calling it right after:

mTrackableBehaviour = GetComponent<TrackableBehaviour>();
            
if (mTrackableBehaviour)
{
	mTrackableBehaviour.RegisterTrackableEventHandler(this);
                
}

In the implementation of ITrackableEventHandler, but the tracker is always `null`! From where am I supposed to call it?

 

Where to call `PersistExtendedTracking()` from?

November 30, 2015 - 5:01am #2

A good place would be in a callback upon Vuforia Started event, so you'll be sure that the Tracker is not null, e.g.:

void Start() {

    VuforiaBehaviour.Instance.RegisterOnVuforiaStartedCallback ( OnVuforiaStarted );

}

private void OnVuforiaStarted() {

   // your code here

}

 

Log in or register to post comments