Merge branch 'master' of https://github.com/highfidelity/hifi into loginInitiative2

This commit is contained in:
Wayne Chen 2018-10-31 09:00:37 -07:00
commit 67539bc87a
5 changed files with 31 additions and 11 deletions

View file

@ -6162,7 +6162,9 @@ void Application::update(float deltaTime) {
{
PROFILE_RANGE_EX(app, "Overlays", 0xffff0000, (uint64_t)getActiveDisplayPlugin()->presentCount());
PerformanceTimer perfTimer("overlays");
_overlays.update(deltaTime);
if (qApp->shouldPaint()) {
_overlays.update(deltaTime);
}
}
// Update _viewFrustum with latest camera and view frustum data...
@ -6247,8 +6249,10 @@ void Application::update(float deltaTime) {
PROFILE_RANGE_EX(app, "PostUpdateLambdas", 0xffff0000, (uint64_t)0);
PerformanceTimer perfTimer("postUpdateLambdas");
std::unique_lock<std::mutex> guard(_postUpdateLambdasLock);
for (auto& iter : _postUpdateLambdas) {
iter.second();
if (qApp->shouldPaint()) {
for (auto& iter : _postUpdateLambdas) {
iter.second();
}
}
_postUpdateLambdas.clear();
}

View file

@ -261,7 +261,9 @@ void AvatarManager::updateOtherAvatars(float deltaTime) {
for (auto it = sortedAvatarVector.begin(); it != sortedAvatarVector.end(); ++it) {
const SortableAvatar& sortData = *it;
const auto avatar = std::static_pointer_cast<OtherAvatar>(sortData.getAvatar());
if (!avatar->_isClientAvatar) {
avatar->setIsClientAvatar(true);
}
// TODO: to help us scale to more avatars it would be nice to not have to poll this stuff every update
if (avatar->getSkeletonModel()->isLoaded()) {
// remove the orb if it is there

View file

@ -936,17 +936,27 @@ int AvatarData::parseDataFromBuffer(const QByteArray& buffer) {
}
_serverPosition = glm::vec3(data->globalPosition[0], data->globalPosition[1], data->globalPosition[2]) + offset;
auto oneStepDistance = glm::length(_globalPosition - _serverPosition);
if (oneStepDistance <= AVATAR_TRANSIT_MIN_TRIGGER_DISTANCE || oneStepDistance >= AVATAR_TRANSIT_MAX_TRIGGER_DISTANCE) {
_globalPosition = _serverPosition;
// if we don't have a parent, make sure to also set our local position
if (_isClientAvatar) {
auto oneStepDistance = glm::length(_globalPosition - _serverPosition);
if (oneStepDistance <= AVATAR_TRANSIT_MIN_TRIGGER_DISTANCE || oneStepDistance >= AVATAR_TRANSIT_MAX_TRIGGER_DISTANCE) {
_globalPosition = _serverPosition;
// if we don't have a parent, make sure to also set our local position
if (!hasParent()) {
setLocalPosition(_serverPosition);
}
}
if (_globalPosition != _serverPosition) {
_globalPositionChanged = now;
}
} else {
if (_globalPosition != _serverPosition) {
_globalPosition = _serverPosition;
_globalPositionChanged = now;
}
if (!hasParent()) {
setLocalPosition(_serverPosition);
}
}
if (_globalPosition != _serverPosition) {
_globalPositionChanged = now;
}
sourceBuffer += sizeof(AvatarDataPacket::AvatarGlobalPosition);
int numBytesRead = sourceBuffer - startSection;
_globalPositionRate.increment(numBytesRead);

View file

@ -1221,6 +1221,7 @@ public:
void setIsNewAvatar(bool isNewAvatar) { _isNewAvatar = isNewAvatar; }
bool getIsNewAvatar() { return _isNewAvatar; }
void setIsClientAvatar(bool isClientAvatar) { _isClientAvatar = isClientAvatar; }
signals:
@ -1486,6 +1487,7 @@ protected:
float _density;
int _replicaIndex { 0 };
bool _isNewAvatar { true };
bool _isClientAvatar { false };
// null unless MyAvatar or ScriptableAvatar sending traits data to mixer
std::unique_ptr<ClientTraitsHandler> _clientTraitsHandler;

View file

@ -3207,6 +3207,8 @@ void EntityItemProperties::markAllChanged() {
_queryAACubeChanged = true;
_shapeChanged = true;
_flyingAllowedChanged = true;
_ghostingAllowedChanged = true;
_filterURLChanged = true;