new CubicPanorama(options)
Parameters:
Name | Type | Argument | Description |
---|---|---|---|
options |
Mapspace.street.threejs.CubicPanoramaOptions |
<nullable> |
Options. |
- Source:
- mapspace-street/sceneobjects/cubicpanorama.js
Fires:
- ol.Object.Event#event:change:fixedLevelIndex
- ol.events.Event#event:objectchanged
- ol.events.Event#event:ready
Extends
Members
-
children :Array.<SceneObject>
-
The SceneObjects children of this object. Any SceneObject can have any number of SceneObject children in its own hierachy.
- Inherited From:
- Source:
- mapspace-street/sceneobjects/sceneobject.js
-
extraZoomLevels :number|undefined
-
This property represents the number of zoom levels to add to existing zoom levels defined in any panorama. In the new zoom levels the tiles will be rescaled.
- Source:
- mapspace-street/sceneobjects/cubicpanorama.js
-
object3D :THREE.Object3D
-
The THREE.Object3D that contains this SceneObject. Each SceneObject can contain one and only one THREE.Object3D, but any THREE.Object3D can have any number of THREE.Object chidren in its own hierachy.
- Inherited From:
- Source:
- mapspace-street/sceneobjects/sceneobject.js
-
panoramaMetadata :Mapspace.PanoramaMetadata
-
- Source:
- mapspace-street/sceneobjects/cubicpanorama.js
-
panoramaSize :number
-
Size in meters for the cubic panorama. This will be the real size of the cube inside the scene. Any object in the scene far away this size will be occluded and not be seen.
- Source:
- mapspace-street/sceneobjects/cubicpanorama.js
-
totalZoomLevels :number|undefined
-
This property represents the maximum number of zoom levels. Zoom levels defined in any panorama will be redefined to have this number. If this number is greater than the size of the last zoom level defined in the panorama metadata, then the tiles will be shown rescaled.
- Source:
- mapspace-street/sceneobjects/cubicpanorama.js
Methods
-
addChild(child)
-
Adds a child SceneObject to this object.
Parameters:
Name Type Description child
Mapspace.street.threejs.SceneObject Child SceneObject.
- Inherited From:
- Source:
- mapspace-street/sceneobjects/sceneobject.js
-
changeOpacity(opacity)
-
Changes the opacity of all the tiles.
Parameters:
Name Type Description opacity
number Opacity from 0 to 1, zero transparent.
- Source:
- mapspace-street/sceneobjects/cubicpanorama.js
-
changePanoramaSize(size)
-
Change panorama size.
Parameters:
Name Type Description size
number Size of the panorama in meters.
- Source:
- mapspace-street/sceneobjects/cubicpanorama.js
-
findIntersectionForLevel(raycaster, z)
-
Returns a THREE.Vector3 point and tile ID with the intersection of the raycaster.
Parameters:
Name Type Description raycaster
THREE.Raycaster Raycaster.
z
number Zoom level.
- Source:
- mapspace-street/sceneobjects/cubicpanorama.js
Returns:
Object with a point and tileID values or null if no intersection.
- Type
- Object
-
findSceneObjectForLevel(raycaster, z)
-
Finds scene objects raycasted and only in one level.
Parameters:
Name Type Description raycaster
THREE.Raycaster Raycaster.
z
number Zoom level.
- Source:
- mapspace-street/sceneobjects/cubicpanorama.js
-
findSceneObjects(raycaster)
-
Returns an array of SceneObjects that are intersected by given raycaster. Function to be overrided in derived classes.
Parameters:
Name Type Description raycaster
THREE.Raycaster Raycaster.
- Inherited From:
- Overrides:
- Source:
- mapspace-street/sceneobjects/sceneobject.js
Returns:
Array of SceneObject.
- Type
- Array.<Mapspace.street.threejs.SceneObject>
-
findThreeObjects(raycaster)
-
Returns an array of THREE.Object3D that are intersected by given raycaster. Function to be overrided in derived classes.
Parameters:
Name Type Description raycaster
THREE.Raycaster Raycaster.
- Inherited From:
- Overrides:
- Source:
- mapspace-street/sceneobjects/sceneobject.js
Returns:
Array of THREE.Object3D.
- Type
- Array.<THREE.Object3D>
-
getBestFOV(pixelRatio, height, levelIndex)
-
Gets the best FOV that should be used to render the cubic panorama.
Parameters:
Name Type Description pixelRatio
number The device pixel ratio.
height
number The height of the viewport.
levelIndex
number The level index.
- Source:
- mapspace-street/sceneobjects/cubicpanorama.js
Returns:
The FOV.
- Type
- number
-
getBestLevelIndex(pixelRatio, height, fov)
-
Gets the best level that should be used to render the cubic panorama.
Parameters:
Name Type Description pixelRatio
number The device pixel ratio.
height
number The height of the viewport.
fov
number The camera FOV.
- Source:
- mapspace-street/sceneobjects/cubicpanorama.js
Returns:
The selected level.
-
getCurrentLevel(pixelRatio, height, fov)
-
Gets the current level as a decimal value.
Parameters:
Name Type Description pixelRatio
number The device pixel ratio.
height
number The height of the viewport.
fov
number The FOV.
- Source:
- mapspace-street/sceneobjects/cubicpanorama.js
Returns:
The level as decimal value.
- Type
- number
-
getCurrentLevelIndex(pixelRatio, height, fov)
-
Gets the current level that is be used to render the cubic panorama.
Parameters:
Name Type Description pixelRatio
number The device pixel ratio.
height
number The height of the viewport.
fov
number The camera FOV.
- Source:
- mapspace-street/sceneobjects/cubicpanorama.js
Returns:
The selected level.
-
getFixedLevelIndex()
-
Get the fixed level index.
- Source:
- mapspace-street/sceneobjects/cubicpanorama.js
Returns:
- Type
- number | null
-
getMaxZoom()
-
Returns the max zoom level. Zoom levels always start in zero and the max zoom level is totalZoomLvels - 1.
- Source:
- mapspace-street/sceneobjects/cubicpanorama.js
Returns:
- Type
- number
-
getScene()
-
Returns the Three.js scene the object3D contained inside this object is attached to.
- Inherited From:
- Source:
- mapspace-street/sceneobjects/sceneobject.js
Returns:
The scene.
- Type
- THREE.Scene
-
getSceneManager()
-
Returns the SceneManager this SceneObject is attached to.
- Inherited From:
- Source:
- mapspace-street/sceneobjects/sceneobject.js
Returns:
SceneManager.
- Type
- Mapspace.streetthreejs.SceneManager
-
getVisible()
-
Returns the visibility of the objects of this object.
- Inherited From:
- Source:
- mapspace-street/sceneobjects/sceneobject.js
Returns:
- Type
- boolean
-
getVisibleTiles(frustum, centerTile)
-
Returns a list of the visible tiles.
Parameters:
Name Type Description frustum
THREE.Frustum Current frustum of the camera.
centerTile
Mapspace.street.threejs.CubicPanoramaTile Tile currently in center.
- Source:
- mapspace-street/sceneobjects/cubicpanorama.js
Returns:
- Type
- Array.<Mapspace.street.threejs.CubicPanoramaTile>
-
loadFirstLevel()
-
Loads the first level. Notifies with a READY event when it has finished.
- Source:
- mapspace-street/sceneobjects/cubicpanorama.js
-
removeChild(child)
-
Removes a child SceneObject from this object.
Parameters:
Name Type Description child
Mapspace.street.threejs.SceneObject Child SceneObject.
- Inherited From:
- Source:
- mapspace-street/sceneobjects/sceneobject.js
-
rotateAroundWorldAxis(axis, radians)
-
Rotate the object3D of this SceneObject around an arbitrary axis in world space.
Parameters:
Name Type Description axis
THREE.Vector3 Axis. It is not needed the axis to be normalized.
radians
number Angle in radians.
- Inherited From:
- Source:
- mapspace-street/sceneobjects/sceneobject.js
-
setDebugGrid(debugGrid)
-
Shows or hides a debug grid render of tiles.
Parameters:
Name Type Description debugGrid
boolean True to show and false to hide.
- Source:
- mapspace-street/sceneobjects/cubicpanorama.js
-
setDebugGridColor(debugColor)
-
Changes color of the debug grid.
Parameters:
Name Type Description debugColor
string Color as CSS color.
- Source:
- mapspace-street/sceneobjects/cubicpanorama.js
-
setFixedLevelIndex(levelIndex)
-
Set the fixed level index. When set, the corresponding level will be used regardless of the camera parameters. Unset with a null argument.
Parameters:
Name Type Description levelIndex
number | null - Source:
- mapspace-street/sceneobjects/cubicpanorama.js
-
setObject3D(object3D)
-
Sets the THREE.Object3D of this object.
Parameters:
Name Type Description object3D
THREE.Object3D The Object3D of this object.
- Inherited From:
- Source:
- mapspace-street/sceneobjects/sceneobject.js
-
setPosition(x, y, z)
-
Move this object to new coordinates.
Parameters:
Name Type Description x
number X coord.
y
number Y coord.
z
number Z coord.
- Inherited From:
- Source:
- mapspace-street/sceneobjects/sceneobject.js
-
setVisible(visible)
-
Change the visibility of this object.
Parameters:
Name Type Description visible
boolean If object should be visible or not.
- Inherited From:
- Source:
- mapspace-street/sceneobjects/sceneobject.js
-
update(pixelRatio, height, fov, frustum, raycaster)
-
Updates the tiles visibles in the cubic panorama.
Parameters:
Name Type Description pixelRatio
number The current pixel ratio of the viewport from 0 to 1.
height
number Height in pixels of viewport.
fov
number Camera FOV in degrees.
frustum
THREE.Frustum Current frustum of the camera.
raycaster
THREE.Raycaster Current raycaster.
- Source:
- mapspace-street/sceneobjects/cubicpanorama.js