move _cauterizationNeedsUpdate back to MyAvatar

This commit is contained in:
Andrew Meadows 2019-01-17 13:58:34 -08:00
parent e22024b0dd
commit 74f9a415d3
4 changed files with 11 additions and 8 deletions

View file

@ -823,7 +823,9 @@ void MyAvatar::simulate(float deltaTime, bool inView) {
// and all of its joints, now update our attachements.
Avatar::simulateAttachments(deltaTime);
relayJointDataToChildren();
updateGrabs();
if (updateGrabs()) {
_cauterizationNeedsUpdate = true;
}
if (!_skeletonModel->hasSkeleton()) {
// All the simulation that can be done has been done

View file

@ -1869,6 +1869,8 @@ private:
bool _enableDebugDrawIKChains { false };
bool _enableDebugDrawDetailedCollision { false };
mutable bool _cauterizationNeedsUpdate; // do we need to scan children and update their "cauterized" state?
AudioListenerMode _audioListenerMode;
glm::vec3 _customListenPosition;
glm::quat _customListenOrientation;

View file

@ -324,8 +324,8 @@ void Avatar::removeAvatarEntitiesFromTree() {
}
}
void Avatar::updateGrabs() {
bool Avatar::updateGrabs() {
bool grabAddedOrRemoved = false;
// update the Grabs according to any changes in _avatarGrabData
_avatarGrabsLock.withWriteLock([&] {
if (_avatarGrabDataChanged) {
@ -385,7 +385,7 @@ void Avatar::updateGrabs() {
entityTree->updateEntityQueryAACube(target, packetSender, force, iShouldTellServer);
});
}
_cauterizationNeedsUpdate = true;
grabAddedOrRemoved = true;
}
_avatarGrabs.remove(grabID);
_changedAvatarGrabs.remove(grabID);
@ -403,10 +403,11 @@ void Avatar::updateGrabs() {
target->addGrab(grab);
// only clear this entry from the _changedAvatarGrabs if we found the entity.
changeItr.remove();
_cauterizationNeedsUpdate = true;
grabAddedOrRemoved = true;
}
}
});
return grabAddedOrRemoved;
}
void Avatar::accumulateGrabPositions(std::map<QUuid, GrabLocationAccumulator>& grabAccumulators) {

View file

@ -536,11 +536,9 @@ protected:
glm::vec3 _worldUpDirection { Vectors::UP };
bool _moving { false }; ///< set when position is changing
mutable bool _cauterizationNeedsUpdate; // do we need to scan children and update their "cauterized" state?
// protected methods...
bool isLookingAtMe(AvatarSharedPointer avatar) const;
void updateGrabs();
bool updateGrabs();
void relayJointDataToChildren();
void fade(render::Transaction& transaction, render::Transition::Type type);