added occlusion culling menu option

This commit is contained in:
ZappoMan 2013-06-18 09:34:12 -07:00
parent c9e1c898c2
commit 7fe6c0e3b3
4 changed files with 19 additions and 6 deletions

View file

@ -1005,6 +1005,10 @@ void Application::setWantsDelta(bool wantsDelta) {
_myAvatar.setWantDelta(wantsDelta);
}
void Application::setWantsOcclusionCulling(bool wantsOcclusionCulling) {
_myAvatar.setWantOcclusionCulling(wantsOcclusionCulling);
}
void Application::updateVoxelModeActions() {
// only the sender can be checked
foreach (QAction* action, _voxelModeActions->actions()) {
@ -1346,6 +1350,7 @@ void Application::initMenu() {
debugMenu->addAction("Wants Res-In", this, SLOT(setWantsResIn(bool)))->setCheckable(true);
debugMenu->addAction("Wants Monochrome", this, SLOT(setWantsMonochrome(bool)))->setCheckable(true);
debugMenu->addAction("Wants View Delta Sending", this, SLOT(setWantsDelta(bool)))->setCheckable(true);
debugMenu->addAction("Wants Occlusion Culling", this, SLOT(setWantsOcclusionCulling(bool)))->setCheckable(true);
QMenu* settingsMenu = menuBar->addMenu("Settings");
(_settingsAutosave = settingsMenu->addAction("Autosave"))->setCheckable(true);

View file

@ -114,6 +114,7 @@ private slots:
void setWantsMonochrome(bool wantsMonochrome);
void setWantsResIn(bool wantsResIn);
void setWantsDelta(bool wantsDelta);
void setWantsOcclusionCulling(bool wantsOcclusionCulling);
void updateVoxelModeActions();
void decreaseVoxelSize();
void increaseVoxelSize();

View file

@ -35,6 +35,7 @@ AvatarData::AvatarData(Agent* owningAgent) :
_wantResIn(false),
_wantColor(true),
_wantDelta(false),
_wantOcclusionCulling(false),
_headData(NULL)
{
@ -106,9 +107,10 @@ int AvatarData::getBroadcastData(unsigned char* destinationBuffer) {
// bitMask of less than byte wide items
unsigned char bitItems = 0;
if (_wantResIn) { setAtBit(bitItems,WANT_RESIN_AT_BIT); }
if (_wantColor) { setAtBit(bitItems,WANT_COLOR_AT_BIT); }
if (_wantDelta) { setAtBit(bitItems,WANT_DELTA_AT_BIT); }
if (_wantResIn) { setAtBit(bitItems, WANT_RESIN_AT_BIT); }
if (_wantColor) { setAtBit(bitItems, WANT_COLOR_AT_BIT); }
if (_wantDelta) { setAtBit(bitItems, WANT_DELTA_AT_BIT); }
if (_wantOcclusionCulling) { setAtBit(bitItems, WANT_OCCLUSION_CULLING_BIT); }
// key state
setSemiNibbleAt(bitItems,KEY_STATE_START_BIT,_keyState);
@ -192,9 +194,10 @@ int AvatarData::parseData(unsigned char* sourceBuffer, int numBytes) {
// voxel sending features...
unsigned char bitItems = 0;
bitItems = (unsigned char)*sourceBuffer++;
_wantResIn = oneAtBit(bitItems,WANT_RESIN_AT_BIT);
_wantColor = oneAtBit(bitItems,WANT_COLOR_AT_BIT);
_wantDelta = oneAtBit(bitItems,WANT_DELTA_AT_BIT);
_wantResIn = oneAtBit(bitItems, WANT_RESIN_AT_BIT);
_wantColor = oneAtBit(bitItems, WANT_COLOR_AT_BIT);
_wantDelta = oneAtBit(bitItems, WANT_DELTA_AT_BIT);
_wantOcclusionCulling = oneAtBit(bitItems, WANT_OCCLUSION_CULLING_BIT);
// key state, stored as a semi-nibble in the bitItems
_keyState = (KeyState)getSemiNibbleAt(bitItems,KEY_STATE_START_BIT);

View file

@ -23,6 +23,7 @@ const int WANT_COLOR_AT_BIT = 1;
const int WANT_DELTA_AT_BIT = 2;
const int KEY_STATE_START_BIT = 3; // 4th and 5th bits
const int HAND_STATE_START_BIT = 5; // 6th and 7th bits
const int WANT_OCCLUSION_CULLING_BIT = 7; // 8th bit
const float MAX_AUDIO_LOUDNESS = 1000.0; // close enough for mouth animation
@ -89,9 +90,11 @@ public:
bool getWantResIn() const { return _wantResIn; }
bool getWantColor() const { return _wantColor; }
bool getWantDelta() const { return _wantDelta; }
bool getWantOcclusionCulling() const { return _wantOcclusionCulling; }
void setWantResIn(bool wantResIn) { _wantResIn = wantResIn; }
void setWantColor(bool wantColor) { _wantColor = wantColor; }
void setWantDelta(bool wantDelta) { _wantDelta = wantDelta; }
void setWantOcclusionCulling(bool wantOcclusionCulling) { _wantOcclusionCulling = wantOcclusionCulling; }
void setHeadData(HeadData* headData) { _headData = headData; }
@ -125,6 +128,7 @@ protected:
bool _wantResIn;
bool _wantColor;
bool _wantDelta;
bool _wantOcclusionCulling;
HeadData* _headData;
private: