CameraBounds

public struct CameraBounds

The Camera bounds defines constraints that can be applied to the user’s touch movements. This is used to stop keep the camera focused on the venue as a whole.

Camera Bounds

This diagram shows how the camera is constrained. The camera projects a ray that intersects with a 2D plane (xy), the plane height (z) is always 0 in the map coordinate space.

This point on the plane will always kept within a circle that is defined from the center point and the radius of the circle is set with the radius variable.

The camera itself can be outside of the circle, but what it is focusing on will always lie within this region.

The hight adjustment specifics how far up or down the Camera can be from the map. Zooming in or out is achieved in the SDK by moving the camera closer or further away from the center of view. So the field of view is always fixed with our camera.

When the camera exceeds the bounds, a hard stop is used to force the camera to be constrained looking at the map. For the center of view, this is done by moving the camera along the plane until it distance is one radius away. Then the height bounds is applied. This is done such that the camera’s distance away from it’s center of view is scaled to keep the max height and min height constraints satisfied.

  • A point where the bounding sphere for the camera will use as the center

    If not set, this will always default to center the map’s bounding sphere

    Declaration

    Swift

    public var center: Vector2?
  • The maximum distance away from the origin the Camera may be if not set this will always be the size of a bounding sphere

    Declaration

    Swift

    public var radius: Float?
  • The maximum height of that the user may move the Camera, in meters Defaults to 2500

    Declaration

    Swift

    public var maxHeight: Float
  • the minimum height of that the user may move the Camera, in meters Defaults to 25

    Declaration

    Swift

    public var minHeight: Float