From 05c9d4febc35d4f0d094925def4345741a977d2e Mon Sep 17 00:00:00 2001 From: ZappoMan Date: Tue, 15 Oct 2013 13:37:14 -0700 Subject: [PATCH] added old style voxelnode for size comparison --- .../src/VoxelPersistThread.cpp | 3 ++- libraries/voxels/src/VoxelNode.h | 26 +++++++++++++++++++ 2 files changed, 28 insertions(+), 1 deletion(-) diff --git a/libraries/voxel-server-library/src/VoxelPersistThread.cpp b/libraries/voxel-server-library/src/VoxelPersistThread.cpp index ee8147eaad..d63601e5be 100644 --- a/libraries/voxel-server-library/src/VoxelPersistThread.cpp +++ b/libraries/voxel-server-library/src/VoxelPersistThread.cpp @@ -29,7 +29,8 @@ bool VoxelPersistThread::process() { _initialLoad = true; qDebug("loading voxels from file: %s...\n", _filename); - qDebug("sizeof(VoxelNode)=%d sizeof(AABox)=%d sizeof(oldAABox)=%d\n", sizeof(VoxelNode), sizeof(AABox), sizeof(oldAABox)); + qDebug("sizeof(oldVoxelNode)=%d sizeof(VoxelNode)=%d sizeof(AABox)=%d sizeof(oldAABox)=%d\n", + sizeof(oldVoxelNode), sizeof(VoxelNode), sizeof(AABox), sizeof(oldAABox)); bool persistantFileRead = _tree->readFromSVOFile(_filename); if (persistantFileRead) { diff --git a/libraries/voxels/src/VoxelNode.h b/libraries/voxels/src/VoxelNode.h index 3b36b2d3e9..8432b7b06b 100644 --- a/libraries/voxels/src/VoxelNode.h +++ b/libraries/voxels/src/VoxelNode.h @@ -167,4 +167,30 @@ private: static uint64_t _octcodeMemoryUsage; }; + +class oldVoxelNode { +public: + + VoxelNode* _children[8]; /// Client and server, pointers to child nodes, 64 bytes + oldAABox _box; /// Client and server, axis aligned box for bounds of this voxel, 48 bytes + unsigned char* _octalCode; /// Client and server, pointer to octal code for this node, 8 bytes + + uint64_t _lastChanged; /// Client and server, timestamp this node was last changed, 8 bytes + unsigned long _subtreeNodeCount; /// Client and server, nodes below this node, 8 bytes + unsigned long _subtreeLeafNodeCount; /// Client and server, leaves below this node, 8 bytes + + glBufferIndex _glBufferIndex; /// Client only, vbo index for this voxel if being rendered, 8 bytes + VoxelSystem* _voxelSystem; /// Client only, pointer to VoxelSystem rendering this voxel, 8 bytes + + float _density; /// Client and server, If leaf: density = 1, if internal node: 0-1 density of voxels inside, 4 bytes + int _childCount; /// Client and server, current child nodes set to non-null in _children, 4 bytes + + nodeColor _trueColor; /// Client and server, true color of this voxel, 4 bytes + nodeColor _currentColor; /// Client only, false color of this voxel, 4 bytes + bool _falseColored; /// Client only, is this voxel false colored, 1 bytes + + bool _isDirty; /// Client only, has this voxel changed since being rendered, 1 byte + bool _shouldRender; /// Client only, should this voxel render at this time, 1 byte + uint16_t _sourceID; /// Client only, stores node id of voxel server that sent his voxel, 2 bytes +}; #endif /* defined(__hifi__VoxelNode__) */ \ No newline at end of file