Class: DataHelper

PSV.services~DataHelper

new DataHelper (psv)

Collections of data converters for the current viewer

Name Type Description
psv PSV.Viewer

Extends

Members

config PSV.Options readonly inherited overrides

Configuration holder

prop Object readonly inherited overrides

Properties holder

Reference to main controller

Methods

cleanPosition (position)PSV.Position

Converts x/y to latitude/longitude if present and ensure boundaries

Name Type Description
position PSV.ExtendedPosition
Returns:
Type Description
PSV.Position

cleanSphereCorrection (sphereCorrection)PSV.SphereCorrection

Ensure a SphereCorrection object is valide

Name Type Description
sphereCorrection PSV.SphereCorrection
Returns:
Type Description
PSV.SphereCorrection

destroy () inherited overrides

Destroys the service

fovToZoomLevel (fov)number

Converts vertical FOV to zoom level

Name Type Description
fov number
Returns:
Type Description
number

isExtendedPosition (object)boolean

Checks if an object is a {PSV.ExtendedPosition}, ie has x/y or longitude/latitude

Name Type Description
object object
Returns:
Type Description
boolean

speedToDuration (value, angle)number

Converts a speed into a duration from current position to a new position

Name Type Description
value string | number
angle number
Returns:
Type Description
number

sphericalCoordsToTextureCoords (position)PSV.Point

Converts spherical radians coordinates to pixel texture coordinates

Name Type Description
position PSV.Position
Returns:
Type Description
PSV.Point

sphericalCoordsToVector3 (position)external:THREE.Vector3

Converts spherical radians coordinates to a THREE.Vector3

Name Type Description
position PSV.Position
Returns:
Type Description
external:THREE.Vector3

textureCoordsToSphericalCoords (point)PSV.Position

Converts pixel texture coordinates to spherical radians coordinates

Name Type Description
point PSV.Point
Returns:
Type Description
PSV.Position

vector3ToSphericalCoords (vector)PSV.Position

Converts a THREE.Vector3 to spherical radians coordinates

Name Type Description
vector external:THREE.Vector3
Returns:
Type Description
PSV.Position

vector3ToViewerCoords (vector)PSV.Point

Converts a THREE.Vector3 to position on the viewer

Name Type Description
vector external:THREE.Vector3
Returns:
Type Description
PSV.Point

vFovToHFov (vFov)number

Convert vertical FOV to horizontal FOV

Name Type Description
vFov number
Returns:
Type Description
number

viewerCoordsToVector3 (viewerPoint)external:THREE.Vector3

Converts position on the viewer to a THREE.Vector3

Name Type Description
viewerPoint PSV.Point
Returns:
Type Description
external:THREE.Vector3

zoomLevelToFov (level)number

Converts zoom level to vertical FOV

Name Type Description
level number
Returns:
Type Description
number