From 768934ae11b9e0373d559f06f733a45f25b308a7 Mon Sep 17 00:00:00 2001 From: Seth Alves Date: Mon, 4 Jan 2016 11:29:15 -0800 Subject: [PATCH] update entity timestamps when sending joint information --- libraries/entities/src/EntityScriptingInterface.cpp | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/libraries/entities/src/EntityScriptingInterface.cpp b/libraries/entities/src/EntityScriptingInterface.cpp index 8df5d86ddd..10f74ef5cc 100644 --- a/libraries/entities/src/EntityScriptingInterface.cpp +++ b/libraries/entities/src/EntityScriptingInterface.cpp @@ -832,16 +832,18 @@ glm::quat EntityScriptingInterface::getAbsoluteJointRotationInObjectFrame(const bool EntityScriptingInterface::setAbsoluteJointTranslationInObjectFrame(const QUuid& entityID, int jointIndex, glm::vec3 translation) { if (auto entity = checkForTreeEntityAndTypeMatch(entityID, EntityTypes::Model)) { + auto now = usecTimestampNow(); auto modelEntity = std::dynamic_pointer_cast(entity); bool result = modelEntity->setAbsoluteJointTranslationInObjectFrame(jointIndex, translation); if (result) { EntityItemProperties properties; _entityTree->withReadLock([&] { properties = entity->getProperties(); + entity->setLastEdited(now); + entity->setLastBroadcast(now); }); properties.setJointTranslationsDirty(); - auto now = usecTimestampNow(); properties.setLastEdited(now); queueEntityMessage(PacketType::EntityEdit, entityID, properties); return true; @@ -853,16 +855,18 @@ bool EntityScriptingInterface::setAbsoluteJointTranslationInObjectFrame(const QU bool EntityScriptingInterface::setAbsoluteJointRotationInObjectFrame(const QUuid& entityID, int jointIndex, glm::quat rotation) { if (auto entity = checkForTreeEntityAndTypeMatch(entityID, EntityTypes::Model)) { + auto now = usecTimestampNow(); auto modelEntity = std::dynamic_pointer_cast(entity); bool result = modelEntity->setAbsoluteJointRotationInObjectFrame(jointIndex, rotation); if (result) { EntityItemProperties properties; _entityTree->withReadLock([&] { properties = entity->getProperties(); + entity->setLastEdited(now); + entity->setLastBroadcast(now); }); properties.setJointRotationsDirty(); - auto now = usecTimestampNow(); properties.setLastEdited(now); queueEntityMessage(PacketType::EntityEdit, entityID, properties); return true;