Log in or register to post comments

Acces to the parts of a multitarget

April 15, 2014 - 1:26am #1

It is posible to acces to the part of a multitarget to know its state, if is tracked or not?

Is an option only for the native Sdk?

It would be very usefull in unity too.

Thank you

Acces to the parts of a multitarget

September 1, 2014 - 3:30am #4

Hi, you are right (apologies if my previous message was partially incorrect);

 you can in fact retrieve the children of the MultiTargets (the parts are attached under the game object called "ChildTargets"), however the individual parts in Unity do not have the TrackableBehaviour component attached, so you cannot query the status for the individual subparts. This is a limitation of the Unity implementation.

As a possible workaround, I could imagine  using a mathematical approach; since the relative position and orientation of the subparts are known (and you can also get them at runtime from the Transform of the ChildTargets children), you can see if a target is visible and facing the camera in the current frame; this would allow you to guess if that part is tracked or not.

 

 

Acces to the parts of a multitarget

August 6, 2014 - 3:42am #3

Sorry I have tried this, but i cant find the TrackableBehaviour of the subparts, I cant see them in the Editor either ,

Am I doing something wrong, or maybe this feature is not enable in the last version?

Is there another way to know which parts are tracked in a multitarget?

Thank you, bye

Acces to the parts of a multitarget

April 18, 2014 - 1:28am #2

There is not an explicit API for this in Multi Target in Unity (e.g. there is no getSubPart() or similar method);

however, due to the hierarchical parent-child structure of game objects in Unity, the subparts of a Multi-Target can be obtained as children of the parent MultiTarget object, using the transform.GetChild() Unity API

https://docs.unity3d.com/Documentation/ScriptReference/Transform.GetChild.html

or more in general;

https://docs.unity3d.com/Documentation/ScriptReference/Transform.html

 

Once you have retrieved the children (sub-parts image targets) of the Multi-Target, for each of them you could obtain its TrackableBehaviour component using

TrackableBehaviour childTrackableBehaviour = subpart.GetComponentInChildren<TrackableBehaviour>();

then you can query the Status using the Vuforia Trackable.Status property:

https://developer.vuforia.com/resources/api/unity/class_trackable_behaviour

 

I hope this helps.

 

 

 

 

Log in or register to post comments