mirror of
https://github.com/overte-org/overte.git
synced 2025-08-10 06:23:06 +02:00
remove wantsColor support since its always true and required for entities
This commit is contained in:
parent
81fb4476bc
commit
f472b515c3
14 changed files with 62 additions and 115 deletions
|
@ -179,7 +179,6 @@ void OctreeQueryNode::resetOctreePacket() {
|
||||||
|
|
||||||
// If we're moving, and the client asked for low res, then we force monochrome, otherwise, use
|
// If we're moving, and the client asked for low res, then we force monochrome, otherwise, use
|
||||||
// the clients requested color state.
|
// the clients requested color state.
|
||||||
_currentPacketIsColor = getWantColor();
|
|
||||||
_currentPacketIsCompressed = getWantCompression();
|
_currentPacketIsCompressed = getWantCompression();
|
||||||
OCTREE_PACKET_FLAGS flags = 0;
|
OCTREE_PACKET_FLAGS flags = 0;
|
||||||
if (_currentPacketIsColor) {
|
if (_currentPacketIsColor) {
|
||||||
|
|
|
@ -78,7 +78,7 @@ public:
|
||||||
bool getCurrentPacketIsColor() const { return _currentPacketIsColor; }
|
bool getCurrentPacketIsColor() const { return _currentPacketIsColor; }
|
||||||
bool getCurrentPacketIsCompressed() const { return _currentPacketIsCompressed; }
|
bool getCurrentPacketIsCompressed() const { return _currentPacketIsCompressed; }
|
||||||
bool getCurrentPacketFormatMatches() {
|
bool getCurrentPacketFormatMatches() {
|
||||||
return (getCurrentPacketIsColor() == getWantColor() && getCurrentPacketIsCompressed() == getWantCompression());
|
return (getCurrentPacketIsCompressed() == getWantCompression());
|
||||||
}
|
}
|
||||||
|
|
||||||
bool hasLodChanged() const { return _lodChanged; }
|
bool hasLodChanged() const { return _lodChanged; }
|
||||||
|
|
|
@ -321,7 +321,6 @@ int OctreeSendThread::packetDistributor(OctreeQueryNode* nodeData, bool viewFrus
|
||||||
// If we're starting a fresh packet, then...
|
// If we're starting a fresh packet, then...
|
||||||
// If we're moving, and the client asked for low res, then we force monochrome, otherwise, use
|
// If we're moving, and the client asked for low res, then we force monochrome, otherwise, use
|
||||||
// the clients requested color state.
|
// the clients requested color state.
|
||||||
bool wantColor = nodeData->getWantColor();
|
|
||||||
bool wantCompression = nodeData->getWantCompression();
|
bool wantCompression = nodeData->getWantCompression();
|
||||||
|
|
||||||
// If we have a packet waiting, and our desired want color, doesn't match the current waiting packets color
|
// If we have a packet waiting, and our desired want color, doesn't match the current waiting packets color
|
||||||
|
@ -456,7 +455,7 @@ int OctreeSendThread::packetDistributor(OctreeQueryNode* nodeData, bool viewFrus
|
||||||
int boundaryLevelAdjust = boundaryLevelAdjustClient + (viewFrustumChanged && nodeData->getWantLowResMoving()
|
int boundaryLevelAdjust = boundaryLevelAdjustClient + (viewFrustumChanged && nodeData->getWantLowResMoving()
|
||||||
? LOW_RES_MOVING_ADJUST : NO_BOUNDARY_ADJUST);
|
? LOW_RES_MOVING_ADJUST : NO_BOUNDARY_ADJUST);
|
||||||
|
|
||||||
EncodeBitstreamParams params(INT_MAX, &nodeData->getCurrentViewFrustum(), wantColor,
|
EncodeBitstreamParams params(INT_MAX, &nodeData->getCurrentViewFrustum(),
|
||||||
WANT_EXISTS_BITS, DONT_CHOP, wantDelta, lastViewFrustum,
|
WANT_EXISTS_BITS, DONT_CHOP, wantDelta, lastViewFrustum,
|
||||||
boundaryLevelAdjust, octreeSizeScale,
|
boundaryLevelAdjust, octreeSizeScale,
|
||||||
nodeData->getLastTimeBagEmpty(),
|
nodeData->getLastTimeBagEmpty(),
|
||||||
|
|
|
@ -3074,7 +3074,6 @@ void Application::queryOctree(NodeType_t serverType, PacketType packetType, Node
|
||||||
|
|
||||||
// These will be the same for all servers, so we can set them up once and then reuse for each server we send to.
|
// These will be the same for all servers, so we can set them up once and then reuse for each server we send to.
|
||||||
_octreeQuery.setWantLowResMoving(true);
|
_octreeQuery.setWantLowResMoving(true);
|
||||||
_octreeQuery.setWantColor(true);
|
|
||||||
_octreeQuery.setWantDelta(true);
|
_octreeQuery.setWantDelta(true);
|
||||||
_octreeQuery.setWantCompression(true);
|
_octreeQuery.setWantCompression(true);
|
||||||
|
|
||||||
|
|
|
@ -950,9 +950,9 @@ int Octree::encodeTreeBitstream(OctreeElementPointer element,
|
||||||
// if childBytesWritten == 1 then something went wrong... that's not possible
|
// if childBytesWritten == 1 then something went wrong... that's not possible
|
||||||
assert(childBytesWritten != 1);
|
assert(childBytesWritten != 1);
|
||||||
|
|
||||||
// if includeColor and childBytesWritten == 2, then it can only mean that the lower level trees don't exist or for some
|
// if childBytesWritten == 2, then it can only mean that the lower level trees don't exist or for some
|
||||||
// reason couldn't be written... so reset them here... This isn't true for the non-color included case
|
// reason couldn't be written... so reset them here... This isn't true for the non-color included case
|
||||||
if (suppressEmptySubtrees() && params.includeColor && childBytesWritten == 2) {
|
if (suppressEmptySubtrees() && childBytesWritten == 2) {
|
||||||
childBytesWritten = 0;
|
childBytesWritten = 0;
|
||||||
//params.stopReason = EncodeBitstreamParams::UNKNOWN; // possibly should be DIDNT_FIT...
|
//params.stopReason = EncodeBitstreamParams::UNKNOWN; // possibly should be DIDNT_FIT...
|
||||||
}
|
}
|
||||||
|
@ -1293,7 +1293,7 @@ int Octree::encodeTreeBitstreamRecursion(OctreeElementPointer element,
|
||||||
// NOW might be a good time to give our tree subclass and this element a chance to set up and check any extra encode data
|
// NOW might be a good time to give our tree subclass and this element a chance to set up and check any extra encode data
|
||||||
element->initializeExtraEncodeData(params);
|
element->initializeExtraEncodeData(params);
|
||||||
|
|
||||||
// write the child element data... NOTE: includeColor means include element data
|
// write the child element data...
|
||||||
// NOTE: the format of the bitstream is generally this:
|
// NOTE: the format of the bitstream is generally this:
|
||||||
// [octalcode]
|
// [octalcode]
|
||||||
// [bitmask for existence of child data]
|
// [bitmask for existence of child data]
|
||||||
|
@ -1303,7 +1303,6 @@ int Octree::encodeTreeBitstreamRecursion(OctreeElementPointer element,
|
||||||
// N x [ ... tree for children ...]
|
// N x [ ... tree for children ...]
|
||||||
//
|
//
|
||||||
// This section of the code, is writing the "N x [child data]" portion of this bitstream
|
// This section of the code, is writing the "N x [child data]" portion of this bitstream
|
||||||
if (params.includeColor) {
|
|
||||||
for (int i = 0; i < NUMBER_OF_CHILDREN; i++) {
|
for (int i = 0; i < NUMBER_OF_CHILDREN; i++) {
|
||||||
if (oneAtBit(childrenDataBits, i)) {
|
if (oneAtBit(childrenDataBits, i)) {
|
||||||
OctreeElementPointer childElement = element->getChildAtIndex(i);
|
OctreeElementPointer childElement = element->getChildAtIndex(i);
|
||||||
|
@ -1365,7 +1364,6 @@ int Octree::encodeTreeBitstreamRecursion(OctreeElementPointer element,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
if (!mustIncludeAllChildData() && !continueThisLevel) {
|
if (!mustIncludeAllChildData() && !continueThisLevel) {
|
||||||
qCDebug(octree) << "WARNING UNEXPECTED CASE: reached end of child element data loop with continueThisLevel=FALSE";
|
qCDebug(octree) << "WARNING UNEXPECTED CASE: reached end of child element data loop with continueThisLevel=FALSE";
|
||||||
|
@ -1500,17 +1498,10 @@ int Octree::encodeTreeBitstreamRecursion(OctreeElementPointer element,
|
||||||
// so, if the child returns 2 bytes out, we can actually consider that an empty tree also!!
|
// so, if the child returns 2 bytes out, we can actually consider that an empty tree also!!
|
||||||
//
|
//
|
||||||
// we can make this act like no bytes out, by just resetting the bytes out in this case
|
// we can make this act like no bytes out, by just resetting the bytes out in this case
|
||||||
if (suppressEmptySubtrees() && params.includeColor && !params.includeExistsBits && childTreeBytesOut == 2) {
|
if (suppressEmptySubtrees() && !params.includeExistsBits && childTreeBytesOut == 2) {
|
||||||
childTreeBytesOut = 0; // this is the degenerate case of a tree with no colors and no child trees
|
childTreeBytesOut = 0; // this is the degenerate case of a tree with no colors and no child trees
|
||||||
|
|
||||||
}
|
}
|
||||||
// We used to try to collapse trees that didn't contain any data, but this does appear to create a problem
|
|
||||||
// in detecting element deletion. So, I've commented this out but left it in here as a warning to anyone else
|
|
||||||
// about not attempting to add this optimization back in, without solving the element deletion case.
|
|
||||||
// We need to send these bitMasks in case the exists in tree bitmask is indicating the deletion of a tree
|
|
||||||
//if (params.includeColor && params.includeExistsBits && childTreeBytesOut == 3) {
|
|
||||||
// childTreeBytesOut = 0; // this is the degenerate case of a tree with no colors and no child trees
|
|
||||||
//}
|
|
||||||
|
|
||||||
bytesAtThisLevel += childTreeBytesOut;
|
bytesAtThisLevel += childTreeBytesOut;
|
||||||
|
|
||||||
|
@ -1530,7 +1521,7 @@ int Octree::encodeTreeBitstreamRecursion(OctreeElementPointer element,
|
||||||
|
|
||||||
// If this is the last of the child exists bits, then we're actually be rolling out the entire tree
|
// If this is the last of the child exists bits, then we're actually be rolling out the entire tree
|
||||||
if (params.stats && childrenExistInPacketBits == 0) {
|
if (params.stats && childrenExistInPacketBits == 0) {
|
||||||
params.stats->childBitsRemoved(params.includeExistsBits, params.includeColor);
|
params.stats->childBitsRemoved(params.includeExistsBits);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!continueThisLevel) {
|
if (!continueThisLevel) {
|
||||||
|
@ -1825,7 +1816,7 @@ bool Octree::readSVOFromStream(unsigned long streamLength, QDataStream& inputStr
|
||||||
|
|
||||||
unsigned char* dataAt = entireFileDataSection;
|
unsigned char* dataAt = entireFileDataSection;
|
||||||
|
|
||||||
ReadBitstreamToTreeParams args(WANT_COLOR, NO_EXISTS_BITS, NULL, 0,
|
ReadBitstreamToTreeParams args(NO_EXISTS_BITS, NULL, 0,
|
||||||
SharedNodePointer(), wantImportProgress, gotVersion);
|
SharedNodePointer(), wantImportProgress, gotVersion);
|
||||||
|
|
||||||
readBitstreamToTree(dataAt, dataLength, args);
|
readBitstreamToTree(dataAt, dataLength, args);
|
||||||
|
@ -1864,7 +1855,7 @@ bool Octree::readSVOFromStream(unsigned long streamLength, QDataStream& inputStr
|
||||||
unsigned char* dataAt = fileChunk;
|
unsigned char* dataAt = fileChunk;
|
||||||
unsigned long dataLength = chunkLength;
|
unsigned long dataLength = chunkLength;
|
||||||
|
|
||||||
ReadBitstreamToTreeParams args(WANT_COLOR, NO_EXISTS_BITS, NULL, 0,
|
ReadBitstreamToTreeParams args(NO_EXISTS_BITS, NULL, 0,
|
||||||
SharedNodePointer(), wantImportProgress, gotVersion);
|
SharedNodePointer(), wantImportProgress, gotVersion);
|
||||||
|
|
||||||
readBitstreamToTree(dataAt, dataLength, args);
|
readBitstreamToTree(dataAt, dataLength, args);
|
||||||
|
@ -2012,7 +2003,7 @@ void Octree::writeToSVOFile(const char* fileName, OctreeElementPointer element)
|
||||||
bool lastPacketWritten = false;
|
bool lastPacketWritten = false;
|
||||||
|
|
||||||
while (OctreeElementPointer subTree = elementBag.extract()) {
|
while (OctreeElementPointer subTree = elementBag.extract()) {
|
||||||
EncodeBitstreamParams params(INT_MAX, IGNORE_VIEW_FRUSTUM, WANT_COLOR, NO_EXISTS_BITS);
|
EncodeBitstreamParams params(INT_MAX, IGNORE_VIEW_FRUSTUM, NO_EXISTS_BITS);
|
||||||
withReadLock([&] {
|
withReadLock([&] {
|
||||||
params.extraEncodeData = &extraEncodeData;
|
params.extraEncodeData = &extraEncodeData;
|
||||||
bytesWritten = encodeTreeBitstream(subTree, &packetData, elementBag, params);
|
bytesWritten = encodeTreeBitstream(subTree, &packetData, elementBag, params);
|
||||||
|
|
|
@ -52,8 +52,6 @@ typedef QHash<uint, AACube> CubeList;
|
||||||
|
|
||||||
const bool NO_EXISTS_BITS = false;
|
const bool NO_EXISTS_BITS = false;
|
||||||
const bool WANT_EXISTS_BITS = true;
|
const bool WANT_EXISTS_BITS = true;
|
||||||
const bool NO_COLOR = false;
|
|
||||||
const bool WANT_COLOR = true;
|
|
||||||
const bool COLLAPSE_EMPTY_TREE = true;
|
const bool COLLAPSE_EMPTY_TREE = true;
|
||||||
const bool DONT_COLLAPSE = false;
|
const bool DONT_COLLAPSE = false;
|
||||||
|
|
||||||
|
@ -72,7 +70,6 @@ public:
|
||||||
int maxEncodeLevel;
|
int maxEncodeLevel;
|
||||||
int maxLevelReached;
|
int maxLevelReached;
|
||||||
const ViewFrustum* viewFrustum;
|
const ViewFrustum* viewFrustum;
|
||||||
bool includeColor;
|
|
||||||
bool includeExistsBits;
|
bool includeExistsBits;
|
||||||
int chopLevels;
|
int chopLevels;
|
||||||
bool deltaViewFrustum;
|
bool deltaViewFrustum;
|
||||||
|
@ -103,7 +100,6 @@ public:
|
||||||
EncodeBitstreamParams(
|
EncodeBitstreamParams(
|
||||||
int maxEncodeLevel = INT_MAX,
|
int maxEncodeLevel = INT_MAX,
|
||||||
const ViewFrustum* viewFrustum = IGNORE_VIEW_FRUSTUM,
|
const ViewFrustum* viewFrustum = IGNORE_VIEW_FRUSTUM,
|
||||||
bool includeColor = WANT_COLOR,
|
|
||||||
bool includeExistsBits = WANT_EXISTS_BITS,
|
bool includeExistsBits = WANT_EXISTS_BITS,
|
||||||
int chopLevels = 0,
|
int chopLevels = 0,
|
||||||
bool deltaViewFrustum = false,
|
bool deltaViewFrustum = false,
|
||||||
|
@ -118,7 +114,6 @@ public:
|
||||||
maxEncodeLevel(maxEncodeLevel),
|
maxEncodeLevel(maxEncodeLevel),
|
||||||
maxLevelReached(0),
|
maxLevelReached(0),
|
||||||
viewFrustum(viewFrustum),
|
viewFrustum(viewFrustum),
|
||||||
includeColor(includeColor),
|
|
||||||
includeExistsBits(includeExistsBits),
|
includeExistsBits(includeExistsBits),
|
||||||
chopLevels(chopLevels),
|
chopLevels(chopLevels),
|
||||||
deltaViewFrustum(deltaViewFrustum),
|
deltaViewFrustum(deltaViewFrustum),
|
||||||
|
@ -181,7 +176,6 @@ public:
|
||||||
|
|
||||||
class ReadBitstreamToTreeParams {
|
class ReadBitstreamToTreeParams {
|
||||||
public:
|
public:
|
||||||
bool includeColor;
|
|
||||||
bool includeExistsBits;
|
bool includeExistsBits;
|
||||||
OctreeElementPointer destinationElement;
|
OctreeElementPointer destinationElement;
|
||||||
QUuid sourceUUID;
|
QUuid sourceUUID;
|
||||||
|
@ -192,14 +186,12 @@ public:
|
||||||
int entitiesPerPacket = 0;
|
int entitiesPerPacket = 0;
|
||||||
|
|
||||||
ReadBitstreamToTreeParams(
|
ReadBitstreamToTreeParams(
|
||||||
bool includeColor = WANT_COLOR,
|
|
||||||
bool includeExistsBits = WANT_EXISTS_BITS,
|
bool includeExistsBits = WANT_EXISTS_BITS,
|
||||||
OctreeElementPointer destinationElement = NULL,
|
OctreeElementPointer destinationElement = NULL,
|
||||||
QUuid sourceUUID = QUuid(),
|
QUuid sourceUUID = QUuid(),
|
||||||
SharedNodePointer sourceNode = SharedNodePointer(),
|
SharedNodePointer sourceNode = SharedNodePointer(),
|
||||||
bool wantImportProgress = false,
|
bool wantImportProgress = false,
|
||||||
PacketVersion bitstreamVersion = 0) :
|
PacketVersion bitstreamVersion = 0) :
|
||||||
includeColor(includeColor),
|
|
||||||
includeExistsBits(includeExistsBits),
|
includeExistsBits(includeExistsBits),
|
||||||
destinationElement(destinationElement),
|
destinationElement(destinationElement),
|
||||||
sourceUUID(sourceUUID),
|
sourceUUID(sourceUUID),
|
||||||
|
@ -306,7 +298,7 @@ public:
|
||||||
Octree::lockType lockType = Octree::TryLock, bool* accurateResult = NULL);
|
Octree::lockType lockType = Octree::TryLock, bool* accurateResult = NULL);
|
||||||
|
|
||||||
// Note: this assumes the fileFormat is the HIO individual voxels code files
|
// Note: this assumes the fileFormat is the HIO individual voxels code files
|
||||||
void loadOctreeFile(const char* fileName, bool wantColorRandomizer);
|
void loadOctreeFile(const char* fileName);
|
||||||
|
|
||||||
// Octree exporters
|
// Octree exporters
|
||||||
void writeToFile(const char* filename, OctreeElementPointer element = NULL, QString persistAsFileType = "svo");
|
void writeToFile(const char* filename, OctreeElementPointer element = NULL, QString persistAsFileType = "svo");
|
||||||
|
|
|
@ -51,7 +51,6 @@ void OctreeHeadlessViewer::queryOctree() {
|
||||||
|
|
||||||
// These will be the same for all servers, so we can set them up once and then reuse for each server we send to.
|
// These will be the same for all servers, so we can set them up once and then reuse for each server we send to.
|
||||||
_octreeQuery.setWantLowResMoving(true);
|
_octreeQuery.setWantLowResMoving(true);
|
||||||
_octreeQuery.setWantColor(true);
|
|
||||||
_octreeQuery.setWantDelta(true);
|
_octreeQuery.setWantDelta(true);
|
||||||
_octreeQuery.setWantCompression(true); // TODO: should be on by default
|
_octreeQuery.setWantCompression(true); // TODO: should be on by default
|
||||||
|
|
||||||
|
|
|
@ -41,7 +41,6 @@ int OctreeQuery::getBroadcastData(unsigned char* destinationBuffer) {
|
||||||
// bitMask of less than byte wide items
|
// bitMask of less than byte wide items
|
||||||
unsigned char bitItems = 0;
|
unsigned char bitItems = 0;
|
||||||
if (_wantLowResMoving) { setAtBit(bitItems, WANT_LOW_RES_MOVING_BIT); }
|
if (_wantLowResMoving) { setAtBit(bitItems, WANT_LOW_RES_MOVING_BIT); }
|
||||||
if (_wantColor) { setAtBit(bitItems, WANT_COLOR_AT_BIT); }
|
|
||||||
if (_wantDelta) { setAtBit(bitItems, WANT_DELTA_AT_BIT); }
|
if (_wantDelta) { setAtBit(bitItems, WANT_DELTA_AT_BIT); }
|
||||||
if (_wantCompression) { setAtBit(bitItems, WANT_COMPRESSION); }
|
if (_wantCompression) { setAtBit(bitItems, WANT_COMPRESSION); }
|
||||||
|
|
||||||
|
@ -83,7 +82,6 @@ int OctreeQuery::parseData(NLPacket& packet) {
|
||||||
unsigned char bitItems = 0;
|
unsigned char bitItems = 0;
|
||||||
bitItems = (unsigned char)*sourceBuffer++;
|
bitItems = (unsigned char)*sourceBuffer++;
|
||||||
_wantLowResMoving = oneAtBit(bitItems, WANT_LOW_RES_MOVING_BIT);
|
_wantLowResMoving = oneAtBit(bitItems, WANT_LOW_RES_MOVING_BIT);
|
||||||
_wantColor = oneAtBit(bitItems, WANT_COLOR_AT_BIT);
|
|
||||||
_wantDelta = oneAtBit(bitItems, WANT_DELTA_AT_BIT);
|
_wantDelta = oneAtBit(bitItems, WANT_DELTA_AT_BIT);
|
||||||
_wantCompression = oneAtBit(bitItems, WANT_COMPRESSION);
|
_wantCompression = oneAtBit(bitItems, WANT_COMPRESSION);
|
||||||
|
|
||||||
|
|
|
@ -35,9 +35,9 @@ typedef unsigned long long quint64;
|
||||||
|
|
||||||
// First bitset
|
// First bitset
|
||||||
const int WANT_LOW_RES_MOVING_BIT = 0;
|
const int WANT_LOW_RES_MOVING_BIT = 0;
|
||||||
const int WANT_COLOR_AT_BIT = 1;
|
const int UNUSED_BIT_1 = 1; // unused... available for new feature
|
||||||
const int WANT_DELTA_AT_BIT = 2;
|
const int WANT_DELTA_AT_BIT = 2;
|
||||||
const int UNUSED_BIT = 3; // unused... available for new feature
|
const int UNUSED_BIT_3 = 3; // unused... available for new feature
|
||||||
const int WANT_COMPRESSION = 4; // 5th bit
|
const int WANT_COMPRESSION = 4; // 5th bit
|
||||||
|
|
||||||
class OctreeQuery : public NodeData {
|
class OctreeQuery : public NodeData {
|
||||||
|
@ -71,7 +71,6 @@ public:
|
||||||
void setCameraEyeOffsetPosition(const glm::vec3& eyeOffsetPosition) { _cameraEyeOffsetPosition = eyeOffsetPosition; }
|
void setCameraEyeOffsetPosition(const glm::vec3& eyeOffsetPosition) { _cameraEyeOffsetPosition = eyeOffsetPosition; }
|
||||||
|
|
||||||
// related to Octree Sending strategies
|
// related to Octree Sending strategies
|
||||||
bool getWantColor() const { return _wantColor; }
|
|
||||||
bool getWantDelta() const { return _wantDelta; }
|
bool getWantDelta() const { return _wantDelta; }
|
||||||
bool getWantLowResMoving() const { return _wantLowResMoving; }
|
bool getWantLowResMoving() const { return _wantLowResMoving; }
|
||||||
bool getWantCompression() const { return _wantCompression; }
|
bool getWantCompression() const { return _wantCompression; }
|
||||||
|
@ -81,7 +80,6 @@ public:
|
||||||
|
|
||||||
public slots:
|
public slots:
|
||||||
void setWantLowResMoving(bool wantLowResMoving) { _wantLowResMoving = wantLowResMoving; }
|
void setWantLowResMoving(bool wantLowResMoving) { _wantLowResMoving = wantLowResMoving; }
|
||||||
void setWantColor(bool wantColor) { _wantColor = wantColor; }
|
|
||||||
void setWantDelta(bool wantDelta) { _wantDelta = wantDelta; }
|
void setWantDelta(bool wantDelta) { _wantDelta = wantDelta; }
|
||||||
void setWantCompression(bool wantCompression) { _wantCompression = wantCompression; }
|
void setWantCompression(bool wantCompression) { _wantCompression = wantCompression; }
|
||||||
void setMaxQueryPacketsPerSecond(int maxQueryPPS) { _maxQueryPPS = maxQueryPPS; }
|
void setMaxQueryPacketsPerSecond(int maxQueryPPS) { _maxQueryPPS = maxQueryPPS; }
|
||||||
|
@ -99,7 +97,6 @@ protected:
|
||||||
glm::vec3 _cameraEyeOffsetPosition = glm::vec3(0.0f);
|
glm::vec3 _cameraEyeOffsetPosition = glm::vec3(0.0f);
|
||||||
|
|
||||||
// octree server sending items
|
// octree server sending items
|
||||||
bool _wantColor = true;
|
|
||||||
bool _wantDelta = true;
|
bool _wantDelta = true;
|
||||||
bool _wantLowResMoving = true;
|
bool _wantLowResMoving = true;
|
||||||
bool _wantCompression = false;
|
bool _wantCompression = false;
|
||||||
|
|
|
@ -115,7 +115,7 @@ void OctreeRenderer::processDatagram(NLPacket& packet, SharedNodePointer sourceN
|
||||||
|
|
||||||
if (sectionLength) {
|
if (sectionLength) {
|
||||||
// ask the VoxelTree to read the bitstream into the tree
|
// ask the VoxelTree to read the bitstream into the tree
|
||||||
ReadBitstreamToTreeParams args(packetIsColored ? WANT_COLOR : NO_COLOR, WANT_EXISTS_BITS, NULL,
|
ReadBitstreamToTreeParams args(WANT_EXISTS_BITS, NULL,
|
||||||
sourceUUID, sourceNode, false, packet.getVersion());
|
sourceUUID, sourceNode, false, packet.getVersion());
|
||||||
quint64 startUncompress, startLock = usecTimestampNow();
|
quint64 startUncompress, startLock = usecTimestampNow();
|
||||||
quint64 startReadBitsteam, endReadBitsteam;
|
quint64 startReadBitsteam, endReadBitsteam;
|
||||||
|
|
|
@ -371,14 +371,12 @@ void OctreeSceneStats::existsInPacketBitsWritten() {
|
||||||
_existsInPacketBitsWritten++;
|
_existsInPacketBitsWritten++;
|
||||||
}
|
}
|
||||||
|
|
||||||
void OctreeSceneStats::childBitsRemoved(bool includesExistsBits, bool includesColors) {
|
void OctreeSceneStats::childBitsRemoved(bool includesExistsBits) {
|
||||||
_existsInPacketBitsWritten--;
|
_existsInPacketBitsWritten--;
|
||||||
if (includesExistsBits) {
|
if (includesExistsBits) {
|
||||||
_existsBitsWritten--;
|
_existsBitsWritten--;
|
||||||
}
|
}
|
||||||
if (includesColors) {
|
|
||||||
_colorBitsWritten--;
|
_colorBitsWritten--;
|
||||||
}
|
|
||||||
_treesRemoved++;
|
_treesRemoved++;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -89,7 +89,7 @@ public:
|
||||||
void existsInPacketBitsWritten();
|
void existsInPacketBitsWritten();
|
||||||
|
|
||||||
/// Fix up tracking statistics in case where bitmasks were removed for some reason
|
/// Fix up tracking statistics in case where bitmasks were removed for some reason
|
||||||
void childBitsRemoved(bool includesExistsBits, bool includesColors);
|
void childBitsRemoved(bool includesExistsBits);
|
||||||
|
|
||||||
/// Pack the details of the statistics into a buffer for sending as a network packet
|
/// Pack the details of the statistics into a buffer for sending as a network packet
|
||||||
int packIntoPacket();
|
int packIntoPacket();
|
||||||
|
|
|
@ -264,29 +264,6 @@ unsigned char* chopOctalCode(const unsigned char* originalOctalCode, int chopLev
|
||||||
return newCode;
|
return newCode;
|
||||||
}
|
}
|
||||||
|
|
||||||
unsigned char* rebaseOctalCode(const unsigned char* originalOctalCode, const unsigned char* newParentOctalCode,
|
|
||||||
bool includeColorSpace) {
|
|
||||||
|
|
||||||
int oldCodeLength = numberOfThreeBitSectionsInCode(originalOctalCode);
|
|
||||||
int newParentCodeLength = numberOfThreeBitSectionsInCode(newParentOctalCode);
|
|
||||||
int newCodeLength = newParentCodeLength + oldCodeLength;
|
|
||||||
int bufferLength = newCodeLength + (includeColorSpace ? SIZE_OF_COLOR_DATA : 0);
|
|
||||||
unsigned char* newCode = new unsigned char[bufferLength];
|
|
||||||
*newCode = newCodeLength; // set the length byte
|
|
||||||
|
|
||||||
// copy parent code section first
|
|
||||||
for (int sectionFromParent = 0; sectionFromParent < newParentCodeLength; sectionFromParent++) {
|
|
||||||
char sectionValue = getOctalCodeSectionValue(newParentOctalCode, sectionFromParent);
|
|
||||||
setOctalCodeSectionValue(newCode, sectionFromParent, sectionValue);
|
|
||||||
}
|
|
||||||
// copy original code section next
|
|
||||||
for (int sectionFromOriginal = 0; sectionFromOriginal < oldCodeLength; sectionFromOriginal++) {
|
|
||||||
char sectionValue = getOctalCodeSectionValue(originalOctalCode, sectionFromOriginal);
|
|
||||||
setOctalCodeSectionValue(newCode, sectionFromOriginal + newParentCodeLength, sectionValue);
|
|
||||||
}
|
|
||||||
return newCode;
|
|
||||||
}
|
|
||||||
|
|
||||||
bool isAncestorOf(const unsigned char* possibleAncestor, const unsigned char* possibleDescendent, int descendentsChild) {
|
bool isAncestorOf(const unsigned char* possibleAncestor, const unsigned char* possibleDescendent, int descendentsChild) {
|
||||||
if (!possibleAncestor || !possibleDescendent) {
|
if (!possibleAncestor || !possibleDescendent) {
|
||||||
return false;
|
return false;
|
||||||
|
|
|
@ -36,8 +36,6 @@ const int UNKNOWN_OCTCODE_LENGTH = -2;
|
||||||
int numberOfThreeBitSectionsInCode(const unsigned char* octalCode, int maxBytes = UNKNOWN_OCTCODE_LENGTH);
|
int numberOfThreeBitSectionsInCode(const unsigned char* octalCode, int maxBytes = UNKNOWN_OCTCODE_LENGTH);
|
||||||
|
|
||||||
unsigned char* chopOctalCode(const unsigned char* originalOctalCode, int chopLevels);
|
unsigned char* chopOctalCode(const unsigned char* originalOctalCode, int chopLevels);
|
||||||
unsigned char* rebaseOctalCode(const unsigned char* originalOctalCode, const unsigned char* newParentOctalCode,
|
|
||||||
bool includeColorSpace = false);
|
|
||||||
|
|
||||||
const int CHECK_NODE_ONLY = -1;
|
const int CHECK_NODE_ONLY = -1;
|
||||||
bool isAncestorOf(const unsigned char* possibleAncestor, const unsigned char* possibleDescendent,
|
bool isAncestorOf(const unsigned char* possibleAncestor, const unsigned char* possibleDescendent,
|
||||||
|
|
Loading…
Reference in a new issue