mirror of
https://github.com/overte-org/overte.git
synced 2025-08-06 17:00:13 +02:00
Merge branch 'master' of https://github.com/worklist/hifi into animation_server_jurisdictions
This commit is contained in:
commit
b61e2810b2
3 changed files with 19 additions and 16 deletions
|
@ -407,7 +407,7 @@ Audio::Audio(Oscilloscope* scope, int16_t initialJitterBufferSamples) :
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
inputParameters.channelCount = 2; // Stereo input
|
inputParameters.channelCount = 1; // Stereo input
|
||||||
inputParameters.sampleFormat = (paInt16 | paNonInterleaved);
|
inputParameters.sampleFormat = (paInt16 | paNonInterleaved);
|
||||||
inputParameters.suggestedLatency = Pa_GetDeviceInfo(inputParameters.device)->defaultLowInputLatency;
|
inputParameters.suggestedLatency = Pa_GetDeviceInfo(inputParameters.device)->defaultLowInputLatency;
|
||||||
inputParameters.hostApiSpecificStreamInfo = NULL;
|
inputParameters.hostApiSpecificStreamInfo = NULL;
|
||||||
|
|
|
@ -65,6 +65,8 @@ VoxelSystem::VoxelSystem(float treeScale, int maxVoxels) :
|
||||||
_falseColorizeBySource = false;
|
_falseColorizeBySource = false;
|
||||||
_dataSourceID = UNKNOWN_NODE_ID;
|
_dataSourceID = UNKNOWN_NODE_ID;
|
||||||
_voxelServerCount = 0;
|
_voxelServerCount = 0;
|
||||||
|
|
||||||
|
_viewFrustum = Application::getInstance()->getViewFrustum();
|
||||||
}
|
}
|
||||||
|
|
||||||
void VoxelSystem::nodeDeleted(VoxelNode* node) {
|
void VoxelSystem::nodeDeleted(VoxelNode* node) {
|
||||||
|
@ -394,7 +396,7 @@ int VoxelSystem::newTreeToArrays(VoxelNode* node) {
|
||||||
int voxelsUpdated = 0;
|
int voxelsUpdated = 0;
|
||||||
bool shouldRender = false; // assume we don't need to render it
|
bool shouldRender = false; // assume we don't need to render it
|
||||||
// if it's colored, we might need to render it!
|
// if it's colored, we might need to render it!
|
||||||
shouldRender = node->calculateShouldRender(Application::getInstance()->getViewFrustum());
|
shouldRender = node->calculateShouldRender(_viewFrustum);
|
||||||
|
|
||||||
node->setShouldRender(shouldRender);
|
node->setShouldRender(shouldRender);
|
||||||
// let children figure out their renderness
|
// let children figure out their renderness
|
||||||
|
@ -813,10 +815,8 @@ bool VoxelSystem::falseColorizeInViewOperation(VoxelNode* node, void* extraData)
|
||||||
}
|
}
|
||||||
|
|
||||||
void VoxelSystem::falseColorizeInView() {
|
void VoxelSystem::falseColorizeInView() {
|
||||||
ViewFrustum* viewFrustum = Application::getInstance()->getViewFrustum();
|
|
||||||
|
|
||||||
_nodeCount = 0;
|
_nodeCount = 0;
|
||||||
_tree->recurseTreeWithOperation(falseColorizeInViewOperation,(void*)viewFrustum);
|
_tree->recurseTreeWithOperation(falseColorizeInViewOperation,(void*)_viewFrustum);
|
||||||
qDebug("setting in view false color for %d nodes\n", _nodeCount);
|
qDebug("setting in view false color for %d nodes\n", _nodeCount);
|
||||||
_tree->setDirtyBit();
|
_tree->setDirtyBit();
|
||||||
setupNewVoxelsForDrawing();
|
setupNewVoxelsForDrawing();
|
||||||
|
@ -942,15 +942,13 @@ bool VoxelSystem::getDistanceFromViewRangeOperation(VoxelNode* node, void* extra
|
||||||
}
|
}
|
||||||
|
|
||||||
void VoxelSystem::falseColorizeDistanceFromView() {
|
void VoxelSystem::falseColorizeDistanceFromView() {
|
||||||
ViewFrustum* viewFrustum = Application::getInstance()->getViewFrustum();
|
|
||||||
|
|
||||||
_nodeCount = 0;
|
_nodeCount = 0;
|
||||||
_maxDistance = 0.0;
|
_maxDistance = 0.0;
|
||||||
_minDistance = FLT_MAX;
|
_minDistance = FLT_MAX;
|
||||||
_tree->recurseTreeWithOperation(getDistanceFromViewRangeOperation, (void*) viewFrustum);
|
_tree->recurseTreeWithOperation(getDistanceFromViewRangeOperation, (void*) _viewFrustum);
|
||||||
qDebug("determining distance range for %d nodes\n", _nodeCount);
|
qDebug("determining distance range for %d nodes\n", _nodeCount);
|
||||||
_nodeCount = 0;
|
_nodeCount = 0;
|
||||||
_tree->recurseTreeWithOperation(falseColorizeDistanceFromViewOperation, (void*) viewFrustum);
|
_tree->recurseTreeWithOperation(falseColorizeDistanceFromViewOperation, (void*) _viewFrustum);
|
||||||
qDebug("setting in distance false color for %d nodes\n", _nodeCount);
|
qDebug("setting in distance false color for %d nodes\n", _nodeCount);
|
||||||
_tree->setDirtyBit();
|
_tree->setDirtyBit();
|
||||||
setupNewVoxelsForDrawing();
|
setupNewVoxelsForDrawing();
|
||||||
|
@ -960,6 +958,7 @@ void VoxelSystem::falseColorizeDistanceFromView() {
|
||||||
class removeOutOfViewArgs {
|
class removeOutOfViewArgs {
|
||||||
public:
|
public:
|
||||||
VoxelSystem* thisVoxelSystem;
|
VoxelSystem* thisVoxelSystem;
|
||||||
|
ViewFrustum* thisViewFrustum;
|
||||||
VoxelNodeBag dontRecurseBag;
|
VoxelNodeBag dontRecurseBag;
|
||||||
unsigned long nodesScanned;
|
unsigned long nodesScanned;
|
||||||
unsigned long nodesRemoved;
|
unsigned long nodesRemoved;
|
||||||
|
@ -969,6 +968,7 @@ public:
|
||||||
|
|
||||||
removeOutOfViewArgs(VoxelSystem* voxelSystem) :
|
removeOutOfViewArgs(VoxelSystem* voxelSystem) :
|
||||||
thisVoxelSystem(voxelSystem),
|
thisVoxelSystem(voxelSystem),
|
||||||
|
thisViewFrustum(voxelSystem->getViewFrustum()),
|
||||||
dontRecurseBag(),
|
dontRecurseBag(),
|
||||||
nodesScanned(0),
|
nodesScanned(0),
|
||||||
nodesRemoved(0),
|
nodesRemoved(0),
|
||||||
|
@ -997,7 +997,7 @@ bool VoxelSystem::removeOutOfViewOperation(VoxelNode* node, void* extraData) {
|
||||||
for (int i = 0; i < NUMBER_OF_CHILDREN; i++) {
|
for (int i = 0; i < NUMBER_OF_CHILDREN; i++) {
|
||||||
VoxelNode* childNode = node->getChildAtIndex(i);
|
VoxelNode* childNode = node->getChildAtIndex(i);
|
||||||
if (childNode) {
|
if (childNode) {
|
||||||
ViewFrustum::location inFrustum = childNode->inFrustum(*Application::getInstance()->getViewFrustum());
|
ViewFrustum::location inFrustum = childNode->inFrustum(*args->thisViewFrustum);
|
||||||
switch (inFrustum) {
|
switch (inFrustum) {
|
||||||
case ViewFrustum::OUTSIDE: {
|
case ViewFrustum::OUTSIDE: {
|
||||||
args->nodesOutside++;
|
args->nodesOutside++;
|
||||||
|
@ -1031,9 +1031,9 @@ bool VoxelSystem::isViewChanging() {
|
||||||
bool result = false; // assume the best
|
bool result = false; // assume the best
|
||||||
|
|
||||||
// If our viewFrustum has changed since our _lastKnowViewFrustum
|
// If our viewFrustum has changed since our _lastKnowViewFrustum
|
||||||
if (!_lastKnowViewFrustum.matches(Application::getInstance()->getViewFrustum())) {
|
if (!_lastKnowViewFrustum.matches(_viewFrustum)) {
|
||||||
result = true;
|
result = true;
|
||||||
_lastKnowViewFrustum = *Application::getInstance()->getViewFrustum(); // save last known
|
_lastKnowViewFrustum = *_viewFrustum; // save last known
|
||||||
}
|
}
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
@ -1047,9 +1047,9 @@ bool VoxelSystem::hasViewChanged() {
|
||||||
}
|
}
|
||||||
|
|
||||||
// If our viewFrustum has changed since our _lastKnowViewFrustum
|
// If our viewFrustum has changed since our _lastKnowViewFrustum
|
||||||
if (!_lastStableViewFrustum.matches(Application::getInstance()->getViewFrustum())) {
|
if (!_lastStableViewFrustum.matches(_viewFrustum)) {
|
||||||
result = true;
|
result = true;
|
||||||
_lastStableViewFrustum = *Application::getInstance()->getViewFrustum(); // save last stable
|
_lastStableViewFrustum = *_viewFrustum; // save last stable
|
||||||
}
|
}
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
@ -1403,7 +1403,7 @@ void VoxelSystem::falseColorizeOccluded() {
|
||||||
myCoverageMap.erase();
|
myCoverageMap.erase();
|
||||||
|
|
||||||
FalseColorizeOccludedArgs args;
|
FalseColorizeOccludedArgs args;
|
||||||
args.viewFrustum = Application::getInstance()->getViewFrustum();
|
args.viewFrustum = _viewFrustum;
|
||||||
args.map = &myCoverageMap;
|
args.map = &myCoverageMap;
|
||||||
args.totalVoxels = 0;
|
args.totalVoxels = 0;
|
||||||
args.coloredVoxels = 0;
|
args.coloredVoxels = 0;
|
||||||
|
@ -1525,7 +1525,7 @@ void VoxelSystem::falseColorizeOccludedV2() {
|
||||||
VoxelProjectedPolygon::intersects_calls = 0;
|
VoxelProjectedPolygon::intersects_calls = 0;
|
||||||
|
|
||||||
FalseColorizeOccludedArgs args;
|
FalseColorizeOccludedArgs args;
|
||||||
args.viewFrustum = Application::getInstance()->getViewFrustum();
|
args.viewFrustum = _viewFrustum;
|
||||||
args.mapV2 = &myCoverageMapV2;
|
args.mapV2 = &myCoverageMapV2;
|
||||||
args.totalVoxels = 0;
|
args.totalVoxels = 0;
|
||||||
args.coloredVoxels = 0;
|
args.coloredVoxels = 0;
|
||||||
|
|
|
@ -43,6 +43,8 @@ public:
|
||||||
void simulate(float deltaTime) { };
|
void simulate(float deltaTime) { };
|
||||||
void render(bool texture);
|
void render(bool texture);
|
||||||
|
|
||||||
|
ViewFrustum* getViewFrustum() const {return _viewFrustum;}
|
||||||
|
void setViewFrustum(ViewFrustum* viewFrustum) {_viewFrustum = viewFrustum;}
|
||||||
unsigned long getVoxelsUpdated() const {return _voxelsUpdated;};
|
unsigned long getVoxelsUpdated() const {return _voxelsUpdated;};
|
||||||
unsigned long getVoxelsRendered() const {return _voxelsInReadArrays;};
|
unsigned long getVoxelsRendered() const {return _voxelsInReadArrays;};
|
||||||
|
|
||||||
|
@ -182,6 +184,7 @@ private:
|
||||||
|
|
||||||
ViewFrustum _lastKnowViewFrustum;
|
ViewFrustum _lastKnowViewFrustum;
|
||||||
ViewFrustum _lastStableViewFrustum;
|
ViewFrustum _lastStableViewFrustum;
|
||||||
|
ViewFrustum* _viewFrustum;
|
||||||
|
|
||||||
int newTreeToArrays(VoxelNode *currentNode);
|
int newTreeToArrays(VoxelNode *currentNode);
|
||||||
void cleanupRemovedVoxels();
|
void cleanupRemovedVoxels();
|
||||||
|
|
Loading…
Reference in a new issue