Moved Octree max pps out of Menu

Moved it to OctreeQuery
This commit is contained in:
Atlante45 2015-01-17 23:30:45 -08:00
parent 21a3705b48
commit e8a396b08b
7 changed files with 21 additions and 52 deletions

View file

@ -2304,7 +2304,7 @@ void Application::queryOctree(NodeType_t serverType, PacketType packetType, Node
int perServerPPS = 0;
const int SMALL_BUDGET = 10;
int perUnknownServer = SMALL_BUDGET;
int totalPPS = Menu::getInstance()->getMaxOctreePacketsPerSecond();
int totalPPS = _octreeQuery.getMaxOctreePacketsPerSecond();
// determine PPS based on number of servers
if (inViewServers >= 1) {

View file

@ -186,6 +186,7 @@ public:
PrioVR* getPrioVR() { return &_prioVR; }
QUndoStack* getUndoStack() { return &_undoStack; }
MainWindow* getWindow() { return _window; }
OctreeQuery& getOctreeQuery() { return _octreeQuery; }
EntityTree* getEntityClipboard() { return &_entityClipboard; }
EntityTreeRenderer* getEntityClipboardRenderer() { return &_entityClipboardRenderer; }

View file

@ -592,7 +592,6 @@ void Menu::loadSettings(QSettings* settings) {
int bufferSize = settings->value("audioOutputBufferSize", DEFAULT_AUDIO_OUTPUT_BUFFER_SIZE_FRAMES).toInt();
QMetaObject::invokeMethod(audio.data(), "setOutputBufferSize", Q_ARG(int, bufferSize));
_maxOctreePacketsPerSecond = loadSetting(settings, "maxOctreePPS", DEFAULT_MAX_OCTREE_PPS);
_snapshotsLocation = settings->value("snapshotsLocation",
QStandardPaths::writableLocation(QStandardPaths::DesktopLocation)).toString();
setScriptsLocation(settings->value("scriptsLocation", QString()).toString());
@ -636,7 +635,6 @@ void Menu::saveSettings(QSettings* settings) {
settings->setValue("audioOutputStarveDetectionPeriod", audio->getOutputStarveDetectionPeriod());
settings->setValue("audioOutputBufferSize", audio->getOutputBufferSize());
settings->setValue("maxOctreePPS", _maxOctreePacketsPerSecond);
settings->setValue("snapshotsLocation", _snapshotsLocation);
settings->setValue("scriptsLocation", _scriptsLocation);
#if defined(Q_OS_MAC) || defined(Q_OS_WIN)

View file

@ -146,10 +146,6 @@ public:
#if defined(Q_OS_MAC) || defined(Q_OS_WIN)
SpeechRecognizer* getSpeechRecognizer() { return &_speechRecognizer; }
#endif
// User Tweakable PPS from Voxel Server
int getMaxOctreePacketsPerSecond() const { return _maxOctreePacketsPerSecond; }
void setMaxOctreePacketsPerSecond(int value) { _maxOctreePacketsPerSecond = value; bumpSettings(); }
const QByteArray& getWalletPrivateKey() const { return _walletPrivateKey; }
@ -201,8 +197,6 @@ private:
bool _hasLoginDialogDisplayed = false;
int _maxOctreePacketsPerSecond = DEFAULT_MAX_OCTREE_PPS;
QPointer<AddressBarDialog> _addressBarDialog;
QPointer<AnimationsDialog> _animationsDialog;
QPointer<AttachmentsDialog> _attachmentsDialog;

View file

@ -160,7 +160,7 @@ void PreferencesDialog::loadPreferences() {
ui.avatarScaleSpin->setValue(myAvatar->getScale());
ui.maxOctreePPSSpin->setValue(menuInstance->getMaxOctreePacketsPerSecond());
ui.maxOctreePPSSpin->setValue(qApp->getOctreeQuery().getMaxOctreePacketsPerSecond());
ui.oculusUIAngularSizeSpin->setValue(qApp->getApplicationOverlay().getOculusUIAngularSize());
@ -242,7 +242,7 @@ void PreferencesDialog::savePreferences() {
faceshift->setHostname(ui.faceshiftHostnameEdit->text());
Menu::getInstance()->setMaxOctreePacketsPerSecond(ui.maxOctreePPSSpin->value());
qApp->getOctreeQuery().setMaxOctreePacketsPerSecond(ui.maxOctreePPSSpin->value());
qApp->getApplicationOverlay().setOculusUIAngularSize(ui.oculusUIAngularSizeSpin->value());

View file

@ -10,35 +10,11 @@
//
#include <PacketHeaders.h>
//#include <SharedUtil.h>
#include <GLMHelpers.h>
#include "OctreeConstants.h"
#include "OctreeQuery.h"
OctreeQuery::OctreeQuery() :
NodeData(),
_cameraPosition(0,0,0),
_cameraOrientation(),
_cameraFov(0.0f),
_cameraAspectRatio(0.0f),
_cameraNearClip(0.0f),
_cameraFarClip(0.0f),
_wantColor(true),
_wantDelta(true),
_wantLowResMoving(true),
_wantOcclusionCulling(false), // disabled by default
_wantCompression(false), // disabled by default
_maxOctreePPS(DEFAULT_MAX_OCTREE_PPS),
_octreeElementSizeScale(DEFAULT_OCTREE_SIZE_SCALE)
{
}
OctreeQuery::~OctreeQuery() {
// nothing to do
}
int OctreeQuery::getBroadcastData(unsigned char* destinationBuffer) {
unsigned char* bufferStart = destinationBuffer;

View file

@ -44,8 +44,8 @@ class OctreeQuery : public NodeData {
Q_OBJECT
public:
OctreeQuery();
virtual ~OctreeQuery();
OctreeQuery() {}
virtual ~OctreeQuery() {}
int getBroadcastData(unsigned char* destinationBuffer);
int parseData(const QByteArray& packet);
@ -92,23 +92,23 @@ public slots:
protected:
// camera details for the avatar
glm::vec3 _cameraPosition;
glm::quat _cameraOrientation;
float _cameraFov;
float _cameraAspectRatio;
float _cameraNearClip;
float _cameraFarClip;
glm::vec3 _cameraEyeOffsetPosition;
glm::vec3 _cameraPosition = glm::vec3(0.0f);
glm::quat _cameraOrientation = glm::quat();
float _cameraFov = 0.0f;
float _cameraAspectRatio = 0.0f;
float _cameraNearClip = 0.0f;
float _cameraFarClip = 0.0f;
glm::vec3 _cameraEyeOffsetPosition = glm::vec3(0.0f);
// octree server sending items
bool _wantColor;
bool _wantDelta;
bool _wantLowResMoving;
bool _wantOcclusionCulling;
bool _wantCompression;
int _maxOctreePPS;
float _octreeElementSizeScale; /// used for LOD calculations
int _boundaryLevelAdjust; /// used for LOD calculations
bool _wantColor = true;
bool _wantDelta = true;
bool _wantLowResMoving = true;
bool _wantOcclusionCulling = false;
bool _wantCompression = false;
int _maxOctreePPS = DEFAULT_MAX_OCTREE_PPS;
float _octreeElementSizeScale = DEFAULT_OCTREE_SIZE_SCALE; /// used for LOD calculations
int _boundaryLevelAdjust = 0; /// used for LOD calculations
private:
// privatize the copy constructor and assignment operator so they cannot be called