Événements VPS
Types
LocationObject
| Propriété | Type | Description | 
|---|---|---|
| id | Chaîne | Un identifiant pour cet emplacement de projet qui est stable au sein d'une session | 
| nom | Chaîne | Nom de l'emplacement du projet. | 
| imageUrl | Chaîne | URL d'une image représentative de l'emplacement du projet. | 
| titre | Chaîne | Titre de l'emplacement du projet. | 
| lat | Nombre | Latitude de l'emplacement du projet. | 
| lng | Nombre | Longitude de l'emplacement du projet. | 
PositionAttributeObject
| Propriété | Type | Description | 
|---|---|---|
| nom | Chaîne | Le nom de l'objet | 
| réseau | Float32Array() | Les données géométriques brutes du maillage. | 
| itemSize | Integer | Le nombre d'éléments dans l'objet | 
ColorAttributeObject
| Propriété | Type | Description | 
|---|---|---|
| nom | Chaîne | Le nom de l'objet | 
| réseau | Float32Array() | Les données géométriques brutes du maillage. | 
| itemSize | Integer | Le nombre d'éléments dans l'objet | 
Objet géométrique
| Propriété | Type | Description | 
|---|---|---|
| index | Chaîne | Un identifiant pour ce maillage qui est stable au sein d'une session. | 
| attributs | [PositionAttributeObject,ColorAttributeObject]. | Les données géométriques brutes du maillage. | 
Evénements
REALITY_LOCATION_FOUND
Cet événement est émis lorsqu'un emplacement de projet est trouvé pour la première fois.
Propriétés
| Propriété | Type | Description | 
|---|---|---|
| nom | Chaîne | Le nom de l'emplacement du projet. | 
| position | {x, y, z} | La position 3d de l'emplacement du projet localisé. | 
| rotation | {w, x, y, z} | L'orientation locale 3D (quaternion) de l'emplacement du projet localisé. | 
Exemple
- .listen
- .onEvent
- .addEventListener
defineState('initial-state').initial().listen(world.events.globalId, ecs.events.REALITY_LOCATION_FOUND, (event) => {
  console.log('Location found: ', event.data.name)
})
REALITY_LOCATION_LOST
Cet événement est émis lorsqu'un lieu de projet n'est plus suivi.
Propriétés
| Propriété | Type | Description | 
|---|---|---|
| nom | Chaîne | Le nom de l'emplacement du projet. | 
| position | {x, y, z} | La position 3d de l'emplacement du projet localisé. | 
| rotation | {w, x, y, z} | L'orientation locale 3D (quaternion) de l'emplacement du projet localisé. | 
Exemple
- .listen
- .onEvent
- .addEventListener
defineState('initial-state').initial().listen(world.events.globalId, ecs.events.REALITY_LOCATION_LOST, (event) => {
  console.log('Location lost: ', event.data.name)
})
BALAYAGE_DE_LIEU_DE_LA_RÉALITÉ
Cet événement est émis lorsque tous les emplacements de projet ont été chargés pour la numérisation.
Propriétés
| Propriété | Type | Description | 
|---|---|---|
| lieux | Tableau<LocationObject> | Un tableau d'objets contenant des informations sur la localisation | 
Exemple
- .listen
- .onEvent
- .addEventListener
defineState('initial-state').initial().listen(world.events.globalId, ecs.events.REALITY_LOCATION_SCANNING, (event) => {
  console.log('Locations scanning: ', event.data.locations)
})
REALITY_MESH_FOUND
Cet événement est émis lorsqu'une maille est trouvée pour la première fois, soit après le démarrage, soit après un recenter().
Propriétés
| Propriété | Type | Description | 
|---|---|---|
| id | Chaîne | Un identifiant pour ce maillage qui est stable au sein d'une session. | 
| position | {x, y, z} | La position 3d de l'emplacement du projet localisé. | 
| rotation | {w, x, y, z} | L'orientation locale 3D (quaternion) de l'emplacement du projet localisé. | 
| géométrie | GeometryObject | Un objet contenant des données brutes sur la géométrie du maillage. Les attributs contiennent des attributs de position et de couleur. | 
Exemple
- .listen
- .onEvent
- .addEventListener
defineState('initial-state').initial().listen(world.events.globalId, ecs.events.REALITY_MESH_FOUND, (event) => {
  console.log('Mesh found: ', event.data.id)
})
RÉALITÉ_MAILLE_PERDUE
Cet événement est émis lorsque la fonction recenter() est appelée.
Propriété
| Propriété | Type | Description | 
|---|---|---|
| id | Chaîne | Un identifiant pour ce maillage qui est stable au sein d'une session. | 
Exemple
- .listen
- .onEvent
- .addEventListener
defineState('initial-state').initial().listen(world.events.globalId, ecs.events.REALITY_MESH_LOST, (event) => {
  console.log('Mesh lost: ', event.data.id)
})