Merge branch 'interstitialMerged' of https://github.com/wayne-chen/hifi into interstitialMerged

This commit is contained in:
Wayne Chen 2018-10-01 16:11:40 -07:00
commit 36dbcd41ba
5 changed files with 23 additions and 13 deletions

View file

@ -14,7 +14,7 @@
#include <SharedUtil.h>
#include "EntityTreeRenderer.h"
#include "ModelEntityItem.h"
#include "RenderableModelEntityItem.h"
#include "InterfaceLogging.h"
#include "Application.h"
@ -123,19 +123,18 @@ bool SafeLanding::isLoadSequenceComplete() {
float SafeLanding::loadingProgressPercentage() {
Locker lock(_lock);
static const int MINIMUM_TRACKED_ENTITY_STABILITY_COUNT = 15;
float percentage = 0.0f;
float entityReadyPercentage = 0.0f;
if (_maxTrackedEntityCount > 0) {
percentage = ((_maxTrackedEntityCount - _trackedEntities.size()) / (float)_maxTrackedEntityCount);
entityReadyPercentage = ((_maxTrackedEntityCount - _trackedEntities.size()) / (float)_maxTrackedEntityCount);
}
if (_trackedEntityStabilityCount < MINIMUM_TRACKED_ENTITY_STABILITY_COUNT) {
percentage *= 0.20f;
entityReadyPercentage *= 0.20f;
}
return percentage;
return entityReadyPercentage;
}
bool SafeLanding::isSequenceNumbersComplete() {
@ -148,7 +147,7 @@ bool SafeLanding::isSequenceNumbersComplete() {
if (sequenceSize == 0 ||
(startIter != _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.
return true;
}
@ -160,13 +159,13 @@ bool isEntityPhysicsReady(const EntityItemPointer& entity) {
if (entity && !entity->getCollisionless()) {
const auto& entityType = entity->getType();
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
{ SHAPE_TYPE_COMPOUND, SHAPE_TYPE_SIMPLE_COMPOUND, SHAPE_TYPE_STATIC_MESH, SHAPE_TYPE_SIMPLE_HULL };
bool hasAABox;
entity->getAABox(hasAABox);
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) {
isVisuallyReady = (entity->isVisuallyReady() || !entityTree->renderableForEntityId(entityMapIter->first));
qDebug() << "EntityTpye" << EntityTypes::getEntityTypeName(entity->getType()) << entity->getEntityItemID() << isVisuallyReady;
}
if (isEntityPhysicsReady(entity) && isVisuallyReady) {
@ -209,7 +206,6 @@ bool SafeLanding::isEntityLoadingComplete() {
if (enableInterstitial) {
_trackedEntityStabilityCount++;
qDebug() << "EntityList size" << _trackedEntities.size() << "\n";
}

View file

@ -314,6 +314,14 @@ void RenderableModelEntityItem::getCollisionGeometryResource() {
_compoundShapeResource = DependencyManager::get<ModelCache>()->getCollisionGeometryResource(hullURL);
}
bool RenderableModelEntityItem::computeShapeFailedToLoad() {
if (!_compoundShapeResource) {
getCollisionGeometryResource();
}
return (_compoundShapeResource && _compoundShapeResource->isFailed());
}
void RenderableModelEntityItem::setShapeType(ShapeType type) {
ModelEntityItem::setShapeType(type);
if (getShapeType() == SHAPE_TYPE_COMPOUND) {
@ -342,7 +350,6 @@ void RenderableModelEntityItem::setCompoundShapeURL(const QString& url) {
bool RenderableModelEntityItem::isReadyToComputeShape() const {
ShapeType type = getShapeType();
auto model = getModel();
if (type == SHAPE_TYPE_COMPOUND) {
if (!model || getCompoundShapeURL().isEmpty()) {

View file

@ -81,6 +81,7 @@ public:
virtual bool isReadyToComputeShape() const override;
virtual void computeShapeInfo(ShapeInfo& shapeInfo) override;
bool computeShapeFailedToLoad();
virtual bool contains(const glm::vec3& point) const override;
void stopModelOverrideIfNoParent();

View file

@ -551,6 +551,11 @@ QUrl NetworkMaterial::getTextureUrl(const QUrl& baseUrl, const FBXTexture& textu
graphics::TextureMapPointer NetworkMaterial::fetchTextureMap(const QUrl& baseUrl, const FBXTexture& fbxTexture,
image::TextureUsage::Type type, MapChannel channel) {
if (baseUrl.isEmpty()) {
return nullptr;
}
const auto url = getTextureUrl(baseUrl, fbxTexture);
const auto texture = DependencyManager::get<TextureCache>()->getTexture(url, type, fbxTexture.content, fbxTexture.maxNumPixels);
_textures[channel] = Texture { fbxTexture.name, texture };

View file

@ -293,6 +293,7 @@
function domainChanged(domain) {
if (domain !== currentDomain) {
MyAvatar.restoreAnimation();
resetValues();
var name = location.placename;
domainName = name.charAt(0).toUpperCase() + name.slice(1);
var doRequest = true;