Showing the changes to libraries/entities/src/EntityScriptingInterface.cpp (1 of 18 files). Show all
Unified · Split
| @@ -470,7 +470,7 @@ void synchronizeEditedGrabProperties(EntityItemProperties& properties, const QSt · 469 unmodified lines | ||
| 470 | 470 | } |
| 471 | 471 | |
| 472 | 472 | |
| 473 | −QUuid EntityScriptingInterface::addEntity(const EntityItemProperties& properties, const QString& entityHostString) { | |
| 473 | +QUuid EntityScriptingInterface::addEntity(const EntityItemProperties& properties, const QString& entityHostTypeString) { | |
| 474 | 474 | PROFILE_RANGE(script_entities, __FUNCTION__); |
| 475 | 475 | |
| 476 | 476 | _activityTracking.addedEntityCount++; |
| @@ -479,10 +479,10 @@ QUuid EntityScriptingInterface::addEntity(const EntityItemProperties& properties · 2 unmodified lines | ||
| 479 | 479 | const auto sessionID = nodeList->getSessionUUID(); |
| 480 | 480 | |
| 481 | 481 | EntityItemProperties propertiesWithSimID = properties; |
| 482 | − propertiesWithSimID.setEntityHostFromString(entityHostString); | |
| 483 | − if (propertiesWithSimID.getEntityHost() == EntityHost::AVATAR_ENTITY) { | |
| 482 | + propertiesWithSimID.setEntityHostTypeFromString(entityHostTypeString); | |
| 483 | + if (propertiesWithSimID.getEntityHostType() == entity::HostType::AVATAR) { | |
| 484 | 484 | propertiesWithSimID.setOwningAvatarID(sessionID); |
| 485 | − } else if (propertiesWithSimID.getEntityHost() == EntityHost::LOCAL_ENTITY) { | |
| 485 | + } else if (propertiesWithSimID.getEntityHostType() == entity::HostType::LOCAL) { | |
| 486 | 486 | // For now, local entities are always collisionless |
| 487 | 487 | // TODO: create a separate, local physics simulation that just handles local entities (and MyAvatar?) |
| 488 | 488 | propertiesWithSimID.setCollisionless(true); |
| @@ -572,7 +572,7 @@ QUuid EntityScriptingInterface::cloneEntity(QUuid entityIDToClone) { · 83 unmodified lines | ||
| 572 | 572 | bool cloneAvatarEntity = properties.getCloneAvatarEntity(); |
| 573 | 573 | properties.convertToCloneProperties(entityIDToClone); |
| 574 | 574 | |
| 575 | − if (properties.getEntityHost() == EntityHost::LOCAL_ENTITY) { | |
| 575 | + if (properties.getEntityHostType() == entity::HostType::LOCAL) { | |
| 576 | 576 | // Local entities are only cloned locally |
| 577 | 577 | return addEntity(properties, "local"); |
| 578 | 578 | } else if (cloneAvatarEntity) { |
| @@ -838,9 +838,9 @@ QUuid EntityScriptingInterface::editEntity(QUuid id, const EntityItemProperties& · 259 unmodified lines | ||
| 838 | 838 | } |
| 839 | 839 | |
| 840 | 840 | // set these to make EntityItemProperties::getScalesWithParent() work correctly |
| 841 | − EntityHost entityHost = entity->getEntityHost(); | |
| 842 | − properties.setEntityHost(entityHost); | |
| 843 | − if (entityHost == EntityHost::LOCAL_ENTITY) { | |
| 841 | + entity::HostType entityHostType = entity->getEntityHostType(); | |
| 842 | + properties.setEntityHostType(entityHostType); | |
| 843 | + if (entityHostType == entity::HostType::LOCAL) { | |
| 844 | 844 | properties.setCollisionless(true); |
| 845 | 845 | } |
| 846 | 846 | properties.setOwningAvatarID(entity->getOwningAvatarID()); |
| @@ -1660,7 +1660,7 @@ bool EntityScriptingInterface::actionWorker(const QUuid& entityID, · 813 unmodified lines | ||
| 1660 | 1660 | doTransmit = actor(simulation, entity); |
| 1661 | 1661 | _entityTree->entityChanged(entity); |
| 1662 | 1662 | if (doTransmit) { |
| 1663 | − properties.setEntityHost(entity->getEntityHost()); | |
| 1663 | + properties.setEntityHostType(entity->getEntityHostType()); | |
| 1664 | 1664 | properties.setOwningAvatarID(entity->getOwningAvatarID()); |
| 1665 | 1665 | } |
| 1666 | 1666 | }); |