Closed FantasyTianyu closed 4 years ago
Sorry, I do not understand the bug you are describing.
When tracking image move away from the camera,the trackImage's trackingState is not been TrackingState.None
This sounds like the expected behavior to me.
and destroyOnRemoval doesn't work
In what way does it not work?
Steps to reproduce the behavior:
- Open the track image
What does that mean?
Expected behavior in the example...
Which example?
...when listen to the trackedImagesChanged callback,if the trackImage.trackingState == TrackingState.None,means the trackImage no longer been tracked in the camera, the planeGo's active will be false , or we can set the destroyOnRemoval=true, the trackImage will also destroyed.
I don't understand what the expected behavior is. Tracking state is a separate concept from removal. Further, the GameObject's active state is up to you; we have a sample that sets it in certain cases, but that is not a feature of the ARFoundation SDK.
Actual behavior the trackImage.trackingState will never be TrackingState.None...
This depends on the underlying AR framework, but that sounds about right. The tracking state is more a measure of whether the device is, well, tracking the image, not whether it was removed from view.
It's clear the result is not what you are expecting, but I do not see a bug here. Could you instead describe what you are trying to achieve?
Sorry, I do not understand the bug you are describing.
Sorry,my English is not good,I try to explain it in detail. Please see this .cs file at line 95 in the UpdateInfo method ,when the trackedImage.trackingState != TrackingState.None ,the planeGo will be set to active true,otherwise the planeGo will be set to active false. but unnder what circumstances the trackedImage.trackingState will be none? I used the ARFoundation Sample's image from arfoundation-samples/Assets/Scenes/ImageTracking/Images/Rafflesia.jpg ,the image info is shown on the screen correctly,because the planeGo is set active to true, but when I removed the image out of the camera ,the image info still existence,because the code at line 95 seems never be called, even if I moved the iPhone's camera away from the image for a long time. I found that the trackImage.trackState will be TrackState.Limited So I think maybe it is a bug that the trackImage.trackState will never be TrackState.None.
This depends on the underlying AR framework, but that sounds about right. The tracking state is more a measure of whether the device is, well, tracking the image, not whether it was removed from view.
I've always thought that if the image is out of the camera,the tracking is lost, the TrackState will be TrackState.None.According to you, I may have misunderstood it.
I've always thought that if the image is out of the camera,the tracking is lost, the TrackState will be TrackState.None
No, that is generally not how it works. There is an explanation at https://docs.unity3d.com/Packages/com.unity.xr.arfoundation@4.0/manual/tracked-image-manager.html#tracking-state
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.
Describe the bug When tracking image move away from the camera,the trackImage's trackingState is not been TrackingState.None,and destroyOnRemoval doesn't work
To Reproduce Steps to reproduce the behavior:
Expected behavior in the example , when listen to the trackedImagesChanged callback,if the trackImage.trackingState == TrackingState.None,means the trackImage no longer been tracked in the camera, the planeGo's active will be false , or we can set the destroyOnRemoval=true, the trackImage will also destroyed.
Actual behavior the trackImage.trackingState will never be TrackingState.None,and the destroyOnRemoval had been set to true,but it doesn't work.
Smartphone (please complete the following information):