mirror of
https://github.com/overte-org/overte.git
synced 2025-08-08 21:17:01 +02:00
CR feedback, dead code cleanup
This commit is contained in:
parent
88af387214
commit
d10e1cc39d
12 changed files with 13 additions and 51 deletions
|
@ -3507,14 +3507,6 @@ glm::vec3 Application::getSunDirection() {
|
||||||
// FIXME, preprocessor guard this check to occur only in DEBUG builds
|
// FIXME, preprocessor guard this check to occur only in DEBUG builds
|
||||||
static QThread * activeRenderingThread = nullptr;
|
static QThread * activeRenderingThread = nullptr;
|
||||||
|
|
||||||
float Application::getSizeScale() const {
|
|
||||||
return DependencyManager::get<LODManager>()->getOctreeSizeScale();
|
|
||||||
}
|
|
||||||
|
|
||||||
int Application::getBoundaryLevelAdjust() const {
|
|
||||||
return DependencyManager::get<LODManager>()->getBoundaryLevelAdjust();
|
|
||||||
}
|
|
||||||
|
|
||||||
PickRay Application::computePickRay(float x, float y) const {
|
PickRay Application::computePickRay(float x, float y) const {
|
||||||
vec2 pickPoint { x, y };
|
vec2 pickPoint { x, y };
|
||||||
PickRay result;
|
PickRay result;
|
||||||
|
|
|
@ -170,8 +170,6 @@ public:
|
||||||
|
|
||||||
virtual ViewFrustum* getCurrentViewFrustum() { return getDisplayViewFrustum(); }
|
virtual ViewFrustum* getCurrentViewFrustum() { return getDisplayViewFrustum(); }
|
||||||
virtual QThread* getMainThread() { return thread(); }
|
virtual QThread* getMainThread() { return thread(); }
|
||||||
virtual float getSizeScale() const;
|
|
||||||
virtual int getBoundaryLevelAdjust() const;
|
|
||||||
virtual PickRay computePickRay(float x, float y) const;
|
virtual PickRay computePickRay(float x, float y) const;
|
||||||
virtual glm::vec3 getAvatarPosition() const;
|
virtual glm::vec3 getAvatarPosition() const;
|
||||||
virtual void overrideEnvironmentData(const EnvironmentData& newData) { _environment.override(newData); }
|
virtual void overrideEnvironmentData(const EnvironmentData& newData) { _environment.override(newData); }
|
||||||
|
|
|
@ -183,7 +183,6 @@ void LODManager::autoAdjustLOD(float currentFPS) {
|
||||||
|
|
||||||
if (changed) {
|
if (changed) {
|
||||||
calculateAvatarLODDistanceMultiplier();
|
calculateAvatarLODDistanceMultiplier();
|
||||||
_shouldRenderTableNeedsRebuilding = true;
|
|
||||||
auto lodToolsDialog = DependencyManager::get<DialogsManager>()->getLodToolsDialog();
|
auto lodToolsDialog = DependencyManager::get<DialogsManager>()->getLodToolsDialog();
|
||||||
if (lodToolsDialog) {
|
if (lodToolsDialog) {
|
||||||
lodToolsDialog->reloadSliders();
|
lodToolsDialog->reloadSliders();
|
||||||
|
@ -294,7 +293,6 @@ bool LODManager::shouldRender(const RenderArgs* args, const AABox& bounds) {
|
||||||
void LODManager::setOctreeSizeScale(float sizeScale) {
|
void LODManager::setOctreeSizeScale(float sizeScale) {
|
||||||
_octreeSizeScale = sizeScale;
|
_octreeSizeScale = sizeScale;
|
||||||
calculateAvatarLODDistanceMultiplier();
|
calculateAvatarLODDistanceMultiplier();
|
||||||
_shouldRenderTableNeedsRebuilding = true;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void LODManager::calculateAvatarLODDistanceMultiplier() {
|
void LODManager::calculateAvatarLODDistanceMultiplier() {
|
||||||
|
@ -303,7 +301,6 @@ void LODManager::calculateAvatarLODDistanceMultiplier() {
|
||||||
|
|
||||||
void LODManager::setBoundaryLevelAdjust(int boundaryLevelAdjust) {
|
void LODManager::setBoundaryLevelAdjust(int boundaryLevelAdjust) {
|
||||||
_boundaryLevelAdjust = boundaryLevelAdjust;
|
_boundaryLevelAdjust = boundaryLevelAdjust;
|
||||||
_shouldRenderTableNeedsRebuilding = true;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -135,9 +135,6 @@ private:
|
||||||
SimpleMovingAverage _fpsAverageDownWindow = DOWN_SHIFT_SAMPLES_OF_FRAMES;
|
SimpleMovingAverage _fpsAverageDownWindow = DOWN_SHIFT_SAMPLES_OF_FRAMES;
|
||||||
SimpleMovingAverage _fpsAverageUpWindow = UP_SHIFT_SAMPLES_OF_FRAMES;
|
SimpleMovingAverage _fpsAverageUpWindow = UP_SHIFT_SAMPLES_OF_FRAMES;
|
||||||
|
|
||||||
bool _shouldRenderTableNeedsRebuilding = true;
|
|
||||||
QMap<float, float> _shouldRenderTable;
|
|
||||||
|
|
||||||
PIDController _renderDistanceController{};
|
PIDController _renderDistanceController{};
|
||||||
SimpleMovingAverage _renderDistanceAverage{ 10 };
|
SimpleMovingAverage _renderDistanceAverage{ 10 };
|
||||||
};
|
};
|
||||||
|
|
|
@ -417,15 +417,6 @@ const FBXGeometry* EntityTreeRenderer::getCollisionGeometryForEntity(EntityItemP
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
float EntityTreeRenderer::getSizeScale() const {
|
|
||||||
return _viewState->getSizeScale();
|
|
||||||
}
|
|
||||||
|
|
||||||
int EntityTreeRenderer::getBoundaryLevelAdjust() const {
|
|
||||||
return _viewState->getBoundaryLevelAdjust();
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
void EntityTreeRenderer::processEraseMessage(ReceivedMessage& message, const SharedNodePointer& sourceNode) {
|
void EntityTreeRenderer::processEraseMessage(ReceivedMessage& message, const SharedNodePointer& sourceNode) {
|
||||||
std::static_pointer_cast<EntityTree>(_tree)->processEraseMessage(message, sourceNode);
|
std::static_pointer_cast<EntityTree>(_tree)->processEraseMessage(message, sourceNode);
|
||||||
}
|
}
|
||||||
|
|
|
@ -41,8 +41,6 @@ public:
|
||||||
virtual char getMyNodeType() const { return NodeType::EntityServer; }
|
virtual char getMyNodeType() const { return NodeType::EntityServer; }
|
||||||
virtual PacketType getMyQueryMessageType() const { return PacketType::EntityQuery; }
|
virtual PacketType getMyQueryMessageType() const { return PacketType::EntityQuery; }
|
||||||
virtual PacketType getExpectedPacketType() const { return PacketType::EntityData; }
|
virtual PacketType getExpectedPacketType() const { return PacketType::EntityData; }
|
||||||
virtual float getSizeScale() const;
|
|
||||||
virtual int getBoundaryLevelAdjust() const;
|
|
||||||
virtual void setTree(OctreePointer newTree);
|
virtual void setTree(OctreePointer newTree);
|
||||||
|
|
||||||
void shutdown();
|
void shutdown();
|
||||||
|
|
|
@ -321,7 +321,7 @@ OctreeElement::AppendState EntityTreeElement::appendElementData(OctreePacketData
|
||||||
if (renderAccuracy <= 0.0f) {
|
if (renderAccuracy <= 0.0f) {
|
||||||
includeThisEntity = false; // too small, don't include it
|
includeThisEntity = false; // too small, don't include it
|
||||||
|
|
||||||
#ifdef WANT_LOD_DEBUGGING
|
#if 1 //def WANT_LOD_DEBUGGING
|
||||||
qDebug() << "skipping entity - TOO SMALL - \n"
|
qDebug() << "skipping entity - TOO SMALL - \n"
|
||||||
<< "......id:" << entity->getID() << "\n"
|
<< "......id:" << entity->getID() << "\n"
|
||||||
<< "....name:" << entity->getName() << "\n"
|
<< "....name:" << entity->getName() << "\n"
|
||||||
|
@ -337,11 +337,10 @@ OctreeElement::AppendState EntityTreeElement::appendElementData(OctreePacketData
|
||||||
}
|
}
|
||||||
|
|
||||||
if (includeThisEntity) {
|
if (includeThisEntity) {
|
||||||
#ifdef WANT_LOD_DEBUGGING
|
#if 1 //def WANT_LOD_DEBUGGING
|
||||||
qDebug() << "including entity - \n"
|
qDebug() << "including entity - \n"
|
||||||
<< "......id:" << entity->getID() << "\n"
|
<< "......id:" << entity->getID() << "\n"
|
||||||
<< "....name:" << entity->getName() << "\n"
|
<< "....name:" << entity->getName() << "\n"
|
||||||
<< "..bounds:" << entityBounds << "\n"
|
|
||||||
<< "....cell:" << getAACube();
|
<< "....cell:" << getAACube();
|
||||||
#endif
|
#endif
|
||||||
indexesOfEntitiesToInclude << i;
|
indexesOfEntitiesToInclude << i;
|
||||||
|
|
|
@ -14,11 +14,7 @@
|
||||||
#include "OctreeLogging.h"
|
#include "OctreeLogging.h"
|
||||||
#include "OctreeHeadlessViewer.h"
|
#include "OctreeHeadlessViewer.h"
|
||||||
|
|
||||||
OctreeHeadlessViewer::OctreeHeadlessViewer() :
|
OctreeHeadlessViewer::OctreeHeadlessViewer() : OctreeRenderer()
|
||||||
OctreeRenderer(),
|
|
||||||
_voxelSizeScale(DEFAULT_OCTREE_SIZE_SCALE),
|
|
||||||
_boundaryLevelAdjust(0),
|
|
||||||
_maxPacketsPerSecond(DEFAULT_MAX_OCTREE_PPS)
|
|
||||||
{
|
{
|
||||||
_viewFrustum.setProjection(glm::perspective(glm::radians(DEFAULT_FIELD_OF_VIEW_DEGREES), DEFAULT_ASPECT_RATIO, DEFAULT_NEAR_CLIP, DEFAULT_FAR_CLIP));
|
_viewFrustum.setProjection(glm::perspective(glm::radians(DEFAULT_FIELD_OF_VIEW_DEGREES), DEFAULT_ASPECT_RATIO, DEFAULT_NEAR_CLIP, DEFAULT_FAR_CLIP));
|
||||||
}
|
}
|
||||||
|
@ -57,9 +53,8 @@ void OctreeHeadlessViewer::queryOctree() {
|
||||||
_octreeQuery.setCameraFarClip(_viewFrustum.getFarClip());
|
_octreeQuery.setCameraFarClip(_viewFrustum.getFarClip());
|
||||||
_octreeQuery.setCameraEyeOffsetPosition(glm::vec3());
|
_octreeQuery.setCameraEyeOffsetPosition(glm::vec3());
|
||||||
_octreeQuery.setKeyholeRadius(_viewFrustum.getKeyholeRadius());
|
_octreeQuery.setKeyholeRadius(_viewFrustum.getKeyholeRadius());
|
||||||
|
_octreeQuery.setOctreeSizeScale(_voxelSizeScale);
|
||||||
_octreeQuery.setOctreeSizeScale(getVoxelSizeScale());
|
_octreeQuery.setBoundaryLevelAdjust(_boundaryLevelAdjust);
|
||||||
_octreeQuery.setBoundaryLevelAdjust(getBoundaryLevelAdjust());
|
|
||||||
|
|
||||||
// Iterate all of the nodes, and get a count of how many voxel servers we have...
|
// Iterate all of the nodes, and get a count of how many voxel servers we have...
|
||||||
int totalServers = 0;
|
int totalServers = 0;
|
||||||
|
|
|
@ -59,7 +59,7 @@ public slots:
|
||||||
|
|
||||||
// getters for LOD and PPS
|
// getters for LOD and PPS
|
||||||
float getVoxelSizeScale() const { return _voxelSizeScale; }
|
float getVoxelSizeScale() const { return _voxelSizeScale; }
|
||||||
int getBoundaryLevelAdjust() const override { return _boundaryLevelAdjust; }
|
int getBoundaryLevelAdjust() const { return _boundaryLevelAdjust; }
|
||||||
int getMaxPacketsPerSecond() const { return _maxPacketsPerSecond; }
|
int getMaxPacketsPerSecond() const { return _maxPacketsPerSecond; }
|
||||||
|
|
||||||
unsigned getOctreeElementsCount() const { return _tree->getOctreeElementsCount(); }
|
unsigned getOctreeElementsCount() const { return _tree->getOctreeElementsCount(); }
|
||||||
|
@ -68,9 +68,10 @@ private:
|
||||||
ViewFrustum _viewFrustum;
|
ViewFrustum _viewFrustum;
|
||||||
JurisdictionListener* _jurisdictionListener = nullptr;
|
JurisdictionListener* _jurisdictionListener = nullptr;
|
||||||
OctreeQuery _octreeQuery;
|
OctreeQuery _octreeQuery;
|
||||||
float _voxelSizeScale;
|
|
||||||
int _boundaryLevelAdjust;
|
float _voxelSizeScale { DEFAULT_OCTREE_SIZE_SCALE };
|
||||||
int _maxPacketsPerSecond;
|
int _boundaryLevelAdjust { 0 };
|
||||||
|
int _maxPacketsPerSecond { DEFAULT_MAX_OCTREE_PPS };
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif // hifi_OctreeHeadlessViewer_h
|
#endif // hifi_OctreeHeadlessViewer_h
|
||||||
|
|
|
@ -39,8 +39,6 @@ public:
|
||||||
virtual PacketType getMyQueryMessageType() const = 0;
|
virtual PacketType getMyQueryMessageType() const = 0;
|
||||||
virtual PacketType getExpectedPacketType() const = 0;
|
virtual PacketType getExpectedPacketType() const = 0;
|
||||||
virtual void renderElement(OctreeElementPointer element, RenderArgs* args) { }
|
virtual void renderElement(OctreeElementPointer element, RenderArgs* args) { }
|
||||||
virtual float getSizeScale() const { return DEFAULT_OCTREE_SIZE_SCALE; }
|
|
||||||
virtual int getBoundaryLevelAdjust() const { return 0; }
|
|
||||||
|
|
||||||
virtual void setTree(OctreePointer newTree);
|
virtual void setTree(OctreePointer newTree);
|
||||||
|
|
||||||
|
|
|
@ -758,9 +758,9 @@ float ViewFrustum::calculateRenderAccuracy(const AABox& bounds, float octreeSize
|
||||||
const float maxScale = (float)TREE_SCALE;
|
const float maxScale = (float)TREE_SCALE;
|
||||||
float visibleDistanceAtMaxScale = boundaryDistanceForRenderLevel(boundaryLevelAdjust, octreeSizeScale) / OCTREE_TO_MESH_RATIO;
|
float visibleDistanceAtMaxScale = boundaryDistanceForRenderLevel(boundaryLevelAdjust, octreeSizeScale) / OCTREE_TO_MESH_RATIO;
|
||||||
|
|
||||||
static bool shouldRenderTableNeedsBuilding = true;
|
static std::once_flag once;
|
||||||
static QMap<float, float> shouldRenderTable;
|
static QMap<float, float> shouldRenderTable;
|
||||||
if (shouldRenderTableNeedsBuilding) {
|
std::call_once(once, [&] {
|
||||||
float SMALLEST_SCALE_IN_TABLE = 0.001f; // 1mm is plenty small
|
float SMALLEST_SCALE_IN_TABLE = 0.001f; // 1mm is plenty small
|
||||||
float scale = maxScale;
|
float scale = maxScale;
|
||||||
float factor = 1.0f;
|
float factor = 1.0f;
|
||||||
|
@ -770,9 +770,7 @@ float ViewFrustum::calculateRenderAccuracy(const AABox& bounds, float octreeSize
|
||||||
factor /= 2.0f;
|
factor /= 2.0f;
|
||||||
shouldRenderTable[scale] = factor;
|
shouldRenderTable[scale] = factor;
|
||||||
}
|
}
|
||||||
|
});
|
||||||
shouldRenderTableNeedsBuilding = false;
|
|
||||||
}
|
|
||||||
|
|
||||||
float closestScale = maxScale;
|
float closestScale = maxScale;
|
||||||
float visibleDistanceAtClosestScale = visibleDistanceAtMaxScale;
|
float visibleDistanceAtClosestScale = visibleDistanceAtMaxScale;
|
||||||
|
|
|
@ -41,8 +41,6 @@ public:
|
||||||
|
|
||||||
virtual QThread* getMainThread() = 0;
|
virtual QThread* getMainThread() = 0;
|
||||||
|
|
||||||
virtual float getSizeScale() const = 0;
|
|
||||||
virtual int getBoundaryLevelAdjust() const = 0;
|
|
||||||
virtual PickRay computePickRay(float x, float y) const = 0;
|
virtual PickRay computePickRay(float x, float y) const = 0;
|
||||||
|
|
||||||
virtual glm::vec3 getAvatarPosition() const = 0;
|
virtual glm::vec3 getAvatarPosition() const = 0;
|
||||||
|
|
Loading…
Reference in a new issue