History

cleanups, diff minimization

Seth Alves committed 11 years ago

Commit 4a5631f1 parent 61076823 files · +5 −7Browse files

Showing the changes to libraries/entities/src/EntityScriptingInterface.cpp (1 of 3 files). Show all

Unified · Split

libraries/entities/src/EntityScriptingInterface.cpp+2−2
@@ -65,6 +65,7 @@ void setSimId(EntityItemProperties& propertiesWithSimID, EntityItem* entity) { · 64 unmodified lines
6565 auto nodeList = DependencyManager::get<NodeList>();
6666 const QUuid myNodeID = nodeList->getSessionUUID();
6767
68+ // if this entity has non-zero physics/simulation related values, claim simulation ownership
6869 if (propertiesWithSimID.velocityChanged() ||
6970 propertiesWithSimID.rotationChanged() ||
7071 propertiesWithSimID.containsPositionChange()) {
@@ -83,7 +84,6 @@ EntityItemID EntityScriptingInterface::addEntity(const EntityItemProperties& pro · 12 unmodified lines
8384 // The application will keep track of creatorTokenID
8485 uint32_t creatorTokenID = EntityItemID::getNextCreatorTokenID();
8586
86− // This Node is creating a new object. If it's in motion, set this Node as the simulator.
8787 EntityItemProperties propertiesWithSimID = properties;
8888
8989 EntityItemID id(NEW_ENTITY, creatorTokenID, false );
@@ -92,6 +92,7 @@ EntityItemID EntityScriptingInterface::addEntity(const EntityItemProperties& pro · 2 unmodified lines
9292 if (_entityTree) {
9393 _entityTree->lockForWrite();
9494 EntityItem* entity = _entityTree->addEntity(id, propertiesWithSimID);
95+ // This Node is creating a new object. If it's in motion, set this Node as the simulator.
9596 setSimId(propertiesWithSimID, entity);
9697 _entityTree->unlock();
9798 }
@@ -160,7 +161,6 @@ EntityItemID EntityScriptingInterface::editEntity(EntityItemID entityID, const E · 62 unmodified lines
160161 }
161162 }
162163
163− // if this Node is changing a physics-related property, claim simulation ownership.
164164 EntityItemProperties propertiesWithSimID = properties;
165165
166166 // If we have a local entity tree set, then also update it. We can do this even if we don't know