VPS Events
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 |
LocationObjectβ
LocationObject
is an object with the following properties:
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. |
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. |
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. |
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 |
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)
})