"Box"
, "Shape"
, and "Sphere"
depending on changes to
* the shape
property set for entities of these types.) Read-only.
- * @property {boolean} clientOnly=false - If true
then the entity is an avatar entity; otherwise it is a server
- * entity. An avatar entity follows you to each domain you visit, rendering at the same world coordinates unless it's
- * parented to your avatar. Value cannot be changed after the entity is created.clientOnly
parameter in
+ * @property {EntityHostType} entityHostType="domain" - How this entity will behave, including if and how it is sent to other people.
+ * The value can only be set at entity creation by using the entityHostType
parameter in
* {@link Entities.addEntity}.
- * @property {Uuid} owningAvatarID=Uuid.NULL - The session ID of the owning avatar if clientOnly
is
+ * @property {boolean} avatarEntity=false - If true
then the entity is an avatar entity; An avatar entity follows you to each domain you visit,
+ * rendering at the same world coordinates unless it's parented to your avatar. Value cannot be changed after the entity is created.entityHostType
parameter in
+ * {@link Entities.addEntity}. clientOnly
is an alias.
+ * @property {boolean} localEntity=false - If true
then the entity is a local entity; Local entities only render for you and are not sent over the wire.
+ * Value cannot be changed after the entity is created.entityHostType
parameter in
+ * {@link Entities.addEntity}.
+ * @property {Uuid} owningAvatarID=Uuid.NULL - The session ID of the owning avatar if avatarEntity
is
* true
, otherwise {@link Uuid|Uuid.NULL}. Read-only.
*
* @property {string} created - The UTC date and time that the entity was created, in ISO 8601 format as
@@ -595,7 +624,7 @@ EntityPropertyFlags EntityItemProperties::getChangedProperties() const {
* @property {number} parentJointIndex=65535 - The joint of the entity or avatar that this entity is parented to. Use
* 65535
or -1
to parent to the entity or avatar's position and orientation rather than a joint.
* @property {Vec3} localPosition=0,0,0 - The position of the entity relative to its parent if the entity is parented,
- * otherwise the same value as position
. If the entity is parented to an avatar and is clientOnly
+ * otherwise the same value as position
. If the entity is parented to an avatar and is an avatarEntity
* so that it scales with the avatar, this value remains the original local position value while the avatar scale changes.
* @property {Quat} localRotation=0,0,0,1 - The rotation of the entity relative to its parent if the entity is parented,
* otherwise the same value as rotation
.
@@ -603,8 +632,8 @@ EntityPropertyFlags EntityItemProperties::getChangedProperties() const {
* otherwise the same value as velocity
.
* @property {Vec3} localAngularVelocity=0,0,0 - The angular velocity of the entity relative to its parent if the entity is
* parented, otherwise the same value as position
.
- * @property {Vec3} localDimensions - The dimensions of the entity. If the entity is parented to an avatar and is
- * clientOnly
so that it scales with the avatar, this value remains the original dimensions value while the
+ * @property {Vec3} localDimensions - The dimensions of the entity. If the entity is parented to an avatar and is an
+ * avatarEntity
so that it scales with the avatar, this value remains the original dimensions value while the
* avatar scale changes.
*
* @property {Entities.BoundingBox} boundingBox - The axis-aligned bounding box that tightly encloses the entity.
@@ -629,7 +658,7 @@ EntityPropertyFlags EntityItemProperties::getChangedProperties() const {
* @property {boolean} cloneDynamic=false - If true
then clones created from this entity will have their
* dynamic
property set to true
.
* @property {boolean} cloneAvatarEntity=false - If true
then clones created from this entity will be created as
- * avatar entities: their clientOnly
property will be set to true
.
+ * avatar entities: their avatarEntity
property will be set to true
.
* @property {Uuid} cloneOriginID - The ID of the entity that this entity was cloned from.
*
* @property {Entities.Grab} grab - The grab-related properties.
@@ -740,7 +769,7 @@ EntityPropertyFlags EntityItemProperties::getChangedProperties() const {
* overlay's ID.
* To apply a material to an avatar, set the material entity's parentID
property to the avatar's session UUID.
* To apply a material to your avatar such that it persists across domains and log-ins, create the material as an avatar entity
- * by setting the clientOnly
parameter in {@link Entities.addEntity} to true
.
+ * by setting the entityHostType
parameter in {@link Entities.addEntity} to "avatar"
.
* Material entities render as non-scalable spheres if they don't have their parent set.
* @typedef {object} Entities.EntityProperties-Material
* @property {string} materialURL="" - URL to a {@link MaterialResource}. If you append ?name
to the URL, the
@@ -1532,8 +1561,8 @@ QScriptValue EntityItemProperties::copyToScriptValue(QScriptEngine* engine, bool
COPY_PROPERTY_TO_QSCRIPTVALUE(PROP_LOCAL_ANGULAR_VELOCITY, localAngularVelocity);
COPY_PROPERTY_TO_QSCRIPTVALUE(PROP_LOCAL_DIMENSIONS, localDimensions);
- COPY_PROPERTY_TO_QSCRIPTVALUE(PROP_CLIENT_ONLY, clientOnly); // Gettable but not settable except at entity creation
- COPY_PROPERTY_TO_QSCRIPTVALUE(PROP_OWNING_AVATAR_ID, owningAvatarID); // Gettable but not settable
+ COPY_PROPERTY_TO_QSCRIPTVALUE_GETTER(PROP_ENTITY_HOST_TYPE, entityHostType, getEntityHostTypeAsString()); // Gettable but not settable except at entity creation
+ COPY_PROPERTY_TO_QSCRIPTVALUE(PROP_OWNING_AVATAR_ID, owningAvatarID); // Gettable but not settable
COPY_PROPERTY_TO_QSCRIPTVALUE(PROP_CLONEABLE, cloneable);
COPY_PROPERTY_TO_QSCRIPTVALUE(PROP_CLONE_LIFETIME, cloneLifetime);
@@ -1572,12 +1601,14 @@ QScriptValue EntityItemProperties::copyToScriptValue(QScriptEngine* engine, bool
COPY_PROPERTY_TO_QSCRIPTVALUE_GETTER_NO_SKIP(renderInfo, renderInfo); // Gettable but not settable
}
- // FIXME: These properties should already have been set above.
if (!psuedoPropertyFlagsActive || psueudoPropertyFlags.test(EntityPsuedoPropertyFlag::ClientOnly)) {
- properties.setProperty("clientOnly", convertScriptValue(engine, getClientOnly()));
+ properties.setProperty("clientOnly", convertScriptValue(engine, getEntityHostType() == entity::HostType::AVATAR));
}
- if (!psuedoPropertyFlagsActive || psueudoPropertyFlags.test(EntityPsuedoPropertyFlag::OwningAvatarID)) {
- properties.setProperty("owningAvatarID", convertScriptValue(engine, getOwningAvatarID()));
+ if (!psuedoPropertyFlagsActive || psueudoPropertyFlags.test(EntityPsuedoPropertyFlag::AvatarEntity)) {
+ properties.setProperty("avatarEntity", convertScriptValue(engine, getEntityHostType() == entity::HostType::AVATAR));
+ }
+ if (!psuedoPropertyFlagsActive || psueudoPropertyFlags.test(EntityPsuedoPropertyFlag::LocalEntity)) {
+ properties.setProperty("localEntity", convertScriptValue(engine, getEntityHostType() == entity::HostType::LOCAL));
}
// FIXME - I don't think these properties are supported any more
@@ -1767,7 +1798,7 @@ void EntityItemProperties::copyFromScriptValue(const QScriptValue& object, bool
COPY_PROPERTY_FROM_QSCRIPTVALUE(ghostingAllowed, bool, setGhostingAllowed);
COPY_PROPERTY_FROM_QSCRIPTVALUE(filterURL, QString, setFilterURL);
- COPY_PROPERTY_FROM_QSCRIPTVALUE(clientOnly, bool, setClientOnly);
+ COPY_PROPERTY_FROM_QSCRIPTVALUE_ENUM(entityHostType, EntityHostType);
COPY_PROPERTY_FROM_QSCRIPTVALUE(owningAvatarID, QUuid, setOwningAvatarID);
COPY_PROPERTY_FROM_QSCRIPTVALUE(dpi, uint16_t, setDPI);
@@ -1933,7 +1964,7 @@ void EntityItemProperties::merge(const EntityItemProperties& other) {
COPY_PROPERTY_IF_CHANGED(ghostingAllowed);
COPY_PROPERTY_IF_CHANGED(filterURL);
- COPY_PROPERTY_IF_CHANGED(clientOnly);
+ COPY_PROPERTY_IF_CHANGED(entityHostType);
COPY_PROPERTY_IF_CHANGED(owningAvatarID);
COPY_PROPERTY_IF_CHANGED(dpi);
@@ -3223,7 +3254,7 @@ void EntityItemProperties::markAllChanged() {
_ghostingAllowedChanged = true;
_filterURLChanged = true;
- _clientOnlyChanged = true;
+ _entityHostTypeChanged = true;
_owningAvatarIDChanged = true;
_dpiChanged = true;
@@ -3725,8 +3756,8 @@ QListHow an entity is sent over the wire.
+ *Value | Description |
---|---|
domain | Domain entities are sent over the entity server to everyone else |
avatar | Avatar entities are sent over the avatar entity and are associated with one avatar |
local | Local entities are not sent over the wire and will only render for you, locally |
true
, or if clientOnly
is set true
in
- * the properties, the entity is created as an avatar entity; otherwise it is created on the server. An avatar entity
+ * @param {EntityHostType} [entityHostType="domain"] - If "avatar"
the entity is created as an avatar entity. An avatar entity
* follows you to each domain you visit, rendering at the same world coordinates unless it's parented to your avatar.
+ * If "local"
, the entity is created as a local entity, which will only render for you and isn't sent over the wire.
+ * Otherwise it is created as a normal entity and sent over the entity server.
* @returns {Uuid} The ID of the entity if successfully created, otherwise {@link Uuid|Uuid.NULL}.
* @example