mirror of
https://github.com/overte-org/overte.git
synced 2025-08-10 00:08:53 +02:00
update entity timestamps when sending joint information
This commit is contained in:
parent
9e49fcf0a4
commit
768934ae11
1 changed files with 6 additions and 2 deletions
|
@ -832,16 +832,18 @@ glm::quat EntityScriptingInterface::getAbsoluteJointRotationInObjectFrame(const
|
||||||
bool EntityScriptingInterface::setAbsoluteJointTranslationInObjectFrame(const QUuid& entityID,
|
bool EntityScriptingInterface::setAbsoluteJointTranslationInObjectFrame(const QUuid& entityID,
|
||||||
int jointIndex, glm::vec3 translation) {
|
int jointIndex, glm::vec3 translation) {
|
||||||
if (auto entity = checkForTreeEntityAndTypeMatch(entityID, EntityTypes::Model)) {
|
if (auto entity = checkForTreeEntityAndTypeMatch(entityID, EntityTypes::Model)) {
|
||||||
|
auto now = usecTimestampNow();
|
||||||
auto modelEntity = std::dynamic_pointer_cast<ModelEntityItem>(entity);
|
auto modelEntity = std::dynamic_pointer_cast<ModelEntityItem>(entity);
|
||||||
bool result = modelEntity->setAbsoluteJointTranslationInObjectFrame(jointIndex, translation);
|
bool result = modelEntity->setAbsoluteJointTranslationInObjectFrame(jointIndex, translation);
|
||||||
if (result) {
|
if (result) {
|
||||||
EntityItemProperties properties;
|
EntityItemProperties properties;
|
||||||
_entityTree->withReadLock([&] {
|
_entityTree->withReadLock([&] {
|
||||||
properties = entity->getProperties();
|
properties = entity->getProperties();
|
||||||
|
entity->setLastEdited(now);
|
||||||
|
entity->setLastBroadcast(now);
|
||||||
});
|
});
|
||||||
|
|
||||||
properties.setJointTranslationsDirty();
|
properties.setJointTranslationsDirty();
|
||||||
auto now = usecTimestampNow();
|
|
||||||
properties.setLastEdited(now);
|
properties.setLastEdited(now);
|
||||||
queueEntityMessage(PacketType::EntityEdit, entityID, properties);
|
queueEntityMessage(PacketType::EntityEdit, entityID, properties);
|
||||||
return true;
|
return true;
|
||||||
|
@ -853,16 +855,18 @@ bool EntityScriptingInterface::setAbsoluteJointTranslationInObjectFrame(const QU
|
||||||
bool EntityScriptingInterface::setAbsoluteJointRotationInObjectFrame(const QUuid& entityID,
|
bool EntityScriptingInterface::setAbsoluteJointRotationInObjectFrame(const QUuid& entityID,
|
||||||
int jointIndex, glm::quat rotation) {
|
int jointIndex, glm::quat rotation) {
|
||||||
if (auto entity = checkForTreeEntityAndTypeMatch(entityID, EntityTypes::Model)) {
|
if (auto entity = checkForTreeEntityAndTypeMatch(entityID, EntityTypes::Model)) {
|
||||||
|
auto now = usecTimestampNow();
|
||||||
auto modelEntity = std::dynamic_pointer_cast<ModelEntityItem>(entity);
|
auto modelEntity = std::dynamic_pointer_cast<ModelEntityItem>(entity);
|
||||||
bool result = modelEntity->setAbsoluteJointRotationInObjectFrame(jointIndex, rotation);
|
bool result = modelEntity->setAbsoluteJointRotationInObjectFrame(jointIndex, rotation);
|
||||||
if (result) {
|
if (result) {
|
||||||
EntityItemProperties properties;
|
EntityItemProperties properties;
|
||||||
_entityTree->withReadLock([&] {
|
_entityTree->withReadLock([&] {
|
||||||
properties = entity->getProperties();
|
properties = entity->getProperties();
|
||||||
|
entity->setLastEdited(now);
|
||||||
|
entity->setLastBroadcast(now);
|
||||||
});
|
});
|
||||||
|
|
||||||
properties.setJointRotationsDirty();
|
properties.setJointRotationsDirty();
|
||||||
auto now = usecTimestampNow();
|
|
||||||
properties.setLastEdited(now);
|
properties.setLastEdited(now);
|
||||||
queueEntityMessage(PacketType::EntityEdit, entityID, properties);
|
queueEntityMessage(PacketType::EntityEdit, entityID, properties);
|
||||||
return true;
|
return true;
|
||||||
|
|
Loading…
Reference in a new issue