mirror of
https://github.com/overte-org/overte.git
synced 2025-06-22 13:41:49 +02:00
Merge pull request #4 from danteruiz/interstitialMerged
Interstitial screen updates
This commit is contained in:
commit
8f36bc0850
5 changed files with 23 additions and 13 deletions
|
@ -14,7 +14,7 @@
|
||||||
#include <SharedUtil.h>
|
#include <SharedUtil.h>
|
||||||
|
|
||||||
#include "EntityTreeRenderer.h"
|
#include "EntityTreeRenderer.h"
|
||||||
#include "ModelEntityItem.h"
|
#include "RenderableModelEntityItem.h"
|
||||||
#include "InterfaceLogging.h"
|
#include "InterfaceLogging.h"
|
||||||
#include "Application.h"
|
#include "Application.h"
|
||||||
|
|
||||||
|
@ -123,19 +123,18 @@ bool SafeLanding::isLoadSequenceComplete() {
|
||||||
|
|
||||||
float SafeLanding::loadingProgressPercentage() {
|
float SafeLanding::loadingProgressPercentage() {
|
||||||
Locker lock(_lock);
|
Locker lock(_lock);
|
||||||
|
|
||||||
static const int MINIMUM_TRACKED_ENTITY_STABILITY_COUNT = 15;
|
static const int MINIMUM_TRACKED_ENTITY_STABILITY_COUNT = 15;
|
||||||
|
|
||||||
float percentage = 0.0f;
|
float entityReadyPercentage = 0.0f;
|
||||||
if (_maxTrackedEntityCount > 0) {
|
if (_maxTrackedEntityCount > 0) {
|
||||||
percentage = ((_maxTrackedEntityCount - _trackedEntities.size()) / (float)_maxTrackedEntityCount);
|
entityReadyPercentage = ((_maxTrackedEntityCount - _trackedEntities.size()) / (float)_maxTrackedEntityCount);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (_trackedEntityStabilityCount < MINIMUM_TRACKED_ENTITY_STABILITY_COUNT) {
|
if (_trackedEntityStabilityCount < MINIMUM_TRACKED_ENTITY_STABILITY_COUNT) {
|
||||||
percentage *= 0.20f;
|
entityReadyPercentage *= 0.20f;
|
||||||
}
|
}
|
||||||
|
|
||||||
return percentage;
|
return entityReadyPercentage;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool SafeLanding::isSequenceNumbersComplete() {
|
bool SafeLanding::isSequenceNumbersComplete() {
|
||||||
|
@ -148,7 +147,7 @@ bool SafeLanding::isSequenceNumbersComplete() {
|
||||||
if (sequenceSize == 0 ||
|
if (sequenceSize == 0 ||
|
||||||
(startIter != _sequenceNumbers.end()
|
(startIter != _sequenceNumbers.end()
|
||||||
&& endIter != _sequenceNumbers.end()
|
&& endIter != _sequenceNumbers.end()
|
||||||
&& distance(startIter, endIter) == sequenceSize - 1) ) {
|
&& distance(startIter, endIter) == sequenceSize - 1)) {
|
||||||
_trackingEntities = false; // Don't track anything else that comes in.
|
_trackingEntities = false; // Don't track anything else that comes in.
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
@ -160,13 +159,13 @@ bool isEntityPhysicsReady(const EntityItemPointer& entity) {
|
||||||
if (entity && !entity->getCollisionless()) {
|
if (entity && !entity->getCollisionless()) {
|
||||||
const auto& entityType = entity->getType();
|
const auto& entityType = entity->getType();
|
||||||
if (entityType == EntityTypes::Model) {
|
if (entityType == EntityTypes::Model) {
|
||||||
ModelEntityItem * modelEntity = std::dynamic_pointer_cast<ModelEntityItem>(entity).get();
|
RenderableModelEntityItem * modelEntity = std::dynamic_pointer_cast<RenderableModelEntityItem>(entity).get();
|
||||||
static const std::set<ShapeType> downloadedCollisionTypes
|
static const std::set<ShapeType> downloadedCollisionTypes
|
||||||
{ SHAPE_TYPE_COMPOUND, SHAPE_TYPE_SIMPLE_COMPOUND, SHAPE_TYPE_STATIC_MESH, SHAPE_TYPE_SIMPLE_HULL };
|
{ SHAPE_TYPE_COMPOUND, SHAPE_TYPE_SIMPLE_COMPOUND, SHAPE_TYPE_STATIC_MESH, SHAPE_TYPE_SIMPLE_HULL };
|
||||||
bool hasAABox;
|
bool hasAABox;
|
||||||
entity->getAABox(hasAABox);
|
entity->getAABox(hasAABox);
|
||||||
if (hasAABox && downloadedCollisionTypes.count(modelEntity->getShapeType()) != 0) {
|
if (hasAABox && downloadedCollisionTypes.count(modelEntity->getShapeType()) != 0) {
|
||||||
return (!entity->shouldBePhysical() || entity->isReadyToComputeShape());
|
return (!entity->shouldBePhysical() || entity->isReadyToComputeShape() || modelEntity->computeShapeFailedToLoad());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -192,8 +191,6 @@ bool SafeLanding::isEntityLoadingComplete() {
|
||||||
|
|
||||||
if (enableInterstitial) {
|
if (enableInterstitial) {
|
||||||
isVisuallyReady = (entity->isVisuallyReady() || !entityTree->renderableForEntityId(entityMapIter->first));
|
isVisuallyReady = (entity->isVisuallyReady() || !entityTree->renderableForEntityId(entityMapIter->first));
|
||||||
|
|
||||||
qDebug() << "EntityTpye" << EntityTypes::getEntityTypeName(entity->getType()) << entity->getEntityItemID() << isVisuallyReady;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if (isEntityPhysicsReady(entity) && isVisuallyReady) {
|
if (isEntityPhysicsReady(entity) && isVisuallyReady) {
|
||||||
|
@ -209,7 +206,6 @@ bool SafeLanding::isEntityLoadingComplete() {
|
||||||
|
|
||||||
if (enableInterstitial) {
|
if (enableInterstitial) {
|
||||||
_trackedEntityStabilityCount++;
|
_trackedEntityStabilityCount++;
|
||||||
qDebug() << "EntityList size" << _trackedEntities.size() << "\n";
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -314,6 +314,14 @@ void RenderableModelEntityItem::getCollisionGeometryResource() {
|
||||||
_compoundShapeResource = DependencyManager::get<ModelCache>()->getCollisionGeometryResource(hullURL);
|
_compoundShapeResource = DependencyManager::get<ModelCache>()->getCollisionGeometryResource(hullURL);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
bool RenderableModelEntityItem::computeShapeFailedToLoad() {
|
||||||
|
if (!_compoundShapeResource) {
|
||||||
|
getCollisionGeometryResource();
|
||||||
|
}
|
||||||
|
|
||||||
|
return (_compoundShapeResource && _compoundShapeResource->isFailed());
|
||||||
|
}
|
||||||
|
|
||||||
void RenderableModelEntityItem::setShapeType(ShapeType type) {
|
void RenderableModelEntityItem::setShapeType(ShapeType type) {
|
||||||
ModelEntityItem::setShapeType(type);
|
ModelEntityItem::setShapeType(type);
|
||||||
if (getShapeType() == SHAPE_TYPE_COMPOUND) {
|
if (getShapeType() == SHAPE_TYPE_COMPOUND) {
|
||||||
|
@ -342,7 +350,6 @@ void RenderableModelEntityItem::setCompoundShapeURL(const QString& url) {
|
||||||
|
|
||||||
bool RenderableModelEntityItem::isReadyToComputeShape() const {
|
bool RenderableModelEntityItem::isReadyToComputeShape() const {
|
||||||
ShapeType type = getShapeType();
|
ShapeType type = getShapeType();
|
||||||
|
|
||||||
auto model = getModel();
|
auto model = getModel();
|
||||||
if (type == SHAPE_TYPE_COMPOUND) {
|
if (type == SHAPE_TYPE_COMPOUND) {
|
||||||
if (!model || getCompoundShapeURL().isEmpty()) {
|
if (!model || getCompoundShapeURL().isEmpty()) {
|
||||||
|
|
|
@ -81,6 +81,7 @@ public:
|
||||||
|
|
||||||
virtual bool isReadyToComputeShape() const override;
|
virtual bool isReadyToComputeShape() const override;
|
||||||
virtual void computeShapeInfo(ShapeInfo& shapeInfo) override;
|
virtual void computeShapeInfo(ShapeInfo& shapeInfo) override;
|
||||||
|
bool computeShapeFailedToLoad();
|
||||||
|
|
||||||
virtual bool contains(const glm::vec3& point) const override;
|
virtual bool contains(const glm::vec3& point) const override;
|
||||||
void stopModelOverrideIfNoParent();
|
void stopModelOverrideIfNoParent();
|
||||||
|
|
|
@ -551,6 +551,11 @@ QUrl NetworkMaterial::getTextureUrl(const QUrl& baseUrl, const FBXTexture& textu
|
||||||
|
|
||||||
graphics::TextureMapPointer NetworkMaterial::fetchTextureMap(const QUrl& baseUrl, const FBXTexture& fbxTexture,
|
graphics::TextureMapPointer NetworkMaterial::fetchTextureMap(const QUrl& baseUrl, const FBXTexture& fbxTexture,
|
||||||
image::TextureUsage::Type type, MapChannel channel) {
|
image::TextureUsage::Type type, MapChannel channel) {
|
||||||
|
|
||||||
|
if (baseUrl.isEmpty()) {
|
||||||
|
return nullptr;
|
||||||
|
}
|
||||||
|
|
||||||
const auto url = getTextureUrl(baseUrl, fbxTexture);
|
const auto url = getTextureUrl(baseUrl, fbxTexture);
|
||||||
const auto texture = DependencyManager::get<TextureCache>()->getTexture(url, type, fbxTexture.content, fbxTexture.maxNumPixels);
|
const auto texture = DependencyManager::get<TextureCache>()->getTexture(url, type, fbxTexture.content, fbxTexture.maxNumPixels);
|
||||||
_textures[channel] = Texture { fbxTexture.name, texture };
|
_textures[channel] = Texture { fbxTexture.name, texture };
|
||||||
|
|
|
@ -264,6 +264,7 @@
|
||||||
function domainChanged(domain) {
|
function domainChanged(domain) {
|
||||||
if (domain !== currentDomain) {
|
if (domain !== currentDomain) {
|
||||||
MyAvatar.restoreAnimation();
|
MyAvatar.restoreAnimation();
|
||||||
|
resetValues();
|
||||||
var name = location.placename;
|
var name = location.placename;
|
||||||
domainName = name.charAt(0).toUpperCase() + name.slice(1);
|
domainName = name.charAt(0).toUpperCase() + name.slice(1);
|
||||||
var doRequest = true;
|
var doRequest = true;
|
||||||
|
|
Loading…
Reference in a new issue