in the normal case can try one of the options
1.) to stop / the extended Tracking - this means the model is tracked only when the target is completely inside the device view
a good resource where you could look for the functionality – this are the Vuforia HoloLens 1+2 examples (https://assetstore.unity.com/packages/templates/packs/vuforia-hololens-1-2-sample-for-unity-2020-2-and-later-183725) and also the Vuforia Core Example (mobile). I think because the HoloLens examples has some overhead for the functionality specific for the HoloLens device , so you can first easily check , modify and test the functionality when we take the Vuforia Core Examples https://assetstore.unity.com/packages/templates/packs/vuforia-core-samples-99026
So further I want to refer to scene 3-ModelTargets(or in the HoloLens Example 2-ModelTargets) in the folder assets/SamplesResources/scenes
In this example we have the script TrackabelSettings.cs – folder assets/Common/scripts – and in the example this script is used as component of the “SettingsMenu” gameObject. In the example we can e.g. define a UI button and stop the extend tracking – means switch between extended tracking and tracked. With other words this will stop the extended tracking and track only if the target is currently, and entirely scanned in the correct view by the camera . Otherwise the tracking will restart. For better understanding the principle here I want also to refer to the following articles:
Best Practices for Continued AR experiences
Device Tracking Overview
Interpreting Tracking State API Results
The following code used in UI button will toggle between extended tracking and tracking
GameObject SettingsMenu = GameObject.FindWithTag("SettingsMenu");
if (SettingsMenu == null) return;
TrackableSettings trackSets = SettingsMenu.GetComponent<TrackableSettings>();
print("==> trackSets.IsDeviceTrackingEnabled()=" + trackSets.IsDeviceTrackingEnabled());
When we test the functionality we can see that:
In the same view the tracking is continued by the extended tracking and in the bottom view it is lost /only tracking/ and it shows the symbol for the guided view.
2.)Another aspect is to reset the tracking. To reset tracking we could check the button on the bottom right (picture) “reset”, which will call MenuOptions.ResetDeviceTracker() method
It is implemented as:
public void ResetDeviceTracker()
It should have similar effect to the code in the HoloLese examples for the reset call.
....But as you already mentioned that this will not work in your case. Did you check the behavior of the HoloLens Examples. So far I remember when you reset there the tracking and e.g. change the position of the target - e.g. Mars Viking Lander it will update the location - so far the target is recongnized therefore possibly this is an implementation issue.. Sometime the device is still in extended tracking because the target is not recongnized ( bad light conditions , target quality , shining surfaces etc.) You can check in the mentioned above HoloLens sample scene 2-ModelTargets - the VuforiaTargets and its child to see how different content is managed depending on the target which was selected.
Vuforia Engine Support