mirror of
https://github.com/HifiExperiments/overte.git
synced 2025-08-09 11:58:37 +02:00
saving changes
This commit is contained in:
parent
54236e5c59
commit
535fdf32cf
3 changed files with 36 additions and 12 deletions
|
@ -66,20 +66,24 @@ void SafeLanding::addTrackedEntity(const EntityItemID& entityID) {
|
||||||
EntityItemPointer entity = _entityTree->findEntityByID(entityID);
|
EntityItemPointer entity = _entityTree->findEntityByID(entityID);
|
||||||
|
|
||||||
if (entity && !entity->getCollisionless()) {
|
if (entity && !entity->getCollisionless()) {
|
||||||
static const std::set<ShapeType> downloadedCollisionTypes
|
const auto& entityType = entity->getType();
|
||||||
{ SHAPE_TYPE_COMPOUND, SHAPE_TYPE_SIMPLE_COMPOUND, SHAPE_TYPE_STATIC_MESH, SHAPE_TYPE_SIMPLE_HULL };
|
if (entityType == EntityTypes::Model) {
|
||||||
bool hasAABox;
|
ModelEntityItem * modelEntity = std::dynamic_pointer_cast<ModelEntityItem>(entity).get();
|
||||||
entity->getAABox(hasAABox);
|
static const std::set<ShapeType> downloadedCollisionTypes
|
||||||
if (hasAABox && downloadedCollisionTypes.count(entity->getShapeType()) != 0) {
|
{ SHAPE_TYPE_COMPOUND, SHAPE_TYPE_SIMPLE_COMPOUND, SHAPE_TYPE_STATIC_MESH, SHAPE_TYPE_SIMPLE_HULL };
|
||||||
// Only track entities with downloaded collision bodies.
|
bool hasAABox;
|
||||||
_trackedEntities.emplace(entityID, entity);
|
entity->getAABox(hasAABox);
|
||||||
|
if (hasAABox && downloadedCollisionTypes.count(modelEntity->getShapeType()) != 0) {
|
||||||
|
// Only track entities with downloaded collision bodies.
|
||||||
|
_trackedEntities.emplace(entityID, entity);
|
||||||
|
|
||||||
float trackedEntityCount = (float)_trackedEntities.size();
|
float trackedEntityCount = (float)_trackedEntities.size();
|
||||||
|
|
||||||
if (trackedEntityCount > _maxTrackedEntityCount) {
|
if (trackedEntityCount > _maxTrackedEntityCount) {
|
||||||
_maxTrackedEntityCount = trackedEntityCount;
|
_maxTrackedEntityCount = trackedEntityCount;
|
||||||
|
}
|
||||||
|
qCDebug(interfaceapp) << "Safe Landing: Tracking entity " << entity->getItemName();
|
||||||
}
|
}
|
||||||
qCDebug(interfaceapp) << "Safe Landing: Tracking entity " << entity->getItemName();
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -155,7 +159,6 @@ bool SafeLanding::isEntityPhysicsComplete() {
|
||||||
auto entity = entityMapIter->second;
|
auto entity = entityMapIter->second;
|
||||||
if (!entity->shouldBePhysical() || entity->isReadyToComputeShape()) {
|
if (!entity->shouldBePhysical() || entity->isReadyToComputeShape()) {
|
||||||
entityMapIter = _trackedEntities.erase(entityMapIter);
|
entityMapIter = _trackedEntities.erase(entityMapIter);
|
||||||
qDebug() << "--> removing entity <--";
|
|
||||||
if (entityMapIter == _trackedEntities.end()) {
|
if (entityMapIter == _trackedEntities.end()) {
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
|
@ -103,6 +103,7 @@ void OverlayConductor::update(float dt) {
|
||||||
|
|
||||||
bool targetVisible = Menu::getInstance()->isOptionChecked(MenuOption::Overlays) && !_suppressedByHead;
|
bool targetVisible = Menu::getInstance()->isOptionChecked(MenuOption::Overlays) && !_suppressedByHead;
|
||||||
if (targetVisible != currentVisible) {
|
if (targetVisible != currentVisible) {
|
||||||
|
qDebug() << "setting pinned: " << !targetVisible;
|
||||||
offscreenUi->setPinned(!targetVisible);
|
offscreenUi->setPinned(!targetVisible);
|
||||||
}
|
}
|
||||||
if (shouldRecenter && !_suppressedByHead) {
|
if (shouldRecenter && !_suppressedByHead) {
|
||||||
|
|
|
@ -207,6 +207,18 @@
|
||||||
return ((1 - t) * a + t * b);
|
return ((1 - t) * a + t * b);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function resetValues() {
|
||||||
|
var properties = {
|
||||||
|
localPosition: { x: 1.85, y: -0.935, z: 0.0 },
|
||||||
|
dimensions: {
|
||||||
|
x: 0.1,
|
||||||
|
y: 2.8
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
Overlays.editOverlay(loadingBarProgress, properties);
|
||||||
|
}
|
||||||
|
|
||||||
function startInterstitialPage() {
|
function startInterstitialPage() {
|
||||||
if (timer === null) {
|
if (timer === null) {
|
||||||
updateOverlays(Window.isPhysicsEnabled());
|
updateOverlays(Window.isPhysicsEnabled());
|
||||||
|
@ -323,6 +335,10 @@
|
||||||
Overlays.editOverlay(loadingBarPlacard, properties);
|
Overlays.editOverlay(loadingBarPlacard, properties);
|
||||||
Overlays.editOverlay(loadingBarProgress, loadingBarProperties);
|
Overlays.editOverlay(loadingBarProgress, loadingBarProperties);
|
||||||
|
|
||||||
|
if (physicsEnabled) {
|
||||||
|
resetValues();
|
||||||
|
}
|
||||||
|
|
||||||
Camera.mode = "first person";
|
Camera.mode = "first person";
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -409,6 +425,10 @@
|
||||||
if (DEBUG) {
|
if (DEBUG) {
|
||||||
tablet.removeButton(button);
|
tablet.removeButton(button);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
renderViewTask.getConfig("LightingModel")["enableAmbientLight"] = true;
|
||||||
|
renderViewTask.getConfig("LightingModel")["enableDirectionalLight"] = true;
|
||||||
|
renderViewTask.getConfig("LightingModel")["enablePointLight"] = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
Script.scriptEnding.connect(cleanup);
|
Script.scriptEnding.connect(cleanup);
|
||||||
|
|
Loading…
Reference in a new issue