Objects

projectManager : object

Object responsible for handling projects. Projects are snapshots of the current state in the scene, which can be stored locally or in the cloud and loaded at a later moment

roomManager : object

Object responsible for handling 3D representations of indoor environments. This environments exists separately from the rest of the scene.

screenshotManager : object
storage : object
syncManager : object

Synchronizes arbitrary state between two or more ViewAR SL instances. Instances can both send and receive arbitrary payloads to/from one another. Payloads must be serializable to JSON. Uses a centralized client-server architecture.

tracking : object
appUtils : object

Constants

arCamera : `ArCamera`
perspectiveCamera : `PerspectiveCamera`
vrCamera : `VrCamera`
modelManager : `ModelManager`
sceneManager : `SceneManager`

Typedefs

Interaction : object
Vector3d : object
Quaternion : object
Pose : object
HighlightInfo : object
ContainerInsertionParams : object
ModelInsertionParams : object
PropertyValues : Object.
SyncParams : object

Interfaces

ArCamera`Camera`

Uses arCamera feed together with device sensors and various trackers to provide an AR experience for the user.

Camera

Common interface for all cameras.

PerspectiveCamera`Camera`

Uses camera sensors and joystick input to provide a first-person VR experience. Behaves like a first-person camera in computer games (i.e. has no roll).

VrCamera`Camera`

Uses camera sensors and joystick input to provide a first-person VR experience. Behaves like a first-person camera in computer games (i.e. has no roll).

Emitter
Taggable
CatalogItem`Taggable`
Category`CatalogItem`

Part of the model category tree, contains other categories and models.

Model`CatalogItem`
ModelManager`Emitter`

Object responsible for handling models and categories, and communicating with the model repository.

Project
Playable

Interface for objects that represent streamable content

Animation
Option
EnumeratedProperty`Property`
RangeProperty`Property`
Range
Property
Container`SceneNode`

Represents a group of other scene nodes. Can be either grouped or ungrouped. If ungrouped, it is non-interactive but its children are.

SceneManager`Emitter`

Object responsible for scene content management.

SceneNode

Provides getters and setters for common properties of scene nodes (SceneObject Container)

SceneObject`SceneNode`

Represents an instance of a model in the scene.

Video
Storage
CloudStorage`Storage`
LocalStorage`Storage`
Mesh
VuforiaTracker ⇐ ProtectedEmitter
TrackingTarget ⇐ ProtectedEmitter

ArCamera ⇐ Camera

Uses arCamera feed together with device sensors and various trackers to provide an AR experience for the user.

Extends: Camera

arCamera.pose : ControllableCameraPose

arCamera pose

arCamera.active : boolean

camera activity state

arCamera.freeze() ⇒ Promise

Freezes arCamera feed and the scene.

arCamera.unfreeze() ⇒ Promise

Unfreezes arCamera feed and the scene.

arCamera.showFreezeFrame(freezeFrame) ⇒ Promise

Freezes the arCamera feed and displays the given freezeFrame

Param Type
freezeFrame FreezeFrame

arCamera.downloadFreezeFrame(name) ⇒ Promise.

Downloads a previously saved freezeFrame from the server and creates a freezeFrame Object

Param Description
name freezeFrame's name

arCamera.freezeFrame() ⇒ Promise.

Freezes the arCamera feed and saves the current feed frame and arCamera pose as a new freezeFrame

arCamera.removeFreezeFrame(freezeFrame) ⇒ Promise

Removes the given freeze frame. Unfreezes camera if the frozen frame was currently active.

Param Type
freezeFrame FreezeFrame

arCamera.activate() ⇒ Promise

Activates the camera.

Returns: Promise - resolved on completion.

arCamera.updatePose() ⇒ Promise

Updates the camera pose once.

Returns: Promise - current camera pose

arCamera.startPoseUpdate()

Starts the automatic camera pose update, which is by default turned off for performance reasons. The pose returned is relative to the initialized virtual space origin.

arCamera.stopPoseUpdate()

Stops the automatic pose update.

arCamera.enableHmdMode() ⇒ Promise

Switches to stereoscopic rendering mode for use in HMDs.

Returns: Promise - resolved on completion.

arCamera.disableHmdMode() ⇒ Promise

Switches to regular rendering mode for handheld devices.

Returns: Promise - resolved on completion.

arCamera.getPoseInViewingDirection(distance, projectToFloor) ⇒ Promise.<Vector3d>

Calculates a point in 3d space in front of the camera at specified distance.

Param Type Description
distance number distance from camera
projectToFloor boolean if true, projects the resulting point onto the xz plain

Returns: Promise.<Vector3d> - resulting position

Camera

Common interface for all cameras.

camera.active : boolean

camera activity state

camera.activate() ⇒ Promise

Activates the camera.

Returns: Promise - resolved on completion.

camera.updatePose() ⇒ Promise

Updates the camera pose once.

Returns: Promise - current camera pose

camera.startPoseUpdate()

Starts the automatic camera pose update, which is by default turned off for performance reasons. The pose returned is relative to the initialized virtual space origin.

camera.stopPoseUpdate()

Stops the automatic pose update.

camera.enableHmdMode() ⇒ Promise

Switches to stereoscopic rendering mode for use in HMDs.

Returns: Promise - resolved on completion.

camera.disableHmdMode() ⇒ Promise

Switches to regular rendering mode for handheld devices.

Returns: Promise - resolved on completion.

camera.getPoseInViewingDirection(distance, projectToFloor) ⇒ Promise.<Vector3d>

Calculates a point in 3d space in front of the camera at specified distance.

Param Type Description
distance number distance from camera
projectToFloor boolean if true, projects the resulting point onto the xz plain

Returns: Promise.<Vector3d> - resulting position

PerspectiveCamera ⇐ Camera

Uses camera sensors and joystick input to provide a first-person VR experience. Behaves like a first-person camera in computer games (i.e. has no roll).

Extends: Camera

perspectiveCamera.active : boolean

camera activity state

perspectiveCamera.disableSceneInteraction() ⇒ Promise

Turns off touch interaction with scene nodes. When off, touches only affect camera pose.

Returns: Promise - resolved on completion.

perspectiveCamera.enableSceneInteraction() ⇒ Promise

Turns on touch interaction with scene nodes.

Returns: Promise - resolved on completion.

perspectiveCamera.setInteraction(newInteraction) ⇒ Promise

Sets camera interaction.

Param Type
newInteraction CameraInteraction

Returns: Promise - resolved on completion

perspectiveCamera.setPose(newPose) ⇒ Promise

Sets camera pose.

Param Type
newPose CameraPose

Returns: Promise - resolved on completion

perspectiveCamera.setBackgroundMaterial(materialId) ⇒ Promise

Sets the background material to a specific material id. This can only be done once.

Param Type
materialId string

Returns: Promise - resolved on completion

perspectiveCamera.zoomToFit() ⇒ Promise

Turns and moves the camera so that all visible scene objects are in the viewport.

Returns: Promise - resolved on completion

perspectiveCamera.lookAtSceneCenter() ⇒ Promise

Turns camera towards the center of the current scene with respect to all visible scene objects.

Returns: Promise - resolved on completion

perspectiveCamera.activate() ⇒ Promise

Activates the camera.

Returns: Promise - resolved on completion.

perspectiveCamera.updatePose() ⇒ Promise

Updates the camera pose once.

Returns: Promise - current camera pose

perspectiveCamera.startPoseUpdate()

Starts the automatic camera pose update, which is by default turned off for performance reasons. The pose returned is relative to the initialized virtual space origin.

perspectiveCamera.stopPoseUpdate()

Stops the automatic pose update.

perspectiveCamera.enableHmdMode() ⇒ Promise

Switches to stereoscopic rendering mode for use in HMDs.

Returns: Promise - resolved on completion.

perspectiveCamera.disableHmdMode() ⇒ Promise

Switches to regular rendering mode for handheld devices.

Returns: Promise - resolved on completion.

perspectiveCamera.getPoseInViewingDirection(distance, projectToFloor) ⇒ Promise.<Vector3d>

Calculates a point in 3d space in front of the camera at specified distance.

Param Type Description
distance number distance from camera
projectToFloor boolean if true, projects the resulting point onto the xz plain

Returns: Promise.<Vector3d> - resulting position

VrCamera ⇐ Camera

Uses camera sensors and joystick input to provide a first-person VR experience. Behaves like a first-person camera in computer games (i.e. has no roll).

Extends: Camera

vrCamera.active : boolean

camera activity state

vrCamera.enableGyroscope() ⇒ Promise

Enables the gyroscope for this camera.

Returns: Promise - resolved on completion.

vrCamera.disableGyroscope() ⇒ Promise

Disables the gyroscope for this camera.

Returns: Promise - resolved on completion.

vrCamera.translate(joystick)

Translates the camera using joystick input

Param Type Description
joystick Vector3d axis values

vrCamera.rotate(joystick)

Rotates the camera using joystick input

Param Type Description
joystick Vector3d axis values

vrCamera.activate() ⇒ Promise

Activates the camera.

Returns: Promise - resolved on completion.

vrCamera.updatePose() ⇒ Promise

Updates the camera pose once.

Returns: Promise - current camera pose

vrCamera.startPoseUpdate()

Starts the automatic camera pose update, which is by default turned off for performance reasons. The pose returned is relative to the initialized virtual space origin.

vrCamera.stopPoseUpdate()

Stops the automatic pose update.

vrCamera.enableHmdMode() ⇒ Promise

Switches to stereoscopic rendering mode for use in HMDs.

Returns: Promise - resolved on completion.

vrCamera.disableHmdMode() ⇒ Promise

Switches to regular rendering mode for handheld devices.

Returns: Promise - resolved on completion.

vrCamera.getPoseInViewingDirection(distance, projectToFloor) ⇒ Promise.<Vector3d>

Calculates a point in 3d space in front of the camera at specified distance.

Param Type Description
distance number distance from camera
projectToFloor boolean if true, projects the resulting point onto the xz plain

Returns: Promise.<Vector3d> - resulting position

Emitter

emitter.on(eventName, eventHandler)

Param Type
eventName string
eventHandler function

emitter.off(eventName, eventHandler)

Param Type
eventName string
eventHandler function

emitter.once(eventName, eventHandler)

Param Type
eventName string
eventHandler function

Taggable

taggable.tags : Array.

tags describing the object

taggable.hasAnyTag(tags) ⇒ boolean

Checks if the object has any of the provided tags.

Param Type
tags Array.

taggable.hasAllTags(tags) ⇒ boolean

Checks if the object has all of the provided tags. The object may have more tags than that.

Param Type
tags Array.

taggable.hasExactTags(tags) ⇒ boolean

Checks if the object has exactly the provided tags, no more or less.

Param Type
tags Array.

CatalogItem ⇐ Taggable

Extends: Taggable

catalogItem.id : string

System-wide unique identifier

catalogItem.name : string

Product or model name

catalogItem.imageUrl : string

string containing thumbnail URL

catalogItem.tags : Array.

tags describing the object

catalogItem.hasAnyTag(tags) ⇒ boolean

Checks if the object has any of the provided tags.

Param Type
tags Array.

catalogItem.hasAllTags(tags) ⇒ boolean

Checks if the object has all of the provided tags. The object may have more tags than that.

Param Type
tags Array.

catalogItem.hasExactTags(tags) ⇒ boolean

Checks if the object has exactly the provided tags, no more or less.

Param Type
tags Array.

Category ⇐ CatalogItem

Part of the model category tree, contains other categories and models.

Extends: CatalogItem

category.id : string

System-wide unique identifier

category.name : string

Product or model name

category.imageUrl : string

string containing thumbnail URL

category.tags : Array.

tags describing the object

category.hasAnyTag(tags) ⇒ boolean

Checks if the object has any of the provided tags.

Param Type
tags Array.

category.hasAllTags(tags) ⇒ boolean

Checks if the object has all of the provided tags. The object may have more tags than that.

Param Type
tags Array.

category.hasExactTags(tags) ⇒ boolean

Checks if the object has exactly the provided tags, no more or less.

Param Type
tags Array.

Model ⇐ CatalogItem

Extends: CatalogItem

model.type : string

Type of the model.

model.foreignKey : string

Foreign key in the model tree.

model.version : number

Version of the locally stored resource. Should be a UNIX timestamp.

model.id : string

System-wide unique identifier

model.name : string

Product or model name

model.imageUrl : string

string containing thumbnail URL

model.tags : Array.

tags describing the object

model.download(listener) ⇒ Promise

Downloads all model assets.

Param Type Description
listener function \ null optional progress listener

model.downloadDescription() ⇒ Promise

Downloads app-specific data (e.g. textual description, translations, gallery images, etc.).

model.update() ⇒ Promise

Looks for newer model version, invalidating its assets if found. Does not actually download assets. Works only if the model hasn't been instantiated yet.

Throws:

  • Error if model has already been instantiated

model.hasAnyTag(tags) ⇒ boolean

Checks if the object has any of the provided tags.

Param Type
tags Array.

model.hasAllTags(tags) ⇒ boolean

Checks if the object has all of the provided tags. The object may have more tags than that.

Param Type
tags Array.

model.hasExactTags(tags) ⇒ boolean

Checks if the object has exactly the provided tags, no more or less.

Param Type
tags Array.

ModelManager ⇐ Emitter

Object responsible for handling models and categories, and communicating with the model repository.

Extends: Emitter

modelManager.models : Array.<Model>

modelManager.rootCategory : Category

modelManager.fetchModelFromRepository(id) ⇒ Promise.<Model>

Downloads the full model description to the device's permanent storage.

Once the promise is resolved the model is accessible via getModelById function. Successive calls to this function will not trigger any further downloads unless the model is updated on the server in the meantime.

Param Type Description
id string model id

Returns: Promise.<Model> - requested model

modelManager.findModelById(id) ⇒ Model

Retrieves the model with the given identifier.

Param Type Description
id string ID of the requested model

Returns: Model - requested model if found; null otherwise

modelManager.findModelByForeignKey(foreignKey) ⇒ Model

Retrieves the model with the given foreign key.

Param Type Description
foreignKey string foreign key of the requested model

Returns: Model - requested model if found; null otherwise

modelManager.downloadAll() ⇒ Promise

Begins the downloading all model assets assigned to the app. Can be interrupted at any time by calling stopDownloadAll.

Returns: Promise - fulfilled when completed.

modelManager.stopDownloadAll()

Interrupts the process of downloading all model assets.

modelManager.on(eventName, eventHandler)

Param Type
eventName string
eventHandler function

modelManager.off(eventName, eventHandler)

Param Type
eventName string
eventHandler function

modelManager.once(eventName, eventHandler)

Param Type
eventName string
eventHandler function

Project

project.setFlags(flags)

Sets storage flags

Param Type
flags object

project.loadState(flags) ⇒ Promise

Loads the scene state from the project

Param Type
flags object

Returns: Promise - resolved when done.

project.saveState(url)

Saves the scene state into the project

Param Type Description
url string screenshot URL

project.storeLocally() ⇒ Promise

Stores project to local permanent storage

Returns: Promise - resolved when done.

project.removeLocally() ⇒ Promise

Removes project from local permanent storage

Returns: Promise - resolved when done.

project.storeToCloud() ⇒ Promise

Stores project to cloud storage

Returns: Promise - resolved when done.

project.removeFromCloud() ⇒ Promise

Removes project from cloud storage

Returns: Promise - resolved when done.

project.clone() ⇒ Project

Creates a copy of this project and all data stored within. The copy is not automatically stored anywhere.

Playable

Interface for objects that represent streamable content

playable.start(timeInMs, loop) ⇒ Promise

Starts the streaming.

Param Type Description
timeInMs number timestamp to start from
loop boolean if true the streamable will restart after finishing

Returns: Promise - resolved when done.

playable.stop() ⇒ Promise

Stops the streaming.

Returns: Promise - resolved when done.

playable.resume() ⇒ Promise

Resumes the streaming.

Returns: Promise - resolved when done.

playable.pause() ⇒ Promise

Pauses the streaming.

Returns: Promise - resolved when done.

Animation

Implements: Playable

animation.name : string

Name of the animation.

animation.state : string

State of the animation.

animation.duration : number

Duration of the animation in ms.

animation.pause() ⇒ Promise

Pauses playing animation.

Implements: pause
Returns: Promise - resolved when done.

animation.resume() ⇒ Promise

Resumes paused animation.

Implements: resume
Returns: Promise - resolved when done.

animation.start(timeInMs, loop) ⇒ Promise

Starts the animation from specified time.

Implements: start

Param Type Default Description
timeInMs number 0 starting time
loop boolean false whether or not the animation should loop

Returns: Promise - resolved when done.

animation.stop() ⇒ Promise

Stops playing animation. Resets current time to zero.

Implements: stop
Returns: Promise - resolved when done.

Option

option.name : string

name of the option. used when referencing the option

option.key : string

unique machine-readable key of the option

option.imageUrl : string

URL to option's thumbnail

option.isValid(instance)

checks whether the option is allowed to be selected within given instance configuration

Param Type
instance ModelInstance

EnumeratedProperty ⇐ Property

Extends: Property

enumeratedProperty.options : Array.<Option>

list of property's values

enumeratedProperty.ranges : Array.<Range>

list of property's ranges

enumeratedProperty.name : string

name of the property. used when referencing the property

enumeratedProperty.value : Object

current value of the property

RangeProperty ⇐ Property

Extends: Property

rangeProperty.name : string

name of the property. used when referencing the property

rangeProperty.value : Object

current value of the property

Range

Property

property.name : string

name of the property. used when referencing the property

property.value : Object

current value of the property

Container ⇐ SceneNode

Represents a group of other scene nodes. Can be either grouped or ungrouped. If ungrouped, it is non-interactive but its children are.

Extends: SceneNode

container.type : string

container.children : Array.<SceneNode>

Container's children

container.id : string

System-wide unique identifier

container.interaction : Interaction

Node's interaction settings.

container.pose : Pose

Node's pose.

container.visible : boolean

Node's visibility.

container.setParent(newParent) ⇒ Promise

Moves the node to a new container.

Param Type
newParent Container

Returns: Promise - resolved when done.

container.setPose(newPose) ⇒ Promise

Changes object's pose.

Param Type
newPose Pose

Returns: Promise - Promise that resolves when updated.

container.setInteraction(newInteraction) ⇒ Promise

Changes object's interaction settings.

Param Type
newInteraction Interaction

Returns: Promise - Promise that resolves when updated.

container.setVisible(newVisible) ⇒ Promise

Changes object's visibility.

Param Type
newVisible boolean

Returns: Promise - Promise that resolves when updated.

SceneManager ⇐ Emitter

Object responsible for scene content management.

Extends: Emitter
Emits: sceneObjectPoseChanged, selectionChanged, objectTouched

sceneManager.scene : Container

Container representing the whole scene.

sceneManager.selection : SceneNode | null

Currently selected scene node. Is null if no node is selected.

sceneManager.clearScene() ⇒ Promise

Clears the scene completely, removing every scene node apart from the scene itself. Also removes any rooms.

Returns: Promise - Promise that resolves when the scene is cleared.

sceneManager.select(node) ⇒ Promise.<SceneNode>

Selects the scene node. Selected nodes can be interacted with to change their pose.

Param Type Description
node SceneNode scene node to be selected

Returns: Promise.<SceneNode> - Promise that resolves when the object is selected.

sceneManager.clearSelection() ⇒ Promise

Deselects the currently selected object. Does nothing is nothing is selected.

Returns: Promise - Promise that resolves when the object is deselected.

sceneManager.findNodeById(id) ⇒ SceneNode | null

Searches the scene for a node by id.

Param Type Description
id string unique id of the scene node

Returns: SceneNode | null - scene node, if found; null otherwise.

sceneManager.insertContainer(insertionParams) ⇒ Promise.<Container>

Inserts a container into the scene according to given parameters.

Param Type Description
insertionParams ContainerInsertionParams insertion parameters for the container

Returns: Promise.<Container> - Promise that resolves with the inserted container.

sceneManager.insertModel(model, instanceProps, insertionParams) ⇒ Promise.<(ModelInstance|Configuration)>

Inserts a model into the scene according to given parameters.

Param Type Description
model Model model to be inserted
instanceProps ModelInsertionParams properties of the new instance
insertionParams Object insertion setting for snapping

Returns: Promise.<(ModelInstance|Configuration)> - Promise that resolves with the inserted instance of the model.

sceneManager.removeNode(node) ⇒ Promise

Removes given scene node. Attempting to remove the scene will throw an error.

Throws:

  • Error when attempting to remove the scene
Param Type Description
node SceneNode scene node to be removed

Returns: Promise - Promise that resolves when the object is removed.

sceneManager.getSceneState() ⇒ Object

Returns a serializable (JSON) representation of the whole scene, including the room description. Modifications of the returned objects have no effect on the actual scene state.

Returns: Object - serializable representation of the scene.

sceneManager.getSceneStateSafe() ⇒ Promise.

Same as sceneManager.getSceneState, but returns a Promise that resolves with the scene state after all scene updates have been made.

Returns: Promise. - Promise that resolves with serializable representation of the scene.

sceneManager.setSceneState(newSceneState) ⇒ Promise

Same as sceneManager.getSceneState, but returns a Promise that resolves with the scene state after all scene updates have been made.

Param Type Description
newSceneState Object scene state, obtained using sceneManager.getSceneState or sceneManager.getSceneStateSafe

Returns: Promise - Promise that resolves once the scene is updated.

sceneManager.on(eventName, eventHandler)

Param Type
eventName string
eventHandler function

sceneManager.off(eventName, eventHandler)

Param Type
eventName string
eventHandler function

sceneManager.once(eventName, eventHandler)

Param Type
eventName string
eventHandler function

"sceneObjectPoseChanged" (node)

Event that is emitted when an scene node is moved manually

Param Type Description
node SceneNode node whose pose was changed

"selectionChanged" (selection)

Event that is emitted when selection changes

Param Type Description
selection SceneNode \ null new selection

"objectTouched" (node)

Event that is emitted when an scene node is touched

Param Type Description
node SceneNode node that was touched

SceneNode

Provides getters and setters for common properties of scene nodes (SceneObject Container)

sceneNode.id : string

System-wide unique identifier

sceneNode.interaction : Interaction

Node's interaction settings.

sceneNode.pose : Pose

Node's pose.

sceneNode.visible : boolean

Node's visibility.

sceneNode.setParent(newParent) ⇒ Promise

Moves the node to a new container.

Param Type
newParent Container

Returns: Promise - resolved when done.

sceneNode.setPose(newPose) ⇒ Promise

Changes object's pose.

Param Type
newPose Pose

Returns: Promise - Promise that resolves when updated.

sceneNode.setInteraction(newInteraction) ⇒ Promise

Changes object's interaction settings.

Param Type
newInteraction Interaction

Returns: Promise - Promise that resolves when updated.

sceneNode.setVisible(newVisible) ⇒ Promise

Changes object's visibility.

Param Type
newVisible boolean

Returns: Promise - Promise that resolves when updated.

SceneObject ⇐ SceneNode

Represents an instance of a model in the scene.

Extends: SceneNode

sceneObject.model : Model

Model this object was instantiated from

sceneObject.propertyValues : PropertyValues

Dictionary of property values keyed by their names

sceneObject.animations : Array.<Animation>

Dictionary of animations

sceneObject.videos : Array.<Video>

Dictionary of videos

sceneObject.displayTemplate : Array.

Template used for displaying instances properties

sceneObject.properties : Object.

Dictionary of properties this instance has

sceneObject.id : string

System-wide unique identifier

sceneObject.interaction : Interaction

Node's interaction settings.

sceneObject.pose : Pose

Node's pose.

sceneObject.visible : boolean

Node's visibility.

sceneObject.setPropertyValues(newValues) ⇒ Promise

Assigns values to one or more properties.

Param Type
newValues PropertyValues

Returns: Promise - resolved when done.

sceneObject.setParent(newParent) ⇒ Promise

Moves the node to a new container.

Param Type
newParent Container

Returns: Promise - resolved when done.

sceneObject.setPose(newPose) ⇒ Promise

Changes object's pose.

Param Type
newPose Pose

Returns: Promise - Promise that resolves when updated.

sceneObject.setInteraction(newInteraction) ⇒ Promise

Changes object's interaction settings.

Param Type
newInteraction Interaction

Returns: Promise - Promise that resolves when updated.

sceneObject.setVisible(newVisible) ⇒ Promise

Changes object's visibility.

Param Type
newVisible boolean

Returns: Promise - Promise that resolves when updated.

Video

Implements: Playable

video.name : string

Name of the animation.

video.state : string

State of the animation.

video.pause() ⇒ Promise

Pauses playing animation.

Implements: pause
Returns: Promise - resolved when done.

video.resume() ⇒ Promise

Resumes paused animation.

Implements: resume
Returns: Promise - resolved when done.

video.start(timeInMs, loop) ⇒ Promise

Starts the animation from specified time.

Implements: start

Param Type Default Description
timeInMs number 0 starting time
loop boolean false whether or not the animation should loop

Returns: Promise - resolved when done.

video.stop() ⇒ Promise

Stops playing animation. Resets current time to zero.

Implements: stop
Returns: Promise - resolved when done.

Storage

storage.read() ⇒ Promise.<(string|null)>

Reads file contents from storage. Resolves to null if file doesn't exist.

Params: string path file path
Returns: Promise.<(string|null)> - file contents

storage.write() ⇒ Promise

Writes file contents from storage.

Params: string path file path
Params: string content content to write
Params: string format content format
Returns: Promise - resolved on completion

storage.remove() ⇒ Promise

Removes file from storage.

Params: string path file path
Returns: Promise - resolved on completion

CloudStorage ⇐ Storage

Extends: Storage

cloudStorage.read() ⇒ Promise.<(string|null)>

Reads file contents from storage. Resolves to null if file doesn't exist.

Params: string path file path
Returns: Promise.<(string|null)> - file contents

cloudStorage.write() ⇒ Promise

Writes file contents from storage.

Params: string path file path
Params: string content content to write
Params: string format content format
Returns: Promise - resolved on completion

cloudStorage.remove() ⇒ Promise

Removes file from storage.

Params: string path file path
Returns: Promise - resolved on completion

LocalStorage ⇐ Storage

Extends: Storage

localStorage.read() ⇒ Promise.<(string|null)>

Reads file contents from storage. Resolves to null if file doesn't exist.

Params: string path file path
Returns: Promise.<(string|null)> - file contents

localStorage.write() ⇒ Promise

Writes file contents from storage.

Params: string path file path
Params: string content content to write
Params: string format content format
Returns: Promise - resolved on completion

localStorage.remove() ⇒ Promise

Removes file from storage.

Params: string path file path
Returns: Promise - resolved on completion

Mesh

mesh.id : string

mesh.name : string

mesh.vertexCount : number

mesh.material : material

mesh.visibility : boolean

mesh.collision : boolean

mesh.wireframeMode : string

mesh.setMeshMaterial(newMaterialName) ⇒ Promise

Sets mesh material

Param Type
newMaterialName string

Returns: Promise - resolved when done.

mesh.setMeshVisibility(newVisibility) ⇒ Promise

Sets mesh visibility

Param Type
newVisibility boolean

Returns: Promise - resolved when done.

mesh.setMeshCollision(newCollision) ⇒ Promise

Sets mesh collision

Param Type
newCollision boolean

Returns: Promise - resolved when done.

mesh.setMeshWireframeMode(newWireframeMode) ⇒ Promise

Sets mesh wireframe mode

Param Type
newWireframeMode string

Returns: Promise - resolved when done.

VuforiaTracker ⇐ ProtectedEmitter

Extends: ProtectedEmitter
Emits: trackingStatusChanged, trackingTargetStatusChanged

vuforiaTracker.active : boolean

vuforiaTracker.tracking : boolean

vuforiaTracker.targets : Array.<TrackingTarget>

vuforiaTracker.captureUserTarget() ⇒ Promise

Captures a user target from the current camera input.

Returns: Promise - resolved when done.

vuforiaTracker.removeUserTarget() ⇒ Promise

Removes the previously captures user target.

Returns: Promise - resolved when done.

"trackingTargetStatusChanged" (target)

Param Type
target TrackingTarget

"trackingStatusChanged" (info)

Param Type
info object
info.target TrackingTarget
info.trackedTargets Array.<TrackingTarget>
info.untrackedTargets Array.<TrackingTarget>

TrackingTarget ⇐ ProtectedEmitter

Extends: ProtectedEmitter
Emits: found, lost

trackingTarget.name : string

name of the target

trackingTarget.tracked : boolean

tracking status of the target

"found"

fires when the particular target is recognized by the tracker

"lost"

fires when the particular target is no longer recognized by the tracker

projectManager : object

Object responsible for handling projects. Projects are snapshots of the current state in the scene, which can be stored locally or in the cloud and loaded at a later moment

projectManager.projects : Object

Collection of all user' s projects. Includes projects stored locally and in the cloud.

projectManager.online : boolean

Status about internet connection of the user.

projectManager.init()

Downloads projects from the cloud if online and loads projects from local disk.

projectManager.createNewProject(specification) ⇒ Project

Creates a new project

Param Type Description
specification Object specification of the project (name, screenshotUrl, info, data)

Returns: Project - the created project

projectManager.updateCloudIndex() ⇒ boolean

Fetches projects from the cloud

Returns: boolean - online status of the user

projectManager.fetchProjectById() ⇒ Project

Fetches a specific project from the cloud

Returns: Project - requested Project if found; null otherwise

roomManager : object

Object responsible for handling 3D representations of indoor environments. This environments exists separately from the rest of the scene.

roomManager.roomVisible : boolean

current environment visibility

roomManager.roomMaterialDescription : object | null

wall and floor material description

roomManager.roomDescription : boolean

environment description

roomManager.wallObjectModels : boolean

wall object models

roomManager.initResources() ⇒ Promise

Prepares the necessary resources for wall and floor representation

Returns: Promise - resolved when done

roomManager.setRoomVisible(newVisible) ⇒ Promise

Toggles indoor environment visibility.

Param Type
newVisible boolean

Returns: Promise - resolved when done

roomManager.addRoomToScene(newRoomDescription) ⇒ Promise

Instantiates the indoor environment according to the passed description. If a falsy value is passed the current environment is removed from the scene.

Param Type Default Description
newRoomDescription object \ null environment

Returns: Promise - resolved when instantiated

roomManager.removeRoomFromScene() ⇒ Promise

Removes the indoor environment from the scene.

Returns: Promise - resolved when done

screenshotManager : object

screenshotManager.takeScreenshot() ⇒ Promise

Takes a screenshot. The screenshot isn't immediately saved.

Returns: Promise - Resolved when done.

screenshotManager.saveScreenshot(subFolder) ⇒ Promise

Saves a taken screenshot to a sub-folder on the hard drive. Returns a path to the file.

Param Type Description
subFolder string target sub-folder

Returns: Promise - Resolved when done.

screenshotManager.emailScreenshot() ⇒ Promise

Opens the native email client with taken screenshot in the attachment.

Returns: Promise - Resolved when done.

screenshotManager.saveScreenshotToGallery() ⇒ Promise

Saves taken screenshot to device's native gallery.

Returns: Promise - Resolved when done.

screenshotManager.shareScreenshot(socialMediaService, screenshotPath) ⇒ Promise

Shares saved screenshot on chosen social media service.

Param Type Description
socialMediaService string name of the social media service
screenshotPath string

Returns: Promise - Resolved when done.

screenshotManager.deleteScreenshot(screenshotPath, subFolder) ⇒ Promise

Deletes stored screenshot from sub-folder

Param Type Description
screenshotPath string name of the social media service
subFolder string folder containing screenshot

Returns: Promise - Resolved when done.

storage : object

storage.local : LocalStorage

storage.cloud : CloudStorage

syncManager : object

Synchronizes arbitrary state between two or more ViewAR SL instances. Instances can both send and receive arbitrary payloads to/from one another. Payloads must be serializable to JSON. Uses a centralized client-server architecture.

Extends: ProtectedEmitter

syncManager.syncId : string | null

Sync id of the active sync. Null if sync is currently not active.

syncManager.register(propertyName, getter, setter)

Registers a state property for synchronization. The only mandatory thing is that the getter returns a value, either plain or wrapped in a promise. Other than that, getters and setters are free to do any computation and data manipulation required. Sync manager will wait for all getters to return before sending the data, and all setters to return before being called again.

To avoid unexpected behavior this method should not be called while sync is running.

Param Type Description
propertyName string name of the property
getter function function that retrieves the local value of the property. Can be either sync or async.
setter function function that updates the local value of the property. Can be either sync or async.

syncManager.stopLiveSync()

Stops running state synchronization. This function will prevent sending further data to the server but may not prevent the executions of setters that have begun executing.

tracking : object

tracking.Vuforia : VuforiaTracker

appUtils : object

appUtils.httpPost(url, args) ⇒ Promise

Sends an HTTP POST request

Param Type Description
url string target URL
args object POST arguments (parameters)

appUtils.getDeviceRamInfo() ⇒ Promise

Gets the RAM info of the device

appUtils.setTextureQuality(quality, [reloadScene]) ⇒ Promise

Sets the global texture quality to be used by the engine.

Param Type Default Description
quality string
[reloadScene] boolean true flag that specifies if the whole scene should be updated to the given quality

appUtils.openUrl(url)

Opens the given URL in the device's browser. The app will go into background.

Param Type Description
url string URL to be opened

appUtils.prepareCustomImage(fileName, url) ⇒ Promise.

Downloads an image under the given URL.

Param Type Description
fileName string file name to save the image under
url string image location

Returns: Promise. - path to the downloaded image

appUtils.sendEmail(emailObject) ⇒ Promise

Opens the devices email client/form and fills it with the given data.

Param Type Description
emailObject EmailObject object containing email data

appUtils.pauseRenderLoop() ⇒ Promise

Pauses the main render loop of the 3D engine. Freezes the engine output, but not the user interface, which remains functional as usual. Any changes in the state of the app will not be redrawn until the render loop is resumed. This frees up a lot of resources and may improve performance of background tasks such as download and insertion. This method is idempotent.

appUtils.resumeRenderLoop() ⇒ Promise

Resumes the render loop, allowing changes in the app state to be redrawn. Note that it might cause a delay if new objects had been inserted into scene during the pause. This method is idempotent.

appUtils.setAuthentication(authKey) ⇒ Promise

Persistently stores an authentication key. The purpose of this key is arbitrary and fully depends on the app logic. The key persists between app executions and can be retrieved using getAuthentication function.

Param Type
authKey string

appUtils.getAuthentication() ⇒ Promise

Retrieves the authentication key stored using setAuthentication function.

appUtils.closeApp() ⇒ Promise

Sends a shutdown signal to the app. Used for device platforms that do not normally close running apps via task manager. Works on Windows platform only.

arCamera : ArCamera

perspectiveCamera : PerspectiveCamera

vrCamera : VrCamera

modelManager : ModelManager

sceneManager : SceneManager

Interaction : object

Properties

Name Type
manipulationPlane string
translation boolean
rotation boolean
scaling boolean

Vector3d : object

Properties

Name Type
x number
y number
z number

Quaternion : object

Properties

Name Type
w number
x number
y number
z number

Pose : object

Properties

Name Type
position Vector3d
orientation Quaternion
scale Vector3d

HighlightInfo : object

Properties

Name Type
type string
visible boolean

ContainerInsertionParams : object

Properties

Name Type
pose Pose
interaction Interaction
visible boolean
type string

ModelInsertionParams : object

Properties

Name Type
pose Pose
interaction Interaction
visible boolean

PropertyValues : Object.

SyncParams : object

Properties

Name Type Description
pollInterval number polling interval in ms. Sync manager will wait at least this long between pollings
send boolean whether this instance should send payloads or not
receive boolean whether this instance should receive payloads or not