diff --git a/example/interface.html b/example/interface.html index e409ad24..c7bd53e6 100644 --- a/example/interface.html +++ b/example/interface.html @@ -179,7 +179,7 @@

Entity List

- + diff --git a/example/interface.js b/example/interface.js index b6a27970..eee0cf9e 100644 --- a/example/interface.js +++ b/example/interface.js @@ -596,9 +596,10 @@ import { Vircadia, DomainServer, Camera, AudioMixer, AvatarMixer, EntityServer, const POS_DECIMAL_PLACES = 3; const ENTITY_TYPE_INDEX = 1; - const X_INDEX = 2; - const Y_INDEX = 3; - const Z_INDEX = 4; + const NAME_INDEX = 2; + const X_INDEX = 3; + const Y_INDEX = 4; + const Z_INDEX = 5; const DEFAULT_POSITION = { x: 0, y: 0, z: 0 }; const entitiesCount = document.getElementById("entitiesCount"); @@ -629,13 +630,17 @@ import { Vircadia, DomainServer, Camera, AudioMixer, AvatarMixer, EntityServer, function onEntityData(data) { data.forEach((e) => { - // Update the type and position if an entity ID is already in our list. Create a new element otherwise. + // Update properties if the entity is already in our list. Create a new element otherwise. if (entityIDsList.some((id) => { return e.entityItemID.stringify() === id; })) { const cols = document.getElementById(e.entityItemID.stringify()).children; - cols.item(ENTITY_TYPE_INDEX).innerHTML = e.entityType; - + if (e.entityType) { + cols.item(ENTITY_TYPE_INDEX).innerHTML = e.entityType; + } + if (e.name) { + cols.item(NAME_INDEX).innerHTML = e.name; + } if (e.position) { cols.item(X_INDEX).innerHTML = e.position.x.toFixed(POS_DECIMAL_PLACES); cols.item(Y_INDEX).innerHTML = e.position.y.toFixed(POS_DECIMAL_PLACES); @@ -652,6 +657,9 @@ import { Vircadia, DomainServer, Camera, AudioMixer, AvatarMixer, EntityServer, td = document.createElement("td"); td.innerHTML = e.entityType; tr.appendChild(td); + td = document.createElement("td"); + td.innerHTML = e.name; + tr.appendChild(td); const position = e.position ?? DEFAULT_POSITION; td = document.createElement("td"); td.className = "number"; diff --git a/src/domain/networking/packets/EntityData.ts b/src/domain/networking/packets/EntityData.ts index 669e1c89..9cf8996d 100644 --- a/src/domain/networking/packets/EntityData.ts +++ b/src/domain/networking/packets/EntityData.ts @@ -570,7 +570,7 @@ const EntityData = new class { } let parentID: Uuid | null | undefined = undefined; - if (propertyFlags.getHasProperty(EntityPropertyFlags.PROP_SIMULATION_OWNER)) { + if (propertyFlags.getHasProperty(EntityPropertyFlags.PROP_PARENT_ID)) { const length = data.getUint16(dataPosition, UDT.LITTLE_ENDIAN); dataPosition += 2; @@ -766,7 +766,6 @@ const EntityData = new class { dataPosition += 16; } } - } let billboardMode: number | undefined = undefined; @@ -998,7 +997,6 @@ const EntityData = new class { dataPosition += 1; } actionData = buffer; - } }
Entity IDEntity typePosition
IDTypeNamePosition