Autodesk.Viewing.Extensions.FirstPerson.FirstPersonExtension
Extends Extension
new FirstPersonExtension(viewer,options)
First Person navigation tool, similar to those found in videogames.
It will also replace the default walk tool button when GuiViewer3D is present.
Parameters
viewer* | Viewer instance. |
options* object | Not used. |
Methods
getCache()
Inherits getCache
Returns an object that persists throughout an extension’s unload->load operation sequence. Cache object is kept at ViewingApplication level. Cache object lives only in RAM, there is no localStorage persistence.
Returns
Type | Description |
---|---|
object | The cache object for a given extension. |
getState(viewerState)
Inherits getState
Gets the extension state as a plain object. Intended to be called when viewer state is requested.
Parameters
viewerState* object | Object to inject extension values. |
load()
Inherits load
Override the load method to add functionality to the viewer. Use the Viewer’s APIs to add/modify/replace/delete UI, register event listeners, etc.
Returns
Type | Description |
---|---|
boolean | True if the load was successful. |
restoreState(viewerState,immediate)
Inherits restoreState
Restores the extension state from a given object.
Parameters
viewerState* object | Viewer state. |
immediate* boolean | Whether the new view is applied with (true) or without transition (false). |
Returns
Type | Description |
---|---|
boolean | True if restore operation was successful. |
unload()
Inherits unload
Override the unload method to perform some cleanup of operations that were done in load.
Returns
Type | Description |
---|---|
boolean | True if the unload was successful. |