frameBoundingBox(_:setNearAndFar:)
Moves the camera such that the specified bounding box lies entirely within the camera’s field of view.
Declaration
func frameBoundingBox(_ boundingBox: MDLAxisAlignedBoundingBox, setNearAndFar: Bool)Parameters
- boundingBox:
The region, in world space coordinates, to be made visible to the camera.
- setNearAndFar:
If True, the camera also adjusts its Nearvisibilitydistance and Farvisibilitydistance properties to place the specified region entirely within the camera’s viewing frustum. If False, those properties remain unchanged, and the specified region may therefore lie outside the camera’s near and far limits.
Discussion
When calculating the new camera position and orientation, this method assumes the camera points in the negative z-axis direction and that the positive y-axis represents the up direction for the camera’s view.