Zum Hauptinhalt springen

VPS Events

Events​

locationfound​

This event is emitted when a Project Location is first found.

Properties​

PropertyTypeDescription
nameStringThe 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​

PropertyTypeDescription
nameStringThe 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​

PropertyTypeDescription
locations[LocationObject]An array of objects containing Location information
LocationObject​

LocationObject is an object with the following properties:

PropertyTypeDescription
idStringAn id for this Project Location that is stable within a session
nameStringProject Location name.
imageUrlStringURL to a representative image for this Project Location.
titleStringProject Location title.
latNumberLatitude of this Project Location.
lngNumberLongitude 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​

PropertyTypeDescription
idStringAn 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.
geometryGeometryObjectAn object containing raw mesh geometry data. Attributes contain position and color attributes.
GeometryObject​
PropertyTypeDescription
indexStringAn id for this mesh that is stable within a session.
attributes[PositionAttributeObject, ColorAttributeObject]The raw mesh geometry data.
PositionAttributeObject​
PropertyTypeDescription
nameStringThe object name
arrayFloat32Array()The raw mesh geometry data.
itemSizeIntegerThe number of items in the object
ColorAttributeObject​
PropertyTypeDescription
nameStringThe object name
arrayFloat32Array()The raw mesh geometry data.
itemSizeIntegerThe 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​

PropertyTypeDescription
idStringAn id for this mesh that is stable within a session.

Example​

world.events.addListener(world.events.globalId, 'reality.meshlost', (e) => {
console.log(e)
})