-
-
Set widget content
Parameters:
Name |
Type |
Description |
controlIndex |
integer
|
Control index |
mode |
PANOLENS.Modes
|
Modes for effects |
- Source:
-
-
add(object)
-
Add an object to the scene
Automatically hookup with panolens-viewer-handler listener
to communicate with viewer method
Parameters:
Name |
Type |
Description |
object |
THREE.Object3D
|
The object to be added |
- Source:
-
-
addDefaultControlBar(array)
-
Add default control bar
Parameters:
Name |
Type |
Description |
array |
array
|
The control buttons array |
- Source:
-
-
addPanoramaEventListener(pano)
-
Add default panorama event listeners
Parameters:
Name |
Type |
Description |
pano |
PANOLENS.Panorama
|
The panorama to be added with event listener |
- Source:
-
-
addReticle()
-
Add reticle
- Source:
-
-
addUpdateCallback()
-
Add update callback to be called every animation frame
- Source:
-
-
addViewIndicator()
-
View indicator in upper left
- Source:
-
-
appendControlItem( [option])
-
Append custom control item to existing control bar
Parameters:
Name |
Type |
Argument |
Default |
Description |
option |
object
|
<optional>
|
{}
|
Style object to overwirte default element style. It takes 'style', 'onTap' and 'group' properties. |
- Source:
-
-
checkSpriteInViewport()
-
Check Sprite in Viewport
- Source:
-
-
destory()
-
Destory viewer by disposing and stopping requestAnimationFrame
- Source:
-
-
disableControl()
-
Disable current control
- Source:
-
-
disableEffect()
-
Disable additional rendering effect
- Source:
-
-
disableReticleControl()
-
Disable reticle control
- Source:
-
-
dispatchEventToChildren(event)
-
Dispatch event to all descendants
Parameters:
Name |
Type |
Description |
event |
object
|
Event to be passed along |
- Source:
-
-
dispose()
-
Dispose all scene objects and clear cache
- Source:
-
-
enableControl(index)
-
Enable control by index
Parameters:
- Source:
-
-
enableEffect(mode)
-
Enable rendering effect
Parameters:
- Source:
-
-
enableReticleControl()
-
Enable reticle control
- Source:
-
-
eventHandler(event)
-
Event handler to execute commands from child objects
Parameters:
Name |
Type |
Description |
event |
object
|
The dispatched event with method as function name and data as an argument |
- Source:
-
-
getCamera()
-
Get camera
- Source:
-
Returns:
- The scene camera
-
Type
-
THREE.Camera
-
getContainer()
-
Get container
- Source:
-
Returns:
- The container holds rendererd canvas
-
Type
-
HTMLDOMElement
-
getControl()
-
Get current camera control
- Source:
-
Returns:
- Current navigation control. THREE.OrbitControls or THREE.DeviceOrientationControls
-
Type
-
object
-
getControlName()
-
Get control name
- Source:
-
Returns:
- Control name. 'orbit' or 'device-orientation'
-
Type
-
string
-
getNextControlIndex()
-
Get next navigation control index
- Source:
-
Returns:
- Next control index
-
Type
-
number
-
getNextControlName()
-
Get next navigation control name
- Source:
-
Returns:
- Next control name
-
Type
-
string
-
getRenderer()
-
Get renderer
- Source:
-
Returns:
- The renderer using webgl
-
Type
-
THREE.WebGLRenderer
-
getScene()
-
Get scene
- Source:
-
Returns:
- Current scene which the viewer is built on
-
Type
-
THREE.Scene
-
getScreenVector()
-
Screen Space Projection
- Source:
-
-
-
Hide video widget
- Source:
-
-
loadAsyncRequest(url [, callback])
-
Load ajax call
Parameters:
Name |
Type |
Argument |
Description |
url |
string
|
|
URL to be requested |
callback |
function
|
<optional>
|
Callback after request completes |
- Source:
-
-
onPanoramaDispose()
-
On panorama dispose
- Source:
-
-
onVideoUpdate(percentage)
-
This will be called when video updates if an widget is present
Parameters:
Name |
Type |
Description |
percentage |
number
|
Percentage of a video. Range from 0.0 to 1.0 |
- Source:
-
Fires:
-
onWindowResize( [windowWidth] [, windowHeight])
-
This is called when window size is changed
Parameters:
Name |
Type |
Argument |
Description |
windowWidth |
number
|
<optional>
|
Specify if custom element has changed width |
windowHeight |
number
|
<optional>
|
Specify if custom element has changed height |
- Source:
-
Fires:
-
outputInfospotPosition()
-
Output infospot attach position in developer console by holding down Ctrl button
- Source:
-
-
registerEventListeners()
-
Register container and window listeners
- Source:
-
-
registerMouseAndTouchEvents()
-
Register mouse and touch event on container
- Source:
-
-
registerReticleEvent()
-
Register reticle event
- Source:
-
-
remove(object)
-
Remove an object from the scene
Parameters:
Name |
Type |
Description |
object |
THREE.Object3D
|
Object to be removed |
- Source:
-
-
removeUpdateCallback(fn)
-
Remove update callback
Parameters:
Name |
Type |
Description |
fn |
function
|
The function to be removed |
- Source:
-
-
render()
-
Rendering function to be called on every animation frame
- Source:
-
-
reverseDraggingDirection()
-
Reverse dragging direction
- Source:
-
-
setCameraControl()
-
Set camera control
- Source:
-
-
setCameraFov()
-
Set field of view of camera
- Source:
-
-
setPanorama(pano)
-
Set a panorama to be the current one
Parameters:
- Source:
-
-
setVideoCurrentTime(percentage)
-
Set currentTime in a video
Parameters:
Name |
Type |
Description |
percentage |
number
|
Percentage of a video. Range from 0.0 to 1.0 |
- Source:
-
Fires:
-
-
Show video widget
- Source:
-
-
toggleControlBar()
-
Toggle control bar
- Source:
-
Fires:
- [PANOLENS.Viewer#event:control-bar-toggle]
-
toggleNextControl()
-
Toggle next control
- Source:
-
-
toggleVideoPlay()
-
Toggle video play or stop
- Source:
-
Fires:
-
tweenControlCenter(vector [, duration] [, easing])
-
Tween control looking center
Parameters:
Name |
Type |
Argument |
Default |
Description |
vector |
THREE.Vector3
|
|
|
Vector to be looked at the center |
duration |
number
|
<optional>
|
1000
|
Duration to tween |
easing |
function
|
<optional>
|
TWEEN.Easing.Exponential.Out
|
Easing function |
- Source:
-
-
tweenControlCenterByObject(object [, duration] [, easing])
-
Tween control looking center by object
Parameters:
Name |
Type |
Argument |
Default |
Description |
object |
THREE.Object3D
|
|
|
Object to be looked at the center |
duration |
number
|
<optional>
|
1000
|
Duration to tween |
easing |
function
|
<optional>
|
TWEEN.Easing.Exponential.Out
|
Easing function |
- Source:
-
-
unregisterEventListeners()
-
Unregister container and window listeners
- Source:
-
-
unregisterMouseAndTouchEvents()
-
Unregister mouse and touch event on container
- Source:
-
-
unregisterReticleEvent()
-
Unregister reticle event
- Source:
-
-
update()
-
Update control and callbacks
- Source:
-
-
updateReticleEvent()
-
Update reticle event
- Source:
-