Spatial mesh bounds units?

Hi,

I’m performing intersection testing between a box collider and the spatial mesh to determine which triangles in the mesh intersect. This seems to be working okay except for the initial gross check of the AABB (collider.bounds against mesh.bounds), which always indicates non-overlap (and thus prevents the detailed per vertex check from running) on the actual device.

In the Editor, things are fine because the captured mesh appears to be stitched together such that the bounding box often encompasses the entire room and therefore my AABB tests nearly always pass.

On the actual device, the spatial mesh bounds extents appear to be quite small relative to the box collider’s, despite the collider being relatively tiny. I understand mesh bounds are in local space and collider bounds in world space but for spatial meshes, they are effectively the same.

Has anyone else experienced this? What does mesh.bounds represent on HoloLens for a spatial mesh?

Thanks,

Bart

When you say “In the Editor, things are fine”, are you testing with Holographic Simulation or Remoting, or simply running the same code with fake spatial mapping data?

Fake spatial mapping data. I realized what the problem was. The spatial meshes downloaded from the device are always positioned at the origin so the mesh and renderer bounding boxes are equivalent. Not the case on the actual hardware, where although the scale is still (1,1,1), the center point is different. Using the renderer’s bounds fixed the problem for me.