From 49d8f2b2f507cc161dafb5d45c1ad36d368eec79 Mon Sep 17 00:00:00 2001 From: ZappoMan Date: Tue, 30 Dec 2014 18:52:33 -0800 Subject: [PATCH] more work on voxelEctomy --- interface/src/Camera.cpp | 1 - interface/src/DatagramProcessor.cpp | 20 +------- interface/src/Menu.cpp | 2 +- interface/src/Util.cpp | 1 - interface/src/avatar/Head.h | 2 +- interface/src/devices/SixenseManager.cpp | 1 - interface/src/ui/HMDToolsDialog.cpp | 2 - interface/src/ui/LodToolsDialog.cpp | 2 - interface/src/voxels/VoxelFade.cpp | 2 +- libraries/avatars/src/AvatarData.cpp | 1 - libraries/script-engine/src/ScriptEngine.cpp | 1 - libraries/voxels/src/VoxelConstants.h | 50 -------------------- libraries/voxels/src/VoxelDetail.h | 1 - 13 files changed, 5 insertions(+), 81 deletions(-) delete mode 100644 libraries/voxels/src/VoxelConstants.h diff --git a/interface/src/Camera.cpp b/interface/src/Camera.cpp index b2fd30a1a6..313b7b7774 100644 --- a/interface/src/Camera.cpp +++ b/interface/src/Camera.cpp @@ -11,7 +11,6 @@ #include #include -#include #include #include "Application.h" diff --git a/interface/src/DatagramProcessor.cpp b/interface/src/DatagramProcessor.cpp index 1b7e27776e..4db9a295c2 100644 --- a/interface/src/DatagramProcessor.cpp +++ b/interface/src/DatagramProcessor.cpp @@ -81,31 +81,15 @@ void DatagramProcessor::processDatagrams() { break; case PacketTypeEntityData: case PacketTypeEntityErase: - case PacketTypeVoxelData: - case PacketTypeVoxelErase: case PacketTypeOctreeStats: case PacketTypeEnvironmentData: { PerformanceWarning warn(Menu::getInstance()->isOptionChecked(MenuOption::PipelineWarnings), "Application::networkReceive()... _octreeProcessor.queueReceivedPacket()"); - bool wantExtraDebugging = application->getLogger()->extraDebugging(); - if (wantExtraDebugging && packetTypeForPacket(incomingPacket) == PacketTypeVoxelData) { - int numBytesPacketHeader = numBytesForPacketHeader(incomingPacket); - unsigned char* dataAt = reinterpret_cast(incomingPacket.data()) + numBytesPacketHeader; - dataAt += sizeof(OCTREE_PACKET_FLAGS); - OCTREE_PACKET_SEQUENCE sequence = (*(OCTREE_PACKET_SEQUENCE*)dataAt); - dataAt += sizeof(OCTREE_PACKET_SEQUENCE); - OCTREE_PACKET_SENT_TIME sentAt = (*(OCTREE_PACKET_SENT_TIME*)dataAt); - dataAt += sizeof(OCTREE_PACKET_SENT_TIME); - OCTREE_PACKET_SENT_TIME arrivedAt = usecTimestampNow(); - int flightTime = arrivedAt - sentAt; - - qDebug("got an Octree data or erase message, sequence:%d flightTime:%d", sequence, flightTime); - } - + SharedNodePointer matchedNode = NodeList::getInstance()->sendingNodeForPacket(incomingPacket); if (matchedNode) { - // add this packet to our list of voxel packets and process them on the voxel processing + // add this packet to our list of octree packets and process them on the octree data processing application->_octreeProcessor.queueReceivedPacket(matchedNode, incomingPacket); } diff --git a/interface/src/Menu.cpp b/interface/src/Menu.cpp index fa447a2d30..06fa152932 100644 --- a/interface/src/Menu.cpp +++ b/interface/src/Menu.cpp @@ -117,7 +117,7 @@ Menu::Menu() : _avatarLODIncreaseFPS(ADJUST_LOD_UP_FPS), _avatarLODDistanceMultiplier(DEFAULT_AVATAR_LOD_DISTANCE_MULTIPLIER), _boundaryLevelAdjust(0), - _maxOctreePacketsPerSecond(DEFAULT_MAX_VOXEL_PPS), + _maxOctreePacketsPerSecond(DEFAULT_MAX_OCTREE_PPS), _lastAdjust(usecTimestampNow()), _lastAvatarDetailDrop(usecTimestampNow()), _fpsAverage(FIVE_SECONDS_OF_FRAMES), diff --git a/interface/src/Util.cpp b/interface/src/Util.cpp index 45a7dabb40..7b79024479 100644 --- a/interface/src/Util.cpp +++ b/interface/src/Util.cpp @@ -25,7 +25,6 @@ #include #include "InterfaceConfig.h" -#include "VoxelConstants.h" #include "world.h" #include "Application.h" diff --git a/interface/src/avatar/Head.h b/interface/src/avatar/Head.h index 57d74adaf0..6ae0d7c728 100644 --- a/interface/src/avatar/Head.h +++ b/interface/src/avatar/Head.h @@ -18,7 +18,7 @@ #include -#include +#include // for IDENTITY_* #include "FaceModel.h" #include "InterfaceConfig.h" diff --git a/interface/src/devices/SixenseManager.cpp b/interface/src/devices/SixenseManager.cpp index 5fb4a71091..690a01a77e 100644 --- a/interface/src/devices/SixenseManager.cpp +++ b/interface/src/devices/SixenseManager.cpp @@ -508,7 +508,6 @@ void SixenseManager::emulateMouse(PalmData* palm, int index) { QMouseEvent mouseEvent(QEvent::MouseMove, pos, Qt::NoButton, Qt::NoButton, 0); //Only send the mouse event if the opposite left button isnt held down. - //This is specifically for edit voxels if (triggerButton == Qt::LeftButton) { if (!_triggerPressed[(int)(!index)]) { application->mouseMoveEvent(&mouseEvent, deviceID); diff --git a/interface/src/ui/HMDToolsDialog.cpp b/interface/src/ui/HMDToolsDialog.cpp index 23d6d5df2f..632cc8979f 100644 --- a/interface/src/ui/HMDToolsDialog.cpp +++ b/interface/src/ui/HMDToolsDialog.cpp @@ -19,8 +19,6 @@ #include #include -#include - #include "MainWindow.h" #include "Menu.h" #include "devices/OculusManager.h" diff --git a/interface/src/ui/LodToolsDialog.cpp b/interface/src/ui/LodToolsDialog.cpp index 388d360dc2..d9f2d788cd 100644 --- a/interface/src/ui/LodToolsDialog.cpp +++ b/interface/src/ui/LodToolsDialog.cpp @@ -20,8 +20,6 @@ #include #include -#include - #include "Menu.h" #include "ui/LodToolsDialog.h" diff --git a/interface/src/voxels/VoxelFade.cpp b/interface/src/voxels/VoxelFade.cpp index 7bb3be67ab..aeb44e67ae 100644 --- a/interface/src/voxels/VoxelFade.cpp +++ b/interface/src/voxels/VoxelFade.cpp @@ -13,7 +13,7 @@ #include #include -#include +#include #include "Application.h" #include "VoxelFade.h" diff --git a/libraries/avatars/src/AvatarData.cpp b/libraries/avatars/src/AvatarData.cpp index a5ee3f7fff..d5b6c29362 100644 --- a/libraries/avatars/src/AvatarData.cpp +++ b/libraries/avatars/src/AvatarData.cpp @@ -25,7 +25,6 @@ #include #include #include -#include #include "AvatarData.h" diff --git a/libraries/script-engine/src/ScriptEngine.cpp b/libraries/script-engine/src/ScriptEngine.cpp index c7be5a973b..fc9cdc5430 100644 --- a/libraries/script-engine/src/ScriptEngine.cpp +++ b/libraries/script-engine/src/ScriptEngine.cpp @@ -28,7 +28,6 @@ #include #include #include -//#include #include "AnimationObject.h" #include "ArrayBufferViewClass.h" diff --git a/libraries/voxels/src/VoxelConstants.h b/libraries/voxels/src/VoxelConstants.h deleted file mode 100644 index 34a7667273..0000000000 --- a/libraries/voxels/src/VoxelConstants.h +++ /dev/null @@ -1,50 +0,0 @@ -// -// VoxelConstants.h -// libraries/voxels/src -// -// Created by Brad Hefta-Gaub on 4/29/13. -// Copyright 2013 High Fidelity, Inc. -// -// Various important constants used throughout the system related to voxels -// -// Distributed under the Apache License, Version 2.0. -// See the accompanying file LICENSE or http://www.apache.org/licenses/LICENSE-2.0.html -// - -#ifndef hifi_VoxelConstants_h -#define hifi_VoxelConstants_h - -#include -#include -#include -#include -#include -#include -#include - -// this is where the coordinate system is represented - -const int DEFAULT_MAX_VOXELS_PER_SYSTEM = 500000; -const int VERTICES_PER_VOXEL = 24; // 6 sides * 4 corners per side -const int VERTEX_POINTS_PER_VOXEL = 3 * VERTICES_PER_VOXEL; // xyz for each VERTICE_PER_VOXEL -const int INDICES_PER_VOXEL = 3 * 12; // 6 sides * 2 triangles per size * 3 vertices per triangle -const int COLOR_VALUES_PER_VOXEL = NUMBER_OF_COLORS * VERTICES_PER_VOXEL; - -const int VERTICES_PER_FACE = 4; // 6 sides * 4 corners per side -const int INDICES_PER_FACE = 3 * 2; // 1 side * 2 triangles per size * 3 vertices per triangle -const int GLOBAL_NORMALS_VERTICES_PER_VOXEL = 8; // no need for 3 copies because they don't include normal -const int GLOBAL_NORMALS_VERTEX_POINTS_PER_VOXEL = 3 * GLOBAL_NORMALS_VERTICES_PER_VOXEL; -const int GLOBAL_NORMALS_COLOR_VALUES_PER_VOXEL = NUMBER_OF_COLORS * GLOBAL_NORMALS_VERTICES_PER_VOXEL; - -typedef unsigned long int glBufferIndex; -const glBufferIndex GLBUFFER_INDEX_UNKNOWN = ULONG_MAX; - -const float SIXTY_FPS_IN_MILLISECONDS = 1000.0f / 60.0f; -const float VIEW_CULLING_RATE_IN_MILLISECONDS = 1000.0f; // once a second is fine - -const quint64 CLIENT_TO_SERVER_VOXEL_SEND_INTERVAL_USECS = 1000 * 5; // 1 packet every 50 milliseconds - - -const int DEFAULT_MAX_VOXEL_PPS = 600; // the default maximum PPS we think a voxel server should send to a client - -#endif // hifi_VoxelConstants_h diff --git a/libraries/voxels/src/VoxelDetail.h b/libraries/voxels/src/VoxelDetail.h index 5ef7f0ff4e..1e53fd33d2 100644 --- a/libraries/voxels/src/VoxelDetail.h +++ b/libraries/voxels/src/VoxelDetail.h @@ -17,7 +17,6 @@ #include #include #include -#include "VoxelConstants.h" struct VoxelDetail { float x;