mirror of
https://github.com/lubosz/overte.git
synced 2025-08-08 03:27:48 +02:00
send update for AvatarEntity on deleteGrab
This commit is contained in:
parent
fab3e5e3fd
commit
3ea6241cc9
4 changed files with 22 additions and 3 deletions
|
@ -5312,3 +5312,15 @@ void MyAvatar::releaseGrab(const QUuid& grabID) {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void MyAvatar::sendPacket(const QUuid& entityID, const EntityItemProperties& properties) const {
|
||||||
|
auto treeRenderer = DependencyManager::get<EntityTreeRenderer>();
|
||||||
|
EntityTreePointer entityTree = treeRenderer ? treeRenderer->getTree() : nullptr;
|
||||||
|
if (entityTree) {
|
||||||
|
entityTree->withWriteLock([&] {
|
||||||
|
// force an update packet
|
||||||
|
EntityEditPacketSender* packetSender = qApp->getEntityEditPacketSender();
|
||||||
|
packetSender->queueEditEntityMessage(PacketType::EntityEdit, entityTree, entityID, properties);
|
||||||
|
});
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
|
@ -1882,6 +1882,7 @@ private:
|
||||||
bool didTeleport();
|
bool didTeleport();
|
||||||
bool getIsAway() const { return _isAway; }
|
bool getIsAway() const { return _isAway; }
|
||||||
void setAway(bool value);
|
void setAway(bool value);
|
||||||
|
void sendPacket(const QUuid& entityID, const EntityItemProperties& properties) const override;
|
||||||
|
|
||||||
std::mutex _pinnedJointsMutex;
|
std::mutex _pinnedJointsMutex;
|
||||||
std::vector<int> _pinnedJoints;
|
std::vector<int> _pinnedJoints;
|
||||||
|
|
|
@ -363,6 +363,13 @@ bool Avatar::applyGrabChanges() {
|
||||||
target->removeGrab(grab);
|
target->removeGrab(grab);
|
||||||
_avatarGrabs.erase(itr);
|
_avatarGrabs.erase(itr);
|
||||||
grabAddedOrRemoved = true;
|
grabAddedOrRemoved = true;
|
||||||
|
if (isMyAvatar()) {
|
||||||
|
const EntityItemPointer& entity = std::dynamic_pointer_cast<EntityItem>(target);
|
||||||
|
if (entity && entity->getEntityHostType() == entity::HostType::AVATAR && entity->getSimulationOwner().getID() == getID()) {
|
||||||
|
EntityItemProperties properties = entity->getProperties();
|
||||||
|
sendPacket(entity->getID(), properties);
|
||||||
|
}
|
||||||
|
}
|
||||||
} else {
|
} else {
|
||||||
undeleted.push_back(id);
|
undeleted.push_back(id);
|
||||||
}
|
}
|
||||||
|
|
|
@ -25,6 +25,7 @@
|
||||||
#include <render/Scene.h>
|
#include <render/Scene.h>
|
||||||
#include <graphics-scripting/Forward.h>
|
#include <graphics-scripting/Forward.h>
|
||||||
#include <GLMHelpers.h>
|
#include <GLMHelpers.h>
|
||||||
|
#include <EntityItem.h>
|
||||||
|
|
||||||
#include <Grab.h>
|
#include <Grab.h>
|
||||||
#include <ThreadSafeValueCache.h>
|
#include <ThreadSafeValueCache.h>
|
||||||
|
@ -601,6 +602,7 @@ protected:
|
||||||
|
|
||||||
// protected methods...
|
// protected methods...
|
||||||
bool isLookingAtMe(AvatarSharedPointer avatar) const;
|
bool isLookingAtMe(AvatarSharedPointer avatar) const;
|
||||||
|
virtual void sendPacket(const QUuid& entityID, const EntityItemProperties& properties) const { }
|
||||||
bool applyGrabChanges();
|
bool applyGrabChanges();
|
||||||
void relayJointDataToChildren();
|
void relayJointDataToChildren();
|
||||||
|
|
||||||
|
@ -645,9 +647,6 @@ protected:
|
||||||
bool success { false };
|
bool success { false };
|
||||||
};
|
};
|
||||||
|
|
||||||
//using MapOfAvatarEntityDataHashes = QMap<QUuid, AvatarEntityDataHash>;
|
|
||||||
//MapOfAvatarEntityDataHashes _avatarEntityDataHashes;
|
|
||||||
|
|
||||||
uint64_t _lastRenderUpdateTime { 0 };
|
uint64_t _lastRenderUpdateTime { 0 };
|
||||||
int _leftPointerGeometryID { 0 };
|
int _leftPointerGeometryID { 0 };
|
||||||
int _rightPointerGeometryID { 0 };
|
int _rightPointerGeometryID { 0 };
|
||||||
|
|
Loading…
Reference in a new issue