Entity dimensions in RealityKit

I’m loading a USDZ model using Entity.loadAsync(contentsOf:)

I’d like to get the dimensions of the model and I find that visualBounds(relativeTo: nil).extents returns dimensions larger than the actual dimensions while I see the correct dimensions when viewing the USDZ in Blender or when instantiating it as a MDLAsset(url:). What is the method to get the actual dimensions from an Entity? Thanks

Thanks

Answered by spiff in 714233022

There is no issue with visualBounds. My entity had an unexpected child that was throwing off the dimension caculation.

Deleting this question due to a mistake I was making.

Accepted Answer

There is no issue with visualBounds. My entity had an unexpected child that was throwing off the dimension caculation.

Entity dimensions in RealityKit
 
 
Q