mirror of
https://github.com/overte-org/overte.git
synced 2025-04-14 21:08:53 +02:00
Merge branch 'master' of https://github.com/highfidelity/hifi into project-freeloco
This commit is contained in:
commit
a093fe5c4f
16 changed files with 148 additions and 158 deletions
domain-server/src
interface/src
libraries
animation/src
entities-renderer/src
graphics/src/graphics
networking/src
physics/src
render-utils/src
scripts/system
|
@ -2548,7 +2548,7 @@ bool DomainServer::processPendingContent(HTTPConnection* connection, QString ite
|
|||
_pendingFileContent.seek(_pendingFileContent.size());
|
||||
_pendingFileContent.write(dataChunk);
|
||||
_pendingFileContent.close();
|
||||
|
||||
|
||||
// Respond immediately - will timeout if we wait for restore.
|
||||
connection->respond(HTTPConnection::StatusCode200);
|
||||
if (itemName == "restore-file" || itemName == "restore-file-chunk-final" || itemName == "restore-file-chunk-only") {
|
||||
|
|
|
@ -32,6 +32,17 @@ void GrabManager::simulateGrabs() {
|
|||
bool success;
|
||||
SpatiallyNestablePointer grabbedThing = SpatiallyNestable::findByID(grabbedThingID, success);
|
||||
if (success && grabbedThing) {
|
||||
auto entity = std::dynamic_pointer_cast<EntityItem>(grabbedThing);
|
||||
if (entity) {
|
||||
if (entity->getLocked()) {
|
||||
continue; // even if someone else claims to be grabbing it, don't move a locked thing
|
||||
}
|
||||
const GrabPropertyGroup& grabProps = entity->getGrabProperties();
|
||||
if (!grabProps.getGrabbable()) {
|
||||
continue; // even if someone else claims to be grabbing it, don't move non-grabbable
|
||||
}
|
||||
}
|
||||
|
||||
glm::vec3 finalPosition = acc.finalizePosition();
|
||||
glm::quat finalOrientation = acc.finalizeOrientation();
|
||||
grabbedThing->setTransform(createMatFromQuatAndPos(finalOrientation, finalPosition));
|
||||
|
|
|
@ -939,7 +939,8 @@ void MyAvatar::simulate(float deltaTime, bool inView) {
|
|||
bool isPhysicsEnabled = qApp->isPhysicsEnabled();
|
||||
bool zoneAllowsFlying = zoneInteractionProperties.first;
|
||||
bool collisionlessAllowed = zoneInteractionProperties.second;
|
||||
_characterController.setFlyingAllowed((zoneAllowsFlying && _enableFlying) || !isPhysicsEnabled);
|
||||
_characterController.setZoneFlyingAllowed(zoneAllowsFlying || !isPhysicsEnabled);
|
||||
_characterController.setComfortFlyingAllowed(_enableFlying);
|
||||
_characterController.setCollisionlessAllowed(collisionlessAllowed);
|
||||
}
|
||||
|
||||
|
|
|
@ -295,14 +295,14 @@ QString Overlays::overlayToEntityType(const QString& type) {
|
|||
} \
|
||||
}
|
||||
|
||||
static QHash<QUuid, glm::quat> savedRotations = QHash<QUuid, glm::quat>();
|
||||
static QHash<QUuid, std::pair<glm::quat, bool>> savedRotations = QHash<QUuid, std::pair<glm::quat, bool>>();
|
||||
|
||||
EntityItemProperties Overlays::convertOverlayToEntityProperties(QVariantMap& overlayProps, const QString& type, bool add, const QUuid& id) {
|
||||
glm::quat rotation;
|
||||
std::pair<glm::quat, bool> rotation;
|
||||
return convertOverlayToEntityProperties(overlayProps, rotation, type, add, id);
|
||||
}
|
||||
|
||||
EntityItemProperties Overlays::convertOverlayToEntityProperties(QVariantMap& overlayProps, glm::quat& rotationToSave, const QString& type, bool add, const QUuid& id) {
|
||||
EntityItemProperties Overlays::convertOverlayToEntityProperties(QVariantMap& overlayProps, std::pair<glm::quat, bool>& rotationToSave, const QString& type, bool add, const QUuid& id) {
|
||||
overlayProps["type"] = type;
|
||||
|
||||
SET_OVERLAY_PROP_DEFAULT(alpha, 0.7);
|
||||
|
@ -563,65 +563,33 @@ EntityItemProperties Overlays::convertOverlayToEntityProperties(QVariantMap& ove
|
|||
SET_OVERLAY_PROP_DEFAULT(textures, PathUtils::resourcesUrl() + "images/whitePixel.png");
|
||||
}
|
||||
|
||||
{ // Overlays did this conversion for rotation
|
||||
auto iter = overlayProps.find("rotation");
|
||||
if (iter != overlayProps.end() && !overlayProps.contains("localRotation")) {
|
||||
QUuid parentID;
|
||||
{
|
||||
auto iter = overlayProps.find("parentID");
|
||||
if (iter != overlayProps.end()) {
|
||||
parentID = iter.value().toUuid();
|
||||
} else if (!add) {
|
||||
EntityPropertyFlags desiredProperties;
|
||||
desiredProperties += PROP_PARENT_ID;
|
||||
parentID = DependencyManager::get<EntityScriptingInterface>()->getEntityProperties(id, desiredProperties).getParentID();
|
||||
}
|
||||
}
|
||||
|
||||
int parentJointIndex = -1;
|
||||
{
|
||||
auto iter = overlayProps.find("parentJointIndex");
|
||||
if (iter != overlayProps.end()) {
|
||||
parentJointIndex = iter.value().toInt();
|
||||
} else if (!add) {
|
||||
EntityPropertyFlags desiredProperties;
|
||||
desiredProperties += PROP_PARENT_JOINT_INDEX;
|
||||
parentJointIndex = DependencyManager::get<EntityScriptingInterface>()->getEntityProperties(id, desiredProperties).getParentJointIndex();
|
||||
}
|
||||
}
|
||||
|
||||
glm::quat rotation = quatFromVariant(iter.value());
|
||||
bool success = false;
|
||||
glm::quat localRotation = SpatiallyNestable::worldToLocal(rotation, parentID, parentJointIndex, false, success);
|
||||
if (success) {
|
||||
overlayProps["rotation"] = quatToVariant(localRotation);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (type == "Text" || type == "Image" || type == "Grid" || type == "Web") {
|
||||
glm::quat originalRotation = ENTITY_ITEM_DEFAULT_ROTATION;
|
||||
bool local = false;
|
||||
{
|
||||
auto iter = overlayProps.find("rotation");
|
||||
if (iter != overlayProps.end()) {
|
||||
originalRotation = quatFromVariant(iter.value());
|
||||
local = false;
|
||||
} else {
|
||||
iter = overlayProps.find("localRotation");
|
||||
if (iter != overlayProps.end()) {
|
||||
originalRotation = quatFromVariant(iter.value());
|
||||
local = true;
|
||||
} else if (!add) {
|
||||
auto iter2 = savedRotations.find(id);
|
||||
if (iter2 != savedRotations.end()) {
|
||||
originalRotation = iter2.value();
|
||||
originalRotation = iter2.value().first;
|
||||
local = iter2.value().second;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (!add) {
|
||||
savedRotations[id] = originalRotation;
|
||||
savedRotations[id] = { originalRotation, local };
|
||||
} else {
|
||||
rotationToSave = originalRotation;
|
||||
rotationToSave = { originalRotation, local };
|
||||
}
|
||||
|
||||
glm::vec3 dimensions = ENTITY_ITEM_DEFAULT_DIMENSIONS;
|
||||
|
@ -652,7 +620,11 @@ EntityItemProperties Overlays::convertOverlayToEntityProperties(QVariantMap& ove
|
|||
rotation = glm::angleAxis((float)M_PI, rotation * Vectors::UP) * rotation;
|
||||
}
|
||||
|
||||
overlayProps["localRotation"] = quatToVariant(rotation);
|
||||
if (local) {
|
||||
overlayProps["localRotation"] = quatToVariant(rotation);
|
||||
} else {
|
||||
overlayProps["rotation"] = quatToVariant(rotation);
|
||||
}
|
||||
overlayProps["dimensions"] = vec3toVariant(glm::abs(dimensions));
|
||||
}
|
||||
}
|
||||
|
@ -834,7 +806,7 @@ QUuid Overlays::addOverlay(const QString& type, const QVariant& properties) {
|
|||
if (type == "rectangle3d") {
|
||||
propertyMap["shape"] = "Quad";
|
||||
}
|
||||
glm::quat rotationToSave;
|
||||
std::pair<glm::quat, bool> rotationToSave;
|
||||
QUuid id = DependencyManager::get<EntityScriptingInterface>()->addEntityInternal(convertOverlayToEntityProperties(propertyMap, rotationToSave, entityType, true), entity::HostType::LOCAL);
|
||||
if (entityType == "Text" || entityType == "Image" || entityType == "Grid" || entityType == "Web") {
|
||||
savedRotations[id] = rotationToSave;
|
||||
|
|
|
@ -729,7 +729,7 @@ private:
|
|||
|
||||
QVariantMap convertEntityToOverlayProperties(const EntityItemProperties& entityProps);
|
||||
EntityItemProperties convertOverlayToEntityProperties(QVariantMap& overlayProps, const QString& type, bool add, const QUuid& id);
|
||||
EntityItemProperties convertOverlayToEntityProperties(QVariantMap& overlayProps, glm::quat& rotationToSave, const QString& type, bool add, const QUuid& id = QUuid());
|
||||
EntityItemProperties convertOverlayToEntityProperties(QVariantMap& overlayProps, std::pair<glm::quat, bool>& rotationToSave, const QString& type, bool add, const QUuid& id = QUuid());
|
||||
|
||||
private slots:
|
||||
void mousePressPointerEvent(const QUuid& id, const PointerEvent& event);
|
||||
|
|
|
@ -1066,13 +1066,6 @@ void Rig::computeMotionAnimationState(float deltaTime, const glm::vec3& worldPos
|
|||
|
||||
if (_enableInverseKinematics) {
|
||||
_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 {
|
||||
_animVars.set("ikOverlayAlpha", 0.0f);
|
||||
_animVars.set("splineIKEnabled", false);
|
||||
|
|
|
@ -53,7 +53,7 @@ bool ShapeEntityRenderer::needsRenderUpdate() const {
|
|||
}
|
||||
|
||||
auto mat = _materials.find("0");
|
||||
if (mat != _materials.end() && (mat->second.needsUpdate() || mat->second.areTexturesLoading())) {
|
||||
if (mat != _materials.end() && mat->second.shouldUpdate()) {
|
||||
return true;
|
||||
}
|
||||
|
||||
|
@ -188,7 +188,7 @@ bool ShapeEntityRenderer::useMaterialPipeline(const graphics::MultiMaterial& mat
|
|||
|
||||
ShapeKey ShapeEntityRenderer::getShapeKey() {
|
||||
auto mat = _materials.find("0");
|
||||
if (mat != _materials.end() && (mat->second.needsUpdate() || mat->second.areTexturesLoading())) {
|
||||
if (mat != _materials.end() && mat->second.shouldUpdate()) {
|
||||
RenderPipelines::updateMultiMaterial(mat->second);
|
||||
}
|
||||
|
||||
|
|
|
@ -101,21 +101,15 @@ bool WebEntityRenderer::isTransparent() const {
|
|||
}
|
||||
|
||||
bool WebEntityRenderer::needsRenderUpdateFromTypedEntity(const TypedEntityPointer& entity) const {
|
||||
if (_contextPosition != entity->getWorldPosition()) {
|
||||
return true;
|
||||
}
|
||||
|
||||
{
|
||||
QSharedPointer<OffscreenQmlSurface> webSurface;
|
||||
withReadLock([&] {
|
||||
webSurface = _webSurface;
|
||||
});
|
||||
if (webSurface && uvec2(getWindowSize(entity)) != toGlm(webSurface->size())) {
|
||||
if (resultWithReadLock<bool>([&] {
|
||||
if (_webSurface && uvec2(getWindowSize(entity)) != toGlm(_webSurface->size())) {
|
||||
return true;
|
||||
}
|
||||
|
||||
if (_contextPosition != entity->getWorldPosition()) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
if(resultWithReadLock<bool>([&] {
|
||||
if (_color != entity->getColor()) {
|
||||
return true;
|
||||
}
|
||||
|
@ -194,7 +188,7 @@ void WebEntityRenderer::doRenderUpdateSynchronousTyped(const ScenePointer& scene
|
|||
auto newContentType = getContentType(newSourceURL);
|
||||
ContentType currentContentType;
|
||||
withReadLock([&] {
|
||||
urlChanged = _sourceURL != newSourceURL;
|
||||
urlChanged = newSourceURL.isEmpty() || newSourceURL != _tryingToBuildURL;
|
||||
});
|
||||
currentContentType = _contentType;
|
||||
|
||||
|
@ -206,7 +200,6 @@ void WebEntityRenderer::doRenderUpdateSynchronousTyped(const ScenePointer& scene
|
|||
}
|
||||
}
|
||||
|
||||
|
||||
withWriteLock([&] {
|
||||
_inputMode = entity->getInputMode();
|
||||
_dpi = entity->getDPI();
|
||||
|
@ -216,6 +209,8 @@ void WebEntityRenderer::doRenderUpdateSynchronousTyped(const ScenePointer& scene
|
|||
_billboardMode = entity->getBillboardMode();
|
||||
|
||||
if (_contentType == ContentType::NoContent) {
|
||||
_tryingToBuildURL = newSourceURL;
|
||||
_sourceURL = newSourceURL;
|
||||
return;
|
||||
}
|
||||
|
||||
|
@ -226,10 +221,12 @@ void WebEntityRenderer::doRenderUpdateSynchronousTyped(const ScenePointer& scene
|
|||
|
||||
if (_webSurface) {
|
||||
if (_webSurface->getRootItem()) {
|
||||
if (_contentType == ContentType::HtmlContent && urlChanged) {
|
||||
if (_contentType == ContentType::HtmlContent && _sourceURL != newSourceURL) {
|
||||
_webSurface->getRootItem()->setProperty(URL_PROPERTY, newSourceURL);
|
||||
_sourceURL = newSourceURL;
|
||||
} else if (_contentType != ContentType::HtmlContent) {
|
||||
_sourceURL = newSourceURL;
|
||||
}
|
||||
_sourceURL = newSourceURL;
|
||||
|
||||
{
|
||||
auto scriptURL = entity->getScriptURL();
|
||||
|
@ -294,20 +291,21 @@ void WebEntityRenderer::doRender(RenderArgs* args) {
|
|||
});
|
||||
|
||||
// Try to update the texture
|
||||
{
|
||||
QSharedPointer<OffscreenQmlSurface> webSurface;
|
||||
withReadLock([&] {
|
||||
webSurface = _webSurface;
|
||||
});
|
||||
if (!webSurface) {
|
||||
return;
|
||||
OffscreenQmlSurface::TextureAndFence newTextureAndFence;
|
||||
bool newTextureAvailable = false;
|
||||
if (!resultWithReadLock<bool>([&] {
|
||||
if (!_webSurface) {
|
||||
return false;
|
||||
}
|
||||
|
||||
OffscreenQmlSurface::TextureAndFence newTextureAndFence;
|
||||
bool newTextureAvailable = webSurface->fetchTexture(newTextureAndFence);
|
||||
if (newTextureAvailable) {
|
||||
_texture->setExternalTexture(newTextureAndFence.first, newTextureAndFence.second);
|
||||
}
|
||||
newTextureAvailable = _webSurface->fetchTexture(newTextureAndFence);
|
||||
return true;
|
||||
})) {
|
||||
return;
|
||||
}
|
||||
|
||||
if (newTextureAvailable) {
|
||||
_texture->setExternalTexture(newTextureAndFence.first, newTextureAndFence.second);
|
||||
}
|
||||
|
||||
static const glm::vec2 texMin(0.0f), texMax(1.0f), topLeft(-0.5f), bottomRight(0.5f);
|
||||
|
@ -351,6 +349,8 @@ void WebEntityRenderer::buildWebSurface(const EntityItemPointer& entity, const Q
|
|||
_connections.push_back(QObject::connect(_webSurface.data(), &OffscreenQmlSurface::webEventReceived, this, [entityItemID](const QVariant& message) {
|
||||
emit DependencyManager::get<EntityScriptingInterface>()->webEventReceived(entityItemID, message);
|
||||
}));
|
||||
|
||||
_tryingToBuildURL = newSourceURL;
|
||||
}
|
||||
|
||||
void WebEntityRenderer::destroyWebSurface() {
|
||||
|
@ -383,11 +383,16 @@ glm::vec2 WebEntityRenderer::getWindowSize(const TypedEntityPointer& entity) con
|
|||
void WebEntityRenderer::hoverEnterEntity(const PointerEvent& event) {
|
||||
if (_inputMode == WebInputMode::MOUSE) {
|
||||
handlePointerEvent(event);
|
||||
} else if (_webSurface) {
|
||||
PointerEvent webEvent = event;
|
||||
webEvent.setPos2D(event.getPos2D() * (METERS_TO_INCHES * _dpi));
|
||||
_webSurface->hoverBeginEvent(webEvent, _touchDevice);
|
||||
return;
|
||||
}
|
||||
|
||||
withReadLock([&] {
|
||||
if (_webSurface) {
|
||||
PointerEvent webEvent = event;
|
||||
webEvent.setPos2D(event.getPos2D() * (METERS_TO_INCHES * _dpi));
|
||||
_webSurface->hoverBeginEvent(webEvent, _touchDevice);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
void WebEntityRenderer::hoverLeaveEntity(const PointerEvent& event) {
|
||||
|
@ -398,34 +403,39 @@ void WebEntityRenderer::hoverLeaveEntity(const PointerEvent& event) {
|
|||
// QML onReleased is only triggered if a click has happened first. We need to send this "fake" mouse move event to properly trigger an onExited.
|
||||
PointerEvent endMoveEvent(PointerEvent::Move, event.getID());
|
||||
handlePointerEvent(endMoveEvent);
|
||||
} else if (_webSurface) {
|
||||
PointerEvent webEvent = event;
|
||||
webEvent.setPos2D(event.getPos2D() * (METERS_TO_INCHES * _dpi));
|
||||
_webSurface->hoverEndEvent(webEvent, _touchDevice);
|
||||
}
|
||||
}
|
||||
|
||||
void WebEntityRenderer::handlePointerEvent(const PointerEvent& event) {
|
||||
if (_inputMode == WebInputMode::TOUCH) {
|
||||
handlePointerEventAsTouch(event);
|
||||
} else {
|
||||
handlePointerEventAsMouse(event);
|
||||
}
|
||||
}
|
||||
|
||||
void WebEntityRenderer::handlePointerEventAsTouch(const PointerEvent& event) {
|
||||
if (_webSurface) {
|
||||
PointerEvent webEvent = event;
|
||||
webEvent.setPos2D(event.getPos2D() * (METERS_TO_INCHES * _dpi));
|
||||
_webSurface->handlePointerEvent(webEvent, _touchDevice);
|
||||
}
|
||||
}
|
||||
|
||||
void WebEntityRenderer::handlePointerEventAsMouse(const PointerEvent& event) {
|
||||
if (!_webSurface) {
|
||||
return;
|
||||
}
|
||||
|
||||
withReadLock([&] {
|
||||
if (_webSurface) {
|
||||
PointerEvent webEvent = event;
|
||||
webEvent.setPos2D(event.getPos2D() * (METERS_TO_INCHES * _dpi));
|
||||
_webSurface->hoverEndEvent(webEvent, _touchDevice);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
void WebEntityRenderer::handlePointerEvent(const PointerEvent& event) {
|
||||
withReadLock([&] {
|
||||
if (!_webSurface) {
|
||||
return;
|
||||
}
|
||||
|
||||
if (_inputMode == WebInputMode::TOUCH) {
|
||||
handlePointerEventAsTouch(event);
|
||||
} else {
|
||||
handlePointerEventAsMouse(event);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
void WebEntityRenderer::handlePointerEventAsTouch(const PointerEvent& event) {
|
||||
PointerEvent webEvent = event;
|
||||
webEvent.setPos2D(event.getPos2D() * (METERS_TO_INCHES * _dpi));
|
||||
_webSurface->handlePointerEvent(webEvent, _touchDevice);
|
||||
}
|
||||
|
||||
void WebEntityRenderer::handlePointerEventAsMouse(const PointerEvent& event) {
|
||||
glm::vec2 windowPos = event.getPos2D() * (METERS_TO_INCHES * _dpi);
|
||||
QPointF windowPoint(windowPos.x, windowPos.y);
|
||||
|
||||
|
@ -459,16 +469,20 @@ void WebEntityRenderer::handlePointerEventAsMouse(const PointerEvent& event) {
|
|||
}
|
||||
|
||||
void WebEntityRenderer::setProxyWindow(QWindow* proxyWindow) {
|
||||
if (_webSurface) {
|
||||
_webSurface->setProxyWindow(proxyWindow);
|
||||
}
|
||||
withReadLock([&] {
|
||||
if (_webSurface) {
|
||||
_webSurface->setProxyWindow(proxyWindow);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
QObject* WebEntityRenderer::getEventHandler() {
|
||||
if (!_webSurface) {
|
||||
return nullptr;
|
||||
}
|
||||
return _webSurface->getEventHandler();
|
||||
return resultWithReadLock<QObject*>([&]() -> QObject* {
|
||||
if (!_webSurface) {
|
||||
return nullptr;
|
||||
}
|
||||
return _webSurface->getEventHandler();
|
||||
});
|
||||
}
|
||||
|
||||
void WebEntityRenderer::emitScriptEvent(const QVariant& message) {
|
||||
|
|
|
@ -82,6 +82,7 @@ private:
|
|||
QSharedPointer<OffscreenQmlSurface> _webSurface { nullptr };
|
||||
bool _cachedWebSurface { false };
|
||||
gpu::TexturePointer _texture;
|
||||
QString _tryingToBuildURL;
|
||||
|
||||
glm::u8vec3 _color;
|
||||
float _alpha { 1.0f };
|
||||
|
|
|
@ -456,11 +456,11 @@ public:
|
|||
graphics::MaterialKey getMaterialKey() const { return graphics::MaterialKey(_schemaBuffer.get<graphics::MultiMaterial::Schema>()._key); }
|
||||
const gpu::TextureTablePointer& getTextureTable() const { return _textureTable; }
|
||||
|
||||
bool needsUpdate() const { return _needsUpdate; }
|
||||
void setNeedsUpdate(bool needsUpdate) { _needsUpdate = needsUpdate; }
|
||||
|
||||
void setTexturesLoading(bool value) { _texturesLoading = value; }
|
||||
bool areTexturesLoading() const { return _texturesLoading; }
|
||||
void setInitialized() { _initialized = true; }
|
||||
|
||||
bool shouldUpdate() const { return !_initialized || _needsUpdate || _texturesLoading; }
|
||||
|
||||
int getTextureCount() const { calculateMaterialInfo(); return _textureCount; }
|
||||
size_t getTextureSize() const { calculateMaterialInfo(); return _textureSize; }
|
||||
|
@ -471,6 +471,7 @@ private:
|
|||
gpu::TextureTablePointer _textureTable { std::make_shared<gpu::TextureTable>() };
|
||||
bool _needsUpdate { false };
|
||||
bool _texturesLoading { false };
|
||||
bool _initialized { false };
|
||||
|
||||
mutable size_t _textureSize { 0 };
|
||||
mutable int _textureCount { 0 };
|
||||
|
|
|
@ -315,7 +315,9 @@ bool AddressManager::handleUrl(const QUrl& lookupUrl, LookupTrigger trigger) {
|
|||
|
||||
// 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
|
||||
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)
|
||||
// lookupUrl.scheme() == URL_SCHEME_HTTP ||
|
||||
// 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.
|
||||
|
||||
_previousAPILookup.clear();
|
||||
|
|
|
@ -781,18 +781,18 @@ void CharacterController::updateState() {
|
|||
const float jumpSpeed = sqrtf(2.0f * -DEFAULT_AVATAR_GRAVITY * jumpHeight);
|
||||
if ((velocity.dot(_currentUp) <= (jumpSpeed / 2.0f)) && ((_floorDistance < FLY_TO_GROUND_THRESHOLD) || _hasSupport)) {
|
||||
SET_STATE(State::Ground, "hit ground");
|
||||
} else if (_flyingAllowed) {
|
||||
} else if (_zoneFlyingAllowed) {
|
||||
btVector3 desiredVelocity = _targetVelocity;
|
||||
if (desiredVelocity.length2() < MIN_TARGET_SPEED_SQUARED) {
|
||||
desiredVelocity = btVector3(0.0f, 0.0f, 0.0f);
|
||||
}
|
||||
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");
|
||||
} 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");
|
||||
} else if (_floorDistance > _scaleFactor * DEFAULT_AVATAR_FALL_HEIGHT) {
|
||||
// Transition to hover if we are above the fall threshold
|
||||
} else if ((!rayHasHit && !_hasSupport) || _floorDistance > _scaleFactor * DEFAULT_AVATAR_FALL_HEIGHT) {
|
||||
// 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");
|
||||
}
|
||||
}
|
||||
|
@ -801,8 +801,10 @@ void CharacterController::updateState() {
|
|||
case State::Hover:
|
||||
btScalar horizontalSpeed = (velocity - velocity.dot(_currentUp) * _currentUp).length();
|
||||
bool flyingFast = horizontalSpeed > (MAX_WALKING_SPEED * 0.75f);
|
||||
if (!_flyingAllowed) {
|
||||
SET_STATE(State::InAir, "flying not allowed");
|
||||
if (!_zoneFlyingAllowed) {
|
||||
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) {
|
||||
SET_STATE(State::InAir, "near ground");
|
||||
} else if (((_floorDistance < FLY_TO_GROUND_THRESHOLD) || _hasSupport) && !flyingFast) {
|
||||
|
@ -847,12 +849,6 @@ bool CharacterController::getRigidBodyLocation(glm::vec3& avatarRigidBodyPositio
|
|||
return true;
|
||||
}
|
||||
|
||||
void CharacterController::setFlyingAllowed(bool value) {
|
||||
if (value != _flyingAllowed) {
|
||||
_flyingAllowed = value;
|
||||
}
|
||||
}
|
||||
|
||||
void CharacterController::setCollisionlessAllowed(bool value) {
|
||||
if (value != _collisionlessAllowed) {
|
||||
_collisionlessAllowed = value;
|
||||
|
|
|
@ -65,10 +65,10 @@ public:
|
|||
// overrides from btCharacterControllerInterface
|
||||
virtual void setWalkDirection(const btVector3 &walkDirection) override { assert(false); }
|
||||
virtual void setVelocityForTimeInterval(const btVector3 &velocity, btScalar timeInterval) override { assert(false); }
|
||||
virtual void reset(btCollisionWorld* collisionWorld) override { }
|
||||
virtual void warp(const btVector3& origin) override { }
|
||||
virtual void debugDraw(btIDebugDraw* debugDrawer) override { }
|
||||
virtual void setUpInterpolate(bool value) override { }
|
||||
virtual void reset(btCollisionWorld* collisionWorld) override {}
|
||||
virtual void warp(const btVector3& origin) override {}
|
||||
virtual void debugDraw(btIDebugDraw* debugDrawer) override {}
|
||||
virtual void setUpInterpolate(bool value) override {}
|
||||
virtual void updateAction(btCollisionWorld* collisionWorld, btScalar deltaTime) override;
|
||||
virtual void preStep(btCollisionWorld *collisionWorld) override;
|
||||
virtual void playerStep(btCollisionWorld *collisionWorld, btScalar dt) override;
|
||||
|
@ -90,7 +90,7 @@ public:
|
|||
void preSimulation();
|
||||
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 setParentVelocity(const glm::vec3& parentVelocity);
|
||||
|
@ -129,7 +129,8 @@ public:
|
|||
|
||||
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 setPendingFlagsUpdateCollisionMask(){ _pendingFlags |= PENDING_FLAG_UPDATE_COLLISION_MASK; }
|
||||
|
@ -212,7 +213,8 @@ protected:
|
|||
uint32_t _pendingFlags { 0 };
|
||||
uint32_t _previousFlags { 0 };
|
||||
|
||||
bool _flyingAllowed { true };
|
||||
bool _zoneFlyingAllowed { true };
|
||||
bool _comfortFlyingAllowed { true };
|
||||
bool _collisionlessAllowed { true };
|
||||
bool _collisionless { false };
|
||||
|
||||
|
|
|
@ -83,7 +83,7 @@ void MeshPartPayload::updateKey(const render::ItemKey& key) {
|
|||
ItemKey::Builder builder(key);
|
||||
builder.withTypeShape();
|
||||
|
||||
if (_drawMaterials.needsUpdate() || _drawMaterials.areTexturesLoading()) {
|
||||
if (_drawMaterials.shouldUpdate()) {
|
||||
RenderPipelines::updateMultiMaterial(_drawMaterials);
|
||||
}
|
||||
|
||||
|
@ -329,7 +329,7 @@ void ModelMeshPartPayload::updateKey(const render::ItemKey& key) {
|
|||
builder.withDeformed();
|
||||
}
|
||||
|
||||
if (_drawMaterials.needsUpdate() || _drawMaterials.areTexturesLoading()) {
|
||||
if (_drawMaterials.shouldUpdate()) {
|
||||
RenderPipelines::updateMultiMaterial(_drawMaterials);
|
||||
}
|
||||
|
||||
|
@ -347,7 +347,7 @@ void ModelMeshPartPayload::setShapeKey(bool invalidateShapeKey, PrimitiveMode pr
|
|||
return;
|
||||
}
|
||||
|
||||
if (_drawMaterials.needsUpdate() || _drawMaterials.areTexturesLoading()) {
|
||||
if (_drawMaterials.shouldUpdate()) {
|
||||
RenderPipelines::updateMultiMaterial(_drawMaterials);
|
||||
}
|
||||
|
||||
|
|
|
@ -382,11 +382,6 @@ void RenderPipelines::bindMaterial(graphics::MaterialPointer& material, gpu::Bat
|
|||
void RenderPipelines::updateMultiMaterial(graphics::MultiMaterial& multiMaterial) {
|
||||
auto& schemaBuffer = multiMaterial.getSchemaBuffer();
|
||||
|
||||
if (multiMaterial.size() == 0) {
|
||||
schemaBuffer.edit<graphics::MultiMaterial::Schema>() = graphics::MultiMaterial::Schema();
|
||||
return;
|
||||
}
|
||||
|
||||
auto& drawMaterialTextures = multiMaterial.getTextureTable();
|
||||
multiMaterial.setTexturesLoading(false);
|
||||
|
||||
|
@ -732,14 +727,11 @@ void RenderPipelines::updateMultiMaterial(graphics::MultiMaterial& multiMaterial
|
|||
schema._key = (uint32_t)schemaKey._flags.to_ulong();
|
||||
schemaBuffer.edit<graphics::MultiMaterial::Schema>() = schema;
|
||||
multiMaterial.setNeedsUpdate(false);
|
||||
multiMaterial.setInitialized();
|
||||
}
|
||||
|
||||
void RenderPipelines::bindMaterials(graphics::MultiMaterial& multiMaterial, gpu::Batch& batch, bool enableTextures) {
|
||||
if (multiMaterial.size() == 0) {
|
||||
return;
|
||||
}
|
||||
|
||||
if (multiMaterial.needsUpdate() || multiMaterial.areTexturesLoading()) {
|
||||
if (multiMaterial.shouldUpdate()) {
|
||||
updateMultiMaterial(multiMaterial);
|
||||
}
|
||||
|
||||
|
|
|
@ -325,6 +325,11 @@
|
|||
leftMargin: domainNameLeftMargin
|
||||
};
|
||||
|
||||
// check to be sure we are going to look for an actual domain
|
||||
if (!domain) {
|
||||
doRequest = false;
|
||||
}
|
||||
|
||||
if (doRequest) {
|
||||
var url = Account.metaverseServerURL + '/api/v1/places/' + domain;
|
||||
request({
|
||||
|
|
Loading…
Reference in a new issue