Showing the changes to libraries/entities/src/EntityScriptingInterface.cpp (1 of 7 files). Show all
Unified · Split
| @@ -29,7 +29,7 @@ EntityItemID EntityScriptingInterface::addEntity(const EntityItemProperties& pro · 28 unmodified lines | ||
| 29 | 29 | // The application will keep track of creatorTokenID |
| 30 | 30 | uint32_t creatorTokenID = EntityItem::getNextCreatorTokenID(); |
| 31 | 31 | |
| 32 | − EntityItemID id(NEW_MODEL, creatorTokenID, false ); | |
| 32 | + EntityItemID id(NEW_ENTITY, creatorTokenID, false ); | |
| 33 | 33 | |
| 34 | 34 | // queue the packet |
| 35 | 35 | queueEntityMessage(PacketTypeEntityAddOrEdit, id, properties); |
| @@ -49,7 +49,7 @@ EntityItemID EntityScriptingInterface::identifyEntity(EntityItemID entityID) { · 13 unmodified lines | ||
| 49 | 49 | |
| 50 | 50 | if (!entityID.isKnownID) { |
| 51 | 51 | actualID = EntityItem::getIDfromCreatorTokenID(entityID.creatorTokenID); |
| 52 | − if (actualID == UNKNOWN_MODEL_ID) { | |
| 52 | + if (actualID == UNKNOWN_ENTITY_ID) { | |
| 53 | 53 | return entityID; // bailing early |
| 54 | 54 | } |
| 55 | 55 | |
| @@ -92,7 +92,7 @@ EntityItemID EntityScriptingInterface::editEntity(EntityItemID entityID, const E · 36 unmodified lines | ||
| 92 | 92 | } |
| 93 | 93 | |
| 94 | 94 | // if at this point, we know the id, send the update to the model server |
| 95 | − if (actualID != UNKNOWN_MODEL_ID) { | |
| 95 | + if (actualID != UNKNOWN_ENTITY_ID) { | |
| 96 | 96 | entityID.id = actualID; |
| 97 | 97 | entityID.isKnownID = true; |
| 98 | 98 | queueEntityMessage(PacketTypeEntityAddOrEdit, entityID, properties); |
| @@ -109,9 +109,9 @@ EntityItemID EntityScriptingInterface::editEntity(EntityItemID entityID, const E · 10 unmodified lines | ||
| 109 | 109 | } |
| 110 | 110 | |
| 111 | 111 | |
| 112 | −// TODO: This deleteEntity() method uses the PacketType_MODEL_ADD_OR_EDIT message to send | |
| 112 | +// TODO: This deleteEntity() method uses the PacketTypeEntityAddOrEdit message to send | |
| 113 | 113 | // a changed model with a shouldDie() property set to true. This works and is currently the only |
| 114 | −// way to tell the model server to delete a model. But we should change this to use the PacketType_MODEL_ERASE | |
| 114 | +// way to tell the model server to delete a model. But we should change this to use the PacketTypeEntityErase | |
| 115 | 115 | // message which takes a list of model id's to delete. |
| 116 | 116 | void EntityScriptingInterface::deleteEntity(EntityItemID entityID) { |
| 117 | 117 | |
| @@ -127,7 +127,7 @@ void EntityScriptingInterface::deleteEntity(EntityItemID entityID) { · 9 unmodified lines | ||
| 127 | 127 | } |
| 128 | 128 | |
| 129 | 129 | // if at this point, we know the id, send the update to the model server |
| 130 | − if (actualID != UNKNOWN_MODEL_ID) { | |
| 130 | + if (actualID != UNKNOWN_ENTITY_ID) { | |
| 131 | 131 | entityID.id = actualID; |
| 132 | 132 | entityID.isKnownID = true; |
| 133 | 133 | queueEntityMessage(PacketTypeEntityAddOrEdit, entityID, properties); |
| @@ -142,7 +142,7 @@ void EntityScriptingInterface::deleteEntity(EntityItemID entityID) { · 8 unmodified lines | ||
| 142 | 142 | } |
| 143 | 143 | |
| 144 | 144 | EntityItemID EntityScriptingInterface::findClosestEntity(const glm::vec3& center, float radius) const { |
| 145 | − EntityItemID result(UNKNOWN_MODEL_ID, UNKNOWN_MODEL_TOKEN, false); | |
| 145 | + EntityItemID result(UNKNOWN_ENTITY_ID, UNKNOWN_ENTITY_TOKEN, false); | |
| 146 | 146 | if (_entityTree) { |
| 147 | 147 | _entityTree->lockForRead(); |
| 148 | 148 | const EntityItem* closestEntity = _entityTree->findClosestEntity(center/(float)TREE_SCALE, |
| @@ -166,7 +166,7 @@ QVector<EntityItemID> EntityScriptingInterface::findEntities(const glm::vec3& ce · 17 unmodified lines | ||
| 166 | 166 | _entityTree->unlock(); |
| 167 | 167 | |
| 168 | 168 | foreach (const EntityItem* model, models) { |
| 169 | − EntityItemID thisEntityItemID(model->getID(), UNKNOWN_MODEL_TOKEN, true); | |
| 169 | + EntityItemID thisEntityItemID(model->getID(), UNKNOWN_ENTITY_TOKEN, true); | |
| 170 | 170 | result << thisEntityItemID; |
| 171 | 171 | } |
| 172 | 172 | } |