Merge remote-tracking branch 'upstream/master' into web

This commit is contained in:
SamGondelman 2019-02-25 17:23:58 -08:00
commit 94a82b8304
7 changed files with 30 additions and 31 deletions

View file

@ -2548,7 +2548,7 @@ bool DomainServer::processPendingContent(HTTPConnection* connection, QString ite
_pendingFileContent.seek(_pendingFileContent.size()); _pendingFileContent.seek(_pendingFileContent.size());
_pendingFileContent.write(dataChunk); _pendingFileContent.write(dataChunk);
_pendingFileContent.close(); _pendingFileContent.close();
// Respond immediately - will timeout if we wait for restore. // Respond immediately - will timeout if we wait for restore.
connection->respond(HTTPConnection::StatusCode200); connection->respond(HTTPConnection::StatusCode200);
if (itemName == "restore-file" || itemName == "restore-file-chunk-final" || itemName == "restore-file-chunk-only") { if (itemName == "restore-file" || itemName == "restore-file-chunk-final" || itemName == "restore-file-chunk-only") {

View file

@ -932,7 +932,8 @@ void MyAvatar::simulate(float deltaTime, bool inView) {
bool isPhysicsEnabled = qApp->isPhysicsEnabled(); bool isPhysicsEnabled = qApp->isPhysicsEnabled();
bool zoneAllowsFlying = zoneInteractionProperties.first; bool zoneAllowsFlying = zoneInteractionProperties.first;
bool collisionlessAllowed = zoneInteractionProperties.second; bool collisionlessAllowed = zoneInteractionProperties.second;
_characterController.setFlyingAllowed((zoneAllowsFlying && _enableFlying) || !isPhysicsEnabled); _characterController.setZoneFlyingAllowed(zoneAllowsFlying || !isPhysicsEnabled);
_characterController.setComfortFlyingAllowed(_enableFlying);
_characterController.setCollisionlessAllowed(collisionlessAllowed); _characterController.setCollisionlessAllowed(collisionlessAllowed);
} }

View file

@ -1066,13 +1066,6 @@ void Rig::computeMotionAnimationState(float deltaTime, const glm::vec3& worldPos
if (_enableInverseKinematics) { if (_enableInverseKinematics) {
_animVars.set("ikOverlayAlpha", 1.0f); _animVars.set("ikOverlayAlpha", 1.0f);
_animVars.set("splineIKEnabled", true);
_animVars.set("leftHandIKEnabled", true);
_animVars.set("rightHandIKEnabled", true);
_animVars.set("leftFootIKEnabled", true);
_animVars.set("rightFootIKEnabled", true);
_animVars.set("leftFootPoleVectorEnabled", true);
_animVars.set("rightFootPoleVectorEnabled", true);
} else { } else {
_animVars.set("ikOverlayAlpha", 0.0f); _animVars.set("ikOverlayAlpha", 0.0f);
_animVars.set("splineIKEnabled", false); _animVars.set("splineIKEnabled", false);

View file

@ -315,7 +315,9 @@ bool AddressManager::handleUrl(const QUrl& lookupUrl, LookupTrigger trigger) {
// wasn't an address - lookup the place name // wasn't an address - lookup the place name
// we may have a path that defines a relative viewpoint - pass that through the lookup so we can go to it after // we may have a path that defines a relative viewpoint - pass that through the lookup so we can go to it after
attemptPlaceNameLookup(lookupUrl.host(), lookupUrl.path(), trigger); if (!lookupUrl.host().isNull() && !lookupUrl.host().isEmpty()) {
attemptPlaceNameLookup(lookupUrl.host(), lookupUrl.path(), trigger);
}
} }
} }
@ -337,7 +339,7 @@ bool AddressManager::handleUrl(const QUrl& lookupUrl, LookupTrigger trigger) {
// be loaded over http(s) // be loaded over http(s)
// lookupUrl.scheme() == URL_SCHEME_HTTP || // lookupUrl.scheme() == URL_SCHEME_HTTP ||
// lookupUrl.scheme() == HIFI_URL_SCHEME_HTTPS || // lookupUrl.scheme() == HIFI_URL_SCHEME_HTTPS ||
// TODO once a file can return a connection refusal if there were to be some kind of load error, we'd // TODO once a file can return a connection refusal if there were to be some kind of load error, we'd
// need to store the previous domain tried in _lastVisitedURL. For now , do not store it. // need to store the previous domain tried in _lastVisitedURL. For now , do not store it.
_previousAPILookup.clear(); _previousAPILookup.clear();

View file

@ -781,18 +781,18 @@ void CharacterController::updateState() {
const float jumpSpeed = sqrtf(2.0f * -DEFAULT_AVATAR_GRAVITY * jumpHeight); const float jumpSpeed = sqrtf(2.0f * -DEFAULT_AVATAR_GRAVITY * jumpHeight);
if ((velocity.dot(_currentUp) <= (jumpSpeed / 2.0f)) && ((_floorDistance < FLY_TO_GROUND_THRESHOLD) || _hasSupport)) { if ((velocity.dot(_currentUp) <= (jumpSpeed / 2.0f)) && ((_floorDistance < FLY_TO_GROUND_THRESHOLD) || _hasSupport)) {
SET_STATE(State::Ground, "hit ground"); SET_STATE(State::Ground, "hit ground");
} else if (_flyingAllowed) { } else if (_zoneFlyingAllowed) {
btVector3 desiredVelocity = _targetVelocity; btVector3 desiredVelocity = _targetVelocity;
if (desiredVelocity.length2() < MIN_TARGET_SPEED_SQUARED) { if (desiredVelocity.length2() < MIN_TARGET_SPEED_SQUARED) {
desiredVelocity = btVector3(0.0f, 0.0f, 0.0f); desiredVelocity = btVector3(0.0f, 0.0f, 0.0f);
} }
bool vertTargetSpeedIsNonZero = desiredVelocity.dot(_currentUp) > MIN_TARGET_SPEED; bool vertTargetSpeedIsNonZero = desiredVelocity.dot(_currentUp) > MIN_TARGET_SPEED;
if ((jumpButtonHeld || vertTargetSpeedIsNonZero) && (_takeoffJumpButtonID != _jumpButtonDownCount)) { if (_comfortFlyingAllowed && (jumpButtonHeld || vertTargetSpeedIsNonZero) && (_takeoffJumpButtonID != _jumpButtonDownCount)) {
SET_STATE(State::Hover, "double jump button"); SET_STATE(State::Hover, "double jump button");
} else if ((jumpButtonHeld || vertTargetSpeedIsNonZero) && (now - _jumpButtonDownStartTime) > JUMP_TO_HOVER_PERIOD) { } else if (_comfortFlyingAllowed && (jumpButtonHeld || vertTargetSpeedIsNonZero) && (now - _jumpButtonDownStartTime) > JUMP_TO_HOVER_PERIOD) {
SET_STATE(State::Hover, "jump button held"); SET_STATE(State::Hover, "jump button held");
} else if (_floorDistance > _scaleFactor * DEFAULT_AVATAR_FALL_HEIGHT) { } else if ((!rayHasHit && !_hasSupport) || _floorDistance > _scaleFactor * DEFAULT_AVATAR_FALL_HEIGHT) {
// Transition to hover if we are above the fall threshold // Transition to hover if there's no ground beneath us or we are above the fall threshold, regardless of _comfortFlyingAllowed
SET_STATE(State::Hover, "above fall threshold"); SET_STATE(State::Hover, "above fall threshold");
} }
} }
@ -801,8 +801,10 @@ void CharacterController::updateState() {
case State::Hover: case State::Hover:
btScalar horizontalSpeed = (velocity - velocity.dot(_currentUp) * _currentUp).length(); btScalar horizontalSpeed = (velocity - velocity.dot(_currentUp) * _currentUp).length();
bool flyingFast = horizontalSpeed > (MAX_WALKING_SPEED * 0.75f); bool flyingFast = horizontalSpeed > (MAX_WALKING_SPEED * 0.75f);
if (!_flyingAllowed) { if (!_zoneFlyingAllowed) {
SET_STATE(State::InAir, "flying not allowed"); SET_STATE(State::InAir, "zone flying not allowed");
} else if (!_comfortFlyingAllowed && (rayHasHit || _hasSupport || _floorDistance < FLY_TO_GROUND_THRESHOLD)) {
SET_STATE(State::InAir, "comfort flying not allowed");
} else if ((_floorDistance < MIN_HOVER_HEIGHT) && !jumpButtonHeld && !flyingFast) { } else if ((_floorDistance < MIN_HOVER_HEIGHT) && !jumpButtonHeld && !flyingFast) {
SET_STATE(State::InAir, "near ground"); SET_STATE(State::InAir, "near ground");
} else if (((_floorDistance < FLY_TO_GROUND_THRESHOLD) || _hasSupport) && !flyingFast) { } else if (((_floorDistance < FLY_TO_GROUND_THRESHOLD) || _hasSupport) && !flyingFast) {
@ -847,12 +849,6 @@ bool CharacterController::getRigidBodyLocation(glm::vec3& avatarRigidBodyPositio
return true; return true;
} }
void CharacterController::setFlyingAllowed(bool value) {
if (value != _flyingAllowed) {
_flyingAllowed = value;
}
}
void CharacterController::setCollisionlessAllowed(bool value) { void CharacterController::setCollisionlessAllowed(bool value) {
if (value != _collisionlessAllowed) { if (value != _collisionlessAllowed) {
_collisionlessAllowed = value; _collisionlessAllowed = value;

View file

@ -65,10 +65,10 @@ public:
// overrides from btCharacterControllerInterface // overrides from btCharacterControllerInterface
virtual void setWalkDirection(const btVector3 &walkDirection) override { assert(false); } virtual void setWalkDirection(const btVector3 &walkDirection) override { assert(false); }
virtual void setVelocityForTimeInterval(const btVector3 &velocity, btScalar timeInterval) override { assert(false); } virtual void setVelocityForTimeInterval(const btVector3 &velocity, btScalar timeInterval) override { assert(false); }
virtual void reset(btCollisionWorld* collisionWorld) override { } virtual void reset(btCollisionWorld* collisionWorld) override {}
virtual void warp(const btVector3& origin) override { } virtual void warp(const btVector3& origin) override {}
virtual void debugDraw(btIDebugDraw* debugDrawer) override { } virtual void debugDraw(btIDebugDraw* debugDrawer) override {}
virtual void setUpInterpolate(bool value) override { } virtual void setUpInterpolate(bool value) override {}
virtual void updateAction(btCollisionWorld* collisionWorld, btScalar deltaTime) override; virtual void updateAction(btCollisionWorld* collisionWorld, btScalar deltaTime) override;
virtual void preStep(btCollisionWorld *collisionWorld) override; virtual void preStep(btCollisionWorld *collisionWorld) override;
virtual void playerStep(btCollisionWorld *collisionWorld, btScalar dt) override; virtual void playerStep(btCollisionWorld *collisionWorld, btScalar dt) override;
@ -90,7 +90,7 @@ public:
void preSimulation(); void preSimulation();
void postSimulation(); void postSimulation();
void setPositionAndOrientation( const glm::vec3& position, const glm::quat& orientation); void setPositionAndOrientation(const glm::vec3& position, const glm::quat& orientation);
void getPositionAndOrientation(glm::vec3& position, glm::quat& rotation) const; void getPositionAndOrientation(glm::vec3& position, glm::quat& rotation) const;
void setParentVelocity(const glm::vec3& parentVelocity); void setParentVelocity(const glm::vec3& parentVelocity);
@ -129,7 +129,8 @@ public:
bool getRigidBodyLocation(glm::vec3& avatarRigidBodyPosition, glm::quat& avatarRigidBodyRotation); bool getRigidBodyLocation(glm::vec3& avatarRigidBodyPosition, glm::quat& avatarRigidBodyRotation);
void setFlyingAllowed(bool value); void setZoneFlyingAllowed(bool value) { _zoneFlyingAllowed = value; }
void setComfortFlyingAllowed(bool value) { _comfortFlyingAllowed = value; }
void setCollisionlessAllowed(bool value); void setCollisionlessAllowed(bool value);
void setPendingFlagsUpdateCollisionMask(){ _pendingFlags |= PENDING_FLAG_UPDATE_COLLISION_MASK; } void setPendingFlagsUpdateCollisionMask(){ _pendingFlags |= PENDING_FLAG_UPDATE_COLLISION_MASK; }
@ -212,7 +213,8 @@ protected:
uint32_t _pendingFlags { 0 }; uint32_t _pendingFlags { 0 };
uint32_t _previousFlags { 0 }; uint32_t _previousFlags { 0 };
bool _flyingAllowed { true }; bool _zoneFlyingAllowed { true };
bool _comfortFlyingAllowed { true };
bool _collisionlessAllowed { true }; bool _collisionlessAllowed { true };
bool _collisionless { false }; bool _collisionless { false };

View file

@ -325,6 +325,11 @@
leftMargin: domainNameLeftMargin leftMargin: domainNameLeftMargin
}; };
// check to be sure we are going to look for an actual domain
if (!domain) {
doRequest = false;
}
if (doRequest) { if (doRequest) {
var url = Account.metaverseServerURL + '/api/v1/places/' + domain; var url = Account.metaverseServerURL + '/api/v1/places/' + domain;
request({ request({