Log in or register to post comments

How Image Targets get activated/deactivated

June 23, 2012 - 6:33pm #1

I have implemented the ITrackableEventHandler on assorted image targets in one scene.  They all have hierarchy's of geometry etc underneath.  I am curious why it works when I SetActiveRecursively(false) inside the OnTrackingLost() function call.  It seems that once the image target game object and all children get deactivated, they wouldn't be able to recieve any more events.  But it works find when building to device.  Is there a separate list that gets made by qcar that allows the deactivated game objects to be activated again?

How Image Targets get activated/deactivated

June 26, 2012 - 7:54pm #4

I see what you're asking, yes you are correct. References are maintained to the ImageTarget's TrackableBehaviour (i.e. ImageTargetBehaviour, or MarkerBehaviour for FrameMarkers ). You can review the ImageTracker class to see how these are referenced in relation to the active dataset (e.g. UpdateTrackablePoses() ).

How Image Targets get activated/deactivated

June 26, 2012 - 4:23pm #3

Yes I know, I'm just curious why it works if you disable the Image Target and all children when tracking is lost.  I'm guessing that qcar uses a reference to all trackables itself, so even if your code deactivates it, the game object reference is still kept.  In Unity if you have a script that disables the game object it's attached to, your game object will remain deactivated forever...Unless an outside script references that game object.

How Image Targets get activated/deactivated

June 26, 2012 - 2:39pm #2

OnTrackingLost, in the default implementation, isn't deactivating the target's child objects, it's only disabling their mesh renderers.

 

 

 

Log in or register to post comments