mirror of
https://github.com/JulianGro/overte.git
synced 2025-04-25 17:35:08 +02:00
update queryAACube during grab rather than only when grab is released
This commit is contained in:
parent
b5326936d8
commit
b1c34eb9ec
4 changed files with 18 additions and 3 deletions
|
@ -18,6 +18,8 @@ void GrabManager::simulateGrabs() {
|
|||
// Update grabbed objects
|
||||
auto entityTreeRenderer = DependencyManager::get<EntityTreeRenderer>();
|
||||
auto entityTree = entityTreeRenderer->getTree();
|
||||
auto sessionID = DependencyManager::get<NodeList>()->getSessionUUID();
|
||||
EntityEditPacketSender* packetSender = entityTreeRenderer ? entityTreeRenderer->getPacketSender() : nullptr;
|
||||
entityTree->withReadLock([&] {
|
||||
PROFILE_RANGE(simulation, "Grabs");
|
||||
|
||||
|
@ -33,6 +35,8 @@ void GrabManager::simulateGrabs() {
|
|||
glm::vec3 finalPosition = acc.finalizePosition();
|
||||
glm::quat finalOrientation = acc.finalizeOrientation();
|
||||
grabbedThing->setTransform(createMatFromQuatAndPos(finalOrientation, finalPosition));
|
||||
bool iShouldTellServer = grabbedThing->getEditSenderID() == sessionID;
|
||||
entityTree->updateEntityQueryAACube(grabbedThing, packetSender, false, iShouldTellServer);
|
||||
}
|
||||
}
|
||||
});
|
||||
|
|
|
@ -3349,7 +3349,8 @@ void EntityItem::prepareForSimulationOwnershipBid(EntityItemProperties& properti
|
|||
}
|
||||
|
||||
bool EntityItem::isWearable() const {
|
||||
return isVisible() && (getParentID() == DependencyManager::get<NodeList>()->getSessionUUID() || getParentID() == AVATAR_SELF_ID);
|
||||
return isVisible() &&
|
||||
(getParentID() == DependencyManager::get<NodeList>()->getSessionUUID() || getParentID() == AVATAR_SELF_ID);
|
||||
}
|
||||
|
||||
void EntityItem::addGrab(GrabPointer grab) {
|
||||
|
|
|
@ -2982,6 +2982,7 @@ void EntityTree::updateEntityQueryAACubeWorker(SpatiallyNestablePointer object,
|
|||
properties.setLastEdited(now);
|
||||
|
||||
packetSender->queueEditEntityMessage(PacketType::EntityEdit, getThisPointer(), entity->getID(), properties);
|
||||
entity->setLastEdited(now); // so we ignore the echo from the server
|
||||
entity->setLastBroadcast(now); // for debug/physics status icons
|
||||
}
|
||||
|
||||
|
|
|
@ -33,6 +33,7 @@
|
|||
getGrabbableData:true,
|
||||
isAnothersAvatarEntity:true,
|
||||
isAnothersChildEntity:true,
|
||||
entityIsEquippable:true,
|
||||
entityIsGrabbable:true,
|
||||
entityIsDistanceGrabbable:true,
|
||||
getControllerJointIndexCacheTime:true,
|
||||
|
@ -332,10 +333,18 @@ entityIsEquippable = function (eieProps) {
|
|||
return false;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
};
|
||||
|
||||
entityIsGrabbable = function (eigProps) {
|
||||
return entityIsEquippable(eigProps) && !eigProps.locked;
|
||||
var grabbable = getGrabbableData(eigProps).grabbable;
|
||||
if (!grabbable ||
|
||||
eigProps.locked ||
|
||||
isAnothersAvatarEntity(eigProps) ||
|
||||
isAnothersChildEntity(eigProps) ||
|
||||
FORBIDDEN_GRAB_TYPES.indexOf(eigProps.type) >= 0) {
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
};
|
||||
|
||||
clearHighlightedEntities = function() {
|
||||
|
|
Loading…
Reference in a new issue