mirror of
https://github.com/lubosz/overte.git
synced 2025-04-15 19:47:38 +02:00
Return server position
This commit is contained in:
parent
62e4b3fead
commit
767f4e9d6d
2 changed files with 4 additions and 4 deletions
|
@ -883,6 +883,9 @@ int AvatarData::parseDataFromBuffer(const QByteArray& buffer) {
|
|||
}
|
||||
|
||||
_serverPosition = glm::vec3(data->globalPosition[0], data->globalPosition[1], data->globalPosition[2]) + offset;
|
||||
if (_globalPosition != _serverPosition) {
|
||||
_globalPositionChanged = now;
|
||||
}
|
||||
auto oneStepDistance = glm::length(_globalPosition - _serverPosition);
|
||||
if (oneStepDistance <= AVATAR_TRANSIT_MIN_TRIGGER_DISTANCE || oneStepDistance >= AVATAR_TRANSIT_MAX_TRIGGER_DISTANCE) {
|
||||
_globalPosition = _serverPosition;
|
||||
|
@ -891,9 +894,6 @@ int AvatarData::parseDataFromBuffer(const QByteArray& buffer) {
|
|||
setLocalPosition(_serverPosition);
|
||||
}
|
||||
}
|
||||
if (_globalPosition != _serverPosition) {
|
||||
_globalPositionChanged = now;
|
||||
}
|
||||
sourceBuffer += sizeof(AvatarDataPacket::AvatarGlobalPosition);
|
||||
int numBytesRead = sourceBuffer - startSection;
|
||||
_globalPositionRate.increment(numBytesRead);
|
||||
|
|
|
@ -1111,7 +1111,7 @@ public:
|
|||
void fromJson(const QJsonObject& json, bool useFrameSkeleton = true);
|
||||
|
||||
glm::vec3 getClientGlobalPosition() const { return _serverPosition; }
|
||||
AABox getGlobalBoundingBox() const { return AABox(_globalPosition + _globalBoundingBoxOffset - _globalBoundingBoxDimensions, _globalBoundingBoxDimensions); }
|
||||
AABox getGlobalBoundingBox() const { return AABox(_serverPosition + _globalBoundingBoxOffset - _globalBoundingBoxDimensions, _globalBoundingBoxDimensions); }
|
||||
|
||||
/**jsdoc
|
||||
* @function MyAvatar.getAvatarEntityData
|
||||
|
|
Loading…
Reference in a new issue