diff --git a/interface/src/Application.cpp b/interface/src/Application.cpp index b02ffdb99e..7aa6042dba 100644 --- a/interface/src/Application.cpp +++ b/interface/src/Application.cpp @@ -1954,6 +1954,7 @@ void Application::initMenu() { optionsMenu->addAction("Webcam", &_webcam, SLOT(setEnabled(bool)))->setCheckable(true); optionsMenu->addAction("Skeleton Tracking", &_webcam, SLOT(setSkeletonTrackingOn(bool)))->setCheckable(true); (_wantCollisionsOn = optionsMenu->addAction("Turn collisions On", this, SLOT(toggleWantCollisionsOn())))->setCheckable(true); + _wantCollisionsOn->setChecked(true); optionsMenu->addAction("Cycle Webcam Send Mode", _webcam.getGrabber(), SLOT(cycleVideoSendMode())); optionsMenu->addAction("Webcam Texture", _webcam.getGrabber(), SLOT(setDepthOnly(bool)))->setCheckable(true); optionsMenu->addAction("Go Home", this, SLOT(goHome()), Qt::CTRL | Qt::Key_G); diff --git a/interface/src/avatar/Avatar.cpp b/interface/src/avatar/Avatar.cpp index e16ab73c93..d695cb4759 100755 --- a/interface/src/avatar/Avatar.cpp +++ b/interface/src/avatar/Avatar.cpp @@ -101,6 +101,7 @@ Avatar::Avatar(Node* owningNode) : _lastCollisionPosition(0, 0, 0), _speedBrakes(false), _isThrustOn(false), + _isCollisionsOn(true), _leadingAvatar(NULL), _voxels(this) { diff --git a/libraries/shared/src/OctalCode.cpp b/libraries/shared/src/OctalCode.cpp index eeea3385e9..5513d362ac 100644 --- a/libraries/shared/src/OctalCode.cpp +++ b/libraries/shared/src/OctalCode.cpp @@ -118,17 +118,19 @@ unsigned char * childOctalCode(unsigned char * parentOctalCode, char childNumber void voxelDetailsForCode(unsigned char * octalCode, VoxelPositionSize& voxelPositionSize) { float output[3]; memset(&output[0], 0, 3 * sizeof(float)); - float currentScale = 1.0; - - for (int i = 0; i < numberOfThreeBitSectionsInCode(octalCode); i++) { - currentScale *= 0.5; - int sectionIndex = sectionValue(octalCode + 1 + (3 * i / 8), (3 * i) % 8); + + if (octalCode) { + for (int i = 0; i < numberOfThreeBitSectionsInCode(octalCode); i++) { + currentScale *= 0.5; + int sectionIndex = sectionValue(octalCode + 1 + (BITS_IN_OCTAL * i / BITS_IN_BYTE), + (BITS_IN_OCTAL * i) % BITS_IN_BYTE); + + for (int j = 0; j < BITS_IN_OCTAL; j++) { + output[j] += currentScale * (int)oneAtBit(sectionIndex, (BITS_IN_BYTE - BITS_IN_OCTAL) + j); + } - for (int j = 0; j < 3; j++) { - output[j] += currentScale * (int)oneAtBit(sectionIndex, 5 + j); } - } voxelPositionSize.x = output[0]; voxelPositionSize.y = output[1];