Options
All
  • Public
  • Public/Protected
  • All
Menu

Class SphereHorizon

Class computing horizon tangent points and intersections with canvas for spherical projection.

remarks

The horizon for a sphere is a circle formed by all intersections of tangent lines passing through the camera with said sphere. It lies on a plane perpendicular to the sphere normal at the camera and it's center is at the line segment joining the sphere center and the camera.

The further the camera is, the nearer the horizon center gets to the sphere center, only reaching the sphere center when the camera is at infinity. In other words, the horizon observed from a finite distance is always smaller than a great circle (a circle with the sphere radius, dividing the sphere in two hemispheres, and therefore it's radius is smaller than the sphere's.

internal

Hierarchy

  • SphereHorizon

Index

Constructors

constructor

  • new SphereHorizon(m_camera: PerspectiveCamera, m_cornerIntersects: boolean[]): SphereHorizon
  • Constructs the SphereHorizon for the given camera.

    Parameters

    • m_camera: PerspectiveCamera

      The camera used as a reference to compute the horizon.

    • m_cornerIntersects: boolean[]

      Array with a boolean for each canvas corner telling whether it intersects with the world. Corners are in ccw-order starting with bottom left.

    Returns SphereHorizon

Accessors

isFullyVisible

  • get isFullyVisible(): boolean

Methods

getDivisionPoints

  • getDivisionPoints(callback: (point: Vector3) => void, tStart?: number, tEnd?: number, maxNumPoints?: number): void
  • Subdivides and arc of the horizon circle, providing the world coordinates of the divisions.

    Parameters

    • callback: (point: Vector3) => void

      Function called for every division point, getting the point world coordinates as parameter.

        • (point: Vector3): void
        • Parameters

          • point: Vector3

          Returns void

    • Default value tStart: number = 0

      Angular parameter of the arc's start point [0,1].

    • Default value tEnd: number = 1

      Angular parameter of the arc's end point [0,1].

    • Default value maxNumPoints: number = 10

      Number of division points for the whole horizon. Smaller arcs will be assigned a proportionally smaller number of points.

    Returns void

getPoint

  • getPoint(t: number, arcStart?: number, arcEnd?: number, target?: Vector3): Vector3
  • Gets the world coordinates of a point in the horizon corresponding to the given parameter.

    Parameters

    • t: number

      Parameter value in [0,1] corresponding to the point in the horizon circle at angle t(arcEnd - arcStart)2*pi counter clockwise.

    • Default value arcStart: number = 0

      Start of the arc covered by parameter t, corresponds to angle arcStart2pi.

    • Default value arcEnd: number = 1

      End of the arc covered by parameter t, corresponds to angle arcEnd2pi.

    • Default value target: Vector3 = new THREE.Vector3()

      Optional target where resulting world coordinates will be set.

    Returns Vector3

    the resulting point in world space.

getSideIntersections

  • getSideIntersections(side: CanvasSide): number[]

Generated using TypeDoc