visualBounds(recursive:relativeTo:excludeInactive:)
Computes a bounding box for the entity in the specified space, optionally including child entities.
Declaration
@MainActor @preconcurrency func visualBounds(recursive: Bool = true, relativeTo referenceEntity: Entity?, excludeInactive: Bool = false) -> BoundingBoxParameters
- recursive:
A Boolean that you set to
trueto incorporate the bounds of all descendants. - referenceEntity:
An entity that defines a frame of reference. Set to
nilto indicate world space. - excludeInactive:
A Boolean that you set to
trueto exclude inactive entities.
Mentioned in
Return Value
The bounding box.
Discussion
The method has complexity O(n), where n is the number of entities in the hierarchy.