Issue with Raycasting/Collision Detection while panning and zooming

01-03-2023 12:19 PM
New Contributor II

Just writing to report that an issue I posted about in v1.0 is still present in v1.1. I don't see it in the list of Known Issues - is there another place to specifically report bugs? 

My previous post:

Post from another user (@ChristofferLindellBolin)that appears to be similar:


The problem summarized: If you raycast when camera is moving, there seems to be a chance for the raycast to hit somewhere that does not correspond to the correct geolocation. I assume this has something to do with the LOD loading or the map root position changing. However, as an end user, it seems completely unpredictable. 

This problem can be recreated in the included ArcGISHitTestSample. Rapidly zoom in/out while shift-clicking on map features. When you click, the text should appear slightly offset from the position you clicked. However, it will sometimes end up kilometers in the air, as if you clicked a mesh collider that was still in place after the map root position had changed. 

I am including an image here from 2 angles to help alleviate the issue of perspective. While zooming out, I clicked roughly on the blue dot, but the text object was placed far from that position, about 3km in the air.hittestA.PNGhittestB.PNG


In the ArcGISHitTestSample, it is easier to recreate this problem if you have a mouse with a free-spinning wheel. 

This issue has caused our application several problems. For one, we have objects on the map which may load in or move at any time. Each time, we place them on the map by raycasting from their Lat/Lon to get the ground position. Because the user may be moving the map at the time of placement, the objects may end up weirdly offset as seen here. 

We also wanted to implement a limit for zooming in/out so that the user would not be able to zoom in further than the terrain. We simply raycast each time the user scrolls, and if the camera becomes too close to the terrain, clamp is position. However, the raycast may hit a point that no longer corresponds with the map, which results in the camera suddenly jumping to an incorrect altitude to "correct" itself.

I couldn't come up with any reliable way to filter out the incorrect raycasts, and raycasting in Update(), FixedUpdate(), or LateUpdate() doesn't help. See my prior post for another image showing how the Stadium sample is prone to the same problem. 

0 Kudos
1 Reply
Esri Contributor

@GarrettLeach I haven't been able to repro this on 1.2. Can you give it a try on 1.2? Is that an option?

If you still see the issue, can you try disabling/removing the ArcGIS Rebase component in your ArcGIS Camera? Does the issue persist? Anything related to collisions and physics may not work correctly if rebasing is enabled.

0 Kudos