History

Merge branch 'pie_menu' of https://github.com/Atlante45/hifi into stalking_option

atlante45 committed 13 years ago

Commit f4412952 parents fdd01a6 1cae9fc21 files · +926 −556Browse files

Showing the changes to interface/src/Application.cpp (1 of 21 files). Show all

Unified · Split

interface/src/Application.cpp+189−75
@@ -196,8 +196,9 @@ Application::Application(int& argc, char** argv, timeval &startup_time) : · 195 unmodified lines
196196 _isTouchPressed(false),
197197 _yawFromTouch(0.0f),
198198 _pitchFromTouch(0.0f),
199− _groundPlaneImpact(0.0f),
200199 _mousePressed(false),
200+ _isHoverVoxel(false),
201+ _isHoverVoxelSounding(false),
201202 _mouseVoxelScale(1.0f / 1024.0f),
202203 _justEditedVoxel(false),
203204 _isLookingAtOtherAvatar(false),
@@ -856,6 +857,11 @@ void Application::mouseMoveEvent(QMouseEvent* event) { · 652 unmodified lines
856857 }
857858 }
858859
860+const bool MAKE_SOUND_ON_VOXEL_HOVER = false;
861+const bool MAKE_SOUND_ON_VOXEL_CLICK = true;
862+const float HOVER_VOXEL_FREQUENCY = 14080.f;
863+const float HOVER_VOXEL_DECAY = 0.999f;
864+
859865 void Application::mousePressEvent(QMouseEvent* event) {
860866 if (activeWindow() == _window) {
861867 if (event->button() == Qt::LeftButton) {
@@ -866,9 +872,19 @@ void Application::mousePressEvent(QMouseEvent* event) { · 4 unmodified lines
866872 _mouseVoxelDragging = _mouseVoxel;
867873 _mousePressed = true;
868874
875+
869876 if (!maybeEditVoxelUnderCursor()) {
870877 _pieMenu.mousePressEvent(_mouseX, _mouseY);
871878 }
879+
880+ if (MAKE_SOUND_ON_VOXEL_CLICK && _isHoverVoxel && !_isHoverVoxelSounding) {
881+ _hoverVoxelOriginalColor[0] = _hoverVoxel.red;
882+ _hoverVoxelOriginalColor[1] = _hoverVoxel.green;
883+ _hoverVoxelOriginalColor[2] = _hoverVoxel.blue;
884+ _hoverVoxelOriginalColor[3] = 1;
885+ _audio.startCollisionSound(1.0, HOVER_VOXEL_FREQUENCY * _hoverVoxel.s * TREE_SCALE, 0.0, HOVER_VOXEL_DECAY);
886+ _isHoverVoxelSounding = true;
887+ }
872888
873889 } else if (event->button() == Qt::RightButton && checkedVoxelModeAction() != 0) {
874890 deleteVoxelUnderCursor();
@@ -925,8 +941,10 @@ void Application::touchEndEvent(QTouchEvent* event) { · 50 unmodified lines
925941 _isTouchPressed = false;
926942 }
927943
944+const bool USE_MOUSEWHEEL = false;
928945 void Application::wheelEvent(QWheelEvent* event) {
929− if (activeWindow() == _window) {
946+ // Wheel Events disabled for now because they are also activated by touch look pitch up/down.
947+ if (USE_MOUSEWHEEL && (activeWindow() == _window)) {
930948 if (checkedVoxelModeAction() == 0) {
931949 event->ignore();
932950 return;
@@ -972,14 +990,15 @@ void Application::sendAvatarFaceVideoMessage(int frameCount, const QByteArray& d · 39 unmodified lines
972990
973991 int headerSize = packetPosition - packet;
974992
975− // break the data up into submessages of the maximum size
993+ // break the data up into submessages of the maximum size (at least one, for zero-length packets)
976994 *offsetPosition = 0;
977− while (*offsetPosition < data.size()) {
995+ do {
978996 int payloadSize = min(data.size() - (int)*offsetPosition, MAX_PACKET_SIZE - headerSize);
979997 memcpy(packetPosition, data.constData() + *offsetPosition, payloadSize);
980998 getInstance()->controlledBroadcastToNodes(packet, headerSize + payloadSize, &NODE_TYPE_AVATAR_MIXER, 1);
981999 *offsetPosition += payloadSize;
982− }
1000+
1001+ } while (*offsetPosition < data.size());
9831002 }
9841003
9851004 // Every second, check the frame rates and other stuff
@@ -1502,16 +1521,18 @@ bool Application::sendVoxelsOperation(VoxelNode* node, void* extraData) { · 516 unmodified lines
15021521
15031522 uint64_t now = usecTimestampNow();
15041523 // dynamically sleep until we need to fire off the next set of voxels
1505− const uint64_t CLIENT_TO_SERVER_VOXEL_SEND_INTERVAL_USECS = 1000 * 5; // 1 packet every 10 milliseconds
15061524 uint64_t elapsed = now - args->lastSendTime;
15071525 int usecToSleep = CLIENT_TO_SERVER_VOXEL_SEND_INTERVAL_USECS - elapsed;
15081526 if (usecToSleep > 0) {
1509− qDebug("sendVoxelsOperation: packet: %d bytes:%lld elapsed %lld usecs, sleeping for %d usecs!\n",
1510− args->packetsSent, (long long int)args->bytesSent, (long long int)elapsed, usecToSleep);
1527+ //qDebug("sendVoxelsOperation: packet: %d bytes:%lld elapsed %lld usecs, sleeping for %d usecs!\n",
1528+ // args->packetsSent, (long long int)args->bytesSent, (long long int)elapsed, usecToSleep);
1529+
1530+ Application::getInstance()->timer();
1531+
15111532 usleep(usecToSleep);
15121533 } else {
1513− qDebug("sendVoxelsOperation: packet: %d bytes:%lld elapsed %lld usecs, no need to sleep!\n",
1514− args->packetsSent, (long long int)args->bytesSent, (long long int)elapsed);
1534+ //qDebug("sendVoxelsOperation: packet: %d bytes:%lld elapsed %lld usecs, no need to sleep!\n",
1535+ // args->packetsSent, (long long int)args->bytesSent, (long long int)elapsed);
15151536 }
15161537 args->lastSendTime = now;
15171538 }
@@ -1579,70 +1600,127 @@ void Application::importVoxelsToClipboard() { · 61 unmodified lines
15791600
15801601 void Application::importVoxels() {
15811602 QString desktopLocation = QStandardPaths::writableLocation(QStandardPaths::DesktopLocation);
1582− QString fileNameString = QFileDialog::getOpenFileName(_glWidget, tr("Import Voxels"), desktopLocation,
1603+
1604+ QStringList fileNameStringList = QFileDialog::getOpenFileNames(_glWidget, tr("Import Voxels"), desktopLocation,
15831605 tr(IMPORT_FILE_TYPES));
15841606
1585− QByteArray fileNameAscii = fileNameString.toLocal8Bit();
1586− const char* fileName = fileNameAscii.data();
1607+
1608+ // remember the "selected" voxel point before we do any importing...
1609+ float originalX = _mouseVoxel.x;
1610+ float originalZ = _mouseVoxel.z;
1611+
1612+ const int PNG_TYPE_NAME_LENGTH = 4;
1613+ const int SVO_TYPE_NAME_LENGTH = 4;
1614+ const int SCH_TYPE_NAME_LENGTH = 10;
1615+
1616+ for (int i = 0; i < fileNameStringList.size(); i++) {
1617+ QString fileNameString = fileNameStringList.at(i);
1618+ QByteArray fileNameAscii = fileNameString.toLocal8Bit();
1619+ const char* fileName = fileNameAscii.data();
15871620
1588− VoxelTree importVoxels;
1589− if (fileNameString.endsWith(".png", Qt::CaseInsensitive)) {
1590− QImage pngImage = QImage(fileName);
1591− if (pngImage.height() != pngImage.width()) {
1592− qDebug("ERROR: Bad PNG size: height != width.\n");
1593− return;
1621+ int fileTypeNameLength = 0;
1622+ VoxelTree importVoxels;
1623+ if (fileNameString.endsWith(".png", Qt::CaseInsensitive)) {
1624+ QImage pngImage = QImage(fileName);
1625+ fileTypeNameLength = PNG_TYPE_NAME_LENGTH;
1626+ if (pngImage.height() != pngImage.width()) {
1627+ qDebug("ERROR: Bad PNG size: height != width.\n");
1628+ return;
1629+ }
1630+
1631+ const uint32_t* pixels;
1632+ if (pngImage.format() == QImage::Format_ARGB32) {
1633+ pixels = reinterpret_cast<const uint32_t*>(pngImage.constBits());
1634+ } else {
1635+ QImage tmp = pngImage.convertToFormat(QImage::Format_ARGB32);
1636+ pixels = reinterpret_cast<const uint32_t*>(tmp.constBits());
1637+ }
1638+
1639+ importVoxels.readFromSquareARGB32Pixels(pixels, pngImage.height());
1640+ } else if (fileNameString.endsWith(".svo", Qt::CaseInsensitive)) {
1641+ importVoxels.readFromSVOFile(fileName);
1642+ fileTypeNameLength = SVO_TYPE_NAME_LENGTH;
1643+ } else if (fileNameString.endsWith(".schematic", Qt::CaseInsensitive)) {
1644+ importVoxels.readFromSchematicFile(fileName);
1645+ fileTypeNameLength = SCH_TYPE_NAME_LENGTH;
15941646 }
15951647
1596− const uint32_t* pixels;
1597− if (pngImage.format() == QImage::Format_ARGB32) {
1598− pixels = reinterpret_cast<const uint32_t*>(pngImage.constBits());
1648+ int indexOfFirstPeriod = fileNameString.indexOf('.');
1649+
1650+ QString fileCoord = fileNameString.mid(indexOfFirstPeriod + 1,
1651+ fileNameString.length() - indexOfFirstPeriod - fileTypeNameLength - 1);
1652+
1653+ indexOfFirstPeriod = fileCoord.indexOf('.');
1654+ QString columnNumString = fileCoord.right(fileCoord.length() - indexOfFirstPeriod - 1);
1655+ QString rowNumString = fileCoord.left(indexOfFirstPeriod);
1656+
1657+ int columnNum = columnNumString.toFloat();
1658+ int rowNum = rowNumString.toFloat();
1659+
1660+ qDebug("columnNum: %d\t rowNum: %d\n", columnNum, rowNum);
1661+
1662+ _mouseVoxel.x = originalX + (columnNum - 1) * _mouseVoxel.s;
1663+ _mouseVoxel.z = originalZ + (rowNum - 1) * _mouseVoxel.s;
1664+
1665+ VoxelNode* selectedNode = _voxels.getVoxelAt(_mouseVoxel.x, _mouseVoxel.y, _mouseVoxel.z, _mouseVoxel.s);
1666+
1667+ // Recurse the Import Voxels tree, where everything is root relative, and send all the colored voxels to
1668+ // the server as an set voxel message, this will also rebase the voxels to the new location
1669+ unsigned char* calculatedOctCode = NULL;
1670+ SendVoxelsOperationArgs args;
1671+ args.lastSendTime = usecTimestampNow();
1672+ args.packetsSent = 0;
1673+ args.bytesSent = 0;
1674+
1675+ int numBytesPacketHeader = populateTypeAndVersion(args.messageBuffer, PACKET_TYPE_SET_VOXEL_DESTRUCTIVE);
1676+
1677+ unsigned short int* sequenceAt = (unsigned short int*)&args.messageBuffer[numBytesPacketHeader];
1678+ *sequenceAt = 0;
1679+ args.bufferInUse = numBytesPacketHeader + sizeof(unsigned short int); // set to command + sequence
1680+
1681+ // we only need the selected voxel to get the newBaseOctCode, which we can actually calculate from the
1682+ // voxel size/position details.
1683+ if (selectedNode) {
1684+ args.newBaseOctCode = selectedNode->getOctalCode();
15991685 } else {
1600− QImage tmp = pngImage.convertToFormat(QImage::Format_ARGB32);
1601− pixels = reinterpret_cast<const uint32_t*>(tmp.constBits());
1686+ args.newBaseOctCode = calculatedOctCode = pointToVoxel(_mouseVoxel.x, _mouseVoxel.y, _mouseVoxel.z, _mouseVoxel.s);
16021687 }
1603−
1604− importVoxels.readFromSquareARGB32Pixels(pixels, pngImage.height());
1605− } else if (fileNameString.endsWith(".svo", Qt::CaseInsensitive)) {
1606− importVoxels.readFromSVOFile(fileName);
1607− } else if (fileNameString.endsWith(".schematic", Qt::CaseInsensitive)) {
1608− importVoxels.readFromSchematicFile(fileName);
1609− }
1610−
1611− VoxelNode* selectedNode = _voxels.getVoxelAt(_mouseVoxel.x, _mouseVoxel.y, _mouseVoxel.z, _mouseVoxel.s);
1612−
1613− // Recurse the Import Voxels tree, where everything is root relative, and send all the colored voxels to
1614− // the server as an set voxel message, this will also rebase the voxels to the new location
1615− unsigned char* calculatedOctCode = NULL;
1616− SendVoxelsOperationArgs args;
1617− args.lastSendTime = usecTimestampNow();
1618− args.packetsSent = 0;
1619− args.bytesSent = 0;
16201688
1621− int numBytesPacketHeader = populateTypeAndVersion(args.messageBuffer, PACKET_TYPE_SET_VOXEL_DESTRUCTIVE);
1689+ qDebug("column:%d, row:%d, voxel:%f,%f,%f,%f\n", columnNum, rowNum, _mouseVoxel.x, _mouseVoxel.y, _mouseVoxel.z, _mouseVoxel.s );
1690+
1691+ // send the insert/paste of these voxels
1692+ importVoxels.recurseTreeWithOperation(sendVoxelsOperation, &args);
16221693
1623− unsigned short int* sequenceAt = (unsigned short int*)&args.messageBuffer[numBytesPacketHeader];
1624− *sequenceAt = 0;
1625− args.bufferInUse = numBytesPacketHeader + sizeof(unsigned short int); // set to command + sequence
1694+ // If we have voxels left in the packet, then send the packet
1695+ if (args.bufferInUse > (numBytesPacketHeader + sizeof(unsigned short int))) {
1696+ controlledBroadcastToNodes(args.messageBuffer, args.bufferInUse, & NODE_TYPE_VOXEL_SERVER, 1);
16261697
1627− // we only need the selected voxel to get the newBaseOctCode, which we can actually calculate from the
1628− // voxel size/position details.
1629− if (selectedNode) {
1630− args.newBaseOctCode = selectedNode->getOctalCode();
1631− } else {
1632− args.newBaseOctCode = calculatedOctCode = pointToVoxel(_mouseVoxel.x, _mouseVoxel.y, _mouseVoxel.z, _mouseVoxel.s);
1633− }
16341698
1635− importVoxels.recurseTreeWithOperation(sendVoxelsOperation, &args);
1699+ args.packetsSent++;
1700+ args.bytesSent += args.bufferInUse;
1701+
1702+ uint64_t now = usecTimestampNow();
1703+ // dynamically sleep until we need to fire off the next set of voxels
1704+ uint64_t elapsed = now - args.lastSendTime;
1705+ int usecToSleep = CLIENT_TO_SERVER_VOXEL_SEND_INTERVAL_USECS - elapsed;
1706+
1707+ if (usecToSleep > 0) {
1708+ //qDebug("after sendVoxelsOperation: packet: %d bytes:%lld elapsed %lld usecs, sleeping for %d usecs!\n",
1709+ // args.packetsSent, (long long int)args.bytesSent, (long long int)elapsed, usecToSleep);
1710+ usleep(usecToSleep);
1711+ } else {
1712+ //qDebug("after sendVoxelsOperation: packet: %d bytes:%lld elapsed %lld usecs, no need to sleep!\n",
1713+ // args.packetsSent, (long long int)args.bytesSent, (long long int)elapsed);
1714+ }
1715+ args.lastSendTime = now;
1716+ }
1717+
1718+ if (calculatedOctCode) {
1719+ delete[] calculatedOctCode;
1720+ }
16361721
1637− // If we have voxels left in the packet, then send the packet
1638− if (args.bufferInUse > (numBytesPacketHeader + sizeof(unsigned short int))) {
1639− controlledBroadcastToNodes(args.messageBuffer, args.bufferInUse, & NODE_TYPE_VOXEL_SERVER, 1);
16401722 }
16411723
1642− if (calculatedOctCode) {
1643− delete[] calculatedOctCode;
1644− }
1645−
16461724 // restore the main window's active state
16471725 _window->activateWindow();
16481726 }
@@ -1735,6 +1813,8 @@ void Application::initMenu() { · 86 unmodified lines
17351813 _testPing->setChecked(true);
17361814 (_fullScreenMode = optionsMenu->addAction("Fullscreen", this, SLOT(setFullscreen(bool)), Qt::Key_F))->setCheckable(true);
17371815 optionsMenu->addAction("Webcam", &_webcam, SLOT(setEnabled(bool)))->setCheckable(true);
1816+ optionsMenu->addAction("Toggle Skeleton Tracking", &_webcam, SLOT(setSkeletonTrackingOn(bool)))->setCheckable(true);
1817+ optionsMenu->addAction("Cycle Webcam Send Mode", _webcam.getGrabber(), SLOT(cycleVideoSendMode()));
17381818 optionsMenu->addAction("Go Home", this, SLOT(goHome()));
17391819
17401820 QMenu* renderMenu = menuBar->addMenu("Render");
@@ -1762,7 +1842,6 @@ void Application::initMenu() { · 21 unmodified lines
17621842 (_renderLookatIndicatorOn = renderMenu->addAction("Lookat Indicator"))->setCheckable(true);
17631843 _renderLookatIndicatorOn->setChecked(true);
17641844 (_renderParticleSystemOn = renderMenu->addAction("Particle System"))->setCheckable(true);
1765− _renderParticleSystemOn->setChecked(true);
17661845 (_manualFirstPerson = renderMenu->addAction(
17671846 "First Person", this, SLOT(setRenderFirstPerson(bool)), Qt::Key_P))->setCheckable(true);
17681847 (_manualThirdPerson = renderMenu->addAction(
@@ -2039,6 +2118,7 @@ void Application::renderLookatIndicator(glm::vec3 pointOfInterest, Camera& which · 270 unmodified lines
20392118 }
20402119
20412120 void Application::update(float deltaTime) {
2121+
20422122 // Use Transmitter Hand to move hand if connected, else use mouse
20432123 if (_myTransmitter.isConnected()) {
20442124 const float HAND_FORCE_SCALING = 0.01f;
@@ -2071,11 +2151,46 @@ void Application::update(float deltaTime) { · 26 unmodified lines
20712151 // If the mouse is over another avatar's head...
20722152 glm::vec3 myLookAtFromMouse(eyePosition);
20732153 _myAvatar.getHead().setLookAtPosition(myLookAtFromMouse);
2154+ } else if (_isHoverVoxel) {
2155+ // Look at the hovered voxel
2156+ glm::vec3 lookAtSpot = getMouseVoxelWorldCoordinates(_hoverVoxel);
2157+ _myAvatar.getHead().setLookAtPosition(lookAtSpot);
20742158 } else {
2159+ // Just look in direction of the mouse ray
20752160 glm::vec3 myLookAtFromMouse(mouseRayOrigin + mouseRayDirection);
20762161 _myAvatar.getHead().setLookAtPosition(myLookAtFromMouse);
20772162 }
2078−
2163+
2164+ // Find the voxel we are hovering over, and respond if clicked
2165+ float distance;
2166+ BoxFace face;
2167+
2168+ // If we have clicked on a voxel, update it's color
2169+ if (_isHoverVoxelSounding) {
2170+ VoxelNode* hoveredNode = _voxels.getVoxelAt(_hoverVoxel.x, _hoverVoxel.y, _hoverVoxel.z, _hoverVoxel.s);
2171+ float bright = _audio.getCollisionSoundMagnitude();
2172+ nodeColor clickColor = { 255 * bright + _hoverVoxelOriginalColor[0] * (1.f - bright),
2173+ _hoverVoxelOriginalColor[1] * (1.f - bright),
2174+ _hoverVoxelOriginalColor[2] * (1.f - bright), 1 };
2175+ hoveredNode->setColor(clickColor);
2176+ if (bright < 0.01f) {
2177+ hoveredNode->setColor(_hoverVoxelOriginalColor);
2178+ _isHoverVoxelSounding = false;
2179+ }
2180+ } else {
2181+ // Check for a new hover voxel
2182+ glm::vec4 oldVoxel(_hoverVoxel.x, _hoverVoxel.y, _hoverVoxel.z, _hoverVoxel.s);
2183+ _isHoverVoxel = _voxels.findRayIntersection(mouseRayOrigin, mouseRayDirection, _hoverVoxel, distance, face);
2184+ if (MAKE_SOUND_ON_VOXEL_HOVER && _isHoverVoxel && glm::vec4(_hoverVoxel.x, _hoverVoxel.y, _hoverVoxel.z, _hoverVoxel.s) != oldVoxel) {
2185+ _hoverVoxelOriginalColor[0] = _hoverVoxel.red;
2186+ _hoverVoxelOriginalColor[1] = _hoverVoxel.green;
2187+ _hoverVoxelOriginalColor[2] = _hoverVoxel.blue;
2188+ _hoverVoxelOriginalColor[3] = 1;
2189+ _audio.startCollisionSound(1.0, HOVER_VOXEL_FREQUENCY * _hoverVoxel.s * TREE_SCALE, 0.0, HOVER_VOXEL_DECAY);
2190+ _isHoverVoxelSounding = true;
2191+ }
2192+ }
2193+
20792194 // If we are dragging on a voxel, add thrust according to the amount the mouse is dragging
20802195 const float VOXEL_GRAB_THRUST = 0.0f;
20812196 if (_mousePressed && (_mouseVoxel.s != 0)) {
@@ -2101,8 +2216,6 @@ void Application::update(float deltaTime) { · 19 unmodified lines
21012216 (fabs(_myAvatar.getVelocity().x) +
21022217 fabs(_myAvatar.getVelocity().y) +
21032218 fabs(_myAvatar.getVelocity().z)) / 3 < MAX_AVATAR_EDIT_VELOCITY) {
2104− float distance;
2105− BoxFace face;
21062219 if (_voxels.findRayIntersection(mouseRayOrigin, mouseRayDirection, _mouseVoxel, distance, face)) {
21072220 if (distance < MAX_VOXEL_EDIT_DISTANCE) {
21082221 // find the nearest voxel with the desired scale
@@ -2289,20 +2402,18 @@ void Application::update(float deltaTime) { · 180 unmodified lines
22892402 }
22902403
22912404 void Application::updateAvatar(float deltaTime) {
2292−
2293− // When head is rotated via touch/mouse look, slowly turn body to follow
2294− const float BODY_FOLLOW_HEAD_RATE = 0.5f;
2295− // update body yaw by body yaw delta
2405+
2406+ // rotate body yaw for yaw received from multitouch
22962407 _myAvatar.setOrientation(_myAvatar.getOrientation()
2297− * glm::quat(glm::vec3(0, _yawFromTouch * deltaTime * BODY_FOLLOW_HEAD_RATE, 0) * deltaTime));
2298− _yawFromTouch -= _yawFromTouch * deltaTime * BODY_FOLLOW_HEAD_RATE;
2408+ * glm::quat(glm::vec3(0, _yawFromTouch * deltaTime, 0)));
2409+ _yawFromTouch = 0.f;
22992410
23002411 // Update my avatar's state from gyros and/or webcam
23012412 _myAvatar.updateFromGyrosAndOrWebcam(_gyroLook->isChecked(),
23022413 glm::vec3(_headCameraPitchYawScale,
23032414 _headCameraPitchYawScale,
23042415 _headCameraPitchYawScale),
2305− _yawFromTouch,
2416+ 0.f,
23062417 _pitchFromTouch);
23072418
23082419 if (_serialHeadSensor.isActive()) {
@@ -2761,8 +2872,12 @@ void Application::displayOverlay() { · 452 unmodified lines
27612872 glDisable(GL_DEPTH_TEST);
27622873 glDisable(GL_LIGHTING);
27632874
2764− // Display a single screen-size quad to
2765− renderCollisionOverlay(_glWidget->width(), _glWidget->height(), _audio.getCollisionSoundMagnitude());
2875+ // Display a single screen-size quad to create an alpha blended 'collision' flash
2876+ float collisionSoundMagnitude = _audio.getCollisionSoundMagnitude();
2877+ const float VISIBLE_COLLISION_SOUND_MAGNITUDE = 0.5f;
2878+ if (collisionSoundMagnitude > VISIBLE_COLLISION_SOUND_MAGNITUDE) {
2879+ renderCollisionOverlay(_glWidget->width(), _glWidget->height(), _audio.getCollisionSoundMagnitude());
2880+ }
27662881
27672882 #ifndef _WIN32
27682883 _audio.render(_glWidget->width(), _glWidget->height());
@@ -3501,6 +3616,7 @@ void* Application::networkReceive(void* args) { · 732 unmodified lines
35013616 }
35023617
35033618 if (NodeList::getInstance()->getNodeSocket()->receive(&senderAddress, app->_incomingPacket, &bytesReceived)) {
3619+
35043620 app->_packetCount++;
35053621 app->_bytesCount += bytesReceived;
35063622
@@ -3545,13 +3661,11 @@ void* Application::networkReceive(void* args) { · 38 unmodified lines
35453661 Node* voxelServer = NodeList::getInstance()->soloNodeOfType(NODE_TYPE_VOXEL_SERVER);
35463662 if (voxelServer && socketMatch(voxelServer->getActiveSocket(), &senderAddress)) {
35473663 voxelServer->lock();
3548−
35493664 if (messageData[0] == PACKET_TYPE_ENVIRONMENT_DATA) {
35503665 app->_environment.parseData(&senderAddress, messageData, messageLength);
35513666 } else {
35523667 app->_voxels.parseData(messageData, messageLength);
35533668 }
3554−
35553669 voxelServer->unlock();
35563670 }
35573671 }

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t