Class: DataHelper

PSV.services.DataHelper

new PSV.services.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

cleanPanoramaPose (panoData)PSV.SphereCorrection

Parse the pose angles of the pano data

Name Type Description
panoData PSV.PanoData
Returns:
Type Description
PSV.SphereCorrection

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 valid

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

getIntersections (viewerPoint)Array.<external:THREE.Intersection>

Returns intersections with objects in the scene

Name Type Description
viewerPoint PSV.Point
Returns:
Type Description
Array.<external:THREE.Intersection>

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
Throws:

when the current adapter does not support texture coordinates

Type
PSV.PSVError
Returns:
Type Description
PSV.Point

sphericalCoordsToVector3 (position, vector)external:THREE.Vector3

Converts spherical radians coordinates to a THREE.Vector3

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

sphericalCoordsToViewerCoords (position)PSV.Point

Converts spherical radians coordinates to position on the viewer

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

textureCoordsToSphericalCoords (point)PSV.Position

Converts pixel texture coordinates to spherical radians coordinates

Name Type Description
point PSV.Point
Throws:

when the current adapter does not support texture coordinates

Type
PSV.PSVError
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