VPS Events
Types
LocationObject
Property | Type | Description |
---|---|---|
id | String | An id for this Project Location that is stable within a session |
name | String | Project Location name. |
imageUrl | String | URL to a representative image for this Project Location. |
title | String | Project Location title. |
lat | Number | Latitude of this Project Location. |
lng | Number | Longitude of this Project Location. |
PositionAttributeObject
Property | Type | Description |
---|---|---|
name | String | The object name |
array | Float32Array() | The raw mesh geometry data. |
itemSize | Integer | The number of items in the object |
ColorAttributeObject
Property | Type | Description |
---|---|---|
name | String | The object name |
array | Float32Array() | The raw mesh geometry data. |
itemSize | Integer | The number of items in the object |
GeometryObject
Property | Type | Description |
---|---|---|
index | String | An id for this mesh that is stable within a session. |
attributes | [ PositionAttributeObject , ColorAttributeObject ] | The raw mesh geometry data. |
Events
locationfound
This event is emitted when a Project Location is first found.
Properties
Property | Type | Description |
---|---|---|
name | String | The Project Location name. |
position | {x, y, z} | The 3d position of the located Project Location. |
rotation | {w, x, y, z} | The 3d local orientation (quaternion) of the located Project Location. |
Example
world.events.addListener(world.events.globalId, 'reality.locationfound', (e) => {
console.log(e)
})
locationlost
This event is emitted when a Project Location is no longer being tracked.
Properties
Property | Type | Description |
---|---|---|
name | String | The Project Location name. |
position | {x, y, z} | The 3d position of the located Project Location. |
rotation | {w, x, y, z} | The 3d local orientation (quaternion) of the located Project Location. |
Example
world.events.addListener(world.events.globalId, 'reality.locationlost', (e) => {
console.log(e)
})
locationscanning
This event is emitted when all Project Locations have been loaded for scanning.
Properties
Property | Type | Description |
---|---|---|
locations | [ LocationObject ] | An array of objects containing Location information |
Example
world.events.addListener(world.events.globalId, 'reality.locationscanning', (e) => {
console.log(e)
})
meshfound
This event is emitted when a mesh is first found either after start or after a recenter()
.
Properties
Property | Type | Description |
---|---|---|
id | String | An id for this mesh that is stable within a session. |
position | {x, y, z} | The 3d position of the located Project Location. |
rotation | {w, x, y, z} | The 3d local orientation (quaternion) of the located Project Location. |
geometry | GeometryObject | An object containing raw mesh geometry data. Attributes contain position and color attributes. |
Example
world.events.addListener(world.events.globalId, 'reality.meshfound', (e) => {
console.log(e)
})
meshlost
This event is emitted when recenter()
is called.
Properties
Property | Type | Description |
---|---|---|
id | String | An id for this mesh that is stable within a session. |
Example
world.events.addListener(world.events.globalId, 'reality.meshlost', (e) => {
console.log(e)
})