Showing the changes to libraries/entities/src/EntityScriptingInterface.cpp (1 of 23 files). Show all
Unified · Split
| @@ -90,8 +90,6 @@ EntityItemProperties EntityScriptingInterface::getEntityProperties(EntityItemID · 89 unmodified lines | |||
| 90 | return results; | 90 | return results; |
| 91 | } | 91 | } |
| 92 | 92 | ||
| 93 | |||
| 94 | |||
| 95 | EntityItemID EntityScriptingInterface::editEntity(EntityItemID entityID, const EntityItemProperties& properties) { | 93 | EntityItemID EntityScriptingInterface::editEntity(EntityItemID entityID, const EntityItemProperties& properties) { |
| 96 | EntityItemID actualID = entityID; | 94 | EntityItemID actualID = entityID; |
| 97 | 95 | ||
| @@ -104,7 +102,6 @@ EntityItemID EntityScriptingInterface::editEntity(EntityItemID entityID, const E · 6 unmodified lines | |||
| 104 | if (actualID.id != UNKNOWN_ENTITY_ID) { | 102 | if (actualID.id != UNKNOWN_ENTITY_ID) { |
| 105 | entityID.id = actualID.id; | 103 | entityID.id = actualID.id; |
| 106 | entityID.isKnownID = true; | 104 | entityID.isKnownID = true; |
| 107 | //qDebug() << "EntityScriptingInterface::editEntity()... isKnownID=" << entityID.isKnownID << "id=" << entityID.id << "creatorTokenID=" << entityID.creatorTokenID; | ||
| 108 | queueEntityMessage(PacketTypeEntityAddOrEdit, entityID, properties); | 105 | queueEntityMessage(PacketTypeEntityAddOrEdit, entityID, properties); |
| 109 | } | 106 | } |
| 110 | 107 | ||
| @@ -112,19 +109,12 @@ EntityItemID EntityScriptingInterface::editEntity(EntityItemID entityID, const E · 1 unmodified line | |||
| 112 | // the actual id, because we can edit out local models just with creatorTokenID | 109 | // the actual id, because we can edit out local models just with creatorTokenID |
| 113 | if (_entityTree) { | 110 | if (_entityTree) { |
| 114 | _entityTree->lockForWrite(); | 111 | _entityTree->lockForWrite(); |
| 115 | //qDebug() << "EntityScriptingInterface::editEntity() ******* START _entityTree->updateEntity()..."; | ||
| 116 | _entityTree->updateEntity(entityID, properties); | 112 | _entityTree->updateEntity(entityID, properties); |
| 117 | //qDebug() << "EntityScriptingInterface::editEntity() ******* DONE _entityTree->updateEntity()..."; | ||
| 118 | _entityTree->unlock(); | 113 | _entityTree->unlock(); |
| 119 | } | 114 | } |
| 120 | return entityID; | 115 | return entityID; |
| 121 | } | 116 | } |
| 122 | 117 | ||
| 123 | |||
| 124 | // TODO: This deleteEntity() method uses the PacketTypeEntityAddOrEdit message to send | ||
| 125 | // a changed model with a shouldDie() property set to true. This works and is currently the only | ||
| 126 | // way to tell the model server to delete a model. But we should change this to use the PacketTypeEntityErase | ||
| 127 | // message which takes a list of model id's to delete. | ||
| 128 | void EntityScriptingInterface::deleteEntity(EntityItemID entityID) { | 118 | void EntityScriptingInterface::deleteEntity(EntityItemID entityID) { |
| 129 | 119 | ||
| 130 | EntityItemID actualID = entityID; | 120 | EntityItemID actualID = entityID; |
| @@ -220,10 +210,6 @@ RayToEntityIntersectionResult EntityScriptingInterface::findRayIntersectionWorke · 89 unmodified lines | |||
| 220 | result.intersects = _entityTree->findRayIntersection(ray.origin, ray.direction, element, result.distance, result.face, | 210 | result.intersects = _entityTree->findRayIntersection(ray.origin, ray.direction, element, result.distance, result.face, |
| 221 | (void**)&intersectedEntity, lockType, &result.accurate); | 211 | (void**)&intersectedEntity, lockType, &result.accurate); |
| 222 | if (result.intersects && intersectedEntity) { | 212 | if (result.intersects && intersectedEntity) { |
| 223 | |||
| 224 | //qDebug() << "findRayIntersectionWorker().... intersectedEntity=" << intersectedEntity; | ||
| 225 | //intersectedEntity->debugDump(); | ||
| 226 | |||
| 227 | result.entityID = intersectedEntity->getEntityItemID(); | 213 | result.entityID = intersectedEntity->getEntityItemID(); |
| 228 | result.properties = intersectedEntity->getProperties(); | 214 | result.properties = intersectedEntity->getProperties(); |
| 229 | result.intersection = ray.origin + (ray.direction * result.distance); | 215 | result.intersection = ray.origin + (ray.direction * result.distance); |