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?
- Sort Posts
- 3 replies
- Last post
How Image Targets get activated/deactivated
June 26, 2012 - 7:54pm #4
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.
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() ).