From 0c992ef43dab1d3c12fbd397925b6ea319901e2c Mon Sep 17 00:00:00 2001 From: Jeroen Baert Date: Thu, 30 Jan 2014 13:20:37 +0100 Subject: [PATCH 001/120] Updated Ubuntu package requirements --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index bc32998113..92fe83c4e1 100644 --- a/README.md +++ b/README.md @@ -72,7 +72,7 @@ distributions. A Windows build is planned for the future, but not currently in development. On a fresh Ubuntu 13.10 install, these are all the packages you need to grab and build the hifi project: -
sudo apt-get install build-essential cmake git libcurl4-openssl-dev libqt5scripttools5 libqt5svg5-dev libqt5webkit5-dev libqt5location5 qtlocation5-dev qtdeclarative5-dev qtscript5-dev qtsensors5-dev qtmultimedia5-dev qtquick1-5-dev libasound2 libxmu-dev libxi-dev freeglut3-dev libasound2-dev libjack-dev
+
sudo apt-get install build-essential cmake git qttools5-dev libcurl4-openssl-dev libqt5scripttools5 libqt5svg5-dev libqt5webkit5-dev libqt5location5 qtlocation5-dev qtdeclarative5-dev qtscript5-dev qtsensors5-dev qtmultimedia5-dev qtquick1-5-dev libasound2 libxmu-dev libxi-dev freeglut3-dev libasound2-dev libjack-dev
Running Interface ----- From ec73edb8d88f80195d6b9708d6b6847db00c4cf4 Mon Sep 17 00:00:00 2001 From: stojce Date: Sun, 23 Feb 2014 13:54:22 +0100 Subject: [PATCH 002/120] restyled preferences dialog - Frameless dialog super class --- interface/resources/styles/global.qss | 35 ++ interface/src/Menu.cpp | 139 +----- interface/src/Menu.h | 2 + interface/src/ui/FramelessDialog.cpp | 23 + interface/src/ui/FramelessDialog.h | 27 ++ interface/src/ui/PreferencesDialog.cpp | 96 ++++ interface/src/ui/PreferencesDialog.h | 37 ++ interface/ui/preferencesDialog.ui | 646 +++++++++++++++++++++++++ 8 files changed, 871 insertions(+), 134 deletions(-) create mode 100644 interface/resources/styles/global.qss create mode 100644 interface/src/ui/FramelessDialog.cpp create mode 100644 interface/src/ui/FramelessDialog.h create mode 100644 interface/src/ui/PreferencesDialog.cpp create mode 100644 interface/src/ui/PreferencesDialog.h create mode 100644 interface/ui/preferencesDialog.ui diff --git a/interface/resources/styles/global.qss b/interface/resources/styles/global.qss new file mode 100644 index 0000000000..3ecb96fa8c --- /dev/null +++ b/interface/resources/styles/global.qss @@ -0,0 +1,35 @@ +* { + padding: 0; + margin: 0; +} + +FramelessDialog { + background-color: rgb(255, 255, 255); + font-family: Helvetica, Arial, sans-serif; + font-size: 16px; +} + +QLineEdit { + background-color: rgba(255, 255, 255, 1); + border-style: solid; + border-width: 1px; + border-color: #ccc; + padding: 7px; + opacity: 1; +} + +QLabel p { + color: #0e7077; + font-size: 23px; +} + +QPushButton { + border-width: 0; + border-radius: 9px; + border-radius: 9px; + font-family: Arial; + font-size: 18px; + font-weight: 100; + color: #ffffff; + padding: 10px 15px; +} diff --git a/interface/src/Menu.cpp b/interface/src/Menu.cpp index 327f905194..e3fd698ecf 100644 --- a/interface/src/Menu.cpp +++ b/interface/src/Menu.cpp @@ -71,7 +71,8 @@ Menu::Menu() : _voxelSizeScale(DEFAULT_OCTREE_SIZE_SCALE), _boundaryLevelAdjust(0), _maxVoxelPacketsPerSecond(DEFAULT_MAX_VOXEL_PPS), - _lastAdjust(usecTimestampNow()) + _lastAdjust(usecTimestampNow()), + _preferencesDialog() { Application *appInstance = Application::getInstance(); @@ -763,140 +764,10 @@ void Menu::login() { } void Menu::editPreferences() { - Application* applicationInstance = Application::getInstance(); - - QDialog dialog(applicationInstance->getWindow()); - dialog.setWindowTitle("Interface Preferences"); - QBoxLayout* layout = new QBoxLayout(QBoxLayout::TopToBottom); - dialog.setLayout(layout); - - QFormLayout* form = new QFormLayout(); - layout->addLayout(form, 1); - - QString faceURLString = applicationInstance->getAvatar()->getHead()->getFaceModel().getURL().toString(); - QLineEdit* faceURLEdit = new QLineEdit(faceURLString); - faceURLEdit->setMinimumWidth(QLINE_MINIMUM_WIDTH); - faceURLEdit->setPlaceholderText(DEFAULT_HEAD_MODEL_URL.toString()); - form->addRow("Face URL:", faceURLEdit); - - QString skeletonURLString = applicationInstance->getAvatar()->getSkeletonModel().getURL().toString(); - QLineEdit* skeletonURLEdit = new QLineEdit(skeletonURLString); - skeletonURLEdit->setMinimumWidth(QLINE_MINIMUM_WIDTH); - skeletonURLEdit->setPlaceholderText(DEFAULT_BODY_MODEL_URL.toString()); - form->addRow("Skeleton URL:", skeletonURLEdit); - - QString displayNameString = applicationInstance->getAvatar()->getDisplayName(); - QLineEdit* displayNameEdit = new QLineEdit(displayNameString); - displayNameEdit->setMinimumWidth(QLINE_MINIMUM_WIDTH); - form->addRow("Display name:", displayNameEdit); - - QSlider* pupilDilation = new QSlider(Qt::Horizontal); - pupilDilation->setValue(applicationInstance->getAvatar()->getHead()->getPupilDilation() * pupilDilation->maximum()); - form->addRow("Pupil Dilation:", pupilDilation); - - QSlider* faceshiftEyeDeflection = new QSlider(Qt::Horizontal); - faceshiftEyeDeflection->setValue(_faceshiftEyeDeflection * faceshiftEyeDeflection->maximum()); - form->addRow("Faceshift Eye Deflection:", faceshiftEyeDeflection); - - QSpinBox* fieldOfView = new QSpinBox(); - fieldOfView->setMaximum(180); - fieldOfView->setMinimum(1); - fieldOfView->setValue(_fieldOfView); - form->addRow("Vertical Field of View (Degrees):", fieldOfView); - - QDoubleSpinBox* leanScale = new QDoubleSpinBox(); - leanScale->setValue(applicationInstance->getAvatar()->getLeanScale()); - form->addRow("Lean Scale:", leanScale); - - QDoubleSpinBox* avatarScale = new QDoubleSpinBox(); - avatarScale->setValue(applicationInstance->getAvatar()->getScale()); - form->addRow("Avatar Scale:", avatarScale); - - QSpinBox* audioJitterBufferSamples = new QSpinBox(); - audioJitterBufferSamples->setMaximum(10000); - audioJitterBufferSamples->setMinimum(-10000); - audioJitterBufferSamples->setValue(_audioJitterBufferSamples); - form->addRow("Audio Jitter Buffer Samples (0 for automatic):", audioJitterBufferSamples); - - QSpinBox* maxVoxels = new QSpinBox(); - const int MAX_MAX_VOXELS = 5000000; - const int MIN_MAX_VOXELS = 0; - const int STEP_MAX_VOXELS = 50000; - maxVoxels->setMaximum(MAX_MAX_VOXELS); - maxVoxels->setMinimum(MIN_MAX_VOXELS); - maxVoxels->setSingleStep(STEP_MAX_VOXELS); - maxVoxels->setValue(_maxVoxels); - form->addRow("Maximum Voxels:", maxVoxels); - - QSpinBox* maxVoxelsPPS = new QSpinBox(); - const int MAX_MAX_VOXELS_PPS = 6000; - const int MIN_MAX_VOXELS_PPS = 60; - const int STEP_MAX_VOXELS_PPS = 10; - maxVoxelsPPS->setMaximum(MAX_MAX_VOXELS_PPS); - maxVoxelsPPS->setMinimum(MIN_MAX_VOXELS_PPS); - maxVoxelsPPS->setSingleStep(STEP_MAX_VOXELS_PPS); - maxVoxelsPPS->setValue(_maxVoxelPacketsPerSecond); - form->addRow("Maximum Voxels Packets Per Second:", maxVoxelsPPS); - - QDialogButtonBox* buttons = new QDialogButtonBox(QDialogButtonBox::Ok | QDialogButtonBox::Cancel); - dialog.connect(buttons, SIGNAL(accepted()), SLOT(accept())); - dialog.connect(buttons, SIGNAL(rejected()), SLOT(reject())); - layout->addWidget(buttons); - - int ret = dialog.exec(); - if (ret == QDialog::Accepted) { - QUrl faceModelURL(faceURLEdit->text()); - - bool shouldDispatchIdentityPacket = false; - - if (faceModelURL.toString() != faceURLString) { - // change the faceModelURL in the profile, it will also update this user's BlendFace - applicationInstance->getAvatar()->setFaceModelURL(faceModelURL); - shouldDispatchIdentityPacket = true; - } - - QUrl skeletonModelURL(skeletonURLEdit->text()); - - if (skeletonModelURL.toString() != skeletonURLString) { - // change the skeletonModelURL in the profile, it will also update this user's Body - applicationInstance->getAvatar()->setSkeletonModelURL(skeletonModelURL); - shouldDispatchIdentityPacket = true; - } - - QString displayNameStr(displayNameEdit->text()); - - if (displayNameStr != displayNameString) { - applicationInstance->getAvatar()->setDisplayName(displayNameStr); - shouldDispatchIdentityPacket = true; - } - - if (shouldDispatchIdentityPacket) { - applicationInstance->getAvatar()->sendIdentityPacket(); - } - - applicationInstance->getAvatar()->getHead()->setPupilDilation(pupilDilation->value() / (float)pupilDilation->maximum()); - - _maxVoxels = maxVoxels->value(); - applicationInstance->getVoxels()->setMaxVoxels(_maxVoxels); - - _maxVoxelPacketsPerSecond = maxVoxelsPPS->value(); - - applicationInstance->getAvatar()->setLeanScale(leanScale->value()); - applicationInstance->getAvatar()->setClampedTargetScale(avatarScale->value()); - - _audioJitterBufferSamples = audioJitterBufferSamples->value(); - - if (_audioJitterBufferSamples != 0) { - applicationInstance->getAudio()->setJitterBufferSamples(_audioJitterBufferSamples); - } - - _fieldOfView = fieldOfView->value(); - applicationInstance->resizeGL(applicationInstance->getGLWidget()->width(), applicationInstance->getGLWidget()->height()); - - _faceshiftEyeDeflection = faceshiftEyeDeflection->value() / (float)faceshiftEyeDeflection->maximum(); + if (! _preferencesDialog) { + _preferencesDialog = new PreferencesDialog(Application::getInstance()->getGLWidget()); } - - sendFakeEnterEvent(); + _preferencesDialog->show(); } void Menu::goToDomain(const QString newDomain) { diff --git a/interface/src/Menu.h b/interface/src/Menu.h index bd9cdc523e..4e75bc6fb9 100644 --- a/interface/src/Menu.h +++ b/interface/src/Menu.h @@ -15,6 +15,7 @@ #include #include +#include "ui/PreferencesDialog.h" const float ADJUST_LOD_DOWN_FPS = 40.0; const float ADJUST_LOD_UP_FPS = 55.0; @@ -173,6 +174,7 @@ private: QMenu* _activeScriptsMenu; QString replaceLastOccurrence(QChar search, QChar replace, QString string); quint64 _lastAdjust; + QPointer _preferencesDialog; }; namespace MenuOption { diff --git a/interface/src/ui/FramelessDialog.cpp b/interface/src/ui/FramelessDialog.cpp new file mode 100644 index 0000000000..ddd056fd32 --- /dev/null +++ b/interface/src/ui/FramelessDialog.cpp @@ -0,0 +1,23 @@ +// +// FramelessDialog.cpp +// hifi +// +// Created by Stojce Slavkovski on 2/20/14. +// +// + +#include "FramelessDialog.h" +#include +#include + +FramelessDialog::FramelessDialog(QWidget *parent, Qt::WindowFlags flags) : QDialog(parent, flags | Qt::FramelessWindowHint) { + QFile styleSheet("resources/styles/global.qss"); + if (styleSheet.open(QIODevice::ReadOnly)) { + setStyleSheet(styleSheet.readAll()); + } + setWindowOpacity(0.95); +} + +FramelessDialog::~FramelessDialog() { + +} diff --git a/interface/src/ui/FramelessDialog.h b/interface/src/ui/FramelessDialog.h new file mode 100644 index 0000000000..ca11c3eb2f --- /dev/null +++ b/interface/src/ui/FramelessDialog.h @@ -0,0 +1,27 @@ +// +// FramelessDialog.h +// hifi +// +// Created by Stojce Slavkovski on 2/20/14. +// +// + +#ifndef __hifi__FramelessDialog__ +#define __hifi__FramelessDialog__ + +#include +#include +#include +#include +#include + +class FramelessDialog : public QDialog { + Q_OBJECT + +public: + FramelessDialog(QWidget* parent = 0, Qt::WindowFlags flags = 0); + ~FramelessDialog(); + +}; + +#endif /* defined(__hifi__FramelessDialog__) */ diff --git a/interface/src/ui/PreferencesDialog.cpp b/interface/src/ui/PreferencesDialog.cpp new file mode 100644 index 0000000000..df3e94f31f --- /dev/null +++ b/interface/src/ui/PreferencesDialog.cpp @@ -0,0 +1,96 @@ +// +// PreferencesDialog.cpp +// hifi +// +// Created by Stojce Slavkovski on 2/22/14. +// +// + +#include "PreferencesDialog.h" +#include "Application.h" +#include "Menu.h" + +PreferencesDialog::PreferencesDialog(QWidget* parent, Qt::WindowFlags flags) : FramelessDialog(parent, flags) { + ui.setupUi(this); + setAttribute(Qt::WA_DeleteOnClose); + loadPreferences(); +} + +void PreferencesDialog::accept() { + savePreferences(); + close(); +} + +void PreferencesDialog::loadPreferences() { + + MyAvatar* myAvatar = Application::getInstance()->getAvatar(); + Menu* menuInstance = Menu::getInstance(); + + _displayNameString = myAvatar->getDisplayName(); + ui.displayNameEdit->setText(_displayNameString); + + _faceURLString = myAvatar->getHead()->getFaceModel().getURL().toString(); + ui.faceURLEdit->setText(_faceURLString); + + _skeletonURLString = myAvatar->getSkeletonModel().getURL().toString(); + ui.skeletonURLEdit->setText(_skeletonURLString); + + float pupilDilation = myAvatar->getHead()->getPupilDilation(); + ui.pupilDilationSlider->setValue(pupilDilation * ui.pupilDilationSlider->maximum()); + + ui.faceshiftEyeDeflectionSider->setValue(menuInstance->getFaceshiftEyeDeflection() * + ui.faceshiftEyeDeflectionSider->maximum()); + + ui.fieldOfViewSpin->setValue(menuInstance->getFieldOfView() * ui.fieldOfViewSpin->maximum()); + + ui.leanScaleSpin->setValue(myAvatar->getLeanScale()); + + ui.avatarScaleSpin->setValue(myAvatar->getScale()); + + ui.maxVoxelsSpin->setValue(menuInstance->getMaxVoxels()); + + ui.maxVoxelsPPSSpin->setValue(menuInstance->getMaxVoxelPacketsPerSecond()); +} + +void PreferencesDialog::savePreferences() { + + MyAvatar* myAvatar = Application::getInstance()->getAvatar(); + bool shouldDispatchIdentityPacket = false; + + QString displayNameStr(ui.displayNameEdit->text()); + if (displayNameStr != _displayNameString) { + myAvatar->setDisplayName(displayNameStr); + shouldDispatchIdentityPacket = true; + } + + QUrl faceModelURL(ui.faceURLEdit->text()); + if (faceModelURL.toString() != _faceURLString) { + // change the faceModelURL in the profile, it will also update this user's BlendFace + myAvatar->setFaceModelURL(faceModelURL); + shouldDispatchIdentityPacket = true; + } + + QUrl skeletonModelURL(ui.skeletonURLEdit->text()); + if (skeletonModelURL.toString() != _skeletonURLString) { + // change the skeletonModelURL in the profile, it will also update this user's Body + myAvatar->setSkeletonModelURL(skeletonModelURL); + shouldDispatchIdentityPacket = true; + } + + if (shouldDispatchIdentityPacket) { + myAvatar->sendIdentityPacket(); + } + + myAvatar->getHead()->setPupilDilation(ui.pupilDilationSlider->value() / (float)ui.pupilDilationSlider->maximum()); + Application::getInstance()->getVoxels()->setMaxVoxels(ui.maxVoxelsSpin->value()); + + + myAvatar->setLeanScale(ui.leanScaleSpin->value()); + myAvatar->setClampedTargetScale(ui.avatarScaleSpin->value()); + + Application::getInstance()->resizeGL(Application::getInstance()->getGLWidget()->width(), + Application::getInstance()->getGLWidget()->height()); + + // _maxVoxelPacketsPerSecond = maxVoxelsPPS->value(); + // _faceshiftEyeDeflection = faceshiftEyeDeflection->value() / (float)faceshiftEyeDeflection->maximum(); +} diff --git a/interface/src/ui/PreferencesDialog.h b/interface/src/ui/PreferencesDialog.h new file mode 100644 index 0000000000..d5cb41c7df --- /dev/null +++ b/interface/src/ui/PreferencesDialog.h @@ -0,0 +1,37 @@ +// +// PreferencesDialog.h +// hifi +// +// Created by Stojce Slavkovski on 2/22/14. +// +// + +#ifndef __hifi__PreferencesDialog__ +#define __hifi__PreferencesDialog__ + +#include "FramelessDialog.h" +#include "ui_preferencesDialog.h" + +#include + +class PreferencesDialog : public FramelessDialog { + Q_OBJECT + +public: + PreferencesDialog(QWidget* parent = 0, Qt::WindowFlags flags = 0); + +private: + Ui_PreferencesDialog ui; + void loadPreferences(); + void savePreferences(); + + QString _faceURLString; + QString _skeletonURLString; + QString _displayNameString; + +private slots: + void accept(); + +}; + +#endif /* defined(__hifi__PreferencesDialog__) */ diff --git a/interface/ui/preferencesDialog.ui b/interface/ui/preferencesDialog.ui new file mode 100644 index 0000000000..7c89eb15c9 --- /dev/null +++ b/interface/ui/preferencesDialog.ui @@ -0,0 +1,646 @@ + + + PreferencesDialog + + + + 0 + 0 + 611 + 745 + + + + + + 30 + 30 + 555 + 596 + + + + + + + + 23 + + + + color: #0e7077 + + + Avatar + + + faceURLEdit + + + + + + + + 0 + 0 + + + + color: #0e7077 + + + <html><head/><body><p>Avatar display name <span style=" color:#909090;">(optional)</span></p></body></html> + + + displayNameEdit + + + + + + + + 0 + 0 + + + + + 280 + 0 + + + + Qt::LeftToRight + + + + + + Not showing a name + + + + + + + color: #0e7077 + + + Head + + + faceURLEdit + + + + + + + + + + color: #0e7077 + + + Body + + + faceURLEdit + + + + + + + + + + + 23 + + + + color: #0e7077 + + + Advanced Tuning + + + + + + + It's not recomended that you play with these settings unless you've looked into exactly what they do. + + + false + + + true + + + + + + + + 20 + 50 + false + + + + color: #0e7077 + + + <p>Avatar</p> + + + + + + + + 0 + 0 + + + + background-color: #fff + + + + + 7 + 0 + 531 + 26 + + + + + + + Lean scale (applies to Faceshift users) + + + leanScaleSpin + + + + + + + Qt::Horizontal + + + + 40 + 20 + + + + + + + + + + + + + + + + + Vertical field of view + + + fieldOfViewSpin + + + + + + + Qt::Horizontal + + + + 40 + 20 + + + + + + + + 1 + + + 180 + + + + + + + + + + 0 + 0 + + + + background-color: #fff + + + + + 7 + 0 + 531 + 26 + + + + + + + Avatar scale (default is 1.0) + + + avatarScaleSpin + + + + + + + Qt::Horizontal + + + + 40 + 20 + + + + + + + + + + + + + + + + + Pupil dillation + + + + + + + Qt::Horizontal + + + + 40 + 20 + + + + + + + + + 0 + 0 + + + + Qt::Horizontal + + + + + + + + + + 0 + 0 + + + + background-color: #fff + + + + + 7 + 0 + 531 + 26 + + + + + + + Faceshift eye detection + + + avatarScaleSpin + + + + + + + Qt::Horizontal + + + + 40 + 20 + + + + + + + + + 0 + 0 + + + + Qt::Horizontal + + + + + + + + + + + + 20 + 50 + false + + + + color: #0e7077 + + + <html><head/><body><p>Voxels</p></body></html> + + + + + + + + 0 + 0 + + + + background-color: #fff + + + + + 7 + 0 + 531 + 26 + + + + + + + Maximum voxels + + + leanScaleSpin + + + + + + + Qt::Horizontal + + + + 40 + 20 + + + + + + + + 5000000 + + + 50000 + + + + + + + + + + + + 0 + 0 + + + + background-color: #fff + + + + + 7 + 0 + 531 + 26 + + + + + + + Max voxels sent each second + + + leanScaleSpin + + + + + + + Qt::Horizontal + + + + 40 + 20 + + + + + + + + 60 + + + 6000 + + + 10 + + + + + + + + + + + + + 0 + 665 + 616 + 80 + + + + background-color: #0e7077 + + + + + 0 + 20 + 591 + 41 + + + + + + + Qt::Horizontal + + + + 0 + 0 + + + + + + + + Cancel + + + + + + + background-color: #fff; +color: #0e7077 + + + Save all changes + + + true + + + + + + + + + + FramelessDialog + 1 + + + + displayNameEdit + faceURLEdit + leanScaleSpin + fieldOfViewSpin + avatarScaleSpin + pupilDilationSlider + + + + + cancelButton + clicked() + PreferencesDialog + close() + + + 372 + 700 + + + 528 + -9 + + + + + defaultButton + clicked() + PreferencesDialog + accept() + + + 20 + 20 + + + 20 + 20 + + + + + From 1e2cd0c1a2c93b3d3b4ff8301e5e1af15e5a0a26 Mon Sep 17 00:00:00 2001 From: stojce Date: Tue, 25 Feb 2014 20:36:14 +0100 Subject: [PATCH 003/120] UI changes --- interface/resources/styles/avatar.svg | 27 + interface/resources/styles/close.svg | 14 + interface/resources/styles/down.svg | 9 + interface/resources/styles/slider-bg.svg | 10 + interface/resources/styles/slider-handle.svg | 10 + interface/resources/styles/up.svg | 9 + interface/resources/styles/wrench.svg | 9 + interface/src/Menu.h | 5 +- interface/src/ui/PreferencesDialog.cpp | 20 +- interface/ui/preferencesDialog.ui | 493 ++++++++----------- 10 files changed, 320 insertions(+), 286 deletions(-) create mode 100644 interface/resources/styles/avatar.svg create mode 100644 interface/resources/styles/close.svg create mode 100644 interface/resources/styles/down.svg create mode 100644 interface/resources/styles/slider-bg.svg create mode 100644 interface/resources/styles/slider-handle.svg create mode 100644 interface/resources/styles/up.svg create mode 100644 interface/resources/styles/wrench.svg diff --git a/interface/resources/styles/avatar.svg b/interface/resources/styles/avatar.svg new file mode 100644 index 0000000000..f9382edee4 --- /dev/null +++ b/interface/resources/styles/avatar.svg @@ -0,0 +1,27 @@ + + + + + + + + diff --git a/interface/resources/styles/close.svg b/interface/resources/styles/close.svg new file mode 100644 index 0000000000..8fe4bf4bdb --- /dev/null +++ b/interface/resources/styles/close.svg @@ -0,0 +1,14 @@ + + + + + + + + + + diff --git a/interface/resources/styles/down.svg b/interface/resources/styles/down.svg new file mode 100644 index 0000000000..983ccd9597 --- /dev/null +++ b/interface/resources/styles/down.svg @@ -0,0 +1,9 @@ + + + + + + diff --git a/interface/resources/styles/slider-bg.svg b/interface/resources/styles/slider-bg.svg new file mode 100644 index 0000000000..36c6478026 --- /dev/null +++ b/interface/resources/styles/slider-bg.svg @@ -0,0 +1,10 @@ + + + + + + + + diff --git a/interface/resources/styles/slider-handle.svg b/interface/resources/styles/slider-handle.svg new file mode 100644 index 0000000000..5d87e8599c --- /dev/null +++ b/interface/resources/styles/slider-handle.svg @@ -0,0 +1,10 @@ + + + + + + + + + diff --git a/interface/resources/styles/up.svg b/interface/resources/styles/up.svg new file mode 100644 index 0000000000..d122c4801e --- /dev/null +++ b/interface/resources/styles/up.svg @@ -0,0 +1,9 @@ + + + + + + diff --git a/interface/resources/styles/wrench.svg b/interface/resources/styles/wrench.svg new file mode 100644 index 0000000000..5019f92b18 --- /dev/null +++ b/interface/resources/styles/wrench.svg @@ -0,0 +1,9 @@ + + + + + + diff --git a/interface/src/Menu.h b/interface/src/Menu.h index 5c1e26933d..81089473d3 100644 --- a/interface/src/Menu.h +++ b/interface/src/Menu.h @@ -65,10 +65,12 @@ public: void triggerOption(const QString& menuOption); QAction* getActionForOption(const QString& menuOption); bool isVoxelModeActionChecked(); - + float getAudioJitterBufferSamples() const { return _audioJitterBufferSamples; } + void setAudioJitterBufferSamples(int audioJitterBufferSamples) { _audioJitterBufferSamples = audioJitterBufferSamples; } float getFieldOfView() const { return _fieldOfView; } float getFaceshiftEyeDeflection() const { return _faceshiftEyeDeflection; } + void setFaceshiftEyeDeflection(float faceshiftEyeDeflection) { _faceshiftEyeDeflection = faceshiftEyeDeflection; } BandwidthDialog* getBandwidthDialog() const { return _bandwidthDialog; } FrustumDrawMode getFrustumDrawMode() const { return _frustumDrawMode; } ViewFrustumOffset getViewFrustumOffset() const { return _viewFrustumOffset; } @@ -89,6 +91,7 @@ public: // User Tweakable PPS from Voxel Server int getMaxVoxelPacketsPerSecond() const { return _maxVoxelPacketsPerSecond; } + void setMaxVoxelPacketsPerSecond(int maxVoxelPacketsPerSecond) { _maxVoxelPacketsPerSecond = maxVoxelPacketsPerSecond; } virtual QMenu* getActiveScriptsMenu() { return _activeScriptsMenu;} virtual QAction* addActionToQMenuAndActionHash(QMenu* destinationMenu, diff --git a/interface/src/ui/PreferencesDialog.cpp b/interface/src/ui/PreferencesDialog.cpp index df3e94f31f..de585d0a2a 100644 --- a/interface/src/ui/PreferencesDialog.cpp +++ b/interface/src/ui/PreferencesDialog.cpp @@ -35,13 +35,15 @@ void PreferencesDialog::loadPreferences() { _skeletonURLString = myAvatar->getSkeletonModel().getURL().toString(); ui.skeletonURLEdit->setText(_skeletonURLString); - float pupilDilation = myAvatar->getHead()->getPupilDilation(); - ui.pupilDilationSlider->setValue(pupilDilation * ui.pupilDilationSlider->maximum()); + ui.pupilDilationSlider->setValue(myAvatar->getHead()->getPupilDilation() * + ui.pupilDilationSlider->maximum()); ui.faceshiftEyeDeflectionSider->setValue(menuInstance->getFaceshiftEyeDeflection() * ui.faceshiftEyeDeflectionSider->maximum()); - ui.fieldOfViewSpin->setValue(menuInstance->getFieldOfView() * ui.fieldOfViewSpin->maximum()); + ui.audioJitterSpin->setValue(menuInstance->getAudioJitterBufferSamples()); + + ui.fieldOfViewSpin->setValue(menuInstance->getFieldOfView()); ui.leanScaleSpin->setValue(myAvatar->getLeanScale()); @@ -82,15 +84,17 @@ void PreferencesDialog::savePreferences() { } myAvatar->getHead()->setPupilDilation(ui.pupilDilationSlider->value() / (float)ui.pupilDilationSlider->maximum()); - Application::getInstance()->getVoxels()->setMaxVoxels(ui.maxVoxelsSpin->value()); - - myAvatar->setLeanScale(ui.leanScaleSpin->value()); myAvatar->setClampedTargetScale(ui.avatarScaleSpin->value()); + Application::getInstance()->getVoxels()->setMaxVoxels(ui.maxVoxelsSpin->value()); Application::getInstance()->resizeGL(Application::getInstance()->getGLWidget()->width(), Application::getInstance()->getGLWidget()->height()); + + Menu::getInstance()->setFaceshiftEyeDeflection(ui.faceshiftEyeDeflectionSider->value() / + (float)ui.faceshiftEyeDeflectionSider->maximum()); + Menu::getInstance()->setMaxVoxelPacketsPerSecond(ui.maxVoxelsPPSSpin->value()); + + Menu::getInstance()->setAudioJitterBufferSamples(ui.audioJitterSpin->value()); - // _maxVoxelPacketsPerSecond = maxVoxelsPPS->value(); - // _faceshiftEyeDeflection = faceshiftEyeDeflection->value() / (float)faceshiftEyeDeflection->maximum(); } diff --git a/interface/ui/preferencesDialog.ui b/interface/ui/preferencesDialog.ui index 7c89eb15c9..8fed57c06b 100644 --- a/interface/ui/preferencesDialog.ui +++ b/interface/ui/preferencesDialog.ui @@ -7,16 +7,16 @@ 0 0 611 - 745 + 805 30 - 30 + 0 555 - 596 + 701 @@ -96,7 +96,14 @@ - + + + + 0 + 0 + + + @@ -160,55 +167,34 @@ - - - - 0 - 0 - - - - background-color: #fff - - - - - 7 - 0 - 531 - 26 - - - - - - - Lean scale (applies to Faceshift users) - - - leanScaleSpin - - - - - - - Qt::Horizontal - - - - 40 - 20 - - - - - - - - - - + + + + + Lean scale (applies to Faceshift users) + + + leanScaleSpin + + + + + + + Qt::Horizontal + + + + 40 + 20 + + + + + + + + @@ -248,55 +234,34 @@ - - - - 0 - 0 - - - - background-color: #fff - - - - - 7 - 0 - 531 - 26 - - - - - - - Avatar scale (default is 1.0) - - - avatarScaleSpin - - - - - - - Qt::Horizontal - - - - 40 - 20 - - - - - - - - - - + + + + + Avatar scale (default is 1.0) + + + avatarScaleSpin + + + + + + + Qt::Horizontal + + + + 40 + 20 + + + + + + + + @@ -336,65 +301,81 @@ - - - - 0 - 0 - - - - background-color: #fff - - - - - 7 - 0 - 531 - 26 - - - - - - - Faceshift eye detection - - - avatarScaleSpin - - - - - - - Qt::Horizontal - - - - 40 - 20 - - - - - - - - - 0 - 0 - - - - Qt::Horizontal - - - - - - + + + + + Audio Jitter Buffer Samples (0 for automatic) + + + + + + + Qt::Horizontal + + + + 40 + 20 + + + + + + + + -10000 + + + 10000 + + + 1 + + + + + + + + + + + Faceshift eye detection + + + avatarScaleSpin + + + + + + + Qt::Horizontal + + + + 40 + 20 + + + + + + + + + 0 + 0 + + + + Qt::Horizontal + + + + @@ -414,123 +395,81 @@ - - - - 0 - 0 - - - - background-color: #fff - - - - - 7 - 0 - 531 - 26 - - - - - - - Maximum voxels - - - leanScaleSpin - - - - - - - Qt::Horizontal - - - - 40 - 20 - - - - - - - - 5000000 - - - 50000 - - - - - - + + + + + Maximum voxels + + + leanScaleSpin + + + + + + + Qt::Horizontal + + + + 40 + 20 + + + + + + + + 5000000 + + + 50000 + + + + - - - - 0 - 0 - - - - background-color: #fff - - - - - 7 - 0 - 531 - 26 - - - - - - - Max voxels sent each second - - - leanScaleSpin - - - - - - - Qt::Horizontal - - - - 40 - 20 - - - - - - - - 60 - - - 6000 - - - 10 - - - - - - + + + + + Max voxels sent each second + + + leanScaleSpin + + + + + + + Qt::Horizontal + + + + 40 + 20 + + + + + + + + 60 + + + 6000 + + + 10 + + + + @@ -538,7 +477,7 @@ 0 - 665 + 725 616 80 From 303fddd93b6ba503557236b4f35e3701561fc2ec Mon Sep 17 00:00:00 2001 From: stojce Date: Tue, 25 Feb 2014 21:19:43 +0100 Subject: [PATCH 004/120] Bad merge fix --- interface/src/Menu.cpp | 2 -- 1 file changed, 2 deletions(-) diff --git a/interface/src/Menu.cpp b/interface/src/Menu.cpp index 5f8cc5c4dc..662f91548f 100644 --- a/interface/src/Menu.cpp +++ b/interface/src/Menu.cpp @@ -71,8 +71,6 @@ Menu::Menu() : _boundaryLevelAdjust(0), _maxVoxelPacketsPerSecond(DEFAULT_MAX_VOXEL_PPS), _lastAdjust(usecTimestampNow()), - _loginAction(NULL) - _lastAdjust(usecTimestampNow()), _preferencesDialog() { Application *appInstance = Application::getInstance(); From 6383457e4e11f777c109e1fbec832569904026e8 Mon Sep 17 00:00:00 2001 From: stojce Date: Wed, 26 Feb 2014 22:15:12 +0100 Subject: [PATCH 005/120] styling bad merge fix --- interface/resources/styles/global.qss | 32 +++++- interface/src/Menu.cpp | 135 +------------------------ interface/src/ui/FramelessDialog.cpp | 1 + interface/src/ui/PreferencesDialog.cpp | 1 - 4 files changed, 35 insertions(+), 134 deletions(-) diff --git a/interface/resources/styles/global.qss b/interface/resources/styles/global.qss index 3ecb96fa8c..e3548fb52e 100644 --- a/interface/resources/styles/global.qss +++ b/interface/resources/styles/global.qss @@ -26,10 +26,40 @@ QLabel p { QPushButton { border-width: 0; border-radius: 9px; - border-radius: 9px; font-family: Arial; font-size: 18px; font-weight: 100; color: #ffffff; padding: 10px 15px; } + + +QSpinBox { + padding: 5px; + border-width: 1; + +} + +QSpinBox::up-button { + + width: 25px; + height: 18px; + background-image: url(resources/styles/up.svg); + background-repeat: no-repeat; + border: 1px #ccc solid; + + border-top-left-radius: 2px; + border-top-right-radius: 2px; +} + +QSpinBox::down-button { + + width: 25px; + height: 18px; + background-image: url(resources/styles/down.svg); + background-repeat: no-repeat; + border: 1px #ccc solid; + + border-top-left-radius: 2px; + border-top-right-radius: 2px; +} diff --git a/interface/src/Menu.cpp b/interface/src/Menu.cpp index 662f91548f..d3a0d7f8c1 100644 --- a/interface/src/Menu.cpp +++ b/interface/src/Menu.cpp @@ -792,139 +792,10 @@ void Menu::loginForCurrentDomain() { } void Menu::editPreferences() { - Application* applicationInstance = Application::getInstance(); - - QDialog dialog(applicationInstance->getWindow()); - dialog.setWindowTitle("Interface Preferences"); - - QBoxLayout* layout = new QBoxLayout(QBoxLayout::TopToBottom); - dialog.setLayout(layout); - - QFormLayout* form = new QFormLayout(); - layout->addLayout(form, 1); - - QString faceURLString = applicationInstance->getAvatar()->getHead()->getFaceModel().getURL().toString(); - QLineEdit* faceURLEdit = new QLineEdit(faceURLString); - faceURLEdit->setMinimumWidth(QLINE_MINIMUM_WIDTH); - faceURLEdit->setPlaceholderText(DEFAULT_HEAD_MODEL_URL.toString()); - form->addRow("Face URL:", faceURLEdit); - - QString skeletonURLString = applicationInstance->getAvatar()->getSkeletonModel().getURL().toString(); - QLineEdit* skeletonURLEdit = new QLineEdit(skeletonURLString); - skeletonURLEdit->setMinimumWidth(QLINE_MINIMUM_WIDTH); - skeletonURLEdit->setPlaceholderText(DEFAULT_BODY_MODEL_URL.toString()); - form->addRow("Skeleton URL:", skeletonURLEdit); - - QString displayNameString = applicationInstance->getAvatar()->getDisplayName(); - QLineEdit* displayNameEdit = new QLineEdit(displayNameString); - displayNameEdit->setMinimumWidth(QLINE_MINIMUM_WIDTH); - form->addRow("Display name:", displayNameEdit); - - QSlider* pupilDilation = new QSlider(Qt::Horizontal); - pupilDilation->setValue(applicationInstance->getAvatar()->getHead()->getPupilDilation() * pupilDilation->maximum()); - form->addRow("Pupil Dilation:", pupilDilation); - - QSlider* faceshiftEyeDeflection = new QSlider(Qt::Horizontal); - faceshiftEyeDeflection->setValue(_faceshiftEyeDeflection * faceshiftEyeDeflection->maximum()); - form->addRow("Faceshift Eye Deflection:", faceshiftEyeDeflection); - - QSpinBox* fieldOfView = new QSpinBox(); - fieldOfView->setMaximum(180); - fieldOfView->setMinimum(1); - fieldOfView->setValue(_fieldOfView); - form->addRow("Vertical Field of View (Degrees):", fieldOfView); - - QDoubleSpinBox* leanScale = new QDoubleSpinBox(); - leanScale->setValue(applicationInstance->getAvatar()->getLeanScale()); - form->addRow("Lean Scale:", leanScale); - - QDoubleSpinBox* avatarScale = new QDoubleSpinBox(); - avatarScale->setValue(applicationInstance->getAvatar()->getScale()); - form->addRow("Avatar Scale:", avatarScale); - - QSpinBox* audioJitterBufferSamples = new QSpinBox(); - audioJitterBufferSamples->setMaximum(10000); - audioJitterBufferSamples->setMinimum(-10000); - audioJitterBufferSamples->setValue(_audioJitterBufferSamples); - form->addRow("Audio Jitter Buffer Samples (0 for automatic):", audioJitterBufferSamples); - - QSpinBox* maxVoxels = new QSpinBox(); - const int MAX_MAX_VOXELS = 5000000; - const int MIN_MAX_VOXELS = 0; - const int STEP_MAX_VOXELS = 50000; - maxVoxels->setMaximum(MAX_MAX_VOXELS); - maxVoxels->setMinimum(MIN_MAX_VOXELS); - maxVoxels->setSingleStep(STEP_MAX_VOXELS); - maxVoxels->setValue(_maxVoxels); - form->addRow("Maximum Voxels:", maxVoxels); - - QSpinBox* maxVoxelsPPS = new QSpinBox(); - const int MAX_MAX_VOXELS_PPS = 6000; - const int MIN_MAX_VOXELS_PPS = 60; - const int STEP_MAX_VOXELS_PPS = 10; - maxVoxelsPPS->setMaximum(MAX_MAX_VOXELS_PPS); - maxVoxelsPPS->setMinimum(MIN_MAX_VOXELS_PPS); - maxVoxelsPPS->setSingleStep(STEP_MAX_VOXELS_PPS); - maxVoxelsPPS->setValue(_maxVoxelPacketsPerSecond); - form->addRow("Maximum Voxels Packets Per Second:", maxVoxelsPPS); - - QDialogButtonBox* buttons = new QDialogButtonBox(QDialogButtonBox::Ok | QDialogButtonBox::Cancel); - dialog.connect(buttons, SIGNAL(accepted()), SLOT(accept())); - dialog.connect(buttons, SIGNAL(rejected()), SLOT(reject())); - layout->addWidget(buttons); - - int ret = dialog.exec(); - if (ret == QDialog::Accepted) { - QUrl faceModelURL(faceURLEdit->text()); - - bool shouldDispatchIdentityPacket = false; - - if (faceModelURL.toString() != faceURLString) { - // change the faceModelURL in the profile, it will also update this user's BlendFace - applicationInstance->getAvatar()->setFaceModelURL(faceModelURL); - shouldDispatchIdentityPacket = true; - } - - QUrl skeletonModelURL(skeletonURLEdit->text()); - - if (skeletonModelURL.toString() != skeletonURLString) { - // change the skeletonModelURL in the profile, it will also update this user's Body - applicationInstance->getAvatar()->setSkeletonModelURL(skeletonModelURL); - shouldDispatchIdentityPacket = true; - } - - QString displayNameStr(displayNameEdit->text()); - - if (displayNameStr != displayNameString) { - applicationInstance->getAvatar()->setDisplayName(displayNameStr); - shouldDispatchIdentityPacket = true; - } - - if (shouldDispatchIdentityPacket) { - applicationInstance->getAvatar()->sendIdentityPacket(); - } - - applicationInstance->getAvatar()->getHead()->setPupilDilation(pupilDilation->value() / (float)pupilDilation->maximum()); - - _maxVoxels = maxVoxels->value(); - applicationInstance->getVoxels()->setMaxVoxels(_maxVoxels); - - _maxVoxelPacketsPerSecond = maxVoxelsPPS->value(); - - applicationInstance->getAvatar()->setLeanScale(leanScale->value()); - applicationInstance->getAvatar()->setClampedTargetScale(avatarScale->value()); - - _audioJitterBufferSamples = audioJitterBufferSamples->value(); - - if (_audioJitterBufferSamples != 0) { - applicationInstance->getAudio()->setJitterBufferSamples(_audioJitterBufferSamples); - } - - _fieldOfView = fieldOfView->value(); - applicationInstance->resizeGL(applicationInstance->getGLWidget()->width(), applicationInstance->getGLWidget()->height()); - - _faceshiftEyeDeflection = faceshiftEyeDeflection->value() / (float)faceshiftEyeDeflection->maximum(); + if(! _preferencesDialog) { + _preferencesDialog = new PreferencesDialog(Application::getInstance()->getGLWidget()); } + _preferencesDialog->show(); } diff --git a/interface/src/ui/FramelessDialog.cpp b/interface/src/ui/FramelessDialog.cpp index ddd056fd32..4ca765b352 100644 --- a/interface/src/ui/FramelessDialog.cpp +++ b/interface/src/ui/FramelessDialog.cpp @@ -16,6 +16,7 @@ FramelessDialog::FramelessDialog(QWidget *parent, Qt::WindowFlags flags) : QDial setStyleSheet(styleSheet.readAll()); } setWindowOpacity(0.95); + setAttribute(Qt::WA_DeleteOnClose); } FramelessDialog::~FramelessDialog() { diff --git a/interface/src/ui/PreferencesDialog.cpp b/interface/src/ui/PreferencesDialog.cpp index de585d0a2a..b82bcd7e68 100644 --- a/interface/src/ui/PreferencesDialog.cpp +++ b/interface/src/ui/PreferencesDialog.cpp @@ -12,7 +12,6 @@ PreferencesDialog::PreferencesDialog(QWidget* parent, Qt::WindowFlags flags) : FramelessDialog(parent, flags) { ui.setupUi(this); - setAttribute(Qt::WA_DeleteOnClose); loadPreferences(); } From b8bb8013f3862f0e0ff687da25192cbb26163c6c Mon Sep 17 00:00:00 2001 From: stojce Date: Thu, 27 Feb 2014 23:15:57 +0100 Subject: [PATCH 006/120] Bad merge fixes --- interface/src/Menu.h | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/interface/src/Menu.h b/interface/src/Menu.h index 041f1fcd50..f7beca0f39 100644 --- a/interface/src/Menu.h +++ b/interface/src/Menu.h @@ -18,6 +18,8 @@ #include #include +#include "ui/PreferencesDialog.h" + const float ADJUST_LOD_DOWN_FPS = 40.0; const float ADJUST_LOD_UP_FPS = 55.0; @@ -66,10 +68,12 @@ public: void setIsOptionChecked(const QString& menuOption, bool isChecked); void triggerOption(const QString& menuOption); QAction* getActionForOption(const QString& menuOption); - + float getAudioJitterBufferSamples() const { return _audioJitterBufferSamples; } + void setAudioJitterBufferSamples(float audioJitterBufferSamples) { _audioJitterBufferSamples = audioJitterBufferSamples; } float getFieldOfView() const { return _fieldOfView; } float getFaceshiftEyeDeflection() const { return _faceshiftEyeDeflection; } + void setFaceshiftEyeDeflection(float faceshiftEyeDeflection) { _faceshiftEyeDeflection = faceshiftEyeDeflection; } BandwidthDialog* getBandwidthDialog() const { return _bandwidthDialog; } FrustumDrawMode getFrustumDrawMode() const { return _frustumDrawMode; } ViewFrustumOffset getViewFrustumOffset() const { return _viewFrustumOffset; } @@ -89,6 +93,7 @@ public: // User Tweakable PPS from Voxel Server int getMaxVoxelPacketsPerSecond() const { return _maxVoxelPacketsPerSecond; } + void setMaxVoxelPacketsPerSecond(int maxVoxelPacketsPerSecond) { _maxVoxelPacketsPerSecond = maxVoxelPacketsPerSecond; } QMenu* getActiveScriptsMenu() { return _activeScriptsMenu;} @@ -194,6 +199,7 @@ private: QString replaceLastOccurrence(QChar search, QChar replace, QString string); quint64 _lastAdjust; QAction* _loginAction; + QPointer _preferencesDialog; }; namespace MenuOption { From a29025a7396f7400fe2ac9f4f69d344dd90998ce Mon Sep 17 00:00:00 2001 From: stojce Date: Fri, 14 Mar 2014 01:51:22 +0100 Subject: [PATCH 007/120] New layout --- interface/interface_en.ts | 133 +++++++++++++++++++++++++++++++++++--- interface/src/Menu.cpp | 12 +++- 2 files changed, 135 insertions(+), 10 deletions(-) diff --git a/interface/interface_en.ts b/interface/interface_en.ts index 1d962393d7..a0d1378d44 100644 --- a/interface/interface_en.ts +++ b/interface/interface_en.ts @@ -4,22 +4,22 @@ Application - + Export Voxels - + Sparse Voxel Octree Files (*.svo) - + Open Script - + JavaScript Files (*.js) @@ -113,22 +113,139 @@ Menu - + Open .ini config file - - + + Text files (*.ini) - + Save .ini config file + + PreferencesDialog + + + + Avatar + + + + + + <html><head/><body><p>Avatar display name <span style=" color:#909090;">(optional)</span></p></body></html> + + + + + + Not showing a name + + + + + + Head + + + + + + Body + + + + + + Advanced Tuning + + + + + + It's not recomended that you play with these settings unless you've looked into exactly what they do. + + + + + + <p>Avatar</p> + + + + + + Lean scale (applies to Faceshift users) + + + + + + Vertical field of view + + + + + + Avatar scale (default is 1.0) + + + + + + Pupil dillation + + + + + + Audio Jitter Buffer Samples (0 for automatic) + + + + + + Faceshift eye detection + + + + + + <html><head/><body><p>Voxels</p></body></html> + + + + + + Maximum voxels + + + + + + Max voxels sent each second + + + + + + Cancel + + + + + + Save all changes + + + QObject diff --git a/interface/src/Menu.cpp b/interface/src/Menu.cpp index bf94c3ad4b..b20b468acf 100644 --- a/interface/src/Menu.cpp +++ b/interface/src/Menu.cpp @@ -76,7 +76,7 @@ Menu::Menu() : _lastAdjust(usecTimestampNow()), _fpsAverage(FIVE_SECONDS_OF_FRAMES), _loginAction(NULL), - _preferencesDialog() + _preferencesDialog(NULL) { Application *appInstance = Application::getInstance(); @@ -678,6 +678,14 @@ void Menu::loginForCurrentDomain() { } void Menu::editPreferences() { + if (! _preferencesDialog) { + _preferencesDialog = new PreferencesDialog(Application::getInstance()->getGLWidget()); + _preferencesDialog->show(); + } + _preferencesDialog->raise(); + + /* + Application* applicationInstance = Application::getInstance(); QDialog dialog(applicationInstance->getWindow()); @@ -812,7 +820,7 @@ void Menu::editPreferences() { _faceshiftEyeDeflection = faceshiftEyeDeflection->value() / (float)faceshiftEyeDeflection->maximum(); } QMetaObject::invokeMethod(applicationInstance->getAudio(), "reset", Qt::QueuedConnection); - +*/ sendFakeEnterEvent(); } From 4e2d3c95495a2ae1beb9156ec74bf299cddf604b Mon Sep 17 00:00:00 2001 From: stojce Date: Fri, 14 Mar 2014 23:24:32 +0100 Subject: [PATCH 008/120] styling QSlider --- interface/interface_en.ts | 125 ++++++++++++++++++++++- interface/resources/styles/global.qss | 30 ++++-- interface/src/Menu.cpp | 142 +------------------------- interface/src/ui/FramelessDialog.cpp | 10 +- interface/src/ui/FramelessDialog.h | 2 +- 5 files changed, 154 insertions(+), 155 deletions(-) diff --git a/interface/interface_en.ts b/interface/interface_en.ts index c52ec91671..18ae5f446c 100644 --- a/interface/interface_en.ts +++ b/interface/interface_en.ts @@ -113,22 +113,139 @@ Menu - + Open .ini config file - - + + Text files (*.ini) - + Save .ini config file + + PreferencesDialog + + + + Avatar + + + + + + <html><head/><body><p>Avatar display name <span style=" color:#909090;">(optional)</span></p></body></html> + + + + + + Not showing a name + + + + + + Head + + + + + + Body + + + + + + Advanced Tuning + + + + + + It's not recomended that you play with these settings unless you've looked into exactly what they do. + + + + + + <p>Avatar</p> + + + + + + Lean scale (applies to Faceshift users) + + + + + + Vertical field of view + + + + + + Avatar scale (default is 1.0) + + + + + + Pupil dillation + + + + + + Audio Jitter Buffer Samples (0 for automatic) + + + + + + Faceshift eye detection + + + + + + <html><head/><body><p>Voxels</p></body></html> + + + + + + Maximum voxels + + + + + + Max voxels sent each second + + + + + + Cancel + + + + + + Save all changes + + + QObject diff --git a/interface/resources/styles/global.qss b/interface/resources/styles/global.qss index e3548fb52e..87e142eb00 100644 --- a/interface/resources/styles/global.qss +++ b/interface/resources/styles/global.qss @@ -33,18 +33,18 @@ QPushButton { padding: 10px 15px; } - QSpinBox { padding: 5px; border-width: 1; } +QDoubleSpinBox::up-button, QSpinBox::up-button { width: 25px; height: 18px; - background-image: url(resources/styles/up.svg); + background-image: url(styles/up.svg); background-repeat: no-repeat; border: 1px #ccc solid; @@ -52,14 +52,32 @@ QSpinBox::up-button { border-top-right-radius: 2px; } +QDoubleSpinBox::down-button, QSpinBox::down-button { width: 25px; height: 18px; - background-image: url(resources/styles/down.svg); + background-image: url(styles/down.svg); background-repeat: no-repeat; border: 1px #ccc solid; - - border-top-left-radius: 2px; - border-top-right-radius: 2px; +} + +QSlider { + width: 125px; + height: 18px; +} + +QSlider::groove:horizontal { + border: none; + background-image: url(styles/slider-bg.svg); + background-repeat: no-repeat; + background-position: center center; +} + +QSlider::handle:horizontal { + width: 18px; + height: 18px; + background-image: url(styles/slider-handle.svg); + background-repeat: no-repeat; + background-position: center center; } diff --git a/interface/src/Menu.cpp b/interface/src/Menu.cpp index 1d3b6753ff..df9e1d40dc 100644 --- a/interface/src/Menu.cpp +++ b/interface/src/Menu.cpp @@ -687,148 +687,8 @@ void Menu::loginForCurrentDomain() { void Menu::editPreferences() { if (! _preferencesDialog) { _preferencesDialog = new PreferencesDialog(Application::getInstance()->getGLWidget()); - _preferencesDialog->show(); } - _preferencesDialog->raise(); - - /* - - Application* applicationInstance = Application::getInstance(); - - QDialog dialog(applicationInstance->getWindow()); - dialog.setWindowTitle("Interface Preferences"); - - QBoxLayout* layout = new QBoxLayout(QBoxLayout::TopToBottom); - dialog.setLayout(layout); - - QFormLayout* form = new QFormLayout(); - layout->addLayout(form, 1); - - QString faceURLString = applicationInstance->getAvatar()->getHead()->getFaceModel().getURL().toString(); - QLineEdit* faceURLEdit = new QLineEdit(faceURLString); - faceURLEdit->setMinimumWidth(QLINE_MINIMUM_WIDTH); - faceURLEdit->setPlaceholderText(DEFAULT_HEAD_MODEL_URL.toString()); - form->addRow("Face URL:", faceURLEdit); - - QString skeletonURLString = applicationInstance->getAvatar()->getSkeletonModel().getURL().toString(); - QLineEdit* skeletonURLEdit = new QLineEdit(skeletonURLString); - skeletonURLEdit->setMinimumWidth(QLINE_MINIMUM_WIDTH); - skeletonURLEdit->setPlaceholderText(DEFAULT_BODY_MODEL_URL.toString()); - form->addRow("Skeleton URL:", skeletonURLEdit); - - QString displayNameString = applicationInstance->getAvatar()->getDisplayName(); - QLineEdit* displayNameEdit = new QLineEdit(displayNameString); - displayNameEdit->setMinimumWidth(QLINE_MINIMUM_WIDTH); - form->addRow("Display name:", displayNameEdit); - - QSlider* pupilDilation = new QSlider(Qt::Horizontal); - pupilDilation->setValue(applicationInstance->getAvatar()->getHead()->getPupilDilation() * pupilDilation->maximum()); - form->addRow("Pupil Dilation:", pupilDilation); - - QSlider* faceshiftEyeDeflection = new QSlider(Qt::Horizontal); - faceshiftEyeDeflection->setValue(_faceshiftEyeDeflection * faceshiftEyeDeflection->maximum()); - form->addRow("Faceshift Eye Deflection:", faceshiftEyeDeflection); - - QSpinBox* fieldOfView = new QSpinBox(); - fieldOfView->setMaximum(180.f); - fieldOfView->setMinimum(1.f); - fieldOfView->setValue(_fieldOfView); - form->addRow("Vertical Field of View (Degrees):", fieldOfView); - - QDoubleSpinBox* leanScale = new QDoubleSpinBox(); - leanScale->setValue(applicationInstance->getAvatar()->getLeanScale()); - form->addRow("Lean Scale:", leanScale); - - QDoubleSpinBox* avatarScale = new QDoubleSpinBox(); - avatarScale->setValue(applicationInstance->getAvatar()->getScale()); - form->addRow("Avatar Scale:", avatarScale); - - QSpinBox* audioJitterBufferSamples = new QSpinBox(); - audioJitterBufferSamples->setMaximum(10000); - audioJitterBufferSamples->setMinimum(-10000); - audioJitterBufferSamples->setValue(_audioJitterBufferSamples); - form->addRow("Audio Jitter Buffer Samples (0 for automatic):", audioJitterBufferSamples); - - QSpinBox* maxVoxels = new QSpinBox(); - const int MAX_MAX_VOXELS = 5000000; - const int MIN_MAX_VOXELS = 0; - const int STEP_MAX_VOXELS = 50000; - maxVoxels->setMaximum(MAX_MAX_VOXELS); - maxVoxels->setMinimum(MIN_MAX_VOXELS); - maxVoxels->setSingleStep(STEP_MAX_VOXELS); - maxVoxels->setValue(_maxVoxels); - form->addRow("Maximum Voxels:", maxVoxels); - - QSpinBox* maxVoxelsPPS = new QSpinBox(); - const int MAX_MAX_VOXELS_PPS = 6000; - const int MIN_MAX_VOXELS_PPS = 60; - const int STEP_MAX_VOXELS_PPS = 10; - maxVoxelsPPS->setMaximum(MAX_MAX_VOXELS_PPS); - maxVoxelsPPS->setMinimum(MIN_MAX_VOXELS_PPS); - maxVoxelsPPS->setSingleStep(STEP_MAX_VOXELS_PPS); - maxVoxelsPPS->setValue(_maxVoxelPacketsPerSecond); - form->addRow("Maximum Voxels Packets Per Second:", maxVoxelsPPS); - - QDialogButtonBox* buttons = new QDialogButtonBox(QDialogButtonBox::Ok | QDialogButtonBox::Cancel); - dialog.connect(buttons, SIGNAL(accepted()), SLOT(accept())); - dialog.connect(buttons, SIGNAL(rejected()), SLOT(reject())); - layout->addWidget(buttons); - - int ret = dialog.exec(); - if (ret == QDialog::Accepted) { - QUrl faceModelURL(faceURLEdit->text()); - - bool shouldDispatchIdentityPacket = false; - - if (faceModelURL.toString() != faceURLString) { - // change the faceModelURL in the profile, it will also update this user's BlendFace - applicationInstance->getAvatar()->setFaceModelURL(faceModelURL); - shouldDispatchIdentityPacket = true; - } - - QUrl skeletonModelURL(skeletonURLEdit->text()); - - if (skeletonModelURL.toString() != skeletonURLString) { - // change the skeletonModelURL in the profile, it will also update this user's Body - applicationInstance->getAvatar()->setSkeletonModelURL(skeletonModelURL); - shouldDispatchIdentityPacket = true; - } - - QString displayNameStr(displayNameEdit->text()); - - if (displayNameStr != displayNameString) { - applicationInstance->getAvatar()->setDisplayName(displayNameStr); - shouldDispatchIdentityPacket = true; - } - - if (shouldDispatchIdentityPacket) { - applicationInstance->getAvatar()->sendIdentityPacket(); - } - - applicationInstance->getAvatar()->getHead()->setPupilDilation(pupilDilation->value() / (float)pupilDilation->maximum()); - - _maxVoxels = maxVoxels->value(); - applicationInstance->getVoxels()->setMaxVoxels(_maxVoxels); - - _maxVoxelPacketsPerSecond = maxVoxelsPPS->value(); - - applicationInstance->getAvatar()->setLeanScale(leanScale->value()); - applicationInstance->getAvatar()->setClampedTargetScale(avatarScale->value()); - - _audioJitterBufferSamples = audioJitterBufferSamples->value(); - - if (_audioJitterBufferSamples != 0) { - applicationInstance->getAudio()->setJitterBufferSamples(_audioJitterBufferSamples); - } - - _fieldOfView = fieldOfView->value(); - applicationInstance->resizeGL(applicationInstance->getGLWidget()->width(), applicationInstance->getGLWidget()->height()); - - _faceshiftEyeDeflection = faceshiftEyeDeflection->value() / (float)faceshiftEyeDeflection->maximum(); - } - QMetaObject::invokeMethod(applicationInstance->getAudio(), "reset", Qt::QueuedConnection); -*/ - sendFakeEnterEvent(); + _preferencesDialog->show(); } void Menu::goToDomain(const QString newDomain) { diff --git a/interface/src/ui/FramelessDialog.cpp b/interface/src/ui/FramelessDialog.cpp index 4ca765b352..94bb218171 100644 --- a/interface/src/ui/FramelessDialog.cpp +++ b/interface/src/ui/FramelessDialog.cpp @@ -6,13 +6,17 @@ // // -#include "FramelessDialog.h" -#include #include +#include + +#include "Application.h" +#include "FramelessDialog.h" FramelessDialog::FramelessDialog(QWidget *parent, Qt::WindowFlags flags) : QDialog(parent, flags | Qt::FramelessWindowHint) { - QFile styleSheet("resources/styles/global.qss"); + + QFile styleSheet(Application::resourcesPath() + "styles/global.qss"); if (styleSheet.open(QIODevice::ReadOnly)) { + QDir::setCurrent(Application::resourcesPath()); setStyleSheet(styleSheet.readAll()); } setWindowOpacity(0.95); diff --git a/interface/src/ui/FramelessDialog.h b/interface/src/ui/FramelessDialog.h index ca11c3eb2f..fd2121ddad 100644 --- a/interface/src/ui/FramelessDialog.h +++ b/interface/src/ui/FramelessDialog.h @@ -20,7 +20,7 @@ class FramelessDialog : public QDialog { public: FramelessDialog(QWidget* parent = 0, Qt::WindowFlags flags = 0); - ~FramelessDialog(); + virtual ~FramelessDialog(); }; From ebd7dff4b97a2a9dd221fb114ff40785f3b08e24 Mon Sep 17 00:00:00 2001 From: stojce Date: Sat, 15 Mar 2014 22:07:29 +0100 Subject: [PATCH 009/120] QSpinBox, QDoubleSpinBox styling --- interface/resources/styles/global.qss | 49 +++++++++++++++++---------- interface/src/ui/FramelessDialog.cpp | 1 + 2 files changed, 33 insertions(+), 17 deletions(-) diff --git a/interface/resources/styles/global.qss b/interface/resources/styles/global.qss index 87e142eb00..14929d39af 100644 --- a/interface/resources/styles/global.qss +++ b/interface/resources/styles/global.qss @@ -33,33 +33,48 @@ QPushButton { padding: 10px 15px; } -QSpinBox { +QSpinBox, QDoubleSpinBox { padding: 5px; border-width: 1; - +} + +QDoubleSpinBox::up-arrow, +QSpinBox::up-arrow { + background-image: url(styles/up.svg); + background-repeat: no-repeat; + background-position: center center; +} + +QDoubleSpinBox::down-arrow, +QSpinBox::down-arrow { + background-image: url(styles/down.svg); + background-repeat: no-repeat; + background-position: center center; +} + +QDoubleSpinBox::up-button, +QSpinBox::up-button, +QDoubleSpinBox::down-button, +QSpinBox::down-button { + width: 26px; + height: 13px; + + background-color: #f2f2f2; + border-color: #ccc; + border-style: solid; + border-width: 1px; } QDoubleSpinBox::up-button, QSpinBox::up-button { - - width: 25px; - height: 18px; - background-image: url(styles/up.svg); - background-repeat: no-repeat; - border: 1px #ccc solid; - - border-top-left-radius: 2px; - border-top-right-radius: 2px; + border-top-left-radius: 4px; + border-top-right-radius: 4px; } QDoubleSpinBox::down-button, QSpinBox::down-button { - - width: 25px; - height: 18px; - background-image: url(styles/down.svg); - background-repeat: no-repeat; - border: 1px #ccc solid; + border-bottom-left-radius: 4px; + border-bottom-right-radius: 4px; } QSlider { diff --git a/interface/src/ui/FramelessDialog.cpp b/interface/src/ui/FramelessDialog.cpp index 94bb218171..2216e61b91 100644 --- a/interface/src/ui/FramelessDialog.cpp +++ b/interface/src/ui/FramelessDialog.cpp @@ -19,6 +19,7 @@ FramelessDialog::FramelessDialog(QWidget *parent, Qt::WindowFlags flags) : QDial QDir::setCurrent(Application::resourcesPath()); setStyleSheet(styleSheet.readAll()); } + setWindowOpacity(0.95); setAttribute(Qt::WA_DeleteOnClose); } From 913783c0f121cd6763a2a76f3e4771a30d35eb2a Mon Sep 17 00:00:00 2001 From: stojce Date: Sun, 16 Mar 2014 22:47:03 +0100 Subject: [PATCH 010/120] resizing - fixed layout --- interface/interface_en.ts | 131 +- interface/resources/styles/global.qss | 4 +- interface/resources/styles/preferences.qss | 11 + interface/src/Menu.cpp | 3 +- interface/src/ui/FramelessDialog.cpp | 42 +- interface/src/ui/FramelessDialog.h | 13 +- interface/src/ui/PreferencesDialog.cpp | 1 + interface/ui/preferencesDialog.ui | 1615 ++++++++++++++------ 8 files changed, 1296 insertions(+), 524 deletions(-) create mode 100644 interface/resources/styles/preferences.qss diff --git a/interface/interface_en.ts b/interface/interface_en.ts index 75ada1910c..3c61d5f17a 100644 --- a/interface/interface_en.ts +++ b/interface/interface_en.ts @@ -113,22 +113,145 @@ Menu - + Open .ini config file - - + + Text files (*.ini) - + Save .ini config file + + PreferencesDialog + + + + Avatar + + + + + + <html><head/><body><p>Avatar display name <span style=" color:#909090;">(optional)</span></p></body></html> + + + + + + Not showing a name + + + + + + Head + + + + + + Body + + + + + + Advanced Tuning + + + + + + It's not recomended that you play with these settings unless you've looked into exactly what they do. + + + + + + <p>Avatar</p> + + + + + + Lean scale (applies to Faceshift users) + + + + + + Vertical field of view + + + + + + Avatar scale (default is 1.0) + + + + + + Pupil dillation + + + + + + Audio Jitter Buffer Samples (0 for automatic) + + + + + + Faceshift eye detection + + + + + + <html><head/><body><p>Voxels</p></body></html> + + + + + + Maximum voxels + + + + + + Max voxels sent each second + + + + + + PushButton + + + + + + Cancel + + + + + + Save all changes + + + QObject diff --git a/interface/resources/styles/global.qss b/interface/resources/styles/global.qss index 14929d39af..d302555463 100644 --- a/interface/resources/styles/global.qss +++ b/interface/resources/styles/global.qss @@ -4,7 +4,6 @@ } FramelessDialog { - background-color: rgb(255, 255, 255); font-family: Helvetica, Arial, sans-serif; font-size: 16px; } @@ -67,12 +66,15 @@ QSpinBox::down-button { QDoubleSpinBox::up-button, QSpinBox::up-button { + + margin-top:2px; border-top-left-radius: 4px; border-top-right-radius: 4px; } QDoubleSpinBox::down-button, QSpinBox::down-button { + margin-bottom:3px; border-bottom-left-radius: 4px; border-bottom-right-radius: 4px; } diff --git a/interface/resources/styles/preferences.qss b/interface/resources/styles/preferences.qss new file mode 100644 index 0000000000..ee587b70da --- /dev/null +++ b/interface/resources/styles/preferences.qss @@ -0,0 +1,11 @@ +QLabel#avatarLabel { + background-image: url(styles/avatar.svg); + background-repeat: no-repeat; + background-position: left center; +} + +QLabel#advancedTuningLabel { + background-image: url(styles/wrench.svg); + background-repeat: no-repeat; + background-position: left center; +} diff --git a/interface/src/Menu.cpp b/interface/src/Menu.cpp index dd43e511bd..99e984c8cb 100644 --- a/interface/src/Menu.cpp +++ b/interface/src/Menu.cpp @@ -695,8 +695,9 @@ void Menu::loginForCurrentDomain() { void Menu::editPreferences() { if (! _preferencesDialog) { _preferencesDialog = new PreferencesDialog(Application::getInstance()->getGLWidget()); + _preferencesDialog->show(); } - _preferencesDialog->show(); + _preferencesDialog->raise(); } void Menu::goToDomain(const QString newDomain) { diff --git a/interface/src/ui/FramelessDialog.cpp b/interface/src/ui/FramelessDialog.cpp index 2216e61b91..9239deed90 100644 --- a/interface/src/ui/FramelessDialog.cpp +++ b/interface/src/ui/FramelessDialog.cpp @@ -8,20 +8,46 @@ #include #include +#include #include "Application.h" #include "FramelessDialog.h" FramelessDialog::FramelessDialog(QWidget *parent, Qt::WindowFlags flags) : QDialog(parent, flags | Qt::FramelessWindowHint) { - - QFile styleSheet(Application::resourcesPath() + "styles/global.qss"); - if (styleSheet.open(QIODevice::ReadOnly)) { - QDir::setCurrent(Application::resourcesPath()); - setStyleSheet(styleSheet.readAll()); - } - - setWindowOpacity(0.95); + setWindowOpacity(0.9); setAttribute(Qt::WA_DeleteOnClose); + isResizing = false; +} + +void FramelessDialog::setStyleSheet(const QString& fileName) { + QFile globalStyleSheet(Application::resourcesPath() + "styles/global.qss"); + QFile styleSheet(Application::resourcesPath() + fileName); + if (styleSheet.open(QIODevice::ReadOnly) && globalStyleSheet.open(QIODevice::ReadOnly) ) { + QDir::setCurrent(Application::resourcesPath()); + QDialog::setStyleSheet(globalStyleSheet.readAll() + styleSheet.readAll()); + } +} +void FramelessDialog::mousePressEvent(QMouseEvent* mouseEvent) { + if (abs(mouseEvent->pos().x() - size().width()) < 2 && mouseEvent->button() == Qt::LeftButton) { + isResizing = true; + QApplication::setOverrideCursor(Qt::SizeHorCursor); + } + // propagate the event + QDialog::mousePressEvent(mouseEvent); +} + +void FramelessDialog::mouseReleaseEvent(QMouseEvent* mouseEvent) { + QApplication::restoreOverrideCursor(); + isResizing = false; + // propagate the event + QDialog::mouseReleaseEvent(mouseEvent); +} + +void FramelessDialog::mouseMoveEvent(QMouseEvent* mouseEvent) { + if (isResizing) { + resize(mouseEvent->pos().x(), size().height()); + } + QDialog::mouseMoveEvent(mouseEvent); } FramelessDialog::~FramelessDialog() { diff --git a/interface/src/ui/FramelessDialog.h b/interface/src/ui/FramelessDialog.h index fd2121ddad..4e18aff161 100644 --- a/interface/src/ui/FramelessDialog.h +++ b/interface/src/ui/FramelessDialog.h @@ -10,10 +10,10 @@ #define __hifi__FramelessDialog__ #include +#include +#include #include #include -#include -#include class FramelessDialog : public QDialog { Q_OBJECT @@ -21,6 +21,15 @@ class FramelessDialog : public QDialog { public: FramelessDialog(QWidget* parent = 0, Qt::WindowFlags flags = 0); virtual ~FramelessDialog(); + void setStyleSheet(const QString& fileName); + +protected: + void mouseMoveEvent(QMouseEvent* mouseEvent); + void mousePressEvent(QMouseEvent* mouseEvent); + void mouseReleaseEvent(QMouseEvent* mouseEvent); + +private: + bool isResizing; }; diff --git a/interface/src/ui/PreferencesDialog.cpp b/interface/src/ui/PreferencesDialog.cpp index b82bcd7e68..318db54f2c 100644 --- a/interface/src/ui/PreferencesDialog.cpp +++ b/interface/src/ui/PreferencesDialog.cpp @@ -12,6 +12,7 @@ PreferencesDialog::PreferencesDialog(QWidget* parent, Qt::WindowFlags flags) : FramelessDialog(parent, flags) { ui.setupUi(this); + setStyleSheet("styles/preferences.qss"); loadPreferences(); } diff --git a/interface/ui/preferencesDialog.ui b/interface/ui/preferencesDialog.ui index 8fed57c06b..0099838177 100644 --- a/interface/ui/preferencesDialog.ui +++ b/interface/ui/preferencesDialog.ui @@ -2,486 +2,43 @@ PreferencesDialog + + Qt::ApplicationModal + 0 0 - 611 - 805 + 640 + 752 - - - - 30 - 0 - 555 - 701 - - - - - - - - 23 - - - - color: #0e7077 - - - Avatar - - - faceURLEdit - - - - - - - - 0 - 0 - - - - color: #0e7077 - - - <html><head/><body><p>Avatar display name <span style=" color:#909090;">(optional)</span></p></body></html> - - - displayNameEdit - - - - - - - - 0 - 0 - - - - - 280 - 0 - - - - Qt::LeftToRight - - - - - - Not showing a name - - - - - - - color: #0e7077 - - - Head - - - faceURLEdit - - - - - - - - 0 - 0 - - - - - - - - color: #0e7077 - - - Body - - - faceURLEdit - - - - - - - - - - - 23 - - - - color: #0e7077 - - - Advanced Tuning - - - - - - - It's not recomended that you play with these settings unless you've looked into exactly what they do. - - - false - - - true - - - - - - - - 20 - 50 - false - - - - color: #0e7077 - - - <p>Avatar</p> - - - - - - - - - Lean scale (applies to Faceshift users) - - - leanScaleSpin - - - - - - - Qt::Horizontal - - - - 40 - 20 - - - - - - - - - - - - - - - Vertical field of view - - - fieldOfViewSpin - - - - - - - Qt::Horizontal - - - - 40 - 20 - - - - - - - - 1 - - - 180 - - - - - - - - - - - Avatar scale (default is 1.0) - - - avatarScaleSpin - - - - - - - Qt::Horizontal - - - - 40 - 20 - - - - - - - - - - - - - - - Pupil dillation - - - - - - - Qt::Horizontal - - - - 40 - 20 - - - - - - - - - 0 - 0 - - - - Qt::Horizontal - - - - - - - - - - - Audio Jitter Buffer Samples (0 for automatic) - - - - - - - Qt::Horizontal - - - - 40 - 20 - - - - - - - - -10000 - - - 10000 - - - 1 - - - - - - - - - - - Faceshift eye detection - - - avatarScaleSpin - - - - - - - Qt::Horizontal - - - - 40 - 20 - - - - - - - - - 0 - 0 - - - - Qt::Horizontal - - - - - - - - - - 20 - 50 - false - - - - color: #0e7077 - - - <html><head/><body><p>Voxels</p></body></html> - - - - - - - - - Maximum voxels - - - leanScaleSpin - - - - - - - Qt::Horizontal - - - - 40 - 20 - - - - - - - - 5000000 - - - 50000 - - - - - - - - - - - Max voxels sent each second - - - leanScaleSpin - - - - - - - Qt::Horizontal - - - - 40 - 20 - - - - - - - - 60 - - - 6000 - - - 10 - - - - - - - + + + 0 + 0 + + + + + 610 + 0 + + 0 - 725 + 720 616 80 + + + Arial + + background-color: #0e7077 @@ -494,9 +51,22 @@ 41 + + + Arial + + + + 0 + + + + Arial + + Qt::Horizontal @@ -510,6 +80,11 @@ + + + Arial + + Cancel @@ -517,6 +92,11 @@ + + + Arial + + background-color: #fff; color: #0e7077 @@ -532,6 +112,1066 @@ color: #0e7077 + + + + 0 + 0 + 621 + 1000 + + + + + 0 + 0 + + + + true + + + + + 0 + 0 + 619 + 998 + + + + + + 0 + 50 + 621 + 783 + + + + + Arial + + + + + 0 + + + 30 + + + 0 + + + 30 + + + + + + 0 + 0 + + + + + Arial + 24 + + + + color: #0e7077 + + + Avatar + + + 25 + + + + + + + + + + + 0 + 0 + + + + + 0 + 30 + + + + + Arial + 16 + + + + color: #0e7077 + + + <html><head/><body><p>Avatar display name <span style=" color:#909090;">(optional)</span></p></body></html> + + + Qt::AlignBottom|Qt::AlignLeading|Qt::AlignLeft + + + displayNameEdit + + + + + + + + 0 + 0 + + + + + 280 + 0 + + + + + Arial + + + + Qt::LeftToRight + + + + + + Not showing a name + + + + + + + + 0 + 0 + + + + + 0 + 30 + + + + + Arial + 16 + + + + color: #0e7077 + + + Head + + + Qt::AlignBottom|Qt::AlignLeading|Qt::AlignLeft + + + 0 + + + faceURLEdit + + + + + + + + 0 + 0 + + + + + Arial + + + + + + + + + 0 + 0 + + + + + 0 + 30 + + + + + Arial + 16 + + + + color: #0e7077 + + + Body + + + Qt::AlignBottom|Qt::AlignLeading|Qt::AlignLeft + + + skeletonURLEdit + + + + + + + + 0 + 0 + + + + + Arial + + + + + + + + Qt::Vertical + + + + 20 + 40 + + + + + + + + + 0 + 0 + + + + + 0 + 0 + + + + + Arial + 24 + + + + color: #0e7077 + + + Advanced Tuning + + + Qt::AlignLeading|Qt::AlignLeft|Qt::AlignVCenter + + + 25 + + + + + + + + 0 + 0 + + + + + Arial + + + + color: rgb(51, 51, 51) + + + It's not recomended that you play with these settings unless you've looked into exactly what they do. + + + false + + + true + + + + + + + + 0 + 0 + + + + + 0 + 40 + + + + + Arial + 20 + 50 + false + + + + color: #0e7077 + + + <p>Avatar</p> + + + Qt::AlignBottom|Qt::AlignLeading|Qt::AlignLeft + + + + + + + 0 + + + 10 + + + 10 + + + + + + 0 + 0 + + + + + 0 + 0 + + + + + 16777215 + 25 + + + + + Arial + + + + color: rgb(51, 51, 51) + + + Lean scale (applies to Faceshift users) + + + leanScaleSpin + + + + + + + + Arial + + + + Qt::Horizontal + + + QSizePolicy::Expanding + + + + 40 + 10 + + + + + + + + + 0 + 0 + + + + + 95 + 36 + + + + + 70 + 16777215 + + + + + Arial + + + + + + + + + + 0 + + + 10 + + + 0 + + + 10 + + + + + + Arial + + + + color: rgb(51, 51, 51) + + + Vertical field of view + + + fieldOfViewSpin + + + + + + + + Arial + + + + Qt::Horizontal + + + + 40 + 20 + + + + + + + + + 0 + 0 + + + + + 95 + 36 + + + + + 70 + 16777215 + + + + + Arial + + + + 1 + + + 180 + + + + + + + + + 0 + + + 10 + + + 0 + + + 10 + + + + + + Arial + + + + color: rgb(51, 51, 51) + + + Avatar scale (default is 1.0) + + + avatarScaleSpin + + + + + + + + Arial + + + + Qt::Horizontal + + + + 40 + 20 + + + + + + + + + 0 + 0 + + + + + 95 + 36 + + + + + 70 + 16777215 + + + + + Arial + + + + + + + + + + 0 + + + 10 + + + 0 + + + 10 + + + + + + Arial + + + + color: rgb(51, 51, 51) + + + Pupil dillation + + + + + + + + Arial + + + + Qt::Horizontal + + + + 40 + 20 + + + + + + + + + 0 + 0 + + + + + 125 + 0 + + + + + Arial + + + + Qt::Horizontal + + + + + + + + + 0 + + + 10 + + + 0 + + + 10 + + + + + + Arial + + + + color: rgb(51, 51, 51) + + + Audio Jitter Buffer Samples (0 for automatic) + + + + + + + + Arial + + + + Qt::Horizontal + + + + 40 + 20 + + + + + + + + + 0 + 0 + + + + + 95 + 36 + + + + + 70 + 16777215 + + + + + Arial + + + + -10000 + + + 10000 + + + 1 + + + + + + + + + 0 + + + 10 + + + 0 + + + 10 + + + + + + Arial + + + + color: rgb(51, 51, 51) + + + Faceshift eye detection + + + avatarScaleSpin + + + + + + + + Arial + + + + Qt::Horizontal + + + + 40 + 20 + + + + + + + + + 0 + 0 + + + + + 125 + 0 + + + + + Arial + + + + Qt::Horizontal + + + + + + + + + + 0 + 0 + + + + + 0 + 40 + + + + + Arial + 20 + 50 + false + + + + color: #0e7077 + + + <html><head/><body><p>Voxels</p></body></html> + + + + + + + 0 + + + 10 + + + 0 + + + 10 + + + + + + Arial + + + + color: rgb(51, 51, 51) + + + Maximum voxels + + + leanScaleSpin + + + + + + + + Arial + + + + Qt::Horizontal + + + + 40 + 20 + + + + + + + + + 0 + 0 + + + + + 125 + 36 + + + + + Arial + + + + 5000000 + + + 50000 + + + + + + + + + 0 + + + 10 + + + 0 + + + 10 + + + + + + Arial + + + + Max voxels sent each second + + + leanScaleSpin + + + + + + + + Arial + + + + Qt::Horizontal + + + + 40 + 20 + + + + + + + + + 0 + 0 + + + + + 95 + 36 + + + + + 70 + 16777215 + + + + + Arial + + + + 60 + + + 6000 + + + 10 + + + + + + + + + + + 540 + 40 + 114 + 32 + + + + PushButton + + + + @@ -539,47 +1179,6 @@ color: #0e7077 1 - - displayNameEdit - faceURLEdit - leanScaleSpin - fieldOfViewSpin - avatarScaleSpin - pupilDilationSlider - - - - cancelButton - clicked() - PreferencesDialog - close() - - - 372 - 700 - - - 528 - -9 - - - - - defaultButton - clicked() - PreferencesDialog - accept() - - - 20 - 20 - - - 20 - 20 - - - - + From 9077a05f9d76881ea5c5776f4404d4f48337ad6d Mon Sep 17 00:00:00 2001 From: stojce Date: Fri, 21 Mar 2014 22:34:10 +0100 Subject: [PATCH 011/120] - Layout fix - Model browsers - merge --- assignment-client/src/audio/AudioMixer.cpp | 64 +- assignment-client/src/audio/AudioMixer.h | 9 +- .../src/audio/AudioMixerClientData.cpp | 22 +- .../src/audio/AudioMixerClientData.h | 5 +- .../src/octree/OctreeQueryNode.cpp | 66 +- .../src/octree/OctreeQueryNode.h | 5 + .../src/octree/OctreeSendThread.cpp | 25 +- assignment-client/src/octree/OctreeServer.cpp | 16 +- examples/editVoxels.js | 250 +- examples/inspect.js | 240 ++ interface/interface_en.ts | 98 +- interface/resources/resources.qrc | 7 +- interface/resources/styles/global.qss | 21 +- interface/src/Application.cpp | 100 +- interface/src/Application.h | 5 + interface/src/Environment.cpp | 16 +- interface/src/GLCanvas.cpp | 4 + interface/src/GLCanvas.h | 2 + interface/src/Menu.cpp | 11 +- interface/src/Menu.h | 3 +- interface/src/ModelBrowser.cpp | 150 ++ interface/src/ModelBrowser.h | 62 + interface/src/avatar/MyAvatar.cpp | 5 +- interface/src/avatar/MyAvatar.h | 2 + interface/src/renderer/TextureCache.cpp | 2 +- interface/src/ui/FramelessDialog.cpp | 40 +- interface/src/ui/FramelessDialog.h | 11 +- interface/src/ui/PreferencesDialog.cpp | 50 +- interface/src/ui/PreferencesDialog.h | 12 +- interface/ui/preferencesDialog.ui | 2366 +++++++++-------- libraries/audio/src/AudioRingBuffer.cpp | 19 +- libraries/audio/src/AudioRingBuffer.h | 5 +- .../audio/src/PositionalAudioRingBuffer.cpp | 1 + libraries/avatars/src/AvatarData.cpp | 26 + libraries/shared/src/FileDownloader.cpp | 65 + libraries/shared/src/FileDownloader.h | 44 + libraries/shared/src/FstReader.cpp | 23 +- libraries/shared/src/FstReader.h | 1 + libraries/shared/src/PacketHeaders.cpp | 4 +- libraries/voxels/src/EnvironmentData.cpp | 15 + libraries/voxels/src/EnvironmentData.h | 8 + 41 files changed, 2347 insertions(+), 1533 deletions(-) create mode 100644 examples/inspect.js create mode 100644 interface/src/ModelBrowser.cpp create mode 100644 interface/src/ModelBrowser.h create mode 100644 libraries/shared/src/FileDownloader.cpp create mode 100644 libraries/shared/src/FileDownloader.h diff --git a/assignment-client/src/audio/AudioMixer.cpp b/assignment-client/src/audio/AudioMixer.cpp index 988bcc1da7..e86ecda36e 100644 --- a/assignment-client/src/audio/AudioMixer.cpp +++ b/assignment-client/src/audio/AudioMixer.cpp @@ -62,7 +62,12 @@ void attachNewBufferToNode(Node *newNode) { } AudioMixer::AudioMixer(const QByteArray& packet) : - ThreadedAssignment(packet) + ThreadedAssignment(packet), + _trailingSleepRatio(1.0f), + _minSourceLoudnessInFrame(1.0f), + _maxSourceLoudnessInFrame(0.0f), + _loudnessCutoffRatio(0.0f), + _minRequiredLoudness(0.0f) { } @@ -301,7 +306,7 @@ void AudioMixer::prepareMixForListeningNode(Node* node) { if ((*otherNode != *node || otherNodeBuffer->shouldLoopbackForNode()) && otherNodeBuffer->willBeAddedToMix() - && otherNodeClientData->getNextOutputLoudness() > 0) { + && otherNodeBuffer->getAverageLoudness() > _minRequiredLoudness) { addBufferToMixForListeningNodeWithBuffer(otherNodeBuffer, nodeRingBuffer); } } @@ -350,14 +355,65 @@ void AudioMixer::run() { char* clientMixBuffer = new char[NETWORK_BUFFER_LENGTH_BYTES_STEREO + numBytesForPacketHeaderGivenPacketType(PacketTypeMixedAudio)]; + + int usecToSleep = BUFFER_SEND_INTERVAL_USECS; while (!_isFinished) { + _minSourceLoudnessInFrame = 1.0f; + _maxSourceLoudnessInFrame = 0.0f; + foreach (const SharedNodePointer& node, nodeList->getNodeHash()) { if (node->getLinkedData()) { - ((AudioMixerClientData*) node->getLinkedData())->checkBuffersBeforeFrameSend(JITTER_BUFFER_SAMPLES); + ((AudioMixerClientData*) node->getLinkedData())->checkBuffersBeforeFrameSend(JITTER_BUFFER_SAMPLES, + _minSourceLoudnessInFrame, + _maxSourceLoudnessInFrame); } } + + const float STRUGGLE_TRIGGER_SLEEP_PERCENTAGE_THRESHOLD = 0.10; + const float BACK_OFF_TRIGGER_SLEEP_PERCENTAGE_THRESHOLD = 0.30; + const float CUTOFF_EPSILON = 0.0001; + + const int TRAILING_AVERAGE_FRAMES = 100; + const float CURRENT_FRAME_RATIO = 1.0f / TRAILING_AVERAGE_FRAMES; + const float PREVIOUS_FRAMES_RATIO = 1 - CURRENT_FRAME_RATIO; + + if (usecToSleep < 0) { + usecToSleep = 0; + } + + _trailingSleepRatio = (PREVIOUS_FRAMES_RATIO * _trailingSleepRatio) + + (usecToSleep * CURRENT_FRAME_RATIO / (float) BUFFER_SEND_INTERVAL_USECS); + + float lastCutoffRatio = _loudnessCutoffRatio; + bool hasRatioChanged = false; + + if (_trailingSleepRatio <= STRUGGLE_TRIGGER_SLEEP_PERCENTAGE_THRESHOLD) { + // we're struggling - change our min required loudness to reduce some load + _loudnessCutoffRatio += (1 - _loudnessCutoffRatio) / 2; + + qDebug() << "Mixer is struggling, sleeping" << _trailingSleepRatio * 100 << "% of frame time. Old cutoff was" + << lastCutoffRatio << "and is now" << _loudnessCutoffRatio; + hasRatioChanged = true; + } else if (_trailingSleepRatio >= BACK_OFF_TRIGGER_SLEEP_PERCENTAGE_THRESHOLD && _loudnessCutoffRatio != 0) { + // we've recovered and can back off the required loudness + _loudnessCutoffRatio -= _loudnessCutoffRatio / 2; + + if (_loudnessCutoffRatio < CUTOFF_EPSILON) { + _loudnessCutoffRatio = 0; + } + + qDebug() << "Mixer is recovering, sleeping" << _trailingSleepRatio * 100 << "% of frame time. Old cutoff was" + << lastCutoffRatio << "and is now" << _loudnessCutoffRatio; + hasRatioChanged = true; + } + + if (hasRatioChanged) { + // set out min required loudness from the new ratio + _minRequiredLoudness = _loudnessCutoffRatio * (_maxSourceLoudnessInFrame - _minSourceLoudnessInFrame); + qDebug() << "Minimum loudness required to be mixed is now" << _minRequiredLoudness; + } foreach (const SharedNodePointer& node, nodeList->getNodeHash()) { if (node->getType() == NodeType::Agent && node->getActiveSocket() && node->getLinkedData() @@ -384,7 +440,7 @@ void AudioMixer::run() { break; } - int usecToSleep = usecTimestamp(&startTime) + (++nextFrame * BUFFER_SEND_INTERVAL_USECS) - usecTimestampNow(); + usecToSleep = usecTimestamp(&startTime) + (++nextFrame * BUFFER_SEND_INTERVAL_USECS) - usecTimestampNow(); if (usecToSleep > 0) { usleep(usecToSleep); diff --git a/assignment-client/src/audio/AudioMixer.h b/assignment-client/src/audio/AudioMixer.h index 5a68b0023f..4ba8cdebd3 100644 --- a/assignment-client/src/audio/AudioMixer.h +++ b/assignment-client/src/audio/AudioMixer.h @@ -37,7 +37,14 @@ private: void prepareMixForListeningNode(Node* node); // client samples capacity is larger than what will be sent to optimize mixing - int16_t _clientSamples[NETWORK_BUFFER_LENGTH_SAMPLES_STEREO + SAMPLE_PHASE_DELAY_AT_90]; + // we are MMX adding 4 samples at a time so we need client samples to have an extra 4 + int16_t _clientSamples[NETWORK_BUFFER_LENGTH_SAMPLES_STEREO + (SAMPLE_PHASE_DELAY_AT_90 * 2)]; + + float _trailingSleepRatio; + float _minSourceLoudnessInFrame; + float _maxSourceLoudnessInFrame; + float _loudnessCutoffRatio; + float _minRequiredLoudness; }; #endif /* defined(__hifi__AudioMixer__) */ diff --git a/assignment-client/src/audio/AudioMixerClientData.cpp b/assignment-client/src/audio/AudioMixerClientData.cpp index b2da0a0aaa..41fd72e54e 100644 --- a/assignment-client/src/audio/AudioMixerClientData.cpp +++ b/assignment-client/src/audio/AudioMixerClientData.cpp @@ -6,6 +6,8 @@ // Copyright (c) 2013 HighFidelity, Inc. All rights reserved. // +#include + #include #include @@ -14,8 +16,7 @@ #include "AudioMixerClientData.h" AudioMixerClientData::AudioMixerClientData() : - _ringBuffers(), - _nextOutputLoudness(0) + _ringBuffers() { } @@ -82,16 +83,29 @@ int AudioMixerClientData::parseData(const QByteArray& packet) { return 0; } -void AudioMixerClientData::checkBuffersBeforeFrameSend(int jitterBufferLengthSamples) { +void AudioMixerClientData::checkBuffersBeforeFrameSend(int jitterBufferLengthSamples, + float& currentMinLoudness, + float& currentMaxLoudness) { for (unsigned int i = 0; i < _ringBuffers.size(); i++) { if (_ringBuffers[i]->shouldBeAddedToMix(jitterBufferLengthSamples)) { // this is a ring buffer that is ready to go // set its flag so we know to push its buffer when all is said and done _ringBuffers[i]->setWillBeAddedToMix(true); + // calculate the average loudness for the next NETWORK_BUFFER_LENGTH_SAMPLES_PER_CHANNEL // that would be mixed in - _nextOutputLoudness = _ringBuffers[i]->averageLoudnessForBoundarySamples(NETWORK_BUFFER_LENGTH_SAMPLES_PER_CHANNEL); + _ringBuffers[i]->updateAverageLoudnessForBoundarySamples(NETWORK_BUFFER_LENGTH_SAMPLES_PER_CHANNEL); + + float ringBufferLoudness = _ringBuffers[i]->getAverageLoudness(); + + if (ringBufferLoudness != 0 && ringBufferLoudness < currentMinLoudness) { + currentMinLoudness = ringBufferLoudness; + } + + if (ringBufferLoudness > currentMaxLoudness) { + currentMaxLoudness = ringBufferLoudness; + } } } } diff --git a/assignment-client/src/audio/AudioMixerClientData.h b/assignment-client/src/audio/AudioMixerClientData.h index bb10098e23..d41563bbca 100644 --- a/assignment-client/src/audio/AudioMixerClientData.h +++ b/assignment-client/src/audio/AudioMixerClientData.h @@ -24,14 +24,11 @@ public: const std::vector getRingBuffers() const { return _ringBuffers; } AvatarAudioRingBuffer* getAvatarAudioRingBuffer() const; - float getNextOutputLoudness() const { return _nextOutputLoudness; } - int parseData(const QByteArray& packet); - void checkBuffersBeforeFrameSend(int jitterBufferLengthSamples); + void checkBuffersBeforeFrameSend(int jitterBufferLengthSamples, float& currentMinLoudness, float& currentMaxLoudness); void pushBuffersAfterFrameSend(); private: std::vector _ringBuffers; - float _nextOutputLoudness; }; #endif /* defined(__hifi__AudioMixerClientData__) */ diff --git a/assignment-client/src/octree/OctreeQueryNode.cpp b/assignment-client/src/octree/OctreeQueryNode.cpp index a1922f980d..2ceb9e1040 100644 --- a/assignment-client/src/octree/OctreeQueryNode.cpp +++ b/assignment-client/src/octree/OctreeQueryNode.cpp @@ -36,18 +36,34 @@ OctreeQueryNode::OctreeQueryNode() : _lodChanged(false), _lodInitialized(false), _sequenceNumber(0), - _lastRootTimestamp(0) + _lastRootTimestamp(0), + _myPacketType(PacketTypeUnknown), + _isShuttingDown(false) { } OctreeQueryNode::~OctreeQueryNode() { + _isShuttingDown = true; + const bool extraDebugging = false; + if (extraDebugging) { + qDebug() << "OctreeQueryNode::~OctreeQueryNode()"; + } if (_octreeSendThread) { + if (extraDebugging) { + qDebug() << "OctreeQueryNode::~OctreeQueryNode()... calling _octreeSendThread->terminate()"; + } _octreeSendThread->terminate(); + if (extraDebugging) { + qDebug() << "OctreeQueryNode::~OctreeQueryNode()... calling delete _octreeSendThread"; + } delete _octreeSendThread; } delete[] _octreePacket; delete[] _lastOctreePacket; + if (extraDebugging) { + qDebug() << "OctreeQueryNode::~OctreeQueryNode()... DONE..."; + } } @@ -59,9 +75,13 @@ void OctreeQueryNode::initializeOctreeSendThread(OctreeServer* octreeServer, con } bool OctreeQueryNode::packetIsDuplicate() const { + // if shutting down, return immediately + if (_isShuttingDown) { + return false; + } // since our packets now include header information, like sequence number, and createTime, we can't just do a memcmp // of the entire packet, we need to compare only the packet content... - int numBytesPacketHeader = numBytesForPacketHeaderGivenPacketType(getMyPacketType()); + int numBytesPacketHeader = numBytesForPacketHeaderGivenPacketType(_myPacketType); if (_lastOctreePacketLength == getPacketLength()) { if (memcmp(_lastOctreePacket + (numBytesPacketHeader + OCTREE_PACKET_EXTRA_HEADERS_SIZE), @@ -74,6 +94,11 @@ bool OctreeQueryNode::packetIsDuplicate() const { } bool OctreeQueryNode::shouldSuppressDuplicatePacket() { + // if shutting down, return immediately + if (_isShuttingDown) { + return true; + } + bool shouldSuppress = false; // assume we won't suppress // only consider duplicate packets @@ -107,7 +132,17 @@ bool OctreeQueryNode::shouldSuppressDuplicatePacket() { return shouldSuppress; } +void OctreeQueryNode::init() { + _myPacketType = getMyPacketType(); + resetOctreePacket(true); // don't bump sequence +} + void OctreeQueryNode::resetOctreePacket(bool lastWasSurpressed) { + // if shutting down, return immediately + if (_isShuttingDown) { + return; + } + // Whenever we call this, we will keep a copy of the last packet, so we can determine if the last packet has // changed since we last reset it. Since we know that no two packets can ever be identical without being the same // scene information, (e.g. the root node packet of a static scene), we can use this as a strategy for reducing @@ -128,7 +163,7 @@ void OctreeQueryNode::resetOctreePacket(bool lastWasSurpressed) { } _octreePacketAvailableBytes = MAX_PACKET_SIZE; - int numBytesPacketHeader = populatePacketHeader(reinterpret_cast(_octreePacket), getMyPacketType()); + int numBytesPacketHeader = populatePacketHeader(reinterpret_cast(_octreePacket), _myPacketType); _octreePacketAt = _octreePacket + numBytesPacketHeader; _octreePacketAvailableBytes -= numBytesPacketHeader; @@ -158,6 +193,11 @@ void OctreeQueryNode::resetOctreePacket(bool lastWasSurpressed) { } void OctreeQueryNode::writeToPacket(const unsigned char* buffer, unsigned int bytes) { + // if shutting down, return immediately + if (_isShuttingDown) { + return; + } + // compressed packets include lead bytes which contain compressed size, this allows packing of // multiple compressed portions together if (_currentPacketIsCompressed) { @@ -174,6 +214,11 @@ void OctreeQueryNode::writeToPacket(const unsigned char* buffer, unsigned int by } bool OctreeQueryNode::updateCurrentViewFrustum() { + // if shutting down, return immediately + if (_isShuttingDown) { + return false; + } + bool currentViewFrustumChanged = false; ViewFrustum newestViewFrustum; // get position and orientation details from the camera @@ -233,6 +278,11 @@ void OctreeQueryNode::setViewSent(bool viewSent) { } void OctreeQueryNode::updateLastKnownViewFrustum() { + // if shutting down, return immediately + if (_isShuttingDown) { + return; + } + bool frustumChanges = !_lastKnownViewFrustum.isVerySimilar(_currentViewFrustum); if (frustumChanges) { @@ -247,6 +297,11 @@ void OctreeQueryNode::updateLastKnownViewFrustum() { bool OctreeQueryNode::moveShouldDump() const { + // if shutting down, return immediately + if (_isShuttingDown) { + return false; + } + glm::vec3 oldPosition = _lastKnownViewFrustum.getPosition(); glm::vec3 newPosition = _currentViewFrustum.getPosition(); @@ -259,6 +314,11 @@ bool OctreeQueryNode::moveShouldDump() const { } void OctreeQueryNode::dumpOutOfView() { + // if shutting down, return immediately + if (_isShuttingDown) { + return; + } + int stillInView = 0; int outOfView = 0; OctreeElementBag tempBag; diff --git a/assignment-client/src/octree/OctreeQueryNode.h b/assignment-client/src/octree/OctreeQueryNode.h index 20fa2c5858..eab8cb5d0a 100644 --- a/assignment-client/src/octree/OctreeQueryNode.h +++ b/assignment-client/src/octree/OctreeQueryNode.h @@ -28,6 +28,7 @@ public: OctreeQueryNode(); virtual ~OctreeQueryNode(); + void init(); // called after creation to set up some virtual items virtual PacketType getMyPacketType() const = 0; void resetOctreePacket(bool lastWasSurpressed = false); // resets octree packet to after "V" header @@ -91,6 +92,7 @@ public: unsigned int getlastOctreePacketLength() const { return _lastOctreePacketLength; } int getDuplicatePacketCount() const { return _duplicatePacketCount; } + bool isShuttingDown() const { return _isShuttingDown; } private: OctreeQueryNode(const OctreeQueryNode &); @@ -127,6 +129,9 @@ private: OCTREE_PACKET_SEQUENCE _sequenceNumber; quint64 _lastRootTimestamp; + + PacketType _myPacketType; + bool _isShuttingDown; }; #endif /* defined(__hifi__OctreeQueryNode__) */ diff --git a/assignment-client/src/octree/OctreeSendThread.cpp b/assignment-client/src/octree/OctreeSendThread.cpp index caa729e340..9c04c4a1ad 100644 --- a/assignment-client/src/octree/OctreeSendThread.cpp +++ b/assignment-client/src/octree/OctreeSendThread.cpp @@ -65,7 +65,7 @@ bool OctreeSendThread::process() { nodeData = (OctreeQueryNode*) node->getLinkedData(); // Sometimes the node data has not yet been linked, in which case we can't really do anything - if (nodeData) { + if (nodeData && !nodeData->isShuttingDown()) { bool viewFrustumChanged = nodeData->updateCurrentViewFrustum(); packetDistributor(node, nodeData, viewFrustumChanged); } @@ -99,7 +99,14 @@ quint64 OctreeSendThread::_totalBytes = 0; quint64 OctreeSendThread::_totalWastedBytes = 0; quint64 OctreeSendThread::_totalPackets = 0; -int OctreeSendThread::handlePacketSend(const SharedNodePointer& node, OctreeQueryNode* nodeData, int& trueBytesSent, int& truePacketsSent) { +int OctreeSendThread::handlePacketSend(const SharedNodePointer& node, + OctreeQueryNode* nodeData, int& trueBytesSent, int& truePacketsSent) { + + // if we're shutting down, then exit early + if (nodeData->isShuttingDown()) { + return 0; + } + bool debug = _myServer->wantsDebugSending(); quint64 now = usecTimestampNow(); @@ -136,7 +143,7 @@ int OctreeSendThread::handlePacketSend(const SharedNodePointer& node, OctreeQuer // If we've got a stats message ready to send, then see if we can piggyback them together - if (nodeData->stats.isReadyToSend()) { + if (nodeData->stats.isReadyToSend() && !nodeData->isShuttingDown()) { // Send the stats message to the client unsigned char* statsMessage = nodeData->stats.getStatsMessage(); int statsMessageLength = nodeData->stats.getStatsMessageLength(); @@ -203,7 +210,7 @@ int OctreeSendThread::handlePacketSend(const SharedNodePointer& node, OctreeQuer nodeData->stats.markAsSent(); } else { // If there's actually a packet waiting, then send it. - if (nodeData->isPacketWaiting()) { + if (nodeData->isPacketWaiting() && !nodeData->isShuttingDown()) { // just send the voxel packet NodeList::getInstance()->writeDatagram((char*) nodeData->getPacket(), nodeData->getPacketLength(), SharedNodePointer(node)); @@ -234,6 +241,12 @@ int OctreeSendThread::handlePacketSend(const SharedNodePointer& node, OctreeQuer /// Version of voxel distributor that sends the deepest LOD level at once int OctreeSendThread::packetDistributor(const SharedNodePointer& node, OctreeQueryNode* nodeData, bool viewFrustumChanged) { + + // if shutting down, exit early + if (nodeData->isShuttingDown()) { + return 0; + } + int truePacketsSent = 0; int trueBytesSent = 0; int packetsSentThisInterval = 0; @@ -336,7 +349,7 @@ int OctreeSendThread::packetDistributor(const SharedNodePointer& node, OctreeQue int extraPackingAttempts = 0; bool completedScene = false; - while (somethingToSend && packetsSentThisInterval < maxPacketsPerInterval) { + while (somethingToSend && packetsSentThisInterval < maxPacketsPerInterval && !nodeData->isShuttingDown()) { float lockWaitElapsedUsec = OctreeServer::SKIP_TIME; float encodeElapsedUsec = OctreeServer::SKIP_TIME; float compressAndWriteElapsedUsec = OctreeServer::SKIP_TIME; @@ -503,7 +516,7 @@ int OctreeSendThread::packetDistributor(const SharedNodePointer& node, OctreeQue // Here's where we can/should allow the server to send other data... // send the environment packet // TODO: should we turn this into a while loop to better handle sending multiple special packets - if (_myServer->hasSpecialPacketToSend(node)) { + if (_myServer->hasSpecialPacketToSend(node) && !nodeData->isShuttingDown()) { trueBytesSent += _myServer->sendSpecialPacket(node); truePacketsSent++; packetsSentThisInterval++; diff --git a/assignment-client/src/octree/OctreeServer.cpp b/assignment-client/src/octree/OctreeServer.cpp index 7e6ffe52da..496f9af1a0 100644 --- a/assignment-client/src/octree/OctreeServer.cpp +++ b/assignment-client/src/octree/OctreeServer.cpp @@ -168,7 +168,7 @@ void OctreeServer::trackPacketSendingTime(float time) { void OctreeServer::attachQueryNodeToNode(Node* newNode) { if (!newNode->getLinkedData()) { OctreeQueryNode* newQueryNodeData = _instance->createOctreeQueryNode(); - newQueryNodeData->resetOctreePacket(true); // don't bump sequence + newQueryNodeData->init(); newNode->setLinkedData(newQueryNodeData); } } @@ -784,16 +784,26 @@ void OctreeServer::readPendingDatagrams() { if (packetType == getMyQueryMessageType()) { bool debug = false; if (debug) { - qDebug() << "Got PacketTypeVoxelQuery at" << usecTimestampNow(); + if (matchingNode) { + qDebug() << "Got PacketTypeVoxelQuery at" << usecTimestampNow() << "node:" << *matchingNode; + } else { + qDebug() << "Got PacketTypeVoxelQuery at" << usecTimestampNow() << "node: ??????"; + } } // If we got a PacketType_VOXEL_QUERY, then we're talking to an NodeType_t_AVATAR, and we // need to make sure we have it in our nodeList. if (matchingNode) { + if (debug) { + qDebug() << "calling updateNodeWithDataFromPacket()... node:" << *matchingNode; + } nodeList->updateNodeWithDataFromPacket(matchingNode, receivedPacket); OctreeQueryNode* nodeData = (OctreeQueryNode*) matchingNode->getLinkedData(); if (nodeData && !nodeData->isOctreeSendThreadInitalized()) { + if (debug) { + qDebug() << "calling initializeOctreeSendThread()... node:" << *matchingNode; + } nodeData->initializeOctreeSendThread(this, matchingNode->getUUID()); } } @@ -999,6 +1009,8 @@ void OctreeServer::nodeKilled(SharedNodePointer node) { node->setLinkedData(NULL); // set this first in case another thread comes through and tryes to acces this qDebug() << qPrintable(_safeServerName) << "server deleting Linked Data for node:" << *node; nodeData->deleteLater(); + } else { + qDebug() << qPrintable(_safeServerName) << "server node missing linked data node:" << *node; } } diff --git a/examples/editVoxels.js b/examples/editVoxels.js index 31d483d798..43bc485274 100644 --- a/examples/editVoxels.js +++ b/examples/editVoxels.js @@ -20,8 +20,6 @@ var windowDimensions = Controller.getViewportDimensions(); var NEW_VOXEL_SIZE = 1.0; var NEW_VOXEL_DISTANCE_FROM_CAMERA = 3.0; -var ORBIT_RATE_ALTITUDE = 200.0; -var ORBIT_RATE_AZIMUTH = 90.0; var PIXELS_PER_EXTRUDE_VOXEL = 16; var WHEEL_PIXELS_PER_SCALE_CHANGE = 100; var MAX_VOXEL_SCALE = 1.0; @@ -37,19 +35,7 @@ var previewLineWidth = 1.5; var oldMode = Camera.getMode(); var isAdding = false; -var isExtruding = false; -var isOrbiting = false; -var isOrbitingFromTouch = false; -var isPanning = false; -var isPanningFromTouch = false; -var touchPointsToOrbit = 2; // you can change these, but be mindful that on some track pads 2 touch points = right click+drag -var touchPointsToPan = 3; -var orbitAzimuth = 0.0; -var orbitAltitude = 0.0; -var orbitCenter = { x: 0, y: 0, z: 0 }; -var orbitPosition = { x: 0, y: 0, z: 0 }; -var torsoToEyeVector = { x: 0, y: 0, z: 0 }; -var orbitRadius = 0.0; +var isExtruding = false; var extrudeDirection = { x: 0, y: 0, z: 0 }; var extrudeScale = 0.0; var lastVoxelPosition = { x: 0, y: 0, z: 0 }; @@ -444,24 +430,11 @@ function getNewVoxelPosition() { return newPosition; } -function fixEulerAngles(eulers) { - var rVal = { x: 0, y: 0, z: eulers.z }; - if (eulers.x >= 90.0) { - rVal.x = 180.0 - eulers.x; - rVal.y = eulers.y - 180.0; - } else if (eulers.x <= -90.0) { - rVal.x = 180.0 - eulers.x; - rVal.y = eulers.y - 180.0; - } - return rVal; -} - var trackLastMouseX = 0; var trackLastMouseY = 0; var trackAsDelete = false; var trackAsRecolor = false; var trackAsEyedropper = false; -var trackAsOrbitOrPan = false; var voxelToolSelected = true; var recolorToolSelected = false; @@ -761,10 +734,6 @@ function trackKeyPressEvent(event) { trackAsEyedropper = true; moveTools(); } - if (event.text == "ALT") { - trackAsOrbitOrPan = true; - moveTools(); - } showPreviewGuides(); } @@ -802,10 +771,6 @@ function trackKeyReleaseEvent(event) { trackAsEyedropper = false; moveTools(); } - if (event.text == "ALT") { - trackAsOrbitOrPan = false; - moveTools(); - } // on F1 toggle the preview mode between cubes and lines if (event.text == "F1") { @@ -816,74 +781,6 @@ function trackKeyReleaseEvent(event) { } } -function startOrbitMode(event) { - mouseX = event.x; - mouseY = event.y; - var pickRay = Camera.computePickRay(event.x, event.y); - var intersection = Voxels.findRayIntersection(pickRay); - - // start orbit camera! - var cameraPosition = Camera.getPosition(); - torsoToEyeVector = Vec3.subtract(cameraPosition, MyAvatar.position); - torsoToEyeVector.x = 0.0; - torsoToEyeVector.z = 0.0; - oldMode = Camera.getMode(); - Camera.setMode("independent"); - Camera.keepLookingAt(intersection.intersection); - // get position for initial azimuth, elevation - orbitCenter = intersection.intersection; - var orbitVector = Vec3.subtract(cameraPosition, orbitCenter); - orbitRadius = Vec3.length(orbitVector); - orbitAzimuth = Math.atan2(orbitVector.z, orbitVector.x); - orbitAltitude = Math.asin(orbitVector.y / Vec3.length(orbitVector)); - - //print("startOrbitMode..."); -} - -function handleOrbitingMove(event) { - var cameraOrientation = Camera.getOrientation(); - var origEulers = Quat.safeEulerAngles(cameraOrientation); - var newEulers = fixEulerAngles(Quat.safeEulerAngles(cameraOrientation)); - var dx = event.x - mouseX; - var dy = event.y - mouseY; - orbitAzimuth += dx / ORBIT_RATE_AZIMUTH; - orbitAltitude += dy / ORBIT_RATE_ALTITUDE; - var orbitVector = { x:(Math.cos(orbitAltitude) * Math.cos(orbitAzimuth)) * orbitRadius, - y:Math.sin(orbitAltitude) * orbitRadius, - z:(Math.cos(orbitAltitude) * Math.sin(orbitAzimuth)) * orbitRadius }; - orbitPosition = Vec3.sum(orbitCenter, orbitVector); - Camera.setPosition(orbitPosition); - - mouseX = event.x; - mouseY = event.y; - //print("handleOrbitingMove..."); -} - -function endOrbitMode(event) { - var cameraOrientation = Camera.getOrientation(); - MyAvatar.position = Vec3.subtract(Camera.getPosition(), torsoToEyeVector); - MyAvatar.headOrientation = cameraOrientation; - Camera.stopLooking(); - Camera.setMode(oldMode); - Camera.setOrientation(cameraOrientation); - //print("endOrbitMode..."); -} - -function startPanMode(event, intersection) { - // start pan camera! - print("handle PAN mode!!!"); -} - -function handlePanMove(event) { - print("PANNING mode!!! "); - //print("isPanning="+isPanning + " inPanningFromTouch="+isPanningFromTouch + " trackAsOrbitOrPan="+trackAsOrbitOrPan); -} - -function endPanMode(event) { - print("ending PAN mode!!!"); -} - - function mousePressEvent(event) { // if our tools are off, then don't do anything @@ -891,31 +788,6 @@ function mousePressEvent(event) { return; } - // Normally, if we're panning or orbiting from touch, ignore these... because our touch takes precedence. - // but In the case of a button="RIGHT" click, we may get some touch messages first, and we actually want to - // cancel any touch mode, and then let the right-click through - if (isOrbitingFromTouch || isPanningFromTouch) { - - // if the user is holding the ALT key AND they are clicking the RIGHT button (or on multi-touch doing a two - // finger touch, then we want to let the new panning behavior take over. - // if it's any other case we still want to bail - if (event.button == "RIGHT" && trackAsOrbitOrPan) { - // cancel our current multitouch operation... - if (isOrbitingFromTouch) { - endOrbitMode(event); - isOrbitingFromTouch = false; - } - if (isPanningFromTouch) { - //print("mousePressEvent... calling endPanMode()"); - endPanMode(event); - isPanningFromTouch = false; - } - // let things fall through - } else { - return; - } - } - // no clicking on overlays while in panning mode if (!trackAsOrbitOrPan) { var clickedOnSomething = false; @@ -1008,17 +880,7 @@ function mousePressEvent(event) { calcThumbFromScale(intersection.voxel.s); } - // Note: touch and mouse events can cross paths, so we want to ignore any mouse events that would - // start a pan or orbit if we're already doing a pan or orbit via touch... - if ((event.isAlt || trackAsOrbitOrPan) && !(isOrbitingFromTouch || isPanningFromTouch)) { - if (event.isLeftButton && !event.isRightButton) { - startOrbitMode(event); - isOrbiting = true; - } else if (event.isRightButton && !event.isLeftButton) { - startPanMode(event); - isPanning = true; - } - } else if (trackAsDelete || event.isRightButton && !trackAsEyedropper) { + if (trackAsDelete || event.isRightButton && !trackAsEyedropper) { // Delete voxel voxelDetails = calculateVoxelFromIntersection(intersection,"delete"); Voxels.eraseVoxel(voxelDetails.x, voxelDetails.y, voxelDetails.z, voxelDetails.s); @@ -1209,23 +1071,7 @@ function mouseMoveEvent(event) { return; } - // if we're panning or orbiting from touch, ignore these... because our touch takes precedence. - if (isOrbitingFromTouch || isPanningFromTouch) { - return; - } - // double check that we didn't accidentally miss a pan or orbit click request - if (trackAsOrbitOrPan && !isPanning && !isOrbiting) { - if (event.isLeftButton && !event.isRightButton) { - startOrbitMode(event); - isOrbiting = true; - } - if (!event.isLeftButton && event.isRightButton) { - startPanMode(event); - isPanning = true; - } - } - if (!trackAsOrbitOrPan && isMovingSlider) { thumbX = (event.x - thumbClickOffsetX) - sliderX; if (thumbX < minThumbX) { @@ -1236,10 +1082,6 @@ function mouseMoveEvent(event) { } calcScaleFromThumb(thumbX); - } else if (isOrbiting) { - handleOrbitingMove(event); - } else if (isPanning) { - handlePanMove(event); } else if (!trackAsOrbitOrPan && isAdding) { // Watch the drag direction to tell which way to 'extrude' this voxel if (!isExtruding) { @@ -1293,16 +1135,6 @@ function mouseReleaseEvent(event) { if (isMovingSlider) { isMovingSlider = false; } - - if (isOrbiting) { - endOrbitMode(event); - isOrbiting = false; - } - if (isPanning) { - print("mouseReleaseEvent... calling endPanMode()"); - endPanMode(event); - isPanning = false; - } isAdding = false; isExtruding = false; } @@ -1396,96 +1228,18 @@ function touchBeginEvent(event) { if (!editToolsOn) { return; } - - // if we're already in the middle of orbiting or panning, then ignore these multi-touch events... - if (isOrbiting || isPanning) { - return; - } - - if (event.isAlt || trackAsOrbitOrPan) { - if (event.touchPoints == touchPointsToOrbit) { - // we need to double check that we didn't start an orbit, because the touch events will sometimes - // come in as 2 then 3 touches... - if (isPanningFromTouch) { - print("touchBeginEvent... calling endPanMode()"); - endPanMode(event); - isPanningFromTouch = false; - } - startOrbitMode(event); - isOrbitingFromTouch = true; - } else if (event.touchPoints == touchPointsToPan) { - // we need to double check that we didn't start an orbit, because the touch events will sometimes - // come in as 2 then 3 touches... - if (isOrbitingFromTouch) { - endOrbitMode(event); - isOrbitingFromTouch = false; - } - startPanMode(event); - isPanningFromTouch = true; - } - } } function touchUpdateEvent(event) { if (!editToolsOn) { return; } - - // if we're already in the middle of orbiting or panning, then ignore these multi-touch events... - if (isOrbiting || isPanning) { - return; - } - - if (isOrbitingFromTouch) { - // we need to double check that we didn't start an orbit, because the touch events will sometimes - // come in as 2 then 3 touches... - if (event.touchPoints == touchPointsToPan) { - //print("we now have touchPointsToPan touches... switch to pan..."); - endOrbitMode(event); - isOrbitingFromTouch = false; - startPanMode(event); - isPanningFromTouch = true; - } else { - handleOrbitingMove(event); - } - } - if (isPanningFromTouch) { - //print("touchUpdateEvent... isPanningFromTouch... event.touchPoints=" + event.touchPoints); - // we need to double check that we didn't start an orbit, because the touch events will sometimes - // come in as 2 then 3 touches... - if (event.touchPoints == touchPointsToOrbit) { - //print("we now have touchPointsToOrbit touches... switch to orbit..."); - //print("touchUpdateEvent... calling endPanMode()"); - endPanMode(event); - isPanningFromTouch = false; - startOrbitMode(event); - isOrbitingFromTouch = true; - handleOrbitingMove(event); - } else { - handlePanMove(event); - } - } } function touchEndEvent(event) { if (!editToolsOn) { return; } - - // if we're already in the middle of orbiting or panning, then ignore these multi-touch events... - if (isOrbiting || isPanning) { - return; - } - - if (isOrbitingFromTouch) { - endOrbitMode(event); - isOrbitingFromTouch = false; - } - if (isPanningFromTouch) { - print("touchEndEvent... calling endPanMode()"); - endPanMode(event); - isPanningFromTouch = false; - } } var lastFingerAddVoxel = { x: -1, y: -1, z: -1}; // off of the build-able area diff --git a/examples/inspect.js b/examples/inspect.js new file mode 100644 index 0000000000..9292450784 --- /dev/null +++ b/examples/inspect.js @@ -0,0 +1,240 @@ +// +// inspect.js +// hifi +// +// Created by Clément Brisset on March 20, 2014 +// Copyright (c) 2014 HighFidelity, Inc. All rights reserved. +// +// Allows you to inspect non moving objects (Voxels or Avatars) using Atl, Control (Command on Mac) and Shift +// +// radial mode = hold ALT +// orbit mode = hold ALT + CONTROL +// pan mode = hold ALT + CONTROL + SHIFT +// Once you are in a mode left click on the object to inspect and hold the click +// Dragging the mouse will move your camera according to the mode you are in. +// + +var AZIMUTH_RATE = 90.0; +var ALTITUDE_RATE = 200.0; +var RADIUS_RATE = 20.0; +var PAN_RATE = 50.0; + +var alt = false; +var shift = false; +var control = false; + +var isActive = false; + +var noMode = 0; +var orbitMode = 1; +var radialMode = 2; +var panningMode = 3; + +var mode = noMode; + +var mouseLastX = 0; +var mouseLastY = 0; + + +var center = { x: 0, y: 0, z: 0 }; +var position = { x: 0, y: 0, z: 0 }; +var vector = { x: 0, y: 0, z: 0 }; +var radius = 0.0; +var azimuth = 0.0; +var altitude = 0.0; + + +function handleRadialMode(dx, dy) { + azimuth += dx / AZIMUTH_RATE; + radius += radius * dy / RADIUS_RATE; + if (radius < 1) { + radius = 1; + } + + vector = { x: (Math.cos(altitude) * Math.cos(azimuth)) * radius, + y: Math.sin(altitude) * radius, + z: (Math.cos(altitude) * Math.sin(azimuth)) * radius }; + position = Vec3.sum(center, vector); + Camera.setPosition(position); +} + +function handleOrbitMode(dx, dy) { + azimuth += dx / AZIMUTH_RATE; + altitude += dy / ALTITUDE_RATE; + + vector = { x:(Math.cos(altitude) * Math.cos(azimuth)) * radius, + y:Math.sin(altitude) * radius, + z:(Math.cos(altitude) * Math.sin(azimuth)) * radius }; + position = Vec3.sum(center, vector); + Camera.setPosition(position); +} + + +function handlePanMode(dx, dy) { + var up = Quat.getUp(Camera.getOrientation()); + var right = Quat.getRight(Camera.getOrientation()); + var distance = Vec3.length(vector); + + var dv = Vec3.sum(Vec3.multiply(up, - distance * dy / PAN_RATE), Vec3.multiply(right, distance * dx / PAN_RATE)); + + center = Vec3.sum(center, dv); + position = Vec3.sum(position, dv); + + Camera.setPosition(position); + Camera.keepLookingAt(center); +} + +function saveCameraState() { + oldMode = Camera.getMode(); + var oldPosition = Camera.getPosition(); + Camera.setMode("independent"); + Camera.setPosition(oldPosition); +} + +function restoreCameraState() { + Camera.stopLooking(); + Camera.setMode(oldMode); +} + +function handleModes() { + var newMode = noMode; + if (alt) { + if (control) { + if (shift) { + newMode = panningMode; + } else { + newMode = orbitMode; + } + } else { + newMode = radialMode; + } + } + + // if leaving noMode + if (mode == noMode && newMode != noMode) { + saveCameraState(); + } + // if entering noMode + if (newMode == noMode && mode != noMode) { + restoreCameraState(); + } + + mode = newMode; +} + +function keyPressEvent(event) { + var changed = false; + + if (event.text == "ALT") { + alt = true; + changed = true; + } + if (event.text == "CONTROL") { + control = true; + changed = true; + } + if (event.text == "SHIFT") { + shift = true; + changed = true; + } + + if (changed) { + handleModes(); + } +} + +function keyReleaseEvent(event) { + var changed = false; + + if (event.text == "ALT") { + alt = false; + changed = true; + } + if (event.text == "CONTROL") { + control = false; + changed = true; + } + if (event.text == "SHIFT") { + shift = false; + changed = true; + } + + if (changed) { + handleModes(); + } +} + +function mousePressEvent(event) { + if (alt) { + isActive = true; + mouseLastX = event.x; + mouseLastY = event.y; + + // Compute trajectories related values + var pickRay = Camera.computePickRay(mouseLastX, mouseLastY); + var intersection = Voxels.findRayIntersection(pickRay); + + position = Camera.getPosition(); + + avatarTarget = MyAvatar.getTargetAvatarPosition(); + voxelTarget = intersection.intersection; + if (Vec3.length(Vec3.subtract(avatarTarget, position)) < Vec3.length(Vec3.subtract(voxelTarget, position))) { + if (avatarTarget.x != 0 || avatarTarget.y != 0 || avatarTarget.z != 0) { + center = avatarTarget; + } else { + center = voxelTarget; + } + } else { + if (voxelTarget.x != 0 || voxelTarget.y != 0 || voxelTarget.z != 0) { + center = voxelTarget; + } else { + center = avatarTarget; + } + } + + vector = Vec3.subtract(position, center); + radius = Vec3.length(vector); + azimuth = Math.atan2(vector.z, vector.x); + altitude = Math.asin(vector.y / Vec3.length(vector)); + + Camera.keepLookingAt(center); + } +} + +function mouseReleaseEvent(event) { + if (isActive) { + isActive = false; + } +} + +function mouseMoveEvent(event) { + if (isActive && mode != noMode) { + if (mode == radialMode) { + handleRadialMode(event.x - mouseLastX, event.y - mouseLastY); + } + if (mode == orbitMode) { + handleOrbitMode(event.x - mouseLastX, event.y - mouseLastY); + } + if (mode == panningMode) { + handlePanMode(event.x - mouseLastX, event.y - mouseLastY); + } + + mouseLastX = event.x; + mouseLastY = event.y; + } +} + +function scriptEnding() { + if (mode != noMode) { + restoreCameraState(); + } +} + +Controller.keyPressEvent.connect(keyPressEvent); +Controller.keyReleaseEvent.connect(keyReleaseEvent); + +Controller.mousePressEvent.connect(mousePressEvent); +Controller.mouseReleaseEvent.connect(mouseReleaseEvent); +Controller.mouseMoveEvent.connect(mouseMoveEvent); + +Script.scriptEnding.connect(scriptEnding); \ No newline at end of file diff --git a/interface/interface_en.ts b/interface/interface_en.ts index 3c61d5f17a..05998e6436 100644 --- a/interface/interface_en.ts +++ b/interface/interface_en.ts @@ -4,22 +4,22 @@ Application - + Export Voxels - + Sparse Voxel Octree Files (*.svo) - + Open Script - + JavaScript Files (*.js) @@ -113,18 +113,18 @@ Menu - + Open .ini config file - - + + Text files (*.ini) - + Save .ini config file @@ -132,122 +132,116 @@ PreferencesDialog - - + + Avatar - - + + <html><head/><body><p>Avatar display name <span style=" color:#909090;">(optional)</span></p></body></html> - - + + Not showing a name - - + + Head - - + + Body - - + + Advanced Tuning - - + + It's not recomended that you play with these settings unless you've looked into exactly what they do. - - + + <p>Avatar</p> - - + + Lean scale (applies to Faceshift users) - - + + Vertical field of view - - + + Avatar scale (default is 1.0) - - + + Pupil dillation - - + + Audio Jitter Buffer Samples (0 for automatic) - - + + Faceshift eye detection - - + + <html><head/><body><p>Voxels</p></body></html> - - + + Maximum voxels - - + + Max voxels sent each second - - - PushButton - - - - - + + Cancel - - + + Save all changes diff --git a/interface/resources/resources.qrc b/interface/resources/resources.qrc index 372fa8b1d4..300728392c 100644 --- a/interface/resources/resources.qrc +++ b/interface/resources/resources.qrc @@ -1,5 +1,6 @@ - - images/close.svg - + + images/close.svg + styles/search.svg + diff --git a/interface/resources/styles/global.qss b/interface/resources/styles/global.qss index d302555463..2554f3b2c9 100644 --- a/interface/resources/styles/global.qss +++ b/interface/resources/styles/global.qss @@ -13,8 +13,9 @@ QLineEdit { border-style: solid; border-width: 1px; border-color: #ccc; - padding: 7px; - opacity: 1; + padding: 8px; + font-size: 16px; + color: rgb(51, 51, 51); } QLabel p { @@ -27,14 +28,15 @@ QPushButton { border-radius: 9px; font-family: Arial; font-size: 18px; - font-weight: 100; color: #ffffff; - padding: 10px 15px; + padding: 10px 0px; } QSpinBox, QDoubleSpinBox { padding: 5px; border-width: 1; + font-size: 16px; + color: rgb(51, 51, 51); } QDoubleSpinBox::up-arrow, @@ -98,3 +100,14 @@ QSlider::handle:horizontal { background-repeat: no-repeat; background-position: center center; } + +QPushButton#closeButton { + border-color: #ccc; + border-style: solid; + border-width: 1px; + border-radius: 0; + background-color: #fff; + background-image: url(styles/close.svg); + background-repeat: no-repeat; + background-position: center center; +} diff --git a/interface/src/Application.cpp b/interface/src/Application.cpp index 50dbf1b51a..030e3bc6fd 100644 --- a/interface/src/Application.cpp +++ b/interface/src/Application.cpp @@ -692,6 +692,8 @@ bool Application::event(QEvent* event) { void Application::keyPressEvent(QKeyEvent* event) { + _keysPressed.insert(event->key()); + _controllerScriptingInterface.emitKeyPressEvent(event); // send events to any registered scripts // if one of our scripts have asked to capture this event, then stop processing it @@ -914,6 +916,8 @@ void Application::keyPressEvent(QKeyEvent* event) { void Application::keyReleaseEvent(QKeyEvent* event) { + _keysPressed.remove(event->key()); + _controllerScriptingInterface.emitKeyReleaseEvent(event); // send events to any registered scripts // if one of our scripts have asked to capture this event, then stop processing it @@ -921,60 +925,66 @@ void Application::keyReleaseEvent(QKeyEvent* event) { return; } + switch (event->key()) { + case Qt::Key_E: + _myAvatar->setDriveKeys(UP, 0.f); + break; - if (activeWindow() == _window) { - switch (event->key()) { - case Qt::Key_E: - _myAvatar->setDriveKeys(UP, 0.f); - break; + case Qt::Key_C: + _myAvatar->setDriveKeys(DOWN, 0.f); + break; - case Qt::Key_C: - _myAvatar->setDriveKeys(DOWN, 0.f); - break; + case Qt::Key_W: + _myAvatar->setDriveKeys(FWD, 0.f); + break; - case Qt::Key_W: - _myAvatar->setDriveKeys(FWD, 0.f); - break; + case Qt::Key_S: + _myAvatar->setDriveKeys(BACK, 0.f); + break; - case Qt::Key_S: - _myAvatar->setDriveKeys(BACK, 0.f); - break; + case Qt::Key_A: + _myAvatar->setDriveKeys(ROT_LEFT, 0.f); + break; - case Qt::Key_A: - _myAvatar->setDriveKeys(ROT_LEFT, 0.f); - break; + case Qt::Key_D: + _myAvatar->setDriveKeys(ROT_RIGHT, 0.f); + break; - case Qt::Key_D: - _myAvatar->setDriveKeys(ROT_RIGHT, 0.f); - break; + case Qt::Key_Up: + _myAvatar->setDriveKeys(FWD, 0.f); + _myAvatar->setDriveKeys(UP, 0.f); + break; - case Qt::Key_Up: - _myAvatar->setDriveKeys(FWD, 0.f); - _myAvatar->setDriveKeys(UP, 0.f); - break; + case Qt::Key_Down: + _myAvatar->setDriveKeys(BACK, 0.f); + _myAvatar->setDriveKeys(DOWN, 0.f); + break; - case Qt::Key_Down: - _myAvatar->setDriveKeys(BACK, 0.f); - _myAvatar->setDriveKeys(DOWN, 0.f); - break; + case Qt::Key_Left: + _myAvatar->setDriveKeys(LEFT, 0.f); + _myAvatar->setDriveKeys(ROT_LEFT, 0.f); + break; - case Qt::Key_Left: - _myAvatar->setDriveKeys(LEFT, 0.f); - _myAvatar->setDriveKeys(ROT_LEFT, 0.f); - break; + case Qt::Key_Right: + _myAvatar->setDriveKeys(RIGHT, 0.f); + _myAvatar->setDriveKeys(ROT_RIGHT, 0.f); + break; - case Qt::Key_Right: - _myAvatar->setDriveKeys(RIGHT, 0.f); - _myAvatar->setDriveKeys(ROT_RIGHT, 0.f); - break; - - default: - event->ignore(); - break; - } + default: + event->ignore(); + break; } } +void Application::focusOutEvent(QFocusEvent* event) { + // synthesize events for keys currently pressed, since we may not get their release events + foreach (int key, _keysPressed) { + QKeyEvent event(QEvent::KeyRelease, key, Qt::NoModifier); + keyReleaseEvent(&event); + } + _keysPressed.clear(); +} + void Application::mouseMoveEvent(QMouseEvent* event) { _controllerScriptingInterface.emitMouseMoveEvent(event); // send events to any registered scripts @@ -1680,7 +1690,7 @@ void Application::updateMyAvatarLookAtPosition() { } else { // look in direction of the mouse ray, but use distance from intersection, if any float distance = TREE_SCALE; - if (_myAvatar->getLookAtTargetAvatar()) { + if (_myAvatar->getLookAtTargetAvatar() && _myAvatar != _myAvatar->getLookAtTargetAvatar()) { distance = glm::distance(_mouseRayOrigin, static_cast(_myAvatar->getLookAtTargetAvatar())->getHead()->calculateAverageEyePosition()); } @@ -2140,7 +2150,8 @@ void Application::loadViewFrustum(Camera& camera, ViewFrustum& viewFrustum) { } glm::vec3 Application::getSunDirection() { - return glm::normalize(_environment.getClosestData(_myCamera.getPosition()).getSunLocation() - _myCamera.getPosition()); + return glm::normalize(_environment.getClosestData(_myCamera.getPosition()).getSunLocation(_myCamera.getPosition()) - + _myCamera.getPosition()); } void Application::updateShadowMap() { @@ -2302,7 +2313,8 @@ void Application::displaySide(Camera& whichCamera, bool selfAvatarOnly) { float alpha = 1.0f; if (Menu::getInstance()->isOptionChecked(MenuOption::Atmosphere)) { const EnvironmentData& closestData = _environment.getClosestData(whichCamera.getPosition()); - float height = glm::distance(whichCamera.getPosition(), closestData.getAtmosphereCenter()); + float height = glm::distance(whichCamera.getPosition(), + closestData.getAtmosphereCenter(whichCamera.getPosition())); if (height < closestData.getAtmosphereInnerRadius()) { alpha = 0.0f; diff --git a/interface/src/Application.h b/interface/src/Application.h index cbfbf4166d..28060113a9 100644 --- a/interface/src/Application.h +++ b/interface/src/Application.h @@ -18,6 +18,7 @@ #include #include #include +#include #include #include @@ -122,6 +123,8 @@ public: void keyPressEvent(QKeyEvent* event); void keyReleaseEvent(QKeyEvent* event); + void focusOutEvent(QFocusEvent* event); + void mouseMoveEvent(QMouseEvent* event); void mousePressEvent(QMouseEvent* event); void mouseReleaseEvent(QMouseEvent* event); @@ -432,6 +435,8 @@ private: bool _mousePressed; // true if mouse has been pressed (clear when finished) + QSet _keysPressed; + GeometryCache _geometryCache; TextureCache _textureCache; diff --git a/interface/src/Environment.cpp b/interface/src/Environment.cpp index 1f9e23bee1..096b8770fb 100644 --- a/interface/src/Environment.cpp +++ b/interface/src/Environment.cpp @@ -92,7 +92,7 @@ glm::vec3 Environment::getGravity (const glm::vec3& position) { foreach (const ServerData& serverData, _data) { foreach (const EnvironmentData& environmentData, serverData) { - glm::vec3 vector = environmentData.getAtmosphereCenter() - position; + glm::vec3 vector = environmentData.getAtmosphereCenter(position) - position; float surfaceRadius = environmentData.getAtmosphereInnerRadius(); if (glm::length(vector) <= surfaceRadius) { // At or inside a planet, gravity is as set for the planet @@ -116,7 +116,7 @@ const EnvironmentData Environment::getClosestData(const glm::vec3& position) { float closestDistance = FLT_MAX; foreach (const ServerData& serverData, _data) { foreach (const EnvironmentData& environmentData, serverData) { - float distance = glm::distance(position, environmentData.getAtmosphereCenter()) - + float distance = glm::distance(position, environmentData.getAtmosphereCenter(position)) - environmentData.getAtmosphereOuterRadius(); if (distance < closestDistance) { closest = environmentData; @@ -132,6 +132,8 @@ bool Environment::findCapsulePenetration(const glm::vec3& start, const glm::vec3 // collide with the "floor" bool found = findCapsulePlanePenetration(start, end, radius, glm::vec4(0.0f, 1.0f, 0.0f, 0.0f), penetration); + glm::vec3 middle = (start + end) * 0.5f; + // get the lock for the duration of the call QMutexLocker locker(&_mutex); @@ -141,7 +143,7 @@ bool Environment::findCapsulePenetration(const glm::vec3& start, const glm::vec3 continue; // don't bother colliding with gravity-less environments } glm::vec3 environmentPenetration; - if (findCapsuleSpherePenetration(start, end, radius, environmentData.getAtmosphereCenter(), + if (findCapsuleSpherePenetration(start, end, radius, environmentData.getAtmosphereCenter(middle), environmentData.getAtmosphereInnerRadius(), environmentPenetration)) { penetration = addPenetrations(penetration, environmentPenetration); found = true; @@ -203,10 +205,12 @@ ProgramObject* Environment::createSkyProgram(const char* from, int* locations) { } void Environment::renderAtmosphere(Camera& camera, const EnvironmentData& data) { + glm::vec3 center = data.getAtmosphereCenter(camera.getPosition()); + glPushMatrix(); - glTranslatef(data.getAtmosphereCenter().x, data.getAtmosphereCenter().y, data.getAtmosphereCenter().z); - - glm::vec3 relativeCameraPos = camera.getPosition() - data.getAtmosphereCenter(); + glTranslatef(center.x, center.y, center.z); + + glm::vec3 relativeCameraPos = camera.getPosition() - center; float height = glm::length(relativeCameraPos); // use the appropriate shader depending on whether we're inside or outside diff --git a/interface/src/GLCanvas.cpp b/interface/src/GLCanvas.cpp index a91452c06d..513dcfe40c 100644 --- a/interface/src/GLCanvas.cpp +++ b/interface/src/GLCanvas.cpp @@ -55,6 +55,10 @@ void GLCanvas::keyReleaseEvent(QKeyEvent* event) { Application::getInstance()->keyReleaseEvent(event); } +void GLCanvas::focusOutEvent(QFocusEvent* event) { + Application::getInstance()->focusOutEvent(event); +} + void GLCanvas::mouseMoveEvent(QMouseEvent* event) { Application::getInstance()->mouseMoveEvent(event); } diff --git a/interface/src/GLCanvas.h b/interface/src/GLCanvas.h index ad396a48ce..f7f7fb7c20 100644 --- a/interface/src/GLCanvas.h +++ b/interface/src/GLCanvas.h @@ -31,6 +31,8 @@ protected: virtual void keyPressEvent(QKeyEvent* event); virtual void keyReleaseEvent(QKeyEvent* event); + virtual void focusOutEvent(QFocusEvent* event); + virtual void mouseMoveEvent(QMouseEvent* event); virtual void mousePressEvent(QMouseEvent* event); virtual void mouseReleaseEvent(QMouseEvent* event); diff --git a/interface/src/Menu.cpp b/interface/src/Menu.cpp index 54b6a5dac2..2b1003f2e4 100644 --- a/interface/src/Menu.cpp +++ b/interface/src/Menu.cpp @@ -24,11 +24,12 @@ #include #include #include -#include +#include #include #include #include +#include #include "Application.h" #include "Menu.h" @@ -36,6 +37,7 @@ #include "Util.h" #include "InfoView.h" #include "ui/MetavoxelEditor.h" +#include "ModelBrowser.h" Menu* Menu::_instance = NULL; @@ -138,9 +140,8 @@ Menu::Menu() : this, SLOT(goTo())); - addDisabledActionAndSeparator(fileMenu, "Upload/Browse"); - addActionToQMenuAndActionHash(fileMenu, MenuOption::UploaderAvatarHead, 0, Application::getInstance(), SLOT(uploadFST())); - addActionToQMenuAndActionHash(fileMenu, MenuOption::UploaderAvatarSkeleton, 0, Application::getInstance(), SLOT(uploadFST())); + addDisabledActionAndSeparator(fileMenu, "Upload Avatar Model"); + addActionToQMenuAndActionHash(fileMenu, MenuOption::UploadFST, 0, Application::getInstance(), SLOT(uploadFST())); addDisabledActionAndSeparator(fileMenu, "Settings"); addActionToQMenuAndActionHash(fileMenu, MenuOption::SettingsImport, 0, this, SLOT(importSettings())); @@ -693,7 +694,7 @@ void Menu::loginForCurrentDomain() { } void Menu::editPreferences() { - if (! _preferencesDialog) { + if (!_preferencesDialog) { _preferencesDialog = new PreferencesDialog(Application::getInstance()->getGLWidget()); _preferencesDialog->show(); } diff --git a/interface/src/Menu.h b/interface/src/Menu.h index 15a4ee1811..96d5267b9c 100644 --- a/interface/src/Menu.h +++ b/interface/src/Menu.h @@ -300,8 +300,7 @@ namespace MenuOption { const QString StopAllScripts = "Stop All Scripts"; const QString TestPing = "Test Ping"; const QString TransmitterDrive = "Transmitter Drive"; - const QString UploaderAvatarHead = "Upload Avatar Head"; - const QString UploaderAvatarSkeleton = "Upload Avatar Skeleton"; + const QString UploadFST = "Upload FST file"; const QString Visage = "Visage"; const QString Quit = "Quit"; const QString Voxels = "Voxels"; diff --git a/interface/src/ModelBrowser.cpp b/interface/src/ModelBrowser.cpp new file mode 100644 index 0000000000..e03081273f --- /dev/null +++ b/interface/src/ModelBrowser.cpp @@ -0,0 +1,150 @@ +// +// ModelBrowser.cpp +// hifi +// +// Created by Clement on 3/17/14. +// Copyright (c) 2014 HighFidelity, Inc. All rights reserved. +// + +#include +#include +#include +#include +#include +#include +#include +#include + +#include + +#include "ModelBrowser.h" + +static const QString PREFIX_PARAMETER_NAME = "prefix"; +static const QString MARKER_PARAMETER_NAME = "marker"; +static const QString IS_TRUNCATED_NAME = "IsTruncated"; +static const QString CONTAINER_NAME = "Contents"; +static const QString KEY_NAME = "Key"; + +ModelBrowser::ModelBrowser(ModelType modelType, QWidget* parent) : QWidget(parent), _type(modelType) { + QUrl url(S3_URL); + QUrlQuery query; + + if (_type == Head) { + query.addQueryItem(PREFIX_PARAMETER_NAME, HEAD_MODELS_LOCATION); + } else if (_type == Skeleton) { + query.addQueryItem(PREFIX_PARAMETER_NAME, SKELETON_MODELS_LOCATION); + } + url.setQuery(query); + + _downloader = new FileDownloader(url); + connect(_downloader, SIGNAL(done(QNetworkReply::NetworkError)), SLOT(downloadFinished())); +} + +ModelBrowser::~ModelBrowser() { + delete _downloader; +} + +void ModelBrowser::downloadFinished() { + parseXML(_downloader->getData()); +} + +void ModelBrowser::browse() { + QDialog dialog(this); + dialog.setWindowTitle("Browse models"); + + QGridLayout* layout = new QGridLayout(&dialog); + dialog.setLayout(layout); + + QLineEdit* searchBar = new QLineEdit(&dialog); + layout->addWidget(searchBar, 0, 0); + + ListView* listView = new ListView(&dialog); + listView->setEditTriggers(QAbstractItemView::NoEditTriggers); + layout->addWidget(listView, 1, 0); + listView->connect(searchBar, SIGNAL(textChanged(const QString&)), SLOT(keyboardSearch(const QString&))); + dialog.connect(listView, SIGNAL(doubleClicked(const QModelIndex&)), SLOT(accept())); + + QStringListModel* model = new QStringListModel(_models.keys(), listView); + model->sort(0); + listView->setModel(model); + + QDialogButtonBox* buttons = new QDialogButtonBox(QDialogButtonBox::Ok | QDialogButtonBox::Cancel); + layout->addWidget(buttons, 2, 0); + dialog.connect(buttons, SIGNAL(accepted()), SLOT(accept())); + dialog.connect(buttons, SIGNAL(rejected()), SLOT(reject())); + + if (dialog.exec() == QDialog::Rejected) { + return; + } + + QString selectedKey = model->data(listView->currentIndex(), Qt::DisplayRole).toString(); + + emit selected(_models[selectedKey]); +} + +bool ModelBrowser::parseXML(QByteArray xmlFile) { + QXmlStreamReader xml(xmlFile); + QRegExp rx(".*fst"); + bool truncated = false; + QString lastKey; + + // Read xml until the end or an error is detected + while(!xml.atEnd() && !xml.hasError()) { + if(xml.tokenType() == QXmlStreamReader::StartElement && xml.name() == IS_TRUNCATED_NAME) { + while(!(xml.tokenType() == QXmlStreamReader::EndElement && xml.name() == IS_TRUNCATED_NAME)) { + // Let's check if there is more + xml.readNext(); + if (xml.text().toString() == "True") { + truncated = true; + } + } + } + + if(xml.tokenType() == QXmlStreamReader::StartElement && xml.name() == CONTAINER_NAME) { + while(!(xml.tokenType() == QXmlStreamReader::EndElement && xml.name() == CONTAINER_NAME)) { + // If a file is find, process it + if(xml.tokenType() == QXmlStreamReader::StartElement && xml.name() == KEY_NAME) { + xml.readNext(); + lastKey = xml.text().toString(); + if (rx.exactMatch(xml.text().toString())) { + // Add the found file to the list + _models.insert(QFileInfo(xml.text().toString()).baseName(), + S3_URL + "/" + xml.text().toString()); + } + } + xml.readNext(); + } + } + xml.readNext(); + } + + // Error handling + if(xml.hasError()) { + _models.clear(); + QMessageBox::critical(this, + "ModelBrowser::ModelBrowser()", + xml.errorString(), + QMessageBox::Ok); + return false; + } + + // If we didn't all the files, download the next ones + if (truncated) { + QUrl url(S3_URL); + QUrlQuery query; + + if (_type == Head) { + query.addQueryItem(PREFIX_PARAMETER_NAME, HEAD_MODELS_LOCATION); + } else if (_type == Skeleton) { + query.addQueryItem(PREFIX_PARAMETER_NAME, SKELETON_MODELS_LOCATION); + } + query.addQueryItem(MARKER_PARAMETER_NAME, lastKey); + url.setQuery(query); + + delete _downloader; + _downloader = new FileDownloader(url); + connect(_downloader, SIGNAL(done(QNetworkReply::NetworkError)), SLOT(downloadFinished())); + } + + return true; +} \ No newline at end of file diff --git a/interface/src/ModelBrowser.h b/interface/src/ModelBrowser.h new file mode 100644 index 0000000000..4628642e89 --- /dev/null +++ b/interface/src/ModelBrowser.h @@ -0,0 +1,62 @@ +// +// ModelBrowser.h +// hifi +// +// Created by Clement on 3/17/14. +// Copyright (c) 2014 HighFidelity, Inc. All rights reserved. +// + +#ifndef __hifi__ModelBrowser__ +#define __hifi__ModelBrowser__ + +#include + +#include +#include + +static const QString S3_URL = "http://highfidelity-public.s3-us-west-1.amazonaws.com"; +static const QString HEAD_MODELS_LOCATION = "models/heads/"; +static const QString SKELETON_MODELS_LOCATION = "models/skeletons/"; + +enum ModelType { + Head, + Skeleton +}; + +class ModelBrowser : public QWidget { + Q_OBJECT + +public: + ModelBrowser(ModelType modelType, QWidget* parent = NULL); + ~ModelBrowser(); + +signals: + void selected(QString filename); + +public slots: + void browse(); + +private slots: + void downloadFinished(); + +private: + ModelType _type; + FileDownloader* _downloader; + QHash _models; + + bool parseXML(QByteArray xmlFile); +}; + + + +class ListView : public QListView { + Q_OBJECT +public: + ListView(QWidget* parent) : QListView(parent) {} + public slots: + void keyboardSearch(const QString& text) { + QAbstractItemView::keyboardSearch(text); + } +}; + +#endif /* defined(__hifi__ModelBrowser__) */ diff --git a/interface/src/avatar/MyAvatar.cpp b/interface/src/avatar/MyAvatar.cpp index fb0d704c6a..13e2d3321a 100644 --- a/interface/src/avatar/MyAvatar.cpp +++ b/interface/src/avatar/MyAvatar.cpp @@ -582,16 +582,15 @@ void MyAvatar::updateLookAtTargetAvatar() { foreach (const AvatarSharedPointer& avatarPointer, Application::getInstance()->getAvatarManager().getAvatarHash()) { Avatar* avatar = static_cast(avatarPointer.data()); - if (avatar == static_cast(this)) { - continue; - } float distance; if (avatar->findRayIntersection(mouseOrigin, mouseDirection, distance)) { _lookAtTargetAvatar = avatarPointer; + _targetAvatarPosition = avatarPointer->getPosition(); return; } } _lookAtTargetAvatar.clear(); + _targetAvatarPosition = glm::vec3(0, 0, 0); } } diff --git a/interface/src/avatar/MyAvatar.h b/interface/src/avatar/MyAvatar.h index 3544fb1a61..d958103fa6 100644 --- a/interface/src/avatar/MyAvatar.h +++ b/interface/src/avatar/MyAvatar.h @@ -76,6 +76,7 @@ public: void orbit(const glm::vec3& position, int deltaX, int deltaY); + Q_INVOKABLE glm::vec3 getTargetAvatarPosition() const { return _targetAvatarPosition; } AvatarData* getLookAtTargetAvatar() const { return _lookAtTargetAvatar.data(); } void updateLookAtTargetAvatar(); void clearLookAtTargetAvatar(); @@ -116,6 +117,7 @@ private: glm::vec3 _moveTarget; int _moveTargetStepCounter; QWeakPointer _lookAtTargetAvatar; + glm::vec3 _targetAvatarPosition; bool _shouldRender; bool _billboardValid; diff --git a/interface/src/renderer/TextureCache.cpp b/interface/src/renderer/TextureCache.cpp index 2b43c89998..b3820abf25 100644 --- a/interface/src/renderer/TextureCache.cpp +++ b/interface/src/renderer/TextureCache.cpp @@ -313,7 +313,7 @@ void ImageReader::run() { int imageArea = image.width() * image.height(); if (opaquePixels == imageArea) { qDebug() << "Image with alpha channel is completely opaque:" << url; - image.convertToFormat(QImage::Format_RGB888); + image = image.convertToFormat(QImage::Format_RGB888); } QMetaObject::invokeMethod(texture.data(), "setImage", Q_ARG(const QImage&, image), Q_ARG(bool, translucentPixels >= imageArea / 2)); diff --git a/interface/src/ui/FramelessDialog.cpp b/interface/src/ui/FramelessDialog.cpp index 9239deed90..1f67e9f4d1 100644 --- a/interface/src/ui/FramelessDialog.cpp +++ b/interface/src/ui/FramelessDialog.cpp @@ -6,6 +6,7 @@ // // +#include #include #include #include @@ -13,13 +14,29 @@ #include "Application.h" #include "FramelessDialog.h" -FramelessDialog::FramelessDialog(QWidget *parent, Qt::WindowFlags flags) : QDialog(parent, flags | Qt::FramelessWindowHint) { - setWindowOpacity(0.9); +const int RESIZE_HANDLE_WIDTH = 7; + +FramelessDialog::FramelessDialog(QWidget *parent, Qt::WindowFlags flags) : + QDialog(parent, flags | Qt::FramelessWindowHint), + _isResizing(false) { + + setWindowOpacity(0.95); setAttribute(Qt::WA_DeleteOnClose); - isResizing = false; + + installEventFilter(this); } -void FramelessDialog::setStyleSheet(const QString& fileName) { +void FramelessDialog::showEvent(QShowEvent* event) { + QDesktopWidget desktop; + + // move to upper left + move(desktop.availableGeometry().x(), desktop.availableGeometry().y()); + + // keep full height + resize(size().width(), desktop.availableGeometry().height()); +} + +void FramelessDialog::setStyleSheetFile(const QString& fileName) { QFile globalStyleSheet(Application::resourcesPath() + "styles/global.qss"); QFile styleSheet(Application::resourcesPath() + fileName); if (styleSheet.open(QIODevice::ReadOnly) && globalStyleSheet.open(QIODevice::ReadOnly) ) { @@ -27,27 +44,24 @@ void FramelessDialog::setStyleSheet(const QString& fileName) { QDialog::setStyleSheet(globalStyleSheet.readAll() + styleSheet.readAll()); } } + void FramelessDialog::mousePressEvent(QMouseEvent* mouseEvent) { - if (abs(mouseEvent->pos().x() - size().width()) < 2 && mouseEvent->button() == Qt::LeftButton) { - isResizing = true; + + if (abs(mouseEvent->pos().x() - size().width()) < RESIZE_HANDLE_WIDTH && mouseEvent->button() == Qt::LeftButton) { + _isResizing = true; QApplication::setOverrideCursor(Qt::SizeHorCursor); } - // propagate the event - QDialog::mousePressEvent(mouseEvent); } void FramelessDialog::mouseReleaseEvent(QMouseEvent* mouseEvent) { QApplication::restoreOverrideCursor(); - isResizing = false; - // propagate the event - QDialog::mouseReleaseEvent(mouseEvent); + _isResizing = false; } void FramelessDialog::mouseMoveEvent(QMouseEvent* mouseEvent) { - if (isResizing) { + if (_isResizing) { resize(mouseEvent->pos().x(), size().height()); } - QDialog::mouseMoveEvent(mouseEvent); } FramelessDialog::~FramelessDialog() { diff --git a/interface/src/ui/FramelessDialog.h b/interface/src/ui/FramelessDialog.h index 4e18aff161..2bb8d6b85c 100644 --- a/interface/src/ui/FramelessDialog.h +++ b/interface/src/ui/FramelessDialog.h @@ -21,15 +21,16 @@ class FramelessDialog : public QDialog { public: FramelessDialog(QWidget* parent = 0, Qt::WindowFlags flags = 0); virtual ~FramelessDialog(); - void setStyleSheet(const QString& fileName); + void setStyleSheetFile(const QString& fileName); protected: - void mouseMoveEvent(QMouseEvent* mouseEvent); - void mousePressEvent(QMouseEvent* mouseEvent); - void mouseReleaseEvent(QMouseEvent* mouseEvent); + virtual void mouseMoveEvent(QMouseEvent* mouseEvent); + virtual void mousePressEvent(QMouseEvent* mouseEvent); + virtual void mouseReleaseEvent(QMouseEvent* mouseEvent); + virtual void showEvent(QShowEvent* event); private: - bool isResizing; + bool _isResizing; }; diff --git a/interface/src/ui/PreferencesDialog.cpp b/interface/src/ui/PreferencesDialog.cpp index 318db54f2c..56dbf8470c 100644 --- a/interface/src/ui/PreferencesDialog.cpp +++ b/interface/src/ui/PreferencesDialog.cpp @@ -6,14 +6,27 @@ // // -#include "PreferencesDialog.h" #include "Application.h" #include "Menu.h" +#include "ModelBrowser.h" +#include "PreferencesDialog.h" + +const int SCROLL_PANEL_BOTTOM_MARGIN = 30; +const int OK_BUTTON_RIGHT_MARGIN = 30; +const int BUTTONS_TOP_MARGIN = 24; PreferencesDialog::PreferencesDialog(QWidget* parent, Qt::WindowFlags flags) : FramelessDialog(parent, flags) { + ui.setupUi(this); - setStyleSheet("styles/preferences.qss"); + setStyleSheetFile("styles/preferences.qss"); loadPreferences(); + connect(ui.closeButton, &QPushButton::clicked, this, &QDialog::close); + connect(ui.buttonBrowseHead, &QPushButton::clicked, this, &PreferencesDialog::openHeadModelBrowser); + connect(ui.buttonBrowseBody, &QPushButton::clicked, this, &PreferencesDialog::openBodyModelBrowser); +} + +PreferencesDialog::~PreferencesDialog() { + deleteLater(); } void PreferencesDialog::accept() { @@ -21,6 +34,39 @@ void PreferencesDialog::accept() { close(); } +void PreferencesDialog::openHeadModelBrowser() { + ModelBrowser modelBrowser(Head); + modelBrowser.browse(); + connect(&modelBrowser, &ModelBrowser::selected, ui.faceURLEdit, &QLineEdit::setText); +} + +void PreferencesDialog::openBodyModelBrowser() { + ModelBrowser modelBrowser(Skeleton); + modelBrowser.browse(); + connect(&modelBrowser, &ModelBrowser::selected, ui.skeletonURLEdit, &QLineEdit::setText); +} + +void PreferencesDialog::resizeEvent(QResizeEvent *resizeEvent) { + + // keep buttons panel at the bottom + ui.buttonsPanel->setGeometry(0, size().height() - ui.buttonsPanel->height(), size().width(), ui.buttonsPanel->height()); + + // set width and height of srcollarea to match bottom panel and width + ui.scrollArea->setGeometry(ui.scrollArea->geometry().x(), ui.scrollArea->geometry().y(), + size().width(), + size().height() - ui.buttonsPanel->height() - + SCROLL_PANEL_BOTTOM_MARGIN - ui.scrollArea->geometry().y()); + + // move Save button to left position + ui.defaultButton->move(size().width() - OK_BUTTON_RIGHT_MARGIN - ui.defaultButton->size().width(), BUTTONS_TOP_MARGIN); + + // move Save button to left position + ui.cancelButton->move(ui.defaultButton->pos().x() - ui.cancelButton->size().width(), BUTTONS_TOP_MARGIN); + + // move close button + ui.closeButton->move(size().width() - OK_BUTTON_RIGHT_MARGIN - ui.closeButton->size().width(), ui.closeButton->pos().y()); +} + void PreferencesDialog::loadPreferences() { MyAvatar* myAvatar = Application::getInstance()->getAvatar(); diff --git a/interface/src/ui/PreferencesDialog.h b/interface/src/ui/PreferencesDialog.h index d5cb41c7df..f1f37c66cd 100644 --- a/interface/src/ui/PreferencesDialog.h +++ b/interface/src/ui/PreferencesDialog.h @@ -19,16 +19,22 @@ class PreferencesDialog : public FramelessDialog { public: PreferencesDialog(QWidget* parent = 0, Qt::WindowFlags flags = 0); + ~PreferencesDialog(); + +protected: + void resizeEvent(QResizeEvent* resizeEvent); private: - Ui_PreferencesDialog ui; void loadPreferences(); void savePreferences(); - + void openHeadModelBrowser(); + void openBodyModelBrowser(); + + Ui_PreferencesDialog ui; QString _faceURLString; QString _skeletonURLString; QString _displayNameString; - + private slots: void accept(); diff --git a/interface/ui/preferencesDialog.ui b/interface/ui/preferencesDialog.ui index 0099838177..0f33e2a0b0 100644 --- a/interface/ui/preferencesDialog.ui +++ b/interface/ui/preferencesDialog.ui @@ -3,14 +3,14 @@ PreferencesDialog - Qt::ApplicationModal + Qt::NonModal 0 0 - 640 - 752 + 610 + 499 @@ -25,15 +25,27 @@ 0 - + 0 - 720 - 616 - 80 + 400 + 611 + 97 + + + 0 + 0 + + + + + 0 + 97 + + Arial @@ -42,1136 +54,1245 @@ background-color: #0e7077 - + - 0 - 20 - 591 - 41 + 310 + 24 + 91 + 50 + + + 0 + 0 + + + + + 0 + 50 + + Arial + 18 + 50 + false - - - 0 - - - - - - Arial - - - - Qt::Horizontal - - - - 0 - 0 - - - - - - - - - Arial - - - - Cancel - - - - - - - - Arial - - - - background-color: #fff; + + + + + Cancel + + + + + + 400 + 24 + 188 + 50 + + + + + 0 + 0 + + + + + 188 + 49 + + + + + Arial + 18 + + + + background-color: #fff; color: #0e7077 - - - Save all changes - - - true - - - - + + + Save all changes + + + true + 0 - 0 - 621 - 1000 + 30 + 615 + 351 - - - 0 - 0 - + + QFrame::NoFrame + + + QFrame::Plain + + + 0 true - + 0 0 - 619 - 998 + 615 + 833 - - - - 0 - 50 - 621 - 783 - + + + 0 - - - Arial - + + 30 - - - 0 - - - 30 - - - 0 - - - 30 - - - - - - 0 - 0 - - - - - Arial - 24 - - - - color: #0e7077 - - - Avatar - - - 25 - - - - - - - - - - - 0 - 0 - - - - - 0 - 30 - - - - - Arial - 16 - - - - color: #0e7077 - - - <html><head/><body><p>Avatar display name <span style=" color:#909090;">(optional)</span></p></body></html> - - - Qt::AlignBottom|Qt::AlignLeading|Qt::AlignLeft - - - displayNameEdit - - - - - - - - 0 - 0 - - - - - 280 - 0 - - - - - Arial - - - - Qt::LeftToRight - - - - - - Not showing a name - - - - - - - - 0 - 0 - - - - - 0 - 30 - - - - - Arial - 16 - - - - color: #0e7077 - - - Head - - - Qt::AlignBottom|Qt::AlignLeading|Qt::AlignLeft - - - 0 - - - faceURLEdit - - - - - - - - 0 - 0 - - - - - Arial - - - - - - - - - 0 - 0 - - - - - 0 - 30 - - - - - Arial - 16 - - - - color: #0e7077 - - - Body - - - Qt::AlignBottom|Qt::AlignLeading|Qt::AlignLeft - - - skeletonURLEdit - - - - - - - - 0 - 0 - - - - - Arial - - - - - - - - Qt::Vertical - - - - 20 - 40 - - - - - - - - - 0 - 0 - - - - - 0 - 0 - - - - - Arial - 24 - - - - color: #0e7077 - - - Advanced Tuning - - - Qt::AlignLeading|Qt::AlignLeft|Qt::AlignVCenter - - - 25 - - - - - - - - 0 - 0 - - - - - Arial - - - - color: rgb(51, 51, 51) - - - It's not recomended that you play with these settings unless you've looked into exactly what they do. - - - false - - - true - - - - - - - - 0 - 0 - - - - - 0 - 40 - - - - - Arial - 20 - 50 - false - - - - color: #0e7077 - - - <p>Avatar</p> - - - Qt::AlignBottom|Qt::AlignLeading|Qt::AlignLeft - - - - - - - 0 - - - 10 - - - 10 - - - - - - 0 - 0 - - - - - 0 - 0 - - - - - 16777215 - 25 - - - - - Arial - - - - color: rgb(51, 51, 51) - - - Lean scale (applies to Faceshift users) - - - leanScaleSpin - - - - - - - - Arial - - - - Qt::Horizontal - - - QSizePolicy::Expanding - - - - 40 - 10 - - - - - - - - - 0 - 0 - - - - - 95 - 36 - - - - - 70 - 16777215 - - - - - Arial - - - - - - - - - - 0 - - - 10 - - - 0 - - - 10 - - - - - - Arial - - - - color: rgb(51, 51, 51) - - - Vertical field of view - - - fieldOfViewSpin - - - - - - - - Arial - - - - Qt::Horizontal - - - - 40 - 20 - - - - - - - - - 0 - 0 - - - - - 95 - 36 - - - - - 70 - 16777215 - - - - - Arial - - - - 1 - - - 180 - - - - - - - - - 0 - - - 10 - - - 0 - - - 10 - - - - - - Arial - - - - color: rgb(51, 51, 51) - - - Avatar scale (default is 1.0) - - - avatarScaleSpin - - - - - - - - Arial - - - - Qt::Horizontal - - - - 40 - 20 - - - - - - - - - 0 - 0 - - - - - 95 - 36 - - - - - 70 - 16777215 - - - - - Arial - - - - - - - - - - 0 - - - 10 - - - 0 - - - 10 - - - - - - Arial - - - - color: rgb(51, 51, 51) - - - Pupil dillation - - - - - - - - Arial - - - - Qt::Horizontal - - - - 40 - 20 - - - - - - - - - 0 - 0 - - - - - 125 - 0 - - - - - Arial - - - - Qt::Horizontal - - - - - - - - - 0 - - - 10 - - - 0 - - - 10 - - - - - - Arial - - - - color: rgb(51, 51, 51) - - - Audio Jitter Buffer Samples (0 for automatic) - - - - - - - - Arial - - - - Qt::Horizontal - - - - 40 - 20 - - - - - - - - - 0 - 0 - - - - - 95 - 36 - - - - - 70 - 16777215 - - - - - Arial - - - - -10000 - - - 10000 - - - 1 - - - - - - - - - 0 - - - 10 - - - 0 - - - 10 - - - - - - Arial - - - - color: rgb(51, 51, 51) - - - Faceshift eye detection - - - avatarScaleSpin - - - - - - - - Arial - - - - Qt::Horizontal - - - - 40 - 20 - - - - - - - - - 0 - 0 - - - - - 125 - 0 - - - - - Arial - - - - Qt::Horizontal - - - - - - - - - - 0 - 0 - - - - - 0 - 40 - - - - - Arial - 20 - 50 - false - - - - color: #0e7077 - - - <html><head/><body><p>Voxels</p></body></html> - - - - - - - 0 - - - 10 - - - 0 - - - 10 - - - - - - Arial - - - - color: rgb(51, 51, 51) - - - Maximum voxels - - - leanScaleSpin - - - - - - - - Arial - - - - Qt::Horizontal - - - - 40 - 20 - - - - - - - - - 0 - 0 - - - - - 125 - 36 - - - - - Arial - - - - 5000000 - - - 50000 - - - - - - - - - 0 - - - 10 - - - 0 - - - 10 - - - - - - Arial - - - - Max voxels sent each second - - - leanScaleSpin - - - - - - - - Arial - - - - Qt::Horizontal - - - - 40 - 20 - - - - - - - - - 0 - 0 - - - - - 95 - 36 - - - - - 70 - 16777215 - - - - - Arial - - - - 60 - - - 6000 - - - 10 - - - - - - - - - - - 540 - 40 - 114 - 32 - + + 0 - - PushButton + + 30 - + + 30 + + + + + + 0 + 0 + + + + + Arial + 24 + + + + color: #0e7077 + + + Avatar + + + 25 + + + + + + + + + + + 0 + 0 + + + + + 0 + 30 + + + + + Arial + 16 + + + + color: #0e7077 + + + <html><head/><body><p>Avatar display name <span style=" color:#909090;">(optional)</span></p></body></html> + + + Qt::AlignBottom|Qt::AlignLeading|Qt::AlignLeft + + + displayNameEdit + + + + + + + + 0 + 0 + + + + + 280 + 20 + + + + + Arial + + + + Qt::LeftToRight + + + + + + Not showing a name + + + + + + + + 0 + 0 + + + + + 0 + 30 + + + + + Arial + 16 + + + + color: #0e7077 + + + Head + + + Qt::AlignBottom|Qt::AlignLeading|Qt::AlignLeft + + + 0 + + + faceURLEdit + + + + + + + + + + 0 + 0 + + + + + Arial + + + + + + + + Qt::Horizontal + + + QSizePolicy::Fixed + + + + 20 + 20 + + + + + + + + + 0 + 0 + + + + + 30 + 30 + + + + background-color: #fff; +border-radius: 0; +padding: 0; + + + + + + + :/styles/search.svg + + + + + + + + + + + 0 + 0 + + + + + 0 + 30 + + + + + Arial + 16 + + + + color: #0e7077 + + + Body + + + Qt::AlignBottom|Qt::AlignLeading|Qt::AlignLeft + + + skeletonURLEdit + + + + + + + + + + 0 + 0 + + + + + Arial + + + + + + + + Qt::Horizontal + + + QSizePolicy::Fixed + + + + 20 + 20 + + + + + + + + + 0 + 0 + + + + + 30 + 30 + + + + background-color: #fff; +border-radius: 0; +padding: 0; + + + + + + + :/styles/search.svg + + + + + + + + + + Qt::Vertical + + + + 0 + 35 + + + + + + + + + 0 + 0 + + + + + 0 + 0 + + + + + Arial + 24 + + + + color: #0e7077 + + + Advanced Tuning + + + Qt::AlignLeading|Qt::AlignLeft|Qt::AlignVCenter + + + 25 + + + + + + + + 0 + 0 + + + + + Arial + 16 + + + + color: rgb(51, 51, 51) + + + It's not recomended that you play with these settings unless you've looked into exactly what they do. + + + false + + + true + + + + + + + + 0 + 0 + + + + + 0 + 40 + + + + + Arial + 20 + 50 + false + + + + color: #0e7077 + + + <p>Avatar</p> + + + Qt::AlignBottom|Qt::AlignLeading|Qt::AlignLeft + + + + + + + 0 + + + 10 + + + 0 + + + 10 + + + + + + Arial + + + + color: rgb(51, 51, 51) + + + Vertical field of view + + + fieldOfViewSpin + + + + + + + + Arial + + + + Qt::Horizontal + + + + 40 + 20 + + + + + + + + + 0 + 0 + + + + + 95 + 36 + + + + + 70 + 16777215 + + + + + Arial + + + + 1 + + + 180 + + + + + + + + + 0 + + + 10 + + + 10 + + + + + + 0 + 0 + + + + + 0 + 0 + + + + + 16777215 + 25 + + + + + Arial + + + + color: rgb(51, 51, 51) + + + Lean scale (applies to Faceshift users) + + + leanScaleSpin + + + + + + + + Arial + + + + Qt::Horizontal + + + QSizePolicy::Expanding + + + + 40 + 10 + + + + + + + + + 0 + 0 + + + + + 95 + 36 + + + + + 70 + 16777215 + + + + + Arial + + + + + + + + + + 0 + + + 10 + + + 0 + + + 10 + + + + + + Arial + + + + color: rgb(51, 51, 51) + + + Avatar scale (default is 1.0) + + + avatarScaleSpin + + + + + + + + Arial + + + + Qt::Horizontal + + + + 40 + 20 + + + + + + + + + 0 + 0 + + + + + 95 + 36 + + + + + 70 + 16777215 + + + + + Arial + + + + + + + + + + 0 + + + 10 + + + 0 + + + 10 + + + + + + Arial + + + + color: rgb(51, 51, 51) + + + Pupil dillation + + + pupilDilationSlider + + + + + + + + Arial + + + + Qt::Horizontal + + + + 40 + 20 + + + + + + + + + 0 + 0 + + + + + 125 + 0 + + + + + Arial + + + + Qt::Horizontal + + + + + + + + + 0 + + + 10 + + + 0 + + + 10 + + + + + + Arial + + + + color: rgb(51, 51, 51) + + + Audio Jitter Buffer Samples (0 for automatic) + + + audioJitterSpin + + + + + + + + Arial + + + + Qt::Horizontal + + + + 40 + 20 + + + + + + + + + 0 + 0 + + + + + 95 + 36 + + + + + 70 + 16777215 + + + + + Arial + + + + -10000 + + + 10000 + + + 1 + + + + + + + + + 0 + + + 10 + + + 0 + + + 10 + + + + + + Arial + + + + color: rgb(51, 51, 51) + + + Faceshift eye detection + + + faceshiftEyeDeflectionSider + + + + + + + + Arial + + + + Qt::Horizontal + + + + 40 + 20 + + + + + + + + + 0 + 0 + + + + + 125 + 0 + + + + + Arial + + + + Qt::Horizontal + + + + + + + + + + 0 + 0 + + + + + 0 + 40 + + + + + Arial + 20 + 50 + false + + + + color: #0e7077 + + + <html><head/><body><p>Voxels</p></body></html> + + + Qt::AlignBottom|Qt::AlignLeading|Qt::AlignLeft + + + + + + + 0 + + + 10 + + + 0 + + + 10 + + + + + + Arial + + + + color: rgb(51, 51, 51) + + + Maximum voxels + + + maxVoxelsSpin + + + + + + + + Arial + + + + Qt::Horizontal + + + + 40 + 20 + + + + + + + + + 0 + 0 + + + + + 125 + 36 + + + + + Arial + + + + 5000000 + + + 50000 + + + + + + + + + 0 + + + 10 + + + 0 + + + 10 + + + + + + Arial + + + + Max voxels sent each second + + + maxVoxelsPPSSpin + + + + + + + + Arial + + + + Qt::Horizontal + + + + 40 + 20 + + + + + + + + + 0 + 0 + + + + + 95 + 36 + + + + + 70 + 16777215 + + + + + Arial + + + + 60 + + + 6000 + + + 10 + + + + + + + + + + 540 + 24 + 31 + 31 + + + + + PreferAntialias + + + + + + @@ -1179,6 +1300,41 @@ color: #0e7077 1 - - + + + + + + cancelButton + clicked() + PreferencesDialog + close() + + + 495 + 749 + + + 528 + 0 + + + + + defaultButton + clicked() + PreferencesDialog + accept() + + + 504 + 749 + + + 20 + 20 + + + + diff --git a/libraries/audio/src/AudioRingBuffer.cpp b/libraries/audio/src/AudioRingBuffer.cpp index 0e92ab4eb5..cf35b6a20f 100644 --- a/libraries/audio/src/AudioRingBuffer.cpp +++ b/libraries/audio/src/AudioRingBuffer.cpp @@ -19,7 +19,8 @@ AudioRingBuffer::AudioRingBuffer(int numFrameSamples) : NodeData(), _sampleCapacity(numFrameSamples * RING_BUFFER_LENGTH_FRAMES), _isStarved(true), - _hasStarted(false) + _hasStarted(false), + _averageLoudness(0) { if (numFrameSamples) { _buffer = new int16_t[_sampleCapacity]; @@ -55,18 +56,22 @@ int AudioRingBuffer::parseData(const QByteArray& packet) { return writeData(packet.data() + numBytesPacketHeader, packet.size() - numBytesPacketHeader); } -float AudioRingBuffer::averageLoudnessForBoundarySamples(int numSamples) { +void AudioRingBuffer::updateAverageLoudnessForBoundarySamples(int numSamples) { // ForBoundarySamples means that we expect the number of samples not to roll of the end of the ring buffer - float averageLoudness = 0; + float nextLoudness = 0; for (int i = 0; i < numSamples; ++i) { - averageLoudness += fabsf(_nextOutput[i]); + nextLoudness += fabsf(_nextOutput[i]); } - averageLoudness /= numSamples; - averageLoudness /= MAX_SAMPLE_VALUE; + nextLoudness /= numSamples; + nextLoudness /= MAX_SAMPLE_VALUE; + + const int TRAILING_AVERAGE_FRAMES = 100; + const float CURRENT_FRAME_RATIO = 1.0f / TRAILING_AVERAGE_FRAMES; + const float PREVIOUS_FRAMES_RATIO = 1 - CURRENT_FRAME_RATIO; - return averageLoudness; + _averageLoudness = (_averageLoudness * PREVIOUS_FRAMES_RATIO) + (CURRENT_FRAME_RATIO * nextLoudness); } qint64 AudioRingBuffer::readSamples(int16_t* destination, qint64 maxSamples) { diff --git a/libraries/audio/src/AudioRingBuffer.h b/libraries/audio/src/AudioRingBuffer.h index 0beb45ca18..efc85ac94b 100644 --- a/libraries/audio/src/AudioRingBuffer.h +++ b/libraries/audio/src/AudioRingBuffer.h @@ -50,7 +50,8 @@ public: const int16_t* getNextOutput() { return _nextOutput; } const int16_t* getBuffer() { return _buffer; } - float averageLoudnessForBoundarySamples(int numSamples); + void updateAverageLoudnessForBoundarySamples(int numSamples); + float getAverageLoudness() const { return _averageLoudness; } qint64 readSamples(int16_t* destination, qint64 maxSamples); qint64 writeSamples(const int16_t* source, qint64 maxSamples); @@ -85,6 +86,8 @@ protected: int16_t* _buffer; bool _isStarved; bool _hasStarted; + + float _averageLoudness; }; #endif /* defined(__interface__AudioRingBuffer__) */ diff --git a/libraries/audio/src/PositionalAudioRingBuffer.cpp b/libraries/audio/src/PositionalAudioRingBuffer.cpp index 66a27647d6..ccbe5d3f23 100644 --- a/libraries/audio/src/PositionalAudioRingBuffer.cpp +++ b/libraries/audio/src/PositionalAudioRingBuffer.cpp @@ -50,6 +50,7 @@ int PositionalAudioRingBuffer::parseData(const QByteArray& packet) { int16_t numSilentSamples; memcpy(&numSilentSamples, packet.data() + readBytes, sizeof(int16_t)); + readBytes += sizeof(int16_t); addSilentFrame(numSilentSamples); diff --git a/libraries/avatars/src/AvatarData.cpp b/libraries/avatars/src/AvatarData.cpp index e5e0e4b3d7..4e57e311eb 100644 --- a/libraries/avatars/src/AvatarData.cpp +++ b/libraries/avatars/src/AvatarData.cpp @@ -88,6 +88,17 @@ QByteArray AvatarData::toByteArray() { // Body scale destinationBuffer += packFloatRatioToTwoByte(destinationBuffer, _targetScale); + // Head rotation (NOTE: This needs to become a quaternion to save two bytes) + destinationBuffer += packFloatAngleToTwoByte(destinationBuffer, _headData->getTweakedYaw()); + destinationBuffer += packFloatAngleToTwoByte(destinationBuffer, _headData->getTweakedPitch()); + destinationBuffer += packFloatAngleToTwoByte(destinationBuffer, _headData->getTweakedRoll()); + + // Head lean X,Z (head lateral and fwd/back motion relative to torso) + memcpy(destinationBuffer, &_headData->_leanSideways, sizeof(_headData->_leanSideways)); + destinationBuffer += sizeof(_headData->_leanSideways); + memcpy(destinationBuffer, &_headData->_leanForward, sizeof(_headData->_leanForward)); + destinationBuffer += sizeof(_headData->_leanForward); + // Lookat Position memcpy(destinationBuffer, &_headData->_lookAtPosition, sizeof(_headData->_lookAtPosition)); destinationBuffer += sizeof(_headData->_lookAtPosition); @@ -191,6 +202,21 @@ int AvatarData::parseDataAtOffset(const QByteArray& packet, int offset) { // Body scale sourceBuffer += unpackFloatRatioFromTwoByte(sourceBuffer, _targetScale); + // Head rotation (NOTE: This needs to become a quaternion to save two bytes) + float headYaw, headPitch, headRoll; + sourceBuffer += unpackFloatAngleFromTwoByte((uint16_t*) sourceBuffer, &headYaw); + sourceBuffer += unpackFloatAngleFromTwoByte((uint16_t*) sourceBuffer, &headPitch); + sourceBuffer += unpackFloatAngleFromTwoByte((uint16_t*) sourceBuffer, &headRoll); + _headData->setYaw(headYaw); + _headData->setPitch(headPitch); + _headData->setRoll(headRoll); + + // Head position relative to pelvis + memcpy(&_headData->_leanSideways, sourceBuffer, sizeof(_headData->_leanSideways)); + sourceBuffer += sizeof(float); + memcpy(&_headData->_leanForward, sourceBuffer, sizeof(_headData->_leanForward)); + sourceBuffer += sizeof(_headData->_leanForward); + // Lookat Position memcpy(&_headData->_lookAtPosition, sourceBuffer, sizeof(_headData->_lookAtPosition)); sourceBuffer += sizeof(_headData->_lookAtPosition); diff --git a/libraries/shared/src/FileDownloader.cpp b/libraries/shared/src/FileDownloader.cpp new file mode 100644 index 0000000000..2b65bbd8df --- /dev/null +++ b/libraries/shared/src/FileDownloader.cpp @@ -0,0 +1,65 @@ +// +// FileDownloader.cpp +// hifi +// +// Created by Clement Brisset on 3/14/14. +// Copyright (c) 2014 HighFidelity, Inc. All rights reserved. +// +// + +#include +#include +#include +#include + +#include "FileDownloader.h" + +FileDownloader::FileDownloader(const QUrl dataURL, QObject* parent) : + QObject(parent), + _done(false) +{ + connect(&_networkAccessManager, SIGNAL(finished(QNetworkReply*)), this, SLOT(processReply(QNetworkReply*))); + + QNetworkRequest request(dataURL); + _networkAccessManager.get(request); +} + +void FileDownloader::processReply(QNetworkReply *reply) { + if (reply->error() == QNetworkReply::NoError) { + _downloadedData = reply->readAll(); + } + + reply->deleteLater(); + _done = true; + emit done(reply->error()); +} + +void FileDownloader::waitForFile(int timeout) { + QTimer timer; + QEventLoop loop; + connect(&timer, SIGNAL(timeout()), &loop, SLOT(quit())); + connect(this, SIGNAL(done(QNetworkReply::NetworkError)), &loop, SLOT(quit())); + + if (!_done) { + if (timeout > 0) { + timer.start(timeout); + } + loop.exec(); + } +} + +QByteArray FileDownloader::download(const QUrl dataURL, int timeout) { + QTimer timer; + QEventLoop loop; + connect(&timer, SIGNAL(timeout()), &loop, SLOT(quit)); + + FileDownloader downloader(dataURL); + connect(&downloader, SIGNAL(done(QNetworkReply::NetworkError)), &loop, SLOT(quit())); + + if (timeout > 0) { + timer.start(timeout); + } + loop.exec(); + + return downloader.getData(); +} \ No newline at end of file diff --git a/libraries/shared/src/FileDownloader.h b/libraries/shared/src/FileDownloader.h new file mode 100644 index 0000000000..593b39b013 --- /dev/null +++ b/libraries/shared/src/FileDownloader.h @@ -0,0 +1,44 @@ +// +// FileDownloader.h +// hifi +// +// Created by Clement Brisset on 3/14/14. +// Copyright (c) 2014 HighFidelity, Inc. All rights reserved. +// +// + +#ifndef __hifi__FileDownloader__ +#define __hifi__FileDownloader__ + +#include +#include +#include + +class FileDownloader : public QObject { + Q_OBJECT + +public: + FileDownloader(const QUrl dataURL, QObject* parent = NULL); + + void waitForFile(int timeout = 0); + + QByteArray getData() const { return _downloadedData; } + bool done() { return _done; } + + static QByteArray download(const QUrl dataURL, int timeout = 0); + +signals: + void done(QNetworkReply::NetworkError error); + +private slots: + void processReply(QNetworkReply* reply); + +private: + QNetworkAccessManager _networkAccessManager; + QByteArray _downloadedData; + + bool _done; +}; + + +#endif /* defined(__hifi__FileDownloader__) */ diff --git a/libraries/shared/src/FstReader.cpp b/libraries/shared/src/FstReader.cpp index d82ddf68a3..a803583598 100644 --- a/libraries/shared/src/FstReader.cpp +++ b/libraries/shared/src/FstReader.cpp @@ -24,6 +24,7 @@ static const QString NAME_FIELD = "name"; static const QString FILENAME_FIELD = "filename"; static const QString TEXDIR_FIELD = "texdir"; static const QString LOD_FIELD = "lod"; +static const QString HEAD_SPECIFIC_FIELD = "bs"; static const QString MODEL_URL = "/api/v1/models"; @@ -32,6 +33,7 @@ static const int MAX_SIZE = 10 * 1024 * 1024; // 10 MB FstReader::FstReader() : _lodCount(-1), _texturesCount(-1), + _isHead(false), _readyToSend(false), _dataMultiPart(new QHttpMultiPart(QHttpMultiPart::FormDataType)) { @@ -81,13 +83,15 @@ bool FstReader::zip() { } // according to what is read, we modify the command - if (line.first() == NAME_FIELD) { + if (line[1] == HEAD_SPECIFIC_FIELD) { + _isHead = true; + } else if (line[1] == NAME_FIELD) { QHttpPart textPart; textPart.setHeader(QNetworkRequest::ContentDispositionHeader, "form-data;" " name=\"model_name\""); textPart.setBody(line[1].toUtf8()); _dataMultiPart->append(textPart); - } else if (line.first() == FILENAME_FIELD) { + } else if (line[1] == FILENAME_FIELD) { QFileInfo fbx(QFileInfo(fst).path() + "/" + line[1]); if (!fbx.exists() || !fbx.isFile()) { // Check existence qDebug() << "[ERROR] FBX file " << fbx.absoluteFilePath() << " doesn't exist."; @@ -101,7 +105,7 @@ bool FstReader::zip() { if (!addPart(_zipDir.path() + "/" + line[1], "fbx")) { return false; } - } else if (line.first() == TEXDIR_FIELD) { // Check existence + } else if (line[1] == TEXDIR_FIELD) { // Check existence QFileInfo texdir(QFileInfo(fst).path() + "/" + line[1]); if (!texdir.exists() || !texdir.isDir()) { qDebug() << "[ERROR] Texture directory " << texdir.absolutePath() << " doesn't exist."; @@ -110,7 +114,7 @@ bool FstReader::zip() { if (!addTextures(texdir)) { // Recursive compress and copy return false; } - } else if (line.first() == LOD_FIELD) { + } else if (line[1] == LOD_FIELD) { QFileInfo lod(QFileInfo(fst).path() + "/" + line[1]); if (!lod.exists() || !lod.isFile()) { // Check existence qDebug() << "[ERROR] FBX file " << lod.absoluteFilePath() << " doesn't exist."; @@ -127,6 +131,17 @@ bool FstReader::zip() { } } + + QHttpPart textPart; + textPart.setHeader(QNetworkRequest::ContentDispositionHeader, "form-data;" + " name=\"model_category\""); + if (_isHead) { + textPart.setBody("head"); + } else { + textPart.setBody("skeleton"); + } + _dataMultiPart->append(textPart); + _readyToSend = true; return true; } diff --git a/libraries/shared/src/FstReader.h b/libraries/shared/src/FstReader.h index aab42bd967..1d9da71641 100644 --- a/libraries/shared/src/FstReader.h +++ b/libraries/shared/src/FstReader.h @@ -27,6 +27,7 @@ private: int _lodCount; int _texturesCount; int _totalSize; + bool _isHead; bool _readyToSend; QHttpMultiPart* _dataMultiPart; diff --git a/libraries/shared/src/PacketHeaders.cpp b/libraries/shared/src/PacketHeaders.cpp index 307453d8bf..c7518708ce 100644 --- a/libraries/shared/src/PacketHeaders.cpp +++ b/libraries/shared/src/PacketHeaders.cpp @@ -45,7 +45,9 @@ int packArithmeticallyCodedValue(int value, char* destination) { PacketVersion versionForPacketType(PacketType type) { switch (type) { case PacketTypeAvatarData: - return 2; + return 3; + case PacketTypeEnvironmentData: + return 1; case PacketTypeParticleData: return 1; case PacketTypeDomainList: diff --git a/libraries/voxels/src/EnvironmentData.cpp b/libraries/voxels/src/EnvironmentData.cpp index 5cee88e127..1c9af55abd 100644 --- a/libraries/voxels/src/EnvironmentData.cpp +++ b/libraries/voxels/src/EnvironmentData.cpp @@ -14,6 +14,7 @@ // GameEngine.cpp EnvironmentData::EnvironmentData(int id) : _id(id), + _flat(true), _gravity(0.0f), _atmosphereCenter(0, -1000, 0), _atmosphereInnerRadius(1000), @@ -25,12 +26,23 @@ EnvironmentData::EnvironmentData(int id) : _sunBrightness(20.0f) { } +glm::vec3 EnvironmentData::getAtmosphereCenter(const glm::vec3& cameraPosition) const { + return _atmosphereCenter + (_flat ? glm::vec3(cameraPosition.x, 0.0f, cameraPosition.z) : glm::vec3()); +} + +glm::vec3 EnvironmentData::getSunLocation(const glm::vec3& cameraPosition) const { + return _sunLocation + (_flat ? glm::vec3(cameraPosition.x, 0.0f, cameraPosition.z) : glm::vec3()); +} + int EnvironmentData::getBroadcastData(unsigned char* destinationBuffer) const { unsigned char* bufferStart = destinationBuffer; memcpy(destinationBuffer, &_id, sizeof(_id)); destinationBuffer += sizeof(_id); + memcpy(destinationBuffer, &_flat, sizeof(_flat)); + destinationBuffer += sizeof(_flat); + memcpy(destinationBuffer, &_gravity, sizeof(_gravity)); destinationBuffer += sizeof(_gravity); @@ -67,6 +79,9 @@ int EnvironmentData::parseData(const unsigned char* sourceBuffer, int numBytes) memcpy(&_id, sourceBuffer, sizeof(_id)); sourceBuffer += sizeof(_id); + memcpy(&_flat, sourceBuffer, sizeof(_flat)); + sourceBuffer += sizeof(_flat); + memcpy(&_gravity, sourceBuffer, sizeof(_gravity)); sourceBuffer += sizeof(_gravity); diff --git a/libraries/voxels/src/EnvironmentData.h b/libraries/voxels/src/EnvironmentData.h index 90cc0763fe..627a661e1c 100644 --- a/libraries/voxels/src/EnvironmentData.h +++ b/libraries/voxels/src/EnvironmentData.h @@ -19,6 +19,9 @@ public: void setID(int id) { _id = id; } int getID() const { return _id; } + void setFlat(bool flat) { _flat = flat; } + bool isFlat() const { return _flat; } + void setGravity(float gravity) { _gravity = gravity; } float getGravity() const { return _gravity; } @@ -42,6 +45,9 @@ public: const glm::vec3& getSunLocation() const { return _sunLocation; } float getSunBrightness() const { return _sunBrightness; } + glm::vec3 getAtmosphereCenter(const glm::vec3& cameraPosition) const; + glm::vec3 getSunLocation(const glm::vec3& cameraPosition) const; + int getBroadcastData(unsigned char* destinationBuffer) const; int parseData(const unsigned char* sourceBuffer, int numBytes); @@ -49,6 +55,8 @@ private: int _id; + bool _flat; + float _gravity; glm::vec3 _atmosphereCenter; From 3eb64f5b2933fd11e341ce986a4b7932cbd53d8b Mon Sep 17 00:00:00 2001 From: stojce Date: Fri, 21 Mar 2014 22:45:15 +0100 Subject: [PATCH 012/120] updated interface_en.ts file --- interface/interface_en.ts | 125 ++++++++++++++++++++++++++++++++++++-- 1 file changed, 121 insertions(+), 4 deletions(-) diff --git a/interface/interface_en.ts b/interface/interface_en.ts index 34e3614716..12d9e48589 100644 --- a/interface/interface_en.ts +++ b/interface/interface_en.ts @@ -113,22 +113,139 @@ Menu - + Open .ini config file - - + + Text files (*.ini) - + Save .ini config file + + PreferencesDialog + + + + Cancel + + + + + + Save all changes + + + + + + Avatar + + + + + + <html><head/><body><p>Avatar display name <span style=" color:#909090;">(optional)</span></p></body></html> + + + + + + Not showing a name + + + + + + Head + + + + + + Body + + + + + + Advanced Tuning + + + + + + It's not recomended that you play with these settings unless you've looked into exactly what they do. + + + + + + <p>Avatar</p> + + + + + + Vertical field of view + + + + + + Lean scale (applies to Faceshift users) + + + + + + Avatar scale (default is 1.0) + + + + + + Pupil dillation + + + + + + Audio Jitter Buffer Samples (0 for automatic) + + + + + + Faceshift eye detection + + + + + + <html><head/><body><p>Voxels</p></body></html> + + + + + + Maximum voxels + + + + + + Max voxels sent each second + + + QObject From 7c36c4a2b73f1c8b33d440d146eef51d840b3555 Mon Sep 17 00:00:00 2001 From: stojce Date: Sun, 23 Mar 2014 13:20:24 +0100 Subject: [PATCH 013/120] Layout fixes --- interface/interface_en.ts | 82 ++++++++++++++-------------- interface/src/ui/FramelessDialog.cpp | 3 - interface/ui/preferencesDialog.ui | 44 ++++++++++++--- 3 files changed, 78 insertions(+), 51 deletions(-) diff --git a/interface/interface_en.ts b/interface/interface_en.ts index 12d9e48589..7dc5a4c41d 100644 --- a/interface/interface_en.ts +++ b/interface/interface_en.ts @@ -14,12 +14,12 @@ - + Open Script - + JavaScript Files (*.js) @@ -132,116 +132,116 @@ PreferencesDialog - - + + Cancel - - + + Save all changes - - + + Avatar - - + + <html><head/><body><p>Avatar display name <span style=" color:#909090;">(optional)</span></p></body></html> - - + + Not showing a name - - + + Head - - + + Body - - + + Advanced Tuning - - + + It's not recomended that you play with these settings unless you've looked into exactly what they do. - - + + <p>Avatar</p> - - + + Vertical field of view - - + + Lean scale (applies to Faceshift users) - - - Avatar scale (default is 1.0) + + + Avatar scale <span style=" color:#909090;">(default is 1.0)</span> - - + + Pupil dillation - - + + Audio Jitter Buffer Samples (0 for automatic) - - + + Faceshift eye detection - - + + <html><head/><body><p>Voxels</p></body></html> - - + + Maximum voxels - - + + Max voxels sent each second diff --git a/interface/src/ui/FramelessDialog.cpp b/interface/src/ui/FramelessDialog.cpp index 1f67e9f4d1..2b9dd42ed7 100644 --- a/interface/src/ui/FramelessDialog.cpp +++ b/interface/src/ui/FramelessDialog.cpp @@ -19,10 +19,7 @@ const int RESIZE_HANDLE_WIDTH = 7; FramelessDialog::FramelessDialog(QWidget *parent, Qt::WindowFlags flags) : QDialog(parent, flags | Qt::FramelessWindowHint), _isResizing(false) { - - setWindowOpacity(0.95); setAttribute(Qt::WA_DeleteOnClose); - installEventFilter(this); } diff --git a/interface/ui/preferencesDialog.ui b/interface/ui/preferencesDialog.ui index 0f33e2a0b0..7692da2943 100644 --- a/interface/ui/preferencesDialog.ui +++ b/interface/ui/preferencesDialog.ui @@ -9,8 +9,8 @@ 0 0 - 610 - 499 + 638 + 652 @@ -25,11 +25,14 @@ 0 + + 0.950000000000000 + 0 - 400 + 560 611 97 @@ -135,7 +138,7 @@ color: #0e7077 0 30 615 - 351 + 491 @@ -527,8 +530,11 @@ padding: 0; 16 + + true + - color: rgb(51, 51, 51) + color: rgb(51, 51, 51); It's not recomended that you play with these settings unless you've looked into exactly what they do. @@ -596,11 +602,14 @@ padding: 0; - color: rgb(51, 51, 51) + Vertical field of view + + 15 + fieldOfViewSpin @@ -701,6 +710,9 @@ padding: 0; Lean scale (applies to Faceshift users) + + 15 + leanScaleSpin @@ -781,7 +793,10 @@ padding: 0; color: rgb(51, 51, 51) - Avatar scale (default is 1.0) + Avatar scale <span style=" color:#909090;">(default is 1.0)</span> + + + 15 avatarScaleSpin @@ -862,6 +877,9 @@ padding: 0; Pupil dillation + + 15 + pupilDilationSlider @@ -938,6 +956,9 @@ padding: 0; Audio Jitter Buffer Samples (0 for automatic) + + 15 + audioJitterSpin @@ -1026,6 +1047,9 @@ padding: 0; Faceshift eye detection + + 15 + faceshiftEyeDeflectionSider @@ -1135,6 +1159,9 @@ padding: 0; Maximum voxels + + 15 + maxVoxelsSpin @@ -1211,6 +1238,9 @@ padding: 0; Max voxels sent each second + + 15 + maxVoxelsPPSSpin From 32502d7b0dbb0ca35981aae7ba574f40ec8ba39e Mon Sep 17 00:00:00 2001 From: stojce Date: Sun, 23 Mar 2014 16:20:29 +0100 Subject: [PATCH 014/120] layout improvements --- interface/interface_en.ts | 62 ++++++++++++-------------- interface/src/Menu.h | 1 + interface/src/ui/PreferencesDialog.cpp | 14 +++--- interface/ui/preferencesDialog.ui | 14 +++--- 4 files changed, 46 insertions(+), 45 deletions(-) diff --git a/interface/interface_en.ts b/interface/interface_en.ts index 7dc5a4c41d..b8534c1779 100644 --- a/interface/interface_en.ts +++ b/interface/interface_en.ts @@ -133,115 +133,111 @@ PreferencesDialog - + Cancel - + Save all changes - + + + Avatar - + <html><head/><body><p>Avatar display name <span style=" color:#909090;">(optional)</span></p></body></html> - + Not showing a name - + Head - + Body - + Advanced Tuning - + It's not recomended that you play with these settings unless you've looked into exactly what they do. - - - <p>Avatar</p> - - - - - + + Vertical field of view - - + + Lean scale (applies to Faceshift users) - - + + Avatar scale <span style=" color:#909090;">(default is 1.0)</span> - - + + Pupil dillation - - + + Audio Jitter Buffer Samples (0 for automatic) - - + + Faceshift eye detection - - + + <html><head/><body><p>Voxels</p></body></html> - - + + Maximum voxels - - + + Max voxels sent each second diff --git a/interface/src/Menu.h b/interface/src/Menu.h index 96d5267b9c..2c459a488a 100644 --- a/interface/src/Menu.h +++ b/interface/src/Menu.h @@ -75,6 +75,7 @@ public: float getAudioJitterBufferSamples() const { return _audioJitterBufferSamples; } void setAudioJitterBufferSamples(float audioJitterBufferSamples) { _audioJitterBufferSamples = audioJitterBufferSamples; } float getFieldOfView() const { return _fieldOfView; } + void setFieldOfView(float fieldOfView) { _fieldOfView = fieldOfView; } float getFaceshiftEyeDeflection() const { return _faceshiftEyeDeflection; } void setFaceshiftEyeDeflection(float faceshiftEyeDeflection) { _faceshiftEyeDeflection = faceshiftEyeDeflection; } BandwidthDialog* getBandwidthDialog() const { return _bandwidthDialog; } diff --git a/interface/src/ui/PreferencesDialog.cpp b/interface/src/ui/PreferencesDialog.cpp index 56dbf8470c..c7f5f19099 100644 --- a/interface/src/ui/PreferencesDialog.cpp +++ b/interface/src/ui/PreferencesDialog.cpp @@ -71,16 +71,16 @@ void PreferencesDialog::loadPreferences() { MyAvatar* myAvatar = Application::getInstance()->getAvatar(); Menu* menuInstance = Menu::getInstance(); - + _displayNameString = myAvatar->getDisplayName(); ui.displayNameEdit->setText(_displayNameString); - + _faceURLString = myAvatar->getHead()->getFaceModel().getURL().toString(); ui.faceURLEdit->setText(_faceURLString); - + _skeletonURLString = myAvatar->getSkeletonModel().getURL().toString(); ui.skeletonURLEdit->setText(_skeletonURLString); - + ui.pupilDilationSlider->setValue(myAvatar->getHead()->getPupilDilation() * ui.pupilDilationSlider->maximum()); @@ -137,10 +137,14 @@ void PreferencesDialog::savePreferences() { Application::getInstance()->resizeGL(Application::getInstance()->getGLWidget()->width(), Application::getInstance()->getGLWidget()->height()); + Menu::getInstance()->setFieldOfView(ui.fieldOfViewSpin->value()); + Menu::getInstance()->setFaceshiftEyeDeflection(ui.faceshiftEyeDeflectionSider->value() / (float)ui.faceshiftEyeDeflectionSider->maximum()); Menu::getInstance()->setMaxVoxelPacketsPerSecond(ui.maxVoxelsPPSSpin->value()); Menu::getInstance()->setAudioJitterBufferSamples(ui.audioJitterSpin->value()); - + + Application::getInstance()->resizeGL(Application::getInstance()->getGLWidget()->width(), + Application::getInstance()->getGLWidget()->height()); } diff --git a/interface/ui/preferencesDialog.ui b/interface/ui/preferencesDialog.ui index 7692da2943..14db1b6d5e 100644 --- a/interface/ui/preferencesDialog.ui +++ b/interface/ui/preferencesDialog.ui @@ -573,7 +573,7 @@ padding: 0; color: #0e7077 - <p>Avatar</p> + Avatar Qt::AlignBottom|Qt::AlignLeading|Qt::AlignLeft @@ -627,8 +627,8 @@ padding: 0; - 40 - 20 + 0 + 0 @@ -649,8 +649,8 @@ padding: 0; - 70 - 16777215 + 95 + 36 @@ -1100,7 +1100,7 @@ padding: 0; - + 0 @@ -1125,7 +1125,7 @@ padding: 0; color: #0e7077 - <html><head/><body><p>Voxels</p></body></html> + Voxels Qt::AlignBottom|Qt::AlignLeading|Qt::AlignLeft From 22a8693b896dfdfba3a2079682539f94f5488bf3 Mon Sep 17 00:00:00 2001 From: stojce Date: Wed, 26 Mar 2014 00:05:11 +0100 Subject: [PATCH 015/120] Overlay behaviour --- interface/interface_en.ts | 129 +++++++++++++++++++++++++-- interface/src/Menu.cpp | 2 +- interface/src/ui/FramelessDialog.cpp | 22 ++++- interface/src/ui/FramelessDialog.h | 3 + 4 files changed, 144 insertions(+), 12 deletions(-) diff --git a/interface/interface_en.ts b/interface/interface_en.ts index 689b45afcf..913ae2c50b 100644 --- a/interface/interface_en.ts +++ b/interface/interface_en.ts @@ -4,22 +4,22 @@ Application - + Export Voxels - + Sparse Voxel Octree Files (*.svo) - + Open Script - + JavaScript Files (*.js) @@ -113,22 +113,135 @@ Menu - + Open .ini config file - - + + Text files (*.ini) - + Save .ini config file + + PreferencesDialog + + + + Cancel + + + + + + Save all changes + + + + + + + + Avatar + + + + + + <html><head/><body><p>Avatar display name <span style=" color:#909090;">(optional)</span></p></body></html> + + + + + + Not showing a name + + + + + + Head + + + + + + Body + + + + + + Advanced Tuning + + + + + + It's not recomended that you play with these settings unless you've looked into exactly what they do. + + + + + + Vertical field of view + + + + + + Lean scale (applies to Faceshift users) + + + + + + Avatar scale <span style=" color:#909090;">(default is 1.0)</span> + + + + + + Pupil dillation + + + + + + Audio Jitter Buffer Samples (0 for automatic) + + + + + + Faceshift eye detection + + + + + + Voxels + + + + + + Maximum voxels + + + + + + Max voxels sent each second + + + QObject diff --git a/interface/src/Menu.cpp b/interface/src/Menu.cpp index 38a1bc8aaa..7373bb8833 100644 --- a/interface/src/Menu.cpp +++ b/interface/src/Menu.cpp @@ -714,7 +714,7 @@ void Menu::loginForCurrentDomain() { void Menu::editPreferences() { if (!_preferencesDialog) { - _preferencesDialog = new PreferencesDialog(Application::getInstance()->getGLWidget()); + _preferencesDialog = new PreferencesDialog(Application::getInstance()->getWindow()); _preferencesDialog->show(); } _preferencesDialog->raise(); diff --git a/interface/src/ui/FramelessDialog.cpp b/interface/src/ui/FramelessDialog.cpp index 2b9dd42ed7..d11fd5ae6b 100644 --- a/interface/src/ui/FramelessDialog.cpp +++ b/interface/src/ui/FramelessDialog.cpp @@ -10,6 +10,7 @@ #include #include #include +#include #include "Application.h" #include "FramelessDialog.h" @@ -17,20 +18,35 @@ const int RESIZE_HANDLE_WIDTH = 7; FramelessDialog::FramelessDialog(QWidget *parent, Qt::WindowFlags flags) : - QDialog(parent, flags | Qt::FramelessWindowHint), + QDialog(parent, flags | Qt::FramelessWindowHint | Qt::WindowStaysOnTopHint), _isResizing(false) { setAttribute(Qt::WA_DeleteOnClose); installEventFilter(this); + + startTimer(20); +} + +void FramelessDialog::timerEvent(QTimerEvent *event) { + move(parentWidget()->pos().x(), parentWidget()->pos().y() + 22); + setFixedHeight(parentWidget()->size().height()); +} + +void FramelessDialog::paintEvent(QPaintEvent* event) { + //move(parentWidget()->pos()); + //resize(size().width(), parentWidget()->size().height()); } void FramelessDialog::showEvent(QShowEvent* event) { QDesktopWidget desktop; // move to upper left - move(desktop.availableGeometry().x(), desktop.availableGeometry().y()); +// move(desktop.availableGeometry().x(), desktop.availableGeometry().y()); + + move(parentWidget()->pos().x(), parentWidget()->pos().y() + 22); // keep full height - resize(size().width(), desktop.availableGeometry().height()); + setFixedHeight(parentWidget()->size().height()); +// resize(size().width(), desktop.availableGeometry().height()); } void FramelessDialog::setStyleSheetFile(const QString& fileName) { diff --git a/interface/src/ui/FramelessDialog.h b/interface/src/ui/FramelessDialog.h index 2bb8d6b85c..3cca9ec4fb 100644 --- a/interface/src/ui/FramelessDialog.h +++ b/interface/src/ui/FramelessDialog.h @@ -14,6 +14,7 @@ #include #include #include +#include class FramelessDialog : public QDialog { Q_OBJECT @@ -28,6 +29,8 @@ protected: virtual void mousePressEvent(QMouseEvent* mouseEvent); virtual void mouseReleaseEvent(QMouseEvent* mouseEvent); virtual void showEvent(QShowEvent* event); + void paintEvent(QPaintEvent* event); + void timerEvent(QTimerEvent *event); private: bool _isResizing; From 8b6db350da404b21a3e4effb6fee6c2126f9eaa6 Mon Sep 17 00:00:00 2001 From: stojce Date: Thu, 27 Mar 2014 21:50:41 +0100 Subject: [PATCH 016/120] Switched to QDockWidget --- interface/interface_en.ts | 76 ++++++++++++++-------------- interface/src/Menu.cpp | 7 +-- interface/src/ui/FramelessDialog.cpp | 58 +++------------------ interface/src/ui/FramelessDialog.h | 12 ++--- interface/ui/preferencesDialog.ui | 5 +- 5 files changed, 55 insertions(+), 103 deletions(-) diff --git a/interface/interface_en.ts b/interface/interface_en.ts index 913ae2c50b..6403e5fdd5 100644 --- a/interface/interface_en.ts +++ b/interface/interface_en.ts @@ -132,112 +132,112 @@ PreferencesDialog - - + + Cancel - - + + Save all changes - - - - + + + + Avatar - - + + <html><head/><body><p>Avatar display name <span style=" color:#909090;">(optional)</span></p></body></html> - - + + Not showing a name - - + + Head - - + + Body - - + + Advanced Tuning - - + + It's not recomended that you play with these settings unless you've looked into exactly what they do. - - + + Vertical field of view - - + + Lean scale (applies to Faceshift users) - - + + Avatar scale <span style=" color:#909090;">(default is 1.0)</span> - - + + Pupil dillation - - + + Audio Jitter Buffer Samples (0 for automatic) - - + + Faceshift eye detection - - + + Voxels - - + + Maximum voxels - - + + Max voxels sent each second diff --git a/interface/src/Menu.cpp b/interface/src/Menu.cpp index 7373bb8833..5c0fd72eee 100644 --- a/interface/src/Menu.cpp +++ b/interface/src/Menu.cpp @@ -714,10 +714,11 @@ void Menu::loginForCurrentDomain() { void Menu::editPreferences() { if (!_preferencesDialog) { - _preferencesDialog = new PreferencesDialog(Application::getInstance()->getWindow()); - _preferencesDialog->show(); + Application::getInstance()->getWindow()->addDockWidget(Qt::LeftDockWidgetArea, _preferencesDialog = new PreferencesDialog()); + } else { + Application::getInstance()->getWindow()->removeDockWidget(_preferencesDialog); + _preferencesDialog->close(); } - _preferencesDialog->raise(); } void Menu::goToDomain(const QString newDomain) { diff --git a/interface/src/ui/FramelessDialog.cpp b/interface/src/ui/FramelessDialog.cpp index d11fd5ae6b..40388b2f5f 100644 --- a/interface/src/ui/FramelessDialog.cpp +++ b/interface/src/ui/FramelessDialog.cpp @@ -15,38 +15,17 @@ #include "Application.h" #include "FramelessDialog.h" -const int RESIZE_HANDLE_WIDTH = 7; - FramelessDialog::FramelessDialog(QWidget *parent, Qt::WindowFlags flags) : - QDialog(parent, flags | Qt::FramelessWindowHint | Qt::WindowStaysOnTopHint), - _isResizing(false) { + QDockWidget(parent, flags) { setAttribute(Qt::WA_DeleteOnClose); - installEventFilter(this); - startTimer(20); -} + // set as floating + setFeatures(QDockWidget::DockWidgetFloatable); -void FramelessDialog::timerEvent(QTimerEvent *event) { - move(parentWidget()->pos().x(), parentWidget()->pos().y() + 22); - setFixedHeight(parentWidget()->size().height()); -} + // remove titlebar + setTitleBarWidget(new QWidget()); -void FramelessDialog::paintEvent(QPaintEvent* event) { - //move(parentWidget()->pos()); - //resize(size().width(), parentWidget()->size().height()); -} - -void FramelessDialog::showEvent(QShowEvent* event) { - QDesktopWidget desktop; - - // move to upper left -// move(desktop.availableGeometry().x(), desktop.availableGeometry().y()); - - move(parentWidget()->pos().x(), parentWidget()->pos().y() + 22); - - // keep full height - setFixedHeight(parentWidget()->size().height()); -// resize(size().width(), desktop.availableGeometry().height()); + setAllowedAreas(Qt::LeftDockWidgetArea); } void FramelessDialog::setStyleSheetFile(const QString& fileName) { @@ -54,29 +33,6 @@ void FramelessDialog::setStyleSheetFile(const QString& fileName) { QFile styleSheet(Application::resourcesPath() + fileName); if (styleSheet.open(QIODevice::ReadOnly) && globalStyleSheet.open(QIODevice::ReadOnly) ) { QDir::setCurrent(Application::resourcesPath()); - QDialog::setStyleSheet(globalStyleSheet.readAll() + styleSheet.readAll()); + setStyleSheet(globalStyleSheet.readAll() + styleSheet.readAll()); } } - -void FramelessDialog::mousePressEvent(QMouseEvent* mouseEvent) { - - if (abs(mouseEvent->pos().x() - size().width()) < RESIZE_HANDLE_WIDTH && mouseEvent->button() == Qt::LeftButton) { - _isResizing = true; - QApplication::setOverrideCursor(Qt::SizeHorCursor); - } -} - -void FramelessDialog::mouseReleaseEvent(QMouseEvent* mouseEvent) { - QApplication::restoreOverrideCursor(); - _isResizing = false; -} - -void FramelessDialog::mouseMoveEvent(QMouseEvent* mouseEvent) { - if (_isResizing) { - resize(mouseEvent->pos().x(), size().height()); - } -} - -FramelessDialog::~FramelessDialog() { - -} diff --git a/interface/src/ui/FramelessDialog.h b/interface/src/ui/FramelessDialog.h index 3cca9ec4fb..5c55f3de25 100644 --- a/interface/src/ui/FramelessDialog.h +++ b/interface/src/ui/FramelessDialog.h @@ -9,29 +9,27 @@ #ifndef __hifi__FramelessDialog__ #define __hifi__FramelessDialog__ -#include +#include #include #include #include #include #include -class FramelessDialog : public QDialog { +class FramelessDialog : public QDockWidget { Q_OBJECT public: FramelessDialog(QWidget* parent = 0, Qt::WindowFlags flags = 0); - virtual ~FramelessDialog(); void setStyleSheetFile(const QString& fileName); protected: + /* virtual void mouseMoveEvent(QMouseEvent* mouseEvent); virtual void mousePressEvent(QMouseEvent* mouseEvent); virtual void mouseReleaseEvent(QMouseEvent* mouseEvent); - virtual void showEvent(QShowEvent* event); - void paintEvent(QPaintEvent* event); - void timerEvent(QTimerEvent *event); - + */ + private: bool _isResizing; diff --git a/interface/ui/preferencesDialog.ui b/interface/ui/preferencesDialog.ui index 14db1b6d5e..f28bcde60c 100644 --- a/interface/ui/preferencesDialog.ui +++ b/interface/ui/preferencesDialog.ui @@ -2,9 +2,6 @@ PreferencesDialog - - Qt::NonModal - 0 @@ -251,7 +248,7 @@ color: #0e7077 280 - 20 + 0 From 252326726980ec2bb3ce601ad86321a4944ced26 Mon Sep 17 00:00:00 2001 From: stojce Date: Thu, 27 Mar 2014 22:02:45 +0100 Subject: [PATCH 017/120] i18n file updates --- interface/interface_en.ts | 121 ++++++++++++++++++++++++++++++++++++-- 1 file changed, 117 insertions(+), 4 deletions(-) diff --git a/interface/interface_en.ts b/interface/interface_en.ts index da8827d89d..48b395339e 100644 --- a/interface/interface_en.ts +++ b/interface/interface_en.ts @@ -113,22 +113,135 @@ Menu - + Open .ini config file - - + + Text files (*.ini) - + Save .ini config file + + PreferencesDialog + + + + Cancel + + + + + + Save all changes + + + + + + + + Avatar + + + + + + <html><head/><body><p>Avatar display name <span style=" color:#909090;">(optional)</span></p></body></html> + + + + + + Not showing a name + + + + + + Head + + + + + + Body + + + + + + Advanced Tuning + + + + + + It's not recomended that you play with these settings unless you've looked into exactly what they do. + + + + + + Vertical field of view + + + + + + Lean scale (applies to Faceshift users) + + + + + + Avatar scale <span style=" color:#909090;">(default is 1.0)</span> + + + + + + Pupil dillation + + + + + + Audio Jitter Buffer Samples (0 for automatic) + + + + + + Faceshift eye detection + + + + + + Voxels + + + + + + Maximum voxels + + + + + + Max voxels sent each second + + + QObject From d2800ccd559e9c03ed4fbf9d83a00b70c3174333 Mon Sep 17 00:00:00 2001 From: Jeroen Baert Date: Thu, 3 Apr 2014 11:52:13 +0100 Subject: [PATCH 018/120] For some GLEW distributions, it's just lib --- cmake/modules/FindGLEW.cmake | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cmake/modules/FindGLEW.cmake b/cmake/modules/FindGLEW.cmake index 684acca762..dbb366390a 100644 --- a/cmake/modules/FindGLEW.cmake +++ b/cmake/modules/FindGLEW.cmake @@ -20,7 +20,7 @@ else () find_path(GLEW_INCLUDE_DIRS GL/glew.h PATH_SUFFIXES include HINTS ${WIN_GLEW_SEARCH_DIRS}) - find_library(GLEW_LIBRARY glew32s PATH_SUFFIXES "lib/Release/Win32" HINTS ${WIN_GLEW_SEARCH_DIRS}) + find_library(GLEW_LIBRARY glew32s PATH_SUFFIXES "lib/Release/Win32" "lib" HINTS ${WIN_GLEW_SEARCH_DIRS}) endif () include(FindPackageHandleStandardArgs) From ba5a092ad7287baf2033caeab9042b01fd6ced24 Mon Sep 17 00:00:00 2001 From: stojce Date: Sun, 6 Apr 2014 15:30:30 +0200 Subject: [PATCH 019/120] Frameless dialog position/size fixes Fixed frameless dialog size and position on main window resize and move --- interface/src/Menu.cpp | 4 +- interface/src/ui/FramelessDialog.cpp | 93 ++++++++++++++++++++++++---- interface/src/ui/FramelessDialog.h | 12 ++-- 3 files changed, 90 insertions(+), 19 deletions(-) diff --git a/interface/src/Menu.cpp b/interface/src/Menu.cpp index 859b3250be..9615238b36 100644 --- a/interface/src/Menu.cpp +++ b/interface/src/Menu.cpp @@ -717,9 +717,9 @@ void Menu::loginForCurrentDomain() { void Menu::editPreferences() { if (!_preferencesDialog) { - Application::getInstance()->getWindow()->addDockWidget(Qt::LeftDockWidgetArea, _preferencesDialog = new PreferencesDialog()); + _preferencesDialog = new PreferencesDialog(Application::getInstance()->getWindow()); + _preferencesDialog->show(); } else { - Application::getInstance()->getWindow()->removeDockWidget(_preferencesDialog); _preferencesDialog->close(); } } diff --git a/interface/src/ui/FramelessDialog.cpp b/interface/src/ui/FramelessDialog.cpp index 40388b2f5f..14f7e57f3b 100644 --- a/interface/src/ui/FramelessDialog.cpp +++ b/interface/src/ui/FramelessDialog.cpp @@ -6,26 +6,65 @@ // // -#include -#include -#include -#include -#include - #include "Application.h" #include "FramelessDialog.h" +const int RESIZE_HANDLE_WIDTH = 7; + FramelessDialog::FramelessDialog(QWidget *parent, Qt::WindowFlags flags) : - QDockWidget(parent, flags) { +QDialog(parent, flags | Qt::FramelessWindowHint | Qt::WindowStaysOnTopHint) { setAttribute(Qt::WA_DeleteOnClose); - // set as floating - setFeatures(QDockWidget::DockWidgetFloatable); + // handle rezize and move events + parentWidget()->installEventFilter(this); - // remove titlebar - setTitleBarWidget(new QWidget()); + // handle minimize, restore and focus events + Application::getInstance()->installEventFilter(this); +} - setAllowedAreas(Qt::LeftDockWidgetArea); +bool FramelessDialog::eventFilter(QObject* sender, QEvent* event) { + switch (event->type()) { + case QEvent::Move: + + if (sender == parentWidget()) { + // move to upper left corner on app move + move(parentWidget()->geometry().topLeft()); + } + break; + + case QEvent::Resize: + if (sender == parentWidget()) { + // keep full app height on resizing the app + setFixedHeight(parentWidget()->size().height()); + } + break; + + case QEvent::WindowStateChange: + if (parentWidget()->isMinimized()) { + setHidden(true); + } else { + setHidden(false); + } + break; + + case QEvent::ApplicationDeactivate: + // hide on minimize and focus lost + setHidden(true); + break; + + case QEvent::ApplicationActivate: + setHidden(false); + break; + + default: + break; + } + + return false; +} + +FramelessDialog::~FramelessDialog() { + deleteLater(); } void FramelessDialog::setStyleSheetFile(const QString& fileName) { @@ -36,3 +75,33 @@ void FramelessDialog::setStyleSheetFile(const QString& fileName) { setStyleSheet(globalStyleSheet.readAll() + styleSheet.readAll()); } } + +void FramelessDialog::showEvent(QShowEvent* event) { + // move to upper left corner + move(parentWidget()->geometry().topLeft()); + + // keep full app height + setFixedHeight(parentWidget()->size().height()); + + // resize parrent if width is smaller than this dialog + if (parentWidget()->size().width() < size().width()) { + parentWidget()->resize(size().width(), parentWidget()->size().height()); + } +} +void FramelessDialog::mousePressEvent(QMouseEvent* mouseEvent) { + if (abs(mouseEvent->pos().x() - size().width()) < RESIZE_HANDLE_WIDTH && mouseEvent->button() == Qt::LeftButton) { + _isResizing = true; + QApplication::setOverrideCursor(Qt::SizeHorCursor); + } +} + +void FramelessDialog::mouseReleaseEvent(QMouseEvent* mouseEvent) { + QApplication::restoreOverrideCursor(); + _isResizing = false; +} + +void FramelessDialog::mouseMoveEvent(QMouseEvent* mouseEvent) { + if (_isResizing) { + resize(mouseEvent->pos().x(), size().height()); + } +} diff --git a/interface/src/ui/FramelessDialog.h b/interface/src/ui/FramelessDialog.h index 5c55f3de25..f13219a688 100644 --- a/interface/src/ui/FramelessDialog.h +++ b/interface/src/ui/FramelessDialog.h @@ -9,27 +9,29 @@ #ifndef __hifi__FramelessDialog__ #define __hifi__FramelessDialog__ -#include +#include #include #include #include #include #include -class FramelessDialog : public QDockWidget { +class FramelessDialog : public QDialog { Q_OBJECT public: FramelessDialog(QWidget* parent = 0, Qt::WindowFlags flags = 0); + ~FramelessDialog(); void setStyleSheetFile(const QString& fileName); protected: - /* virtual void mouseMoveEvent(QMouseEvent* mouseEvent); virtual void mousePressEvent(QMouseEvent* mouseEvent); virtual void mouseReleaseEvent(QMouseEvent* mouseEvent); - */ - + virtual void showEvent(QShowEvent* event); + + bool eventFilter(QObject* sender, QEvent* event); + private: bool _isResizing; From dd5a19874012c5c420aefa22217fcbb40ef36bfc Mon Sep 17 00:00:00 2001 From: stojce Date: Sun, 6 Apr 2014 16:13:15 +0200 Subject: [PATCH 020/120] Models browser fixes --- interface/src/ui/FramelessDialog.h | 5 ----- interface/src/ui/ModelsBrowser.cpp | 2 +- interface/src/ui/PreferencesDialog.cpp | 17 +++++++++++++++-- interface/src/ui/PreferencesDialog.h | 2 ++ 4 files changed, 18 insertions(+), 8 deletions(-) diff --git a/interface/src/ui/FramelessDialog.h b/interface/src/ui/FramelessDialog.h index f13219a688..aa83960b8b 100644 --- a/interface/src/ui/FramelessDialog.h +++ b/interface/src/ui/FramelessDialog.h @@ -10,11 +10,6 @@ #define __hifi__FramelessDialog__ #include -#include -#include -#include -#include -#include class FramelessDialog : public QDialog { Q_OBJECT diff --git a/interface/src/ui/ModelsBrowser.cpp b/interface/src/ui/ModelsBrowser.cpp index 616aba3881..52c10a51d7 100644 --- a/interface/src/ui/ModelsBrowser.cpp +++ b/interface/src/ui/ModelsBrowser.cpp @@ -62,7 +62,7 @@ static const QString propertiesIds[MODEL_METADATA_COUNT] = { }; ModelsBrowser::ModelsBrowser(ModelType modelsType, QWidget* parent) : - QWidget(parent), + QWidget(parent, Qt::WindowStaysOnTopHint), _handler(new ModelHandler(modelsType)) { connect(_handler, SIGNAL(doneDownloading()), SLOT(resizeView())); diff --git a/interface/src/ui/PreferencesDialog.cpp b/interface/src/ui/PreferencesDialog.cpp index 3aa439558a..96ffe662c7 100644 --- a/interface/src/ui/PreferencesDialog.cpp +++ b/interface/src/ui/PreferencesDialog.cpp @@ -21,6 +21,7 @@ PreferencesDialog::PreferencesDialog(QWidget* parent, Qt::WindowFlags flags) : F setStyleSheetFile("styles/preferences.qss"); loadPreferences(); connect(ui.closeButton, &QPushButton::clicked, this, &QDialog::close); + connect(ui.buttonBrowseHead, &QPushButton::clicked, this, &PreferencesDialog::openHeadModelBrowser); connect(ui.buttonBrowseBody, &QPushButton::clicked, this, &PreferencesDialog::openBodyModelBrowser); } @@ -34,16 +35,28 @@ void PreferencesDialog::accept() { close(); } +void PreferencesDialog::setHeadUrl(QString modelUrl) { + ui.faceURLEdit->setText(modelUrl); + setWindowFlags(windowFlags() | Qt::WindowStaysOnTopHint); +} + +void PreferencesDialog::setSkeletonUrl(QString modelUrl) { + ui.skeletonURLEdit->setText(modelUrl); + setWindowFlags(windowFlags() | Qt::WindowStaysOnTopHint); +} + void PreferencesDialog::openHeadModelBrowser() { + setWindowFlags(windowFlags() & ~Qt::WindowStaysOnTopHint); ModelsBrowser modelBrowser(Head); + connect(&modelBrowser, &ModelsBrowser::selected, this, &PreferencesDialog::setHeadUrl); modelBrowser.browse(); - connect(&modelBrowser, &ModelsBrowser::selected, ui.faceURLEdit, &QLineEdit::setText); } void PreferencesDialog::openBodyModelBrowser() { + setWindowFlags(windowFlags() & ~Qt::WindowStaysOnTopHint); ModelsBrowser modelBrowser(Skeleton); + connect(&modelBrowser, &ModelsBrowser::selected, this, &PreferencesDialog::setSkeletonUrl); modelBrowser.browse(); - connect(&modelBrowser, &ModelsBrowser::selected, ui.skeletonURLEdit, &QLineEdit::setText); } void PreferencesDialog::resizeEvent(QResizeEvent *resizeEvent) { diff --git a/interface/src/ui/PreferencesDialog.h b/interface/src/ui/PreferencesDialog.h index f1f37c66cd..c7f8f43616 100644 --- a/interface/src/ui/PreferencesDialog.h +++ b/interface/src/ui/PreferencesDialog.h @@ -37,6 +37,8 @@ private: private slots: void accept(); + void setHeadUrl(QString modelUrl); + void setSkeletonUrl(QString modelUrl); }; From 23c6873d999bd7deed28126766e7ffe51b4872bc Mon Sep 17 00:00:00 2001 From: Andrew Meadows Date: Mon, 7 Apr 2014 14:12:29 -0700 Subject: [PATCH 021/120] Add Uuid object to ScriptEngine --- libraries/script-engine/src/ScriptEngine.cpp | 7 ++-- libraries/script-engine/src/ScriptEngine.h | 2 ++ libraries/script-engine/src/ScriptUUID.cpp | 35 ++++++++++++++++++++ libraries/script-engine/src/ScriptUUID.h | 29 ++++++++++++++++ 4 files changed, 71 insertions(+), 2 deletions(-) create mode 100644 libraries/script-engine/src/ScriptUUID.cpp create mode 100644 libraries/script-engine/src/ScriptUUID.h diff --git a/libraries/script-engine/src/ScriptEngine.cpp b/libraries/script-engine/src/ScriptEngine.cpp index 7572638a30..7d3dd650ae 100644 --- a/libraries/script-engine/src/ScriptEngine.cpp +++ b/libraries/script-engine/src/ScriptEngine.cpp @@ -60,7 +60,8 @@ ScriptEngine::ScriptEngine(const QString& scriptContents, const QString& fileNam _scriptName(), _fileNameString(fileNameString), _quatLibrary(), - _vec3Library() + _vec3Library(), + _uuidLibrary() { } @@ -83,7 +84,8 @@ ScriptEngine::ScriptEngine(const QUrl& scriptURL, _scriptName(), _fileNameString(), _quatLibrary(), - _vec3Library() + _vec3Library(), + _uuidLibrary() { QString scriptURLString = scriptURL.toString(); _fileNameString = scriptURLString; @@ -197,6 +199,7 @@ void ScriptEngine::init() { registerGlobalObject("Particles", &_particlesScriptingInterface); registerGlobalObject("Quat", &_quatLibrary); registerGlobalObject("Vec3", &_vec3Library); + registerGlobalObject("Uuid", &_uuidLibrary); registerGlobalObject("Voxels", &_voxelsScriptingInterface); diff --git a/libraries/script-engine/src/ScriptEngine.h b/libraries/script-engine/src/ScriptEngine.h index 964f64a005..2b98549d66 100644 --- a/libraries/script-engine/src/ScriptEngine.h +++ b/libraries/script-engine/src/ScriptEngine.h @@ -22,6 +22,7 @@ #include "AbstractControllerScriptingInterface.h" #include "Quat.h" +#include "ScriptUUID.h" #include "Vec3.h" class ParticlesScriptingInterface; @@ -121,6 +122,7 @@ private: QString _fileNameString; Quat _quatLibrary; Vec3 _vec3Library; + ScriptUUID _uuidLibrary; }; #endif /* defined(__hifi__ScriptEngine__) */ diff --git a/libraries/script-engine/src/ScriptUUID.cpp b/libraries/script-engine/src/ScriptUUID.cpp new file mode 100644 index 0000000000..cea7247e90 --- /dev/null +++ b/libraries/script-engine/src/ScriptUUID.cpp @@ -0,0 +1,35 @@ +// +// ScriptUUID.h +// hifi +// +// Created by Andrew Meadows on 2014.04.07 +// Copyright (c) 2014 High Fidelity, Inc. All rights reserved. +// + +#include + +#include "ScriptUUID.h" + +QUuid ScriptUUID::fromString(const QString& s) { + return QUuid(s); +} + +QString ScriptUUID::toString(const QUuid& id) { + return id.toString(); +} + +QUuid ScriptUUID::generate() { + return QUuid::createUuid(); +} + +bool ScriptUUID::isEqual(const QUuid& idA, const QUuid& idB) { + return idA == idB; +} + +bool ScriptUUID::isNull(const QUuid& id) { + return id.isNull(); +} + +void ScriptUUID::print(const QString& lable, const QUuid& id) { + qDebug() << qPrintable(lable) << id.toString(); +} diff --git a/libraries/script-engine/src/ScriptUUID.h b/libraries/script-engine/src/ScriptUUID.h new file mode 100644 index 0000000000..43e885cf98 --- /dev/null +++ b/libraries/script-engine/src/ScriptUUID.h @@ -0,0 +1,29 @@ +// +// ScriptUUID.h +// hifi +// +// Created by Andrew Meadows on 2014.04.07 +// Copyright (c) 2014 High Fidelity, Inc. All rights reserved. +// + +#ifndef __hifi__ScriptUUID__ +#define __hifi__ScriptUUID__ + +#include + +/// Scriptable interface a UUID helper class object. Used exclusively in the JavaScript API +class ScriptUUID : public QObject { + Q_OBJECT + +public slots: + QUuid fromString(const QString& string); + QString toString(const QUuid& id); + QUuid generate(); + bool isEqual(const QUuid& idA, const QUuid& idB); + bool isNull(const QUuid& id); + void print(const QString& lable, const QUuid& id); +}; + + + +#endif /* defined(__hifi__Vec3__) */ From 79670563d487058daa08df46f1a64c2b3230f512 Mon Sep 17 00:00:00 2001 From: Andrew Meadows Date: Mon, 7 Apr 2014 14:42:49 -0700 Subject: [PATCH 022/120] AvatarData stores its sessionID --- interface/src/avatar/AvatarManager.cpp | 26 ++++++++++++------------- libraries/avatars/src/AvatarData.h | 5 +++++ libraries/avatars/src/AvatarHashMap.cpp | 1 + 3 files changed, 19 insertions(+), 13 deletions(-) diff --git a/interface/src/avatar/AvatarManager.cpp b/interface/src/avatar/AvatarManager.cpp index c2ba28ac7b..5b98d933ff 100644 --- a/interface/src/avatar/AvatarManager.cpp +++ b/interface/src/avatar/AvatarManager.cpp @@ -123,8 +123,8 @@ void AvatarManager::renderAvatarFades(const glm::vec3& cameraPosition, Avatar::R } } -AvatarSharedPointer AvatarManager::matchingOrNewAvatar(const QUuid& nodeUUID, const QWeakPointer& mixerWeakPointer) { - AvatarSharedPointer matchingAvatar = _avatarHash.value(nodeUUID); +AvatarSharedPointer AvatarManager::matchingOrNewAvatar(const QUuid& sessionID, const QWeakPointer& mixerWeakPointer) { + AvatarSharedPointer matchingAvatar = _avatarHash.value(sessionID); if (!matchingAvatar) { // construct a new Avatar for this node @@ -133,9 +133,9 @@ AvatarSharedPointer AvatarManager::matchingOrNewAvatar(const QUuid& nodeUUID, co // insert the new avatar into our hash matchingAvatar = AvatarSharedPointer(avatar); - _avatarHash.insert(nodeUUID, matchingAvatar); + _avatarHash.insert(sessionID, matchingAvatar); - qDebug() << "Adding avatar with UUID" << nodeUUID << "to AvatarManager hash."; + qDebug() << "Adding avatar with sessionID " << sessionID << "to AvatarManager hash."; } return matchingAvatar; @@ -166,10 +166,10 @@ void AvatarManager::processAvatarDataPacket(const QByteArray &datagram, const QW // enumerate over all of the avatars in this packet // only add them if mixerWeakPointer points to something (meaning that mixer is still around) while (bytesRead < datagram.size() && mixerWeakPointer.data()) { - QUuid nodeUUID = QUuid::fromRfc4122(datagram.mid(bytesRead, NUM_BYTES_RFC4122_UUID)); + QUuid sessionID = QUuid::fromRfc4122(datagram.mid(bytesRead, NUM_BYTES_RFC4122_UUID)); bytesRead += NUM_BYTES_RFC4122_UUID; - AvatarSharedPointer matchingAvatarData = matchingOrNewAvatar(nodeUUID, mixerWeakPointer); + AvatarSharedPointer matchingAvatarData = matchingOrNewAvatar(sessionID, mixerWeakPointer); // have the matching (or new) avatar parse the data from the packet bytesRead += matchingAvatarData->parseDataAtOffset(datagram, bytesRead); @@ -188,16 +188,16 @@ void AvatarManager::processAvatarIdentityPacket(const QByteArray &packet, const QDataStream identityStream(packet); identityStream.skipRawData(numBytesForPacketHeader(packet)); - QUuid nodeUUID; + QUuid sessionID; while (!identityStream.atEnd()) { QUrl faceMeshURL, skeletonURL; QString displayName; - identityStream >> nodeUUID >> faceMeshURL >> skeletonURL >> displayName; + identityStream >> sessionID >> faceMeshURL >> skeletonURL >> displayName; // mesh URL for a UUID, find avatar in our list - AvatarSharedPointer matchingAvatar = matchingOrNewAvatar(nodeUUID, mixerWeakPointer); + AvatarSharedPointer matchingAvatar = matchingOrNewAvatar(sessionID, mixerWeakPointer); if (matchingAvatar) { Avatar* avatar = static_cast(matchingAvatar.data()); @@ -218,9 +218,9 @@ void AvatarManager::processAvatarIdentityPacket(const QByteArray &packet, const void AvatarManager::processAvatarBillboardPacket(const QByteArray& packet, const QWeakPointer& mixerWeakPointer) { int headerSize = numBytesForPacketHeader(packet); - QUuid nodeUUID = QUuid::fromRfc4122(QByteArray::fromRawData(packet.constData() + headerSize, NUM_BYTES_RFC4122_UUID)); + QUuid sessionID = QUuid::fromRfc4122(QByteArray::fromRawData(packet.constData() + headerSize, NUM_BYTES_RFC4122_UUID)); - AvatarSharedPointer matchingAvatar = matchingOrNewAvatar(nodeUUID, mixerWeakPointer); + AvatarSharedPointer matchingAvatar = matchingOrNewAvatar(sessionID, mixerWeakPointer); if (matchingAvatar) { Avatar* avatar = static_cast(matchingAvatar.data()); QByteArray billboard = packet.mid(headerSize + NUM_BYTES_RFC4122_UUID); @@ -232,10 +232,10 @@ void AvatarManager::processAvatarBillboardPacket(const QByteArray& packet, const void AvatarManager::processKillAvatar(const QByteArray& datagram) { // read the node id - QUuid nodeUUID = QUuid::fromRfc4122(datagram.mid(numBytesForPacketHeader(datagram), NUM_BYTES_RFC4122_UUID)); + QUuid sessionID = QUuid::fromRfc4122(datagram.mid(numBytesForPacketHeader(datagram), NUM_BYTES_RFC4122_UUID)); // remove the avatar with that UUID from our hash, if it exists - AvatarHash::iterator matchedAvatar = _avatarHash.find(nodeUUID); + AvatarHash::iterator matchedAvatar = _avatarHash.find(sessionID); if (matchedAvatar != _avatarHash.end()) { erase(matchedAvatar); } diff --git a/libraries/avatars/src/AvatarData.h b/libraries/avatars/src/AvatarData.h index 221bbd0428..2637b5a0c3 100755 --- a/libraries/avatars/src/AvatarData.h +++ b/libraries/avatars/src/AvatarData.h @@ -36,6 +36,7 @@ typedef unsigned long long quint64; #include #include #include +#include #include #include @@ -97,6 +98,9 @@ public: AvatarData(); virtual ~AvatarData(); + const QUuid& getSessionID() { return _sessionID; } + void setSessionID(const QUuid& id) { _sessionID = id; } + const glm::vec3& getPosition() const { return _position; } void setPosition(const glm::vec3 position) { _position = position; } @@ -218,6 +222,7 @@ public slots: void sendBillboardPacket(); void setBillboardFromNetworkReply(); protected: + QUuid _sessionID; glm::vec3 _position; glm::vec3 _handPosition; diff --git a/libraries/avatars/src/AvatarHashMap.cpp b/libraries/avatars/src/AvatarHashMap.cpp index 82485691c5..5a56e3d5dc 100644 --- a/libraries/avatars/src/AvatarHashMap.cpp +++ b/libraries/avatars/src/AvatarHashMap.cpp @@ -15,6 +15,7 @@ AvatarHashMap::AvatarHashMap() : void AvatarHashMap::insert(const QUuid& id, AvatarSharedPointer avatar) { _avatarHash.insert(id, avatar); + avatar->setSessionID(id); } AvatarHash::iterator AvatarHashMap::erase(const AvatarHash::iterator& iterator) { From 8ad7c3b239c4b3998069414f8183f995105e00a6 Mon Sep 17 00:00:00 2001 From: Atlante45 Date: Tue, 8 Apr 2014 14:03:27 -0700 Subject: [PATCH 023/120] Moved ModelUploader to interface + New error messages --- .../src/ModelUploader.cpp | 80 +++++++++++-------- .../shared => interface}/src/ModelUploader.h | 4 +- 2 files changed, 48 insertions(+), 36 deletions(-) rename {libraries/shared => interface}/src/ModelUploader.cpp (82%) rename {libraries/shared => interface}/src/ModelUploader.h (94%) diff --git a/libraries/shared/src/ModelUploader.cpp b/interface/src/ModelUploader.cpp similarity index 82% rename from libraries/shared/src/ModelUploader.cpp rename to interface/src/ModelUploader.cpp index 4386704559..1881d84d85 100644 --- a/libraries/shared/src/ModelUploader.cpp +++ b/interface/src/ModelUploader.cpp @@ -18,7 +18,9 @@ #include #include -#include "AccountManager.h" +#include + +#include "renderer/FBXReader.h" #include "ModelUploader.h" @@ -59,11 +61,13 @@ bool ModelUploader::zip() { "Select your .fst file ...", QStandardPaths::writableLocation(QStandardPaths::HomeLocation), "*.fst"); - qDebug() << QStandardPaths::writableLocation(QStandardPaths::HomeLocation); if (filename == "") { // If the user canceled we return. return false; } + QString texDir; + QString fbxFile; + // First we check the FST file QFile fst(filename); @@ -100,22 +104,24 @@ bool ModelUploader::zip() { _dataMultiPart->append(textPart); _url = S3_URL + ((_isHead)? "/models/heads/" : "/models/skeletons/") + line[1].toUtf8() + ".fst"; } else if (line[0] == FILENAME_FIELD) { - QFileInfo fbx(QFileInfo(fst).path() + "/" + line[1]); - if (!fbx.exists() || !fbx.isFile()) { // Check existence + fbxFile = QFileInfo(fst).path() + "/" + line[1]; + QFileInfo fbxInfo(fbxFile); + if (!fbxInfo.exists() || !fbxInfo.isFile()) { // Check existence QMessageBox::warning(NULL, QString("ModelUploader::zip()"), - QString("FBX file %1 could not be found.").arg(fbx.fileName()), + QString("FBX file %1 could not be found.").arg(fbxInfo.fileName()), QMessageBox::Ok); - qDebug() << "[Warning] " << QString("FBX file %1 could not be found.").arg(fbx.fileName()); + qDebug() << "[Warning] " << QString("FBX file %1 could not be found.").arg(fbxInfo.fileName()); return false; } // Compress and copy - if (!addPart(fbx.filePath(), "fbx")) { + if (!addPart(fbxInfo.filePath(), "fbx")) { return false; } } else if (line[0] == TEXDIR_FIELD) { // Check existence - QFileInfo texdir(QFileInfo(fst).path() + "/" + line[1]); - if (!texdir.exists() || !texdir.isDir()) { + texDir = QFileInfo(fst).path() + "/" + line[1]; + QFileInfo texInfo(texDir); + if (!texInfo.exists() || !texInfo.isDir()) { QMessageBox::warning(NULL, QString("ModelUploader::zip()"), QString("Texture directory could not be found."), @@ -123,18 +129,14 @@ bool ModelUploader::zip() { qDebug() << "[Warning] " << QString("Texture directory could not be found."); return false; } - if (!addTextures(texdir)) { // Recursive compress and copy - return false; - } } else if (line[0] == LOD_FIELD) { QFileInfo lod(QFileInfo(fst).path() + "/" + line[1]); if (!lod.exists() || !lod.isFile()) { // Check existence QMessageBox::warning(NULL, QString("ModelUploader::zip()"), - QString("FBX file %1 could not be found.").arg(lod.fileName()), + QString("LOD file %1 could not be found.").arg(lod.fileName()), QMessageBox::Ok); qDebug() << "[Warning] " << QString("FBX file %1 could not be found.").arg(lod.fileName()); - return false; } // Compress and copy if (!addPart(lod.filePath(), QString("lod%1").arg(++_lodCount))) { @@ -143,6 +145,10 @@ bool ModelUploader::zip() { } } + if (!addTextures(texDir, fbxFile)) { + return false; + } + QHttpPart textPart; textPart.setHeader(QNetworkRequest::ContentDispositionHeader, "form-data;" " name=\"model_category\""); @@ -159,6 +165,7 @@ bool ModelUploader::zip() { void ModelUploader::send() { if (!zip()) { + deleteLater(); return; } @@ -202,7 +209,7 @@ void ModelUploader::uploadSuccess(const QJsonObject& jsonResponse) { } QMessageBox::information(NULL, QString("ModelUploader::uploadSuccess()"), - QString("Your model is being processed by the system."), + QString("We are reading your model information."), QMessageBox::Ok); qDebug() << "Model sent with success"; checkS3(); @@ -214,7 +221,7 @@ void ModelUploader::uploadFailed(QNetworkReply::NetworkError errorCode, const QS } QMessageBox::warning(NULL, QString("ModelUploader::uploadFailed()"), - QString("Model could not be sent to the data server."), + QString("There was a problem with your upload, please try again later."), QMessageBox::Ok); qDebug() << "Model upload failed (" << errorCode << "): " << errorString; deleteLater(); @@ -247,7 +254,8 @@ void ModelUploader::processCheck() { default: QMessageBox::warning(NULL, QString("ModelUploader::processCheck()"), - QString("Could not verify that the model is present on the server."), + QString("We could not verify that your model was sent sucessfully\n" + "but it may have. If you do not see it in the model browser, try to upload again."), QMessageBox::Ok); deleteLater(); break; @@ -256,24 +264,29 @@ void ModelUploader::processCheck() { delete reply; } -bool ModelUploader::addTextures(const QFileInfo& texdir) { - QStringList filter; - filter << "*.png" << "*.tif" << "*.jpg" << "*.jpeg"; +bool ModelUploader::addTextures(const QString& texdir, const QString fbxFile) { + QFile fbx(fbxFile); + if (!fbx.open(QIODevice::ReadOnly)) { + return false; + } - QFileInfoList list = QDir(texdir.filePath()).entryInfoList(filter, - QDir::Files | - QDir::AllDirs | - QDir::NoDotAndDotDot | - QDir::NoSymLinks); - foreach (QFileInfo info, list) { - if (info.isFile()) { - // Compress and copy - if (!addPart(info.filePath(), QString("texture%1").arg(++_texturesCount))) { - return false; + QByteArray buffer = fbx.readAll(); + QVariantHash variantHash = readMapping(buffer); + FBXGeometry geometry = readFBX(buffer, variantHash); + + foreach (FBXMesh mesh, geometry.meshes) { + foreach (FBXMeshPart part, mesh.parts) { + if (!part.diffuseFilename.isEmpty()) { + if (!addPart(QFileInfo(fbxFile).path() + "/" + part.diffuseFilename, + QString("texture%1").arg(++_texturesCount))) { + return false; + } } - } else if (info.isDir()) { - if (!addTextures(info)) { - return false; + if (!part.normalFilename.isEmpty()) { + if (!addPart(QFileInfo(fbxFile).path() + "/" + part.normalFilename, + QString("texture%1").arg(++_texturesCount))) { + return false; + } } } } @@ -282,6 +295,7 @@ bool ModelUploader::addTextures(const QFileInfo& texdir) { } bool ModelUploader::addPart(const QString &path, const QString& name) { + qDebug() << path; QFile file(path); if (!file.open(QIODevice::ReadOnly)) { QMessageBox::warning(NULL, diff --git a/libraries/shared/src/ModelUploader.h b/interface/src/ModelUploader.h similarity index 94% rename from libraries/shared/src/ModelUploader.h rename to interface/src/ModelUploader.h index 0e62ab8705..0d18ef9022 100644 --- a/libraries/shared/src/ModelUploader.h +++ b/interface/src/ModelUploader.h @@ -17,8 +17,6 @@ class QFileInfo; class QHttpMultiPart; class QProgressBar; -class TemporaryDir; - class ModelUploader : public QObject { Q_OBJECT @@ -55,7 +53,7 @@ private: bool zip(); - bool addTextures(const QFileInfo& texdir); + bool addTextures(const QString& texdir, const QString fbxFile); bool addPart(const QString& path, const QString& name); }; From 039450aeec47ea58364de4b352d1320fe7bcc1eb Mon Sep 17 00:00:00 2001 From: Atlante45 Date: Tue, 8 Apr 2014 16:35:07 -0700 Subject: [PATCH 024/120] Checking model name is present in the .fst file --- interface/src/ModelUploader.cpp | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/interface/src/ModelUploader.cpp b/interface/src/ModelUploader.cpp index 1881d84d85..93a2c96c7c 100644 --- a/interface/src/ModelUploader.cpp +++ b/interface/src/ModelUploader.cpp @@ -65,6 +65,7 @@ bool ModelUploader::zip() { // If the user canceled we return. return false; } + bool _nameIsPresent = false; QString texDir; QString fbxFile; @@ -103,6 +104,7 @@ bool ModelUploader::zip() { textPart.setBody(line[1].toUtf8()); _dataMultiPart->append(textPart); _url = S3_URL + ((_isHead)? "/models/heads/" : "/models/skeletons/") + line[1].toUtf8() + ".fst"; + _nameIsPresent = true; } else if (line[0] == FILENAME_FIELD) { fbxFile = QFileInfo(fst).path() + "/" + line[1]; QFileInfo fbxInfo(fbxFile); @@ -159,6 +161,15 @@ bool ModelUploader::zip() { } _dataMultiPart->append(textPart); + if (!_nameIsPresent) { + QMessageBox::warning(NULL, + QString("ModelUploader::zip()"), + QString("Model name is missing in the .fst file."), + QMessageBox::Ok); + qDebug() << "[Warning] " << QString("Model name is missing in the .fst file."); + return false; + } + _readyToSend = true; return true; } From 98011da1efd15a7dca395b611a3d4df4ad43133e Mon Sep 17 00:00:00 2001 From: Andrzej Kapolka Date: Tue, 8 Apr 2014 17:07:45 -0700 Subject: [PATCH 025/120] Starting on Faceplus integration. --- cmake/modules/FindFaceplus.cmake | 42 ++++++++++++++++++++++++++ interface/CMakeLists.txt | 9 ++++++ interface/external/faceplus/readme.txt | 9 ++++++ 3 files changed, 60 insertions(+) create mode 100644 cmake/modules/FindFaceplus.cmake create mode 100644 interface/external/faceplus/readme.txt diff --git a/cmake/modules/FindFaceplus.cmake b/cmake/modules/FindFaceplus.cmake new file mode 100644 index 0000000000..2a2083d6e4 --- /dev/null +++ b/cmake/modules/FindFaceplus.cmake @@ -0,0 +1,42 @@ +# Try to find the Faceplus library +# +# You must provide a FACEPLUS_ROOT_DIR which contains lib and include directories +# +# Once done this will define +# +# FACEPLUS_FOUND - system found Faceplus +# FACEPLUS_INCLUDE_DIRS - the Faceplus include directory +# FACEPLUS_LIBRARIES - Link this to use Faceplus +# +# Created on 4/8/2014 by Andrzej Kapolka +# Copyright (c) 2014 High Fidelity +# + +if (FACEPLUS_LIBRARIES AND FACEPLUS_INCLUDE_DIRS) + # in cache already + set(FACEPLUS_FOUND TRUE) +else (FACEPLUS_LIBRARIES AND FACEPLUS_INCLUDE_DIRS) + find_path(FACEPLUS_INCLUDE_DIRS faceplus.h ${FACEPLUS_ROOT_DIR}/include) + + if (WIN32) + find_library(FACEPLUS_LIBRARIES faceplus.lib ${FACEPLUS_ROOT_DIR}/win32/) + endif (WIN32) + + if (FACEPLUS_INCLUDE_DIRS AND FACEPLUS_LIBRARIES) + set(FACEPLUS_FOUND TRUE) + endif (FACEPLUS_INCLUDE_DIRS AND FACEPLUS_LIBRARIES) + + if (FACEPLUS_FOUND) + if (NOT FACEPLUS_FIND_QUIETLY) + message(STATUS "Found Faceplus... ${FACEPLUS_LIBRARIES}") + endif (NOT FACEPLUS_FIND_QUIETLY) + else () + if (FACEPLUS_FIND_REQUIRED) + message(FATAL_ERROR "Could not find Faceplus") + endif (FACEPLUS_FIND_REQUIRED) + endif () + + # show the FACEPLUS_INCLUDE_DIRS and FACEPLUS_LIBRARIES variables only in the advanced view + mark_as_advanced(FACEPLUS_INCLUDE_DIRS FACEPLUS_LIBRARIES) + +endif (FACEPLUS_LIBRARIES AND FACEPLUS_INCLUDE_DIRS) diff --git a/interface/CMakeLists.txt b/interface/CMakeLists.txt index 55d0a86d87..29943eb4cb 100644 --- a/interface/CMakeLists.txt +++ b/interface/CMakeLists.txt @@ -12,6 +12,7 @@ project(${TARGET_NAME}) # setup for find modules set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} "${CMAKE_CURRENT_SOURCE_DIR}/../cmake/modules/") +set(FACEPLUS_ROOT_DIR "${CMAKE_CURRENT_SOURCE_DIR}/external/faceplus") set(FACESHIFT_ROOT_DIR "${CMAKE_CURRENT_SOURCE_DIR}/external/faceshift") set(LIBOVR_ROOT_DIR "${CMAKE_CURRENT_SOURCE_DIR}/external/oculus") set(SIXENSE_ROOT_DIR "${CMAKE_CURRENT_SOURCE_DIR}/external/Sixense") @@ -130,6 +131,7 @@ link_hifi_library(audio ${TARGET_NAME} "${ROOT_DIR}") link_hifi_library(script-engine ${TARGET_NAME} "${ROOT_DIR}") # find any optional libraries +find_package(Faceplus) find_package(Faceshift) find_package(LibOVR) find_package(Sixense) @@ -163,6 +165,13 @@ if (VISAGE_FOUND AND NOT DISABLE_VISAGE) target_link_libraries(${TARGET_NAME} "${VISAGE_LIBRARIES}") endif (VISAGE_FOUND AND NOT DISABLE_VISAGE) +# and with Faceplus library, also for webcam feature tracking +if (FACEPLUS_FOUND AND NOT DISABLE_FACEPLUS) + add_definitions(-DHAVE_FACEPLUS) + include_directories(SYSTEM "${FACEPLUS_INCLUDE_DIRS}") + target_link_libraries(${TARGET_NAME} "${FACEPLUS_LIBRARIES}") +endif (FACEPLUS_FOUND AND NOT DISABLE_FACEPLUS) + # and with LibOVR for Oculus Rift if (LIBOVR_FOUND AND NOT DISABLE_LIBOVR) add_definitions(-DHAVE_LIBOVR) diff --git a/interface/external/faceplus/readme.txt b/interface/external/faceplus/readme.txt new file mode 100644 index 0000000000..322ea846bb --- /dev/null +++ b/interface/external/faceplus/readme.txt @@ -0,0 +1,9 @@ + +Instructions for adding the Faceplus driver to Interface +Andrzej Kapolka, April 8, 2014 + +1. Copy the Faceplus sdk folders (include, win32) into the interface/external/faceplus folder. + This readme.txt should be there as well. + +2. Delete your build directory, run cmake and build, and you should be all set. + From f3cbd120ce58246d1e326a7c924582bf4f1e2762 Mon Sep 17 00:00:00 2001 From: Stephen Birarda Date: Tue, 8 Apr 2014 17:19:23 -0700 Subject: [PATCH 026/120] header comment tweaks prior to regex match --- interface/src/scripting/ControllerScriptingInterface.h | 1 - interface/src/ui/RearMirrorTools.h | 2 +- interface/src/ui/RunningScriptsWidget.h | 1 + interface/src/world.h | 2 +- libraries/octree/src/OctreeConstants.h | 1 - libraries/octree/src/Plane.h | 3 +-- libraries/shared/src/PacketHeaders.h | 2 +- libraries/shared/src/RegisteredMetaTypes.h | 1 + libraries/voxels/src/VoxelConstants.h | 1 - 9 files changed, 6 insertions(+), 8 deletions(-) diff --git a/interface/src/scripting/ControllerScriptingInterface.h b/interface/src/scripting/ControllerScriptingInterface.h index 6fe5a60fa4..ada146ff02 100644 --- a/interface/src/scripting/ControllerScriptingInterface.h +++ b/interface/src/scripting/ControllerScriptingInterface.h @@ -1,4 +1,3 @@ - // // ControllerScriptingInterface.h // hifi diff --git a/interface/src/ui/RearMirrorTools.h b/interface/src/ui/RearMirrorTools.h index 7f13eafbee..007b54f129 100644 --- a/interface/src/ui/RearMirrorTools.h +++ b/interface/src/ui/RearMirrorTools.h @@ -4,7 +4,7 @@ // // Created by stojce on 23.10.2013. // Copyright (c) 2013 High Fidelity, Inc. All rights reserved. - +// #ifndef __hifi__RearMirrorTools__ #define __hifi__RearMirrorTools__ diff --git a/interface/src/ui/RunningScriptsWidget.h b/interface/src/ui/RunningScriptsWidget.h index d92927347f..5d365dae91 100644 --- a/interface/src/ui/RunningScriptsWidget.h +++ b/interface/src/ui/RunningScriptsWidget.h @@ -4,6 +4,7 @@ // // Created by Mohammed Nafees on 03/28/2014. // Copyright (c) 2014 High Fidelity, Inc. All rights reserved. +// #ifndef __hifi__RunningScriptsWidget__ #define __hifi__RunningScriptsWidget__ diff --git a/interface/src/world.h b/interface/src/world.h index bc8dab9106..8d857303ae 100644 --- a/interface/src/world.h +++ b/interface/src/world.h @@ -4,7 +4,7 @@ // // Created by Philip Rosedale on 8/23/12. // Copyright (c) 2012 High Fidelity, Inc. All rights reserved. -// +// #ifndef __interface__world__ #define __interface__world__ diff --git a/libraries/octree/src/OctreeConstants.h b/libraries/octree/src/OctreeConstants.h index a78d778f70..82f4acea66 100644 --- a/libraries/octree/src/OctreeConstants.h +++ b/libraries/octree/src/OctreeConstants.h @@ -7,7 +7,6 @@ // // Various important constants used throughout the system related to voxels // -// #ifndef __hifi_OctreeConstants_h__ #define __hifi_OctreeConstants_h__ diff --git a/libraries/octree/src/Plane.h b/libraries/octree/src/Plane.h index 8ce0e5042e..48bef064f6 100755 --- a/libraries/octree/src/Plane.h +++ b/libraries/octree/src/Plane.h @@ -13,8 +13,7 @@ #include -class Plane -{ +class Plane { public: Plane(const glm::vec3 &v1, const glm::vec3 &v2, const glm::vec3 &v3) { set3Points(v1,v2,v3); } Plane() : _normal(0,0,0), _point(0,0,0), _dCoefficient(0) {}; diff --git a/libraries/shared/src/PacketHeaders.h b/libraries/shared/src/PacketHeaders.h index a9bc5d3763..0e1e152a02 100644 --- a/libraries/shared/src/PacketHeaders.h +++ b/libraries/shared/src/PacketHeaders.h @@ -7,7 +7,7 @@ // // The packet headers below refer to the first byte of a received UDP packet transmitted between // any two Hifi components. For example, a packet whose first byte is 'P' is always a ping packet. -// +// #ifndef hifi_PacketHeaders_h #define hifi_PacketHeaders_h diff --git a/libraries/shared/src/RegisteredMetaTypes.h b/libraries/shared/src/RegisteredMetaTypes.h index 0e7732c057..4e6a071dd6 100644 --- a/libraries/shared/src/RegisteredMetaTypes.h +++ b/libraries/shared/src/RegisteredMetaTypes.h @@ -7,6 +7,7 @@ // // Used to register meta-types with Qt so that they can be used as properties for objects exposed to our // Agent scripting. +// #ifndef hifi_RegisteredMetaTypes_h #define hifi_RegisteredMetaTypes_h diff --git a/libraries/voxels/src/VoxelConstants.h b/libraries/voxels/src/VoxelConstants.h index d4cbc54f18..16d75873d9 100644 --- a/libraries/voxels/src/VoxelConstants.h +++ b/libraries/voxels/src/VoxelConstants.h @@ -7,7 +7,6 @@ // // Various important constants used throughout the system related to voxels // -// #ifndef __hifi_VoxelConstants_h__ #define __hifi_VoxelConstants_h__ From 6a51df9e38d5689566146ed62a17a3b736dbc67e Mon Sep 17 00:00:00 2001 From: Stephen Birarda Date: Tue, 8 Apr 2014 17:30:36 -0700 Subject: [PATCH 027/120] initial regex replacement of headers --- animation-server/src/AnimationServer.h | 7 ++- assignment-client/src/Agent.h | 7 ++- assignment-client/src/AssignmentClient.h | 7 ++- .../src/AssignmentClientMonitor.h | 7 ++- assignment-client/src/AssignmentFactory.h | 7 ++- assignment-client/src/AssignmentThread.h | 9 ++- assignment-client/src/audio/AudioMixer.h | 7 ++- .../src/audio/AudioMixerClientData.h | 7 ++- .../src/audio/AvatarAudioRingBuffer.h | 7 ++- assignment-client/src/avatars/AvatarMixer.h | 7 ++- .../src/avatars/AvatarMixerClientData.h | 7 ++- .../src/metavoxels/MetavoxelServer.h | 7 ++- .../src/octree/OctreeInboundPacketProcessor.h | 9 +-- .../src/octree/OctreeQueryNode.h | 5 +- .../src/octree/OctreeSendThread.h | 8 ++- assignment-client/src/octree/OctreeServer.h | 8 ++- .../src/octree/OctreeServerConsts.h | 9 ++- .../src/particles/ParticleNodeData.h | 8 ++- .../src/particles/ParticleServer.h | 8 ++- .../src/particles/ParticleServerConsts.h | 9 ++- assignment-client/src/voxels/VoxelNodeData.h | 7 ++- assignment-client/src/voxels/VoxelServer.h | 8 ++- .../src/voxels/VoxelServerConsts.h | 9 ++- domain-server/src/DomainServer.h | 7 ++- domain-server/src/DomainServerNodeData.h | 7 ++- interface/src/AbstractLoggerInterface.h | 7 ++- interface/src/Application.h | 7 ++- interface/src/Audio.h | 7 ++- interface/src/BuckyBalls.h | 5 +- interface/src/Camera.h | 7 ++- interface/src/DatagramProcessor.h | 7 ++- interface/src/Environment.h | 7 ++- interface/src/FileLogger.h | 5 +- interface/src/GLCanvas.h | 7 ++- interface/src/Menu.h | 7 ++- interface/src/MetavoxelSystem.h | 7 ++- interface/src/ParticleTreeRenderer.h | 8 ++- interface/src/Physics.h | 7 ++- interface/src/Stars.h | 11 ++-- interface/src/Util.h | 7 ++- interface/src/XmppClient.h | 9 ++- interface/src/avatar/Avatar.h | 7 ++- interface/src/avatar/AvatarManager.h | 7 ++- interface/src/avatar/FaceModel.h | 7 ++- interface/src/avatar/Hand.h | 7 ++- interface/src/avatar/Head.h | 7 ++- interface/src/avatar/MyAvatar.h | 7 ++- interface/src/avatar/SkeletonModel.h | 7 ++- interface/src/devices/Faceshift.h | 7 ++- interface/src/devices/OculusManager.h | 7 ++- interface/src/devices/SixenseManager.h | 7 ++- interface/src/devices/TV3DManager.h | 9 ++- interface/src/devices/Visage.h | 7 ++- interface/src/location/LocationManager.h | 5 +- interface/src/location/NamedLocation.h | 5 +- .../src/renderer/AmbientOcclusionEffect.h | 7 ++- interface/src/renderer/FBXReader.h | 7 ++- interface/src/renderer/GeometryCache.h | 7 ++- interface/src/renderer/GlowEffect.h | 7 ++- interface/src/renderer/Model.h | 7 ++- interface/src/renderer/PointShader.h | 7 ++- interface/src/renderer/ProgramObject.h | 7 ++- interface/src/renderer/RenderUtil.h | 7 ++- interface/src/renderer/TextureCache.h | 7 ++- interface/src/renderer/VoxelShader.h | 7 ++- .../scripting/AudioDeviceScriptingInterface.h | 9 ++- .../scripting/ClipboardScriptingInterface.h | 7 ++- .../scripting/ControllerScriptingInterface.h | 9 ++- .../src/scripting/MenuScriptingInterface.h | 9 ++- .../scripting/SettingsScriptingInterface.h | 9 ++- interface/src/starfield/Config.h | 16 ++--- interface/src/starfield/Controller.h | 12 ++-- interface/src/starfield/Generator.h | 13 +++-- interface/src/starfield/data/GpuVertex.h | 12 ++-- interface/src/starfield/data/InputVertex.h | 12 ++-- interface/src/starfield/data/Tile.h | 11 ++-- interface/src/starfield/renderer/Renderer.h | 58 ++----------------- interface/src/starfield/renderer/Tiling.h | 11 ++-- .../src/starfield/renderer/VertexOrder.h | 11 ++-- interface/src/ui/BandwidthDialog.h | 7 ++- interface/src/ui/BandwidthMeter.h | 7 ++- interface/src/ui/ChatWindow.h | 7 ++- interface/src/ui/ImportDialog.h | 7 ++- interface/src/ui/InfoView.h | 7 ++- interface/src/ui/LodToolsDialog.h | 7 ++- interface/src/ui/LogDialog.h | 7 ++- interface/src/ui/MetavoxelEditor.h | 7 ++- interface/src/ui/ModelsBrowser.h | 7 ++- interface/src/ui/OctreeStatsDialog.h | 7 ++- interface/src/ui/Oscilloscope.h | 7 ++- interface/src/ui/RearMirrorTools.h | 9 ++- interface/src/ui/RunningScriptsWidget.h | 9 ++- interface/src/ui/Snapshot.h | 7 ++- interface/src/ui/Stats.h | 9 ++- interface/src/ui/TextRenderer.h | 7 ++- interface/src/ui/UpdateDialog.h | 8 ++- interface/src/ui/overlays/Base3DOverlay.h | 7 ++- interface/src/ui/overlays/Cube3DOverlay.h | 7 ++- interface/src/ui/overlays/ImageOverlay.h | 7 ++- interface/src/ui/overlays/Line3DOverlay.h | 7 ++- .../src/ui/overlays/LocalVoxelsOverlay.h | 7 ++- interface/src/ui/overlays/Overlay.h | 7 ++- interface/src/ui/overlays/Overlay2D.h | 7 ++- interface/src/ui/overlays/Overlays.h | 7 ++- interface/src/ui/overlays/Sphere3DOverlay.h | 7 ++- interface/src/ui/overlays/TextOverlay.h | 7 ++- interface/src/ui/overlays/Volume3DOverlay.h | 7 ++- interface/src/voxels/PrimitiveRenderer.h | 16 ++--- interface/src/voxels/VoxelFade.h | 7 ++- interface/src/voxels/VoxelHideShowThread.h | 9 +-- interface/src/voxels/VoxelImporter.h | 7 ++- interface/src/voxels/VoxelPacketProcessor.h | 7 ++- interface/src/voxels/VoxelSystem.h | 7 ++- interface/src/windowshacks.h | 9 +-- interface/src/world.h | 7 ++- libraries/audio/src/AbstractAudioInterface.h | 8 ++- libraries/audio/src/AudioInjector.h | 7 ++- libraries/audio/src/AudioInjectorOptions.h | 7 ++- libraries/audio/src/AudioRingBuffer.h | 7 ++- libraries/audio/src/AudioScriptingInterface.h | 7 ++- libraries/audio/src/InjectedAudioRingBuffer.h | 7 ++- libraries/audio/src/MixedAudioRingBuffer.h | 9 ++- .../audio/src/PositionalAudioRingBuffer.h | 7 ++- libraries/audio/src/Sound.h | 8 ++- libraries/avatars/src/AvatarData.h | 7 ++- libraries/avatars/src/AvatarHashMap.h | 7 ++- libraries/avatars/src/HandData.h | 7 ++- libraries/avatars/src/HeadData.h | 7 ++- .../embedded-webserver/src/HTTPConnection.h | 9 ++- .../embedded-webserver/src/HTTPManager.h | 9 ++- libraries/metavoxels/src/AttributeRegistry.h | 7 ++- libraries/metavoxels/src/Bitstream.h | 7 ++- libraries/metavoxels/src/DatagramSequencer.h | 7 ++- libraries/metavoxels/src/MetavoxelData.h | 7 ++- libraries/metavoxels/src/MetavoxelMessages.h | 7 ++- libraries/metavoxels/src/MetavoxelUtil.h | 7 ++- libraries/metavoxels/src/ScriptCache.h | 7 ++- libraries/metavoxels/src/SharedObject.h | 7 ++- libraries/octree/src/AABox.h | 11 ++-- libraries/octree/src/CoverageMap.h | 11 ++-- libraries/octree/src/CoverageMapV2.h | 11 ++-- libraries/octree/src/JurisdictionListener.h | 7 ++- libraries/octree/src/JurisdictionMap.h | 7 ++- libraries/octree/src/JurisdictionSender.h | 7 ++- libraries/octree/src/Octree.h | 7 ++- libraries/octree/src/OctreeConstants.h | 9 +-- libraries/octree/src/OctreeEditPacketSender.h | 7 ++- libraries/octree/src/OctreeElement.h | 7 ++- libraries/octree/src/OctreeElementBag.h | 12 ++-- libraries/octree/src/OctreeHeadlessViewer.h | 10 ++-- libraries/octree/src/OctreePacketData.h | 17 ++---- libraries/octree/src/OctreePersistThread.h | 9 +-- libraries/octree/src/OctreeProjectedPolygon.h | 10 +++- libraries/octree/src/OctreeQuery.h | 7 ++- libraries/octree/src/OctreeRenderer.h | 8 ++- libraries/octree/src/OctreeSceneStats.h | 6 +- .../octree/src/OctreeScriptingInterface.h | 9 ++- libraries/octree/src/Plane.h | 8 ++- libraries/octree/src/ViewFrustum.h | 7 ++- libraries/particles/src/Particle.h | 6 +- .../particles/src/ParticleCollisionSystem.h | 6 +- .../particles/src/ParticleEditPacketSender.h | 7 ++- libraries/particles/src/ParticleTree.h | 7 ++- libraries/particles/src/ParticleTreeElement.h | 6 +- .../src/ParticleTreeHeadlessViewer.h | 10 ++-- .../src/ParticlesScriptingInterface.h | 9 ++- .../AbstractControllerScriptingInterface.h | 9 ++- libraries/script-engine/src/EventTypes.h | 7 ++- libraries/script-engine/src/LocalVoxels.h | 7 ++- .../script-engine/src/MenuItemProperties.h | 7 ++- libraries/script-engine/src/Quat.h | 10 ++-- libraries/script-engine/src/ScriptEngine.h | 7 ++- libraries/script-engine/src/Vec3.h | 10 ++-- libraries/shared/src/AccountManager.h | 7 ++- libraries/shared/src/AngleUtil.h | 11 ++-- libraries/shared/src/Assignment.h | 7 ++- libraries/shared/src/CapsuleShape.h | 9 ++- libraries/shared/src/CollisionInfo.h | 9 ++- libraries/shared/src/DataServerAccountInfo.h | 7 ++- libraries/shared/src/DomainInfo.h | 7 ++- libraries/shared/src/FileUtils.h | 7 ++- libraries/shared/src/FloodFill.h | 8 ++- libraries/shared/src/GenericThread.h | 7 ++- libraries/shared/src/GeometryUtil.h | 7 ++- libraries/shared/src/HifiSockAddr.h | 7 ++- libraries/shared/src/ListShape.h | 8 ++- libraries/shared/src/Logging.h | 7 ++- libraries/shared/src/ModelUploader.h | 6 +- libraries/shared/src/NetworkPacket.h | 7 ++- libraries/shared/src/Node.h | 7 ++- libraries/shared/src/NodeData.h | 7 ++- libraries/shared/src/NodeList.h | 7 ++- libraries/shared/src/OAuthAccessToken.h | 7 ++- libraries/shared/src/OctalCode.h | 7 ++- libraries/shared/src/PacketHeaders.h | 8 +-- libraries/shared/src/PacketSender.h | 7 ++- libraries/shared/src/PerfStat.h | 11 ++-- libraries/shared/src/Radix2InplaceSort.h | 11 ++-- libraries/shared/src/Radix2IntegerScanner.h | 11 ++-- .../shared/src/ReceivedPacketProcessor.h | 7 ++- libraries/shared/src/RegisteredMetaTypes.h | 8 +-- libraries/shared/src/ResourceCache.h | 7 ++- libraries/shared/src/Shape.h | 8 ++- libraries/shared/src/ShapeCollider.h | 9 ++- libraries/shared/src/SharedUtil.h | 7 ++- libraries/shared/src/SimpleMovingAverage.h | 7 ++- libraries/shared/src/SphereShape.h | 9 ++- libraries/shared/src/StdDev.h | 5 +- libraries/shared/src/StreamUtils.h | 8 ++- libraries/shared/src/ThreadedAssignment.h | 7 ++- libraries/shared/src/UUID.h | 7 ++- libraries/voxels/src/EnvironmentData.h | 7 ++- libraries/voxels/src/LocalVoxelsList.h | 7 ++- libraries/voxels/src/Tags.h | 7 ++- libraries/voxels/src/VoxelConstants.h | 9 +-- libraries/voxels/src/VoxelDetail.h | 10 ++-- libraries/voxels/src/VoxelEditPacketSender.h | 7 ++- libraries/voxels/src/VoxelTree.h | 7 ++- libraries/voxels/src/VoxelTreeCommands.h | 7 ++- libraries/voxels/src/VoxelTreeElement.h | 5 +- .../voxels/src/VoxelTreeHeadlessViewer.h | 10 ++-- .../voxels/src/VoxelsScriptingInterface.h | 7 ++- voxel-edit/src/SceneUtils.h | 5 +- 223 files changed, 1148 insertions(+), 637 deletions(-) diff --git a/animation-server/src/AnimationServer.h b/animation-server/src/AnimationServer.h index cda5f8fb24..924e973599 100644 --- a/animation-server/src/AnimationServer.h +++ b/animation-server/src/AnimationServer.h @@ -1,9 +1,12 @@ // // AnimationServer.h -// hifi +// animation-server/src // // Created by Stephen Birarda on 12/5/2013. -// Copyright (c) 2013 HighFidelity, Inc. All rights reserved. +// Copyright 2013 High Fidelity, Inc. +// +// 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__AnimationServer__ diff --git a/assignment-client/src/Agent.h b/assignment-client/src/Agent.h index 9e5f31213c..6423514894 100644 --- a/assignment-client/src/Agent.h +++ b/assignment-client/src/Agent.h @@ -1,9 +1,12 @@ // // Agent.h -// hifi +// assignment-client/src // // Created by Stephen Birarda on 7/1/13. -// Copyright (c) 2013 HighFidelity, Inc. All rights reserved. +// Copyright 2013 High Fidelity, Inc. +// +// 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__Agent__ diff --git a/assignment-client/src/AssignmentClient.h b/assignment-client/src/AssignmentClient.h index c267c6238b..26e3a47255 100644 --- a/assignment-client/src/AssignmentClient.h +++ b/assignment-client/src/AssignmentClient.h @@ -1,9 +1,12 @@ // // AssignmentClient.h -// hifi +// assignment-client/src // // Created by Stephen Birarda on 11/25/2013. -// Copyright (c) 2013 HighFidelity, Inc. All rights reserved. +// Copyright 2013 High Fidelity, Inc. +// +// 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__AssignmentClient__ diff --git a/assignment-client/src/AssignmentClientMonitor.h b/assignment-client/src/AssignmentClientMonitor.h index 259a6d6db7..4bb82ab715 100644 --- a/assignment-client/src/AssignmentClientMonitor.h +++ b/assignment-client/src/AssignmentClientMonitor.h @@ -1,9 +1,12 @@ // // AssignmentClientMonitor.h -// hifi +// assignment-client/src // // Created by Stephen Birarda on 1/10/2014. -// Copyright (c) 2014 HighFidelity, Inc. All rights reserved. +// Copyright 2014 High Fidelity, Inc. +// +// 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__AssignmentClientMonitor__ diff --git a/assignment-client/src/AssignmentFactory.h b/assignment-client/src/AssignmentFactory.h index 9eff29a468..2a63bffd37 100644 --- a/assignment-client/src/AssignmentFactory.h +++ b/assignment-client/src/AssignmentFactory.h @@ -1,9 +1,12 @@ // // AssignmentFactory.h -// hifi +// assignment-client/src // // Created by Stephen Birarda on 9/17/13. -// Copyright (c) 2013 HighFidelity, Inc. All rights reserved. +// Copyright 2013 High Fidelity, Inc. +// +// 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__AssignmentFactory__ diff --git a/assignment-client/src/AssignmentThread.h b/assignment-client/src/AssignmentThread.h index b55ac10676..a76c118192 100644 --- a/assignment-client/src/AssignmentThread.h +++ b/assignment-client/src/AssignmentThread.h @@ -1,9 +1,12 @@ // // AssignmentThread.h -// hifi +// assignment-client/src // -// Created by Stephen Birarda on 2014-03-28. -// Copyright (c) 2014 High Fidelity, Inc. All rights reserved. +// Created by Stephen Birarda on 2014. +// Copyright 2014 High Fidelity, Inc. +// +// 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__AssignmentThread__ diff --git a/assignment-client/src/audio/AudioMixer.h b/assignment-client/src/audio/AudioMixer.h index 0ca241c5ed..cea8bba083 100644 --- a/assignment-client/src/audio/AudioMixer.h +++ b/assignment-client/src/audio/AudioMixer.h @@ -1,9 +1,12 @@ // // AudioMixer.h -// hifi +// assignment-client/src/audio // // Created by Stephen Birarda on 8/22/13. -// Copyright (c) 2013 HighFidelity, Inc. All rights reserved. +// Copyright 2013 High Fidelity, Inc. +// +// 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__AudioMixer__ diff --git a/assignment-client/src/audio/AudioMixerClientData.h b/assignment-client/src/audio/AudioMixerClientData.h index 7f44390ec5..aa449d20a3 100644 --- a/assignment-client/src/audio/AudioMixerClientData.h +++ b/assignment-client/src/audio/AudioMixerClientData.h @@ -1,9 +1,12 @@ // // AudioMixerClientData.h -// hifi +// assignment-client/src/audio // // Created by Stephen Birarda on 10/18/13. -// Copyright (c) 2013 HighFidelity, Inc. All rights reserved. +// Copyright 2013 High Fidelity, Inc. +// +// 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__AudioMixerClientData__ diff --git a/assignment-client/src/audio/AvatarAudioRingBuffer.h b/assignment-client/src/audio/AvatarAudioRingBuffer.h index 0d4f28467b..fb9e68543f 100644 --- a/assignment-client/src/audio/AvatarAudioRingBuffer.h +++ b/assignment-client/src/audio/AvatarAudioRingBuffer.h @@ -1,9 +1,12 @@ // // AvatarAudioRingBuffer.h -// hifi +// assignment-client/src/audio // // Created by Stephen Birarda on 6/5/13. -// Copyright (c) 2013 HighFidelity, Inc. All rights reserved. +// Copyright 2013 High Fidelity, Inc. +// +// 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__AvatarAudioRingBuffer__ diff --git a/assignment-client/src/avatars/AvatarMixer.h b/assignment-client/src/avatars/AvatarMixer.h index c9a145d2da..af25a6f0e2 100644 --- a/assignment-client/src/avatars/AvatarMixer.h +++ b/assignment-client/src/avatars/AvatarMixer.h @@ -1,9 +1,12 @@ // // AvatarMixer.h -// hifi +// assignment-client/src/avatars // // Created by Stephen Birarda on 9/5/13. -// Copyright (c) 2013 HighFidelity, Inc. All rights reserved. +// Copyright 2013 High Fidelity, Inc. +// +// 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__AvatarMixer__ diff --git a/assignment-client/src/avatars/AvatarMixerClientData.h b/assignment-client/src/avatars/AvatarMixerClientData.h index bc0a54f06b..75affca7ff 100644 --- a/assignment-client/src/avatars/AvatarMixerClientData.h +++ b/assignment-client/src/avatars/AvatarMixerClientData.h @@ -1,9 +1,12 @@ // // AvatarMixerClientData.h -// hifi +// assignment-client/src/avatars // // Created by Stephen Birarda on 2/4/2014. -// Copyright (c) 2014 HighFidelity, Inc. All rights reserved. +// Copyright 2014 High Fidelity, Inc. +// +// 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__AvatarMixerClientData__ diff --git a/assignment-client/src/metavoxels/MetavoxelServer.h b/assignment-client/src/metavoxels/MetavoxelServer.h index d178127ac7..749ab93b2a 100644 --- a/assignment-client/src/metavoxels/MetavoxelServer.h +++ b/assignment-client/src/metavoxels/MetavoxelServer.h @@ -1,9 +1,12 @@ // // MetavoxelServer.h -// hifi +// assignment-client/src/metavoxels // // Created by Andrzej Kapolka on 12/18/13. -// Copyright (c) 2013 High Fidelity, Inc. All rights reserved. +// Copyright 2013 High Fidelity, Inc. +// +// 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__MetavoxelServer__ diff --git a/assignment-client/src/octree/OctreeInboundPacketProcessor.h b/assignment-client/src/octree/OctreeInboundPacketProcessor.h index e2ec1b5c50..1a4f80b925 100644 --- a/assignment-client/src/octree/OctreeInboundPacketProcessor.h +++ b/assignment-client/src/octree/OctreeInboundPacketProcessor.h @@ -1,11 +1,12 @@ // // OctreeInboundPacketProcessor.h -// voxel-server +// assignment-client/src/octree // -// Created by Brad Hefta-Gaub on 8/21/13 -// Copyright (c) 2013 High Fidelity, Inc. All rights reserved. +// Created by Brad Hefta-Gaub on 8/21/13. +// Copyright 2013 High Fidelity, Inc. // -// Threaded or non-threaded network packet processor for the voxel-server +// Distributed under the Apache License, Version 2.0. +// See the accompanying file LICENSE or http://www.apache.org/licenses/LICENSE-2.0.html // #ifndef __octree_server__OctreeInboundPacketProcessor__ diff --git a/assignment-client/src/octree/OctreeQueryNode.h b/assignment-client/src/octree/OctreeQueryNode.h index 17d6f6337c..6c46679a0c 100644 --- a/assignment-client/src/octree/OctreeQueryNode.h +++ b/assignment-client/src/octree/OctreeQueryNode.h @@ -1,9 +1,12 @@ // // OctreeQueryNode.h -// hifi +// assignment-client/src/octree // // Created by Brad Hefta-Gaub on 12/4/13. +// Copyright 2013 High Fidelity, Inc. // +// 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__OctreeQueryNode__ diff --git a/assignment-client/src/octree/OctreeSendThread.h b/assignment-client/src/octree/OctreeSendThread.h index 4b1b6d8c92..09d5809acc 100644 --- a/assignment-client/src/octree/OctreeSendThread.h +++ b/assignment-client/src/octree/OctreeSendThread.h @@ -1,10 +1,12 @@ // // OctreeSendThread.h +// assignment-client/src/octree // -// Created by Brad Hefta-Gaub on 8/21/13 -// Copyright (c) 2013 High Fidelity, Inc. All rights reserved. +// Created by Brad Hefta-Gaub on 8/21/13. +// Copyright 2013 High Fidelity, Inc. // -// Threaded or non-threaded object for sending voxels to a client +// Distributed under the Apache License, Version 2.0. +// See the accompanying file LICENSE or http://www.apache.org/licenses/LICENSE-2.0.html // #ifndef __octree_server__OctreeSendThread__ diff --git a/assignment-client/src/octree/OctreeServer.h b/assignment-client/src/octree/OctreeServer.h index 63d43b6634..bd37b4f896 100644 --- a/assignment-client/src/octree/OctreeServer.h +++ b/assignment-client/src/octree/OctreeServer.h @@ -1,10 +1,12 @@ // // OctreeServer.h -// voxel-server +// assignment-client/src/octree // -// Created by Brad Hefta-Gaub on 8/21/13 -// Copyright (c) 2013 High Fidelity, Inc. All rights reserved. +// Created by Brad Hefta-Gaub on 8/21/13. +// Copyright 2013 High Fidelity, Inc. // +// Distributed under the Apache License, Version 2.0. +// See the accompanying file LICENSE or http://www.apache.org/licenses/LICENSE-2.0.html // #ifndef __octree_server__OctreeServer__ diff --git a/assignment-client/src/octree/OctreeServerConsts.h b/assignment-client/src/octree/OctreeServerConsts.h index fae03a73ca..995a7d5b24 100644 --- a/assignment-client/src/octree/OctreeServerConsts.h +++ b/assignment-client/src/octree/OctreeServerConsts.h @@ -1,9 +1,12 @@ +// // OctreeServerConsts.h -// octree-server +// assignment-client/src/octree // -// Created by Brad Hefta-Gaub on 12/4/13 -// Copyright (c) 2013 High Fidelity, Inc. All rights reserved. +// Created by Brad Hefta-Gaub on 12/4/13. +// Copyright 2013 High Fidelity, Inc. // +// Distributed under the Apache License, Version 2.0. +// See the accompanying file LICENSE or http://www.apache.org/licenses/LICENSE-2.0.html // #ifndef __octree_server__OctreeServerConsts__ diff --git a/assignment-client/src/particles/ParticleNodeData.h b/assignment-client/src/particles/ParticleNodeData.h index 450767613e..d6995ebb0c 100644 --- a/assignment-client/src/particles/ParticleNodeData.h +++ b/assignment-client/src/particles/ParticleNodeData.h @@ -1,10 +1,12 @@ // // ParticleNodeData.h -// hifi +// assignment-client/src/particles // -// Created by Brad Hefta-Gaub on 12/4/13 -// Copyright (c) 2013 High Fidelity, Inc. All rights reserved. +// Created by Brad Hefta-Gaub on 12/4/13. +// Copyright 2013 High Fidelity, Inc. // +// 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__ParticleNodeData__ diff --git a/assignment-client/src/particles/ParticleServer.h b/assignment-client/src/particles/ParticleServer.h index 4e6a896475..8371ba0301 100644 --- a/assignment-client/src/particles/ParticleServer.h +++ b/assignment-client/src/particles/ParticleServer.h @@ -1,10 +1,12 @@ // // ParticleServer.h -// particle-server +// assignment-client/src/particles // -// Created by Brad Hefta-Gaub on 12/2/13 -// Copyright (c) 2013 High Fidelity, Inc. All rights reserved. +// Created by Brad Hefta-Gaub on 12/2/13. +// Copyright 2013 High Fidelity, Inc. // +// Distributed under the Apache License, Version 2.0. +// See the accompanying file LICENSE or http://www.apache.org/licenses/LICENSE-2.0.html // #ifndef __particle_server__ParticleServer__ diff --git a/assignment-client/src/particles/ParticleServerConsts.h b/assignment-client/src/particles/ParticleServerConsts.h index 5ac2a1534b..be9764ffbf 100644 --- a/assignment-client/src/particles/ParticleServerConsts.h +++ b/assignment-client/src/particles/ParticleServerConsts.h @@ -1,9 +1,12 @@ +// // ParticleServerConsts.h -// particle-server +// assignment-client/src/particles // -// Created by Brad Hefta-Gaub on 8/21/13 -// Copyright (c) 2013 High Fidelity, Inc. All rights reserved. +// Created by Brad Hefta-Gaub on 8/21/13. +// Copyright 2013 High Fidelity, Inc. // +// Distributed under the Apache License, Version 2.0. +// See the accompanying file LICENSE or http://www.apache.org/licenses/LICENSE-2.0.html // #ifndef __particle_server__ParticleServerConsts__ diff --git a/assignment-client/src/voxels/VoxelNodeData.h b/assignment-client/src/voxels/VoxelNodeData.h index c24bfad6ce..da6f41c10e 100644 --- a/assignment-client/src/voxels/VoxelNodeData.h +++ b/assignment-client/src/voxels/VoxelNodeData.h @@ -1,9 +1,12 @@ // // VoxelNodeData.h -// hifi +// assignment-client/src/voxels // // Created by Stephen Birarda on 3/21/13. -// Copyright (c) 2014 HighFidelity, Inc. All rights reserved. +// Copyright 2014 High Fidelity, Inc. +// +// 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__VoxelNodeData__ diff --git a/assignment-client/src/voxels/VoxelServer.h b/assignment-client/src/voxels/VoxelServer.h index 2e97736963..2014012f2c 100644 --- a/assignment-client/src/voxels/VoxelServer.h +++ b/assignment-client/src/voxels/VoxelServer.h @@ -1,10 +1,12 @@ // // VoxelServer.h -// voxel-server +// assignment-client/src/voxels // -// Created by Brad Hefta-Gaub on 8/21/13 -// Copyright (c) 2013 High Fidelity, Inc. All rights reserved. +// Created by Brad Hefta-Gaub on 8/21/13. +// Copyright 2013 High Fidelity, Inc. // +// Distributed under the Apache License, Version 2.0. +// See the accompanying file LICENSE or http://www.apache.org/licenses/LICENSE-2.0.html // #ifndef __voxel_server__VoxelServer__ diff --git a/assignment-client/src/voxels/VoxelServerConsts.h b/assignment-client/src/voxels/VoxelServerConsts.h index ce6fd86a32..373a75f1e8 100644 --- a/assignment-client/src/voxels/VoxelServerConsts.h +++ b/assignment-client/src/voxels/VoxelServerConsts.h @@ -1,9 +1,12 @@ +// // VoxelServerConsts.h -// voxel-server +// assignment-client/src/voxels // -// Created by Brad Hefta-Gaub on 8/21/13 -// Copyright (c) 2013 High Fidelity, Inc. All rights reserved. +// Created by Brad Hefta-Gaub on 8/21/13. +// Copyright 2013 High Fidelity, Inc. // +// Distributed under the Apache License, Version 2.0. +// See the accompanying file LICENSE or http://www.apache.org/licenses/LICENSE-2.0.html // #ifndef __voxel_server__VoxelServerConsts__ diff --git a/domain-server/src/DomainServer.h b/domain-server/src/DomainServer.h index 597be7f50d..9a1853bdcc 100644 --- a/domain-server/src/DomainServer.h +++ b/domain-server/src/DomainServer.h @@ -1,9 +1,12 @@ // // DomainServer.h -// hifi +// domain-server/src // // Created by Stephen Birarda on 9/26/13. -// Copyright (c) 2013 HighFidelity, Inc. All rights reserved. +// Copyright 2013 High Fidelity, Inc. +// +// 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__DomainServer__ diff --git a/domain-server/src/DomainServerNodeData.h b/domain-server/src/DomainServerNodeData.h index 20531839f4..6da91c54fb 100644 --- a/domain-server/src/DomainServerNodeData.h +++ b/domain-server/src/DomainServerNodeData.h @@ -1,9 +1,12 @@ // // DomainServerNodeData.h -// hifi +// domain-server/src // // Created by Stephen Birarda on 2/6/2014. -// Copyright (c) 2014 HighFidelity, Inc. All rights reserved. +// Copyright 2014 High Fidelity, Inc. +// +// 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__DomainServerNodeData__ diff --git a/interface/src/AbstractLoggerInterface.h b/interface/src/AbstractLoggerInterface.h index cedab1fad2..647c104743 100644 --- a/interface/src/AbstractLoggerInterface.h +++ b/interface/src/AbstractLoggerInterface.h @@ -1,9 +1,12 @@ // // AbstractLoggerInterface.h -// interface +// interface/src // // Created by Stojce Slavkovski on 12/22/13. -// Copyright (c) 2013 High Fidelity, Inc. All rights reserved. +// Copyright 2013 High Fidelity, Inc. +// +// Distributed under the Apache License, Version 2.0. +// See the accompanying file LICENSE or http://www.apache.org/licenses/LICENSE-2.0.html // #ifndef __interface__AbstractLoggerInterface__ diff --git a/interface/src/Application.h b/interface/src/Application.h index 7c1cb9cab1..e7af91e997 100644 --- a/interface/src/Application.h +++ b/interface/src/Application.h @@ -1,9 +1,12 @@ // // Application.h -// interface +// interface/src // // Created by Andrzej Kapolka on 5/10/13. -// Copyright (c) 2013 High Fidelity, Inc. All rights reserved. +// Copyright 2013 High Fidelity, Inc. +// +// Distributed under the Apache License, Version 2.0. +// See the accompanying file LICENSE or http://www.apache.org/licenses/LICENSE-2.0.html // #ifndef __interface__Application__ diff --git a/interface/src/Audio.h b/interface/src/Audio.h index 88488922f3..647b88a4a9 100644 --- a/interface/src/Audio.h +++ b/interface/src/Audio.h @@ -1,9 +1,12 @@ // // Audio.h -// interface +// interface/src // // Created by Stephen Birarda on 1/22/13. -// Copyright (c) 2013 High Fidelity, Inc. All rights reserved. +// Copyright 2013 High Fidelity, Inc. +// +// Distributed under the Apache License, Version 2.0. +// See the accompanying file LICENSE or http://www.apache.org/licenses/LICENSE-2.0.html // #ifndef __interface__Audio__ diff --git a/interface/src/BuckyBalls.h b/interface/src/BuckyBalls.h index 705f85517f..305ac4640c 100644 --- a/interface/src/BuckyBalls.h +++ b/interface/src/BuckyBalls.h @@ -1,9 +1,12 @@ // // BuckyBalls.h -// hifi +// interface/src // // Created by Philip on 1/2/14. +// Copyright 2013 High Fidelity, Inc. // +// 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__BuckyBalls__ diff --git a/interface/src/Camera.h b/interface/src/Camera.h index 3fd0efd50a..6e4b533cdc 100644 --- a/interface/src/Camera.h +++ b/interface/src/Camera.h @@ -1,8 +1,11 @@ // // Camera.h -// interface +// interface/src // -// Copyright (c) 2013 High Fidelity, Inc. All rights reserved. +// Copyright 2013 High Fidelity, Inc. +// +// Distributed under the Apache License, Version 2.0. +// See the accompanying file LICENSE or http://www.apache.org/licenses/LICENSE-2.0.html // #ifndef __interface__camera__ diff --git a/interface/src/DatagramProcessor.h b/interface/src/DatagramProcessor.h index 722e5a9d41..6a55820e9d 100644 --- a/interface/src/DatagramProcessor.h +++ b/interface/src/DatagramProcessor.h @@ -1,9 +1,12 @@ // // DatagramProcessor.h -// hifi +// interface/src // // Created by Stephen Birarda on 1/23/2014. -// Copyright (c) 2014 HighFidelity, Inc. All rights reserved. +// Copyright 2014 High Fidelity, Inc. +// +// 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__DatagramProcessor__ diff --git a/interface/src/Environment.h b/interface/src/Environment.h index 1c9ee578c3..aca5fac9d8 100644 --- a/interface/src/Environment.h +++ b/interface/src/Environment.h @@ -1,9 +1,12 @@ // // Environment.h -// interface +// interface/src // // Created by Andrzej Kapolka on 5/6/13. -// Copyright (c) 2013 High Fidelity, Inc. All rights reserved. +// Copyright 2013 High Fidelity, Inc. +// +// Distributed under the Apache License, Version 2.0. +// See the accompanying file LICENSE or http://www.apache.org/licenses/LICENSE-2.0.html // #ifndef __interface__Environment__ diff --git a/interface/src/FileLogger.h b/interface/src/FileLogger.h index 35cafa4db7..a65aa3321c 100644 --- a/interface/src/FileLogger.h +++ b/interface/src/FileLogger.h @@ -1,9 +1,12 @@ // // FileLogger.h -// hifi +// interface/src // // Created by Stojce Slavkovski on 12/22/13. +// Copyright 2013 High Fidelity, Inc. // +// 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_FileLogger_h diff --git a/interface/src/GLCanvas.h b/interface/src/GLCanvas.h index f7f7fb7c20..0b75ef5c5f 100644 --- a/interface/src/GLCanvas.h +++ b/interface/src/GLCanvas.h @@ -1,9 +1,12 @@ // // GLCanvas.h -// hifi +// interface/src // // Created by Stephen Birarda on 8/14/13. -// Copyright (c) 2013 HighFidelity, Inc. All rights reserved. +// Copyright 2013 High Fidelity, Inc. +// +// 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__GLCanvas__ diff --git a/interface/src/Menu.h b/interface/src/Menu.h index 7bb0b75675..2b90d4e3c9 100644 --- a/interface/src/Menu.h +++ b/interface/src/Menu.h @@ -1,9 +1,12 @@ // // Menu.h -// hifi +// interface/src // // Created by Stephen Birarda on 8/12/13. -// Copyright (c) 2013 HighFidelity, Inc. All rights reserved. +// Copyright 2013 High Fidelity, Inc. +// +// 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__Menu__ diff --git a/interface/src/MetavoxelSystem.h b/interface/src/MetavoxelSystem.h index ecab30d535..cc6fa6e743 100644 --- a/interface/src/MetavoxelSystem.h +++ b/interface/src/MetavoxelSystem.h @@ -1,9 +1,12 @@ // // MetavoxelSystem.h -// interface +// interface/src // // Created by Andrzej Kapolka on 12/10/13. -// Copyright (c) 2013 High Fidelity, Inc. All rights reserved. +// Copyright 2013 High Fidelity, Inc. +// +// Distributed under the Apache License, Version 2.0. +// See the accompanying file LICENSE or http://www.apache.org/licenses/LICENSE-2.0.html // #ifndef __interface__MetavoxelSystem__ diff --git a/interface/src/ParticleTreeRenderer.h b/interface/src/ParticleTreeRenderer.h index fe346ae730..531cbc23f7 100644 --- a/interface/src/ParticleTreeRenderer.h +++ b/interface/src/ParticleTreeRenderer.h @@ -1,10 +1,12 @@ // // ParticleTreeRenderer.h -// hifi +// interface/src // // Created by Brad Hefta-Gaub on 12/6/13. -// Copyright (c) 2013 High Fidelity, Inc. All rights reserved. +// Copyright 2013 High Fidelity, Inc. // +// 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__ParticleTreeRenderer__ @@ -49,4 +51,4 @@ protected: QMap _particleModels; }; -#endif /* defined(__hifi__ParticleTreeRenderer__) */ \ No newline at end of file +#endif /* defined(__hifi__ParticleTreeRenderer__) */ diff --git a/interface/src/Physics.h b/interface/src/Physics.h index 699497c187..bf1673a0fe 100644 --- a/interface/src/Physics.h +++ b/interface/src/Physics.h @@ -1,9 +1,12 @@ // -// Balls.h -// hifi +// Physics.h +// interface/src // // Created by Philip on 4/25/13. +// Copyright 2013 High Fidelity, Inc. // +// 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_Physics_h diff --git a/interface/src/Stars.h b/interface/src/Stars.h index f6fe7cfb80..b38c1a2748 100755 --- a/interface/src/Stars.h +++ b/interface/src/Stars.h @@ -1,9 +1,12 @@ // -// Stars.h -// interface +// Stars.h +// interface/src // -// Created by Tobias Schwinger on 3/22/13. -// Copyright (c) 2013 High Fidelity, Inc. All rights reserved. +// Created by Tobias Schwinger on 3/22/13. +// Copyright 2013 High Fidelity, Inc. +// +// Distributed under the Apache License, Version 2.0. +// See the accompanying file LICENSE or http://www.apache.org/licenses/LICENSE-2.0.html // #ifndef __interface__Stars__ diff --git a/interface/src/Util.h b/interface/src/Util.h index 732a36b98d..26a3c85e3c 100644 --- a/interface/src/Util.h +++ b/interface/src/Util.h @@ -1,9 +1,12 @@ // // Util.h -// interface +// interface/src // // Created by Philip Rosedale on 8/24/12. -// Copyright (c) 2012 High Fidelity, Inc. All rights reserved. +// Copyright 2012 High Fidelity, Inc. +// +// Distributed under the Apache License, Version 2.0. +// See the accompanying file LICENSE or http://www.apache.org/licenses/LICENSE-2.0.html // #ifndef __interface__Util__ diff --git a/interface/src/XmppClient.h b/interface/src/XmppClient.h index 905d6e64fb..ac724a4d68 100644 --- a/interface/src/XmppClient.h +++ b/interface/src/XmppClient.h @@ -1,9 +1,12 @@ // // XmppClient.h -// interface +// interface/src // -// Created by Dimitar Dobrev on 10/3/14 -// Copyright (c) 2013 High Fidelity, Inc. All rights reserved. +// Created by Dimitar Dobrev on 10/3/14. +// Copyright 2013 High Fidelity, Inc. +// +// Distributed under the Apache License, Version 2.0. +// See the accompanying file LICENSE or http://www.apache.org/licenses/LICENSE-2.0.html // #ifdef HAVE_QXMPP diff --git a/interface/src/avatar/Avatar.h b/interface/src/avatar/Avatar.h index f57982b514..a1bc7ad0bd 100755 --- a/interface/src/avatar/Avatar.h +++ b/interface/src/avatar/Avatar.h @@ -1,8 +1,11 @@ // // Avatar.h -// interface +// interface/src/avatar // -// Copyright (c) 2012 High Fidelity, Inc. All rights reserved. +// Copyright 2012 High Fidelity, Inc. +// +// Distributed under the Apache License, Version 2.0. +// See the accompanying file LICENSE or http://www.apache.org/licenses/LICENSE-2.0.html // #ifndef __interface__avatar__ diff --git a/interface/src/avatar/AvatarManager.h b/interface/src/avatar/AvatarManager.h index bd04dddb78..db3c9dbf44 100644 --- a/interface/src/avatar/AvatarManager.h +++ b/interface/src/avatar/AvatarManager.h @@ -1,9 +1,12 @@ // // AvatarManager.h -// hifi +// interface/src/avatar // // Created by Stephen Birarda on 1/23/2014. -// Copyright (c) 2014 HighFidelity, Inc. All rights reserved. +// Copyright 2014 High Fidelity, Inc. +// +// 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__AvatarManager__ diff --git a/interface/src/avatar/FaceModel.h b/interface/src/avatar/FaceModel.h index d675495e6b..3fec640bdd 100644 --- a/interface/src/avatar/FaceModel.h +++ b/interface/src/avatar/FaceModel.h @@ -1,9 +1,12 @@ // // FaceModel.h -// interface +// interface/src/avatar // // Created by Andrzej Kapolka on 9/16/13. -// Copyright (c) 2013 High Fidelity, Inc. All rights reserved. +// Copyright 2013 High Fidelity, Inc. +// +// Distributed under the Apache License, Version 2.0. +// See the accompanying file LICENSE or http://www.apache.org/licenses/LICENSE-2.0.html // #ifndef __interface__FaceModel__ diff --git a/interface/src/avatar/Hand.h b/interface/src/avatar/Hand.h index 3be3bc0f77..f3054a7080 100755 --- a/interface/src/avatar/Hand.h +++ b/interface/src/avatar/Hand.h @@ -1,8 +1,11 @@ // // Hand.h -// interface +// interface/src/avatar // -// Copyright (c) 2013 High Fidelity, Inc. All rights reserved. +// Copyright 2013 High Fidelity, Inc. +// +// 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_Hand_h diff --git a/interface/src/avatar/Head.h b/interface/src/avatar/Head.h index 36ab6a9229..f4840121a6 100644 --- a/interface/src/avatar/Head.h +++ b/interface/src/avatar/Head.h @@ -1,8 +1,11 @@ // // Head.h -// interface +// interface/src/avatar // -// Copyright (c) 2013 High Fidelity, Inc. All rights reserved. +// Copyright 2013 High Fidelity, Inc. +// +// 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_Head_h diff --git a/interface/src/avatar/MyAvatar.h b/interface/src/avatar/MyAvatar.h index 2125b126b3..d0589687df 100644 --- a/interface/src/avatar/MyAvatar.h +++ b/interface/src/avatar/MyAvatar.h @@ -1,9 +1,12 @@ // // MyAvatar.h -// interface +// interface/src/avatar // // Created by Mark Peng on 8/16/13. -// Copyright (c) 2012 High Fidelity, Inc. All rights reserved. +// Copyright 2012 High Fidelity, Inc. +// +// Distributed under the Apache License, Version 2.0. +// See the accompanying file LICENSE or http://www.apache.org/licenses/LICENSE-2.0.html // #ifndef __interface__myavatar__ diff --git a/interface/src/avatar/SkeletonModel.h b/interface/src/avatar/SkeletonModel.h index 31867dec5c..b3a7c4c7e4 100644 --- a/interface/src/avatar/SkeletonModel.h +++ b/interface/src/avatar/SkeletonModel.h @@ -1,9 +1,12 @@ // // SkeletonModel.h -// interface +// interface/src/avatar // // Created by Andrzej Kapolka on 10/17/13. -// Copyright (c) 2013 High Fidelity, Inc. All rights reserved. +// Copyright 2013 High Fidelity, Inc. +// +// Distributed under the Apache License, Version 2.0. +// See the accompanying file LICENSE or http://www.apache.org/licenses/LICENSE-2.0.html // #ifndef __interface__SkeletonModel__ diff --git a/interface/src/devices/Faceshift.h b/interface/src/devices/Faceshift.h index f878056b57..abac2c74a1 100644 --- a/interface/src/devices/Faceshift.h +++ b/interface/src/devices/Faceshift.h @@ -1,9 +1,12 @@ // // Faceshift.h -// interface +// interface/src/devices // // Created by Andrzej Kapolka on 9/3/13. -// Copyright (c) 2013 High Fidelity, Inc. All rights reserved. +// Copyright 2013 High Fidelity, Inc. +// +// Distributed under the Apache License, Version 2.0. +// See the accompanying file LICENSE or http://www.apache.org/licenses/LICENSE-2.0.html // #ifndef __interface__Faceshift__ diff --git a/interface/src/devices/OculusManager.h b/interface/src/devices/OculusManager.h index b3cd400ac8..7927c84341 100644 --- a/interface/src/devices/OculusManager.h +++ b/interface/src/devices/OculusManager.h @@ -1,9 +1,12 @@ // // OculusManager.h -// hifi +// interface/src/devices // // Created by Stephen Birarda on 5/9/13. -// Copyright (c) 2012 High Fidelity, Inc. All rights reserved. +// Copyright 2012 High Fidelity, Inc. +// +// 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__OculusManager__ diff --git a/interface/src/devices/SixenseManager.h b/interface/src/devices/SixenseManager.h index de4cccb399..24c37a027f 100644 --- a/interface/src/devices/SixenseManager.h +++ b/interface/src/devices/SixenseManager.h @@ -1,9 +1,12 @@ // // SixenseManager.h -// interface +// interface/src/devices // // Created by Andrzej Kapolka on 11/15/13. -// Copyright (c) 2013 High Fidelity, Inc. All rights reserved. +// Copyright 2013 High Fidelity, Inc. +// +// Distributed under the Apache License, Version 2.0. +// See the accompanying file LICENSE or http://www.apache.org/licenses/LICENSE-2.0.html // #ifndef __interface__SixenseManager__ diff --git a/interface/src/devices/TV3DManager.h b/interface/src/devices/TV3DManager.h index edea489745..aa1f927676 100644 --- a/interface/src/devices/TV3DManager.h +++ b/interface/src/devices/TV3DManager.h @@ -1,9 +1,12 @@ // // TV3DManager.h -// hifi +// interface/src/devices // -// Created by Brad Hefta-Gaub on 12/24/2013 -// Copyright (c) 2013 High Fidelity, Inc. All rights reserved. +// Created by Brad Hefta-Gaub on 12/24/2013. +// Copyright 2013 High Fidelity, Inc. +// +// 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__TV3DManager__ diff --git a/interface/src/devices/Visage.h b/interface/src/devices/Visage.h index 6e98abbb61..02cceb8afa 100644 --- a/interface/src/devices/Visage.h +++ b/interface/src/devices/Visage.h @@ -1,9 +1,12 @@ // // Visage.h -// interface +// interface/src/devices // // Created by Andrzej Kapolka on 2/11/14. -// Copyright (c) 2014 High Fidelity, Inc. All rights reserved. +// Copyright 2014 High Fidelity, Inc. +// +// Distributed under the Apache License, Version 2.0. +// See the accompanying file LICENSE or http://www.apache.org/licenses/LICENSE-2.0.html // #ifndef __interface__Visage__ diff --git a/interface/src/location/LocationManager.h b/interface/src/location/LocationManager.h index a6bdaf66b4..cda64e5058 100644 --- a/interface/src/location/LocationManager.h +++ b/interface/src/location/LocationManager.h @@ -1,9 +1,12 @@ // // LocationManager.h -// hifi +// interface/src/location // // Created by Stojce Slavkovski on 2/7/14. +// Copyright 2013 High Fidelity, Inc. // +// 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__LocationManager__ diff --git a/interface/src/location/NamedLocation.h b/interface/src/location/NamedLocation.h index 81af03b45e..7aa020f8e9 100644 --- a/interface/src/location/NamedLocation.h +++ b/interface/src/location/NamedLocation.h @@ -1,9 +1,12 @@ // // NamedLocation.h -// hifi +// interface/src/location // // Created by Stojce Slavkovski on 2/1/14. +// Copyright 2013 High Fidelity, Inc. // +// 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__NamedLocation__ diff --git a/interface/src/renderer/AmbientOcclusionEffect.h b/interface/src/renderer/AmbientOcclusionEffect.h index e56164bad4..1711b89d16 100644 --- a/interface/src/renderer/AmbientOcclusionEffect.h +++ b/interface/src/renderer/AmbientOcclusionEffect.h @@ -1,9 +1,12 @@ // // AmbientOcclusionEffect.h -// interface +// interface/src/renderer // // Created by Andrzej Kapolka on 7/14/13. -// Copyright (c) 2013 High Fidelity, Inc. All rights reserved. +// Copyright 2013 High Fidelity, Inc. +// +// Distributed under the Apache License, Version 2.0. +// See the accompanying file LICENSE or http://www.apache.org/licenses/LICENSE-2.0.html // #ifndef __interface__AmbientOcclusionEffect__ diff --git a/interface/src/renderer/FBXReader.h b/interface/src/renderer/FBXReader.h index 2847d2a971..85ca23c53f 100644 --- a/interface/src/renderer/FBXReader.h +++ b/interface/src/renderer/FBXReader.h @@ -1,9 +1,12 @@ // // FBXReader.h -// interface +// interface/src/renderer // // Created by Andrzej Kapolka on 9/18/13. -// Copyright (c) 2013 High Fidelity, Inc. All rights reserved. +// Copyright 2013 High Fidelity, Inc. +// +// Distributed under the Apache License, Version 2.0. +// See the accompanying file LICENSE or http://www.apache.org/licenses/LICENSE-2.0.html // #ifndef __interface__FBXReader__ diff --git a/interface/src/renderer/GeometryCache.h b/interface/src/renderer/GeometryCache.h index 252a0c401b..ea6b3c2e0f 100644 --- a/interface/src/renderer/GeometryCache.h +++ b/interface/src/renderer/GeometryCache.h @@ -1,9 +1,12 @@ // // GeometryCache.h -// interface +// interface/src/renderer // // Created by Andrzej Kapolka on 6/21/13. -// Copyright (c) 2013 High Fidelity, Inc. All rights reserved. +// Copyright 2013 High Fidelity, Inc. +// +// Distributed under the Apache License, Version 2.0. +// See the accompanying file LICENSE or http://www.apache.org/licenses/LICENSE-2.0.html // #ifndef __interface__GeometryCache__ diff --git a/interface/src/renderer/GlowEffect.h b/interface/src/renderer/GlowEffect.h index 65d3d6c8ce..cf635083c6 100644 --- a/interface/src/renderer/GlowEffect.h +++ b/interface/src/renderer/GlowEffect.h @@ -1,9 +1,12 @@ // // GlowEffect.h -// interface +// interface/src/renderer // // Created by Andrzej Kapolka on 8/7/13. -// Copyright (c) 2013 High Fidelity, Inc. All rights reserved. +// Copyright 2013 High Fidelity, Inc. +// +// Distributed under the Apache License, Version 2.0. +// See the accompanying file LICENSE or http://www.apache.org/licenses/LICENSE-2.0.html // #ifndef __interface__GlowEffect__ diff --git a/interface/src/renderer/Model.h b/interface/src/renderer/Model.h index 134a3e2172..dea5e3aa59 100644 --- a/interface/src/renderer/Model.h +++ b/interface/src/renderer/Model.h @@ -1,9 +1,12 @@ // // Model.h -// interface +// interface/src/renderer // // Created by Andrzej Kapolka on 10/18/13. -// Copyright (c) 2013 High Fidelity, Inc. All rights reserved. +// Copyright 2013 High Fidelity, Inc. +// +// Distributed under the Apache License, Version 2.0. +// See the accompanying file LICENSE or http://www.apache.org/licenses/LICENSE-2.0.html // #ifndef __interface__Model__ diff --git a/interface/src/renderer/PointShader.h b/interface/src/renderer/PointShader.h index b7e1b8c008..f67e2239cc 100644 --- a/interface/src/renderer/PointShader.h +++ b/interface/src/renderer/PointShader.h @@ -1,9 +1,12 @@ // // PointShader.h -// interface +// interface/src/renderer // // Created by Brad Hefta-Gaub on 10/30/13. -// Copyright (c) 2013 High Fidelity, Inc. All rights reserved. +// Copyright 2013 High Fidelity, Inc. +// +// Distributed under the Apache License, Version 2.0. +// See the accompanying file LICENSE or http://www.apache.org/licenses/LICENSE-2.0.html // #ifndef __interface__PointShader__ diff --git a/interface/src/renderer/ProgramObject.h b/interface/src/renderer/ProgramObject.h index 78f07b7a1b..3c902cd215 100644 --- a/interface/src/renderer/ProgramObject.h +++ b/interface/src/renderer/ProgramObject.h @@ -1,9 +1,12 @@ // // ProgramObject.h -// interface +// interface/src/renderer // // Created by Andrzej Kapolka on 5/7/13. -// Copyright (c) 2013 High Fidelity, Inc. All rights reserved. +// Copyright 2013 High Fidelity, Inc. +// +// Distributed under the Apache License, Version 2.0. +// See the accompanying file LICENSE or http://www.apache.org/licenses/LICENSE-2.0.html // #ifndef __interface__ProgramObject__ diff --git a/interface/src/renderer/RenderUtil.h b/interface/src/renderer/RenderUtil.h index 5e7e9b5d64..fb71f46e9e 100644 --- a/interface/src/renderer/RenderUtil.h +++ b/interface/src/renderer/RenderUtil.h @@ -1,9 +1,12 @@ // // RenderUtil.h -// interface +// interface/src/renderer // // Created by Andrzej Kapolka on 8/15/13. -// Copyright (c) 2013 High Fidelity, Inc. All rights reserved. +// Copyright 2013 High Fidelity, Inc. +// +// Distributed under the Apache License, Version 2.0. +// See the accompanying file LICENSE or http://www.apache.org/licenses/LICENSE-2.0.html // #ifndef __interface__RenderUtil__ diff --git a/interface/src/renderer/TextureCache.h b/interface/src/renderer/TextureCache.h index dc874ab7b0..d8884c310f 100644 --- a/interface/src/renderer/TextureCache.h +++ b/interface/src/renderer/TextureCache.h @@ -1,9 +1,12 @@ // // TextureCache.h -// interface +// interface/src/renderer // // Created by Andrzej Kapolka on 8/6/13. -// Copyright (c) 2013 High Fidelity, Inc. All rights reserved. +// Copyright 2013 High Fidelity, Inc. +// +// Distributed under the Apache License, Version 2.0. +// See the accompanying file LICENSE or http://www.apache.org/licenses/LICENSE-2.0.html // #ifndef __interface__TextureCache__ diff --git a/interface/src/renderer/VoxelShader.h b/interface/src/renderer/VoxelShader.h index 33e8ea0073..4d8a4c749c 100644 --- a/interface/src/renderer/VoxelShader.h +++ b/interface/src/renderer/VoxelShader.h @@ -1,9 +1,12 @@ // // VoxelShader.h -// interface +// interface/src/renderer // // Created by Brad Hefta-Gaub on 9/23/13. -// Copyright (c) 2013 High Fidelity, Inc. All rights reserved. +// Copyright 2013 High Fidelity, Inc. +// +// Distributed under the Apache License, Version 2.0. +// See the accompanying file LICENSE or http://www.apache.org/licenses/LICENSE-2.0.html // #ifndef __interface__VoxelShader__ diff --git a/interface/src/scripting/AudioDeviceScriptingInterface.h b/interface/src/scripting/AudioDeviceScriptingInterface.h index adc86cb15c..0495517139 100644 --- a/interface/src/scripting/AudioDeviceScriptingInterface.h +++ b/interface/src/scripting/AudioDeviceScriptingInterface.h @@ -1,9 +1,12 @@ // // AudioDeviceScriptingInterface.h -// hifi +// interface/src/scripting // -// Created by Brad Hefta-Gaub on 3/22/14 -// Copyright (c) 2014 HighFidelity, Inc. All rights reserved. +// Created by Brad Hefta-Gaub on 3/22/14. +// Copyright 2014 High Fidelity, Inc. +// +// 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__AudioDeviceScriptingInterface__ diff --git a/interface/src/scripting/ClipboardScriptingInterface.h b/interface/src/scripting/ClipboardScriptingInterface.h index 78e72d6de0..16872b1952 100644 --- a/interface/src/scripting/ClipboardScriptingInterface.h +++ b/interface/src/scripting/ClipboardScriptingInterface.h @@ -1,10 +1,11 @@ // // ClipboardScriptingInterface.h -// interface +// interface/src/scripting // -// Copyright (c) 2014 High Fidelity, Inc. All rights reserved. +// Copyright 2014 High Fidelity, Inc. // -// Scriptable interface for the Application clipboard +// Distributed under the Apache License, Version 2.0. +// See the accompanying file LICENSE or http://www.apache.org/licenses/LICENSE-2.0.html // #ifndef __interface__Clipboard__ diff --git a/interface/src/scripting/ControllerScriptingInterface.h b/interface/src/scripting/ControllerScriptingInterface.h index ada146ff02..ebe5f4d943 100644 --- a/interface/src/scripting/ControllerScriptingInterface.h +++ b/interface/src/scripting/ControllerScriptingInterface.h @@ -1,9 +1,12 @@ // // ControllerScriptingInterface.h -// hifi +// interface/src/scripting // -// Created by Brad Hefta-Gaub on 12/17/13 -// Copyright (c) 2013 HighFidelity, Inc. All rights reserved. +// Created by Brad Hefta-Gaub on 12/17/13. +// Copyright 2013 High Fidelity, Inc. +// +// 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__ControllerScriptingInterface__ diff --git a/interface/src/scripting/MenuScriptingInterface.h b/interface/src/scripting/MenuScriptingInterface.h index a4496e3054..15042fd355 100644 --- a/interface/src/scripting/MenuScriptingInterface.h +++ b/interface/src/scripting/MenuScriptingInterface.h @@ -1,9 +1,12 @@ // // MenuScriptingInterface.h -// hifi +// interface/src/scripting // -// Created by Brad Hefta-Gaub on 2/25/14 -// Copyright (c) 2014 HighFidelity, Inc. All rights reserved. +// Created by Brad Hefta-Gaub on 2/25/14. +// Copyright 2014 High Fidelity, Inc. +// +// 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__MenuScriptingInterface__ diff --git a/interface/src/scripting/SettingsScriptingInterface.h b/interface/src/scripting/SettingsScriptingInterface.h index 12bda2173f..84855c1b3c 100644 --- a/interface/src/scripting/SettingsScriptingInterface.h +++ b/interface/src/scripting/SettingsScriptingInterface.h @@ -1,9 +1,12 @@ // // SettingsScriptingInterface.h -// hifi +// interface/src/scripting // -// Created by Brad Hefta-Gaub on 3/22/14 -// Copyright (c) 2014 HighFidelity, Inc. All rights reserved. +// Created by Brad Hefta-Gaub on 3/22/14. +// Copyright 2014 High Fidelity, Inc. +// +// 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__SettingsScriptingInterface__ diff --git a/interface/src/starfield/Config.h b/interface/src/starfield/Config.h index b92aec9a4c..6f44f24093 100755 --- a/interface/src/starfield/Config.h +++ b/interface/src/starfield/Config.h @@ -1,16 +1,12 @@ // -// starfield/Config.h -// interface +// Config.h +// interface/src/starfield // -// Created by Tobias Schwinger on 3/29/13. -// Copyright (c) 2013 High Fidelity, Inc. All rights reserved. +// Created by Tobias Schwinger on 3/29/13. +// Copyright 2013 High Fidelity, Inc. // - -#ifndef __interface__starfield__Config__ -#define __interface__starfield__Config__ - -// -// Dependencies: +// Distributed under the Apache License, Version 2.0. +// See the accompanying file LICENSE or http://www.apache.org/licenses/LICENSE-2.0.html // #include "InterfaceConfig.h" diff --git a/interface/src/starfield/Controller.h b/interface/src/starfield/Controller.h index 5403d2fb75..12963fa2e2 100755 --- a/interface/src/starfield/Controller.h +++ b/interface/src/starfield/Controller.h @@ -1,10 +1,12 @@ // -// starfield/Controller.h -// interface +// Controller.h +// interface/src/starfield // -// Created by Tobias Schwinger on 3/29/13. -// Modified by Chris Barnard 10/16/13. -// Copyright (c) 2013 High Fidelity, Inc. All rights reserved. +// Created by Tobias Schwinger on 3/29/13. +// Copyright 2013 High Fidelity, Inc. +// +// Distributed under the Apache License, Version 2.0. +// See the accompanying file LICENSE or http://www.apache.org/licenses/LICENSE-2.0.html // #ifndef __interface__starfield__Controller__ diff --git a/interface/src/starfield/Generator.h b/interface/src/starfield/Generator.h index 1029bd6a52..238ff99f80 100644 --- a/interface/src/starfield/Generator.h +++ b/interface/src/starfield/Generator.h @@ -1,9 +1,12 @@ // -// starfield/Generator.h -// interface +// Generator.h +// interface/src/starfield // -// Created by Chris Barnard on 10/13/13. -// Copyright (c) 2013 High Fidelity, Inc. All rights reserved. +// Created by Chris Barnard on 10/13/13. +// Copyright 2013 High Fidelity, Inc. +// +// Distributed under the Apache License, Version 2.0. +// See the accompanying file LICENSE or http://www.apache.org/licenses/LICENSE-2.0.html // #ifndef __interface__starfield__Generator__ @@ -34,4 +37,4 @@ namespace starfield { }; } -#endif \ No newline at end of file +#endif diff --git a/interface/src/starfield/data/GpuVertex.h b/interface/src/starfield/data/GpuVertex.h index 39eeb19634..7c435a559f 100755 --- a/interface/src/starfield/data/GpuVertex.h +++ b/interface/src/starfield/data/GpuVertex.h @@ -1,10 +1,12 @@ // -// starfield/data/GpuVertex.h -// interface +// GpuVertex.h +// interface/src/starfield/data // -// Created by Tobias Schwinger on 3/29/13. -// Modified 10/17/13 Chris Barnard. -// Copyright (c) 2013 High Fidelity, Inc. All rights reserved. +// Created by Tobias Schwinger on 3/29/13. +// Copyright 2013 High Fidelity, Inc. +// +// Distributed under the Apache License, Version 2.0. +// See the accompanying file LICENSE or http://www.apache.org/licenses/LICENSE-2.0.html // #ifndef __interface__starfield__data__GpuVertex__ diff --git a/interface/src/starfield/data/InputVertex.h b/interface/src/starfield/data/InputVertex.h index d8c21a37a2..01b15c297f 100755 --- a/interface/src/starfield/data/InputVertex.h +++ b/interface/src/starfield/data/InputVertex.h @@ -1,10 +1,12 @@ // -// starfield/data/InputVertex.h -// interface +// InputVertex.h +// interface/src/starfield/data // -// Created by Tobias Schwinger on 3/29/13. -// Modified by Chris Barnard 10/17/13. -// Copyright (c) 2013 High Fidelity, Inc. All rights reserved. +// Created by Tobias Schwinger on 3/29/13. +// Copyright 2013 High Fidelity, Inc. +// +// Distributed under the Apache License, Version 2.0. +// See the accompanying file LICENSE or http://www.apache.org/licenses/LICENSE-2.0.html // #ifndef __interface__starfield__data__InputVertex__ diff --git a/interface/src/starfield/data/Tile.h b/interface/src/starfield/data/Tile.h index bdef4e612f..17e737af38 100755 --- a/interface/src/starfield/data/Tile.h +++ b/interface/src/starfield/data/Tile.h @@ -1,9 +1,12 @@ // -// starfield/data/Tile.h -// interface +// Tile.h +// interface/src/starfield/data // -// Created by Tobias Schwinger on 3/22/13. -// Copyright (c) 2013 High Fidelity, Inc. All rights reserved. +// Created by Tobias Schwinger on 3/22/13. +// Copyright 2013 High Fidelity, Inc. +// +// Distributed under the Apache License, Version 2.0. +// See the accompanying file LICENSE or http://www.apache.org/licenses/LICENSE-2.0.html // #ifndef __interface__starfield__data__Tile__ diff --git a/interface/src/starfield/renderer/Renderer.h b/interface/src/starfield/renderer/Renderer.h index 7504dd0182..7eaeb1444e 100755 --- a/interface/src/starfield/renderer/Renderer.h +++ b/interface/src/starfield/renderer/Renderer.h @@ -1,58 +1,12 @@ // -// starfield/renderer/Renderer.h -// interface +// Renderer.h +// interface/src/starfield/renderer // -// Created by Tobias Schwinger on 3/22/13. -// Modified 10/17/13 Chris Barnard. -// Copyright (c) 2013 High Fidelity, Inc. All rights reserved. +// Created by Tobias Schwinger on 3/22/13. +// Copyright 2013 High Fidelity, Inc. // - -#ifndef __interface__starfield__renderer__Renderer__ -#define __interface__starfield__renderer__Renderer__ - -#include "starfield/Config.h" -#include "starfield/data/InputVertex.h" -#include "starfield/data/Tile.h" -#include "starfield/data/GpuVertex.h" -#include "starfield/renderer/Tiling.h" - -// -// FOV culling -// =========== -// -// As stars can be thought of as at infinity distance, the field of view only -// depends on perspective and rotation: -// -// _----_ <-- visible stars -// from above +-near-+ - - -// \ / | -// near width: \ / | cos(p/2) -// 2sin(p/2) \/ _ -// center -// -// -// Now it is important to note that a change in altitude maps uniformly to a -// distance on a sphere. This is NOT the case for azimuthal angles: In this -// case a factor of 'cos(alt)' (the orbital radius) applies: -// -// -// |<-cos alt ->| | |<-|<----->|->| d_azi cos(alt) -// | -// __--* | --------- - -// __-- * | | | ^ d_alt -// __-- alt) * | | | v -// --------------*- | ------------- - -// | -// side view | tile on sphere -// -// -// This lets us find a worst-case (Eigen) angle from the center to the edge -// of a tile as -// -// hypot( 0.5 d_alt, 0.5 d_azi cos(alt_absmin) ). -// -// This angle must be added to 'p' (the perspective angle) in order to find -// an altered near plane for the culling decision. +// Distributed under the Apache License, Version 2.0. +// See the accompanying file LICENSE or http://www.apache.org/licenses/LICENSE-2.0.html // namespace starfield { diff --git a/interface/src/starfield/renderer/Tiling.h b/interface/src/starfield/renderer/Tiling.h index d4a1446690..91547d87ca 100755 --- a/interface/src/starfield/renderer/Tiling.h +++ b/interface/src/starfield/renderer/Tiling.h @@ -1,9 +1,12 @@ // -// starfield/renderer/Tiling.h -// interface +// Tiling.h +// interface/src/starfield/renderer // -// Created by Tobias Schwinger on 3/22/13. -// Copyright (c) 2013 High Fidelity, Inc. All rights reserved. +// Created by Tobias Schwinger on 3/22/13. +// Copyright 2013 High Fidelity, Inc. +// +// Distributed under the Apache License, Version 2.0. +// See the accompanying file LICENSE or http://www.apache.org/licenses/LICENSE-2.0.html // #ifndef __interface__starfield__renderer__Tiling__ diff --git a/interface/src/starfield/renderer/VertexOrder.h b/interface/src/starfield/renderer/VertexOrder.h index 85c738ce0d..704af857cf 100755 --- a/interface/src/starfield/renderer/VertexOrder.h +++ b/interface/src/starfield/renderer/VertexOrder.h @@ -1,9 +1,12 @@ // -// starfield/renderer/VertexOrder.h -// interface +// VertexOrder.h +// interface/src/starfield/renderer // -// Created by Tobias Schwinger on 3/22/13. -// Copyright (c) 2013 High Fidelity, Inc. All rights reserved. +// Created by Tobias Schwinger on 3/22/13. +// Copyright 2013 High Fidelity, Inc. +// +// Distributed under the Apache License, Version 2.0. +// See the accompanying file LICENSE or http://www.apache.org/licenses/LICENSE-2.0.html // #ifndef __interface__starfield__renderer__VertexOrder__ diff --git a/interface/src/ui/BandwidthDialog.h b/interface/src/ui/BandwidthDialog.h index a702b1be23..51ed3453cd 100644 --- a/interface/src/ui/BandwidthDialog.h +++ b/interface/src/ui/BandwidthDialog.h @@ -1,9 +1,12 @@ // // BandwidthDialog.h -// interface +// interface/src/ui // // Created by Tobias Schwinger on 6/21/13. -// Copyright (c) 2013 High Fidelity, Inc. All rights reserved. +// Copyright 2013 High Fidelity, Inc. +// +// 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__BandwidthDialog__ diff --git a/interface/src/ui/BandwidthMeter.h b/interface/src/ui/BandwidthMeter.h index c1577da8e4..830bc6502d 100644 --- a/interface/src/ui/BandwidthMeter.h +++ b/interface/src/ui/BandwidthMeter.h @@ -1,9 +1,12 @@ // // BandwidthMeter.h -// interface +// interface/src/ui // // Created by Tobias Schwinger on 6/20/13. -// Copyright (c) 2013 High Fidelity, Inc. All rights reserved. +// Copyright 2013 High Fidelity, Inc. +// +// Distributed under the Apache License, Version 2.0. +// See the accompanying file LICENSE or http://www.apache.org/licenses/LICENSE-2.0.html // #ifndef __interface__BandwidthMeter__ diff --git a/interface/src/ui/ChatWindow.h b/interface/src/ui/ChatWindow.h index da8d423b9d..9ab17c067b 100644 --- a/interface/src/ui/ChatWindow.h +++ b/interface/src/ui/ChatWindow.h @@ -1,9 +1,12 @@ // // ChatWindow.h -// interface +// interface/src/ui // // Created by Dimitar Dobrev on 3/6/14. -// Copyright (c) 2014 High Fidelity, Inc. All rights reserved. +// Copyright 2014 High Fidelity, Inc. +// +// Distributed under the Apache License, Version 2.0. +// See the accompanying file LICENSE or http://www.apache.org/licenses/LICENSE-2.0.html // #ifndef __interface__ChatWindow__ diff --git a/interface/src/ui/ImportDialog.h b/interface/src/ui/ImportDialog.h index 278fac932d..dc707395de 100644 --- a/interface/src/ui/ImportDialog.h +++ b/interface/src/ui/ImportDialog.h @@ -1,9 +1,12 @@ // // ImportDialog.h -// hifi +// interface/src/ui // // Created by Clement Brisset on 8/12/13. -// Copyright (c) 2013 High Fidelity, Inc. All rights reserved. +// Copyright 2013 High Fidelity, Inc. +// +// 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__ImportDialog__ diff --git a/interface/src/ui/InfoView.h b/interface/src/ui/InfoView.h index 009587c1d5..a400e8dacf 100644 --- a/interface/src/ui/InfoView.h +++ b/interface/src/ui/InfoView.h @@ -1,9 +1,12 @@ // // InfoView.h -// hifi +// interface/src/ui // // Created by Stojce Slavkovski on 9/7/13. -// Copyright (c) 2013 HighFidelity, Inc. All rights reserved. +// Copyright 2013 High Fidelity, Inc. +// +// 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__InfoView__ diff --git a/interface/src/ui/LodToolsDialog.h b/interface/src/ui/LodToolsDialog.h index 98a5fce5f8..200fb44ca1 100644 --- a/interface/src/ui/LodToolsDialog.h +++ b/interface/src/ui/LodToolsDialog.h @@ -1,9 +1,12 @@ // // LodToolsDialog.h -// interface +// interface/src/ui // // Created by Brad Hefta-Gaub on 7/19/13. -// Copyright (c) 2013 High Fidelity, Inc. All rights reserved. +// Copyright 2013 High Fidelity, Inc. +// +// 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__LodToolsDialog__ diff --git a/interface/src/ui/LogDialog.h b/interface/src/ui/LogDialog.h index 5138e231c7..c4d4676189 100644 --- a/interface/src/ui/LogDialog.h +++ b/interface/src/ui/LogDialog.h @@ -1,9 +1,12 @@ // // LogDialog.h -// interface +// interface/src/ui // // Created by Stojce Slavkovski on 12/12/13. -// Copyright (c) 2013 High Fidelity, Inc. All rights reserved. +// Copyright 2013 High Fidelity, Inc. +// +// Distributed under the Apache License, Version 2.0. +// See the accompanying file LICENSE or http://www.apache.org/licenses/LICENSE-2.0.html // #ifndef __interface__LogDialog__ diff --git a/interface/src/ui/MetavoxelEditor.h b/interface/src/ui/MetavoxelEditor.h index 7f3521bd1a..f0e8dff7ec 100644 --- a/interface/src/ui/MetavoxelEditor.h +++ b/interface/src/ui/MetavoxelEditor.h @@ -1,9 +1,12 @@ // // MetavoxelEditor.h -// interface +// interface/src/ui // // Created by Andrzej Kapolka on 1/21/14. -// Copyright (c) 2014 High Fidelity, Inc. All rights reserved. +// Copyright 2014 High Fidelity, Inc. +// +// Distributed under the Apache License, Version 2.0. +// See the accompanying file LICENSE or http://www.apache.org/licenses/LICENSE-2.0.html // #ifndef __interface__MetavoxelEditor__ diff --git a/interface/src/ui/ModelsBrowser.h b/interface/src/ui/ModelsBrowser.h index 30320de1c1..01b3e2e405 100644 --- a/interface/src/ui/ModelsBrowser.h +++ b/interface/src/ui/ModelsBrowser.h @@ -1,9 +1,12 @@ // // ModelsBrowser.h -// hifi +// interface/src/ui // // Created by Clement on 3/17/14. -// Copyright (c) 2014 HighFidelity, Inc. All rights reserved. +// Copyright 2014 High Fidelity, Inc. +// +// 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__ModelsBrowser__ diff --git a/interface/src/ui/OctreeStatsDialog.h b/interface/src/ui/OctreeStatsDialog.h index ef190e6a52..0a0d7af5fd 100644 --- a/interface/src/ui/OctreeStatsDialog.h +++ b/interface/src/ui/OctreeStatsDialog.h @@ -1,9 +1,12 @@ // // OctreeStatsDialog.h -// interface +// interface/src/ui // // Created by Brad Hefta-Gaub on 7/19/13. -// Copyright (c) 2013 High Fidelity, Inc. All rights reserved. +// Copyright 2013 High Fidelity, Inc. +// +// 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__OctreeStatsDialog__ diff --git a/interface/src/ui/Oscilloscope.h b/interface/src/ui/Oscilloscope.h index a245f79f05..d51a1d8242 100644 --- a/interface/src/ui/Oscilloscope.h +++ b/interface/src/ui/Oscilloscope.h @@ -1,9 +1,12 @@ // // Oscilloscope.h -// interface +// interface/src/ui // // Created by Philip on 1/28/13. -// Copyright (c) 2013 High Fidelity, Inc. All rights reserved. +// Copyright 2013 High Fidelity, Inc. +// +// Distributed under the Apache License, Version 2.0. +// See the accompanying file LICENSE or http://www.apache.org/licenses/LICENSE-2.0.html // #ifndef __interface__Oscilloscope__ diff --git a/interface/src/ui/RearMirrorTools.h b/interface/src/ui/RearMirrorTools.h index 007b54f129..f410b0b5ff 100644 --- a/interface/src/ui/RearMirrorTools.h +++ b/interface/src/ui/RearMirrorTools.h @@ -1,9 +1,12 @@ // // RearMirrorTools.h -// interface +// interface/src/ui // -// Created by stojce on 23.10.2013. -// Copyright (c) 2013 High Fidelity, Inc. All rights reserved. +// Created by stojce on 23. +// Copyright 2013 High Fidelity, Inc. +// +// 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__RearMirrorTools__ diff --git a/interface/src/ui/RunningScriptsWidget.h b/interface/src/ui/RunningScriptsWidget.h index 5d365dae91..718c417ba8 100644 --- a/interface/src/ui/RunningScriptsWidget.h +++ b/interface/src/ui/RunningScriptsWidget.h @@ -1,9 +1,12 @@ // -// RunningScripts.h -// interface +// RunningScriptsWidget.h +// interface/src/ui // // Created by Mohammed Nafees on 03/28/2014. -// Copyright (c) 2014 High Fidelity, Inc. All rights reserved. +// Copyright 2014 High Fidelity, Inc. +// +// 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__RunningScriptsWidget__ diff --git a/interface/src/ui/Snapshot.h b/interface/src/ui/Snapshot.h index 1b78e8328e..ec5e9d5f13 100644 --- a/interface/src/ui/Snapshot.h +++ b/interface/src/ui/Snapshot.h @@ -1,9 +1,12 @@ // // Snapshot.h -// hifi +// interface/src/ui // // Created by Stojce Slavkovski on 1/26/14. -// Copyright (c) 2014 High Fidelity, Inc. All rights reserved. +// Copyright 2014 High Fidelity, Inc. +// +// 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__Snapshot__ diff --git a/interface/src/ui/Stats.h b/interface/src/ui/Stats.h index 7920c35953..ad2a3c9bf5 100644 --- a/interface/src/ui/Stats.h +++ b/interface/src/ui/Stats.h @@ -1,9 +1,12 @@ // // Stats.h -// interface +// interface/src/ui // // Created by Lucas Crisman on 22/03/14. -// Copyright (c) 2013 High Fidelity, Inc. All rights reserved. +// Copyright 2013 High Fidelity, Inc. +// +// Distributed under the Apache License, Version 2.0. +// See the accompanying file LICENSE or http://www.apache.org/licenses/LICENSE-2.0.html // #include @@ -38,4 +41,4 @@ private: int _voxelStatsWidth; int _lastHorizontalOffset; -}; \ No newline at end of file +}; diff --git a/interface/src/ui/TextRenderer.h b/interface/src/ui/TextRenderer.h index d6c24c1ce8..a24612ab93 100644 --- a/interface/src/ui/TextRenderer.h +++ b/interface/src/ui/TextRenderer.h @@ -1,9 +1,12 @@ // // TextRenderer.h -// interface +// interface/src/ui // // Created by Andrzej Kapolka on 4/26/13. -// Copyright (c) 2013 High Fidelity, Inc. All rights reserved. +// Copyright 2013 High Fidelity, Inc. +// +// Distributed under the Apache License, Version 2.0. +// See the accompanying file LICENSE or http://www.apache.org/licenses/LICENSE-2.0.html // #ifndef __interface__TextRenderer__ diff --git a/interface/src/ui/UpdateDialog.h b/interface/src/ui/UpdateDialog.h index 14f4e6f39c..e346330f71 100644 --- a/interface/src/ui/UpdateDialog.h +++ b/interface/src/ui/UpdateDialog.h @@ -1,9 +1,11 @@ // // UpdateDialog.h -// interface +// interface/src/ui // -// Created by Leonardo Murillo on 1/8/14. -// Copyright (c) 2013, 2014 High Fidelity, Inc. All rights reserved. +// Copyright 2014 High Fidelity, Inc. +// +// 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__UpdateDialog__ diff --git a/interface/src/ui/overlays/Base3DOverlay.h b/interface/src/ui/overlays/Base3DOverlay.h index 286193393c..c464bfc2a7 100644 --- a/interface/src/ui/overlays/Base3DOverlay.h +++ b/interface/src/ui/overlays/Base3DOverlay.h @@ -1,8 +1,11 @@ // // Base3DOverlay.h -// interface +// interface/src/ui/overlays // -// Copyright (c) 2014 High Fidelity, Inc. All rights reserved. +// Copyright 2014 High Fidelity, Inc. +// +// Distributed under the Apache License, Version 2.0. +// See the accompanying file LICENSE or http://www.apache.org/licenses/LICENSE-2.0.html // #ifndef __interface__Base3DOverlay__ diff --git a/interface/src/ui/overlays/Cube3DOverlay.h b/interface/src/ui/overlays/Cube3DOverlay.h index a1705d47d0..0bdebea5b2 100644 --- a/interface/src/ui/overlays/Cube3DOverlay.h +++ b/interface/src/ui/overlays/Cube3DOverlay.h @@ -1,8 +1,11 @@ // // Cube3DOverlay.h -// interface +// interface/src/ui/overlays // -// Copyright (c) 2014 High Fidelity, Inc. All rights reserved. +// Copyright 2014 High Fidelity, Inc. +// +// Distributed under the Apache License, Version 2.0. +// See the accompanying file LICENSE or http://www.apache.org/licenses/LICENSE-2.0.html // #ifndef __interface__Cube3DOverlay__ diff --git a/interface/src/ui/overlays/ImageOverlay.h b/interface/src/ui/overlays/ImageOverlay.h index d6165e388d..9d3f21fdae 100644 --- a/interface/src/ui/overlays/ImageOverlay.h +++ b/interface/src/ui/overlays/ImageOverlay.h @@ -1,8 +1,11 @@ // // ImageOverlay.h -// interface +// interface/src/ui/overlays // -// Copyright (c) 2014 High Fidelity, Inc. All rights reserved. +// Copyright 2014 High Fidelity, Inc. +// +// Distributed under the Apache License, Version 2.0. +// See the accompanying file LICENSE or http://www.apache.org/licenses/LICENSE-2.0.html // #ifndef __interface__ImageOverlay__ diff --git a/interface/src/ui/overlays/Line3DOverlay.h b/interface/src/ui/overlays/Line3DOverlay.h index d52b639d59..250be03cd4 100644 --- a/interface/src/ui/overlays/Line3DOverlay.h +++ b/interface/src/ui/overlays/Line3DOverlay.h @@ -1,8 +1,11 @@ // // Line3DOverlay.h -// interface +// interface/src/ui/overlays // -// Copyright (c) 2014 High Fidelity, Inc. All rights reserved. +// Copyright 2014 High Fidelity, Inc. +// +// Distributed under the Apache License, Version 2.0. +// See the accompanying file LICENSE or http://www.apache.org/licenses/LICENSE-2.0.html // #ifndef __interface__Line3DOverlay__ diff --git a/interface/src/ui/overlays/LocalVoxelsOverlay.h b/interface/src/ui/overlays/LocalVoxelsOverlay.h index 2b3ba1f535..bdc4273693 100644 --- a/interface/src/ui/overlays/LocalVoxelsOverlay.h +++ b/interface/src/ui/overlays/LocalVoxelsOverlay.h @@ -1,11 +1,12 @@ // // LocalVoxelsOverlay.h -// hifi +// interface/src/ui/overlays // // Created by Clément Brisset on 2/28/14. -// Copyright (c) 2014 High Fidelity, Inc. All rights reserved. +// Copyright 2014 High Fidelity, Inc. // -// Scriptable interface for LocalVoxels +// 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__LocalVoxelsOverlay__ diff --git a/interface/src/ui/overlays/Overlay.h b/interface/src/ui/overlays/Overlay.h index ad1084e889..a80d6a403f 100644 --- a/interface/src/ui/overlays/Overlay.h +++ b/interface/src/ui/overlays/Overlay.h @@ -1,8 +1,11 @@ // // Overlay.h -// interface +// interface/src/ui/overlays // -// Copyright (c) 2014 High Fidelity, Inc. All rights reserved. +// Copyright 2014 High Fidelity, Inc. +// +// Distributed under the Apache License, Version 2.0. +// See the accompanying file LICENSE or http://www.apache.org/licenses/LICENSE-2.0.html // #ifndef __interface__Overlay__ diff --git a/interface/src/ui/overlays/Overlay2D.h b/interface/src/ui/overlays/Overlay2D.h index 3da8f8bca4..cb9c588603 100644 --- a/interface/src/ui/overlays/Overlay2D.h +++ b/interface/src/ui/overlays/Overlay2D.h @@ -1,8 +1,11 @@ // // Overlay2D.h -// interface +// interface/src/ui/overlays // -// Copyright (c) 2014 High Fidelity, Inc. All rights reserved. +// Copyright 2014 High Fidelity, Inc. +// +// Distributed under the Apache License, Version 2.0. +// See the accompanying file LICENSE or http://www.apache.org/licenses/LICENSE-2.0.html // #ifndef __interface__Overlay2D__ diff --git a/interface/src/ui/overlays/Overlays.h b/interface/src/ui/overlays/Overlays.h index c28f3ab83b..f6cbabe1f9 100644 --- a/interface/src/ui/overlays/Overlays.h +++ b/interface/src/ui/overlays/Overlays.h @@ -1,8 +1,11 @@ // // Overlays.h -// interface +// interface/src/ui/overlays // -// Copyright (c) 2014 High Fidelity, Inc. All rights reserved. +// Copyright 2014 High Fidelity, Inc. +// +// Distributed under the Apache License, Version 2.0. +// See the accompanying file LICENSE or http://www.apache.org/licenses/LICENSE-2.0.html // #ifndef __interface__Overlays__ diff --git a/interface/src/ui/overlays/Sphere3DOverlay.h b/interface/src/ui/overlays/Sphere3DOverlay.h index 58ed0d7776..0fbfc5e3de 100644 --- a/interface/src/ui/overlays/Sphere3DOverlay.h +++ b/interface/src/ui/overlays/Sphere3DOverlay.h @@ -1,8 +1,11 @@ // // Sphere3DOverlay.h -// interface +// interface/src/ui/overlays // -// Copyright (c) 2014 High Fidelity, Inc. All rights reserved. +// Copyright 2014 High Fidelity, Inc. +// +// Distributed under the Apache License, Version 2.0. +// See the accompanying file LICENSE or http://www.apache.org/licenses/LICENSE-2.0.html // #ifndef __interface__Sphere3DOverlay__ diff --git a/interface/src/ui/overlays/TextOverlay.h b/interface/src/ui/overlays/TextOverlay.h index d565aeb70d..9ea7a724b8 100644 --- a/interface/src/ui/overlays/TextOverlay.h +++ b/interface/src/ui/overlays/TextOverlay.h @@ -1,8 +1,11 @@ // // TextOverlay.h -// interface +// interface/src/ui/overlays // -// Copyright (c) 2014 High Fidelity, Inc. All rights reserved. +// Copyright 2014 High Fidelity, Inc. +// +// Distributed under the Apache License, Version 2.0. +// See the accompanying file LICENSE or http://www.apache.org/licenses/LICENSE-2.0.html // #ifndef __interface__TextOverlay__ diff --git a/interface/src/ui/overlays/Volume3DOverlay.h b/interface/src/ui/overlays/Volume3DOverlay.h index 8badbf2c33..a90074822b 100644 --- a/interface/src/ui/overlays/Volume3DOverlay.h +++ b/interface/src/ui/overlays/Volume3DOverlay.h @@ -1,8 +1,11 @@ // // Volume3DOverlay.h -// interface +// interface/src/ui/overlays // -// Copyright (c) 2014 High Fidelity, Inc. All rights reserved. +// Copyright 2014 High Fidelity, Inc. +// +// Distributed under the Apache License, Version 2.0. +// See the accompanying file LICENSE or http://www.apache.org/licenses/LICENSE-2.0.html // #ifndef __interface__Volume3DOverlay__ diff --git a/interface/src/voxels/PrimitiveRenderer.h b/interface/src/voxels/PrimitiveRenderer.h index 51d96e0840..92536190e2 100644 --- a/interface/src/voxels/PrimitiveRenderer.h +++ b/interface/src/voxels/PrimitiveRenderer.h @@ -1,10 +1,12 @@ -/// -/// @file PrimitiveRenderer.h -/// A geometric primitive renderer. -/// -/// @author: Norman Crafts -/// @copyright 2014, High Fidelity, Inc. All rights reserved. -/// +// +// PrimitiveRenderer.h +// interface/src/voxels +// +// Copyright 2014 High Fidelity, Inc. +// +// Distributed under the Apache License, Version 2.0. +// See the accompanying file LICENSE or http://www.apache.org/licenses/LICENSE-2.0.html +// #ifndef __interface__PrimitiveRenderer__ #define __interface__PrimitiveRenderer__ diff --git a/interface/src/voxels/VoxelFade.h b/interface/src/voxels/VoxelFade.h index fd7a73135b..2bfe65f03b 100644 --- a/interface/src/voxels/VoxelFade.h +++ b/interface/src/voxels/VoxelFade.h @@ -1,9 +1,12 @@ // // VoxelFade.h -// interface +// interface/src/voxels // // Created by Brad Hefta-Gaub on 8/6/13. -// Copyright (c) 2013 High Fidelity, Inc. All rights reserved. +// Copyright 2013 High Fidelity, Inc. +// +// Distributed under the Apache License, Version 2.0. +// See the accompanying file LICENSE or http://www.apache.org/licenses/LICENSE-2.0.html // #ifndef __interface__VoxelFade__ diff --git a/interface/src/voxels/VoxelHideShowThread.h b/interface/src/voxels/VoxelHideShowThread.h index dc1f2062c1..29aa53f430 100644 --- a/interface/src/voxels/VoxelHideShowThread.h +++ b/interface/src/voxels/VoxelHideShowThread.h @@ -1,11 +1,12 @@ // // VoxelHideShowThread.h -// voxel-server +// interface/src/voxels // -// Created by Brad Hefta-Gaub on 12/1/13 -// Copyright (c) 2013 High Fidelity, Inc. All rights reserved. +// Created by Brad Hefta-Gaub on 12/1/13. +// Copyright 2013 High Fidelity, Inc. // -// Threaded or non-threaded voxel persistence +// Distributed under the Apache License, Version 2.0. +// See the accompanying file LICENSE or http://www.apache.org/licenses/LICENSE-2.0.html // #ifndef __interface__VoxelHideShowThread__ diff --git a/interface/src/voxels/VoxelImporter.h b/interface/src/voxels/VoxelImporter.h index 9ebfc2eef2..fb9fe7b589 100644 --- a/interface/src/voxels/VoxelImporter.h +++ b/interface/src/voxels/VoxelImporter.h @@ -1,9 +1,12 @@ // // VoxelImporter.h -// hifi +// interface/src/voxels // // Created by Clement Brisset on 8/9/13. -// Copyright (c) 2013 High Fidelity, Inc. All rights reserved. +// Copyright 2013 High Fidelity, Inc. +// +// 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__VoxelImporter__ diff --git a/interface/src/voxels/VoxelPacketProcessor.h b/interface/src/voxels/VoxelPacketProcessor.h index 2acd347e99..c71bc07c31 100644 --- a/interface/src/voxels/VoxelPacketProcessor.h +++ b/interface/src/voxels/VoxelPacketProcessor.h @@ -1,11 +1,12 @@ // // VoxelPacketProcessor.h -// interface +// interface/src/voxels // // Created by Brad Hefta-Gaub on 8/12/13. -// Copyright (c) 2013 High Fidelity, Inc. All rights reserved. +// Copyright 2013 High Fidelity, Inc. // -// Voxel Packet Receiver +// Distributed under the Apache License, Version 2.0. +// See the accompanying file LICENSE or http://www.apache.org/licenses/LICENSE-2.0.html // #ifndef __shared__VoxelPacketProcessor__ diff --git a/interface/src/voxels/VoxelSystem.h b/interface/src/voxels/VoxelSystem.h index bdc55450dd..eae7e21246 100644 --- a/interface/src/voxels/VoxelSystem.h +++ b/interface/src/voxels/VoxelSystem.h @@ -1,9 +1,12 @@ // // VoxelSystem.h -// interface +// interface/src/voxels // // Created by Philip on 12/31/12. -// Copyright (c) 2012 High Fidelity, Inc. All rights reserved. +// Copyright 2012 High Fidelity, Inc. +// +// Distributed under the Apache License, Version 2.0. +// See the accompanying file LICENSE or http://www.apache.org/licenses/LICENSE-2.0.html // #ifndef __interface__VoxelSystem__ diff --git a/interface/src/windowshacks.h b/interface/src/windowshacks.h index aae7b2f923..07ef69c6f0 100644 --- a/interface/src/windowshacks.h +++ b/interface/src/windowshacks.h @@ -1,11 +1,12 @@ // // windowshacks.h -// hifi +// interface/src // // Created by Brad Hefta-Gaub on 1/12/14. -// Copyright (c) 2014 HighFidelity, Inc. All rights reserved. +// Copyright 2014 High Fidelity, Inc. // -// hacks to get windows to compile +// 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__windowshacks__ @@ -54,4 +55,4 @@ inline int c99_snprintf(char* str, size_t size, const char* format, ...) { #endif // WIN32 -#endif // __hifi__windowshacks__ \ No newline at end of file +#endif // __hifi__windowshacks__ diff --git a/interface/src/world.h b/interface/src/world.h index 8d857303ae..95767e7b15 100644 --- a/interface/src/world.h +++ b/interface/src/world.h @@ -1,9 +1,12 @@ // // world.h -// interface +// interface/src // // Created by Philip Rosedale on 8/23/12. -// Copyright (c) 2012 High Fidelity, Inc. All rights reserved. +// Copyright 2012 High Fidelity, Inc. +// +// Distributed under the Apache License, Version 2.0. +// See the accompanying file LICENSE or http://www.apache.org/licenses/LICENSE-2.0.html // #ifndef __interface__world__ diff --git a/libraries/audio/src/AbstractAudioInterface.h b/libraries/audio/src/AbstractAudioInterface.h index dc3872efd5..28cb0653f8 100644 --- a/libraries/audio/src/AbstractAudioInterface.h +++ b/libraries/audio/src/AbstractAudioInterface.h @@ -1,10 +1,12 @@ // // AbstractAudioInterface.h -// hifi +// libraries/audio/src // // Created by Brad Hefta-Gaub on 12/4/13. -// Copyright (c) 2013 High Fidelity, Inc. All rights reserved. +// Copyright 2013 High Fidelity, Inc. // +// 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__AbstractAudioInterface__ @@ -25,4 +27,4 @@ public slots: Q_DECLARE_METATYPE(AbstractAudioInterface*) -#endif /* defined(__hifi__AbstractAudioInterface__) */ \ No newline at end of file +#endif /* defined(__hifi__AbstractAudioInterface__) */ diff --git a/libraries/audio/src/AudioInjector.h b/libraries/audio/src/AudioInjector.h index beff33a9ef..988ea46444 100644 --- a/libraries/audio/src/AudioInjector.h +++ b/libraries/audio/src/AudioInjector.h @@ -1,9 +1,12 @@ // // AudioInjector.h -// hifi +// libraries/audio/src // // Created by Stephen Birarda on 1/2/2014. -// Copyright (c) 2014 HighFidelity, Inc. All rights reserved. +// Copyright 2014 High Fidelity, Inc. +// +// 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__AudioInjector__ diff --git a/libraries/audio/src/AudioInjectorOptions.h b/libraries/audio/src/AudioInjectorOptions.h index 0c70ad43cb..866f95bde4 100644 --- a/libraries/audio/src/AudioInjectorOptions.h +++ b/libraries/audio/src/AudioInjectorOptions.h @@ -1,9 +1,12 @@ // // AudioInjectorOptions.h -// hifi +// libraries/audio/src // // Created by Stephen Birarda on 1/2/2014. -// Copyright (c) 2014 HighFidelity, Inc. All rights reserved. +// Copyright 2014 High Fidelity, Inc. +// +// 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__AudioInjectorOptions__ diff --git a/libraries/audio/src/AudioRingBuffer.h b/libraries/audio/src/AudioRingBuffer.h index e55eeda40e..7a1a75e43b 100644 --- a/libraries/audio/src/AudioRingBuffer.h +++ b/libraries/audio/src/AudioRingBuffer.h @@ -1,9 +1,12 @@ // // AudioRingBuffer.h -// interface +// libraries/audio/src // // Created by Stephen Birarda on 2/1/13. -// Copyright (c) 2013 HighFidelity, Inc. All rights reserved. +// Copyright 2013 High Fidelity, Inc. +// +// Distributed under the Apache License, Version 2.0. +// See the accompanying file LICENSE or http://www.apache.org/licenses/LICENSE-2.0.html // #ifndef __interface__AudioRingBuffer__ diff --git a/libraries/audio/src/AudioScriptingInterface.h b/libraries/audio/src/AudioScriptingInterface.h index f758923513..9371597075 100644 --- a/libraries/audio/src/AudioScriptingInterface.h +++ b/libraries/audio/src/AudioScriptingInterface.h @@ -1,9 +1,12 @@ // // AudioScriptingInterface.h -// hifi +// libraries/audio/src // // Created by Stephen Birarda on 1/2/2014. -// Copyright (c) 2014 HighFidelity, Inc. All rights reserved. +// Copyright 2014 High Fidelity, Inc. +// +// 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__AudioScriptingInterface__ diff --git a/libraries/audio/src/InjectedAudioRingBuffer.h b/libraries/audio/src/InjectedAudioRingBuffer.h index d4dfb5e360..8a1a430c78 100644 --- a/libraries/audio/src/InjectedAudioRingBuffer.h +++ b/libraries/audio/src/InjectedAudioRingBuffer.h @@ -1,9 +1,12 @@ // // InjectedAudioRingBuffer.h -// hifi +// libraries/audio/src // // Created by Stephen Birarda on 6/5/13. -// Copyright (c) 2013 HighFidelity, Inc. All rights reserved. +// Copyright 2013 High Fidelity, Inc. +// +// 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__InjectedAudioRingBuffer__ diff --git a/libraries/audio/src/MixedAudioRingBuffer.h b/libraries/audio/src/MixedAudioRingBuffer.h index c116361689..2d672f6ada 100644 --- a/libraries/audio/src/MixedAudioRingBuffer.h +++ b/libraries/audio/src/MixedAudioRingBuffer.h @@ -1,9 +1,12 @@ // // MixedAudioRingBuffer.h -// hifi +// libraries/audio/src // -// Created by Stephen Birarda on 2014-03-26. -// Copyright (c) 2014 HighFidelity, Inc. All rights reserved. +// Created by Stephen Birarda on 2014. +// Copyright 2014 High Fidelity, Inc. +// +// 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__MixedAudioRingBuffer__ diff --git a/libraries/audio/src/PositionalAudioRingBuffer.h b/libraries/audio/src/PositionalAudioRingBuffer.h index a82df0b857..c34e6f8bc7 100644 --- a/libraries/audio/src/PositionalAudioRingBuffer.h +++ b/libraries/audio/src/PositionalAudioRingBuffer.h @@ -1,9 +1,12 @@ // // PositionalAudioRingBuffer.h -// hifi +// libraries/audio/src // // Created by Stephen Birarda on 6/5/13. -// Copyright (c) 2013 HighFidelity, Inc. All rights reserved. +// Copyright 2013 High Fidelity, Inc. +// +// 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__PositionalAudioRingBuffer__ diff --git a/libraries/audio/src/Sound.h b/libraries/audio/src/Sound.h index 7956343d46..27e46bec57 100644 --- a/libraries/audio/src/Sound.h +++ b/libraries/audio/src/Sound.h @@ -1,10 +1,12 @@ // // Sound.h -// hifi +// libraries/audio/src // // Created by Stephen Birarda on 1/2/2014. -// Modified by Athanasios Gaitatzes to add WAVE file support. -// Copyright (c) 2014 HighFidelity, Inc. All rights reserved. +// Copyright 2014 High Fidelity, Inc. +// +// 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__Sound__ diff --git a/libraries/avatars/src/AvatarData.h b/libraries/avatars/src/AvatarData.h index cf645855e8..79c2075323 100755 --- a/libraries/avatars/src/AvatarData.h +++ b/libraries/avatars/src/AvatarData.h @@ -1,9 +1,12 @@ // // AvatarData.h -// hifi +// libraries/avatars/src // // Created by Stephen Birarda on 4/9/13. -// Copyright (c) 2013 High Fidelity, Inc. All rights reserved. +// Copyright 2013 High Fidelity, Inc. +// +// 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__AvatarData__ diff --git a/libraries/avatars/src/AvatarHashMap.h b/libraries/avatars/src/AvatarHashMap.h index 19b6623402..fcfd735073 100644 --- a/libraries/avatars/src/AvatarHashMap.h +++ b/libraries/avatars/src/AvatarHashMap.h @@ -1,9 +1,12 @@ // // AvatarHashMap.h -// hifi +// libraries/avatars/src // // Created by Stephen AndrewMeadows on 1/28/2014. -// Copyright (c) 2014 HighFidelity, Inc. All rights reserved. +// Copyright 2014 High Fidelity, Inc. +// +// 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__AvatarHashMap__ diff --git a/libraries/avatars/src/HandData.h b/libraries/avatars/src/HandData.h index 9ebdc8dcf6..662ad493b1 100755 --- a/libraries/avatars/src/HandData.h +++ b/libraries/avatars/src/HandData.h @@ -1,9 +1,12 @@ // // HandData.h -// hifi +// libraries/avatars/src // // Created by Eric Johnston on 6/26/13. -// Copyright (c) 2013 High Fidelity, Inc. All rights reserved. +// Copyright 2013 High Fidelity, Inc. +// +// 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__HandData__ diff --git a/libraries/avatars/src/HeadData.h b/libraries/avatars/src/HeadData.h index c60627e3f9..044966da04 100644 --- a/libraries/avatars/src/HeadData.h +++ b/libraries/avatars/src/HeadData.h @@ -1,9 +1,12 @@ // // HeadData.h -// hifi +// libraries/avatars/src // // Created by Stephen Birarda on 5/20/13. -// Copyright (c) 2013 High Fidelity, Inc. All rights reserved. +// Copyright 2013 High Fidelity, Inc. +// +// 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__HeadData__ diff --git a/libraries/embedded-webserver/src/HTTPConnection.h b/libraries/embedded-webserver/src/HTTPConnection.h index dbf1e31f47..2da4027334 100644 --- a/libraries/embedded-webserver/src/HTTPConnection.h +++ b/libraries/embedded-webserver/src/HTTPConnection.h @@ -1,13 +1,12 @@ // // HTTPConnection.h -// hifi +// libraries/embedded-webserver/src // // Created by Stephen Birarda on 1/16/14. -// Copyright (c) 2014 HighFidelity, Inc. All rights reserved. +// Copyright 2014 High Fidelity, Inc. // -// Heavily based on Andrzej Kapolka's original HTTPConnection class -// found from another one of his projects. -// https://github.com/ey6es/witgap/tree/master/src/cpp/server/http +// 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__HTTPConnection__ diff --git a/libraries/embedded-webserver/src/HTTPManager.h b/libraries/embedded-webserver/src/HTTPManager.h index a8f9d723fa..91f185de2e 100755 --- a/libraries/embedded-webserver/src/HTTPManager.h +++ b/libraries/embedded-webserver/src/HTTPManager.h @@ -1,13 +1,12 @@ // // HTTPManager.h -// hifi +// libraries/embedded-webserver/src // // Created by Stephen Birarda on 1/16/14. -// Copyright (c) 2014 HighFidelity, Inc. All rights reserved. +// Copyright 2014 High Fidelity, Inc. // -// Heavily based on Andrzej Kapolka's original HTTPManager class -// found from another one of his projects. -// https://github.com/ey6es/witgap/tree/master/src/cpp/server/http +// 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__HTTPManager__ diff --git a/libraries/metavoxels/src/AttributeRegistry.h b/libraries/metavoxels/src/AttributeRegistry.h index db13ea9f4e..084ef4426f 100644 --- a/libraries/metavoxels/src/AttributeRegistry.h +++ b/libraries/metavoxels/src/AttributeRegistry.h @@ -1,9 +1,12 @@ // // AttributeRegistry.h -// metavoxels +// libraries/metavoxels/src // // Created by Andrzej Kapolka on 12/6/13. -// Copyright (c) 2013 High Fidelity, Inc. All rights reserved. +// Copyright 2013 High Fidelity, Inc. +// +// Distributed under the Apache License, Version 2.0. +// See the accompanying file LICENSE or http://www.apache.org/licenses/LICENSE-2.0.html // #ifndef __interface__AttributeRegistry__ diff --git a/libraries/metavoxels/src/Bitstream.h b/libraries/metavoxels/src/Bitstream.h index d7b16fcc4a..3c5f738730 100644 --- a/libraries/metavoxels/src/Bitstream.h +++ b/libraries/metavoxels/src/Bitstream.h @@ -1,9 +1,12 @@ // // Bitstream.h -// metavoxels +// libraries/metavoxels/src // // Created by Andrzej Kapolka on 12/2/13. -// Copyright (c) 2013 High Fidelity, Inc. All rights reserved. +// Copyright 2013 High Fidelity, Inc. +// +// Distributed under the Apache License, Version 2.0. +// See the accompanying file LICENSE or http://www.apache.org/licenses/LICENSE-2.0.html // #ifndef __interface__Bitstream__ diff --git a/libraries/metavoxels/src/DatagramSequencer.h b/libraries/metavoxels/src/DatagramSequencer.h index 30a131390d..40a8a7e9e7 100644 --- a/libraries/metavoxels/src/DatagramSequencer.h +++ b/libraries/metavoxels/src/DatagramSequencer.h @@ -1,9 +1,12 @@ // // DatagramSequencer.h -// metavoxels +// libraries/metavoxels/src // // Created by Andrzej Kapolka on 12/20/13. -// Copyright (c) 2013 High Fidelity, Inc. All rights reserved. +// Copyright 2013 High Fidelity, Inc. +// +// Distributed under the Apache License, Version 2.0. +// See the accompanying file LICENSE or http://www.apache.org/licenses/LICENSE-2.0.html // #ifndef __interface__DatagramSequencer__ diff --git a/libraries/metavoxels/src/MetavoxelData.h b/libraries/metavoxels/src/MetavoxelData.h index 7a53598042..49df417b71 100644 --- a/libraries/metavoxels/src/MetavoxelData.h +++ b/libraries/metavoxels/src/MetavoxelData.h @@ -1,9 +1,12 @@ // // MetavoxelData.h -// metavoxels +// libraries/metavoxels/src // // Created by Andrzej Kapolka on 12/6/13. -// Copyright (c) 2013 High Fidelity, Inc. All rights reserved. +// Copyright 2013 High Fidelity, Inc. +// +// Distributed under the Apache License, Version 2.0. +// See the accompanying file LICENSE or http://www.apache.org/licenses/LICENSE-2.0.html // #ifndef __interface__MetavoxelData__ diff --git a/libraries/metavoxels/src/MetavoxelMessages.h b/libraries/metavoxels/src/MetavoxelMessages.h index 4f90a52e4c..d4d2183091 100644 --- a/libraries/metavoxels/src/MetavoxelMessages.h +++ b/libraries/metavoxels/src/MetavoxelMessages.h @@ -1,9 +1,12 @@ // // MetavoxelMessages.h -// metavoxels +// libraries/metavoxels/src // // Created by Andrzej Kapolka on 12/31/13. -// Copyright (c) 2013 High Fidelity, Inc. All rights reserved. +// Copyright 2013 High Fidelity, Inc. +// +// Distributed under the Apache License, Version 2.0. +// See the accompanying file LICENSE or http://www.apache.org/licenses/LICENSE-2.0.html // #ifndef __interface__MetavoxelMessages__ diff --git a/libraries/metavoxels/src/MetavoxelUtil.h b/libraries/metavoxels/src/MetavoxelUtil.h index cc6c540151..e72408b9ed 100644 --- a/libraries/metavoxels/src/MetavoxelUtil.h +++ b/libraries/metavoxels/src/MetavoxelUtil.h @@ -1,9 +1,12 @@ // // MetavoxelUtil.h -// metavoxels +// libraries/metavoxels/src // // Created by Andrzej Kapolka on 12/30/13. -// Copyright (c) 2013 High Fidelity, Inc. All rights reserved. +// Copyright 2013 High Fidelity, Inc. +// +// Distributed under the Apache License, Version 2.0. +// See the accompanying file LICENSE or http://www.apache.org/licenses/LICENSE-2.0.html // #ifndef __interface__MetavoxelUtil__ diff --git a/libraries/metavoxels/src/ScriptCache.h b/libraries/metavoxels/src/ScriptCache.h index ac53e602f8..810da46eb2 100644 --- a/libraries/metavoxels/src/ScriptCache.h +++ b/libraries/metavoxels/src/ScriptCache.h @@ -1,9 +1,12 @@ // // ScriptCache.h -// metavoxels +// libraries/metavoxels/src // // Created by Andrzej Kapolka on 2/4/14. -// Copyright (c) 2014 High Fidelity, Inc. All rights reserved. +// Copyright 2014 High Fidelity, Inc. +// +// Distributed under the Apache License, Version 2.0. +// See the accompanying file LICENSE or http://www.apache.org/licenses/LICENSE-2.0.html // #ifndef __interface__ScriptCache__ diff --git a/libraries/metavoxels/src/SharedObject.h b/libraries/metavoxels/src/SharedObject.h index 2751a66db3..736984fa41 100644 --- a/libraries/metavoxels/src/SharedObject.h +++ b/libraries/metavoxels/src/SharedObject.h @@ -1,9 +1,12 @@ // // SharedObject.h -// metavoxels +// libraries/metavoxels/src // // Created by Andrzej Kapolka on 2/5/14. -// Copyright (c) 2014 High Fidelity, Inc. All rights reserved. +// Copyright 2014 High Fidelity, Inc. +// +// Distributed under the Apache License, Version 2.0. +// See the accompanying file LICENSE or http://www.apache.org/licenses/LICENSE-2.0.html // #ifndef __interface__SharedObject__ diff --git a/libraries/octree/src/AABox.h b/libraries/octree/src/AABox.h index 731b82be4c..2b9be1246f 100644 --- a/libraries/octree/src/AABox.h +++ b/libraries/octree/src/AABox.h @@ -1,11 +1,12 @@ // -// AABox.h - Axis Aligned Boxes -// hifi +// AABox.h +// libraries/octree/src // -// Added by Brad Hefta-Gaub on 04/11/13. -// Originally from lighthouse3d. Modified to utilize glm::vec3 and clean up to our coding standards +// Created by Brad Hefta-Gaub on 04/11/13. +// Copyright 2013 High Fidelity, Inc. // -// Simple axis aligned box class. +// Distributed under the Apache License, Version 2.0. +// See the accompanying file LICENSE or http://www.apache.org/licenses/LICENSE-2.0.html // #ifndef _AABOX_ diff --git a/libraries/octree/src/CoverageMap.h b/libraries/octree/src/CoverageMap.h index 9cdda579e8..d1fada141e 100644 --- a/libraries/octree/src/CoverageMap.h +++ b/libraries/octree/src/CoverageMap.h @@ -1,9 +1,12 @@ // -// CoverageMap.h - 2D CoverageMap Quad tree for storage of OctreeProjectedPolygons -// hifi +// CoverageMap.h +// libraries/octree/src // -// Added by Brad Hefta-Gaub on 06/11/13. -// Copyright (c) 2013 High Fidelity, Inc. All rights reserved. +// Created by Brad Hefta-Gaub on 06/11/13. +// Copyright 2013 High Fidelity, Inc. +// +// Distributed under the Apache License, Version 2.0. +// See the accompanying file LICENSE or http://www.apache.org/licenses/LICENSE-2.0.html // #ifndef _COVERAGE_MAP_ diff --git a/libraries/octree/src/CoverageMapV2.h b/libraries/octree/src/CoverageMapV2.h index e7c2eed4fe..7221c7d5de 100644 --- a/libraries/octree/src/CoverageMapV2.h +++ b/libraries/octree/src/CoverageMapV2.h @@ -1,9 +1,12 @@ // -// CoverageMapV2.h - 2D CoverageMapV2 Quad tree for storage of OctreeProjectedPolygons -// hifi +// CoverageMapV2.h +// libraries/octree/src // -// Added by Brad Hefta-Gaub on 06/11/13. -// Copyright (c) 2013 High Fidelity, Inc. All rights reserved. +// Created by Brad Hefta-Gaub on 06/11/13. +// Copyright 2013 High Fidelity, Inc. +// +// Distributed under the Apache License, Version 2.0. +// See the accompanying file LICENSE or http://www.apache.org/licenses/LICENSE-2.0.html // #ifndef _COVERAGE_MAP_V2_ diff --git a/libraries/octree/src/JurisdictionListener.h b/libraries/octree/src/JurisdictionListener.h index b3dc9664d7..981f7d1a42 100644 --- a/libraries/octree/src/JurisdictionListener.h +++ b/libraries/octree/src/JurisdictionListener.h @@ -1,11 +1,12 @@ // // JurisdictionListener.h -// shared +// libraries/octree/src // // Created by Brad Hefta-Gaub on 8/12/13. -// Copyright (c) 2013 High Fidelity, Inc. All rights reserved. +// Copyright 2013 High Fidelity, Inc. // -// Voxel Packet Sender +// Distributed under the Apache License, Version 2.0. +// See the accompanying file LICENSE or http://www.apache.org/licenses/LICENSE-2.0.html // #ifndef __shared__JurisdictionListener__ diff --git a/libraries/octree/src/JurisdictionMap.h b/libraries/octree/src/JurisdictionMap.h index 06305254d1..4c189bfac0 100644 --- a/libraries/octree/src/JurisdictionMap.h +++ b/libraries/octree/src/JurisdictionMap.h @@ -1,9 +1,12 @@ // // JurisdictionMap.h -// hifi +// libraries/octree/src // // Created by Brad Hefta-Gaub on 8/1/13. -// Copyright (c) 2013 High Fidelity, Inc. All rights reserved. +// Copyright 2013 High Fidelity, Inc. +// +// 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__JurisdictionMap__ diff --git a/libraries/octree/src/JurisdictionSender.h b/libraries/octree/src/JurisdictionSender.h index 18365fda63..20c54824e7 100644 --- a/libraries/octree/src/JurisdictionSender.h +++ b/libraries/octree/src/JurisdictionSender.h @@ -1,11 +1,12 @@ // // JurisdictionSender.h -// shared +// libraries/octree/src // // Created by Brad Hefta-Gaub on 8/12/13. -// Copyright (c) 2013 High Fidelity, Inc. All rights reserved. +// Copyright 2013 High Fidelity, Inc. // -// Jurisdiction Sender +// Distributed under the Apache License, Version 2.0. +// See the accompanying file LICENSE or http://www.apache.org/licenses/LICENSE-2.0.html // #ifndef __shared__JurisdictionSender__ diff --git a/libraries/octree/src/Octree.h b/libraries/octree/src/Octree.h index f029431d87..6451b91a26 100644 --- a/libraries/octree/src/Octree.h +++ b/libraries/octree/src/Octree.h @@ -1,9 +1,12 @@ // // Octree.h -// hifi +// libraries/octree/src // // Created by Stephen Birarda on 3/13/13. -// Copyright (c) 2013 High Fidelity, Inc. All rights reserved. +// Copyright 2013 High Fidelity, Inc. +// +// 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__Octree__ diff --git a/libraries/octree/src/OctreeConstants.h b/libraries/octree/src/OctreeConstants.h index 82f4acea66..ceb3a4de20 100644 --- a/libraries/octree/src/OctreeConstants.h +++ b/libraries/octree/src/OctreeConstants.h @@ -1,11 +1,12 @@ // // OctreeConstants.h -// hifi +// libraries/octree/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_OctreeConstants_h__ @@ -43,4 +44,4 @@ const int DANGEROUSLY_DEEP_RECURSION = 200; // use this for something that needs const int DEFAULT_MAX_OCTREE_PPS = 600; // the default maximum PPS we think any octree based server should send to a client -#endif \ No newline at end of file +#endif diff --git a/libraries/octree/src/OctreeEditPacketSender.h b/libraries/octree/src/OctreeEditPacketSender.h index 75ad02a1c6..36d2f837cf 100644 --- a/libraries/octree/src/OctreeEditPacketSender.h +++ b/libraries/octree/src/OctreeEditPacketSender.h @@ -1,11 +1,12 @@ // // OctreeEditPacketSender.h -// shared +// libraries/octree/src // // Created by Brad Hefta-Gaub on 8/12/13. -// Copyright (c) 2013 High Fidelity, Inc. All rights reserved. +// Copyright 2013 High Fidelity, Inc. // -// Octree Edit Packet Sender +// Distributed under the Apache License, Version 2.0. +// See the accompanying file LICENSE or http://www.apache.org/licenses/LICENSE-2.0.html // #ifndef __shared__OctreeEditPacketSender__ diff --git a/libraries/octree/src/OctreeElement.h b/libraries/octree/src/OctreeElement.h index a37866bdbe..b634acdf2a 100644 --- a/libraries/octree/src/OctreeElement.h +++ b/libraries/octree/src/OctreeElement.h @@ -1,9 +1,12 @@ // // OctreeElement.h -// hifi +// libraries/octree/src // // Created by Stephen Birarda on 3/13/13. +// Copyright 2013 High Fidelity, Inc. // +// 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__OctreeElement__ @@ -316,4 +319,4 @@ protected: static quint64 _childrenCount[NUMBER_OF_CHILDREN + 1]; }; -#endif /* defined(__hifi__OctreeElement__) */ \ No newline at end of file +#endif /* defined(__hifi__OctreeElement__) */ diff --git a/libraries/octree/src/OctreeElementBag.h b/libraries/octree/src/OctreeElementBag.h index ba74a05516..fa3cbf0319 100644 --- a/libraries/octree/src/OctreeElementBag.h +++ b/libraries/octree/src/OctreeElementBag.h @@ -1,14 +1,12 @@ // // OctreeElementBag.h -// hifi +// libraries/octree/src // -// Created by Brad Hefta-Gaub on 4/25/2013 -// Copyright (c) 2013 High Fidelity, Inc. All rights reserved. +// Created by Brad Hefta-Gaub on 4/25/2013. +// Copyright 2013 High Fidelity, Inc. // -// This class is used by the VoxelTree:encodeTreeBitstream() functions to store extra nodes that need to be sent -// it's a generic bag style storage mechanism. But It has the property that you can't put the same node into the bag -// more than once (in other words, it de-dupes automatically), also, it supports collapsing it's several peer nodes -// into a parent node in cases where you add enough peers that it makes more sense to just add the parent. +// 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__OctreeElementBag__ diff --git a/libraries/octree/src/OctreeHeadlessViewer.h b/libraries/octree/src/OctreeHeadlessViewer.h index fc32dbc682..5d98d0291f 100644 --- a/libraries/octree/src/OctreeHeadlessViewer.h +++ b/libraries/octree/src/OctreeHeadlessViewer.h @@ -1,10 +1,12 @@ // // OctreeHeadlessViewer.h -// hifi +// libraries/octree/src // -// Created by Brad Hefta-Gaub on 2/26/14 -// Copyright (c) 2014 High Fidelity, Inc. All rights reserved. +// Created by Brad Hefta-Gaub on 2/26/14. +// Copyright 2014 High Fidelity, Inc. // +// 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__OctreeHeadlessViewer__ @@ -70,4 +72,4 @@ private: int _maxPacketsPerSecond; }; -#endif /* defined(__hifi__OctreeHeadlessViewer__) */ \ No newline at end of file +#endif /* defined(__hifi__OctreeHeadlessViewer__) */ diff --git a/libraries/octree/src/OctreePacketData.h b/libraries/octree/src/OctreePacketData.h index 5d7a904a4c..1efea6c217 100644 --- a/libraries/octree/src/OctreePacketData.h +++ b/libraries/octree/src/OctreePacketData.h @@ -1,19 +1,12 @@ // // OctreePacketData.h -// hifi +// libraries/octree/src // -// Created by Brad Hefta-Gaub on 11/19/2013 +// Created by Brad Hefta-Gaub on 11/19/2013. +// Copyright 2013 High Fidelity, Inc. // -// TO DO: -// -// * add stats tracking for number of unique colors and consecutive identical colors. -// (as research for color dictionaries and RLE) -// -// * further testing of compression to determine optimal configuration for performance and compression -// -// * improve semantics for "reshuffle" - current approach will work for now and with compression -// but wouldn't work with RLE because the colors in the levels would get reordered and RLE would need -// to be recalculated +// 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__OctreePacketData__ diff --git a/libraries/octree/src/OctreePersistThread.h b/libraries/octree/src/OctreePersistThread.h index ce6190b0e6..8d96ac945d 100644 --- a/libraries/octree/src/OctreePersistThread.h +++ b/libraries/octree/src/OctreePersistThread.h @@ -1,11 +1,12 @@ // // OctreePersistThread.h -// Octree-server +// libraries/octree/src // -// Created by Brad Hefta-Gaub on 8/21/13 -// Copyright (c) 2013 High Fidelity, Inc. All rights reserved. +// Created by Brad Hefta-Gaub on 8/21/13. +// Copyright 2013 High Fidelity, Inc. // -// Threaded or non-threaded Octree persistence +// Distributed under the Apache License, Version 2.0. +// See the accompanying file LICENSE or http://www.apache.org/licenses/LICENSE-2.0.html // #ifndef __Octree_server__OctreePersistThread__ diff --git a/libraries/octree/src/OctreeProjectedPolygon.h b/libraries/octree/src/OctreeProjectedPolygon.h index 94e55a11d5..e551a6c005 100644 --- a/libraries/octree/src/OctreeProjectedPolygon.h +++ b/libraries/octree/src/OctreeProjectedPolygon.h @@ -1,8 +1,12 @@ // -// OctreeProjectedPolygon.h - The projected shadow (on the 2D view plane) for a voxel -// hifi +// OctreeProjectedPolygon.h +// libraries/octree/src // -// Added by Brad Hefta-Gaub on 06/11/13. +// Created by Brad Hefta-Gaub on 06/11/13. +// Copyright 2013 High Fidelity, Inc. +// +// Distributed under the Apache License, Version 2.0. +// See the accompanying file LICENSE or http://www.apache.org/licenses/LICENSE-2.0.html // #ifndef _VOXEL_PROJECTED_SHADOW_ diff --git a/libraries/octree/src/OctreeQuery.h b/libraries/octree/src/OctreeQuery.h index 3b53aaa501..6e2b651a5b 100644 --- a/libraries/octree/src/OctreeQuery.h +++ b/libraries/octree/src/OctreeQuery.h @@ -1,9 +1,12 @@ // // OctreeQuery.h -// hifi +// libraries/octree/src // // Created by Stephen Birarda on 4/9/13. -// Copyright (c) 2013 High Fidelity, Inc. All rights reserved. +// Copyright 2013 High Fidelity, Inc. +// +// 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__OctreeQuery__ diff --git a/libraries/octree/src/OctreeRenderer.h b/libraries/octree/src/OctreeRenderer.h index 2e9762a883..e61ac145b8 100644 --- a/libraries/octree/src/OctreeRenderer.h +++ b/libraries/octree/src/OctreeRenderer.h @@ -1,10 +1,12 @@ // // OctreeRenderer.h -// hifi +// libraries/octree/src // // Created by Brad Hefta-Gaub on 12/6/13. -// Copyright (c) 2013 High Fidelity, Inc. All rights reserved. +// Copyright 2013 High Fidelity, Inc. // +// 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__OctreeRenderer__ @@ -69,4 +71,4 @@ protected: ViewFrustum* _viewFrustum; }; -#endif /* defined(__hifi__OctreeRenderer__) */ \ No newline at end of file +#endif /* defined(__hifi__OctreeRenderer__) */ diff --git a/libraries/octree/src/OctreeSceneStats.h b/libraries/octree/src/OctreeSceneStats.h index 866c5d0b85..b74fbbc8d1 100644 --- a/libraries/octree/src/OctreeSceneStats.h +++ b/libraries/octree/src/OctreeSceneStats.h @@ -1,10 +1,12 @@ // // OctreeSceneStats.h -// hifi +// libraries/octree/src // // Created by Brad Hefta-Gaub on 7/18/13. -// Copyright (c) 2013 High Fidelity, Inc. All rights reserved. +// Copyright 2013 High Fidelity, Inc. // +// 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__OctreeSceneStats__ diff --git a/libraries/octree/src/OctreeScriptingInterface.h b/libraries/octree/src/OctreeScriptingInterface.h index 3003950bbf..4c6c6aa54f 100644 --- a/libraries/octree/src/OctreeScriptingInterface.h +++ b/libraries/octree/src/OctreeScriptingInterface.h @@ -1,9 +1,12 @@ // // OctreeScriptingInterface.h -// hifi +// libraries/octree/src // -// Created by Brad Hefta-Gaub on 12/6/13 -// Copyright (c) 2013 HighFidelity, Inc. All rights reserved. +// Created by Brad Hefta-Gaub on 12/6/13. +// Copyright 2013 High Fidelity, Inc. +// +// 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__OctreeScriptingInterface__ diff --git a/libraries/octree/src/Plane.h b/libraries/octree/src/Plane.h index 48bef064f6..1a37499183 100755 --- a/libraries/octree/src/Plane.h +++ b/libraries/octree/src/Plane.h @@ -1,12 +1,16 @@ // // Plane.h -// hifi +// libraries/octree/src/ // // Created by Brad Hefta-Gaub on 04/11/13. -// Originally from lighthouse3d. Modified to utilize glm::vec3 and clean up to our coding standards +// Copyright 2013 High Fidelity, Inc. // +// Originally from lighthouse3d. Modified to utilize glm::vec3 and clean up to our coding standards // Simple plane class. // +// Distributed under the Apache License, Version 2.0. +// See the accompanying file LICENSE or http://www.apache.org/licenses/LICENSE-2.0.html +// #ifndef _PLANE_ #define _PLANE_ diff --git a/libraries/octree/src/ViewFrustum.h b/libraries/octree/src/ViewFrustum.h index 7a1c3b49ba..6553dab1a1 100644 --- a/libraries/octree/src/ViewFrustum.h +++ b/libraries/octree/src/ViewFrustum.h @@ -1,11 +1,12 @@ // // ViewFrustum.h -// hifi +// libraries/octree/src // // Created by Brad Hefta-Gaub on 04/11/13. -// Copyright (c) 2013 HighFidelity, Inc. All rights reserved. +// Copyright 2013 High Fidelity, Inc. // -// Simple view frustum class. +// 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__ViewFrustum__ diff --git a/libraries/particles/src/Particle.h b/libraries/particles/src/Particle.h index dbe98c5bf6..8a49dd273a 100644 --- a/libraries/particles/src/Particle.h +++ b/libraries/particles/src/Particle.h @@ -1,10 +1,12 @@ // // Particle.h -// hifi +// libraries/particles/src // // Created by Brad Hefta-Gaub on 12/4/13. -// Copyright (c) 2013 High Fidelity, Inc. All rights reserved. +// Copyright 2013 High Fidelity, Inc. // +// 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__Particle__ diff --git a/libraries/particles/src/ParticleCollisionSystem.h b/libraries/particles/src/ParticleCollisionSystem.h index c6ab97c02b..50e262a736 100644 --- a/libraries/particles/src/ParticleCollisionSystem.h +++ b/libraries/particles/src/ParticleCollisionSystem.h @@ -1,10 +1,12 @@ // // ParticleCollisionSystem.h -// hifi +// libraries/particles/src // // Created by Brad Hefta-Gaub on 12/4/13. -// Copyright (c) 2013 High Fidelity, Inc. All rights reserved. +// Copyright 2013 High Fidelity, Inc. // +// 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__ParticleCollisionSystem__ diff --git a/libraries/particles/src/ParticleEditPacketSender.h b/libraries/particles/src/ParticleEditPacketSender.h index 3169c5629d..3a22b311a5 100644 --- a/libraries/particles/src/ParticleEditPacketSender.h +++ b/libraries/particles/src/ParticleEditPacketSender.h @@ -1,11 +1,12 @@ // // ParticleEditPacketSender.h -// shared +// libraries/particles/src // // Created by Brad Hefta-Gaub on 8/12/13. -// Copyright (c) 2013 High Fidelity, Inc. All rights reserved. +// Copyright 2013 High Fidelity, Inc. // -// Voxel Packet Sender +// Distributed under the Apache License, Version 2.0. +// See the accompanying file LICENSE or http://www.apache.org/licenses/LICENSE-2.0.html // #ifndef __shared__ParticleEditPacketSender__ diff --git a/libraries/particles/src/ParticleTree.h b/libraries/particles/src/ParticleTree.h index f3b8f5183d..20503085a2 100644 --- a/libraries/particles/src/ParticleTree.h +++ b/libraries/particles/src/ParticleTree.h @@ -1,9 +1,12 @@ // // ParticleTree.h -// hifi +// libraries/particles/src // // Created by Brad Hefta-Gaub on 12/4/13. -// Copyright (c) 2013 High Fidelity, Inc. All rights reserved. +// Copyright 2013 High Fidelity, Inc. +// +// 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__ParticleTree__ diff --git a/libraries/particles/src/ParticleTreeElement.h b/libraries/particles/src/ParticleTreeElement.h index 2854066f3b..95ba27b51e 100644 --- a/libraries/particles/src/ParticleTreeElement.h +++ b/libraries/particles/src/ParticleTreeElement.h @@ -1,10 +1,12 @@ // // ParticleTreeElement.h -// hifi +// libraries/particles/src // // Created by Brad Hefta-Gaub on 12/4/13. -// Copyright (c) 2013 High Fidelity, Inc. All rights reserved. +// Copyright 2013 High Fidelity, Inc. // +// 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__ParticleTreeElement__ diff --git a/libraries/particles/src/ParticleTreeHeadlessViewer.h b/libraries/particles/src/ParticleTreeHeadlessViewer.h index 08aa12280c..eafef3cf34 100644 --- a/libraries/particles/src/ParticleTreeHeadlessViewer.h +++ b/libraries/particles/src/ParticleTreeHeadlessViewer.h @@ -1,10 +1,12 @@ // // ParticleTreeHeadlessViewer.h -// hifi +// libraries/particles/src // -// Created by Brad Hefta-Gaub on 2/26/14 -// Copyright (c) 2014 High Fidelity, Inc. All rights reserved. +// Created by Brad Hefta-Gaub on 2/26/14. +// Copyright 2014 High Fidelity, Inc. // +// 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__ParticleTreeHeadlessViewer__ @@ -39,4 +41,4 @@ public: virtual void init(); }; -#endif /* defined(__hifi__ParticleTreeHeadlessViewer__) */ \ No newline at end of file +#endif /* defined(__hifi__ParticleTreeHeadlessViewer__) */ diff --git a/libraries/particles/src/ParticlesScriptingInterface.h b/libraries/particles/src/ParticlesScriptingInterface.h index 8de44e20bb..dbf80efa61 100644 --- a/libraries/particles/src/ParticlesScriptingInterface.h +++ b/libraries/particles/src/ParticlesScriptingInterface.h @@ -1,9 +1,12 @@ // // ParticlesScriptingInterface.h -// hifi +// libraries/particles/src // -// Created by Brad Hefta-Gaub on 12/6/13 -// Copyright (c) 2013 HighFidelity, Inc. All rights reserved. +// Created by Brad Hefta-Gaub on 12/6/13. +// Copyright 2013 High Fidelity, Inc. +// +// 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__ParticlesScriptingInterface__ diff --git a/libraries/script-engine/src/AbstractControllerScriptingInterface.h b/libraries/script-engine/src/AbstractControllerScriptingInterface.h index 1878edd4d6..23f1cc8477 100644 --- a/libraries/script-engine/src/AbstractControllerScriptingInterface.h +++ b/libraries/script-engine/src/AbstractControllerScriptingInterface.h @@ -1,9 +1,12 @@ // // AbstractControllerScriptingInterface.h -// hifi +// libraries/script-engine/src // -// Created by Brad Hefta-Gaub on 12/17/13 -// Copyright (c) 2013 HighFidelity, Inc. All rights reserved. +// Created by Brad Hefta-Gaub on 12/17/13. +// Copyright 2013 High Fidelity, Inc. +// +// 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__AbstractControllerScriptingInterface__ diff --git a/libraries/script-engine/src/EventTypes.h b/libraries/script-engine/src/EventTypes.h index f5a4fa5c9b..66f7523162 100644 --- a/libraries/script-engine/src/EventTypes.h +++ b/libraries/script-engine/src/EventTypes.h @@ -1,9 +1,12 @@ // // EventTypes.h -// hifi +// libraries/script-engine/src // // Created by Brad Hefta-Gaub on 1/28/14. -// Copyright (c) 2014 HighFidelity, Inc. All rights reserved. +// Copyright 2014 High Fidelity, Inc. +// +// 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_EventTypes_h__ diff --git a/libraries/script-engine/src/LocalVoxels.h b/libraries/script-engine/src/LocalVoxels.h index c64379ab27..82ed95fa66 100644 --- a/libraries/script-engine/src/LocalVoxels.h +++ b/libraries/script-engine/src/LocalVoxels.h @@ -1,9 +1,12 @@ // // LocalVoxels.h -// hifi +// libraries/script-engine/src // // Created by Clément Brisset on 2/24/14. -// Copyright (c) 2014 High Fidelity, Inc. All rights reserved. +// Copyright 2014 High Fidelity, Inc. +// +// 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__LocalVoxels__ diff --git a/libraries/script-engine/src/MenuItemProperties.h b/libraries/script-engine/src/MenuItemProperties.h index 82f00a2bc4..22853d7fca 100644 --- a/libraries/script-engine/src/MenuItemProperties.h +++ b/libraries/script-engine/src/MenuItemProperties.h @@ -1,9 +1,12 @@ // // MenuItemProperties.h -// hifi +// libraries/script-engine/src // // Created by Brad Hefta-Gaub on 1/28/14. -// Copyright (c) 2014 HighFidelity, Inc. All rights reserved. +// Copyright 2014 High Fidelity, Inc. +// +// 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_MenuItemProperties_h__ diff --git a/libraries/script-engine/src/Quat.h b/libraries/script-engine/src/Quat.h index 02c0a3e147..4b3f0b58db 100644 --- a/libraries/script-engine/src/Quat.h +++ b/libraries/script-engine/src/Quat.h @@ -1,12 +1,12 @@ // // Quat.h -// hifi +// libraries/script-engine/src // -// Created by Brad Hefta-Gaub on 1/29/14 -// Copyright (c) 2014 High Fidelity, Inc. All rights reserved. -// -// Scriptable Quaternion class library. +// Created by Brad Hefta-Gaub on 1/29/14. +// Copyright 2014 High Fidelity, Inc. // +// 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__Quat__ diff --git a/libraries/script-engine/src/ScriptEngine.h b/libraries/script-engine/src/ScriptEngine.h index 964f64a005..7fe4f23b53 100644 --- a/libraries/script-engine/src/ScriptEngine.h +++ b/libraries/script-engine/src/ScriptEngine.h @@ -1,9 +1,12 @@ // // ScriptEngine.h -// hifi +// libraries/script-engine/src // // Created by Brad Hefta-Gaub on 12/14/13. -// Copyright (c) 2013 HighFidelity, Inc. All rights reserved. +// Copyright 2013 High Fidelity, Inc. +// +// 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__ScriptEngine__ diff --git a/libraries/script-engine/src/Vec3.h b/libraries/script-engine/src/Vec3.h index cbec55b992..9e962ca4fd 100644 --- a/libraries/script-engine/src/Vec3.h +++ b/libraries/script-engine/src/Vec3.h @@ -1,12 +1,12 @@ // // Vec3.h -// hifi +// libraries/script-engine/src // -// Created by Brad Hefta-Gaub on 1/29/14 -// Copyright (c) 2014 High Fidelity, Inc. All rights reserved. -// -// Scriptable Vec3 class library. +// Created by Brad Hefta-Gaub on 1/29/14. +// Copyright 2014 High Fidelity, Inc. // +// 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__Vec3__ diff --git a/libraries/shared/src/AccountManager.h b/libraries/shared/src/AccountManager.h index 05a2e6a08a..992223f9ce 100644 --- a/libraries/shared/src/AccountManager.h +++ b/libraries/shared/src/AccountManager.h @@ -1,9 +1,12 @@ // // AccountManager.h -// hifi +// libraries/shared/src // // Created by Stephen Birarda on 2/18/2014. -// Copyright (c) 2014 HighFidelity, Inc. All rights reserved. +// Copyright 2014 High Fidelity, Inc. +// +// 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__AccountManager__ diff --git a/libraries/shared/src/AngleUtil.h b/libraries/shared/src/AngleUtil.h index cecee31188..e4d8abc28f 100644 --- a/libraries/shared/src/AngleUtil.h +++ b/libraries/shared/src/AngleUtil.h @@ -1,9 +1,12 @@ // -// AngleUtils.h -// hifi +// AngleUtil.h +// libraries/shared/src // -// Created by Tobias Schwinger on 3/23/13. -// Copyright (c) 2013 High Fidelity, Inc. All rights reserved. +// Created by Tobias Schwinger on 3/23/13. +// Copyright 2013 High Fidelity, Inc. +// +// 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__AngleUtils__ diff --git a/libraries/shared/src/Assignment.h b/libraries/shared/src/Assignment.h index a8ab3be4a8..437112a64f 100644 --- a/libraries/shared/src/Assignment.h +++ b/libraries/shared/src/Assignment.h @@ -1,9 +1,12 @@ // // Assignment.h -// hifi +// libraries/shared/src // // Created by Stephen Birarda on 8/22/13. -// Copyright (c) 2013 HighFidelity, Inc. All rights reserved. +// Copyright 2013 High Fidelity, Inc. +// +// 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__Assignment__ diff --git a/libraries/shared/src/CapsuleShape.h b/libraries/shared/src/CapsuleShape.h index 6d7e0a50be..b721633601 100644 --- a/libraries/shared/src/CapsuleShape.h +++ b/libraries/shared/src/CapsuleShape.h @@ -1,9 +1,12 @@ // // CapsuleShape.h -// hifi +// libraries/shared/src // -// Created by Andrew Meadows on 2014.02.20 -// Copyright (c) 2014 High Fidelity, Inc. All rights reserved. +// Created by Andrew Meadows on 2014. +// Copyright 2014 High Fidelity, Inc. +// +// 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__CapsuleShape__ diff --git a/libraries/shared/src/CollisionInfo.h b/libraries/shared/src/CollisionInfo.h index 868d259ce3..fb7450671b 100644 --- a/libraries/shared/src/CollisionInfo.h +++ b/libraries/shared/src/CollisionInfo.h @@ -1,9 +1,12 @@ // // CollisionInfo.h -// hifi +// libraries/shared/src // -// Created by Andrew Meadows on 2014.01.13 -// Copyright (c) 2014 High Fidelity, Inc. All rights reserved. +// Created by Andrew Meadows on 2014. +// Copyright 2014 High Fidelity, Inc. +// +// 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__CollisionInfo__ diff --git a/libraries/shared/src/DataServerAccountInfo.h b/libraries/shared/src/DataServerAccountInfo.h index c840468319..04d2e7fabd 100644 --- a/libraries/shared/src/DataServerAccountInfo.h +++ b/libraries/shared/src/DataServerAccountInfo.h @@ -1,9 +1,12 @@ // // DataServerAccountInfo.h -// hifi +// libraries/shared/src // // Created by Stephen Birarda on 2/21/2014. -// Copyright (c) 2014 HighFidelity, Inc. All rights reserved. +// Copyright 2014 High Fidelity, Inc. +// +// 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__DataServerAccountInfo__ diff --git a/libraries/shared/src/DomainInfo.h b/libraries/shared/src/DomainInfo.h index da65525f9d..563e2f8db0 100644 --- a/libraries/shared/src/DomainInfo.h +++ b/libraries/shared/src/DomainInfo.h @@ -1,9 +1,12 @@ // // DomainInfo.h -// hifi +// libraries/shared/src // // Created by Stephen Birarda on 2/18/2014. -// Copyright (c) 2014 HighFidelity, Inc. All rights reserved. +// Copyright 2014 High Fidelity, Inc. +// +// 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__DomainInfo__ diff --git a/libraries/shared/src/FileUtils.h b/libraries/shared/src/FileUtils.h index dd4605218e..6953676b83 100644 --- a/libraries/shared/src/FileUtils.h +++ b/libraries/shared/src/FileUtils.h @@ -1,9 +1,12 @@ // // FileUtils.h -// hifi +// libraries/shared/src // // Created by Stojce Slavkovski on 12/23/13. -// Copyright (c) 2013 High Fidelity, Inc. All rights reserved. +// Copyright 2013 High Fidelity, Inc. +// +// 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_FileUtils_h diff --git a/libraries/shared/src/FloodFill.h b/libraries/shared/src/FloodFill.h index 40a89bfd1b..5aeede2450 100644 --- a/libraries/shared/src/FloodFill.h +++ b/libraries/shared/src/FloodFill.h @@ -1,9 +1,11 @@ // // FloodFill.h -// hifi +// libraries/shared/src // -// Created by Tobias Schwinger 3/26/13. -// Copyright (c) 2013 High Fidelity, Inc. All rights reserved. +// Copyright 2013 High Fidelity, Inc. +// +// 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__FloodFill__ diff --git a/libraries/shared/src/GenericThread.h b/libraries/shared/src/GenericThread.h index 1b5b05db5d..dc5c33d341 100644 --- a/libraries/shared/src/GenericThread.h +++ b/libraries/shared/src/GenericThread.h @@ -1,11 +1,12 @@ // // GenericThread.h -// shared +// libraries/shared/src // // Created by Brad Hefta-Gaub on 8/12/13. -// Copyright (c) 2013 High Fidelity, Inc. All rights reserved. +// Copyright 2013 High Fidelity, Inc. // -// Generic Threaded or non-threaded processing class. +// Distributed under the Apache License, Version 2.0. +// See the accompanying file LICENSE or http://www.apache.org/licenses/LICENSE-2.0.html // #ifndef __shared__GenericThread__ diff --git a/libraries/shared/src/GeometryUtil.h b/libraries/shared/src/GeometryUtil.h index 12afc7c59c..3446956ffd 100644 --- a/libraries/shared/src/GeometryUtil.h +++ b/libraries/shared/src/GeometryUtil.h @@ -1,9 +1,12 @@ // // GeometryUtil.h -// interface +// libraries/shared/src // // Created by Andrzej Kapolka on 5/21/13. -// Copyright (c) 2013 High Fidelity, Inc. All rights reserved. +// Copyright 2013 High Fidelity, Inc. +// +// Distributed under the Apache License, Version 2.0. +// See the accompanying file LICENSE or http://www.apache.org/licenses/LICENSE-2.0.html // #ifndef __interface__GeometryUtil__ diff --git a/libraries/shared/src/HifiSockAddr.h b/libraries/shared/src/HifiSockAddr.h index e8f928c36d..da8c75baee 100644 --- a/libraries/shared/src/HifiSockAddr.h +++ b/libraries/shared/src/HifiSockAddr.h @@ -1,9 +1,12 @@ // // HifiSockAddr.h -// hifi +// libraries/shared/src // // Created by Stephen Birarda on 11/26/2013. -// Copyright (c) 2013 HighFidelity, Inc. All rights reserved. +// Copyright 2013 High Fidelity, Inc. +// +// 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__HifiSockAddr__ diff --git a/libraries/shared/src/ListShape.h b/libraries/shared/src/ListShape.h index d6005ddfb9..393f937946 100644 --- a/libraries/shared/src/ListShape.h +++ b/libraries/shared/src/ListShape.h @@ -1,10 +1,12 @@ // // ListShape.h +// libraries/shared/src // -// ListShape: A collection of shapes, each with a local transform. +// Created by Andrew Meadows on 2014. +// Copyright 2014 High Fidelity, Inc. // -// Created by Andrew Meadows on 2014.02.20 -// Copyright (c) 2014 High Fidelity, Inc. All rights reserved. +// 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__ListShape__ diff --git a/libraries/shared/src/Logging.h b/libraries/shared/src/Logging.h index abd5bfaab1..e17f3f3019 100644 --- a/libraries/shared/src/Logging.h +++ b/libraries/shared/src/Logging.h @@ -1,9 +1,12 @@ // // Logging.h -// hifi +// libraries/shared/src // // Created by Stephen Birarda on 6/11/13. -// Copyright (c) 2013 HighFidelity, Inc. All rights reserved. +// Copyright 2013 High Fidelity, Inc. +// +// 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__Logging__ diff --git a/libraries/shared/src/ModelUploader.h b/libraries/shared/src/ModelUploader.h index 0e62ab8705..7500b0fbb1 100644 --- a/libraries/shared/src/ModelUploader.h +++ b/libraries/shared/src/ModelUploader.h @@ -1,10 +1,12 @@ // // ModelUploader.h -// hifi +// libraries/shared/src // // Created by Clément Brisset on 3/4/14. -// Copyright (c) 2014 High Fidelity, Inc. All rights reserved. +// Copyright 2014 High Fidelity, Inc. // +// 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__ModelUploader__ diff --git a/libraries/shared/src/NetworkPacket.h b/libraries/shared/src/NetworkPacket.h index 0875b9f131..00c7caaa58 100644 --- a/libraries/shared/src/NetworkPacket.h +++ b/libraries/shared/src/NetworkPacket.h @@ -1,11 +1,12 @@ // // NetworkPacket.h -// shared +// libraries/shared/src // // Created by Brad Hefta-Gaub on 8/9/13. -// Copyright (c) 2013 High Fidelity, Inc. All rights reserved. +// Copyright 2013 High Fidelity, Inc. // -// A really simple class that stores a network packet between being received and being processed +// Distributed under the Apache License, Version 2.0. +// See the accompanying file LICENSE or http://www.apache.org/licenses/LICENSE-2.0.html // #ifndef __shared_NetworkPacket__ diff --git a/libraries/shared/src/Node.h b/libraries/shared/src/Node.h index 5d30d6f7b0..fd3c123df8 100644 --- a/libraries/shared/src/Node.h +++ b/libraries/shared/src/Node.h @@ -1,9 +1,12 @@ // // Node.h -// hifi +// libraries/shared/src // // Created by Stephen Birarda on 2/15/13. -// Copyright (c) 2013 High Fidelity, Inc. All rights reserved. +// Copyright 2013 High Fidelity, Inc. +// +// 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__Node__ diff --git a/libraries/shared/src/NodeData.h b/libraries/shared/src/NodeData.h index b6b75443a2..6dea803b3f 100644 --- a/libraries/shared/src/NodeData.h +++ b/libraries/shared/src/NodeData.h @@ -1,9 +1,12 @@ // // NodeData.h -// hifi +// libraries/shared/src // // Created by Stephen Birarda on 2/19/13. -// Copyright (c) 2013 High Fidelity, Inc. All rights reserved. +// Copyright 2013 High Fidelity, Inc. +// +// 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_NodeData_h diff --git a/libraries/shared/src/NodeList.h b/libraries/shared/src/NodeList.h index 34078b6a94..4071127131 100644 --- a/libraries/shared/src/NodeList.h +++ b/libraries/shared/src/NodeList.h @@ -1,9 +1,12 @@ // // NodeList.h -// hifi +// libraries/shared/src // // Created by Stephen Birarda on 2/15/13. -// Copyright (c) 2013 High Fidelity, Inc. All rights reserved. +// Copyright 2013 High Fidelity, Inc. +// +// 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__NodeList__ diff --git a/libraries/shared/src/OAuthAccessToken.h b/libraries/shared/src/OAuthAccessToken.h index e2a5eb4ce2..2159f595f2 100644 --- a/libraries/shared/src/OAuthAccessToken.h +++ b/libraries/shared/src/OAuthAccessToken.h @@ -1,9 +1,12 @@ // // OAuthAccessToken.h -// hifi +// libraries/shared/src // // Created by Stephen Birarda on 2/18/2014. -// Copyright (c) 2014 HighFidelity, Inc. All rights reserved. +// Copyright 2014 High Fidelity, Inc. +// +// 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__OAuthAccessToken__ diff --git a/libraries/shared/src/OctalCode.h b/libraries/shared/src/OctalCode.h index c80aa82a2d..535b8a0021 100644 --- a/libraries/shared/src/OctalCode.h +++ b/libraries/shared/src/OctalCode.h @@ -1,9 +1,12 @@ // // OctalCode.h -// hifi +// libraries/shared/src // // Created by Stephen Birarda on 3/15/13. -// Copyright (c) 2013 HighFidelity, Inc. All rights reserved. +// Copyright 2013 High Fidelity, Inc. +// +// 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__OctalCode__ diff --git a/libraries/shared/src/PacketHeaders.h b/libraries/shared/src/PacketHeaders.h index 0e1e152a02..491bdf5ac5 100644 --- a/libraries/shared/src/PacketHeaders.h +++ b/libraries/shared/src/PacketHeaders.h @@ -1,12 +1,12 @@ // // PacketHeaders.h -// hifi +// libraries/shared/src // // Created by Stephen Birarda on 4/8/13. -// Copyright (c) 2013 HighFidelity, Inc. All rights reserved. +// Copyright 2013 High Fidelity, Inc. // -// The packet headers below refer to the first byte of a received UDP packet transmitted between -// any two Hifi components. For example, a packet whose first byte is 'P' is always a ping packet. +// 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_PacketHeaders_h diff --git a/libraries/shared/src/PacketSender.h b/libraries/shared/src/PacketSender.h index bd8de9a1b1..01023f8ca3 100644 --- a/libraries/shared/src/PacketSender.h +++ b/libraries/shared/src/PacketSender.h @@ -1,11 +1,12 @@ // // PacketSender.h -// shared +// libraries/shared/src // // Created by Brad Hefta-Gaub on 8/12/13. -// Copyright (c) 2013 High Fidelity, Inc. All rights reserved. +// Copyright 2013 High Fidelity, Inc. // -// Threaded or non-threaded packet sender. +// Distributed under the Apache License, Version 2.0. +// See the accompanying file LICENSE or http://www.apache.org/licenses/LICENSE-2.0.html // #ifndef __shared__PacketSender__ diff --git a/libraries/shared/src/PerfStat.h b/libraries/shared/src/PerfStat.h index a7a10b97b8..4b4604feb3 100644 --- a/libraries/shared/src/PerfStat.h +++ b/libraries/shared/src/PerfStat.h @@ -1,13 +1,12 @@ // -// HiFiPerfStat.h -// hifi +// PerfStat.h +// libraries/shared/src // // Created by Brad Hefta-Gaub on 3/29/13. -// Copyright (c) 2013 HighFidelity, Inc. All rights reserved. -// -// Poor-man's performance stats collector class. Useful for collecting timing -// details from various portions of the code. +// Copyright 2013 High Fidelity, Inc. // +// 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__PerfStat__ diff --git a/libraries/shared/src/Radix2InplaceSort.h b/libraries/shared/src/Radix2InplaceSort.h index abd650b2a6..38c7b0b73c 100644 --- a/libraries/shared/src/Radix2InplaceSort.h +++ b/libraries/shared/src/Radix2InplaceSort.h @@ -1,9 +1,12 @@ // -// Radix2InplaceSort.h -// hifi +// Radix2InplaceSort.h +// libraries/shared/src // -// Created by Tobias Schwinger on 3/22/13. -// Copyright (c) 2013 High Fidelity, Inc. All rights reserved. +// Created by Tobias Schwinger on 3/22/13. +// Copyright 2013 High Fidelity, Inc. +// +// 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__Radix2InplaceSort__ diff --git a/libraries/shared/src/Radix2IntegerScanner.h b/libraries/shared/src/Radix2IntegerScanner.h index 84e7c7077e..2137db0548 100644 --- a/libraries/shared/src/Radix2IntegerScanner.h +++ b/libraries/shared/src/Radix2IntegerScanner.h @@ -1,9 +1,12 @@ // -// Radix2IntegerScanner.h -// hifi +// Radix2IntegerScanner.h +// libraries/shared/src // -// Created by Tobias Schwinger on 3/23/13. -// Copyright (c) 2013 High Fidelity, Inc. All rights reserved. +// Created by Tobias Schwinger on 3/23/13. +// Copyright 2013 High Fidelity, Inc. +// +// 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__Radix2IntegerScanner__ diff --git a/libraries/shared/src/ReceivedPacketProcessor.h b/libraries/shared/src/ReceivedPacketProcessor.h index f88512639b..e4365f4e18 100644 --- a/libraries/shared/src/ReceivedPacketProcessor.h +++ b/libraries/shared/src/ReceivedPacketProcessor.h @@ -1,11 +1,12 @@ // // ReceivedPacketProcessor.h -// shared +// libraries/shared/src // // Created by Brad Hefta-Gaub on 8/12/13. -// Copyright (c) 2013 High Fidelity, Inc. All rights reserved. +// Copyright 2013 High Fidelity, Inc. // -// Threaded or non-threaded received packet processor. +// Distributed under the Apache License, Version 2.0. +// See the accompanying file LICENSE or http://www.apache.org/licenses/LICENSE-2.0.html // #ifndef __shared__ReceivedPacketProcessor__ diff --git a/libraries/shared/src/RegisteredMetaTypes.h b/libraries/shared/src/RegisteredMetaTypes.h index 4e6a071dd6..93fb4e7f57 100644 --- a/libraries/shared/src/RegisteredMetaTypes.h +++ b/libraries/shared/src/RegisteredMetaTypes.h @@ -1,12 +1,12 @@ // // RegisteredMetaTypes.h -// hifi +// libraries/shared/src // // Created by Stephen Birarda on 10/3/13. -// Copyright (c) 2013 HighFidelity, Inc. All rights reserved. +// Copyright 2013 High Fidelity, Inc. // -// Used to register meta-types with Qt so that they can be used as properties for objects exposed to our -// Agent scripting. +// 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_RegisteredMetaTypes_h diff --git a/libraries/shared/src/ResourceCache.h b/libraries/shared/src/ResourceCache.h index 2fcda0bb98..984ab7aaa2 100644 --- a/libraries/shared/src/ResourceCache.h +++ b/libraries/shared/src/ResourceCache.h @@ -1,9 +1,12 @@ // // ResourceCache.h -// shared +// libraries/shared/src // // Created by Andrzej Kapolka on 2/27/14. -// Copyright (c) 2014 High Fidelity, Inc. All rights reserved. +// Copyright 2014 High Fidelity, Inc. +// +// Distributed under the Apache License, Version 2.0. +// See the accompanying file LICENSE or http://www.apache.org/licenses/LICENSE-2.0.html // #ifndef __shared__ResourceCache__ diff --git a/libraries/shared/src/Shape.h b/libraries/shared/src/Shape.h index 924d13000e..11ce41d103 100644 --- a/libraries/shared/src/Shape.h +++ b/libraries/shared/src/Shape.h @@ -1,8 +1,12 @@ // // Shape.h +// libraries/shared/src // -// Created by Andrew Meadows on 2014.02.20 -// Copyright (c) 2014 High Fidelity, Inc. All rights reserved. +// Created by Andrew Meadows on 2014. +// Copyright 2014 High Fidelity, Inc. +// +// 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__Shape__ diff --git a/libraries/shared/src/ShapeCollider.h b/libraries/shared/src/ShapeCollider.h index e3e044c8fe..7154a158d0 100644 --- a/libraries/shared/src/ShapeCollider.h +++ b/libraries/shared/src/ShapeCollider.h @@ -1,9 +1,12 @@ // // ShapeCollider.h -// hifi +// libraries/shared/src // -// Created by Andrew Meadows on 2014.02.20 -// Copyright (c) 2014 High Fidelity, Inc. All rights reserved. +// Created by Andrew Meadows on 2014. +// Copyright 2014 High Fidelity, Inc. +// +// 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__ShapeCollider__ diff --git a/libraries/shared/src/SharedUtil.h b/libraries/shared/src/SharedUtil.h index d8d686c63b..90dd0ccfe8 100644 --- a/libraries/shared/src/SharedUtil.h +++ b/libraries/shared/src/SharedUtil.h @@ -1,9 +1,12 @@ // // SharedUtil.h -// hifi +// libraries/shared/src // // Created by Stephen Birarda on 2/22/13. -// Copyright (c) 2013 HighFidelity, Inc. All rights reserved. +// Copyright 2013 High Fidelity, Inc. +// +// 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__SharedUtil__ diff --git a/libraries/shared/src/SimpleMovingAverage.h b/libraries/shared/src/SimpleMovingAverage.h index f11cd16e58..8b862f9d63 100644 --- a/libraries/shared/src/SimpleMovingAverage.h +++ b/libraries/shared/src/SimpleMovingAverage.h @@ -1,11 +1,12 @@ // // SimpleMovingAverage.h -// hifi +// libraries/shared/src // // Created by Stephen Birarda on 4/18/13. -// Copyright (c) 2013 HighFidelity, Inc. All rights reserved. +// Copyright 2013 High Fidelity, Inc. // -// Replaces Brad Hefta-Gaub's CounterStats class (RIP) +// 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__Stats__ diff --git a/libraries/shared/src/SphereShape.h b/libraries/shared/src/SphereShape.h index d720dd2289..746f93be80 100644 --- a/libraries/shared/src/SphereShape.h +++ b/libraries/shared/src/SphereShape.h @@ -1,9 +1,12 @@ // // SphereShape.h -// hifi +// libraries/shared/src // -// Created by Andrew Meadows on 2014.02.20 -// Copyright (c) 2014 High Fidelity, Inc. All rights reserved. +// Created by Andrew Meadows on 2014. +// Copyright 2014 High Fidelity, Inc. +// +// 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__SphereShape__ diff --git a/libraries/shared/src/StdDev.h b/libraries/shared/src/StdDev.h index eea0cff3bb..82fccdd79a 100644 --- a/libraries/shared/src/StdDev.h +++ b/libraries/shared/src/StdDev.h @@ -1,9 +1,12 @@ // // StdDev.h -// hifi +// libraries/shared/src // // Created by Philip Rosedale on 3/12/13. +// Copyright 2013 High Fidelity, Inc. // +// 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__StdDev__ diff --git a/libraries/shared/src/StreamUtils.h b/libraries/shared/src/StreamUtils.h index 1a17a94658..d70096bd27 100644 --- a/libraries/shared/src/StreamUtils.h +++ b/libraries/shared/src/StreamUtils.h @@ -1,8 +1,12 @@ // // StreamUtils.h +// libraries/shared/src // -// Created by Andrew Meadows on 2014.02.21 -// Copyright (c) 2014 High Fidelity, Inc. All rights reserved. +// Created by Andrew Meadows on 2014. +// Copyright 2014 High Fidelity, Inc. +// +// Distributed under the Apache License, Version 2.0. +// See the accompanying file LICENSE or http://www.apache.org/licenses/LICENSE-2.0.html // #ifndef __tests__StreamUtils__ diff --git a/libraries/shared/src/ThreadedAssignment.h b/libraries/shared/src/ThreadedAssignment.h index f9652dd98d..9f1f45c1a9 100644 --- a/libraries/shared/src/ThreadedAssignment.h +++ b/libraries/shared/src/ThreadedAssignment.h @@ -1,9 +1,12 @@ // // ThreadedAssignment.h -// hifi +// libraries/shared/src // // Created by Stephen Birarda on 12/3/2013. -// Copyright (c) 2013 HighFidelity, Inc. All rights reserved. +// Copyright 2013 High Fidelity, Inc. +// +// 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__ThreadedAssignment__ diff --git a/libraries/shared/src/UUID.h b/libraries/shared/src/UUID.h index cacadf5a04..da0025d425 100644 --- a/libraries/shared/src/UUID.h +++ b/libraries/shared/src/UUID.h @@ -1,9 +1,12 @@ // // UUID.h -// hifi +// libraries/shared/src // // Created by Stephen Birarda on 10/7/13. -// Copyright (c) 2013 HighFidelity, Inc. All rights reserved. +// Copyright 2013 High Fidelity, Inc. +// +// 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__UUID__ diff --git a/libraries/voxels/src/EnvironmentData.h b/libraries/voxels/src/EnvironmentData.h index 627a661e1c..fe0e279ba8 100644 --- a/libraries/voxels/src/EnvironmentData.h +++ b/libraries/voxels/src/EnvironmentData.h @@ -1,9 +1,12 @@ // // EnvironmentData.h -// interface +// libraries/voxels/src // // Created by Andrzej Kapolka on 5/6/13. -// Copyright (c) 2013 High Fidelity, Inc. All rights reserved. +// Copyright 2013 High Fidelity, Inc. +// +// Distributed under the Apache License, Version 2.0. +// See the accompanying file LICENSE or http://www.apache.org/licenses/LICENSE-2.0.html // #ifndef __interface__EnvironmentData__ diff --git a/libraries/voxels/src/LocalVoxelsList.h b/libraries/voxels/src/LocalVoxelsList.h index e4b4decf8e..2ec68d3234 100644 --- a/libraries/voxels/src/LocalVoxelsList.h +++ b/libraries/voxels/src/LocalVoxelsList.h @@ -1,9 +1,12 @@ // // LocalVoxelsList.h -// hifi +// libraries/voxels/src // // Created by Clément Brisset on 2/24/14. -// Copyright (c) 2014 High Fidelity, Inc. All rights reserved. +// Copyright 2014 High Fidelity, Inc. +// +// 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__LocalVoxelsList__ diff --git a/libraries/voxels/src/Tags.h b/libraries/voxels/src/Tags.h index caf4303c51..ec1ae8c0e8 100644 --- a/libraries/voxels/src/Tags.h +++ b/libraries/voxels/src/Tags.h @@ -1,9 +1,12 @@ // // Tags.h -// hifi +// libraries/voxels/src // // Created by Clement Brisset on 7/3/13. -// Copyright (c) 2013 High Fidelity, Inc. All rights reserved. +// Copyright 2013 High Fidelity, Inc. +// +// 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__Tags__ diff --git a/libraries/voxels/src/VoxelConstants.h b/libraries/voxels/src/VoxelConstants.h index 16d75873d9..a375e23b7c 100644 --- a/libraries/voxels/src/VoxelConstants.h +++ b/libraries/voxels/src/VoxelConstants.h @@ -1,11 +1,12 @@ // // VoxelConstants.h -// hifi +// 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__ @@ -44,4 +45,4 @@ const quint64 CLIENT_TO_SERVER_VOXEL_SEND_INTERVAL_USECS = 1000 * 5; // 1 packet const int DEFAULT_MAX_VOXEL_PPS = 600; // the default maximum PPS we think a voxel server should send to a client -#endif \ No newline at end of file +#endif diff --git a/libraries/voxels/src/VoxelDetail.h b/libraries/voxels/src/VoxelDetail.h index 1604a022a0..5ed68f540e 100644 --- a/libraries/voxels/src/VoxelDetail.h +++ b/libraries/voxels/src/VoxelDetail.h @@ -1,10 +1,12 @@ // // VoxelDetail.h -// hifi +// libraries/voxels/src // -// Created by Brad Hefta-Gaub on 1/29/2014 -// Copyright (c) 2013 High Fidelity, Inc. All rights reserved. +// Created by Brad Hefta-Gaub on 1/29/2014. +// Copyright 2013 High Fidelity, Inc. // +// 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__VoxelDetail__ @@ -48,4 +50,4 @@ Q_DECLARE_METATYPE(RayToVoxelIntersectionResult) QScriptValue rayToVoxelIntersectionResultToScriptValue(QScriptEngine* engine, const RayToVoxelIntersectionResult& results); void rayToVoxelIntersectionResultFromScriptValue(const QScriptValue& object, RayToVoxelIntersectionResult& results); -#endif /* defined(__hifi__VoxelDetail__) */ \ No newline at end of file +#endif /* defined(__hifi__VoxelDetail__) */ diff --git a/libraries/voxels/src/VoxelEditPacketSender.h b/libraries/voxels/src/VoxelEditPacketSender.h index 4a1aa87a1c..37c65207f6 100644 --- a/libraries/voxels/src/VoxelEditPacketSender.h +++ b/libraries/voxels/src/VoxelEditPacketSender.h @@ -1,11 +1,12 @@ // // VoxelEditPacketSender.h -// shared +// libraries/voxels/src // // Created by Brad Hefta-Gaub on 8/12/13. -// Copyright (c) 2013 High Fidelity, Inc. All rights reserved. +// Copyright 2013 High Fidelity, Inc. // -// Voxel Packet Sender +// Distributed under the Apache License, Version 2.0. +// See the accompanying file LICENSE or http://www.apache.org/licenses/LICENSE-2.0.html // #ifndef __shared__VoxelEditPacketSender__ diff --git a/libraries/voxels/src/VoxelTree.h b/libraries/voxels/src/VoxelTree.h index 2079ab91b2..1fafd429ed 100644 --- a/libraries/voxels/src/VoxelTree.h +++ b/libraries/voxels/src/VoxelTree.h @@ -1,9 +1,12 @@ // // VoxelTree.h -// hifi +// libraries/voxels/src // // Created by Stephen Birarda on 3/13/13. -// Copyright (c) 2013 High Fidelity, Inc. All rights reserved. +// Copyright 2013 High Fidelity, Inc. +// +// 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__VoxelTree__ diff --git a/libraries/voxels/src/VoxelTreeCommands.h b/libraries/voxels/src/VoxelTreeCommands.h index ca7700417c..314a49b845 100644 --- a/libraries/voxels/src/VoxelTreeCommands.h +++ b/libraries/voxels/src/VoxelTreeCommands.h @@ -1,9 +1,12 @@ // // VoxelTreeCommands.h -// hifi +// libraries/voxels/src // // Created by Clement on 4/4/14. -// Copyright (c) 2013 High Fidelity, Inc. All rights reserved. +// Copyright 2013 High Fidelity, Inc. +// +// 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__VoxelTreeCommands__ diff --git a/libraries/voxels/src/VoxelTreeElement.h b/libraries/voxels/src/VoxelTreeElement.h index c88fd6d207..757cffc8bc 100644 --- a/libraries/voxels/src/VoxelTreeElement.h +++ b/libraries/voxels/src/VoxelTreeElement.h @@ -1,9 +1,12 @@ // // VoxelTreeElement.h -// hifi +// libraries/voxels/src // // Created by Stephen Birarda on 3/13/13. +// Copyright 2013 High Fidelity, Inc. // +// 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__VoxelTreeElement__ diff --git a/libraries/voxels/src/VoxelTreeHeadlessViewer.h b/libraries/voxels/src/VoxelTreeHeadlessViewer.h index 9c7481c929..55366010ad 100644 --- a/libraries/voxels/src/VoxelTreeHeadlessViewer.h +++ b/libraries/voxels/src/VoxelTreeHeadlessViewer.h @@ -1,10 +1,12 @@ // // VoxelTreeHeadlessViewer.h -// hifi +// libraries/voxels/src // -// Created by Brad Hefta-Gaub on 2/26/14 -// Copyright (c) 2014 High Fidelity, Inc. All rights reserved. +// Created by Brad Hefta-Gaub on 2/26/14. +// Copyright 2014 High Fidelity, Inc. // +// 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__VoxelTreeHeadlessViewer__ @@ -35,4 +37,4 @@ public: virtual void init(); }; -#endif /* defined(__hifi__VoxelTreeHeadlessViewer__) */ \ No newline at end of file +#endif /* defined(__hifi__VoxelTreeHeadlessViewer__) */ diff --git a/libraries/voxels/src/VoxelsScriptingInterface.h b/libraries/voxels/src/VoxelsScriptingInterface.h index da51259eeb..05c93aab8e 100644 --- a/libraries/voxels/src/VoxelsScriptingInterface.h +++ b/libraries/voxels/src/VoxelsScriptingInterface.h @@ -1,9 +1,12 @@ // // VoxelsScriptingInterface.h -// hifi +// libraries/voxels/src // // Created by Stephen Birarda on 9/17/13. -// Copyright (c) 2013 HighFidelity, Inc. All rights reserved. +// Copyright 2013 High Fidelity, Inc. +// +// 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__VoxelsScriptingInterface__ diff --git a/voxel-edit/src/SceneUtils.h b/voxel-edit/src/SceneUtils.h index 6f52a14f05..90b605f2c7 100644 --- a/voxel-edit/src/SceneUtils.h +++ b/voxel-edit/src/SceneUtils.h @@ -1,9 +1,12 @@ // // SceneUtils.h -// hifi +// voxel-edit/src // // Created by Brad Hefta-Gaub on 5/7/2013. +// Copyright 2013 High Fidelity, Inc. // +// 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__SceneUtil__ From 638b49e47d3d833f2399b084caf56038bec2ee9b Mon Sep 17 00:00:00 2001 From: Stephen Birarda Date: Tue, 8 Apr 2014 17:31:02 -0700 Subject: [PATCH 028/120] switch to apache license in root license file --- LICENSE | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/LICENSE b/LICENSE index 1ecd0026f5..93c9a953d4 100644 --- a/LICENSE +++ b/LICENSE @@ -1 +1,13 @@ -All rights reserved. © High Fidelity, Inc. 2013 \ No newline at end of file +Copyright 2014 High Fidelity, Inc. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. \ No newline at end of file From ab3a9af6bfc36e5ebeaff1f2e969185cb4faded6 Mon Sep 17 00:00:00 2001 From: Stephen Birarda Date: Tue, 8 Apr 2014 17:31:30 -0700 Subject: [PATCH 029/120] repair the starfield renderer --- interface/src/starfield/renderer/Renderer.h | 51 ++++++++++++++++++++- 1 file changed, 49 insertions(+), 2 deletions(-) diff --git a/interface/src/starfield/renderer/Renderer.h b/interface/src/starfield/renderer/Renderer.h index 7eaeb1444e..8b75f4e953 100755 --- a/interface/src/starfield/renderer/Renderer.h +++ b/interface/src/starfield/renderer/Renderer.h @@ -9,6 +9,54 @@ // See the accompanying file LICENSE or http://www.apache.org/licenses/LICENSE-2.0.html // +#ifndef __interface__starfield__renderer__Renderer__ +#define __interface__starfield__renderer__Renderer__ + +#include "starfield/Config.h" +#include "starfield/data/InputVertex.h" +#include "starfield/data/Tile.h" +#include "starfield/data/GpuVertex.h" +#include "starfield/renderer/Tiling.h" + +// +// FOV culling +// =========== +// +// As stars can be thought of as at infinity distance, the field of view only +// depends on perspective and rotation: +// +// _----_ <-- visible stars +// from above +-near-+ - - +// \ / | +// near width: \ / | cos(p/2) +// 2sin(p/2) \/ _ +// center +// +// +// Now it is important to note that a change in altitude maps uniformly to a +// distance on a sphere. This is NOT the case for azimuthal angles: In this +// case a factor of 'cos(alt)' (the orbital radius) applies: +// +// +// |<-cos alt ->| | |<-|<----->|->| d_azi cos(alt) +// | +// __--* | --------- - +// __-- * | | | ^ d_alt +// __-- alt) * | | | v +// --------------*- | ------------- - +// | +// side view | tile on sphere +// +// +// This lets us find a worst-case (Eigen) angle from the center to the edge +// of a tile as +// +// hypot( 0.5 d_alt, 0.5 d_azi cos(alt_absmin) ). +// +// This angle must be added to 'p' (the perspective angle) in order to find +// an altered near plane for the culling decision. +// + namespace starfield { class Renderer { @@ -90,5 +138,4 @@ namespace starfield { } -#endif - +#endif \ No newline at end of file From 387179b38fe22d93d1d449eac6de0be0deb7103e Mon Sep 17 00:00:00 2001 From: Stephen Birarda Date: Tue, 8 Apr 2014 17:31:53 -0700 Subject: [PATCH 030/120] add Norman's tagline back to PrimitiveRenderer --- interface/src/voxels/PrimitiveRenderer.h | 1 + 1 file changed, 1 insertion(+) diff --git a/interface/src/voxels/PrimitiveRenderer.h b/interface/src/voxels/PrimitiveRenderer.h index 92536190e2..268b4f3175 100644 --- a/interface/src/voxels/PrimitiveRenderer.h +++ b/interface/src/voxels/PrimitiveRenderer.h @@ -2,6 +2,7 @@ // PrimitiveRenderer.h // interface/src/voxels // +// Created by Norman Craft. // Copyright 2014 High Fidelity, Inc. // // Distributed under the Apache License, Version 2.0. From 7ce91b3f968e1ac4377fb26b47eaf8727f83d7da Mon Sep 17 00:00:00 2001 From: Stephen Birarda Date: Tue, 8 Apr 2014 17:43:35 -0700 Subject: [PATCH 031/120] fix headers who had their comments removed --- .../src/octree/OctreeInboundPacketProcessor.h | 2 ++ assignment-client/src/octree/OctreeSendThread.h | 2 ++ interface/src/ui/RearMirrorTools.h | 2 +- interface/src/voxels/VoxelHideShowThread.h | 2 ++ interface/src/windowshacks.h | 2 ++ libraries/embedded-webserver/src/HTTPManager.h | 4 ++++ libraries/octree/src/AABox.h | 4 +++- libraries/octree/src/JurisdictionListener.h | 3 ++- libraries/octree/src/OctreeElementBag.h | 5 +++++ libraries/octree/src/OctreePacketData.h | 10 ++++++++++ libraries/octree/src/OctreePersistThread.h | 2 ++ libraries/octree/src/OctreeProjectedPolygon.h | 2 ++ libraries/octree/src/ViewFrustum.h | 2 ++ libraries/script-engine/src/Quat.h | 2 ++ libraries/shared/src/GenericThread.h | 2 ++ libraries/shared/src/ListShape.h | 4 +++- libraries/shared/src/NetworkPacket.h | 2 ++ libraries/shared/src/PerfStat.h | 3 +++ libraries/shared/src/SimpleMovingAverage.h | 2 ++ libraries/voxels/src/VoxelConstants.h | 2 ++ libraries/voxels/src/VoxelEditPacketSender.h | 2 ++ 21 files changed, 57 insertions(+), 4 deletions(-) diff --git a/assignment-client/src/octree/OctreeInboundPacketProcessor.h b/assignment-client/src/octree/OctreeInboundPacketProcessor.h index 1a4f80b925..e14065a9c1 100644 --- a/assignment-client/src/octree/OctreeInboundPacketProcessor.h +++ b/assignment-client/src/octree/OctreeInboundPacketProcessor.h @@ -5,6 +5,8 @@ // Created by Brad Hefta-Gaub on 8/21/13. // Copyright 2013 High Fidelity, Inc. // +// Threaded or non-threaded network packet processor for the voxel-server +// // Distributed under the Apache License, Version 2.0. // See the accompanying file LICENSE or http://www.apache.org/licenses/LICENSE-2.0.html // diff --git a/assignment-client/src/octree/OctreeSendThread.h b/assignment-client/src/octree/OctreeSendThread.h index 09d5809acc..423d9fc2bb 100644 --- a/assignment-client/src/octree/OctreeSendThread.h +++ b/assignment-client/src/octree/OctreeSendThread.h @@ -5,6 +5,8 @@ // Created by Brad Hefta-Gaub on 8/21/13. // Copyright 2013 High Fidelity, Inc. // +// Threaded or non-threaded object for sending voxels to a client +// // Distributed under the Apache License, Version 2.0. // See the accompanying file LICENSE or http://www.apache.org/licenses/LICENSE-2.0.html // diff --git a/interface/src/ui/RearMirrorTools.h b/interface/src/ui/RearMirrorTools.h index f410b0b5ff..6230771b4b 100644 --- a/interface/src/ui/RearMirrorTools.h +++ b/interface/src/ui/RearMirrorTools.h @@ -2,7 +2,7 @@ // RearMirrorTools.h // interface/src/ui // -// Created by stojce on 23. +// Created by stojce on 10/23/2013. // Copyright 2013 High Fidelity, Inc. // // Distributed under the Apache License, Version 2.0. diff --git a/interface/src/voxels/VoxelHideShowThread.h b/interface/src/voxels/VoxelHideShowThread.h index 29aa53f430..b12befc9de 100644 --- a/interface/src/voxels/VoxelHideShowThread.h +++ b/interface/src/voxels/VoxelHideShowThread.h @@ -5,6 +5,8 @@ // Created by Brad Hefta-Gaub on 12/1/13. // Copyright 2013 High Fidelity, Inc. // +// Threaded or non-threaded voxel persistence +// // Distributed under the Apache License, Version 2.0. // See the accompanying file LICENSE or http://www.apache.org/licenses/LICENSE-2.0.html // diff --git a/interface/src/windowshacks.h b/interface/src/windowshacks.h index 07ef69c6f0..3563c2a765 100644 --- a/interface/src/windowshacks.h +++ b/interface/src/windowshacks.h @@ -5,6 +5,8 @@ // Created by Brad Hefta-Gaub on 1/12/14. // Copyright 2014 High Fidelity, Inc. // +// hacks to get windows to compile +// // Distributed under the Apache License, Version 2.0. // See the accompanying file LICENSE or http://www.apache.org/licenses/LICENSE-2.0.html // diff --git a/libraries/embedded-webserver/src/HTTPManager.h b/libraries/embedded-webserver/src/HTTPManager.h index 91f185de2e..c7bb479ab2 100755 --- a/libraries/embedded-webserver/src/HTTPManager.h +++ b/libraries/embedded-webserver/src/HTTPManager.h @@ -5,6 +5,10 @@ // Created by Stephen Birarda on 1/16/14. // Copyright 2014 High Fidelity, Inc. // +// Heavily based on Andrzej Kapolka's original HTTPManager class +// found from another one of his projects. +// https://github.com/ey6es/witgap/tree/master/src/cpp/server/http +// // Distributed under the Apache License, Version 2.0. // See the accompanying file LICENSE or http://www.apache.org/licenses/LICENSE-2.0.html // diff --git a/libraries/octree/src/AABox.h b/libraries/octree/src/AABox.h index 2b9be1246f..1d5fad696c 100644 --- a/libraries/octree/src/AABox.h +++ b/libraries/octree/src/AABox.h @@ -5,6 +5,9 @@ // Created by Brad Hefta-Gaub on 04/11/13. // Copyright 2013 High Fidelity, Inc. // +// Originally from lighthouse3d. Modified to utilize glm::vec3 and clean up to our coding standards +// Simple axis aligned box class. +// // Distributed under the Apache License, Version 2.0. // See the accompanying file LICENSE or http://www.apache.org/licenses/LICENSE-2.0.html // @@ -23,7 +26,6 @@ enum BoxFace { MAX_Z_FACE }; - enum BoxVertex { BOTTOM_LEFT_NEAR = 0, BOTTOM_RIGHT_NEAR = 1, diff --git a/libraries/octree/src/JurisdictionListener.h b/libraries/octree/src/JurisdictionListener.h index 981f7d1a42..2d5cd75560 100644 --- a/libraries/octree/src/JurisdictionListener.h +++ b/libraries/octree/src/JurisdictionListener.h @@ -5,6 +5,8 @@ // Created by Brad Hefta-Gaub on 8/12/13. // Copyright 2013 High Fidelity, Inc. // +// Voxel Packet Sender +// // Distributed under the Apache License, Version 2.0. // See the accompanying file LICENSE or http://www.apache.org/licenses/LICENSE-2.0.html // @@ -16,7 +18,6 @@ #include #include - #include "JurisdictionMap.h" /// Sends out PacketType_JURISDICTION_REQUEST packets to all voxel servers and then listens for and processes diff --git a/libraries/octree/src/OctreeElementBag.h b/libraries/octree/src/OctreeElementBag.h index fa3cbf0319..0c17d9f1fa 100644 --- a/libraries/octree/src/OctreeElementBag.h +++ b/libraries/octree/src/OctreeElementBag.h @@ -5,6 +5,11 @@ // Created by Brad Hefta-Gaub on 4/25/2013. // Copyright 2013 High Fidelity, Inc. // +// This class is used by the VoxelTree:encodeTreeBitstream() functions to store extra nodes that need to be sent +// it's a generic bag style storage mechanism. But It has the property that you can't put the same node into the bag +// more than once (in other words, it de-dupes automatically), also, it supports collapsing it's several peer nodes +// into a parent node in cases where you add enough peers that it makes more sense to just add the parent. +// // Distributed under the Apache License, Version 2.0. // See the accompanying file LICENSE or http://www.apache.org/licenses/LICENSE-2.0.html // diff --git a/libraries/octree/src/OctreePacketData.h b/libraries/octree/src/OctreePacketData.h index 1efea6c217..64e7c07161 100644 --- a/libraries/octree/src/OctreePacketData.h +++ b/libraries/octree/src/OctreePacketData.h @@ -5,6 +5,16 @@ // Created by Brad Hefta-Gaub on 11/19/2013. // Copyright 2013 High Fidelity, Inc. // +// TO DO: +// * add stats tracking for number of unique colors and consecutive identical colors. +// (as research for color dictionaries and RLE) +// +// * further testing of compression to determine optimal configuration for performance and compression +// +// * improve semantics for "reshuffle" - current approach will work for now and with compression +// but wouldn't work with RLE because the colors in the levels would get reordered and RLE would need +// to be recalculated +// // Distributed under the Apache License, Version 2.0. // See the accompanying file LICENSE or http://www.apache.org/licenses/LICENSE-2.0.html // diff --git a/libraries/octree/src/OctreePersistThread.h b/libraries/octree/src/OctreePersistThread.h index 8d96ac945d..90b83b4c86 100644 --- a/libraries/octree/src/OctreePersistThread.h +++ b/libraries/octree/src/OctreePersistThread.h @@ -5,6 +5,8 @@ // Created by Brad Hefta-Gaub on 8/21/13. // Copyright 2013 High Fidelity, Inc. // +// Threaded or non-threaded Octree persistence +// // Distributed under the Apache License, Version 2.0. // See the accompanying file LICENSE or http://www.apache.org/licenses/LICENSE-2.0.html // diff --git a/libraries/octree/src/OctreeProjectedPolygon.h b/libraries/octree/src/OctreeProjectedPolygon.h index e551a6c005..ff3a28649e 100644 --- a/libraries/octree/src/OctreeProjectedPolygon.h +++ b/libraries/octree/src/OctreeProjectedPolygon.h @@ -5,6 +5,8 @@ // Created by Brad Hefta-Gaub on 06/11/13. // Copyright 2013 High Fidelity, Inc. // +// The projected shadow (on the 2D view plane) for a voxel +// // Distributed under the Apache License, Version 2.0. // See the accompanying file LICENSE or http://www.apache.org/licenses/LICENSE-2.0.html // diff --git a/libraries/octree/src/ViewFrustum.h b/libraries/octree/src/ViewFrustum.h index 6553dab1a1..65ff992ee4 100644 --- a/libraries/octree/src/ViewFrustum.h +++ b/libraries/octree/src/ViewFrustum.h @@ -5,6 +5,8 @@ // Created by Brad Hefta-Gaub on 04/11/13. // Copyright 2013 High Fidelity, Inc. // +// Simple view frustum class. +// // Distributed under the Apache License, Version 2.0. // See the accompanying file LICENSE or http://www.apache.org/licenses/LICENSE-2.0.html // diff --git a/libraries/script-engine/src/Quat.h b/libraries/script-engine/src/Quat.h index 4b3f0b58db..418488fe2e 100644 --- a/libraries/script-engine/src/Quat.h +++ b/libraries/script-engine/src/Quat.h @@ -5,6 +5,8 @@ // Created by Brad Hefta-Gaub on 1/29/14. // Copyright 2014 High Fidelity, Inc. // +// Scriptable Quaternion class library. +// // Distributed under the Apache License, Version 2.0. // See the accompanying file LICENSE or http://www.apache.org/licenses/LICENSE-2.0.html // diff --git a/libraries/shared/src/GenericThread.h b/libraries/shared/src/GenericThread.h index dc5c33d341..2aaa081aa8 100644 --- a/libraries/shared/src/GenericThread.h +++ b/libraries/shared/src/GenericThread.h @@ -5,6 +5,8 @@ // Created by Brad Hefta-Gaub on 8/12/13. // Copyright 2013 High Fidelity, Inc. // +// Generic Threaded or non-threaded processing class. +// // Distributed under the Apache License, Version 2.0. // See the accompanying file LICENSE or http://www.apache.org/licenses/LICENSE-2.0.html // diff --git a/libraries/shared/src/ListShape.h b/libraries/shared/src/ListShape.h index 393f937946..b8a8fb018d 100644 --- a/libraries/shared/src/ListShape.h +++ b/libraries/shared/src/ListShape.h @@ -2,9 +2,11 @@ // ListShape.h // libraries/shared/src // -// Created by Andrew Meadows on 2014. +// Created by Andrew Meadows on 02/20/2014. // Copyright 2014 High Fidelity, Inc. // +// ListShape: A collection of shapes, each with a local transform. +// // Distributed under the Apache License, Version 2.0. // See the accompanying file LICENSE or http://www.apache.org/licenses/LICENSE-2.0.html // diff --git a/libraries/shared/src/NetworkPacket.h b/libraries/shared/src/NetworkPacket.h index 00c7caaa58..bc9e3def40 100644 --- a/libraries/shared/src/NetworkPacket.h +++ b/libraries/shared/src/NetworkPacket.h @@ -5,6 +5,8 @@ // Created by Brad Hefta-Gaub on 8/9/13. // Copyright 2013 High Fidelity, Inc. // +// A really simple class that stores a network packet between being received and being processed +// // Distributed under the Apache License, Version 2.0. // See the accompanying file LICENSE or http://www.apache.org/licenses/LICENSE-2.0.html // diff --git a/libraries/shared/src/PerfStat.h b/libraries/shared/src/PerfStat.h index 4b4604feb3..c3ae12a825 100644 --- a/libraries/shared/src/PerfStat.h +++ b/libraries/shared/src/PerfStat.h @@ -5,6 +5,9 @@ // Created by Brad Hefta-Gaub on 3/29/13. // Copyright 2013 High Fidelity, Inc. // +// Poor-man's performance stats collector class. Useful for collecting timing +// details from various portions of the code. +// // Distributed under the Apache License, Version 2.0. // See the accompanying file LICENSE or http://www.apache.org/licenses/LICENSE-2.0.html // diff --git a/libraries/shared/src/SimpleMovingAverage.h b/libraries/shared/src/SimpleMovingAverage.h index 8b862f9d63..16d30279b0 100644 --- a/libraries/shared/src/SimpleMovingAverage.h +++ b/libraries/shared/src/SimpleMovingAverage.h @@ -5,6 +5,8 @@ // Created by Stephen Birarda on 4/18/13. // Copyright 2013 High Fidelity, Inc. // +// Replaces Brad Hefta-Gaub's CounterStats class (RIP) +// // Distributed under the Apache License, Version 2.0. // See the accompanying file LICENSE or http://www.apache.org/licenses/LICENSE-2.0.html // diff --git a/libraries/voxels/src/VoxelConstants.h b/libraries/voxels/src/VoxelConstants.h index a375e23b7c..fc2c502a65 100644 --- a/libraries/voxels/src/VoxelConstants.h +++ b/libraries/voxels/src/VoxelConstants.h @@ -5,6 +5,8 @@ // 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 // diff --git a/libraries/voxels/src/VoxelEditPacketSender.h b/libraries/voxels/src/VoxelEditPacketSender.h index 37c65207f6..fdf70fb96d 100644 --- a/libraries/voxels/src/VoxelEditPacketSender.h +++ b/libraries/voxels/src/VoxelEditPacketSender.h @@ -5,6 +5,8 @@ // Created by Brad Hefta-Gaub on 8/12/13. // Copyright 2013 High Fidelity, Inc. // +// Voxel Packet Sender +// // Distributed under the Apache License, Version 2.0. // See the accompanying file LICENSE or http://www.apache.org/licenses/LICENSE-2.0.html // From ff9fd2d8e9742808ffe6ee0515ad017787b36efa Mon Sep 17 00:00:00 2001 From: Stephen Birarda Date: Tue, 8 Apr 2014 17:49:30 -0700 Subject: [PATCH 032/120] tweak headers in cmake find modules --- cmake/macros/AutoMTC.cmake | 4 +--- cmake/modules/FindFaceshift.cmake | 6 +++++ cmake/modules/FindGLEW.cmake | 21 ++++++++++------- cmake/modules/FindGLUT.cmake | 23 ++++++++++++------- cmake/modules/FindLibOVR.cmake | 8 ++++++- .../modules/FindQt5LinguistToolsMacros.cmake | 2 -- cmake/modules/FindQxmpp.cmake | 6 +++++ cmake/modules/FindSixense.cmake | 6 +++++ cmake/modules/FindVisage.cmake | 6 +++++ 9 files changed, 60 insertions(+), 22 deletions(-) diff --git a/cmake/macros/AutoMTC.cmake b/cmake/macros/AutoMTC.cmake index 6619419b59..a2f5047ac7 100644 --- a/cmake/macros/AutoMTC.cmake +++ b/cmake/macros/AutoMTC.cmake @@ -8,6 +8,4 @@ macro(AUTO_MTC TARGET ROOT_DIR) file(GLOB INCLUDE_FILES src/*.h) add_custom_command(OUTPUT ${AUTOMTC_SRC} COMMAND mtc -o ${AUTOMTC_SRC} ${INCLUDE_FILES} DEPENDS mtc ${INCLUDE_FILES}) -endmacro() - - +endmacro() \ No newline at end of file diff --git a/cmake/modules/FindFaceshift.cmake b/cmake/modules/FindFaceshift.cmake index c89cbbab6f..9b407c353f 100644 --- a/cmake/modules/FindFaceshift.cmake +++ b/cmake/modules/FindFaceshift.cmake @@ -1,3 +1,6 @@ +# +# FindFaceshift.cmake +# # Try to find the Faceshift networking library # # You must provide a FACESHIFT_ROOT_DIR which contains lib and include directories @@ -11,6 +14,9 @@ # Created on 8/30/2013 by Andrzej Kapolka # Copyright (c) 2013 High Fidelity # +# Distributed under the Apache License, Version 2.0. +# See the accompanying file LICENSE or http://www.apache.org/licenses/LICENSE-2.0.html +# if (FACESHIFT_LIBRARIES AND FACESHIFT_INCLUDE_DIRS) # in cache already diff --git a/cmake/modules/FindGLEW.cmake b/cmake/modules/FindGLEW.cmake index 684acca762..160cfedc5a 100644 --- a/cmake/modules/FindGLEW.cmake +++ b/cmake/modules/FindGLEW.cmake @@ -1,16 +1,21 @@ # -# Try to find GLEW library and include path. -# Once done this will define -# -# GLEW_FOUND -# GLEW_INCLUDE_DIRS -# GLEW_LIBRARY +# FindGLEW.cmake +# +# Try to find GLEW library and include path. +# Once done this will define +# +# GLEW_FOUND +# GLEW_INCLUDE_DIRS +# GLEW_LIBRARY # - # Created on 2/6/2014 by Stephen Birarda # -# Adapted from FindGLEW.cmake available in the nvidia-texture-tools repository +# Adapted from FindGLEW.cmake available in the nvidia-texture-tools repository # (https://code.google.com/p/nvidia-texture-tools/source/browse/trunk/cmake/FindGLEW.cmake?r=96) +# +# Distributed under the Apache License, Version 2.0. +# See the accompanying file LICENSE or http://www.apache.org/licenses/LICENSE-2.0.html +# if (GLEW_INCLUDE_DIRS AND GLEW_LIBRARY) set(GLEW_FOUND TRUE) diff --git a/cmake/modules/FindGLUT.cmake b/cmake/modules/FindGLUT.cmake index 173f5a24ae..fe41dc5df8 100644 --- a/cmake/modules/FindGLUT.cmake +++ b/cmake/modules/FindGLUT.cmake @@ -1,15 +1,22 @@ -# Try to find GLUT library and include path. -# Once done this will define +# +# FindGLUT.cmake +# +# Try to find GLUT library and include path. +# Once done this will define # -# GLUT_FOUND -# GLUT_INCLUDE_DIR -# GLUT_LIBRARIES -# GLUT_DLL_PATH - Optionally defined for Win32, if not in path +# GLUT_FOUND +# GLUT_INCLUDE_DIR +# GLUT_LIBRARIES +# GLUT_DLL_PATH - Optionally defined for Win32, if not in path # # Created on 2/6/2014 by Stephen Birarda # -# Adapted from FindGLUT.cmake available in tlorach's OpenGLText Repository -# https://raw.github.com/tlorach/OpenGLText/master/cmake/FindGLUT.cmake +# Adapted from FindGLUT.cmake available in tlorach's OpenGLText Repository +# https://raw.github.com/tlorach/OpenGLText/master/cmake/FindGLUT.cmake +# +# Distributed under the Apache License, Version 2.0. +# See the accompanying file LICENSE or http://www.apache.org/licenses/LICENSE-2.0.html +# if (GLUT_INCLUDE_DIR AND GLUT_LIBRARIES) set(GLUT_FOUND TRUE) diff --git a/cmake/modules/FindLibOVR.cmake b/cmake/modules/FindLibOVR.cmake index 47b7d27015..811fdb73d4 100644 --- a/cmake/modules/FindLibOVR.cmake +++ b/cmake/modules/FindLibOVR.cmake @@ -1,4 +1,7 @@ -# - Try to find the LibOVR library to use the Oculus +# +# FindLibOVR.cmake +# +# Try to find the LibOVR library to use the Oculus # # You must provide a LIBOVR_ROOT_DIR which contains Lib and Include directories # @@ -11,6 +14,9 @@ # Created on 5/9/2013 by Stephen Birarda # Copyright (c) 2013 High Fidelity # +# Distributed under the Apache License, Version 2.0. +# See the accompanying file LICENSE or http://www.apache.org/licenses/LICENSE-2.0.html +# if (LIBOVR_LIBRARIES AND LIBOVR_INCLUDE_DIRS) # in cache already diff --git a/cmake/modules/FindQt5LinguistToolsMacros.cmake b/cmake/modules/FindQt5LinguistToolsMacros.cmake index cd2d1eb74f..bd9d55cb16 100644 --- a/cmake/modules/FindQt5LinguistToolsMacros.cmake +++ b/cmake/modules/FindQt5LinguistToolsMacros.cmake @@ -30,8 +30,6 @@ # OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. #============================================================================= - - function(QT5_CREATE_TRANSLATION_CUSTOM _qm_files) set(options) set(oneValueArgs) diff --git a/cmake/modules/FindQxmpp.cmake b/cmake/modules/FindQxmpp.cmake index 415b184a65..caeb35219d 100644 --- a/cmake/modules/FindQxmpp.cmake +++ b/cmake/modules/FindQxmpp.cmake @@ -1,3 +1,6 @@ +# +# FindQxmpp.cmake +# # Try to find the qxmpp library # # You can provide a QXMPP_ROOT_DIR which contains lib and include directories @@ -11,6 +14,9 @@ # Created on 3/10/2014 by Stephen Birarda # Copyright (c) 2014 High Fidelity # +# Distributed under the Apache License, Version 2.0. +# See the accompanying file LICENSE or http://www.apache.org/licenses/LICENSE-2.0.html +# if (QXMPP_LIBRARIES AND QXMPP_INCLUDE_DIRS) # in cache already diff --git a/cmake/modules/FindSixense.cmake b/cmake/modules/FindSixense.cmake index 1585095ba8..74965f5734 100644 --- a/cmake/modules/FindSixense.cmake +++ b/cmake/modules/FindSixense.cmake @@ -1,3 +1,6 @@ +# +# FindSixense.cmake +# # Try to find the Sixense controller library # # You must provide a SIXENSE_ROOT_DIR which contains lib and include directories @@ -11,6 +14,9 @@ # Created on 11/15/2013 by Andrzej Kapolka # Copyright (c) 2013 High Fidelity # +# Distributed under the Apache License, Version 2.0. +# See the accompanying file LICENSE or http://www.apache.org/licenses/LICENSE-2.0.html +# if (SIXENSE_LIBRARIES AND SIXENSE_INCLUDE_DIRS) # in cache already diff --git a/cmake/modules/FindVisage.cmake b/cmake/modules/FindVisage.cmake index aa7f0f9faf..6d204e4649 100644 --- a/cmake/modules/FindVisage.cmake +++ b/cmake/modules/FindVisage.cmake @@ -1,3 +1,6 @@ +# +# FindVisage.cmake +# # Try to find the Visage controller library # # You must provide a VISAGE_ROOT_DIR which contains lib and include directories @@ -11,6 +14,9 @@ # Created on 2/11/2014 by Andrzej Kapolka # Copyright (c) 2014 High Fidelity # +# Distributed under the Apache License, Version 2.0. +# See the accompanying file LICENSE or http://www.apache.org/licenses/LICENSE-2.0.html +# if (VISAGE_LIBRARIES AND VISAGE_INCLUDE_DIRS) # in cache already From d9fdd87aa3c48d843e43db64af8814abb473f4f0 Mon Sep 17 00:00:00 2001 From: Stephen Birarda Date: Tue, 8 Apr 2014 17:50:11 -0700 Subject: [PATCH 033/120] add apache header to mtc main --- tools/mtc/src/main.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/tools/mtc/src/main.cpp b/tools/mtc/src/main.cpp index b7e2929d49..b1cd154a48 100644 --- a/tools/mtc/src/main.cpp +++ b/tools/mtc/src/main.cpp @@ -1,10 +1,12 @@ // // main.cpp -// mtc +// tools/mtc/src // // Created by Andrzej Kapolka on 12/31/13. // Copyright (c) 2013 High Fidelity, Inc. All rights reserved. // +// Distributed under the Apache License, Version 2.0. +// See the accompanying file LICENSE or http://www.apache.org/licenses/LICENSE-2.0.html #include From 5b822dc57c9b9ffe493c4bf345efd5d4a887d76d Mon Sep 17 00:00:00 2001 From: Stephen Birarda Date: Tue, 8 Apr 2014 17:54:54 -0700 Subject: [PATCH 034/120] inital licensing fixes for JS headers --- examples/addVoxelOnMouseClickExample.js | 6 ++++-- examples/audioBall.js | 7 +++++-- examples/audioDeviceExample.js | 8 +++++--- examples/bot.js | 6 ++++-- examples/cameraExample.js | 6 ++++-- examples/clipboardExample.js | 6 ++++-- examples/collidingParticles.js | 6 ++++-- examples/controllerExample.js | 6 ++++-- examples/count.js | 8 ++++++-- examples/crazylegs.js | 7 +++++-- examples/defaultScripts.js | 9 ++++++++- examples/editParticleExample.js | 7 +++++-- 12 files changed, 58 insertions(+), 24 deletions(-) diff --git a/examples/addVoxelOnMouseClickExample.js b/examples/addVoxelOnMouseClickExample.js index 244a017ae4..4fa175577c 100644 --- a/examples/addVoxelOnMouseClickExample.js +++ b/examples/addVoxelOnMouseClickExample.js @@ -1,13 +1,15 @@ // // addVoxelOnMouseClickExample.js -// hifi +// examples // // Created by Brad Hefta-Gaub on 2/6/14. -// Copyright (c) 2014 HighFidelity, Inc. All rights reserved. +// Copyright 2014 High Fidelity, Inc. // // This is an example script that demonstrates use of the Camera and Voxels class to implement // clicking on a voxel and adding a new voxel on the clicked on face // +// Distributed under the Apache License, Version 2.0. +// See the accompanying file LICENSE or http://www.apache.org/licenses/LICENSE-2.0.html // function mousePressEvent(event) { diff --git a/examples/audioBall.js b/examples/audioBall.js index 0889d9eb31..2a77a0999f 100644 --- a/examples/audioBall.js +++ b/examples/audioBall.js @@ -1,14 +1,17 @@ // // audioBall.js -// hifi +// examples // // Created by Athanasios Gaitatzes on 2/10/14. -// Copyright (c) 2014 HighFidelity, Inc. All rights reserved. +// Copyright 2014 High Fidelity, Inc. // // This script creates a particle in front of the user that stays in front of // the user's avatar as they move, and animates it's radius and color // in response to the audio intensity. // +// Distributed under the Apache License, Version 2.0. +// See the accompanying file LICENSE or http://www.apache.org/licenses/LICENSE-2.0.html +// var sound = new Sound("https://s3-us-west-1.amazonaws.com/highfidelity-public/sounds/Animals/mexicanWhipoorwill.raw"); var CHANCE_OF_PLAYING_SOUND = 0.01; diff --git a/examples/audioDeviceExample.js b/examples/audioDeviceExample.js index 1ee00a1582..959b21f848 100644 --- a/examples/audioDeviceExample.js +++ b/examples/audioDeviceExample.js @@ -1,13 +1,15 @@ // // audioDeviceExample.js -// hifi +// examples // // Created by Brad Hefta-Gaub on 3/22/14 -// Copyright (c) 2013 HighFidelity, Inc. All rights reserved. +// Copyright 2013 High Fidelity, Inc. // // This is an example script that demonstrates use of the Menu object // - +// Distributed under the Apache License, Version 2.0. +// See the accompanying file LICENSE or http://www.apache.org/licenses/LICENSE-2.0.html +// var outputDevices = AudioDevice.getOutputDevices(); var defaultOutputDevice = AudioDevice.getDefaultOutputDevice(); diff --git a/examples/bot.js b/examples/bot.js index ccbc24bc3d..f7a0429c53 100644 --- a/examples/bot.js +++ b/examples/bot.js @@ -1,13 +1,15 @@ // // bot.js -// hifi +// examples // // Created by Stephen Birarda on 2/20/14. // Modified by Philip on 3/3/14 -// Copyright (c) 2014 HighFidelity, Inc. All rights reserved. +// Copyright 2014 High Fidelity, Inc. // // This is an example script that demonstrates an NPC avatar. // +// Distributed under the Apache License, Version 2.0. +// See the accompanying file LICENSE or http://www.apache.org/licenses/LICENSE-2.0.html // function getRandomFloat(min, max) { diff --git a/examples/cameraExample.js b/examples/cameraExample.js index 6e3c51a348..332cc0fbca 100644 --- a/examples/cameraExample.js +++ b/examples/cameraExample.js @@ -1,12 +1,14 @@ // // cameraExample.js -// hifi +// examples // // Created by Brad Hefta-Gaub on 2/6/14. -// Copyright (c) 2014 HighFidelity, Inc. All rights reserved. +// Copyright 2014 High Fidelity, Inc. // // This is an example script that demonstrates use of the Camera class // +// Distributed under the Apache License, Version 2.0. +// See the accompanying file LICENSE or http://www.apache.org/licenses/LICENSE-2.0.html // var damping = 0.9; diff --git a/examples/clipboardExample.js b/examples/clipboardExample.js index 4972505dfe..e9f581f581 100644 --- a/examples/clipboardExample.js +++ b/examples/clipboardExample.js @@ -1,12 +1,14 @@ // // clipboardExample.js -// hifi +// examples // // Created by Brad Hefta-Gaub on 1/28/14. -// Copyright (c) 2014 HighFidelity, Inc. All rights reserved. +// Copyright 2014 HighFidelity, Inc. All rights reserved. // // This is an example script that demonstrates use of the Clipboard class // +// Distributed under the Apache License, Version 2.0. +// See the accompanying file LICENSE or http://www.apache.org/licenses/LICENSE-2.0.html // var selectedVoxel = { x: 0, y: 0, z: 0, s: 0 }; diff --git a/examples/collidingParticles.js b/examples/collidingParticles.js index 95520df757..1f1899c8f2 100644 --- a/examples/collidingParticles.js +++ b/examples/collidingParticles.js @@ -1,14 +1,16 @@ // // collidingParticles.js -// hifi +// examples // // Created by Brad Hefta-Gaub on 12/31/13. -// Copyright (c) 2013 HighFidelity, Inc. All rights reserved. +// Copyright 2013 High Fidelity, Inc. // // This is an example script that creates a couple particles, and sends them on a collision course. // One of the particles has a script that when it collides with another particle, it swaps colors with that particle. // The other particle has a script that when it collides with another particle it set's it's script to a suicide script. // +// Distributed under the Apache License, Version 2.0. +// See the accompanying file LICENSE or http://www.apache.org/licenses/LICENSE-2.0.html // var currentIteration = 0; diff --git a/examples/controllerExample.js b/examples/controllerExample.js index ebb013913e..66a9e40c56 100644 --- a/examples/controllerExample.js +++ b/examples/controllerExample.js @@ -1,12 +1,14 @@ // // controllerExample.js -// hifi +// examples // // Created by Brad Hefta-Gaub on 1/28/14. -// Copyright (c) 2014 HighFidelity, Inc. All rights reserved. +// Copyright 2014 High Fidelity, Inc. // // This is an example script that demonstrates use of the Controller class // +// Distributed under the Apache License, Version 2.0. +// See the accompanying file LICENSE or http://www.apache.org/licenses/LICENSE-2.0.html // // initialize our triggers diff --git a/examples/count.js b/examples/count.js index e04bc2c94b..1a59d6af36 100644 --- a/examples/count.js +++ b/examples/count.js @@ -1,12 +1,16 @@ // // count.js -// hifi +// examples // // Created by Brad Hefta-Gaub on 12/31/13. -// Copyright (c) 2013 HighFidelity, Inc. All rights reserved. +// Copyright 2013 High Fidelity, Inc. All rights reserved. // // This is an example script that runs in a loop and displays a counter to the log // +// Distributed under the Apache License, Version 2.0. +// See the accompanying file LICENSE or http://www.apache.org/licenses/LICENSE-2.0.html +// +// var count = 0; diff --git a/examples/crazylegs.js b/examples/crazylegs.js index 19a171dbdf..6311aea6e4 100644 --- a/examples/crazylegs.js +++ b/examples/crazylegs.js @@ -1,9 +1,12 @@ // // crazylegs.js -// hifi +// examples // // Created by Andrzej Kapolka on 3/6/14. -// Copyright (c) 2014 High Fidelity, Inc. All rights reserved. +// Copyright 2014 High Fidelity, Inc. +// +// Distributed under the Apache License, Version 2.0. +// See the accompanying file LICENSE or http://www.apache.org/licenses/LICENSE-2.0.html // var FREQUENCY = 5.0; diff --git a/examples/defaultScripts.js b/examples/defaultScripts.js index 722b21844f..ede2d0f6b6 100644 --- a/examples/defaultScripts.js +++ b/examples/defaultScripts.js @@ -1,5 +1,12 @@ +// // defaultScripts.js -// Copyright (c) 2013 HighFidelity, Inc. All rights reserved. +// examples +// +// Copyright 2014 High Fidelity, Inc. +// +// Distributed under the Apache License, Version 2.0. +// See the accompanying file LICENSE or http://www.apache.org/licenses/LICENSE-2.0.html + Script.include("lookWithTouch.js"); Script.include("editVoxels.js"); Script.include("selectAudioDevice.js"); diff --git a/examples/editParticleExample.js b/examples/editParticleExample.js index b632e0229b..54c94d0ef3 100644 --- a/examples/editParticleExample.js +++ b/examples/editParticleExample.js @@ -1,12 +1,15 @@ // // editParticleExample.js -// hifi +// examples // // Created by Brad Hefta-Gaub on 12/31/13. -// Copyright (c) 2013 HighFidelity, Inc. All rights reserved. +// Copyright 2014 High Fidelity, Inc. // // This is an example script that demonstrates creating and editing a particle // +// Distributed under the Apache License, Version 2.0. +// See the accompanying file LICENSE or http://www.apache.org/licenses/LICENSE-2.0.html +// var count = 0; var moveUntil = 2000; From 71c3443614e9981ab9648f6b80598413ae1ab48c Mon Sep 17 00:00:00 2001 From: Stephen Birarda Date: Tue, 8 Apr 2014 17:56:56 -0700 Subject: [PATCH 035/120] mass replacement of js of hifi with examples --- examples/editVoxels.js | 7 +++++-- examples/findParticleExample.js | 2 +- examples/flockingBirds.js | 2 +- examples/globalCollisionsExample.js | 2 +- examples/gun.js | 2 +- examples/hideAvatarExample.js | 2 +- examples/hydraMove.js | 2 +- examples/includeExample.js | 2 +- examples/inspect.js | 2 +- examples/lookAtExample.js | 2 +- examples/lookWithMouse.js | 2 +- examples/lookWithTouch.js | 2 +- examples/menuExample.js | 2 +- examples/multitouchExample.js | 2 +- examples/overlaysExample.js | 2 +- examples/paintGun.js | 2 +- examples/particleBird.js | 2 +- examples/particleModelExample.js | 2 +- examples/rayPickExample.js | 2 +- examples/ribbon.js | 2 +- examples/rideAlongWithAParticleExample.js | 2 +- examples/seeingVoxelsExample.js | 2 +- examples/selectAudioDevice.js | 2 +- examples/settingsExample.js | 2 +- examples/spaceInvadersExample.js | 2 +- examples/toyball.js | 2 +- examples/voxelDrumming.js | 2 +- 27 files changed, 31 insertions(+), 28 deletions(-) diff --git a/examples/editVoxels.js b/examples/editVoxels.js index 2a0ed98000..31e8da8e74 100644 --- a/examples/editVoxels.js +++ b/examples/editVoxels.js @@ -1,9 +1,9 @@ // // editVoxels.js -// hifi +// examples // // Created by Philip Rosedale on February 8, 2014 -// Copyright (c) 2014 HighFidelity, Inc. All rights reserved. +// Copyright 2014 High Fidelity, Inc. // // Captures mouse clicks and edits voxels accordingly. // @@ -15,6 +15,9 @@ // // Click and drag to create more new voxels in the same direction // +// Distributed under the Apache License, Version 2.0. +// See the accompanying file LICENSE or http://www.apache.org/licenses/LICENSE-2.0.html +// var windowDimensions = Controller.getViewportDimensions(); diff --git a/examples/findParticleExample.js b/examples/findParticleExample.js index 4a0e9b832a..7b95103f0e 100644 --- a/examples/findParticleExample.js +++ b/examples/findParticleExample.js @@ -1,6 +1,6 @@ // // findParticleExample.js -// hifi +// examples // // Created by Brad Hefta-Gaub on 1/24/14. // Copyright (c) 2014 HighFidelity, Inc. All rights reserved. diff --git a/examples/flockingBirds.js b/examples/flockingBirds.js index 12b402ab40..5b0e26267e 100644 --- a/examples/flockingBirds.js +++ b/examples/flockingBirds.js @@ -1,6 +1,6 @@ // // flockingBirds.js -// hifi +// examples // // Created by Brad Hefta-Gaub on 3/4/14. // Copyright (c) 2014 HighFidelity, Inc. All rights reserved. diff --git a/examples/globalCollisionsExample.js b/examples/globalCollisionsExample.js index 7abf707cbf..bd282086ea 100644 --- a/examples/globalCollisionsExample.js +++ b/examples/globalCollisionsExample.js @@ -1,6 +1,6 @@ // // globalCollisionsExample.js -// hifi +// examples // // Created by Brad Hefta-Gaub on 1/29/14. // Copyright (c) 2014 HighFidelity, Inc. All rights reserved. diff --git a/examples/gun.js b/examples/gun.js index 7bdde19d94..b340b7c7c9 100644 --- a/examples/gun.js +++ b/examples/gun.js @@ -1,6 +1,6 @@ // // gun.js -// hifi +// examples // // Created by Brad Hefta-Gaub on 12/31/13. // Modified by Philip on 3/3/14 diff --git a/examples/hideAvatarExample.js b/examples/hideAvatarExample.js index 7a0ece76eb..c22e0e0593 100644 --- a/examples/hideAvatarExample.js +++ b/examples/hideAvatarExample.js @@ -1,6 +1,6 @@ // // hideAvatarExample.js -// hifi +// examples // // Created by Brad Hefta-Gaub on 1/28/14. // Copyright (c) 2014 HighFidelity, Inc. All rights reserved. diff --git a/examples/hydraMove.js b/examples/hydraMove.js index 6268a38ba3..21e974d0af 100644 --- a/examples/hydraMove.js +++ b/examples/hydraMove.js @@ -1,6 +1,6 @@ // // hydraMove.js -// hifi +// examples // // Created by Brad Hefta-Gaub on 2/10/14. // Copyright (c) 2014 HighFidelity, Inc. All rights reserved. diff --git a/examples/includeExample.js b/examples/includeExample.js index 489928d759..03b3f22858 100644 --- a/examples/includeExample.js +++ b/examples/includeExample.js @@ -1,6 +1,6 @@ // // includeExample.js -// hifi +// examples // // Created by Brad Hefta-Gaub on 3/24/14 // Copyright (c) 2013 HighFidelity, Inc. All rights reserved. diff --git a/examples/inspect.js b/examples/inspect.js index 2443eadf9b..be9675afd4 100644 --- a/examples/inspect.js +++ b/examples/inspect.js @@ -1,6 +1,6 @@ // // inspect.js -// hifi +// examples // // Created by Clément Brisset on March 20, 2014 // Copyright (c) 2014 HighFidelity, Inc. All rights reserved. diff --git a/examples/lookAtExample.js b/examples/lookAtExample.js index 46e0863231..6a68b6c4fb 100644 --- a/examples/lookAtExample.js +++ b/examples/lookAtExample.js @@ -1,6 +1,6 @@ // // lookAtExample.js -// hifi +// examples // // Created by Brad Hefta-Gaub on 2/6/14. // Copyright (c) 2014 HighFidelity, Inc. All rights reserved. diff --git a/examples/lookWithMouse.js b/examples/lookWithMouse.js index ef8f11ec16..84aad1d553 100644 --- a/examples/lookWithMouse.js +++ b/examples/lookWithMouse.js @@ -1,6 +1,6 @@ // // lookWithMouse.js -// hifi +// examples // // Created by Brad Hefta-Gaub on 1/28/14. // Copyright (c) 2014 HighFidelity, Inc. All rights reserved. diff --git a/examples/lookWithTouch.js b/examples/lookWithTouch.js index 4406b4567e..d7bf00e67f 100644 --- a/examples/lookWithTouch.js +++ b/examples/lookWithTouch.js @@ -1,6 +1,6 @@ // // lookWithTouch.js -// hifi +// examples // // Created by Brad Hefta-Gaub on 1/28/14. // Copyright (c) 2014 HighFidelity, Inc. All rights reserved. diff --git a/examples/menuExample.js b/examples/menuExample.js index 874d95ec31..656983e243 100644 --- a/examples/menuExample.js +++ b/examples/menuExample.js @@ -1,6 +1,6 @@ // // menuExample.js -// hifi +// examples // // Created by Brad Hefta-Gaub on 2/24/14 // Copyright (c) 2013 HighFidelity, Inc. All rights reserved. diff --git a/examples/multitouchExample.js b/examples/multitouchExample.js index 51bbcc2c20..0c169c27cb 100644 --- a/examples/multitouchExample.js +++ b/examples/multitouchExample.js @@ -1,6 +1,6 @@ // // multitouchExample.js -// hifi +// examples // // Created by Brad Hefta-Gaub on 2/9/14. // Copyright (c) 2014 HighFidelity, Inc. All rights reserved. diff --git a/examples/overlaysExample.js b/examples/overlaysExample.js index 60f924338f..c7beafad53 100644 --- a/examples/overlaysExample.js +++ b/examples/overlaysExample.js @@ -1,6 +1,6 @@ // // overlaysExample.js -// hifi +// examples // // Created by Brad Hefta-Gaub on 2/14/14. // Copyright (c) 2014 HighFidelity, Inc. All rights reserved. diff --git a/examples/paintGun.js b/examples/paintGun.js index 0b30d99fb5..a4327b9a3f 100644 --- a/examples/paintGun.js +++ b/examples/paintGun.js @@ -1,6 +1,6 @@ // // paintGun.js -// hifi +// examples // // Created by Brad Hefta-Gaub on 12/31/13. // Copyright (c) 2013 HighFidelity, Inc. All rights reserved. diff --git a/examples/particleBird.js b/examples/particleBird.js index 5cd068bd60..464e1de2a1 100644 --- a/examples/particleBird.js +++ b/examples/particleBird.js @@ -1,6 +1,6 @@ // // particleBird.js -// hifi +// examples // // This sample script moves a voxel around like a bird and sometimes makes tweeting noises // diff --git a/examples/particleModelExample.js b/examples/particleModelExample.js index c43956cd3e..08f718e3ae 100644 --- a/examples/particleModelExample.js +++ b/examples/particleModelExample.js @@ -1,6 +1,6 @@ // // particleModelExample.js -// hifi +// examples // // Created by Brad Hefta-Gaub on 1/28/14. // Copyright (c) 2014 HighFidelity, Inc. All rights reserved. diff --git a/examples/rayPickExample.js b/examples/rayPickExample.js index 9c34cca1de..a4dfd93fdf 100644 --- a/examples/rayPickExample.js +++ b/examples/rayPickExample.js @@ -1,6 +1,6 @@ // // rayPickExample.js -// hifi +// examples // // Created by Brad Hefta-Gaub on 2/6/14. // Copyright (c) 2014 HighFidelity, Inc. All rights reserved. diff --git a/examples/ribbon.js b/examples/ribbon.js index a6e1edfa4a..d4ae887c28 100644 --- a/examples/ribbon.js +++ b/examples/ribbon.js @@ -1,6 +1,6 @@ // // ribbon.js -// hifi +// examples // // Created by Andrzej Kapolka on 2/24/14. // Copyright (c) 2014 High Fidelity, Inc. All rights reserved. diff --git a/examples/rideAlongWithAParticleExample.js b/examples/rideAlongWithAParticleExample.js index 1148b96b4d..0d2dee2ddd 100644 --- a/examples/rideAlongWithAParticleExample.js +++ b/examples/rideAlongWithAParticleExample.js @@ -1,6 +1,6 @@ // // rideAlongWithAParticleExample.js -// hifi +// examples // // Created by Brad Hefta-Gaub on 1/24/14. // Copyright (c) 2014 HighFidelity, Inc. All rights reserved. diff --git a/examples/seeingVoxelsExample.js b/examples/seeingVoxelsExample.js index 0cfe54d89e..2b17f08ac1 100644 --- a/examples/seeingVoxelsExample.js +++ b/examples/seeingVoxelsExample.js @@ -1,6 +1,6 @@ // // seeingVoxelsExample.js -// hifi +// examples // // Created by Brad Hefta-Gaub on 2/26/14 // Copyright (c) 2014 HighFidelity, Inc. All rights reserved. diff --git a/examples/selectAudioDevice.js b/examples/selectAudioDevice.js index 958ca7babf..872e98d95e 100644 --- a/examples/selectAudioDevice.js +++ b/examples/selectAudioDevice.js @@ -1,6 +1,6 @@ // // audioDeviceExample.js -// hifi +// examples // // Created by Brad Hefta-Gaub on 3/22/14 // Copyright (c) 2013 HighFidelity, Inc. All rights reserved. diff --git a/examples/settingsExample.js b/examples/settingsExample.js index 0dcc5482b6..6d06f2eb46 100644 --- a/examples/settingsExample.js +++ b/examples/settingsExample.js @@ -1,6 +1,6 @@ // // settingsExample.js -// hifi +// examples // // Created by Brad Hefta-Gaub on 3/22/14 // Copyright (c) 2013 HighFidelity, Inc. All rights reserved. diff --git a/examples/spaceInvadersExample.js b/examples/spaceInvadersExample.js index df985e2e18..ee2a0547b5 100644 --- a/examples/spaceInvadersExample.js +++ b/examples/spaceInvadersExample.js @@ -1,6 +1,6 @@ // // spaceInvadersExample.js -// hifi +// examples // // Created by Brad Hefta-Gaub on 1/30/14. // Copyright (c) 2014 HighFidelity, Inc. All rights reserved. diff --git a/examples/toyball.js b/examples/toyball.js index 36f1aa11e5..9a89f601b7 100644 --- a/examples/toyball.js +++ b/examples/toyball.js @@ -1,6 +1,6 @@ // // toyball.js -// hifi +// examples // // Created by Brad Hefta-Gaub on 1/20/14. // Copyright (c) 2014 HighFidelity, Inc. All rights reserved. diff --git a/examples/voxelDrumming.js b/examples/voxelDrumming.js index 178c6734d8..0485f1b9e2 100644 --- a/examples/voxelDrumming.js +++ b/examples/voxelDrumming.js @@ -1,6 +1,6 @@ // // voxelDrumming.js -// hifi +// examples // // Created by Brad Hefta-Gaub on 2/14/14. // Copyright (c) 2014 HighFidelity, Inc. All rights reserved. From 8ff244cc1a81e03b04e25b5b2ed185b00bd9ddd3 Mon Sep 17 00:00:00 2001 From: Stephen Birarda Date: Tue, 8 Apr 2014 17:58:02 -0700 Subject: [PATCH 036/120] add missing space for example replace in javascripts --- examples/findParticleExample.js | 2 +- examples/flockingBirds.js | 2 +- examples/globalCollisionsExample.js | 2 +- examples/gun.js | 2 +- examples/hideAvatarExample.js | 2 +- examples/hydraMove.js | 2 +- examples/includeExample.js | 2 +- examples/inspect.js | 2 +- examples/lookAtExample.js | 2 +- examples/lookWithMouse.js | 2 +- examples/lookWithTouch.js | 2 +- examples/menuExample.js | 2 +- examples/multitouchExample.js | 2 +- examples/overlaysExample.js | 2 +- examples/paintGun.js | 2 +- examples/particleBird.js | 2 +- examples/particleModelExample.js | 2 +- examples/rayPickExample.js | 2 +- examples/ribbon.js | 2 +- examples/rideAlongWithAParticleExample.js | 2 +- examples/seeingVoxelsExample.js | 2 +- examples/selectAudioDevice.js | 2 +- examples/settingsExample.js | 2 +- examples/spaceInvadersExample.js | 2 +- examples/toyball.js | 2 +- examples/voxelDrumming.js | 2 +- 26 files changed, 26 insertions(+), 26 deletions(-) diff --git a/examples/findParticleExample.js b/examples/findParticleExample.js index 7b95103f0e..0b07471273 100644 --- a/examples/findParticleExample.js +++ b/examples/findParticleExample.js @@ -1,6 +1,6 @@ // // findParticleExample.js -// examples +// examples // // Created by Brad Hefta-Gaub on 1/24/14. // Copyright (c) 2014 HighFidelity, Inc. All rights reserved. diff --git a/examples/flockingBirds.js b/examples/flockingBirds.js index 5b0e26267e..a45bcc9f97 100644 --- a/examples/flockingBirds.js +++ b/examples/flockingBirds.js @@ -1,6 +1,6 @@ // // flockingBirds.js -// examples +// examples // // Created by Brad Hefta-Gaub on 3/4/14. // Copyright (c) 2014 HighFidelity, Inc. All rights reserved. diff --git a/examples/globalCollisionsExample.js b/examples/globalCollisionsExample.js index bd282086ea..6dfd4ee3f8 100644 --- a/examples/globalCollisionsExample.js +++ b/examples/globalCollisionsExample.js @@ -1,6 +1,6 @@ // // globalCollisionsExample.js -// examples +// examples // // Created by Brad Hefta-Gaub on 1/29/14. // Copyright (c) 2014 HighFidelity, Inc. All rights reserved. diff --git a/examples/gun.js b/examples/gun.js index b340b7c7c9..6d3bbb2193 100644 --- a/examples/gun.js +++ b/examples/gun.js @@ -1,6 +1,6 @@ // // gun.js -// examples +// examples // // Created by Brad Hefta-Gaub on 12/31/13. // Modified by Philip on 3/3/14 diff --git a/examples/hideAvatarExample.js b/examples/hideAvatarExample.js index c22e0e0593..046ebc1a3b 100644 --- a/examples/hideAvatarExample.js +++ b/examples/hideAvatarExample.js @@ -1,6 +1,6 @@ // // hideAvatarExample.js -// examples +// examples // // Created by Brad Hefta-Gaub on 1/28/14. // Copyright (c) 2014 HighFidelity, Inc. All rights reserved. diff --git a/examples/hydraMove.js b/examples/hydraMove.js index 21e974d0af..9ff776c0eb 100644 --- a/examples/hydraMove.js +++ b/examples/hydraMove.js @@ -1,6 +1,6 @@ // // hydraMove.js -// examples +// examples // // Created by Brad Hefta-Gaub on 2/10/14. // Copyright (c) 2014 HighFidelity, Inc. All rights reserved. diff --git a/examples/includeExample.js b/examples/includeExample.js index 03b3f22858..68c9828630 100644 --- a/examples/includeExample.js +++ b/examples/includeExample.js @@ -1,6 +1,6 @@ // // includeExample.js -// examples +// examples // // Created by Brad Hefta-Gaub on 3/24/14 // Copyright (c) 2013 HighFidelity, Inc. All rights reserved. diff --git a/examples/inspect.js b/examples/inspect.js index be9675afd4..1b220ad333 100644 --- a/examples/inspect.js +++ b/examples/inspect.js @@ -1,6 +1,6 @@ // // inspect.js -// examples +// examples // // Created by Clément Brisset on March 20, 2014 // Copyright (c) 2014 HighFidelity, Inc. All rights reserved. diff --git a/examples/lookAtExample.js b/examples/lookAtExample.js index 6a68b6c4fb..c76273a3c7 100644 --- a/examples/lookAtExample.js +++ b/examples/lookAtExample.js @@ -1,6 +1,6 @@ // // lookAtExample.js -// examples +// examples // // Created by Brad Hefta-Gaub on 2/6/14. // Copyright (c) 2014 HighFidelity, Inc. All rights reserved. diff --git a/examples/lookWithMouse.js b/examples/lookWithMouse.js index 84aad1d553..02bf9fbe13 100644 --- a/examples/lookWithMouse.js +++ b/examples/lookWithMouse.js @@ -1,6 +1,6 @@ // // lookWithMouse.js -// examples +// examples // // Created by Brad Hefta-Gaub on 1/28/14. // Copyright (c) 2014 HighFidelity, Inc. All rights reserved. diff --git a/examples/lookWithTouch.js b/examples/lookWithTouch.js index d7bf00e67f..71d0137533 100644 --- a/examples/lookWithTouch.js +++ b/examples/lookWithTouch.js @@ -1,6 +1,6 @@ // // lookWithTouch.js -// examples +// examples // // Created by Brad Hefta-Gaub on 1/28/14. // Copyright (c) 2014 HighFidelity, Inc. All rights reserved. diff --git a/examples/menuExample.js b/examples/menuExample.js index 656983e243..92081038f5 100644 --- a/examples/menuExample.js +++ b/examples/menuExample.js @@ -1,6 +1,6 @@ // // menuExample.js -// examples +// examples // // Created by Brad Hefta-Gaub on 2/24/14 // Copyright (c) 2013 HighFidelity, Inc. All rights reserved. diff --git a/examples/multitouchExample.js b/examples/multitouchExample.js index 0c169c27cb..4a4b6427f8 100644 --- a/examples/multitouchExample.js +++ b/examples/multitouchExample.js @@ -1,6 +1,6 @@ // // multitouchExample.js -// examples +// examples // // Created by Brad Hefta-Gaub on 2/9/14. // Copyright (c) 2014 HighFidelity, Inc. All rights reserved. diff --git a/examples/overlaysExample.js b/examples/overlaysExample.js index c7beafad53..5b2c89391e 100644 --- a/examples/overlaysExample.js +++ b/examples/overlaysExample.js @@ -1,6 +1,6 @@ // // overlaysExample.js -// examples +// examples // // Created by Brad Hefta-Gaub on 2/14/14. // Copyright (c) 2014 HighFidelity, Inc. All rights reserved. diff --git a/examples/paintGun.js b/examples/paintGun.js index a4327b9a3f..e7477318ed 100644 --- a/examples/paintGun.js +++ b/examples/paintGun.js @@ -1,6 +1,6 @@ // // paintGun.js -// examples +// examples // // Created by Brad Hefta-Gaub on 12/31/13. // Copyright (c) 2013 HighFidelity, Inc. All rights reserved. diff --git a/examples/particleBird.js b/examples/particleBird.js index 464e1de2a1..86ee6e7aa4 100644 --- a/examples/particleBird.js +++ b/examples/particleBird.js @@ -1,6 +1,6 @@ // // particleBird.js -// examples +// examples // // This sample script moves a voxel around like a bird and sometimes makes tweeting noises // diff --git a/examples/particleModelExample.js b/examples/particleModelExample.js index 08f718e3ae..5f99c46d7b 100644 --- a/examples/particleModelExample.js +++ b/examples/particleModelExample.js @@ -1,6 +1,6 @@ // // particleModelExample.js -// examples +// examples // // Created by Brad Hefta-Gaub on 1/28/14. // Copyright (c) 2014 HighFidelity, Inc. All rights reserved. diff --git a/examples/rayPickExample.js b/examples/rayPickExample.js index a4dfd93fdf..7e20a4e95d 100644 --- a/examples/rayPickExample.js +++ b/examples/rayPickExample.js @@ -1,6 +1,6 @@ // // rayPickExample.js -// examples +// examples // // Created by Brad Hefta-Gaub on 2/6/14. // Copyright (c) 2014 HighFidelity, Inc. All rights reserved. diff --git a/examples/ribbon.js b/examples/ribbon.js index d4ae887c28..be8b521f7c 100644 --- a/examples/ribbon.js +++ b/examples/ribbon.js @@ -1,6 +1,6 @@ // // ribbon.js -// examples +// examples // // Created by Andrzej Kapolka on 2/24/14. // Copyright (c) 2014 High Fidelity, Inc. All rights reserved. diff --git a/examples/rideAlongWithAParticleExample.js b/examples/rideAlongWithAParticleExample.js index 0d2dee2ddd..ce0133b25c 100644 --- a/examples/rideAlongWithAParticleExample.js +++ b/examples/rideAlongWithAParticleExample.js @@ -1,6 +1,6 @@ // // rideAlongWithAParticleExample.js -// examples +// examples // // Created by Brad Hefta-Gaub on 1/24/14. // Copyright (c) 2014 HighFidelity, Inc. All rights reserved. diff --git a/examples/seeingVoxelsExample.js b/examples/seeingVoxelsExample.js index 2b17f08ac1..e7a9e9f07a 100644 --- a/examples/seeingVoxelsExample.js +++ b/examples/seeingVoxelsExample.js @@ -1,6 +1,6 @@ // // seeingVoxelsExample.js -// examples +// examples // // Created by Brad Hefta-Gaub on 2/26/14 // Copyright (c) 2014 HighFidelity, Inc. All rights reserved. diff --git a/examples/selectAudioDevice.js b/examples/selectAudioDevice.js index 872e98d95e..be3f621cdb 100644 --- a/examples/selectAudioDevice.js +++ b/examples/selectAudioDevice.js @@ -1,6 +1,6 @@ // // audioDeviceExample.js -// examples +// examples // // Created by Brad Hefta-Gaub on 3/22/14 // Copyright (c) 2013 HighFidelity, Inc. All rights reserved. diff --git a/examples/settingsExample.js b/examples/settingsExample.js index 6d06f2eb46..53e8a8a63c 100644 --- a/examples/settingsExample.js +++ b/examples/settingsExample.js @@ -1,6 +1,6 @@ // // settingsExample.js -// examples +// examples // // Created by Brad Hefta-Gaub on 3/22/14 // Copyright (c) 2013 HighFidelity, Inc. All rights reserved. diff --git a/examples/spaceInvadersExample.js b/examples/spaceInvadersExample.js index ee2a0547b5..7dd5037cda 100644 --- a/examples/spaceInvadersExample.js +++ b/examples/spaceInvadersExample.js @@ -1,6 +1,6 @@ // // spaceInvadersExample.js -// examples +// examples // // Created by Brad Hefta-Gaub on 1/30/14. // Copyright (c) 2014 HighFidelity, Inc. All rights reserved. diff --git a/examples/toyball.js b/examples/toyball.js index 9a89f601b7..9b57987eca 100644 --- a/examples/toyball.js +++ b/examples/toyball.js @@ -1,6 +1,6 @@ // // toyball.js -// examples +// examples // // Created by Brad Hefta-Gaub on 1/20/14. // Copyright (c) 2014 HighFidelity, Inc. All rights reserved. diff --git a/examples/voxelDrumming.js b/examples/voxelDrumming.js index 0485f1b9e2..e8f852ccf2 100644 --- a/examples/voxelDrumming.js +++ b/examples/voxelDrumming.js @@ -1,6 +1,6 @@ // // voxelDrumming.js -// examples +// examples // // Created by Brad Hefta-Gaub on 2/14/14. // Copyright (c) 2014 HighFidelity, Inc. All rights reserved. From 0f204f932c9e505920f74acc8c48f909686a6dab Mon Sep 17 00:00:00 2001 From: Stephen Birarda Date: Tue, 8 Apr 2014 18:00:24 -0700 Subject: [PATCH 037/120] add apache license information to more js files --- examples/globalCollisionsExample.js | 2 ++ examples/gun.js | 2 ++ examples/hideAvatarExample.js | 2 ++ examples/hydraMove.js | 2 ++ examples/includeExample.js | 3 +++ examples/inspect.js | 3 +++ examples/lookAtExample.js | 2 ++ examples/lookWithMouse.js | 2 ++ examples/lookWithTouch.js | 2 ++ examples/menuExample.js | 3 +++ examples/multitouchExample.js | 3 +++ examples/overlaysExample.js | 2 ++ examples/paintGun.js | 3 +++ examples/particleBird.js | 3 +++ examples/particleModelExample.js | 3 +++ examples/playSound.js | 2 ++ examples/rayPickExample.js | 2 ++ examples/ribbon.js | 3 +++ examples/rideAlongWithAParticleExample.js | 3 +++ examples/seeingVoxelsExample.js | 3 +++ examples/selectAudioDevice.js | 3 +++ examples/settingsExample.js | 6 +++--- examples/spaceInvadersExample.js | 3 +++ examples/toyball.js | 2 ++ examples/voxelDrumming.js | 3 +++ 25 files changed, 64 insertions(+), 3 deletions(-) diff --git a/examples/globalCollisionsExample.js b/examples/globalCollisionsExample.js index 6dfd4ee3f8..b9d1dceefe 100644 --- a/examples/globalCollisionsExample.js +++ b/examples/globalCollisionsExample.js @@ -7,6 +7,8 @@ // // This is an example script that demonstrates use of the Controller class // +// Distributed under the Apache License, Version 2.0. +// See the accompanying file LICENSE or http://www.apache.org/licenses/LICENSE-2.0.html // diff --git a/examples/gun.js b/examples/gun.js index 6d3bbb2193..85d0f9c1e5 100644 --- a/examples/gun.js +++ b/examples/gun.js @@ -10,6 +10,8 @@ // It reads the controller, watches for trigger pulls, and launches particles. // When particles collide with voxels they blow little holes out of the voxels. // +// Distributed under the Apache License, Version 2.0. +// See the accompanying file LICENSE or http://www.apache.org/licenses/LICENSE-2.0.html // diff --git a/examples/hideAvatarExample.js b/examples/hideAvatarExample.js index 046ebc1a3b..d9e4b350f4 100644 --- a/examples/hideAvatarExample.js +++ b/examples/hideAvatarExample.js @@ -7,6 +7,8 @@ // // This is an example script that demonstrates how to enable or disable local rendering of your own avatar // +// Distributed under the Apache License, Version 2.0. +// See the accompanying file LICENSE or http://www.apache.org/licenses/LICENSE-2.0.html // function keyReleaseEvent(event) { diff --git a/examples/hydraMove.js b/examples/hydraMove.js index 9ff776c0eb..e2dd608b4a 100644 --- a/examples/hydraMove.js +++ b/examples/hydraMove.js @@ -8,6 +8,8 @@ // This is an example script that demonstrates use of the Controller and MyAvatar classes to implement // avatar flying through the hydra/controller joysticks // +// Distributed under the Apache License, Version 2.0. +// See the accompanying file LICENSE or http://www.apache.org/licenses/LICENSE-2.0.html // var damping = 0.9; diff --git a/examples/includeExample.js b/examples/includeExample.js index 68c9828630..e82a95fc63 100644 --- a/examples/includeExample.js +++ b/examples/includeExample.js @@ -7,6 +7,9 @@ // // This is an example script that demonstrates use of the Script.include() feature // +// Distributed under the Apache License, Version 2.0. +// See the accompanying file LICENSE or http://www.apache.org/licenses/LICENSE-2.0.html +// // You can include scripts from URLs Script.include("http://public.highfidelity.io/scripts/lookWithTouch.js"); diff --git a/examples/inspect.js b/examples/inspect.js index 1b220ad333..5402a6a830 100644 --- a/examples/inspect.js +++ b/examples/inspect.js @@ -13,6 +13,9 @@ // Once you are in a mode left click on the object to inspect and hold the click // Dragging the mouse will move your camera according to the mode you are in. // +// Distributed under the Apache License, Version 2.0. +// See the accompanying file LICENSE or http://www.apache.org/licenses/LICENSE-2.0.html +// var PI = 3.14 // No need for something more precise diff --git a/examples/lookAtExample.js b/examples/lookAtExample.js index c76273a3c7..6e208ddbdd 100644 --- a/examples/lookAtExample.js +++ b/examples/lookAtExample.js @@ -12,6 +12,8 @@ // on the face of the voxel that you clicked. Click again and it will stop looking at that point. While in this fixed mode // you can use the arrow keys to change the position of the camera. // +// Distributed under the Apache License, Version 2.0. +// See the accompanying file LICENSE or http://www.apache.org/licenses/LICENSE-2.0.html // var lookingAtSomething = false; diff --git a/examples/lookWithMouse.js b/examples/lookWithMouse.js index 02bf9fbe13..4293654ae5 100644 --- a/examples/lookWithMouse.js +++ b/examples/lookWithMouse.js @@ -7,6 +7,8 @@ // // This is an example script that demonstrates use of the Controller class // +// Distributed under the Apache License, Version 2.0. +// See the accompanying file LICENSE or http://www.apache.org/licenses/LICENSE-2.0.html // var alwaysLook = true; // if you want the mouse look to happen only when you click, change this to false diff --git a/examples/lookWithTouch.js b/examples/lookWithTouch.js index 71d0137533..0278d2b7b2 100644 --- a/examples/lookWithTouch.js +++ b/examples/lookWithTouch.js @@ -7,6 +7,8 @@ // // This is an example script that demonstrates use of the Controller class // +// Distributed under the Apache License, Version 2.0. +// See the accompanying file LICENSE or http://www.apache.org/licenses/LICENSE-2.0.html // var startedTouching = false; diff --git a/examples/menuExample.js b/examples/menuExample.js index 92081038f5..d448c32bf8 100644 --- a/examples/menuExample.js +++ b/examples/menuExample.js @@ -7,6 +7,9 @@ // // This is an example script that demonstrates use of the Menu object // +// Distributed under the Apache License, Version 2.0. +// See the accompanying file LICENSE or http://www.apache.org/licenses/LICENSE-2.0.html +// function setupMenus() { diff --git a/examples/multitouchExample.js b/examples/multitouchExample.js index 4a4b6427f8..b76902f57a 100644 --- a/examples/multitouchExample.js +++ b/examples/multitouchExample.js @@ -11,6 +11,9 @@ // * Four finger rotate gesture will rotate your avatar. // * Three finger swipe up/down will adjust the pitch of your avatars head. // +// Distributed under the Apache License, Version 2.0. +// See the accompanying file LICENSE or http://www.apache.org/licenses/LICENSE-2.0.html +// var lastX = 0; var lastY = 0; diff --git a/examples/overlaysExample.js b/examples/overlaysExample.js index 5b2c89391e..ec54438692 100644 --- a/examples/overlaysExample.js +++ b/examples/overlaysExample.js @@ -7,6 +7,8 @@ // // This is an example script that demonstrates use of the Overlays class // +// Distributed under the Apache License, Version 2.0. +// See the accompanying file LICENSE or http://www.apache.org/licenses/LICENSE-2.0.html // diff --git a/examples/paintGun.js b/examples/paintGun.js index e7477318ed..fa2d4f1e1f 100644 --- a/examples/paintGun.js +++ b/examples/paintGun.js @@ -5,6 +5,9 @@ // Created by Brad Hefta-Gaub on 12/31/13. // Copyright (c) 2013 HighFidelity, Inc. All rights reserved. // +// Distributed under the Apache License, Version 2.0. +// See the accompanying file LICENSE or http://www.apache.org/licenses/LICENSE-2.0.html +// // initialize our triggers var triggerPulled = new Array(); diff --git a/examples/particleBird.js b/examples/particleBird.js index 86ee6e7aa4..59ada1950e 100644 --- a/examples/particleBird.js +++ b/examples/particleBird.js @@ -4,6 +4,9 @@ // // This sample script moves a voxel around like a bird and sometimes makes tweeting noises // +// Distributed under the Apache License, Version 2.0. +// See the accompanying file LICENSE or http://www.apache.org/licenses/LICENSE-2.0.html +// function vLength(v) { return Math.sqrt(v.x * v.x + v.y * v.y + v.z * v.z); diff --git a/examples/particleModelExample.js b/examples/particleModelExample.js index 5f99c46d7b..96b16c503d 100644 --- a/examples/particleModelExample.js +++ b/examples/particleModelExample.js @@ -7,6 +7,9 @@ // // This is an example script that demonstrates creating and editing a particle // +// Distributed under the Apache License, Version 2.0. +// See the accompanying file LICENSE or http://www.apache.org/licenses/LICENSE-2.0.html +// var count = 0; var stopAfter = 100; diff --git a/examples/playSound.js b/examples/playSound.js index 18857826ea..7715604de2 100644 --- a/examples/playSound.js +++ b/examples/playSound.js @@ -1,6 +1,8 @@ // // This sample script loads a sound file and plays it at the 'fingertip' of the // +// Distributed under the Apache License, Version 2.0. +// See the accompanying file LICENSE or http://www.apache.org/licenses/LICENSE-2.0.html // First, load the clap sound from a URL var clap = new Sound("https://s3-us-west-1.amazonaws.com/highfidelity-public/sounds/Animals/bushtit_1.raw"); diff --git a/examples/rayPickExample.js b/examples/rayPickExample.js index 7e20a4e95d..13ab285af5 100644 --- a/examples/rayPickExample.js +++ b/examples/rayPickExample.js @@ -7,6 +7,8 @@ // // This is an example script that demonstrates use of the Camera class // +// Distributed under the Apache License, Version 2.0. +// See the accompanying file LICENSE or http://www.apache.org/licenses/LICENSE-2.0.html // function mouseMoveEvent(event) { diff --git a/examples/ribbon.js b/examples/ribbon.js index be8b521f7c..5e48ee3193 100644 --- a/examples/ribbon.js +++ b/examples/ribbon.js @@ -5,6 +5,9 @@ // Created by Andrzej Kapolka on 2/24/14. // Copyright (c) 2014 High Fidelity, Inc. All rights reserved. // +// Distributed under the Apache License, Version 2.0. +// See the accompanying file LICENSE or http://www.apache.org/licenses/LICENSE-2.0.html +// function vectorMultiply(vector, scalar) { return [ vector[0] * scalar, vector[1] * scalar, vector[2] * scalar ]; diff --git a/examples/rideAlongWithAParticleExample.js b/examples/rideAlongWithAParticleExample.js index ce0133b25c..a6decbc2c2 100644 --- a/examples/rideAlongWithAParticleExample.js +++ b/examples/rideAlongWithAParticleExample.js @@ -7,6 +7,9 @@ // // This is an example script that demonstrates "finding" particles // +// Distributed under the Apache License, Version 2.0. +// See the accompanying file LICENSE or http://www.apache.org/licenses/LICENSE-2.0.html +// var iteration = 0; var lengthOfRide = 2000; // in iterations diff --git a/examples/seeingVoxelsExample.js b/examples/seeingVoxelsExample.js index e7a9e9f07a..e0f991ea40 100644 --- a/examples/seeingVoxelsExample.js +++ b/examples/seeingVoxelsExample.js @@ -7,6 +7,9 @@ // // This is an example script // +// Distributed under the Apache License, Version 2.0. +// See the accompanying file LICENSE or http://www.apache.org/licenses/LICENSE-2.0.html +// var count = 0; var yawDirection = -1; diff --git a/examples/selectAudioDevice.js b/examples/selectAudioDevice.js index be3f621cdb..668e467254 100644 --- a/examples/selectAudioDevice.js +++ b/examples/selectAudioDevice.js @@ -7,6 +7,9 @@ // // This is an example script that demonstrates use of the Menu object // +// Distributed under the Apache License, Version 2.0. +// See the accompanying file LICENSE or http://www.apache.org/licenses/LICENSE-2.0.html +// if (typeof String.prototype.startsWith != 'function') { String.prototype.startsWith = function (str){ diff --git a/examples/settingsExample.js b/examples/settingsExample.js index 53e8a8a63c..816fc956a3 100644 --- a/examples/settingsExample.js +++ b/examples/settingsExample.js @@ -7,9 +7,9 @@ // // This is an example script that demonstrates use of the Menu object // - - - +// Distributed under the Apache License, Version 2.0. +// See the accompanying file LICENSE or http://www.apache.org/licenses/LICENSE-2.0.html +// print("mySetting: " + Settings.getValue("mySetting")); Settings.setValue("mySetting", "spam"); diff --git a/examples/spaceInvadersExample.js b/examples/spaceInvadersExample.js index 7dd5037cda..be4fcf445f 100644 --- a/examples/spaceInvadersExample.js +++ b/examples/spaceInvadersExample.js @@ -7,6 +7,9 @@ // // This is an example script that demonstrates a simple space invaders style of game // +// Distributed under the Apache License, Version 2.0. +// See the accompanying file LICENSE or http://www.apache.org/licenses/LICENSE-2.0.html +// var iteration = 0; diff --git a/examples/toyball.js b/examples/toyball.js index 9b57987eca..52646c94b4 100644 --- a/examples/toyball.js +++ b/examples/toyball.js @@ -11,6 +11,8 @@ // The particles it creates have a script that when they collide with Voxels, the // particle will change it's color to match the voxel it hits. // +// Distributed under the Apache License, Version 2.0. +// See the accompanying file LICENSE or http://www.apache.org/licenses/LICENSE-2.0.html // // maybe we should make these constants... diff --git a/examples/voxelDrumming.js b/examples/voxelDrumming.js index e8f852ccf2..f064d6736e 100644 --- a/examples/voxelDrumming.js +++ b/examples/voxelDrumming.js @@ -9,6 +9,9 @@ // // It adds Hydra controller "fingertip on voxels" drumming // +// Distributed under the Apache License, Version 2.0. +// See the accompanying file LICENSE or http://www.apache.org/licenses/LICENSE-2.0.html +// Menu.addMenuItem({ menuName: "Developer > Hand Options", From 5b0e7f818d623c064e21acc0566563a2a4326ad8 Mon Sep 17 00:00:00 2001 From: Andrzej Kapolka Date: Tue, 8 Apr 2014 18:03:49 -0700 Subject: [PATCH 038/120] More work on Faceplus integration/cleaning up support for multiple face trackers. --- interface/src/Application.cpp | 56 ++++++++++++++++----------- interface/src/Application.h | 7 +++- interface/src/avatar/MyAvatar.cpp | 24 ++++-------- interface/src/devices/FaceTracker.cpp | 14 +++++++ interface/src/devices/FaceTracker.h | 43 ++++++++++++++++++++ interface/src/devices/Faceplus.cpp | 32 +++++++++++++++ interface/src/devices/Faceplus.h | 34 ++++++++++++++++ interface/src/devices/Faceshift.cpp | 4 +- interface/src/devices/Faceshift.h | 19 ++------- interface/src/devices/Visage.cpp | 4 +- interface/src/devices/Visage.h | 21 ++-------- 11 files changed, 178 insertions(+), 80 deletions(-) create mode 100644 interface/src/devices/FaceTracker.cpp create mode 100644 interface/src/devices/FaceTracker.h create mode 100644 interface/src/devices/Faceplus.cpp create mode 100644 interface/src/devices/Faceplus.h diff --git a/interface/src/Application.cpp b/interface/src/Application.cpp index 45ae36a23b..5c50f76767 100644 --- a/interface/src/Application.cpp +++ b/interface/src/Application.cpp @@ -1342,6 +1342,12 @@ glm::vec3 Application::getMouseVoxelWorldCoordinates(const VoxelDetail& mouseVox (mouseVoxel.z + mouseVoxel.s / 2.f) * TREE_SCALE); } +FaceTracker* Application::getActiveFaceTracker() { + return _faceshift.isActive() ? static_cast(&_faceshift) : + (_faceplus.isActive() ? static_cast(&_faceplus) : + (_visage.isActive() ? static_cast(&_visage) : NULL)); +} + struct SendVoxelsOperationArgs { const unsigned char* newBaseOctCode; }; @@ -1561,7 +1567,8 @@ void Application::init() { } qDebug("Loaded settings"); - // initialize Visage and Faceshift after loading the menu settings + // initialize our face trackers after loading the menu settings + _faceplus.init(); _faceshift.init(); _visage.init(); @@ -1682,6 +1689,15 @@ void Application::updateMouseRay() { _myAvatar->setMouseRay(_mouseRayOrigin, _mouseRayDirection); } +void Application::updateFaceplus() { + + bool showWarnings = Menu::getInstance()->isOptionChecked(MenuOption::PipelineWarnings); + PerformanceWarning warn(showWarnings, "Application::updateFaceplus()"); + + // Update faceplus + _faceplus.update(); +} + void Application::updateFaceshift() { bool showWarnings = Menu::getInstance()->isOptionChecked(MenuOption::PipelineWarnings); @@ -1726,19 +1742,11 @@ void Application::updateMyAvatarLookAtPosition() { glm::distance(_mouseRayOrigin, _myAvatar->getHead()->calculateAverageEyePosition())); lookAtSpot = _mouseRayOrigin + _mouseRayDirection * qMax(minEyeDistance, distance); } - bool trackerActive = false; - float eyePitch, eyeYaw; - if (_faceshift.isActive()) { - eyePitch = _faceshift.getEstimatedEyePitch(); - eyeYaw = _faceshift.getEstimatedEyeYaw(); - trackerActive = true; - - } else if (_visage.isActive()) { - eyePitch = _visage.getEstimatedEyePitch(); - eyeYaw = _visage.getEstimatedEyeYaw(); - trackerActive = true; - } - if (trackerActive) { + FaceTracker* tracker = getActiveFaceTracker(); + if (tracker) { + float eyePitch = tracker->getEstimatedEyePitch(); + float eyeYaw = tracker->getEstimatedEyeYaw(); + // deflect using Faceshift gaze data glm::vec3 origin = _myAvatar->getHead()->calculateAverageEyePosition(); float pitchSign = (_myCamera.getMode() == CAMERA_MODE_MIRROR) ? -1.0f : 1.0f; @@ -1824,15 +1832,15 @@ void Application::updateCamera(float deltaTime) { bool showWarnings = Menu::getInstance()->isOptionChecked(MenuOption::PipelineWarnings); PerformanceWarning warn(showWarnings, "Application::updateCamera()"); - if (!OculusManager::isConnected() && !TV3DManager::isConnected()) { - if (Menu::getInstance()->isOptionChecked(MenuOption::OffAxisProjection)) { - float xSign = _myCamera.getMode() == CAMERA_MODE_MIRROR ? 1.0f : -1.0f; - if (_faceshift.isActive()) { - const float EYE_OFFSET_SCALE = 0.025f; - glm::vec3 position = _faceshift.getHeadTranslation() * EYE_OFFSET_SCALE; - _myCamera.setEyeOffsetPosition(glm::vec3(position.x * xSign, position.y, -position.z)); - updateProjectionMatrix(); - } + if (!OculusManager::isConnected() && !TV3DManager::isConnected() && + Menu::getInstance()->isOptionChecked(MenuOption::OffAxisProjection)) { + FaceTracker* tracker = getActiveFaceTracker(); + if (tracker) { + const float EYE_OFFSET_SCALE = 0.025f; + glm::vec3 position = tracker->getHeadTranslation() * EYE_OFFSET_SCALE; + float xSign = (_myCamera.getMode() == CAMERA_MODE_MIRROR) ? 1.0f : -1.0f; + _myCamera.setEyeOffsetPosition(glm::vec3(position.x * xSign, position.y, -position.z)); + updateProjectionMatrix(); } } } @@ -1886,6 +1894,7 @@ void Application::update(float deltaTime) { // check what's under the mouse and update the mouse voxel updateMouseRay(); + updateFaceplus(); updateFaceshift(); updateVisage(); _myAvatar->updateLookAtTargetAvatar(); @@ -2936,6 +2945,7 @@ void Application::resetSensors() { _mouseX = _glWidget->width() / 2; _mouseY = _glWidget->height() / 2; + _faceplus.reset(); _faceshift.reset(); _visage.reset(); diff --git a/interface/src/Application.h b/interface/src/Application.h index 7c1cb9cab1..c6b38b1644 100644 --- a/interface/src/Application.h +++ b/interface/src/Application.h @@ -49,6 +49,7 @@ #include "avatar/Avatar.h" #include "avatar/AvatarManager.h" #include "avatar/MyAvatar.h" +#include "devices/Faceplus.h" #include "devices/Faceshift.h" #include "devices/SixenseManager.h" #include "devices/Visage.h" @@ -173,8 +174,10 @@ public: bool isMouseHidden() const { return _mouseHidden; } const glm::vec3& getMouseRayOrigin() const { return _mouseRayOrigin; } const glm::vec3& getMouseRayDirection() const { return _mouseRayDirection; } + Faceplus* getFaceplus() { return &_faceplus; } Faceshift* getFaceshift() { return &_faceshift; } Visage* getVisage() { return &_visage; } + FaceTracker* getActiveFaceTracker(); SixenseManager* getSixenseManager() { return &_sixenseManager; } BandwidthMeter* getBandwidthMeter() { return &_bandwidthMeter; } QUndoStack* getUndoStack() { return &_undoStack; } @@ -313,6 +316,7 @@ private: // Various helper functions called during update() void updateLOD(); void updateMouseRay(); + void updateFaceplus(); void updateFaceshift(); void updateVisage(); void updateMyAvatarLookAtPosition(); @@ -412,9 +416,10 @@ private: AvatarManager _avatarManager; MyAvatar* _myAvatar; // TODO: move this and relevant code to AvatarManager (or MyAvatar as the case may be) + Faceplus _faceplus; Faceshift _faceshift; Visage _visage; - + SixenseManager _sixenseManager; Camera _myCamera; // My view onto the world diff --git a/interface/src/avatar/MyAvatar.cpp b/interface/src/avatar/MyAvatar.cpp index 73d2a84eb7..6c7ac5b82c 100644 --- a/interface/src/avatar/MyAvatar.cpp +++ b/interface/src/avatar/MyAvatar.cpp @@ -309,24 +309,13 @@ void MyAvatar::simulate(float deltaTime) { // Update avatar head rotation with sensor data void MyAvatar::updateFromGyros(float deltaTime) { - Faceshift* faceshift = Application::getInstance()->getFaceshift(); - Visage* visage = Application::getInstance()->getVisage(); glm::vec3 estimatedPosition, estimatedRotation; - bool trackerActive = false; - if (faceshift->isActive()) { - estimatedPosition = faceshift->getHeadTranslation(); - estimatedRotation = glm::degrees(safeEulerAngles(faceshift->getHeadRotation())); - trackerActive = true; - - } else if (visage->isActive()) { - estimatedPosition = visage->getHeadTranslation(); - estimatedRotation = glm::degrees(safeEulerAngles(visage->getHeadRotation())); - trackerActive = true; - } - - Head* head = getHead(); - if (trackerActive) { + FaceTracker* tracker = Application::getInstance()->getActiveFaceTracker(); + if (tracker) { + estimatedPosition = tracker->getHeadTranslation(); + estimatedRotation = glm::degrees(safeEulerAngles(tracker->getHeadRotation())); + // Rotate the body if the head is turned beyond the screen if (Menu::getInstance()->isOptionChecked(MenuOption::TurnWithHead)) { const float TRACKER_YAW_TURN_SENSITIVITY = 0.5f; @@ -341,13 +330,14 @@ void MyAvatar::updateFromGyros(float deltaTime) { } } } - } + } // Set the rotation of the avatar's head (as seen by others, not affecting view frustum) // to be scaled. Pitch is greater to emphasize nodding behavior / synchrony. const float AVATAR_HEAD_PITCH_MAGNIFY = 1.0f; const float AVATAR_HEAD_YAW_MAGNIFY = 1.0f; const float AVATAR_HEAD_ROLL_MAGNIFY = 1.0f; + Head* head = getHead(); head->setDeltaPitch(estimatedRotation.x * AVATAR_HEAD_PITCH_MAGNIFY); head->setDeltaYaw(estimatedRotation.y * AVATAR_HEAD_YAW_MAGNIFY); head->setDeltaRoll(estimatedRotation.z * AVATAR_HEAD_ROLL_MAGNIFY); diff --git a/interface/src/devices/FaceTracker.cpp b/interface/src/devices/FaceTracker.cpp new file mode 100644 index 0000000000..45f789fbfe --- /dev/null +++ b/interface/src/devices/FaceTracker.cpp @@ -0,0 +1,14 @@ +// +// FaceTracker.cpp +// interface +// +// Created by Andrzej Kapolka on 4/8/14. +// Copyright (c) 2014 High Fidelity, Inc. All rights reserved. +// + +#include "FaceTracker.h" + +FaceTracker::FaceTracker() : + _estimatedEyePitch(0.0f), + _estimatedEyeYaw(0.0f) { +} diff --git a/interface/src/devices/FaceTracker.h b/interface/src/devices/FaceTracker.h new file mode 100644 index 0000000000..659defe591 --- /dev/null +++ b/interface/src/devices/FaceTracker.h @@ -0,0 +1,43 @@ +// +// FaceTracker.h +// interface +// +// Created by Andrzej Kapolka on 4/8/14. +// Copyright (c) 2014 High Fidelity, Inc. All rights reserved. +// + +#ifndef __interface__FaceTracker__ +#define __interface__FaceTracker__ + +#include +#include + +#include +#include + +/// Base class for face trackers (Faceshift, Visage, Faceplus). +class FaceTracker : public QObject { + Q_OBJECT + +public: + + FaceTracker(); + + const glm::vec3& getHeadTranslation() const { return _headTranslation; } + const glm::quat& getHeadRotation() const { return _headRotation; } + + float getEstimatedEyePitch() const { return _estimatedEyePitch; } + float getEstimatedEyeYaw() const { return _estimatedEyeYaw; } + + const QVector& getBlendshapeCoefficients() const { return _blendshapeCoefficients; } + +protected: + + glm::vec3 _headTranslation; + glm::quat _headRotation; + float _estimatedEyePitch; + float _estimatedEyeYaw; + QVector _blendshapeCoefficients; +}; + +#endif /* defined(__interface__FaceTracker__) */ diff --git a/interface/src/devices/Faceplus.cpp b/interface/src/devices/Faceplus.cpp new file mode 100644 index 0000000000..64dd4bf52d --- /dev/null +++ b/interface/src/devices/Faceplus.cpp @@ -0,0 +1,32 @@ +// +// Faceplus.cpp +// interface +// +// Created by Andrzej Kapolka on 4/8/14. +// Copyright (c) 2014 High Fidelity, Inc. All rights reserved. +// + +#ifdef HAVE_FACEPLUS +#include +#endif + +#include "Faceplus.h" + +Faceplus::Faceplus() : + _active(false) { +} + +void Faceplus::init() { +#ifdef HAVE_FACEPLUS + // these are ignored--any values will do + faceplus_log_in("username", "password"); +#endif +} + +void Faceplus::update() { +} + +void Faceplus::reset() { +} + + diff --git a/interface/src/devices/Faceplus.h b/interface/src/devices/Faceplus.h new file mode 100644 index 0000000000..cf7a6583a1 --- /dev/null +++ b/interface/src/devices/Faceplus.h @@ -0,0 +1,34 @@ +// +// Faceplus.h +// interface +// +// Created by Andrzej Kapolka on 4/8/14. +// Copyright (c) 2014 High Fidelity, Inc. All rights reserved. +// + +#ifndef __interface__Faceplus__ +#define __interface__Faceplus__ + +#include "FaceTracker.h" + +/// Interface for Mixamo FacePlus. +class Faceplus : public FaceTracker { + Q_OBJECT + +public: + + Faceplus(); + + void init(); + + bool isActive() const { return _active; } + + void update(); + void reset(); + +private: + + bool _active; +}; + +#endif /* defined(__interface__Faceplus__) */ diff --git a/interface/src/devices/Faceshift.cpp b/interface/src/devices/Faceshift.cpp index 9f1734c7e5..05abcfd0d7 100644 --- a/interface/src/devices/Faceshift.cpp +++ b/interface/src/devices/Faceshift.cpp @@ -42,9 +42,7 @@ Faceshift::Faceshift() : _jawOpenIndex(21), _longTermAverageEyePitch(0.0f), _longTermAverageEyeYaw(0.0f), - _longTermAverageInitialized(false), - _estimatedEyePitch(0.0f), - _estimatedEyeYaw(0.0f) + _longTermAverageInitialized(false) { connect(&_tcpSocket, SIGNAL(connected()), SLOT(noteConnected())); connect(&_tcpSocket, SIGNAL(error(QAbstractSocket::SocketError)), SLOT(noteError(QAbstractSocket::SocketError))); diff --git a/interface/src/devices/Faceshift.h b/interface/src/devices/Faceshift.h index f878056b57..c49c6661e7 100644 --- a/interface/src/devices/Faceshift.h +++ b/interface/src/devices/Faceshift.h @@ -17,8 +17,10 @@ #include +#include "FaceTracker.h" + /// Handles interaction with the Faceshift software, which provides head position/orientation and facial features. -class Faceshift : public QObject { +class Faceshift : public FaceTracker { Q_OBJECT public: @@ -31,9 +33,7 @@ public: bool isActive() const; - const glm::quat& getHeadRotation() const { return _headRotation; } const glm::vec3& getHeadAngularVelocity() const { return _headAngularVelocity; } - const glm::vec3& getHeadTranslation() const { return _headTranslation; } // these pitch/yaw angles are in degrees float getEyeGazeLeftPitch() const { return _eyeGazeLeftPitch; } @@ -42,11 +42,6 @@ public: float getEyeGazeRightPitch() const { return _eyeGazeRightPitch; } float getEyeGazeRightYaw() const { return _eyeGazeRightYaw; } - float getEstimatedEyePitch() const { return _estimatedEyePitch; } - float getEstimatedEyeYaw() const { return _estimatedEyeYaw; } - - const QVector& getBlendshapeCoefficients() const { return _blendshapeCoefficients; } - float getLeftBlink() const { return getBlendshapeCoefficient(_leftBlinkIndex); } float getRightBlink() const { return getBlendshapeCoefficient(_rightBlinkIndex); } float getLeftEyeOpen() const { return getBlendshapeCoefficient(_leftEyeOpenIndex); } @@ -99,9 +94,7 @@ private: bool _tracking; quint64 _lastTrackingStateReceived; - glm::quat _headRotation; glm::vec3 _headAngularVelocity; - glm::vec3 _headTranslation; // degrees float _eyeGazeLeftPitch; @@ -109,8 +102,6 @@ private: float _eyeGazeRightPitch; float _eyeGazeRightYaw; - QVector _blendshapeCoefficients; - int _leftBlinkIndex; int _rightBlinkIndex; int _leftEyeOpenIndex; @@ -132,10 +123,6 @@ private: float _longTermAverageEyePitch; float _longTermAverageEyeYaw; bool _longTermAverageInitialized; - - // degrees - float _estimatedEyePitch; - float _estimatedEyeYaw; }; #endif /* defined(__interface__Faceshift__) */ diff --git a/interface/src/devices/Visage.cpp b/interface/src/devices/Visage.cpp index b96ef1ee72..0cb534f8c3 100644 --- a/interface/src/devices/Visage.cpp +++ b/interface/src/devices/Visage.cpp @@ -34,9 +34,7 @@ const glm::vec3 DEFAULT_HEAD_ORIGIN(0.0f, 0.0f, 0.7f); Visage::Visage() : _enabled(false), _active(false), - _headOrigin(DEFAULT_HEAD_ORIGIN), - _estimatedEyePitch(0.0f), - _estimatedEyeYaw(0.0f) { + _headOrigin(DEFAULT_HEAD_ORIGIN) { #ifdef HAVE_VISAGE QByteArray licensePath = Application::resourcesPath().toLatin1() + "visage/license.vlc"; diff --git a/interface/src/devices/Visage.h b/interface/src/devices/Visage.h index 6e98abbb61..0da87fb332 100644 --- a/interface/src/devices/Visage.h +++ b/interface/src/devices/Visage.h @@ -16,13 +16,15 @@ #include #include +#include "FaceTracker.h" + namespace VisageSDK { class VisageTracker2; struct FaceData; } /// Handles input from the Visage webcam feature tracking software. -class Visage : public QObject { +class Visage : public FaceTracker { Q_OBJECT public: @@ -34,14 +36,6 @@ public: bool isActive() const { return _active; } - const glm::quat& getHeadRotation() const { return _headRotation; } - const glm::vec3& getHeadTranslation() const { return _headTranslation; } - - float getEstimatedEyePitch() const { return _estimatedEyePitch; } - float getEstimatedEyeYaw() const { return _estimatedEyeYaw; } - - const QVector& getBlendshapeCoefficients() const { return _blendshapeCoefficients; } - void update(); void reset(); @@ -61,15 +55,8 @@ private: bool _enabled; bool _active; - glm::quat _headRotation; - glm::vec3 _headTranslation; - + glm::vec3 _headOrigin; - - float _estimatedEyePitch; - float _estimatedEyeYaw; - - QVector _blendshapeCoefficients; }; #endif /* defined(__interface__Visage__) */ From 34aefe1b496089861904bc1d838febe9d99f4e0f Mon Sep 17 00:00:00 2001 From: Andrew Meadows Date: Tue, 8 Apr 2014 18:33:08 -0700 Subject: [PATCH 039/120] fix glitchy oculus when looking directly behind --- interface/src/avatar/MyAvatar.cpp | 67 +++++++++++++++++++------ interface/src/avatar/MyAvatar.h | 2 +- interface/src/devices/OculusManager.cpp | 10 ---- interface/src/devices/OculusManager.h | 1 - 4 files changed, 52 insertions(+), 28 deletions(-) diff --git a/interface/src/avatar/MyAvatar.cpp b/interface/src/avatar/MyAvatar.cpp index 05636166e2..8b02605a62 100644 --- a/interface/src/avatar/MyAvatar.cpp +++ b/interface/src/avatar/MyAvatar.cpp @@ -62,7 +62,8 @@ MyAvatar::MyAvatar() : _moveTargetStepCounter(0), _lookAtTargetAvatar(), _shouldRender(true), - _billboardValid(false) + _billboardValid(false), + _oculusYawOffset(0.f) { for (int i = 0; i < MAX_DRIVE_KEYS; i++) { _driveKeys[i] = 0.0f; @@ -85,6 +86,7 @@ void MyAvatar::reset() { _skeletonModel.reset(); getHead()->reset(); getHand()->reset(); + _oculusYawOffset = 0.f; setVelocity(glm::vec3(0.f)); setThrust(glm::vec3(0.f)); @@ -121,16 +123,6 @@ void MyAvatar::update(float deltaTime) { //_headMouseY = glm::clamp(_headMouseY, 0, _glWidget->height()); } - if (OculusManager::isConnected()) { - float yaw, pitch, roll; // these angles will be in radians - OculusManager::getEulerAngles(yaw, pitch, roll); - - // but these euler angles are stored in degrees - head->setBaseYaw(yaw * DEGREES_PER_RADIAN); - head->setBasePitch(pitch * DEGREES_PER_RADIAN); - head->setBaseRoll(roll * DEGREES_PER_RADIAN); - } - // Get audio loudness data from audio input device Audio* audio = Application::getInstance()->getAudio(); head->setAudioLoudness(audio->getLastInputLoudness()); @@ -222,6 +214,54 @@ void MyAvatar::simulate(float deltaTime) { applyDamping(deltaTime, _velocity, linearDamping, SQUARED_DAMPING_STRENGTH); } + if (OculusManager::isConnected()) { + // these angles will be in radians + float yaw, pitch, roll; + OculusManager::getEulerAngles(yaw, pitch, roll); + // ... so they need to be converted to degrees before we do math... + + // The neck is limited in how much it can yaw, so we check its relative + // yaw from the body and yaw the body if necessary. + yaw *= DEGREES_PER_RADIAN; + float bodyToHeadYaw = yaw - _oculusYawOffset; + const float MAX_NECK_YAW = 85.f; // degrees + if ((fabs(bodyToHeadYaw) > 2.f * MAX_NECK_YAW) && (yaw * _oculusYawOffset < 0.f)) { + // We've wrapped around the range for yaw so adjust + // the measured yaw to be relative to _oculusYawOffset. + if (yaw > 0.f) { + yaw -= 360.f; + } else { + yaw += 360.f; + } + bodyToHeadYaw = yaw - _oculusYawOffset; + } + + float delta = fabs(bodyToHeadYaw) - MAX_NECK_YAW; + if (delta > 0.f) { + yaw = MAX_NECK_YAW; + if (bodyToHeadYaw < 0.f) { + delta *= -1.f; + bodyToHeadYaw = -MAX_NECK_YAW; + } else { + bodyToHeadYaw = MAX_NECK_YAW; + } + // constrain _oculusYawOffset to be within range [-180,180] + _oculusYawOffset = fmod((_oculusYawOffset + delta) + 180.f, 360.f) - 180.f; + + // We must adjust the body orientation using a delta rotation (rather than + // doing yaw math) because the body's yaw ranges are not the same + // as what the Oculus API provides. + glm::vec3 UP_AXIS = glm::vec3(0.f, 1.f, 0.f); + glm::quat bodyCorrection = glm::angleAxis(glm::radians(delta), UP_AXIS); + orientation = orientation * bodyCorrection; + } + Head* head = getHead(); + head->setBaseYaw(bodyToHeadYaw); + + head->setBasePitch(pitch * DEGREES_PER_RADIAN); + head->setBaseRoll(roll * DEGREES_PER_RADIAN); + } + // update the euler angles setOrientation(orientation); @@ -575,11 +615,6 @@ void MyAvatar::clearLookAtTargetAvatar() { _lookAtTargetAvatar.clear(); } -float MyAvatar::getAbsoluteHeadYaw() const { - const Head* head = static_cast(_headData); - return glm::yaw(head->getOrientation()); -} - glm::vec3 MyAvatar::getUprightHeadPosition() const { return _position + getWorldAlignedOrientation() * glm::vec3(0.0f, getPelvisToHeadLength(), 0.0f); } diff --git a/interface/src/avatar/MyAvatar.h b/interface/src/avatar/MyAvatar.h index 2125b126b3..90b0129037 100644 --- a/interface/src/avatar/MyAvatar.h +++ b/interface/src/avatar/MyAvatar.h @@ -125,8 +125,8 @@ private: QWeakPointer _lookAtTargetAvatar; glm::vec3 _targetAvatarPosition; bool _shouldRender; - bool _billboardValid; + float _oculusYawOffset; // private methods void updateThrust(float deltaTime); diff --git a/interface/src/devices/OculusManager.cpp b/interface/src/devices/OculusManager.cpp index c5377ce428..5619b4b58d 100644 --- a/interface/src/devices/OculusManager.cpp +++ b/interface/src/devices/OculusManager.cpp @@ -27,7 +27,6 @@ int OculusManager::_scaleLocation; int OculusManager::_scaleInLocation; int OculusManager::_hmdWarpParamLocation; bool OculusManager::_isConnected = false; -float OculusManager::_yawOffset = 0.0f; // radians #ifdef HAVE_LIBOVR using namespace OVR; @@ -187,18 +186,9 @@ void OculusManager::reset() { #endif } -void OculusManager::updateYawOffset() { -#ifdef HAVE_LIBOVR - float yaw, pitch, roll; - _sensorFusion->GetOrientation().GetEulerAngles(&yaw, &pitch, &roll); - _yawOffset = yaw; -#endif -} - void OculusManager::getEulerAngles(float& yaw, float& pitch, float& roll) { #ifdef HAVE_LIBOVR _sensorFusion->GetOrientation().GetEulerAngles(&yaw, &pitch, &roll); - yaw = yaw - _yawOffset; #endif } diff --git a/interface/src/devices/OculusManager.h b/interface/src/devices/OculusManager.h index b3cd400ac8..19bbec31dd 100644 --- a/interface/src/devices/OculusManager.h +++ b/interface/src/devices/OculusManager.h @@ -48,7 +48,6 @@ private: static int _scaleInLocation; static int _hmdWarpParamLocation; static bool _isConnected; - static float _yawOffset; #ifdef HAVE_LIBOVR static OVR::Ptr _deviceManager; From 2eef95f67e922865d4d55a2f4b952e55acdfe419 Mon Sep 17 00:00:00 2001 From: Andrew Meadows Date: Tue, 8 Apr 2014 18:44:34 -0700 Subject: [PATCH 040/120] remove getAbsoluteHeadYaw() from the header --- interface/src/avatar/MyAvatar.h | 1 - 1 file changed, 1 deletion(-) diff --git a/interface/src/avatar/MyAvatar.h b/interface/src/avatar/MyAvatar.h index 90b0129037..60874cc886 100644 --- a/interface/src/avatar/MyAvatar.h +++ b/interface/src/avatar/MyAvatar.h @@ -54,7 +54,6 @@ public: float getLeanScale() const { return _leanScale; } float getElapsedTimeStopped() const { return _elapsedTimeStopped; } float getElapsedTimeMoving() const { return _elapsedTimeMoving; } - float getAbsoluteHeadYaw() const; // degrees const glm::vec3& getMouseRayOrigin() const { return _mouseRayOrigin; } const glm::vec3& getMouseRayDirection() const { return _mouseRayDirection; } glm::vec3 getGravity() const { return _gravity; } From b8232b5dfdc70db8cc811dce1815bb5e1ac2c60b Mon Sep 17 00:00:00 2001 From: Andrew Meadows Date: Wed, 9 Apr 2014 08:11:15 -0700 Subject: [PATCH 041/120] AvatarData now stores sessionUUID --- interface/src/Application.cpp | 5 ++++- libraries/avatars/src/AvatarData.cpp | 1 + libraries/avatars/src/AvatarData.h | 8 +++++--- libraries/avatars/src/AvatarHashMap.cpp | 2 +- 4 files changed, 11 insertions(+), 5 deletions(-) diff --git a/interface/src/Application.cpp b/interface/src/Application.cpp index 15d45b614d..f8aaf45f7c 100644 --- a/interface/src/Application.cpp +++ b/interface/src/Application.cpp @@ -1205,7 +1205,10 @@ void Application::timer() { // ask the node list to check in with the domain server NodeList::getInstance()->sendDomainServerCheckIn(); - + // as soon as we have a valid sessionUUID, store it in the avatar for reference + if (_myAvatar->getSessionUUID().isNull()) { + _myAvatar->setSessionUUID(NodeList::getInstance()->getSessionUUID()); + } } void Application::idle() { diff --git a/libraries/avatars/src/AvatarData.cpp b/libraries/avatars/src/AvatarData.cpp index 930e3f7350..7bdd8fb752 100644 --- a/libraries/avatars/src/AvatarData.cpp +++ b/libraries/avatars/src/AvatarData.cpp @@ -32,6 +32,7 @@ using namespace std; QNetworkAccessManager* AvatarData::networkAccessManager = NULL; AvatarData::AvatarData() : + _sessionUUID(), _handPosition(0,0,0), _bodyYaw(-90.f), _bodyPitch(0.0f), diff --git a/libraries/avatars/src/AvatarData.h b/libraries/avatars/src/AvatarData.h index 2637b5a0c3..0f4df39f87 100755 --- a/libraries/avatars/src/AvatarData.h +++ b/libraries/avatars/src/AvatarData.h @@ -94,12 +94,14 @@ class AvatarData : public QObject { Q_PROPERTY(QString faceModelURL READ getFaceModelURLFromScript WRITE setFaceModelURLFromScript) Q_PROPERTY(QString skeletonModelURL READ getSkeletonModelURLFromScript WRITE setSkeletonModelURLFromScript) Q_PROPERTY(QString billboardURL READ getBillboardURL WRITE setBillboardFromURL) + + Q_PROPERTY(QUuid sessionUUID READ getSessionUUID); public: AvatarData(); virtual ~AvatarData(); - const QUuid& getSessionID() { return _sessionID; } - void setSessionID(const QUuid& id) { _sessionID = id; } + const QUuid& getSessionUUID() { return _sessionUUID; } + void setSessionUUID(const QUuid& id) { _sessionUUID = id; } const glm::vec3& getPosition() const { return _position; } void setPosition(const glm::vec3 position) { _position = position; } @@ -222,7 +224,7 @@ public slots: void sendBillboardPacket(); void setBillboardFromNetworkReply(); protected: - QUuid _sessionID; + QUuid _sessionUUID; glm::vec3 _position; glm::vec3 _handPosition; diff --git a/libraries/avatars/src/AvatarHashMap.cpp b/libraries/avatars/src/AvatarHashMap.cpp index 5a56e3d5dc..3dd5c9991f 100644 --- a/libraries/avatars/src/AvatarHashMap.cpp +++ b/libraries/avatars/src/AvatarHashMap.cpp @@ -15,7 +15,7 @@ AvatarHashMap::AvatarHashMap() : void AvatarHashMap::insert(const QUuid& id, AvatarSharedPointer avatar) { _avatarHash.insert(id, avatar); - avatar->setSessionID(id); + avatar->setSessionUUID(id); } AvatarHash::iterator AvatarHashMap::erase(const AvatarHash::iterator& iterator) { From 2f97dd2574e617454046de514ad1aaaca0281fec Mon Sep 17 00:00:00 2001 From: Andrew Meadows Date: Wed, 9 Apr 2014 08:22:35 -0700 Subject: [PATCH 042/120] sessionID --> sessionUUID for consistency --- interface/src/avatar/AvatarManager.cpp | 26 +++++++++++++------------- 1 file changed, 13 insertions(+), 13 deletions(-) diff --git a/interface/src/avatar/AvatarManager.cpp b/interface/src/avatar/AvatarManager.cpp index 5b98d933ff..fbbaad4e84 100644 --- a/interface/src/avatar/AvatarManager.cpp +++ b/interface/src/avatar/AvatarManager.cpp @@ -123,8 +123,8 @@ void AvatarManager::renderAvatarFades(const glm::vec3& cameraPosition, Avatar::R } } -AvatarSharedPointer AvatarManager::matchingOrNewAvatar(const QUuid& sessionID, const QWeakPointer& mixerWeakPointer) { - AvatarSharedPointer matchingAvatar = _avatarHash.value(sessionID); +AvatarSharedPointer AvatarManager::matchingOrNewAvatar(const QUuid& sessionUUID, const QWeakPointer& mixerWeakPointer) { + AvatarSharedPointer matchingAvatar = _avatarHash.value(sessionUUID); if (!matchingAvatar) { // construct a new Avatar for this node @@ -133,9 +133,9 @@ AvatarSharedPointer AvatarManager::matchingOrNewAvatar(const QUuid& sessionID, c // insert the new avatar into our hash matchingAvatar = AvatarSharedPointer(avatar); - _avatarHash.insert(sessionID, matchingAvatar); + _avatarHash.insert(sessionUUID, matchingAvatar); - qDebug() << "Adding avatar with sessionID " << sessionID << "to AvatarManager hash."; + qDebug() << "Adding avatar with sessionUUID " << sessionUUID << "to AvatarManager hash."; } return matchingAvatar; @@ -166,10 +166,10 @@ void AvatarManager::processAvatarDataPacket(const QByteArray &datagram, const QW // enumerate over all of the avatars in this packet // only add them if mixerWeakPointer points to something (meaning that mixer is still around) while (bytesRead < datagram.size() && mixerWeakPointer.data()) { - QUuid sessionID = QUuid::fromRfc4122(datagram.mid(bytesRead, NUM_BYTES_RFC4122_UUID)); + QUuid sessionUUID = QUuid::fromRfc4122(datagram.mid(bytesRead, NUM_BYTES_RFC4122_UUID)); bytesRead += NUM_BYTES_RFC4122_UUID; - AvatarSharedPointer matchingAvatarData = matchingOrNewAvatar(sessionID, mixerWeakPointer); + AvatarSharedPointer matchingAvatarData = matchingOrNewAvatar(sessionUUID, mixerWeakPointer); // have the matching (or new) avatar parse the data from the packet bytesRead += matchingAvatarData->parseDataAtOffset(datagram, bytesRead); @@ -188,16 +188,16 @@ void AvatarManager::processAvatarIdentityPacket(const QByteArray &packet, const QDataStream identityStream(packet); identityStream.skipRawData(numBytesForPacketHeader(packet)); - QUuid sessionID; + QUuid sessionUUID; while (!identityStream.atEnd()) { QUrl faceMeshURL, skeletonURL; QString displayName; - identityStream >> sessionID >> faceMeshURL >> skeletonURL >> displayName; + identityStream >> sessionUUID >> faceMeshURL >> skeletonURL >> displayName; // mesh URL for a UUID, find avatar in our list - AvatarSharedPointer matchingAvatar = matchingOrNewAvatar(sessionID, mixerWeakPointer); + AvatarSharedPointer matchingAvatar = matchingOrNewAvatar(sessionUUID, mixerWeakPointer); if (matchingAvatar) { Avatar* avatar = static_cast(matchingAvatar.data()); @@ -218,9 +218,9 @@ void AvatarManager::processAvatarIdentityPacket(const QByteArray &packet, const void AvatarManager::processAvatarBillboardPacket(const QByteArray& packet, const QWeakPointer& mixerWeakPointer) { int headerSize = numBytesForPacketHeader(packet); - QUuid sessionID = QUuid::fromRfc4122(QByteArray::fromRawData(packet.constData() + headerSize, NUM_BYTES_RFC4122_UUID)); + QUuid sessionUUID = QUuid::fromRfc4122(QByteArray::fromRawData(packet.constData() + headerSize, NUM_BYTES_RFC4122_UUID)); - AvatarSharedPointer matchingAvatar = matchingOrNewAvatar(sessionID, mixerWeakPointer); + AvatarSharedPointer matchingAvatar = matchingOrNewAvatar(sessionUUID, mixerWeakPointer); if (matchingAvatar) { Avatar* avatar = static_cast(matchingAvatar.data()); QByteArray billboard = packet.mid(headerSize + NUM_BYTES_RFC4122_UUID); @@ -232,10 +232,10 @@ void AvatarManager::processAvatarBillboardPacket(const QByteArray& packet, const void AvatarManager::processKillAvatar(const QByteArray& datagram) { // read the node id - QUuid sessionID = QUuid::fromRfc4122(datagram.mid(numBytesForPacketHeader(datagram), NUM_BYTES_RFC4122_UUID)); + QUuid sessionUUID = QUuid::fromRfc4122(datagram.mid(numBytesForPacketHeader(datagram), NUM_BYTES_RFC4122_UUID)); // remove the avatar with that UUID from our hash, if it exists - AvatarHash::iterator matchedAvatar = _avatarHash.find(sessionID); + AvatarHash::iterator matchedAvatar = _avatarHash.find(sessionUUID); if (matchedAvatar != _avatarHash.end()) { erase(matchedAvatar); } From 995084556604a7a3838ad3b5ffce16a5eae97c4d Mon Sep 17 00:00:00 2001 From: Stephen Birarda Date: Wed, 9 Apr 2014 09:19:29 -0700 Subject: [PATCH 043/120] more apache licensing tweaks to JS files --- examples/clap.js | 8 ++++++++ examples/clipboardExample.js | 2 +- examples/count.js | 2 +- examples/drumStick.js | 8 ++++++++ examples/findParticleExample.js | 5 ++++- examples/flockingBirds.js | 8 ++++++-- examples/fountain.js | 10 +++++++++- examples/gameoflife.js | 14 +++++++++++--- examples/globalCollisionsExample.js | 2 +- examples/gun.js | 3 +-- examples/hideAvatarExample.js | 2 +- examples/hydraMove.js | 2 +- examples/includeExample.js | 2 +- examples/inspect.js | 2 +- examples/localVoxelsExample.js | 9 +++++++++ examples/lookAtExample.js | 2 +- examples/lookWithMouse.js | 2 +- examples/lookWithTouch.js | 2 +- examples/menuExample.js | 2 +- examples/movingVoxel.js | 8 ++++++++ examples/multitouchExample.js | 2 +- examples/overlaysExample.js | 2 +- examples/paintGun.js | 2 +- examples/particleBird.js | 2 ++ examples/particleModelExample.js | 2 +- examples/playSound.js | 4 ++++ examples/rayPickExample.js | 2 +- examples/ribbon.js | 2 +- examples/rideAlongWithAParticleExample.js | 2 +- examples/seeingVoxelsExample.js | 4 +--- examples/selectAudioDevice.js | 2 +- examples/settingsExample.js | 2 +- examples/spaceInvadersExample.js | 2 +- examples/timer.js | 10 ++++++++++ examples/toyball.js | 2 +- examples/voxelDrumming.js | 2 +- 36 files changed, 104 insertions(+), 35 deletions(-) diff --git a/examples/clap.js b/examples/clap.js index ef8b61f05a..a0efcfab7b 100644 --- a/examples/clap.js +++ b/examples/clap.js @@ -1,6 +1,14 @@ // +// cameraExample.js +// examples +// +// Copyright 2014 High Fidelity, Inc. +// // This sample script watches your hydra hands and makes clapping sound when they come close together fast // +// Distributed under the Apache License, Version 2.0. +// See the accompanying file LICENSE or http://www.apache.org/licenses/LICENSE-2.0.html +// function length(v) { return Math.sqrt(v.x * v.x + v.y * v.y + v.z * v.z); diff --git a/examples/clipboardExample.js b/examples/clipboardExample.js index e9f581f581..d36b077451 100644 --- a/examples/clipboardExample.js +++ b/examples/clipboardExample.js @@ -3,7 +3,7 @@ // examples // // Created by Brad Hefta-Gaub on 1/28/14. -// Copyright 2014 HighFidelity, Inc. All rights reserved. +// Copyright 2014 HighFidelity, Inc. // // This is an example script that demonstrates use of the Clipboard class // diff --git a/examples/count.js b/examples/count.js index 1a59d6af36..2a8699ac55 100644 --- a/examples/count.js +++ b/examples/count.js @@ -3,7 +3,7 @@ // examples // // Created by Brad Hefta-Gaub on 12/31/13. -// Copyright 2013 High Fidelity, Inc. All rights reserved. +// Copyright 2013 High Fidelity, Inc. // // This is an example script that runs in a loop and displays a counter to the log // diff --git a/examples/drumStick.js b/examples/drumStick.js index 9b0a8ccbca..e9ac54f814 100644 --- a/examples/drumStick.js +++ b/examples/drumStick.js @@ -1,6 +1,14 @@ // +// drumStick.js +// examples +// +// Copyright 2014 High Fidelity, Inc. +// // This example musical instrument script plays 'air drums' when you move your hands downward // +// Distributed under the Apache License, Version 2.0. +// See the accompanying file LICENSE or http://www.apache.org/licenses/LICENSE-2.0.html +// function length(v) { return Math.sqrt(v.x * v.x + v.y * v.y + v.z * v.z); diff --git a/examples/findParticleExample.js b/examples/findParticleExample.js index 0b07471273..b37890d766 100644 --- a/examples/findParticleExample.js +++ b/examples/findParticleExample.js @@ -3,10 +3,13 @@ // examples // // Created by Brad Hefta-Gaub on 1/24/14. -// Copyright (c) 2014 HighFidelity, Inc. All rights reserved. +// Copyright 2014 HighFidelity, Inc. // // This is an example script that demonstrates "finding" particles // +// Distributed under the Apache License, Version 2.0. +// See the accompanying file LICENSE or http://www.apache.org/licenses/LICENSE-2.0.html +// var iteration = 0; diff --git a/examples/flockingBirds.js b/examples/flockingBirds.js index a45bcc9f97..f85b4b38c4 100644 --- a/examples/flockingBirds.js +++ b/examples/flockingBirds.js @@ -3,7 +3,7 @@ // examples // // Created by Brad Hefta-Gaub on 3/4/14. -// Copyright (c) 2014 HighFidelity, Inc. All rights reserved. +// Copyright 2014 HighFidelity, Inc. All rights reserved. // // This is an example script that generates particles that act like flocking birds // @@ -13,12 +13,16 @@ // go back to gliding // birds don't like to be below a certain altitude // if they are below that altitude they will keep thrusting up, until they get ove - +// // flocking // try to align your velocity with velocity of other birds // try to fly toward center of flock // but dont get too close // +// +// Distributed under the Apache License, Version 2.0. +// See the accompanying file LICENSE or http://www.apache.org/licenses/LICENSE-2.0.html +// var birdsInFlock = 40; diff --git a/examples/fountain.js b/examples/fountain.js index 8816dab09a..ab1b82cb76 100644 --- a/examples/fountain.js +++ b/examples/fountain.js @@ -1,4 +1,12 @@ - +// +// fountain.js +// examples +// +// Copyright 2014 High Fidelity, Inc. +// +// Distributed under the Apache License, Version 2.0. +// See the accompanying file LICENSE or http://www.apache.org/licenses/LICENSE-2.0.html +// function vLength(v) { return Math.sqrt(v.x * v.x + v.y * v.y + v.z * v.z); diff --git a/examples/gameoflife.js b/examples/gameoflife.js index c0122c604a..3fcbfa8138 100644 --- a/examples/gameoflife.js +++ b/examples/gameoflife.js @@ -1,6 +1,14 @@ -// Add your JavaScript for assignment below this line - -// The following is an example of Conway's Game of Life (http://en.wikipedia.org/wiki/Conway's_Game_of_Life) +// +// gameoflife.js +// examples +// +// Copyright 2014 High Fidelity, Inc. +// +// The following is an example of Conway's Game of Life (http://en.wikipedia.org/wiki/Conway's_Game_of_Life) +// +// Distributed under the Apache License, Version 2.0. +// See the accompanying file LICENSE or http://www.apache.org/licenses/LICENSE-2.0.html +// var NUMBER_OF_CELLS_EACH_DIMENSION = 64; var NUMBER_OF_CELLS = NUMBER_OF_CELLS_EACH_DIMENSION * NUMBER_OF_CELLS_EACH_DIMENSION; diff --git a/examples/globalCollisionsExample.js b/examples/globalCollisionsExample.js index b9d1dceefe..a9667396a4 100644 --- a/examples/globalCollisionsExample.js +++ b/examples/globalCollisionsExample.js @@ -3,7 +3,7 @@ // examples // // Created by Brad Hefta-Gaub on 1/29/14. -// Copyright (c) 2014 HighFidelity, Inc. All rights reserved. +// Copyright 2014 HighFidelity, Inc. // // This is an example script that demonstrates use of the Controller class // diff --git a/examples/gun.js b/examples/gun.js index 85d0f9c1e5..95d3905cc7 100644 --- a/examples/gun.js +++ b/examples/gun.js @@ -4,7 +4,7 @@ // // Created by Brad Hefta-Gaub on 12/31/13. // Modified by Philip on 3/3/14 -// Copyright (c) 2013 HighFidelity, Inc. All rights reserved. +// Copyright 2013 HighFidelity, Inc. // // This is an example script that turns the hydra controllers and mouse into a particle gun. // It reads the controller, watches for trigger pulls, and launches particles. @@ -14,7 +14,6 @@ // See the accompanying file LICENSE or http://www.apache.org/licenses/LICENSE-2.0.html // - function getRandomFloat(min, max) { return Math.random() * (max - min) + min; } diff --git a/examples/hideAvatarExample.js b/examples/hideAvatarExample.js index d9e4b350f4..cea503b205 100644 --- a/examples/hideAvatarExample.js +++ b/examples/hideAvatarExample.js @@ -3,7 +3,7 @@ // examples // // Created by Brad Hefta-Gaub on 1/28/14. -// Copyright (c) 2014 HighFidelity, Inc. All rights reserved. +// Copyright 2014 HighFidelity, Inc. // // This is an example script that demonstrates how to enable or disable local rendering of your own avatar // diff --git a/examples/hydraMove.js b/examples/hydraMove.js index e2dd608b4a..6df6784ea1 100644 --- a/examples/hydraMove.js +++ b/examples/hydraMove.js @@ -3,7 +3,7 @@ // examples // // Created by Brad Hefta-Gaub on 2/10/14. -// Copyright (c) 2014 HighFidelity, Inc. All rights reserved. +// Copyright 2014 HighFidelity, Inc. // // This is an example script that demonstrates use of the Controller and MyAvatar classes to implement // avatar flying through the hydra/controller joysticks diff --git a/examples/includeExample.js b/examples/includeExample.js index e82a95fc63..d3ed398c94 100644 --- a/examples/includeExample.js +++ b/examples/includeExample.js @@ -3,7 +3,7 @@ // examples // // Created by Brad Hefta-Gaub on 3/24/14 -// Copyright (c) 2013 HighFidelity, Inc. All rights reserved. +// Copyright 2013 HighFidelity, Inc. // // This is an example script that demonstrates use of the Script.include() feature // diff --git a/examples/inspect.js b/examples/inspect.js index 5402a6a830..39b74c9117 100644 --- a/examples/inspect.js +++ b/examples/inspect.js @@ -3,7 +3,7 @@ // examples // // Created by Clément Brisset on March 20, 2014 -// Copyright (c) 2014 HighFidelity, Inc. All rights reserved. +// Copyright 2014 HighFidelity, Inc. // // Allows you to inspect non moving objects (Voxels or Avatars) using Atl, Control (Command on Mac) and Shift // diff --git a/examples/localVoxelsExample.js b/examples/localVoxelsExample.js index 7d9007f590..d64138b214 100644 --- a/examples/localVoxelsExample.js +++ b/examples/localVoxelsExample.js @@ -1,3 +1,12 @@ +// +// localVoxelsExample.js +// examples +// +// Copyright 2014 High Fidelity, Inc. +// +// Distributed under the Apache License, Version 2.0. +// See the accompanying file LICENSE or http://www.apache.org/licenses/LICENSE-2.0.html +// var TREE_SCALE = 16384; var tree = LocalVoxels("tree"); diff --git a/examples/lookAtExample.js b/examples/lookAtExample.js index 6e208ddbdd..58dcfc9184 100644 --- a/examples/lookAtExample.js +++ b/examples/lookAtExample.js @@ -3,7 +3,7 @@ // examples // // Created by Brad Hefta-Gaub on 2/6/14. -// Copyright (c) 2014 HighFidelity, Inc. All rights reserved. +// Copyright 2014 HighFidelity, Inc. // // This is an example script that demonstrates use of the Camera class's lookAt(), keepLookingAt(), and stopLookingAt() // features. diff --git a/examples/lookWithMouse.js b/examples/lookWithMouse.js index 4293654ae5..b269da3c7a 100644 --- a/examples/lookWithMouse.js +++ b/examples/lookWithMouse.js @@ -3,7 +3,7 @@ // examples // // Created by Brad Hefta-Gaub on 1/28/14. -// Copyright (c) 2014 HighFidelity, Inc. All rights reserved. +// Copyright (c) 2014 HighFidelity, Inc. // // This is an example script that demonstrates use of the Controller class // diff --git a/examples/lookWithTouch.js b/examples/lookWithTouch.js index 0278d2b7b2..29920a5b4e 100644 --- a/examples/lookWithTouch.js +++ b/examples/lookWithTouch.js @@ -3,7 +3,7 @@ // examples // // Created by Brad Hefta-Gaub on 1/28/14. -// Copyright (c) 2014 HighFidelity, Inc. All rights reserved. +// Copyright (c) 2014 HighFidelity, Inc. // // This is an example script that demonstrates use of the Controller class // diff --git a/examples/menuExample.js b/examples/menuExample.js index d448c32bf8..b4f956218a 100644 --- a/examples/menuExample.js +++ b/examples/menuExample.js @@ -3,7 +3,7 @@ // examples // // Created by Brad Hefta-Gaub on 2/24/14 -// Copyright (c) 2013 HighFidelity, Inc. All rights reserved. +// Copyright (c) 2013 HighFidelity, Inc. // // This is an example script that demonstrates use of the Menu object // diff --git a/examples/movingVoxel.js b/examples/movingVoxel.js index 0ddce48334..c55957cd04 100644 --- a/examples/movingVoxel.js +++ b/examples/movingVoxel.js @@ -1,6 +1,14 @@ // +// movingVoxel.js +// examples +// +// Copyright 2014 High Fidelity, Inc. +// // This sample script creates a voxel moving back and forth in a line // +// Distributed under the Apache License, Version 2.0. +// See the accompanying file LICENSE or http://www.apache.org/licenses/LICENSE-2.0.html +// var position = { x: 0, y: 0, z: 0 }; var oldPosition = { x: 0, y: 0, z:0 }; diff --git a/examples/multitouchExample.js b/examples/multitouchExample.js index b76902f57a..55d1d834bd 100644 --- a/examples/multitouchExample.js +++ b/examples/multitouchExample.js @@ -3,7 +3,7 @@ // examples // // Created by Brad Hefta-Gaub on 2/9/14. -// Copyright (c) 2014 HighFidelity, Inc. All rights reserved. +// Copyright 2014 HighFidelity, Inc. // // This is an example script that demonstrates use of the Controller class's multi-touch features // diff --git a/examples/overlaysExample.js b/examples/overlaysExample.js index ec54438692..420500faf1 100644 --- a/examples/overlaysExample.js +++ b/examples/overlaysExample.js @@ -3,7 +3,7 @@ // examples // // Created by Brad Hefta-Gaub on 2/14/14. -// Copyright (c) 2014 HighFidelity, Inc. All rights reserved. +// Copyright 2014 HighFidelity, Inc. // // This is an example script that demonstrates use of the Overlays class // diff --git a/examples/paintGun.js b/examples/paintGun.js index fa2d4f1e1f..7d2ec54351 100644 --- a/examples/paintGun.js +++ b/examples/paintGun.js @@ -3,7 +3,7 @@ // examples // // Created by Brad Hefta-Gaub on 12/31/13. -// Copyright (c) 2013 HighFidelity, Inc. All rights reserved. +// Copyright 2013 HighFidelity, Inc. // // Distributed under the Apache License, Version 2.0. // See the accompanying file LICENSE or http://www.apache.org/licenses/LICENSE-2.0.html diff --git a/examples/particleBird.js b/examples/particleBird.js index 59ada1950e..5241b3550b 100644 --- a/examples/particleBird.js +++ b/examples/particleBird.js @@ -2,6 +2,8 @@ // particleBird.js // examples // +// Copyright 2014 High Fidelity, Inc. +// // This sample script moves a voxel around like a bird and sometimes makes tweeting noises // // Distributed under the Apache License, Version 2.0. diff --git a/examples/particleModelExample.js b/examples/particleModelExample.js index 96b16c503d..b489e704c9 100644 --- a/examples/particleModelExample.js +++ b/examples/particleModelExample.js @@ -3,7 +3,7 @@ // examples // // Created by Brad Hefta-Gaub on 1/28/14. -// Copyright (c) 2014 HighFidelity, Inc. All rights reserved. +// Copyright 2014 High Fidelity, Inc. // // This is an example script that demonstrates creating and editing a particle // diff --git a/examples/playSound.js b/examples/playSound.js index 7715604de2..fb589bc9e3 100644 --- a/examples/playSound.js +++ b/examples/playSound.js @@ -1,4 +1,8 @@ // +// playSound.js +// examples +// +// Copyright 2014 High Fidelity, Inc. // This sample script loads a sound file and plays it at the 'fingertip' of the // // Distributed under the Apache License, Version 2.0. diff --git a/examples/rayPickExample.js b/examples/rayPickExample.js index 13ab285af5..c09a7b1e57 100644 --- a/examples/rayPickExample.js +++ b/examples/rayPickExample.js @@ -3,7 +3,7 @@ // examples // // Created by Brad Hefta-Gaub on 2/6/14. -// Copyright (c) 2014 HighFidelity, Inc. All rights reserved. +// Copyright 2014 High Fidelity, Inc. // // This is an example script that demonstrates use of the Camera class // diff --git a/examples/ribbon.js b/examples/ribbon.js index 5e48ee3193..9f0cc02e52 100644 --- a/examples/ribbon.js +++ b/examples/ribbon.js @@ -3,7 +3,7 @@ // examples // // Created by Andrzej Kapolka on 2/24/14. -// Copyright (c) 2014 High Fidelity, Inc. All rights reserved. +// Copyright 2014 High Fidelity, Inc. All rights reserved. // // Distributed under the Apache License, Version 2.0. // See the accompanying file LICENSE or http://www.apache.org/licenses/LICENSE-2.0.html diff --git a/examples/rideAlongWithAParticleExample.js b/examples/rideAlongWithAParticleExample.js index a6decbc2c2..552f6fb7fe 100644 --- a/examples/rideAlongWithAParticleExample.js +++ b/examples/rideAlongWithAParticleExample.js @@ -3,7 +3,7 @@ // examples // // Created by Brad Hefta-Gaub on 1/24/14. -// Copyright (c) 2014 HighFidelity, Inc. All rights reserved. +// Copyright 2014 High Fidelity, Inc. // // This is an example script that demonstrates "finding" particles // diff --git a/examples/seeingVoxelsExample.js b/examples/seeingVoxelsExample.js index e0f991ea40..35e2f95dd7 100644 --- a/examples/seeingVoxelsExample.js +++ b/examples/seeingVoxelsExample.js @@ -3,9 +3,7 @@ // examples // // Created by Brad Hefta-Gaub on 2/26/14 -// Copyright (c) 2014 HighFidelity, Inc. All rights reserved. -// -// This is an example script +// Copyright 2014 High Fidelity, Inc. // // Distributed under the Apache License, Version 2.0. // See the accompanying file LICENSE or http://www.apache.org/licenses/LICENSE-2.0.html diff --git a/examples/selectAudioDevice.js b/examples/selectAudioDevice.js index 668e467254..23606f774c 100644 --- a/examples/selectAudioDevice.js +++ b/examples/selectAudioDevice.js @@ -3,7 +3,7 @@ // examples // // Created by Brad Hefta-Gaub on 3/22/14 -// Copyright (c) 2013 HighFidelity, Inc. All rights reserved. +// Copyright 2013 High Fidelity, Inc. // // This is an example script that demonstrates use of the Menu object // diff --git a/examples/settingsExample.js b/examples/settingsExample.js index 816fc956a3..bef347ff07 100644 --- a/examples/settingsExample.js +++ b/examples/settingsExample.js @@ -3,7 +3,7 @@ // examples // // Created by Brad Hefta-Gaub on 3/22/14 -// Copyright (c) 2013 HighFidelity, Inc. All rights reserved. +// Copyright 2013 High Fidelity, Inc. // // This is an example script that demonstrates use of the Menu object // diff --git a/examples/spaceInvadersExample.js b/examples/spaceInvadersExample.js index be4fcf445f..5b25fa1236 100644 --- a/examples/spaceInvadersExample.js +++ b/examples/spaceInvadersExample.js @@ -3,7 +3,7 @@ // examples // // Created by Brad Hefta-Gaub on 1/30/14. -// Copyright (c) 2014 HighFidelity, Inc. All rights reserved. +// Copyright 2014 High Fidelity, Inc. // // This is an example script that demonstrates a simple space invaders style of game // diff --git a/examples/timer.js b/examples/timer.js index c7ad0290ab..b3af1d902c 100644 --- a/examples/timer.js +++ b/examples/timer.js @@ -1,3 +1,13 @@ +// +// timer.js +// examples +// +// Copyright 2014 High Fidelity, Inc. +// +// Distributed under the Apache License, Version 2.0. +// See the accompanying file LICENSE or http://www.apache.org/licenses/LICENSE-2.0.html +// + var one_timer = Script.setTimeout(function() { print("One time timer fired!"); }, 10000); var multiple_timer = Script.setInterval(function() { print("Repeating timer fired!"); }, 1000); diff --git a/examples/toyball.js b/examples/toyball.js index 52646c94b4..de68e97357 100644 --- a/examples/toyball.js +++ b/examples/toyball.js @@ -3,7 +3,7 @@ // examples // // Created by Brad Hefta-Gaub on 1/20/14. -// Copyright (c) 2014 HighFidelity, Inc. All rights reserved. +// Copyright 2014 High Fidelity, Inc. // // This is an example script that turns the hydra controllers into a toy ball catch and throw game. // It reads the controller, watches for button presses and trigger pulls, and launches particles. diff --git a/examples/voxelDrumming.js b/examples/voxelDrumming.js index f064d6736e..7f3495dea7 100644 --- a/examples/voxelDrumming.js +++ b/examples/voxelDrumming.js @@ -3,7 +3,7 @@ // examples // // Created by Brad Hefta-Gaub on 2/14/14. -// Copyright (c) 2014 HighFidelity, Inc. All rights reserved. +// Copyright 2014 High Fidelity, Inc. // // This is an example script that demonstrates use of the Overlays, Controller, and Audio classes // From 4a398494b1965b5d7f88a271a7ed13d74a73f1f6 Mon Sep 17 00:00:00 2001 From: Stephen Birarda Date: Wed, 9 Apr 2014 09:21:54 -0700 Subject: [PATCH 044/120] ensure spacing in company name for JS licenses --- examples/clipboardExample.js | 2 +- examples/findParticleExample.js | 2 +- examples/flockingBirds.js | 2 +- examples/globalCollisionsExample.js | 2 +- examples/gun.js | 2 +- examples/hideAvatarExample.js | 2 +- examples/hydraMove.js | 2 +- examples/includeExample.js | 2 +- examples/inspect.js | 2 +- examples/lookAtExample.js | 2 +- examples/lookWithMouse.js | 2 +- examples/lookWithTouch.js | 2 +- examples/menuExample.js | 2 +- examples/multitouchExample.js | 2 +- examples/overlaysExample.js | 2 +- 15 files changed, 15 insertions(+), 15 deletions(-) diff --git a/examples/clipboardExample.js b/examples/clipboardExample.js index d36b077451..e6db44054f 100644 --- a/examples/clipboardExample.js +++ b/examples/clipboardExample.js @@ -3,7 +3,7 @@ // examples // // Created by Brad Hefta-Gaub on 1/28/14. -// Copyright 2014 HighFidelity, Inc. +// Copyright 2014 High Fidelity, Inc. // // This is an example script that demonstrates use of the Clipboard class // diff --git a/examples/findParticleExample.js b/examples/findParticleExample.js index b37890d766..635e30f344 100644 --- a/examples/findParticleExample.js +++ b/examples/findParticleExample.js @@ -3,7 +3,7 @@ // examples // // Created by Brad Hefta-Gaub on 1/24/14. -// Copyright 2014 HighFidelity, Inc. +// Copyright 2014 High Fidelity, Inc. // // This is an example script that demonstrates "finding" particles // diff --git a/examples/flockingBirds.js b/examples/flockingBirds.js index f85b4b38c4..17c60d88aa 100644 --- a/examples/flockingBirds.js +++ b/examples/flockingBirds.js @@ -3,7 +3,7 @@ // examples // // Created by Brad Hefta-Gaub on 3/4/14. -// Copyright 2014 HighFidelity, Inc. All rights reserved. +// Copyright 2014 High Fidelity, Inc. // // This is an example script that generates particles that act like flocking birds // diff --git a/examples/globalCollisionsExample.js b/examples/globalCollisionsExample.js index a9667396a4..11d90cd15b 100644 --- a/examples/globalCollisionsExample.js +++ b/examples/globalCollisionsExample.js @@ -3,7 +3,7 @@ // examples // // Created by Brad Hefta-Gaub on 1/29/14. -// Copyright 2014 HighFidelity, Inc. +// Copyright 2014 High Fidelity, Inc. // // This is an example script that demonstrates use of the Controller class // diff --git a/examples/gun.js b/examples/gun.js index 95d3905cc7..8cf6c9f654 100644 --- a/examples/gun.js +++ b/examples/gun.js @@ -4,7 +4,7 @@ // // Created by Brad Hefta-Gaub on 12/31/13. // Modified by Philip on 3/3/14 -// Copyright 2013 HighFidelity, Inc. +// Copyright 2013 High Fidelity, Inc. // // This is an example script that turns the hydra controllers and mouse into a particle gun. // It reads the controller, watches for trigger pulls, and launches particles. diff --git a/examples/hideAvatarExample.js b/examples/hideAvatarExample.js index cea503b205..66d85becf1 100644 --- a/examples/hideAvatarExample.js +++ b/examples/hideAvatarExample.js @@ -3,7 +3,7 @@ // examples // // Created by Brad Hefta-Gaub on 1/28/14. -// Copyright 2014 HighFidelity, Inc. +// Copyright 2014 High Fidelity, Inc. // // This is an example script that demonstrates how to enable or disable local rendering of your own avatar // diff --git a/examples/hydraMove.js b/examples/hydraMove.js index 6df6784ea1..b73f990446 100644 --- a/examples/hydraMove.js +++ b/examples/hydraMove.js @@ -3,7 +3,7 @@ // examples // // Created by Brad Hefta-Gaub on 2/10/14. -// Copyright 2014 HighFidelity, Inc. +// Copyright 2014 High Fidelity, Inc. // // This is an example script that demonstrates use of the Controller and MyAvatar classes to implement // avatar flying through the hydra/controller joysticks diff --git a/examples/includeExample.js b/examples/includeExample.js index d3ed398c94..50a1234772 100644 --- a/examples/includeExample.js +++ b/examples/includeExample.js @@ -3,7 +3,7 @@ // examples // // Created by Brad Hefta-Gaub on 3/24/14 -// Copyright 2013 HighFidelity, Inc. +// Copyright 2013 High Fidelity, Inc. // // This is an example script that demonstrates use of the Script.include() feature // diff --git a/examples/inspect.js b/examples/inspect.js index 39b74c9117..28db1e7735 100644 --- a/examples/inspect.js +++ b/examples/inspect.js @@ -3,7 +3,7 @@ // examples // // Created by Clément Brisset on March 20, 2014 -// Copyright 2014 HighFidelity, Inc. +// Copyright 2014 High Fidelity, Inc. // // Allows you to inspect non moving objects (Voxels or Avatars) using Atl, Control (Command on Mac) and Shift // diff --git a/examples/lookAtExample.js b/examples/lookAtExample.js index 58dcfc9184..1cf8aabb96 100644 --- a/examples/lookAtExample.js +++ b/examples/lookAtExample.js @@ -3,7 +3,7 @@ // examples // // Created by Brad Hefta-Gaub on 2/6/14. -// Copyright 2014 HighFidelity, Inc. +// Copyright 2014 High Fidelity, Inc. // // This is an example script that demonstrates use of the Camera class's lookAt(), keepLookingAt(), and stopLookingAt() // features. diff --git a/examples/lookWithMouse.js b/examples/lookWithMouse.js index b269da3c7a..9110218026 100644 --- a/examples/lookWithMouse.js +++ b/examples/lookWithMouse.js @@ -3,7 +3,7 @@ // examples // // Created by Brad Hefta-Gaub on 1/28/14. -// Copyright (c) 2014 HighFidelity, Inc. +// Copyright (c) 2014 High Fidelity, Inc. // // This is an example script that demonstrates use of the Controller class // diff --git a/examples/lookWithTouch.js b/examples/lookWithTouch.js index 29920a5b4e..5f5e2ee41c 100644 --- a/examples/lookWithTouch.js +++ b/examples/lookWithTouch.js @@ -3,7 +3,7 @@ // examples // // Created by Brad Hefta-Gaub on 1/28/14. -// Copyright (c) 2014 HighFidelity, Inc. +// Copyright (c) 2014 High Fidelity, Inc. // // This is an example script that demonstrates use of the Controller class // diff --git a/examples/menuExample.js b/examples/menuExample.js index b4f956218a..ed6f29d53a 100644 --- a/examples/menuExample.js +++ b/examples/menuExample.js @@ -3,7 +3,7 @@ // examples // // Created by Brad Hefta-Gaub on 2/24/14 -// Copyright (c) 2013 HighFidelity, Inc. +// Copyright (c) 2013 High Fidelity, Inc. // // This is an example script that demonstrates use of the Menu object // diff --git a/examples/multitouchExample.js b/examples/multitouchExample.js index 55d1d834bd..9d27b7ae2a 100644 --- a/examples/multitouchExample.js +++ b/examples/multitouchExample.js @@ -3,7 +3,7 @@ // examples // // Created by Brad Hefta-Gaub on 2/9/14. -// Copyright 2014 HighFidelity, Inc. +// Copyright 2014 High Fidelity, Inc. // // This is an example script that demonstrates use of the Controller class's multi-touch features // diff --git a/examples/overlaysExample.js b/examples/overlaysExample.js index 420500faf1..d0b3870803 100644 --- a/examples/overlaysExample.js +++ b/examples/overlaysExample.js @@ -3,7 +3,7 @@ // examples // // Created by Brad Hefta-Gaub on 2/14/14. -// Copyright 2014 HighFidelity, Inc. +// Copyright 2014 High Fidelity, Inc. // // This is an example script that demonstrates use of the Overlays class // From 067ea5b5b6010510ac912c94ed0cc89fa0b51105 Mon Sep 17 00:00:00 2001 From: Stephen Birarda Date: Wed, 9 Apr 2014 09:22:19 -0700 Subject: [PATCH 045/120] add a missing space in company name in paintGun --- examples/paintGun.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/examples/paintGun.js b/examples/paintGun.js index 7d2ec54351..b5bb2a49da 100644 --- a/examples/paintGun.js +++ b/examples/paintGun.js @@ -3,7 +3,7 @@ // examples // // Created by Brad Hefta-Gaub on 12/31/13. -// Copyright 2013 HighFidelity, Inc. +// Copyright 2013 High Fidelity, Inc. // // Distributed under the Apache License, Version 2.0. // See the accompanying file LICENSE or http://www.apache.org/licenses/LICENSE-2.0.html From fbd2066b0cd7345ff067b1bd923fde9a2eeab8d7 Mon Sep 17 00:00:00 2001 From: Stephen Birarda Date: Wed, 9 Apr 2014 09:25:34 -0700 Subject: [PATCH 046/120] more apache licensing for cmake files --- cmake/macros/AutoMTC.cmake | 10 ++++++++++ cmake/macros/IncludeGLM.cmake | 9 +++++++++ cmake/macros/LinkHifiLibrary.cmake | 9 +++++++++ cmake/macros/SetupHifiLibrary.cmake | 9 +++++++++ cmake/macros/SetupHifiProject.cmake | 9 +++++++++ 5 files changed, 46 insertions(+) diff --git a/cmake/macros/AutoMTC.cmake b/cmake/macros/AutoMTC.cmake index a2f5047ac7..1682b9cd56 100644 --- a/cmake/macros/AutoMTC.cmake +++ b/cmake/macros/AutoMTC.cmake @@ -1,3 +1,13 @@ +# +# AutoMTC.cmake +# +# Created by Andrzej Kapolka on 12/31/13. +# Copyright 2013 High Fidelity, Inc. +# +# Distributed under the Apache License, Version 2.0. +# See the accompanying file LICENSE or http://www.apache.org/licenses/LICENSE-2.0.html +# + macro(AUTO_MTC TARGET ROOT_DIR) if (NOT TARGET mtc) add_subdirectory("${ROOT_DIR}/tools/mtc" "${ROOT_DIR}/tools/mtc") diff --git a/cmake/macros/IncludeGLM.cmake b/cmake/macros/IncludeGLM.cmake index 7f5fe039c6..65974a51c5 100644 --- a/cmake/macros/IncludeGLM.cmake +++ b/cmake/macros/IncludeGLM.cmake @@ -1,3 +1,12 @@ +# +# IncludeGLM.cmake +# +# Copyright (c) 2013 High Fidelity +# +# Distributed under the Apache License, Version 2.0. +# See the accompanying file LICENSE or http://www.apache.org/licenses/LICENSE-2.0.html +# + macro(INCLUDE_GLM TARGET ROOT_DIR) find_package(GLM REQUIRED) diff --git a/cmake/macros/LinkHifiLibrary.cmake b/cmake/macros/LinkHifiLibrary.cmake index 02ebc983c2..6300e50c34 100644 --- a/cmake/macros/LinkHifiLibrary.cmake +++ b/cmake/macros/LinkHifiLibrary.cmake @@ -1,3 +1,12 @@ +# +# LinkHifiLibrary.cmake +# +# Copyright 2013 High Fidelity, Inc. +# +# Distributed under the Apache License, Version 2.0. +# See the accompanying file LICENSE or http://www.apache.org/licenses/LICENSE-2.0.html +# + macro(LINK_HIFI_LIBRARY LIBRARY TARGET ROOT_DIR) if (NOT TARGET ${LIBRARY}) diff --git a/cmake/macros/SetupHifiLibrary.cmake b/cmake/macros/SetupHifiLibrary.cmake index 19428b6723..ff4ae3b4f3 100644 --- a/cmake/macros/SetupHifiLibrary.cmake +++ b/cmake/macros/SetupHifiLibrary.cmake @@ -1,3 +1,12 @@ +# +# SetupHifiLibrary.cmake +# +# Copyright 2013 High Fidelity, Inc. +# +# Distributed under the Apache License, Version 2.0. +# See the accompanying file LICENSE or http://www.apache.org/licenses/LICENSE-2.0.html +# + macro(SETUP_HIFI_LIBRARY TARGET) project(${TARGET}) diff --git a/cmake/macros/SetupHifiProject.cmake b/cmake/macros/SetupHifiProject.cmake index a707626254..11252e2a74 100644 --- a/cmake/macros/SetupHifiProject.cmake +++ b/cmake/macros/SetupHifiProject.cmake @@ -1,3 +1,12 @@ +# +# SetupHifiProject.cmake +# +# Copyright (c) 2013 High Fidelity +# +# Distributed under the Apache License, Version 2.0. +# See the accompanying file LICENSE or http://www.apache.org/licenses/LICENSE-2.0.html +# + macro(SETUP_HIFI_PROJECT TARGET INCLUDE_QT) project(${TARGET}) From 974d8c042724757d1d20629bc2a2e1c0241309c2 Mon Sep 17 00:00:00 2001 From: Stephen Birarda Date: Wed, 9 Apr 2014 09:35:05 -0700 Subject: [PATCH 047/120] prepare header files for regex run against cpp --- assignment-client/src/avatars/AvatarMixer.cpp | 1 + interface/src/Application.cpp | 1 + interface/src/Camera.cpp | 1 + interface/src/Environment.cpp | 1 + interface/src/avatar/Avatar.cpp | 1 + interface/src/avatar/AvatarManager.cpp | 1 + interface/src/avatar/Hand.cpp | 1 + interface/src/avatar/Head.cpp | 1 + interface/src/renderer/GeometryCache.cpp | 1 + interface/src/renderer/GlowEffect.cpp | 1 + interface/src/renderer/PointShader.cpp | 1 + interface/src/renderer/ProgramObject.cpp | 1 + interface/src/renderer/RenderUtil.cpp | 1 + interface/src/renderer/TextureCache.cpp | 1 + interface/src/renderer/VoxelShader.cpp | 1 + interface/src/starfield/data/GpuVertex.cpp | 1 + interface/src/starfield/renderer/Renderer.cpp | 10 +++++----- interface/src/ui/MetavoxelEditor.cpp | 1 + interface/src/ui/RearMirrorTools.cpp | 1 + interface/src/ui/RunningScriptsWidget.cpp | 1 + interface/src/ui/TextRenderer.cpp | 1 + interface/src/ui/overlays/LocalVoxelsOverlay.cpp | 2 +- libraries/octree/src/Plane.cpp | 2 +- libraries/script-engine/src/EventTypes.cpp | 1 + libraries/script-engine/src/MenuItemProperties.cpp | 1 + libraries/shared/src/RegisteredMetaTypes.cpp | 1 + libraries/voxels/src/EnvironmentData.cpp | 1 + 27 files changed, 31 insertions(+), 7 deletions(-) diff --git a/assignment-client/src/avatars/AvatarMixer.cpp b/assignment-client/src/avatars/AvatarMixer.cpp index c4c0dcda24..6d0201f872 100644 --- a/assignment-client/src/avatars/AvatarMixer.cpp +++ b/assignment-client/src/avatars/AvatarMixer.cpp @@ -9,6 +9,7 @@ // // The avatar mixer receives head, hand and positional data from all connected // nodes, and broadcasts that data back to them, every BROADCAST_INTERVAL ms. +// #include #include diff --git a/interface/src/Application.cpp b/interface/src/Application.cpp index 45ae36a23b..4013989b99 100644 --- a/interface/src/Application.cpp +++ b/interface/src/Application.cpp @@ -4,6 +4,7 @@ // // Created by Andrzej Kapolka on 5/10/13. // Copyright (c) 2013 High Fidelity, Inc. All rights reserved. +// #ifdef WIN32 #include diff --git a/interface/src/Camera.cpp b/interface/src/Camera.cpp index 252b3be685..8918a3018d 100644 --- a/interface/src/Camera.cpp +++ b/interface/src/Camera.cpp @@ -3,6 +3,7 @@ // interface // // Copyright (c) 2013 High Fidelity, Inc. All rights reserved. +// #include diff --git a/interface/src/Environment.cpp b/interface/src/Environment.cpp index 096b8770fb..36292c56a1 100644 --- a/interface/src/Environment.cpp +++ b/interface/src/Environment.cpp @@ -4,6 +4,7 @@ // // Created by Andrzej Kapolka on 5/6/13. // Copyright (c) 2013 High Fidelity, Inc. All rights reserved. +// #include "InterfaceConfig.h" diff --git a/interface/src/avatar/Avatar.cpp b/interface/src/avatar/Avatar.cpp index 05f74755df..494c45c295 100644 --- a/interface/src/avatar/Avatar.cpp +++ b/interface/src/avatar/Avatar.cpp @@ -4,6 +4,7 @@ // // Created by Philip Rosedale on 9/11/12. // Copyright (c) 2013 High Fidelity, Inc. All rights reserved. +// #include diff --git a/interface/src/avatar/AvatarManager.cpp b/interface/src/avatar/AvatarManager.cpp index c2ba28ac7b..9f8e7feb2e 100644 --- a/interface/src/avatar/AvatarManager.cpp +++ b/interface/src/avatar/AvatarManager.cpp @@ -5,6 +5,7 @@ // Created by Stephen Birarda on 1/23/2014. // Copyright (c) 2014 HighFidelity, Inc. All rights reserved. // + #include #include diff --git a/interface/src/avatar/Hand.cpp b/interface/src/avatar/Hand.cpp index fc47520c83..c2ce17022d 100644 --- a/interface/src/avatar/Hand.cpp +++ b/interface/src/avatar/Hand.cpp @@ -3,6 +3,7 @@ // interface // // Copyright (c) 2013 High Fidelity, Inc. All rights reserved. +// #include diff --git a/interface/src/avatar/Head.cpp b/interface/src/avatar/Head.cpp index f42220c0f4..fed86ed81f 100644 --- a/interface/src/avatar/Head.cpp +++ b/interface/src/avatar/Head.cpp @@ -3,6 +3,7 @@ // interface // // Copyright (c) 2013 High Fidelity, Inc. All rights reserved. +// #include diff --git a/interface/src/renderer/GeometryCache.cpp b/interface/src/renderer/GeometryCache.cpp index b835e91a12..a3984b9306 100644 --- a/interface/src/renderer/GeometryCache.cpp +++ b/interface/src/renderer/GeometryCache.cpp @@ -4,6 +4,7 @@ // // Created by Andrzej Kapolka on 6/21/13. // Copyright (c) 2013 High Fidelity, Inc. All rights reserved. +// #include diff --git a/interface/src/renderer/GlowEffect.cpp b/interface/src/renderer/GlowEffect.cpp index f926a81941..1aea22367f 100644 --- a/interface/src/renderer/GlowEffect.cpp +++ b/interface/src/renderer/GlowEffect.cpp @@ -4,6 +4,7 @@ // // Created by Andrzej Kapolka on 8/7/13. // Copyright (c) 2013 High Fidelity, Inc. All rights reserved. +// // include this before QOpenGLFramebufferObject, which includes an earlier version of OpenGL #include "InterfaceConfig.h" diff --git a/interface/src/renderer/PointShader.cpp b/interface/src/renderer/PointShader.cpp index 6dd4aae485..4191a116e3 100644 --- a/interface/src/renderer/PointShader.cpp +++ b/interface/src/renderer/PointShader.cpp @@ -4,6 +4,7 @@ // // Created by Brad Hefta-Gaub on 10/30/13. // Copyright (c) 2013 High Fidelity, Inc. All rights reserved. +// // include this before QOpenGLFramebufferObject, which includes an earlier version of OpenGL #include "InterfaceConfig.h" diff --git a/interface/src/renderer/ProgramObject.cpp b/interface/src/renderer/ProgramObject.cpp index 5108c15068..71d6c100f1 100644 --- a/interface/src/renderer/ProgramObject.cpp +++ b/interface/src/renderer/ProgramObject.cpp @@ -4,6 +4,7 @@ // // Created by Andrzej Kapolka on 5/7/13. // Copyright (c) 2013 High Fidelity, Inc. All rights reserved. +// #include "ProgramObject.h" diff --git a/interface/src/renderer/RenderUtil.cpp b/interface/src/renderer/RenderUtil.cpp index 11ec8b572c..32cf36a650 100644 --- a/interface/src/renderer/RenderUtil.cpp +++ b/interface/src/renderer/RenderUtil.cpp @@ -4,6 +4,7 @@ // // Created by Andrzej Kapolka on 8/15/13. // Copyright (c) 2013 High Fidelity, Inc. All rights reserved. +// #include "InterfaceConfig.h" #include "RenderUtil.h" diff --git a/interface/src/renderer/TextureCache.cpp b/interface/src/renderer/TextureCache.cpp index b3820abf25..c959340f6b 100644 --- a/interface/src/renderer/TextureCache.cpp +++ b/interface/src/renderer/TextureCache.cpp @@ -4,6 +4,7 @@ // // Created by Andrzej Kapolka on 8/6/13. // Copyright (c) 2013 High Fidelity, Inc. All rights reserved. +// // include this before QGLWidget, which includes an earlier version of OpenGL #include "InterfaceConfig.h" diff --git a/interface/src/renderer/VoxelShader.cpp b/interface/src/renderer/VoxelShader.cpp index fab40fc338..0377e5fe72 100644 --- a/interface/src/renderer/VoxelShader.cpp +++ b/interface/src/renderer/VoxelShader.cpp @@ -4,6 +4,7 @@ // // Created by Brad Hefta-Gaub on 9/22/13. // Copyright (c) 2013 High Fidelity, Inc. All rights reserved. +// // include this before QOpenGLFramebufferObject, which includes an earlier version of OpenGL #include "InterfaceConfig.h" diff --git a/interface/src/starfield/data/GpuVertex.cpp b/interface/src/starfield/data/GpuVertex.cpp index 58db1d499a..85fc6f8f7e 100755 --- a/interface/src/starfield/data/GpuVertex.cpp +++ b/interface/src/starfield/data/GpuVertex.cpp @@ -6,6 +6,7 @@ // Based on code by Tobias Schwinger on 3/29/13. // Copyright (c) 2013 High Fidelity, Inc. All rights reserved. // + #include "starfield/data/GpuVertex.h" using namespace starfield; diff --git a/interface/src/starfield/renderer/Renderer.cpp b/interface/src/starfield/renderer/Renderer.cpp index 0be9850338..356e46c468 100755 --- a/interface/src/starfield/renderer/Renderer.cpp +++ b/interface/src/starfield/renderer/Renderer.cpp @@ -1,10 +1,10 @@ // -// starfield/renderer/Renderer.cpp -// interface +// starfield/renderer/Renderer.cpp +// interface // -// Created by Chris Barnard on 10/17/13. -// Based on earlier work by Tobias Schwinger 3/22/13. -// Copyright (c) 2013 High Fidelity, Inc. All rights reserved. +// Created by Chris Barnard on 10/17/13. +// Based on earlier work by Tobias Schwinger 3/22/13. +// Copyright (c) 2013 High Fidelity, Inc. All rights reserved. // #include "starfield/renderer/Renderer.h" diff --git a/interface/src/ui/MetavoxelEditor.cpp b/interface/src/ui/MetavoxelEditor.cpp index ee1b4b0460..73a2476aa4 100644 --- a/interface/src/ui/MetavoxelEditor.cpp +++ b/interface/src/ui/MetavoxelEditor.cpp @@ -4,6 +4,7 @@ // // Created by Andrzej Kapolka on 1/21/14. // Copyright (c) 2014 High Fidelity, Inc. All rights reserved. +// // include this before QOpenGLFramebufferObject, which includes an earlier version of OpenGL #include "InterfaceConfig.h" diff --git a/interface/src/ui/RearMirrorTools.cpp b/interface/src/ui/RearMirrorTools.cpp index 314fd7157b..c86770d4f0 100644 --- a/interface/src/ui/RearMirrorTools.cpp +++ b/interface/src/ui/RearMirrorTools.cpp @@ -4,6 +4,7 @@ // // Created by stojce on 23.10.2013. // Copyright (c) 2013 High Fidelity, Inc. All rights reserved. +// #include "InterfaceConfig.h" diff --git a/interface/src/ui/RunningScriptsWidget.cpp b/interface/src/ui/RunningScriptsWidget.cpp index 2238cab2df..dcb9210d56 100644 --- a/interface/src/ui/RunningScriptsWidget.cpp +++ b/interface/src/ui/RunningScriptsWidget.cpp @@ -4,6 +4,7 @@ // // Created by Mohammed Nafees on 03/28/2014. // Copyright (c) 2014 High Fidelity, Inc. All rights reserved. +// #include "ui_runningScriptsWidget.h" #include "RunningScriptsWidget.h" diff --git a/interface/src/ui/TextRenderer.cpp b/interface/src/ui/TextRenderer.cpp index cacd730fd6..06c657e96e 100644 --- a/interface/src/ui/TextRenderer.cpp +++ b/interface/src/ui/TextRenderer.cpp @@ -4,6 +4,7 @@ // // Created by Andrzej Kapolka on 4/24/13. // Copyright (c) 2013 High Fidelity, Inc. All rights reserved. +// #include #include diff --git a/interface/src/ui/overlays/LocalVoxelsOverlay.cpp b/interface/src/ui/overlays/LocalVoxelsOverlay.cpp index 460f4eadb6..e605f8879d 100644 --- a/interface/src/ui/overlays/LocalVoxelsOverlay.cpp +++ b/interface/src/ui/overlays/LocalVoxelsOverlay.cpp @@ -5,7 +5,7 @@ // Created by Clément Brisset on 2/28/14. // Copyright (c) 2014 High Fidelity, Inc. All rights reserved. // -// + // include this before QGLWidget, which includes an earlier version of OpenGL #include "InterfaceConfig.h" diff --git a/libraries/octree/src/Plane.cpp b/libraries/octree/src/Plane.cpp index 6a356784b7..727e16724c 100755 --- a/libraries/octree/src/Plane.cpp +++ b/libraries/octree/src/Plane.cpp @@ -1,5 +1,5 @@ // -// Plane.h +// Plane.cpp // hifi // // Created by Brad Hefta-Gaub on 04/11/13. diff --git a/libraries/script-engine/src/EventTypes.cpp b/libraries/script-engine/src/EventTypes.cpp index 9885b8d9dc..d5c2d72786 100644 --- a/libraries/script-engine/src/EventTypes.cpp +++ b/libraries/script-engine/src/EventTypes.cpp @@ -7,6 +7,7 @@ // // Used to register meta-types with Qt for very various event types so that they can be exposed to our // scripting engine +// #include #include diff --git a/libraries/script-engine/src/MenuItemProperties.cpp b/libraries/script-engine/src/MenuItemProperties.cpp index f071723233..8c91ad8fef 100644 --- a/libraries/script-engine/src/MenuItemProperties.cpp +++ b/libraries/script-engine/src/MenuItemProperties.cpp @@ -7,6 +7,7 @@ // // Used to register meta-types with Qt for very various event types so that they can be exposed to our // scripting engine +// #include #include diff --git a/libraries/shared/src/RegisteredMetaTypes.cpp b/libraries/shared/src/RegisteredMetaTypes.cpp index af074c59bc..0354fedba9 100644 --- a/libraries/shared/src/RegisteredMetaTypes.cpp +++ b/libraries/shared/src/RegisteredMetaTypes.cpp @@ -7,6 +7,7 @@ // // Used to register meta-types with Qt so that they can be used as properties for objects exposed to our // Agent scripting. +// #include "RegisteredMetaTypes.h" diff --git a/libraries/voxels/src/EnvironmentData.cpp b/libraries/voxels/src/EnvironmentData.cpp index 1c9af55abd..dc82844bd0 100644 --- a/libraries/voxels/src/EnvironmentData.cpp +++ b/libraries/voxels/src/EnvironmentData.cpp @@ -4,6 +4,7 @@ // // Created by Andrzej Kapolka on 5/6/13. // Copyright (c) 2013 High Fidelity, Inc. All rights reserved. +// #include From 684c6b5372b934e83b1222c2c9296eab2ad0a4f6 Mon Sep 17 00:00:00 2001 From: Stephen Birarda Date: Wed, 9 Apr 2014 09:35:42 -0700 Subject: [PATCH 048/120] run regex header replacement on all cpp files --- animation-server/src/AnimationServer.cpp | 7 +- animation-server/src/main.cpp | 9 +- assignment-client/src/Agent.cpp | 7 +- assignment-client/src/AssignmentClient.cpp | 7 +- .../src/AssignmentClientMonitor.cpp | 9 +- assignment-client/src/AssignmentFactory.cpp | 7 +- assignment-client/src/AssignmentThread.cpp | 11 +- assignment-client/src/audio/AudioMixer.cpp | 7 +- .../src/audio/AudioMixerClientData.cpp | 7 +- .../src/audio/AvatarAudioRingBuffer.cpp | 9 +- assignment-client/src/avatars/AvatarMixer.cpp | 10 +- .../src/avatars/AvatarMixerClientData.cpp | 7 +- assignment-client/src/main.cpp | 9 +- .../src/metavoxels/MetavoxelServer.cpp | 7 +- .../octree/OctreeInboundPacketProcessor.cpp | 9 +- .../src/octree/OctreeQueryNode.cpp | 5 +- .../src/octree/OctreeSendThread.cpp | 8 +- assignment-client/src/octree/OctreeServer.cpp | 7 +- .../src/particles/ParticleServer.cpp | 9 +- assignment-client/src/voxels/VoxelServer.cpp | 7 +- domain-server/src/DomainServer.cpp | 7 +- domain-server/src/DomainServerNodeData.cpp | 9 +- domain-server/src/main.cpp | 11 +- interface/src/Application.cpp | 7 +- interface/src/Audio.cpp | 7 +- interface/src/BuckyBalls.cpp | 5 +- interface/src/Camera.cpp | 7 +- interface/src/DatagramProcessor.cpp | 7 +- interface/src/Environment.cpp | 7 +- interface/src/FileLogger.cpp | 5 +- interface/src/GLCanvas.cpp | 7 +- interface/src/Menu.cpp | 7 +- interface/src/MetavoxelSystem.cpp | 7 +- interface/src/ParticleTreeRenderer.cpp | 6 +- interface/src/Physics.cpp | 30 +- interface/src/Stars.cpp | 11 +- interface/src/Util.cpp | 41 +-- interface/src/XmppClient.cpp | 9 +- interface/src/avatar/Avatar.cpp | 7 +- interface/src/avatar/AvatarManager.cpp | 7 +- interface/src/avatar/FaceModel.cpp | 7 +- interface/src/avatar/Hand.cpp | 7 +- interface/src/avatar/Head.cpp | 7 +- interface/src/avatar/MyAvatar.cpp | 7 +- interface/src/avatar/SkeletonModel.cpp | 7 +- interface/src/devices/Faceshift.cpp | 7 +- interface/src/devices/OculusManager.cpp | 7 +- interface/src/devices/SixenseManager.cpp | 9 +- interface/src/devices/TV3DManager.cpp | 7 +- interface/src/devices/Visage.cpp | 7 +- interface/src/location/LocationManager.cpp | 5 +- interface/src/location/NamedLocation.cpp | 7 +- interface/src/main.cpp | 17 +- .../src/renderer/AmbientOcclusionEffect.cpp | 7 +- interface/src/renderer/FBXReader.cpp | 7 +- interface/src/renderer/GeometryCache.cpp | 7 +- interface/src/renderer/GlowEffect.cpp | 7 +- interface/src/renderer/Model.cpp | 7 +- interface/src/renderer/PointShader.cpp | 7 +- interface/src/renderer/ProgramObject.cpp | 7 +- interface/src/renderer/RenderUtil.cpp | 7 +- interface/src/renderer/TextureCache.cpp | 7 +- interface/src/renderer/VoxelShader.cpp | 7 +- .../AudioDeviceScriptingInterface.cpp | 9 +- .../scripting/ClipboardScriptingInterface.cpp | 9 +- .../ControllerScriptingInterface.cpp | 11 +- .../src/scripting/MenuScriptingInterface.cpp | 9 +- .../scripting/SettingsScriptingInterface.cpp | 9 +- interface/src/starfield/Controller.cpp | 12 +- interface/src/starfield/Generator.cpp | 11 +- interface/src/starfield/data/GpuVertex.cpp | 12 +- interface/src/starfield/data/InputVertex.cpp | 12 +- interface/src/starfield/renderer/Renderer.cpp | 10 +- .../src/starfield/renderer/VertexOrder.cpp | 13 +- interface/src/ui/BandwidthDialog.cpp | 9 +- interface/src/ui/BandwidthMeter.cpp | 9 +- interface/src/ui/ChatWindow.cpp | 7 +- interface/src/ui/ImportDialog.cpp | 7 +- interface/src/ui/InfoView.cpp | 9 +- interface/src/ui/LodToolsDialog.cpp | 7 +- interface/src/ui/LogDialog.cpp | 7 +- interface/src/ui/MetavoxelEditor.cpp | 7 +- interface/src/ui/ModelsBrowser.cpp | 7 +- interface/src/ui/OctreeStatsDialog.cpp | 7 +- interface/src/ui/Oscilloscope.cpp | 7 +- interface/src/ui/RearMirrorTools.cpp | 9 +- interface/src/ui/RunningScriptsWidget.cpp | 9 +- interface/src/ui/Snapshot.cpp | 7 +- interface/src/ui/Stats.cpp | 7 +- interface/src/ui/TextRenderer.cpp | 7 +- interface/src/ui/UpdateDialog.cpp | 10 +- interface/src/ui/overlays/Base3DOverlay.cpp | 7 +- interface/src/ui/overlays/Cube3DOverlay.cpp | 7 +- interface/src/ui/overlays/ImageOverlay.cpp | 7 +- interface/src/ui/overlays/Line3DOverlay.cpp | 7 +- .../src/ui/overlays/LocalVoxelsOverlay.cpp | 7 +- interface/src/ui/overlays/Overlay.cpp | 7 +- interface/src/ui/overlays/Overlay2D.cpp | 7 +- interface/src/ui/overlays/Overlays.cpp | 7 +- interface/src/ui/overlays/Sphere3DOverlay.cpp | 7 +- interface/src/ui/overlays/TextOverlay.cpp | 7 +- interface/src/ui/overlays/Volume3DOverlay.cpp | 7 +- interface/src/voxels/PrimitiveRenderer.cpp | 18 +- interface/src/voxels/VoxelFade.cpp | 7 +- interface/src/voxels/VoxelHideShowThread.cpp | 9 +- interface/src/voxels/VoxelImporter.cpp | 7 +- interface/src/voxels/VoxelPacketProcessor.cpp | 7 +- interface/src/voxels/VoxelSystem.cpp | 6 +- libraries/audio/src/AudioInjector.cpp | 7 +- libraries/audio/src/AudioInjectorOptions.cpp | 9 +- libraries/audio/src/AudioRingBuffer.cpp | 7 +- .../audio/src/AudioScriptingInterface.cpp | 7 +- .../audio/src/InjectedAudioRingBuffer.cpp | 7 +- libraries/audio/src/MixedAudioRingBuffer.cpp | 11 +- .../audio/src/PositionalAudioRingBuffer.cpp | 7 +- libraries/audio/src/Sound.cpp | 151 +-------- libraries/avatars/src/AvatarData.cpp | 7 +- libraries/avatars/src/AvatarHashMap.cpp | 7 +- libraries/avatars/src/HandData.cpp | 7 +- libraries/avatars/src/HeadData.cpp | 7 +- .../embedded-webserver/src/HTTPConnection.cpp | 7 +- .../embedded-webserver/src/HTTPManager.cpp | 7 +- .../metavoxels/src/AttributeRegistry.cpp | 7 +- libraries/metavoxels/src/Bitstream.cpp | 7 +- .../metavoxels/src/DatagramSequencer.cpp | 7 +- libraries/metavoxels/src/MetavoxelData.cpp | 7 +- .../metavoxels/src/MetavoxelMessages.cpp | 7 +- libraries/metavoxels/src/MetavoxelUtil.cpp | 7 +- libraries/metavoxels/src/ScriptCache.cpp | 7 +- libraries/metavoxels/src/SharedObject.cpp | 7 +- libraries/octree/src/AABox.cpp | 11 +- libraries/octree/src/CoverageMap.cpp | 44 +-- libraries/octree/src/CoverageMapV2.cpp | 45 +-- libraries/octree/src/JurisdictionListener.cpp | 7 +- libraries/octree/src/JurisdictionMap.cpp | 7 +- libraries/octree/src/JurisdictionSender.cpp | 7 +- libraries/octree/src/Octree.cpp | 7 +- .../octree/src/OctreeEditPacketSender.cpp | 7 +- libraries/octree/src/OctreeElement.cpp | 7 +- libraries/octree/src/OctreeElementBag.cpp | 9 +- libraries/octree/src/OctreeHeadlessViewer.cpp | 8 +- libraries/octree/src/OctreePacketData.cpp | 7 +- libraries/octree/src/OctreePersistThread.cpp | 9 +- .../octree/src/OctreeProjectedPolygon.cpp | 10 +- libraries/octree/src/OctreeQuery.cpp | 7 +- libraries/octree/src/OctreeRenderer.cpp | 6 +- libraries/octree/src/OctreeSceneStats.cpp | 6 +- .../octree/src/OctreeScriptingInterface.cpp | 9 +- libraries/octree/src/ViewFrustum.cpp | 7 +- libraries/particles/src/Particle.cpp | 6 +- .../particles/src/ParticleCollisionSystem.cpp | 6 +- .../src/ParticleEditPacketSender.cpp | 7 +- libraries/particles/src/ParticleTree.cpp | 7 +- .../particles/src/ParticleTreeElement.cpp | 7 +- .../src/ParticleTreeHeadlessViewer.cpp | 8 +- .../src/ParticlesScriptingInterface.cpp | 9 +- libraries/script-engine/src/EventTypes.cpp | 8 +- libraries/script-engine/src/LocalVoxels.cpp | 7 +- .../script-engine/src/MenuItemProperties.cpp | 8 +- libraries/script-engine/src/Quat.cpp | 10 +- libraries/script-engine/src/ScriptEngine.cpp | 7 +- libraries/script-engine/src/Vec3.cpp | 10 +- libraries/shared/src/AccountManager.cpp | 7 +- libraries/shared/src/Assignment.cpp | 7 +- libraries/shared/src/CapsuleShape.cpp | 9 +- libraries/shared/src/CollisionInfo.cpp | 9 +- .../shared/src/DataServerAccountInfo.cpp | 7 +- libraries/shared/src/DomainInfo.cpp | 7 +- libraries/shared/src/FileUtils.cpp | 5 +- libraries/shared/src/GenericThread.cpp | 7 +- libraries/shared/src/GeometryUtil.cpp | 295 +----------------- libraries/shared/src/HifiSockAddr.cpp | 7 +- libraries/shared/src/ListShape.cpp | 8 +- libraries/shared/src/Logging.cpp | 7 +- libraries/shared/src/ModelUploader.cpp | 6 +- libraries/shared/src/NetworkPacket.cpp | 7 +- libraries/shared/src/Node.cpp | 7 +- libraries/shared/src/NodeData.cpp | 9 +- libraries/shared/src/NodeList.cpp | 7 +- libraries/shared/src/OAuthAccessToken.cpp | 7 +- libraries/shared/src/OctalCode.cpp | 7 +- libraries/shared/src/PacketHeaders.cpp | 7 +- libraries/shared/src/PacketSender.cpp | 9 +- libraries/shared/src/PerfStat.cpp | 11 +- .../shared/src/ReceivedPacketProcessor.cpp | 7 +- libraries/shared/src/RegisteredMetaTypes.cpp | 8 +- libraries/shared/src/ResourceCache.cpp | 7 +- libraries/shared/src/ShapeCollider.cpp | 9 +- libraries/shared/src/SharedUtil.cpp | 7 +- libraries/shared/src/SimpleMovingAverage.cpp | 9 +- libraries/shared/src/StdDev.cpp | 9 +- libraries/shared/src/StreamUtils.cpp | 8 +- libraries/shared/src/ThreadedAssignment.cpp | 7 +- libraries/shared/src/UUID.cpp | 9 +- libraries/voxels/src/EnvironmentData.cpp | 7 +- libraries/voxels/src/LocalVoxelsList.cpp | 9 +- libraries/voxels/src/Tags.cpp | 7 +- libraries/voxels/src/VoxelDetail.cpp | 9 +- .../voxels/src/VoxelEditPacketSender.cpp | 7 +- libraries/voxels/src/VoxelTree.cpp | 7 +- libraries/voxels/src/VoxelTreeCommands.cpp | 8 +- libraries/voxels/src/VoxelTreeElement.cpp | 7 +- .../voxels/src/VoxelTreeHeadlessViewer.cpp | 8 +- .../voxels/src/VoxelsScriptingInterface.cpp | 7 +- voxel-edit/src/SceneUtils.cpp | 7 +- voxel-edit/src/main.cpp | 7 +- 206 files changed, 1065 insertions(+), 1094 deletions(-) diff --git a/animation-server/src/AnimationServer.cpp b/animation-server/src/AnimationServer.cpp index 1f0828ec17..6a4d1ea76d 100644 --- a/animation-server/src/AnimationServer.cpp +++ b/animation-server/src/AnimationServer.cpp @@ -1,9 +1,12 @@ // // AnimationServer.cpp -// hifi +// animation-server/src // // Created by Stephen Birarda on 12/5/2013. -// Copyright (c) 2013 HighFidelity, Inc. All rights reserved. +// Copyright 2013 High Fidelity, Inc. +// +// Distributed under the Apache License, Version 2.0. +// See the accompanying file LICENSE or http://www.apache.org/licenses/LICENSE-2.0.html // #include diff --git a/animation-server/src/main.cpp b/animation-server/src/main.cpp index 3cdb7f04be..8acf3b8db2 100644 --- a/animation-server/src/main.cpp +++ b/animation-server/src/main.cpp @@ -1,9 +1,12 @@ // // main.cpp -// Animation Server +// animation-server/src // -// Created by Brad Hefta-Gaub on 05/16/2013 -// Copyright (c) 2012 High Fidelity, Inc. All rights reserved. +// Created by Brad Hefta-Gaub on 05/16/2013. +// Copyright 2012 High Fidelity, Inc. +// +// Distributed under the Apache License, Version 2.0. +// See the accompanying file LICENSE or http://www.apache.org/licenses/LICENSE-2.0.html // #include "AnimationServer.h" diff --git a/assignment-client/src/Agent.cpp b/assignment-client/src/Agent.cpp index b5199e87e8..f376c4e981 100644 --- a/assignment-client/src/Agent.cpp +++ b/assignment-client/src/Agent.cpp @@ -1,9 +1,12 @@ // // Agent.cpp -// hifi +// assignment-client/src // // Created by Stephen Birarda on 7/1/13. -// Copyright (c) 2013 HighFidelity, Inc. All rights reserved. +// Copyright 2013 High Fidelity, Inc. +// +// Distributed under the Apache License, Version 2.0. +// See the accompanying file LICENSE or http://www.apache.org/licenses/LICENSE-2.0.html // #include diff --git a/assignment-client/src/AssignmentClient.cpp b/assignment-client/src/AssignmentClient.cpp index aa20f2ff29..9d9bfa3113 100644 --- a/assignment-client/src/AssignmentClient.cpp +++ b/assignment-client/src/AssignmentClient.cpp @@ -1,9 +1,12 @@ // // AssignmentClient.cpp -// hifi +// assignment-client/src // // Created by Stephen Birarda on 11/25/2013. -// Copyright (c) 2013 HighFidelity, Inc. All rights reserved. +// Copyright 2013 High Fidelity, Inc. +// +// Distributed under the Apache License, Version 2.0. +// See the accompanying file LICENSE or http://www.apache.org/licenses/LICENSE-2.0.html // #include diff --git a/assignment-client/src/AssignmentClientMonitor.cpp b/assignment-client/src/AssignmentClientMonitor.cpp index 64c9b31147..af09ff1535 100644 --- a/assignment-client/src/AssignmentClientMonitor.cpp +++ b/assignment-client/src/AssignmentClientMonitor.cpp @@ -1,9 +1,12 @@ // // AssignmentClientMonitor.cpp -// hifi +// assignment-client/src // // Created by Stephen Birarda on 1/10/2014. -// Copyright (c) 2014 HighFidelity, Inc. All rights reserved. +// Copyright 2014 High Fidelity, Inc. +// +// Distributed under the Apache License, Version 2.0. +// See the accompanying file LICENSE or http://www.apache.org/licenses/LICENSE-2.0.html // #include @@ -53,4 +56,4 @@ void AssignmentClientMonitor::spawnChildClient() { void AssignmentClientMonitor::childProcessFinished(int exitCode, QProcess::ExitStatus exitStatus) { qDebug("Replacing dead child assignment client with a new one"); spawnChildClient(); -} \ No newline at end of file +} diff --git a/assignment-client/src/AssignmentFactory.cpp b/assignment-client/src/AssignmentFactory.cpp index cde5666ab9..cdf5c591e1 100644 --- a/assignment-client/src/AssignmentFactory.cpp +++ b/assignment-client/src/AssignmentFactory.cpp @@ -1,9 +1,12 @@ // // AssignmentFactory.cpp -// hifi +// assignment-client/src // // Created by Stephen Birarda on 9/17/13. -// Copyright (c) 2013 HighFidelity, Inc. All rights reserved. +// Copyright 2013 High Fidelity, Inc. +// +// Distributed under the Apache License, Version 2.0. +// See the accompanying file LICENSE or http://www.apache.org/licenses/LICENSE-2.0.html // #include diff --git a/assignment-client/src/AssignmentThread.cpp b/assignment-client/src/AssignmentThread.cpp index dfe093aa7b..848fa7afae 100644 --- a/assignment-client/src/AssignmentThread.cpp +++ b/assignment-client/src/AssignmentThread.cpp @@ -1,9 +1,12 @@ // // AssignmentThread.cpp -// hifi +// assignment-client/src // -// Created by Stephen Birarda on 2014-03-28. -// Copyright (c) 2014 High Fidelity, Inc. All rights reserved. +// Created by Stephen Birarda on 2014. +// Copyright 2014 High Fidelity, Inc. +// +// Distributed under the Apache License, Version 2.0. +// See the accompanying file LICENSE or http://www.apache.org/licenses/LICENSE-2.0.html // #include "AssignmentThread.h" @@ -13,4 +16,4 @@ AssignmentThread::AssignmentThread(const SharedAssignmentPointer& assignment, QO _assignment(assignment) { -} \ No newline at end of file +} diff --git a/assignment-client/src/audio/AudioMixer.cpp b/assignment-client/src/audio/AudioMixer.cpp index f183abade9..35b522ff2f 100644 --- a/assignment-client/src/audio/AudioMixer.cpp +++ b/assignment-client/src/audio/AudioMixer.cpp @@ -1,9 +1,12 @@ // // AudioMixer.cpp -// hifi +// assignment-client/src/audio // // Created by Stephen Birarda on 8/22/13. -// Copyright (c) 2013 HighFidelity, Inc. All rights reserved. +// Copyright 2013 High Fidelity, Inc. +// +// Distributed under the Apache License, Version 2.0. +// See the accompanying file LICENSE or http://www.apache.org/licenses/LICENSE-2.0.html // #include diff --git a/assignment-client/src/audio/AudioMixerClientData.cpp b/assignment-client/src/audio/AudioMixerClientData.cpp index 4a9f1f84de..85b8dde690 100644 --- a/assignment-client/src/audio/AudioMixerClientData.cpp +++ b/assignment-client/src/audio/AudioMixerClientData.cpp @@ -1,9 +1,12 @@ // // AudioMixerClientData.cpp -// hifi +// assignment-client/src/audio // // Created by Stephen Birarda on 10/18/13. -// Copyright (c) 2013 HighFidelity, Inc. All rights reserved. +// Copyright 2013 High Fidelity, Inc. +// +// Distributed under the Apache License, Version 2.0. +// See the accompanying file LICENSE or http://www.apache.org/licenses/LICENSE-2.0.html // #include diff --git a/assignment-client/src/audio/AvatarAudioRingBuffer.cpp b/assignment-client/src/audio/AvatarAudioRingBuffer.cpp index 4b1907efb8..9a7c2839d8 100644 --- a/assignment-client/src/audio/AvatarAudioRingBuffer.cpp +++ b/assignment-client/src/audio/AvatarAudioRingBuffer.cpp @@ -1,9 +1,12 @@ // // AvatarAudioRingBuffer.cpp -// hifi +// assignment-client/src/audio // // Created by Stephen Birarda on 6/5/13. -// Copyright (c) 2013 HighFidelity, Inc. All rights reserved. +// Copyright 2013 High Fidelity, Inc. +// +// Distributed under the Apache License, Version 2.0. +// See the accompanying file LICENSE or http://www.apache.org/licenses/LICENSE-2.0.html // #include @@ -18,4 +21,4 @@ AvatarAudioRingBuffer::AvatarAudioRingBuffer() : int AvatarAudioRingBuffer::parseData(const QByteArray& packet) { _shouldLoopbackForNode = (packetTypeForPacket(packet) == PacketTypeMicrophoneAudioWithEcho); return PositionalAudioRingBuffer::parseData(packet); -} \ No newline at end of file +} diff --git a/assignment-client/src/avatars/AvatarMixer.cpp b/assignment-client/src/avatars/AvatarMixer.cpp index 6d0201f872..93f38e3608 100644 --- a/assignment-client/src/avatars/AvatarMixer.cpp +++ b/assignment-client/src/avatars/AvatarMixer.cpp @@ -1,14 +1,12 @@ // // AvatarMixer.cpp -// hifi +// assignment-client/src/avatars // // Created by Stephen Birarda on 9/5/13. -// Copyright (c) 2013 HighFidelity, Inc. All rights reserved. +// Copyright 2013 High Fidelity, Inc. // -// Original avatar-mixer main created by Leonardo Murillo on 03/25/13. -// -// The avatar mixer receives head, hand and positional data from all connected -// nodes, and broadcasts that data back to them, every BROADCAST_INTERVAL ms. +// Distributed under the Apache License, Version 2.0. +// See the accompanying file LICENSE or http://www.apache.org/licenses/LICENSE-2.0.html // #include diff --git a/assignment-client/src/avatars/AvatarMixerClientData.cpp b/assignment-client/src/avatars/AvatarMixerClientData.cpp index d1449e956e..9289d640f5 100644 --- a/assignment-client/src/avatars/AvatarMixerClientData.cpp +++ b/assignment-client/src/avatars/AvatarMixerClientData.cpp @@ -1,9 +1,12 @@ // // AvatarMixerClientData.cpp -// hifi +// assignment-client/src/avatars // // Created by Stephen Birarda on 2/4/2014. -// Copyright (c) 2014 HighFidelity, Inc. All rights reserved. +// Copyright 2014 High Fidelity, Inc. +// +// Distributed under the Apache License, Version 2.0. +// See the accompanying file LICENSE or http://www.apache.org/licenses/LICENSE-2.0.html // #include "AvatarMixerClientData.h" diff --git a/assignment-client/src/main.cpp b/assignment-client/src/main.cpp index 0151f93319..24d19ddef6 100644 --- a/assignment-client/src/main.cpp +++ b/assignment-client/src/main.cpp @@ -1,9 +1,12 @@ // // main.cpp -// assignment-client +// assignment-client/src // // Created by Stephen Birarda on 8/22/13. -// Copyright (c) 2013 High Fidelity, Inc. All rights reserved. +// Copyright 2013 High Fidelity, Inc. +// +// Distributed under the Apache License, Version 2.0. +// See the accompanying file LICENSE or http://www.apache.org/licenses/LICENSE-2.0.html // #include @@ -37,4 +40,4 @@ int main(int argc, char* argv[]) { AssignmentClient client(argc, argv); return client.exec(); } -} \ No newline at end of file +} diff --git a/assignment-client/src/metavoxels/MetavoxelServer.cpp b/assignment-client/src/metavoxels/MetavoxelServer.cpp index 23c8f2189c..3bf1632074 100644 --- a/assignment-client/src/metavoxels/MetavoxelServer.cpp +++ b/assignment-client/src/metavoxels/MetavoxelServer.cpp @@ -1,9 +1,12 @@ // // MetavoxelServer.cpp -// hifi +// assignment-client/src/metavoxels // // Created by Andrzej Kapolka on 12/18/13. -// Copyright (c) 2013 High Fidelity, Inc. All rights reserved. +// Copyright 2013 High Fidelity, Inc. +// +// Distributed under the Apache License, Version 2.0. +// See the accompanying file LICENSE or http://www.apache.org/licenses/LICENSE-2.0.html // #include diff --git a/assignment-client/src/octree/OctreeInboundPacketProcessor.cpp b/assignment-client/src/octree/OctreeInboundPacketProcessor.cpp index 5e8de3a1b3..41158bf339 100644 --- a/assignment-client/src/octree/OctreeInboundPacketProcessor.cpp +++ b/assignment-client/src/octree/OctreeInboundPacketProcessor.cpp @@ -1,11 +1,12 @@ // // OctreeInboundPacketProcessor.cpp -// voxel-server +// assignment-client/src/octree // -// Created by Brad Hefta-Gaub on 8/21/13 -// Copyright (c) 2013 High Fidelity, Inc. All rights reserved. +// Created by Brad Hefta-Gaub on 8/21/13. +// Copyright 2013 High Fidelity, Inc. // -// Threaded or non-threaded network packet processor for the voxel-server +// Distributed under the Apache License, Version 2.0. +// See the accompanying file LICENSE or http://www.apache.org/licenses/LICENSE-2.0.html // #include diff --git a/assignment-client/src/octree/OctreeQueryNode.cpp b/assignment-client/src/octree/OctreeQueryNode.cpp index 984ce42631..00526cc967 100644 --- a/assignment-client/src/octree/OctreeQueryNode.cpp +++ b/assignment-client/src/octree/OctreeQueryNode.cpp @@ -1,9 +1,12 @@ // // OctreeQueryNode.cpp -// hifi +// assignment-client/src/octree // // Created by Stephen Birarda on 3/21/13. +// Copyright 2013 High Fidelity, Inc. // +// Distributed under the Apache License, Version 2.0. +// See the accompanying file LICENSE or http://www.apache.org/licenses/LICENSE-2.0.html // #include "PacketHeaders.h" diff --git a/assignment-client/src/octree/OctreeSendThread.cpp b/assignment-client/src/octree/OctreeSendThread.cpp index 4105b21eb8..0a53160b8f 100644 --- a/assignment-client/src/octree/OctreeSendThread.cpp +++ b/assignment-client/src/octree/OctreeSendThread.cpp @@ -1,8 +1,12 @@ // // OctreeSendThread.cpp +// assignment-client/src/octree // -// Created by Brad Hefta-Gaub on 8/21/13 -// Copyright (c) 2013 High Fidelity, Inc. All rights reserved. +// Created by Brad Hefta-Gaub on 8/21/13. +// Copyright 2013 High Fidelity, Inc. +// +// Distributed under the Apache License, Version 2.0. +// See the accompanying file LICENSE or http://www.apache.org/licenses/LICENSE-2.0.html // #include diff --git a/assignment-client/src/octree/OctreeServer.cpp b/assignment-client/src/octree/OctreeServer.cpp index fd3f9e6cb7..2e8a354c6a 100644 --- a/assignment-client/src/octree/OctreeServer.cpp +++ b/assignment-client/src/octree/OctreeServer.cpp @@ -1,9 +1,12 @@ // // OctreeServer.cpp -// hifi +// assignment-client/src/octree // // Created by Brad Hefta-Gaub on 9/16/13. -// Copyright (c) 2013 HighFidelity, Inc. All rights reserved. +// Copyright 2013 High Fidelity, Inc. +// +// Distributed under the Apache License, Version 2.0. +// See the accompanying file LICENSE or http://www.apache.org/licenses/LICENSE-2.0.html // #include diff --git a/assignment-client/src/particles/ParticleServer.cpp b/assignment-client/src/particles/ParticleServer.cpp index 1785ef46d6..649ee0cff9 100644 --- a/assignment-client/src/particles/ParticleServer.cpp +++ b/assignment-client/src/particles/ParticleServer.cpp @@ -1,9 +1,12 @@ // // ParticleServer.cpp -// hifi +// assignment-client/src/particles // -// Created by Brad Hefta-Gaub on 12/4/13 -// Copyright (c) 2013 HighFidelity, Inc. All rights reserved. +// Created by Brad Hefta-Gaub on 12/4/13. +// Copyright 2013 High Fidelity, Inc. +// +// Distributed under the Apache License, Version 2.0. +// See the accompanying file LICENSE or http://www.apache.org/licenses/LICENSE-2.0.html // #include diff --git a/assignment-client/src/voxels/VoxelServer.cpp b/assignment-client/src/voxels/VoxelServer.cpp index 771c91570f..7747b8336b 100644 --- a/assignment-client/src/voxels/VoxelServer.cpp +++ b/assignment-client/src/voxels/VoxelServer.cpp @@ -1,9 +1,12 @@ // // VoxelServer.cpp -// hifi +// assignment-client/src/voxels // // Created by Brad Hefta-Gaub on 9/16/13. -// Copyright (c) 2013 HighFidelity, Inc. All rights reserved. +// Copyright 2013 High Fidelity, Inc. +// +// Distributed under the Apache License, Version 2.0. +// See the accompanying file LICENSE or http://www.apache.org/licenses/LICENSE-2.0.html // #include diff --git a/domain-server/src/DomainServer.cpp b/domain-server/src/DomainServer.cpp index 8d1ee9d3dd..05d1fcd534 100644 --- a/domain-server/src/DomainServer.cpp +++ b/domain-server/src/DomainServer.cpp @@ -1,9 +1,12 @@ // // DomainServer.cpp -// hifi +// domain-server/src // // Created by Stephen Birarda on 9/26/13. -// Copyright (c) 2013 HighFidelity, Inc. All rights reserved. +// Copyright 2013 High Fidelity, Inc. +// +// Distributed under the Apache License, Version 2.0. +// See the accompanying file LICENSE or http://www.apache.org/licenses/LICENSE-2.0.html // #include diff --git a/domain-server/src/DomainServerNodeData.cpp b/domain-server/src/DomainServerNodeData.cpp index f1e08e3bc4..9e118faff6 100644 --- a/domain-server/src/DomainServerNodeData.cpp +++ b/domain-server/src/DomainServerNodeData.cpp @@ -1,9 +1,12 @@ // // DomainServerNodeData.cpp -// hifi +// domain-server/src // // Created by Stephen Birarda on 2/6/2014. -// Copyright (c) 2014 HighFidelity, Inc. All rights reserved. +// Copyright 2014 High Fidelity, Inc. +// +// Distributed under the Apache License, Version 2.0. +// See the accompanying file LICENSE or http://www.apache.org/licenses/LICENSE-2.0.html // #include @@ -45,4 +48,4 @@ QJsonObject DomainServerNodeData::mergeJSONStatsFromNewObject(const QJsonObject& } return destinationObject; -} \ No newline at end of file +} diff --git a/domain-server/src/main.cpp b/domain-server/src/main.cpp index 970d1dad70..d79f06365d 100644 --- a/domain-server/src/main.cpp +++ b/domain-server/src/main.cpp @@ -1,15 +1,12 @@ // // main.cpp -// Domain Server +// domain-server/src // // Created by Philip Rosedale on 11/20/12. -// Copyright (c) 2012 High Fidelity, Inc. All rights reserved. +// Copyright 2012 High Fidelity, Inc. // -// The Domain Server keeps a list of nodes that have connected to it, and echoes that list of -// nodes out to nodes when they check in. -// -// The connection is stateless... the domain server will set you inactive if it does not hear from -// you in LOGOFF_CHECK_INTERVAL milliseconds, meaning your info will not be sent to other users. +// Distributed under the Apache License, Version 2.0. +// See the accompanying file LICENSE or http://www.apache.org/licenses/LICENSE-2.0.html // #include diff --git a/interface/src/Application.cpp b/interface/src/Application.cpp index 4013989b99..1faf1d4f0d 100644 --- a/interface/src/Application.cpp +++ b/interface/src/Application.cpp @@ -1,9 +1,12 @@ // // Application.cpp -// interface +// interface/src // // Created by Andrzej Kapolka on 5/10/13. -// Copyright (c) 2013 High Fidelity, Inc. All rights reserved. +// Copyright 2013 High Fidelity, Inc. +// +// Distributed under the Apache License, Version 2.0. +// See the accompanying file LICENSE or http://www.apache.org/licenses/LICENSE-2.0.html // #ifdef WIN32 diff --git a/interface/src/Audio.cpp b/interface/src/Audio.cpp index 63c683dbb0..719bfd8aa1 100644 --- a/interface/src/Audio.cpp +++ b/interface/src/Audio.cpp @@ -1,9 +1,12 @@ // // Audio.cpp -// interface +// interface/src // // Created by Stephen Birarda on 1/22/13. -// Copyright (c) 2013 High Fidelity, Inc. All rights reserved. +// Copyright 2013 High Fidelity, Inc. +// +// Distributed under the Apache License, Version 2.0. +// See the accompanying file LICENSE or http://www.apache.org/licenses/LICENSE-2.0.html // #include diff --git a/interface/src/BuckyBalls.cpp b/interface/src/BuckyBalls.cpp index 8e489db74b..e1ec41dca1 100644 --- a/interface/src/BuckyBalls.cpp +++ b/interface/src/BuckyBalls.cpp @@ -1,9 +1,12 @@ // // BuckyBalls.cpp -// hifi +// interface/src // // Created by Philip on 1/2/14. +// Copyright 2013 High Fidelity, Inc. // +// Distributed under the Apache License, Version 2.0. +// See the accompanying file LICENSE or http://www.apache.org/licenses/LICENSE-2.0.html // #include "BuckyBalls.h" diff --git a/interface/src/Camera.cpp b/interface/src/Camera.cpp index 8918a3018d..2ef32dac5f 100644 --- a/interface/src/Camera.cpp +++ b/interface/src/Camera.cpp @@ -1,8 +1,11 @@ // // Camera.cpp -// interface +// interface/src // -// Copyright (c) 2013 High Fidelity, Inc. All rights reserved. +// Copyright 2013 High Fidelity, Inc. +// +// Distributed under the Apache License, Version 2.0. +// See the accompanying file LICENSE or http://www.apache.org/licenses/LICENSE-2.0.html // #include diff --git a/interface/src/DatagramProcessor.cpp b/interface/src/DatagramProcessor.cpp index 50e84db7b5..92260ad9dc 100644 --- a/interface/src/DatagramProcessor.cpp +++ b/interface/src/DatagramProcessor.cpp @@ -1,9 +1,12 @@ // // DatagramProcessor.cpp -// hifi +// interface/src // // Created by Stephen Birarda on 1/23/2014. -// Copyright (c) 2014 HighFidelity, Inc. All rights reserved. +// Copyright 2014 High Fidelity, Inc. +// +// Distributed under the Apache License, Version 2.0. +// See the accompanying file LICENSE or http://www.apache.org/licenses/LICENSE-2.0.html // #include diff --git a/interface/src/Environment.cpp b/interface/src/Environment.cpp index 36292c56a1..1ba2f0501c 100644 --- a/interface/src/Environment.cpp +++ b/interface/src/Environment.cpp @@ -1,9 +1,12 @@ // // Environment.cpp -// interface +// interface/src // // Created by Andrzej Kapolka on 5/6/13. -// Copyright (c) 2013 High Fidelity, Inc. All rights reserved. +// Copyright 2013 High Fidelity, Inc. +// +// Distributed under the Apache License, Version 2.0. +// See the accompanying file LICENSE or http://www.apache.org/licenses/LICENSE-2.0.html // #include "InterfaceConfig.h" diff --git a/interface/src/FileLogger.cpp b/interface/src/FileLogger.cpp index 81c626a46e..c4e75b21b2 100644 --- a/interface/src/FileLogger.cpp +++ b/interface/src/FileLogger.cpp @@ -1,9 +1,12 @@ // // FileLogger.cpp -// hifi +// interface/src // // Created by Stojce Slavkovski on 12/22/13. +// Copyright 2013 High Fidelity, Inc. // +// Distributed under the Apache License, Version 2.0. +// See the accompanying file LICENSE or http://www.apache.org/licenses/LICENSE-2.0.html // #include "FileLogger.h" diff --git a/interface/src/GLCanvas.cpp b/interface/src/GLCanvas.cpp index 513dcfe40c..9f1bf303fa 100644 --- a/interface/src/GLCanvas.cpp +++ b/interface/src/GLCanvas.cpp @@ -1,9 +1,12 @@ // // GLCanvas.cpp -// hifi +// interface/src // // Created by Stephen Birarda on 8/14/13. -// Copyright (c) 2013 HighFidelity, Inc. All rights reserved. +// Copyright 2013 High Fidelity, Inc. +// +// Distributed under the Apache License, Version 2.0. +// See the accompanying file LICENSE or http://www.apache.org/licenses/LICENSE-2.0.html // #include "Application.h" diff --git a/interface/src/Menu.cpp b/interface/src/Menu.cpp index 8a97c98f02..70e69597f6 100644 --- a/interface/src/Menu.cpp +++ b/interface/src/Menu.cpp @@ -1,9 +1,12 @@ // // Menu.cpp -// hifi +// interface/src // // Created by Stephen Birarda on 8/12/13. -// Copyright (c) 2013 HighFidelity, Inc. All rights reserved. +// Copyright 2013 High Fidelity, Inc. +// +// Distributed under the Apache License, Version 2.0. +// See the accompanying file LICENSE or http://www.apache.org/licenses/LICENSE-2.0.html // #include diff --git a/interface/src/MetavoxelSystem.cpp b/interface/src/MetavoxelSystem.cpp index 6b4d817f7f..78c97c1703 100644 --- a/interface/src/MetavoxelSystem.cpp +++ b/interface/src/MetavoxelSystem.cpp @@ -1,9 +1,12 @@ // // MetavoxelSystem.cpp -// interface +// interface/src // // Created by Andrzej Kapolka on 12/10/13. -// Copyright (c) 2013 High Fidelity, Inc. All rights reserved. +// Copyright 2013 High Fidelity, Inc. +// +// Distributed under the Apache License, Version 2.0. +// See the accompanying file LICENSE or http://www.apache.org/licenses/LICENSE-2.0.html // #include diff --git a/interface/src/ParticleTreeRenderer.cpp b/interface/src/ParticleTreeRenderer.cpp index 59784c8c1f..aa498082d9 100644 --- a/interface/src/ParticleTreeRenderer.cpp +++ b/interface/src/ParticleTreeRenderer.cpp @@ -1,10 +1,12 @@ // // ParticleTreeRenderer.cpp -// hifi +// interface/src // // Created by Brad Hefta-Gaub on 12/6/13. -// Copyright (c) 2013 High Fidelity, Inc. All rights reserved. +// Copyright 2013 High Fidelity, Inc. // +// Distributed under the Apache License, Version 2.0. +// See the accompanying file LICENSE or http://www.apache.org/licenses/LICENSE-2.0.html // #include diff --git a/interface/src/Physics.cpp b/interface/src/Physics.cpp index 101087b1ef..a9f9f6b17d 100644 --- a/interface/src/Physics.cpp +++ b/interface/src/Physics.cpp @@ -1,33 +1,11 @@ // // Physics.cpp -// hifi +// interface/src // -// Created by Philip on July 11, 2013 +// Copyright 2013 High Fidelity, Inc. // -// Routines to help with doing virtual world physics -// - -#include -#include - -#include "Util.h" -#include "world.h" -#include "Physics.h" - -// -// Applies static friction: maxVelocity is the largest velocity for which there -// there is friction, and strength is the amount of friction force applied to reduce -// velocity. -// -void applyStaticFriction(float deltaTime, glm::vec3& velocity, float maxVelocity, float strength) { - float v = glm::length(velocity); - if (v < maxVelocity) { - velocity *= glm::clamp((1.0f - deltaTime * strength * (1.f - v / maxVelocity)), 0.0f, 1.0f); - } -} - -// -// Applies velocity damping, with a strength value for linear and squared velocity damping +// Distributed under the Apache License, Version 2.0. +// See the accompanying file LICENSE or http://www.apache.org/licenses/LICENSE-2.0.html // void applyDamping(float deltaTime, glm::vec3& velocity, float linearStrength, float squaredStrength) { diff --git a/interface/src/Stars.cpp b/interface/src/Stars.cpp index dcfe726fff..e5662005d5 100755 --- a/interface/src/Stars.cpp +++ b/interface/src/Stars.cpp @@ -1,9 +1,12 @@ // -// Stars.cpp -// interface +// Stars.cpp +// interface/src // -// Created by Tobias Schwinger on 3/22/13. -// Copyright (c) 2013 High Fidelity, Inc. All rights reserved. +// Created by Tobias Schwinger on 3/22/13. +// Copyright 2013 High Fidelity, Inc. +// +// Distributed under the Apache License, Version 2.0. +// See the accompanying file LICENSE or http://www.apache.org/licenses/LICENSE-2.0.html // #include "InterfaceConfig.h" diff --git a/interface/src/Util.cpp b/interface/src/Util.cpp index 1921fe924b..4fe5636329 100644 --- a/interface/src/Util.cpp +++ b/interface/src/Util.cpp @@ -1,42 +1,13 @@ // -// util.cpp -// interface +// Util.cpp +// interface/src // // Created by Philip Rosedale on 8/24/12. -// Copyright (c) 2012 High Fidelity, Inc. All rights reserved. +// Copyright 2012 High Fidelity, Inc. +// +// Distributed under the Apache License, Version 2.0. +// See the accompanying file LICENSE or http://www.apache.org/licenses/LICENSE-2.0.html // - -#include -#include -#include -#include - -#include -#include -#include -#include - -#include - -#include "InterfaceConfig.h" -#include "ui/TextRenderer.h" -#include "VoxelConstants.h" -#include "world.h" - -#include "Util.h" - -using namespace std; - -// no clue which versions are affected... -#define WORKAROUND_BROKEN_GLUT_STROKES -// see http://www.opengl.org/resources/libraries/glut/spec3/node78.html - -void eulerToOrthonormals(glm::vec3 * angles, glm::vec3 * front, glm::vec3 * right, glm::vec3 * up) { - // - // Converts from three euler angles to the associated orthonormal vectors - // - // Angles contains (pitch, yaw, roll) in radians - // // First, create the quaternion associated with these euler angles glm::quat q(glm::vec3(angles->x, -(angles->y), angles->z)); diff --git a/interface/src/XmppClient.cpp b/interface/src/XmppClient.cpp index df8cf34874..d930c16b53 100644 --- a/interface/src/XmppClient.cpp +++ b/interface/src/XmppClient.cpp @@ -1,9 +1,12 @@ // // XmppClient.cpp -// interface +// interface/src // -// Created by Dimitar Dobrev on 10/3/14 -// Copyright (c) 2013 High Fidelity, Inc. All rights reserved. +// Created by Dimitar Dobrev on 10/3/14. +// Copyright 2013 High Fidelity, Inc. +// +// Distributed under the Apache License, Version 2.0. +// See the accompanying file LICENSE or http://www.apache.org/licenses/LICENSE-2.0.html // #ifdef HAVE_QXMPP diff --git a/interface/src/avatar/Avatar.cpp b/interface/src/avatar/Avatar.cpp index 494c45c295..47ced025aa 100644 --- a/interface/src/avatar/Avatar.cpp +++ b/interface/src/avatar/Avatar.cpp @@ -1,9 +1,12 @@ // // Avatar.cpp -// interface +// interface/src/avatar // // Created by Philip Rosedale on 9/11/12. -// Copyright (c) 2013 High Fidelity, Inc. All rights reserved. +// Copyright 2013 High Fidelity, Inc. +// +// Distributed under the Apache License, Version 2.0. +// See the accompanying file LICENSE or http://www.apache.org/licenses/LICENSE-2.0.html // #include diff --git a/interface/src/avatar/AvatarManager.cpp b/interface/src/avatar/AvatarManager.cpp index 9f8e7feb2e..38163ef326 100644 --- a/interface/src/avatar/AvatarManager.cpp +++ b/interface/src/avatar/AvatarManager.cpp @@ -1,9 +1,12 @@ // // AvatarManager.cpp -// hifi +// interface/src/avatar // // Created by Stephen Birarda on 1/23/2014. -// Copyright (c) 2014 HighFidelity, Inc. All rights reserved. +// Copyright 2014 High Fidelity, Inc. +// +// Distributed under the Apache License, Version 2.0. +// See the accompanying file LICENSE or http://www.apache.org/licenses/LICENSE-2.0.html // #include diff --git a/interface/src/avatar/FaceModel.cpp b/interface/src/avatar/FaceModel.cpp index e81e1da117..709a9fc79d 100644 --- a/interface/src/avatar/FaceModel.cpp +++ b/interface/src/avatar/FaceModel.cpp @@ -1,9 +1,12 @@ // // FaceModel.cpp -// interface +// interface/src/avatar // // Created by Andrzej Kapolka on 9/16/13. -// Copyright (c) 2013 High Fidelity, Inc. All rights reserved. +// Copyright 2013 High Fidelity, Inc. +// +// Distributed under the Apache License, Version 2.0. +// See the accompanying file LICENSE or http://www.apache.org/licenses/LICENSE-2.0.html // #include diff --git a/interface/src/avatar/Hand.cpp b/interface/src/avatar/Hand.cpp index c2ce17022d..832a3da6ca 100644 --- a/interface/src/avatar/Hand.cpp +++ b/interface/src/avatar/Hand.cpp @@ -1,8 +1,11 @@ // // Hand.cpp -// interface +// interface/src/avatar // -// Copyright (c) 2013 High Fidelity, Inc. All rights reserved. +// Copyright 2013 High Fidelity, Inc. +// +// Distributed under the Apache License, Version 2.0. +// See the accompanying file LICENSE or http://www.apache.org/licenses/LICENSE-2.0.html // #include diff --git a/interface/src/avatar/Head.cpp b/interface/src/avatar/Head.cpp index fed86ed81f..8316c90aca 100644 --- a/interface/src/avatar/Head.cpp +++ b/interface/src/avatar/Head.cpp @@ -1,8 +1,11 @@ // // Head.cpp -// interface +// interface/src/avatar // -// Copyright (c) 2013 High Fidelity, Inc. All rights reserved. +// Copyright 2013 High Fidelity, Inc. +// +// Distributed under the Apache License, Version 2.0. +// See the accompanying file LICENSE or http://www.apache.org/licenses/LICENSE-2.0.html // #include diff --git a/interface/src/avatar/MyAvatar.cpp b/interface/src/avatar/MyAvatar.cpp index 73d2a84eb7..af105de04a 100644 --- a/interface/src/avatar/MyAvatar.cpp +++ b/interface/src/avatar/MyAvatar.cpp @@ -1,9 +1,12 @@ // // MyAvatar.cpp -// interface +// interface/src/avatar // // Created by Mark Peng on 8/16/13. -// Copyright (c) 2012 High Fidelity, Inc. All rights reserved. +// Copyright 2012 High Fidelity, Inc. +// +// Distributed under the Apache License, Version 2.0. +// See the accompanying file LICENSE or http://www.apache.org/licenses/LICENSE-2.0.html // #include diff --git a/interface/src/avatar/SkeletonModel.cpp b/interface/src/avatar/SkeletonModel.cpp index 93eaf22ab8..b9ac280711 100644 --- a/interface/src/avatar/SkeletonModel.cpp +++ b/interface/src/avatar/SkeletonModel.cpp @@ -1,9 +1,12 @@ // // SkeletonModel.cpp -// interface +// interface/src/avatar // // Created by Andrzej Kapolka on 10/17/13. -// Copyright (c) 2013 High Fidelity, Inc. All rights reserved. +// Copyright 2013 High Fidelity, Inc. +// +// Distributed under the Apache License, Version 2.0. +// See the accompanying file LICENSE or http://www.apache.org/licenses/LICENSE-2.0.html // #include diff --git a/interface/src/devices/Faceshift.cpp b/interface/src/devices/Faceshift.cpp index 9f1734c7e5..1fd4b4bf1d 100644 --- a/interface/src/devices/Faceshift.cpp +++ b/interface/src/devices/Faceshift.cpp @@ -1,9 +1,12 @@ // // Faceshift.cpp -// interface +// interface/src/devices // // Created by Andrzej Kapolka on 9/3/13. -// Copyright (c) 2013 High Fidelity, Inc. All rights reserved. +// Copyright 2013 High Fidelity, Inc. +// +// Distributed under the Apache License, Version 2.0. +// See the accompanying file LICENSE or http://www.apache.org/licenses/LICENSE-2.0.html // #include diff --git a/interface/src/devices/OculusManager.cpp b/interface/src/devices/OculusManager.cpp index c5377ce428..a69fd48087 100644 --- a/interface/src/devices/OculusManager.cpp +++ b/interface/src/devices/OculusManager.cpp @@ -1,9 +1,12 @@ // // OculusManager.cpp -// hifi +// interface/src/devices // // Created by Stephen Birarda on 5/9/13. -// Copyright (c) 2012 High Fidelity, Inc. All rights reserved. +// Copyright 2012 High Fidelity, Inc. +// +// Distributed under the Apache License, Version 2.0. +// See the accompanying file LICENSE or http://www.apache.org/licenses/LICENSE-2.0.html // #include "InterfaceConfig.h" diff --git a/interface/src/devices/SixenseManager.cpp b/interface/src/devices/SixenseManager.cpp index 8e54e034ac..b950e6097c 100644 --- a/interface/src/devices/SixenseManager.cpp +++ b/interface/src/devices/SixenseManager.cpp @@ -1,9 +1,12 @@ // -// Sixense.cpp -// interface +// SixenseManager.cpp +// interface/src/devices // // Created by Andrzej Kapolka on 11/15/13. -// Copyright (c) 2013 High Fidelity, Inc. All rights reserved. +// Copyright 2013 High Fidelity, Inc. +// +// Distributed under the Apache License, Version 2.0. +// See the accompanying file LICENSE or http://www.apache.org/licenses/LICENSE-2.0.html // #include diff --git a/interface/src/devices/TV3DManager.cpp b/interface/src/devices/TV3DManager.cpp index 07aeea92b4..fcbef0385c 100644 --- a/interface/src/devices/TV3DManager.cpp +++ b/interface/src/devices/TV3DManager.cpp @@ -1,9 +1,12 @@ // // TV3DManager.cpp -// hifi +// interface/src/devices // // Created by Brad Hefta-Gaub on 12/24/13. -// Copyright (c) 2013 High Fidelity, Inc. All rights reserved. +// Copyright 2013 High Fidelity, Inc. +// +// Distributed under the Apache License, Version 2.0. +// See the accompanying file LICENSE or http://www.apache.org/licenses/LICENSE-2.0.html // #include "InterfaceConfig.h" diff --git a/interface/src/devices/Visage.cpp b/interface/src/devices/Visage.cpp index b96ef1ee72..72f0306e79 100644 --- a/interface/src/devices/Visage.cpp +++ b/interface/src/devices/Visage.cpp @@ -1,9 +1,12 @@ // // Visage.cpp -// interface +// interface/src/devices // // Created by Andrzej Kapolka on 2/11/14. -// Copyright (c) 2014 High Fidelity, Inc. All rights reserved. +// Copyright 2014 High Fidelity, Inc. +// +// Distributed under the Apache License, Version 2.0. +// See the accompanying file LICENSE or http://www.apache.org/licenses/LICENSE-2.0.html // #include diff --git a/interface/src/location/LocationManager.cpp b/interface/src/location/LocationManager.cpp index b83094ba4c..7d22dde040 100644 --- a/interface/src/location/LocationManager.cpp +++ b/interface/src/location/LocationManager.cpp @@ -1,9 +1,12 @@ // // LocationManager.cpp -// hifi +// interface/src/location // // Created by Stojce Slavkovski on 2/7/14. +// Copyright 2013 High Fidelity, Inc. // +// Distributed under the Apache License, Version 2.0. +// See the accompanying file LICENSE or http://www.apache.org/licenses/LICENSE-2.0.html // #include "Application.h" diff --git a/interface/src/location/NamedLocation.cpp b/interface/src/location/NamedLocation.cpp index c6daef4961..ed7701a391 100644 --- a/interface/src/location/NamedLocation.cpp +++ b/interface/src/location/NamedLocation.cpp @@ -1,9 +1,12 @@ // -// LocationManager.cpp -// hifi +// NamedLocation.cpp +// interface/src/location // // Created by Stojce Slavkovski on 2/1/14. +// Copyright 2013 High Fidelity, Inc. // +// Distributed under the Apache License, Version 2.0. +// See the accompanying file LICENSE or http://www.apache.org/licenses/LICENSE-2.0.html // #include "NamedLocation.h" diff --git a/interface/src/main.cpp b/interface/src/main.cpp index f2c516792b..40e2a9ab27 100644 --- a/interface/src/main.cpp +++ b/interface/src/main.cpp @@ -1,18 +1,11 @@ -// -// Interface // -// Allows you to connect to and see/hear the shared 3D space. -// Optionally uses serialUSB connection to get gyro data for head movement. -// Optionally gets UDP stream from transmitter to animate controller/hand. -// -// Usage: The interface client first attempts to contact a domain server to -// discover the appropriate audio, voxel, and avatar servers to contact. -// Right now, the default domain server is "highfidelity.below92.com" -// You can change the domain server to use your own by editing the -// DOMAIN_HOSTNAME or DOMAIN_IP strings in the file NodeList.cpp +// main.cpp +// interface/src // +// Copyright 2013 High Fidelity, Inc. // -// Welcome Aboard! +// Distributed under the Apache License, Version 2.0. +// See the accompanying file LICENSE or http://www.apache.org/licenses/LICENSE-2.0.html // #include "Application.h" diff --git a/interface/src/renderer/AmbientOcclusionEffect.cpp b/interface/src/renderer/AmbientOcclusionEffect.cpp index a492552e7c..635e6c9bd6 100644 --- a/interface/src/renderer/AmbientOcclusionEffect.cpp +++ b/interface/src/renderer/AmbientOcclusionEffect.cpp @@ -1,9 +1,12 @@ // // AmbientOcclusionEffect.cpp -// interface +// interface/src/renderer // // Created by Andrzej Kapolka on 7/14/13. -// Copyright (c) 2013 High Fidelity, Inc. All rights reserved. +// Copyright 2013 High Fidelity, Inc. +// +// Distributed under the Apache License, Version 2.0. +// See the accompanying file LICENSE or http://www.apache.org/licenses/LICENSE-2.0.html // // include this before QOpenGLFramebufferObject, which includes an earlier version of OpenGL diff --git a/interface/src/renderer/FBXReader.cpp b/interface/src/renderer/FBXReader.cpp index c1e1e42abf..959c015eea 100644 --- a/interface/src/renderer/FBXReader.cpp +++ b/interface/src/renderer/FBXReader.cpp @@ -1,9 +1,12 @@ // // FBXReader.cpp -// interface +// interface/src/renderer // // Created by Andrzej Kapolka on 9/18/13. -// Copyright (c) 2013 High Fidelity, Inc. All rights reserved. +// Copyright 2013 High Fidelity, Inc. +// +// Distributed under the Apache License, Version 2.0. +// See the accompanying file LICENSE or http://www.apache.org/licenses/LICENSE-2.0.html // #include diff --git a/interface/src/renderer/GeometryCache.cpp b/interface/src/renderer/GeometryCache.cpp index a3984b9306..7b4eef1ac1 100644 --- a/interface/src/renderer/GeometryCache.cpp +++ b/interface/src/renderer/GeometryCache.cpp @@ -1,9 +1,12 @@ // // GeometryCache.cpp -// interface +// interface/src/renderer // // Created by Andrzej Kapolka on 6/21/13. -// Copyright (c) 2013 High Fidelity, Inc. All rights reserved. +// Copyright 2013 High Fidelity, Inc. +// +// Distributed under the Apache License, Version 2.0. +// See the accompanying file LICENSE or http://www.apache.org/licenses/LICENSE-2.0.html // #include diff --git a/interface/src/renderer/GlowEffect.cpp b/interface/src/renderer/GlowEffect.cpp index 1aea22367f..b52e8d8531 100644 --- a/interface/src/renderer/GlowEffect.cpp +++ b/interface/src/renderer/GlowEffect.cpp @@ -1,9 +1,12 @@ // // GlowEffect.cpp -// interface +// interface/src/renderer // // Created by Andrzej Kapolka on 8/7/13. -// Copyright (c) 2013 High Fidelity, Inc. All rights reserved. +// Copyright 2013 High Fidelity, Inc. +// +// Distributed under the Apache License, Version 2.0. +// See the accompanying file LICENSE or http://www.apache.org/licenses/LICENSE-2.0.html // // include this before QOpenGLFramebufferObject, which includes an earlier version of OpenGL diff --git a/interface/src/renderer/Model.cpp b/interface/src/renderer/Model.cpp index 36fbbe3833..819d1164c0 100644 --- a/interface/src/renderer/Model.cpp +++ b/interface/src/renderer/Model.cpp @@ -1,9 +1,12 @@ // // Model.cpp -// interface +// interface/src/renderer // // Created by Andrzej Kapolka on 10/18/13. -// Copyright (c) 2013 High Fidelity, Inc. All rights reserved. +// Copyright 2013 High Fidelity, Inc. +// +// Distributed under the Apache License, Version 2.0. +// See the accompanying file LICENSE or http://www.apache.org/licenses/LICENSE-2.0.html // #include diff --git a/interface/src/renderer/PointShader.cpp b/interface/src/renderer/PointShader.cpp index 4191a116e3..68df69f284 100644 --- a/interface/src/renderer/PointShader.cpp +++ b/interface/src/renderer/PointShader.cpp @@ -1,9 +1,12 @@ // // PointShader.cpp -// interface +// interface/src/renderer // // Created by Brad Hefta-Gaub on 10/30/13. -// Copyright (c) 2013 High Fidelity, Inc. All rights reserved. +// Copyright 2013 High Fidelity, Inc. +// +// Distributed under the Apache License, Version 2.0. +// See the accompanying file LICENSE or http://www.apache.org/licenses/LICENSE-2.0.html // // include this before QOpenGLFramebufferObject, which includes an earlier version of OpenGL diff --git a/interface/src/renderer/ProgramObject.cpp b/interface/src/renderer/ProgramObject.cpp index 71d6c100f1..b88be69f07 100644 --- a/interface/src/renderer/ProgramObject.cpp +++ b/interface/src/renderer/ProgramObject.cpp @@ -1,9 +1,12 @@ // // ProgramObject.cpp -// interface +// interface/src/renderer // // Created by Andrzej Kapolka on 5/7/13. -// Copyright (c) 2013 High Fidelity, Inc. All rights reserved. +// Copyright 2013 High Fidelity, Inc. +// +// Distributed under the Apache License, Version 2.0. +// See the accompanying file LICENSE or http://www.apache.org/licenses/LICENSE-2.0.html // #include "ProgramObject.h" diff --git a/interface/src/renderer/RenderUtil.cpp b/interface/src/renderer/RenderUtil.cpp index 32cf36a650..0575ceaa88 100644 --- a/interface/src/renderer/RenderUtil.cpp +++ b/interface/src/renderer/RenderUtil.cpp @@ -1,9 +1,12 @@ // // RenderUtil.cpp -// interface +// interface/src/renderer // // Created by Andrzej Kapolka on 8/15/13. -// Copyright (c) 2013 High Fidelity, Inc. All rights reserved. +// Copyright 2013 High Fidelity, Inc. +// +// Distributed under the Apache License, Version 2.0. +// See the accompanying file LICENSE or http://www.apache.org/licenses/LICENSE-2.0.html // #include "InterfaceConfig.h" diff --git a/interface/src/renderer/TextureCache.cpp b/interface/src/renderer/TextureCache.cpp index c959340f6b..17146dc2bb 100644 --- a/interface/src/renderer/TextureCache.cpp +++ b/interface/src/renderer/TextureCache.cpp @@ -1,9 +1,12 @@ // // TextureCache.cpp -// interface +// interface/src/renderer // // Created by Andrzej Kapolka on 8/6/13. -// Copyright (c) 2013 High Fidelity, Inc. All rights reserved. +// Copyright 2013 High Fidelity, Inc. +// +// Distributed under the Apache License, Version 2.0. +// See the accompanying file LICENSE or http://www.apache.org/licenses/LICENSE-2.0.html // // include this before QGLWidget, which includes an earlier version of OpenGL diff --git a/interface/src/renderer/VoxelShader.cpp b/interface/src/renderer/VoxelShader.cpp index 0377e5fe72..0982304adf 100644 --- a/interface/src/renderer/VoxelShader.cpp +++ b/interface/src/renderer/VoxelShader.cpp @@ -1,9 +1,12 @@ // // VoxelShader.cpp -// interface +// interface/src/renderer // // Created by Brad Hefta-Gaub on 9/22/13. -// Copyright (c) 2013 High Fidelity, Inc. All rights reserved. +// Copyright 2013 High Fidelity, Inc. +// +// Distributed under the Apache License, Version 2.0. +// See the accompanying file LICENSE or http://www.apache.org/licenses/LICENSE-2.0.html // // include this before QOpenGLFramebufferObject, which includes an earlier version of OpenGL diff --git a/interface/src/scripting/AudioDeviceScriptingInterface.cpp b/interface/src/scripting/AudioDeviceScriptingInterface.cpp index a184e8a2f6..688b0942d5 100644 --- a/interface/src/scripting/AudioDeviceScriptingInterface.cpp +++ b/interface/src/scripting/AudioDeviceScriptingInterface.cpp @@ -1,9 +1,12 @@ // // AudioDeviceScriptingInterface.cpp -// hifi +// interface/src/scripting // -// Created by Brad Hefta-Gaub on 3/23/14 -// Copyright (c) 2014 HighFidelity, Inc. All rights reserved. +// Created by Brad Hefta-Gaub on 3/23/14. +// Copyright 2014 High Fidelity, Inc. +// +// Distributed under the Apache License, Version 2.0. +// See the accompanying file LICENSE or http://www.apache.org/licenses/LICENSE-2.0.html // #include "Application.h" diff --git a/interface/src/scripting/ClipboardScriptingInterface.cpp b/interface/src/scripting/ClipboardScriptingInterface.cpp index 2ddef524aa..b11c0fdbff 100644 --- a/interface/src/scripting/ClipboardScriptingInterface.cpp +++ b/interface/src/scripting/ClipboardScriptingInterface.cpp @@ -1,8 +1,11 @@ // // ClipboardScriptingInterface.cpp -// interface +// interface/src/scripting // -// Copyright (c) 2014 High Fidelity, Inc. All rights reserved. +// Copyright 2014 High Fidelity, Inc. +// +// Distributed under the Apache License, Version 2.0. +// See the accompanying file LICENSE or http://www.apache.org/licenses/LICENSE-2.0.html // #include "Application.h" @@ -96,4 +99,4 @@ void ClipboardScriptingInterface::nudgeVoxel(float x, float y, float z, float s, s / (float)TREE_SCALE }; Application::getInstance()->nudgeVoxelsByVector(sourceVoxel, nudgeVecInTreeSpace); -} \ No newline at end of file +} diff --git a/interface/src/scripting/ControllerScriptingInterface.cpp b/interface/src/scripting/ControllerScriptingInterface.cpp index f5ab1653f5..aa14f769de 100644 --- a/interface/src/scripting/ControllerScriptingInterface.cpp +++ b/interface/src/scripting/ControllerScriptingInterface.cpp @@ -1,9 +1,12 @@ // -// ControllerScriptingInterface.h -// hifi +// ControllerScriptingInterface.cpp +// interface/src/scripting // -// Created by Brad Hefta-Gaub on 12/17/13 -// Copyright (c) 2013 HighFidelity, Inc. All rights reserved. +// Created by Brad Hefta-Gaub on 12/17/13. +// Copyright 2013 High Fidelity, Inc. +// +// Distributed under the Apache License, Version 2.0. +// See the accompanying file LICENSE or http://www.apache.org/licenses/LICENSE-2.0.html // #include diff --git a/interface/src/scripting/MenuScriptingInterface.cpp b/interface/src/scripting/MenuScriptingInterface.cpp index 4f9003b288..11d681bfc7 100644 --- a/interface/src/scripting/MenuScriptingInterface.cpp +++ b/interface/src/scripting/MenuScriptingInterface.cpp @@ -1,9 +1,12 @@ // // MenuScriptingInterface.cpp -// hifi +// interface/src/scripting // -// Created by Brad Hefta-Gaub on 2/25/14 -// Copyright (c) 2014 HighFidelity, Inc. All rights reserved. +// Created by Brad Hefta-Gaub on 2/25/14. +// Copyright 2014 High Fidelity, Inc. +// +// Distributed under the Apache License, Version 2.0. +// See the accompanying file LICENSE or http://www.apache.org/licenses/LICENSE-2.0.html // #include "Application.h" diff --git a/interface/src/scripting/SettingsScriptingInterface.cpp b/interface/src/scripting/SettingsScriptingInterface.cpp index 2a788c2776..ea9d645a94 100644 --- a/interface/src/scripting/SettingsScriptingInterface.cpp +++ b/interface/src/scripting/SettingsScriptingInterface.cpp @@ -1,9 +1,12 @@ // // SettingsScriptingInterface.cpp -// hifi +// interface/src/scripting // -// Created by Brad Hefta-Gaub on 2/25/14 -// Copyright (c) 2014 HighFidelity, Inc. All rights reserved. +// Created by Brad Hefta-Gaub on 2/25/14. +// Copyright 2014 High Fidelity, Inc. +// +// Distributed under the Apache License, Version 2.0. +// See the accompanying file LICENSE or http://www.apache.org/licenses/LICENSE-2.0.html // #include "Application.h" diff --git a/interface/src/starfield/Controller.cpp b/interface/src/starfield/Controller.cpp index 0987a14dd5..b50c393f00 100755 --- a/interface/src/starfield/Controller.cpp +++ b/interface/src/starfield/Controller.cpp @@ -1,10 +1,12 @@ // -// starfield/Controller.cpp -// interface +// Controller.cpp +// interface/src/starfield // -// Created by Chris Barnard on 10/16/13 -// Portions of code based on earlier work by Tobias Schwinger. -// Copyright (c) 2013 High Fidelity, Inc. All rights reserved. +// Created by Chris Barnard on 10/16/13. +// Copyright 2013 High Fidelity, Inc. +// +// Distributed under the Apache License, Version 2.0. +// See the accompanying file LICENSE or http://www.apache.org/licenses/LICENSE-2.0.html // #ifdef _WIN32 diff --git a/interface/src/starfield/Generator.cpp b/interface/src/starfield/Generator.cpp index 6065140505..15d1736e4e 100644 --- a/interface/src/starfield/Generator.cpp +++ b/interface/src/starfield/Generator.cpp @@ -1,9 +1,12 @@ // -// starfield/Generator.cpp -// interface +// Generator.cpp +// interface/src/starfield // -// Created by Chris Barnard on 10/13/13. -// Copyright (c) 2013 High Fidelity, Inc. All rights reserved. +// Created by Chris Barnard on 10/13/13. +// Copyright 2013 High Fidelity, Inc. +// +// Distributed under the Apache License, Version 2.0. +// See the accompanying file LICENSE or http://www.apache.org/licenses/LICENSE-2.0.html // #ifdef _WIN32 diff --git a/interface/src/starfield/data/GpuVertex.cpp b/interface/src/starfield/data/GpuVertex.cpp index 85fc6f8f7e..5c1a8ea711 100755 --- a/interface/src/starfield/data/GpuVertex.cpp +++ b/interface/src/starfield/data/GpuVertex.cpp @@ -1,10 +1,12 @@ // -// starfield/data/GpuVertex.cpp -// interface +// GpuVertex.cpp +// interface/src/starfield/data // -// Created by Chris Barnard on 10/17/13. -// Based on code by Tobias Schwinger on 3/29/13. -// Copyright (c) 2013 High Fidelity, Inc. All rights reserved. +// Created by Chris Barnard on 10/17/13. +// Copyright 2013 High Fidelity, Inc. +// +// Distributed under the Apache License, Version 2.0. +// See the accompanying file LICENSE or http://www.apache.org/licenses/LICENSE-2.0.html // #include "starfield/data/GpuVertex.h" diff --git a/interface/src/starfield/data/InputVertex.cpp b/interface/src/starfield/data/InputVertex.cpp index 28bffb0ec0..ffb7e725fc 100755 --- a/interface/src/starfield/data/InputVertex.cpp +++ b/interface/src/starfield/data/InputVertex.cpp @@ -1,10 +1,12 @@ // -// starfield/data/InputVertex.cpp -// interface +// InputVertex.cpp +// interface/src/starfield/data // -// Created by Chris Barnard on 10/17.13. -// Based on code by Tobias Schwinger 3/29/13. -// Copyright (c) 2013 High Fidelity, Inc. All rights reserved. +// Created by Chris Barnard on 10/17. +// Copyright 2013 High Fidelity, Inc. +// +// Distributed under the Apache License, Version 2.0. +// See the accompanying file LICENSE or http://www.apache.org/licenses/LICENSE-2.0.html // #include "starfield/data/InputVertex.h" diff --git a/interface/src/starfield/renderer/Renderer.cpp b/interface/src/starfield/renderer/Renderer.cpp index 356e46c468..c571cb0977 100755 --- a/interface/src/starfield/renderer/Renderer.cpp +++ b/interface/src/starfield/renderer/Renderer.cpp @@ -1,10 +1,12 @@ // -// starfield/renderer/Renderer.cpp -// interface +// Renderer.cpp +// interface/src/starfield/renderer // // Created by Chris Barnard on 10/17/13. -// Based on earlier work by Tobias Schwinger 3/22/13. -// Copyright (c) 2013 High Fidelity, Inc. All rights reserved. +// Copyright 2013 High Fidelity, Inc. +// +// Distributed under the Apache License, Version 2.0. +// See the accompanying file LICENSE or http://www.apache.org/licenses/LICENSE-2.0.html // #include "starfield/renderer/Renderer.h" diff --git a/interface/src/starfield/renderer/VertexOrder.cpp b/interface/src/starfield/renderer/VertexOrder.cpp index 78f5229f90..baffb81f4e 100755 --- a/interface/src/starfield/renderer/VertexOrder.cpp +++ b/interface/src/starfield/renderer/VertexOrder.cpp @@ -1,11 +1,12 @@ // -// starfield/renderer/VertexOrder.cpp -// interface +// VertexOrder.cpp +// interface/src/starfield/renderer // -// Created by Chris Barnard on 10/17/13. -// Based on code by Tobias Schwinger on 3/22/13. +// Created by Chris Barnard on 10/17/13. +// Copyright 2013 High Fidelity, Inc. // -// Copyright (c) 2013 High Fidelity, Inc. All rights reserved. +// Distributed under the Apache License, Version 2.0. +// See the accompanying file LICENSE or http://www.apache.org/licenses/LICENSE-2.0.html // #include "starfield/renderer/VertexOrder.h" @@ -15,4 +16,4 @@ using namespace starfield; bool VertexOrder::bit(InputVertex const& vertex, state_type const& state) const { unsigned key = _tiling.getTileIndex(vertex.getAzimuth(), vertex.getAltitude()); return base::bit(key, state); -} \ No newline at end of file +} diff --git a/interface/src/ui/BandwidthDialog.cpp b/interface/src/ui/BandwidthDialog.cpp index 8cefc9cf93..3e6d9d876b 100644 --- a/interface/src/ui/BandwidthDialog.cpp +++ b/interface/src/ui/BandwidthDialog.cpp @@ -1,9 +1,12 @@ // -// BandwidthDialog.h -// interface +// BandwidthDialog.cpp +// interface/src/ui // // Created by Tobias Schwinger on 6/21/13. -// Copyright (c) 2013 High Fidelity, Inc. All rights reserved. +// Copyright 2013 High Fidelity, Inc. +// +// Distributed under the Apache License, Version 2.0. +// See the accompanying file LICENSE or http://www.apache.org/licenses/LICENSE-2.0.html // #include diff --git a/interface/src/ui/BandwidthMeter.cpp b/interface/src/ui/BandwidthMeter.cpp index 962e8a857b..3ed66c53e1 100644 --- a/interface/src/ui/BandwidthMeter.cpp +++ b/interface/src/ui/BandwidthMeter.cpp @@ -1,9 +1,12 @@ // -// BandwidthMeter.h -// interface +// BandwidthMeter.cpp +// interface/src/ui // // Created by Tobias Schwinger on 6/20/13. -// Copyright (c) 2013 High Fidelity, Inc. All rights reserved. +// Copyright 2013 High Fidelity, Inc. +// +// Distributed under the Apache License, Version 2.0. +// See the accompanying file LICENSE or http://www.apache.org/licenses/LICENSE-2.0.html // #include diff --git a/interface/src/ui/ChatWindow.cpp b/interface/src/ui/ChatWindow.cpp index b079b56584..0060cb839c 100644 --- a/interface/src/ui/ChatWindow.cpp +++ b/interface/src/ui/ChatWindow.cpp @@ -1,9 +1,12 @@ // // ChatWindow.cpp -// interface +// interface/src/ui // // Created by Dimitar Dobrev on 3/6/14. -// Copyright (c) 2014 High Fidelity, Inc. All rights reserved. +// Copyright 2014 High Fidelity, Inc. +// +// Distributed under the Apache License, Version 2.0. +// See the accompanying file LICENSE or http://www.apache.org/licenses/LICENSE-2.0.html // #include diff --git a/interface/src/ui/ImportDialog.cpp b/interface/src/ui/ImportDialog.cpp index 2741fada0a..67b89773fb 100644 --- a/interface/src/ui/ImportDialog.cpp +++ b/interface/src/ui/ImportDialog.cpp @@ -1,9 +1,12 @@ // // ImportDialog.cpp -// hifi +// interface/src/ui // // Created by Clement Brisset on 8/12/13. -// Copyright (c) 2013 High Fidelity, Inc. All rights reserved. +// Copyright 2013 High Fidelity, Inc. +// +// Distributed under the Apache License, Version 2.0. +// See the accompanying file LICENSE or http://www.apache.org/licenses/LICENSE-2.0.html // #include "InterfaceConfig.h" diff --git a/interface/src/ui/InfoView.cpp b/interface/src/ui/InfoView.cpp index 8ed4da254c..06de3fdf2e 100644 --- a/interface/src/ui/InfoView.cpp +++ b/interface/src/ui/InfoView.cpp @@ -1,9 +1,12 @@ // -// InfoView -// hifi +// InfoView.cpp +// interface/src/ui // // Created by Stojce Slavkovski on 9/7/13. -// Copyright (c) 2013 HighFidelity, Inc. All rights reserved. +// Copyright 2013 High Fidelity, Inc. +// +// Distributed under the Apache License, Version 2.0. +// See the accompanying file LICENSE or http://www.apache.org/licenses/LICENSE-2.0.html // #include "InfoView.h" diff --git a/interface/src/ui/LodToolsDialog.cpp b/interface/src/ui/LodToolsDialog.cpp index 564669757c..35d5eada41 100644 --- a/interface/src/ui/LodToolsDialog.cpp +++ b/interface/src/ui/LodToolsDialog.cpp @@ -1,9 +1,12 @@ // // LodToolsDialog.cpp -// interface +// interface/src/ui // // Created by Brad Hefta-Gaub on 7/19/13. -// Copyright (c) 2013 High Fidelity, Inc. All rights reserved. +// Copyright 2013 High Fidelity, Inc. +// +// Distributed under the Apache License, Version 2.0. +// See the accompanying file LICENSE or http://www.apache.org/licenses/LICENSE-2.0.html // #include diff --git a/interface/src/ui/LogDialog.cpp b/interface/src/ui/LogDialog.cpp index d219c08698..5db704b230 100644 --- a/interface/src/ui/LogDialog.cpp +++ b/interface/src/ui/LogDialog.cpp @@ -1,9 +1,12 @@ // // LogDialog.cpp -// interface +// interface/src/ui // // Created by Stojce Slavkovski on 12/12/13. -// Copyright (c) 2013 High Fidelity, Inc. All rights reserved. +// Copyright 2013 High Fidelity, Inc. +// +// Distributed under the Apache License, Version 2.0. +// See the accompanying file LICENSE or http://www.apache.org/licenses/LICENSE-2.0.html // #include "InterfaceConfig.h" diff --git a/interface/src/ui/MetavoxelEditor.cpp b/interface/src/ui/MetavoxelEditor.cpp index 73a2476aa4..a42c84470b 100644 --- a/interface/src/ui/MetavoxelEditor.cpp +++ b/interface/src/ui/MetavoxelEditor.cpp @@ -1,9 +1,12 @@ // // MetavoxelEditor.cpp -// interface +// interface/src/ui // // Created by Andrzej Kapolka on 1/21/14. -// Copyright (c) 2014 High Fidelity, Inc. All rights reserved. +// Copyright 2014 High Fidelity, Inc. +// +// Distributed under the Apache License, Version 2.0. +// See the accompanying file LICENSE or http://www.apache.org/licenses/LICENSE-2.0.html // // include this before QOpenGLFramebufferObject, which includes an earlier version of OpenGL diff --git a/interface/src/ui/ModelsBrowser.cpp b/interface/src/ui/ModelsBrowser.cpp index 616aba3881..6c421863c8 100644 --- a/interface/src/ui/ModelsBrowser.cpp +++ b/interface/src/ui/ModelsBrowser.cpp @@ -1,9 +1,12 @@ // // ModelsBrowser.cpp -// hifi +// interface/src/ui // // Created by Clement on 3/17/14. -// Copyright (c) 2014 HighFidelity, Inc. All rights reserved. +// Copyright 2014 High Fidelity, Inc. +// +// Distributed under the Apache License, Version 2.0. +// See the accompanying file LICENSE or http://www.apache.org/licenses/LICENSE-2.0.html // #include diff --git a/interface/src/ui/OctreeStatsDialog.cpp b/interface/src/ui/OctreeStatsDialog.cpp index daf5a68587..c56aa0b6ab 100644 --- a/interface/src/ui/OctreeStatsDialog.cpp +++ b/interface/src/ui/OctreeStatsDialog.cpp @@ -1,9 +1,12 @@ // // OctreeStatsDialog.cpp -// interface +// interface/src/ui // // Created by Brad Hefta-Gaub on 7/19/13. -// Copyright (c) 2013 High Fidelity, Inc. All rights reserved. +// Copyright 2013 High Fidelity, Inc. +// +// Distributed under the Apache License, Version 2.0. +// See the accompanying file LICENSE or http://www.apache.org/licenses/LICENSE-2.0.html // #include diff --git a/interface/src/ui/Oscilloscope.cpp b/interface/src/ui/Oscilloscope.cpp index a47586b436..af10539c43 100644 --- a/interface/src/ui/Oscilloscope.cpp +++ b/interface/src/ui/Oscilloscope.cpp @@ -1,9 +1,12 @@ // // Oscilloscope.cpp -// interface +// interface/src/ui // // Created by Philip on 1/28/13. -// Copyright (c) 2013 High Fidelity, Inc. All rights reserved. +// Copyright 2013 High Fidelity, Inc. +// +// Distributed under the Apache License, Version 2.0. +// See the accompanying file LICENSE or http://www.apache.org/licenses/LICENSE-2.0.html // #include diff --git a/interface/src/ui/RearMirrorTools.cpp b/interface/src/ui/RearMirrorTools.cpp index c86770d4f0..e52d59e81a 100644 --- a/interface/src/ui/RearMirrorTools.cpp +++ b/interface/src/ui/RearMirrorTools.cpp @@ -1,9 +1,12 @@ // // RearMirrorTools.cpp -// interface +// interface/src/ui // -// Created by stojce on 23.10.2013. -// Copyright (c) 2013 High Fidelity, Inc. All rights reserved. +// Created by stojce on 23. +// Copyright 2013 High Fidelity, Inc. +// +// Distributed under the Apache License, Version 2.0. +// See the accompanying file LICENSE or http://www.apache.org/licenses/LICENSE-2.0.html // #include "InterfaceConfig.h" diff --git a/interface/src/ui/RunningScriptsWidget.cpp b/interface/src/ui/RunningScriptsWidget.cpp index dcb9210d56..dc9ae7c5f8 100644 --- a/interface/src/ui/RunningScriptsWidget.cpp +++ b/interface/src/ui/RunningScriptsWidget.cpp @@ -1,9 +1,12 @@ // -// RunningScripts.cpp -// interface +// RunningScriptsWidget.cpp +// interface/src/ui // // Created by Mohammed Nafees on 03/28/2014. -// Copyright (c) 2014 High Fidelity, Inc. All rights reserved. +// Copyright 2014 High Fidelity, Inc. +// +// Distributed under the Apache License, Version 2.0. +// See the accompanying file LICENSE or http://www.apache.org/licenses/LICENSE-2.0.html // #include "ui_runningScriptsWidget.h" diff --git a/interface/src/ui/Snapshot.cpp b/interface/src/ui/Snapshot.cpp index a29a96f009..5360924e63 100644 --- a/interface/src/ui/Snapshot.cpp +++ b/interface/src/ui/Snapshot.cpp @@ -1,9 +1,12 @@ // // Snapshot.cpp -// hifi +// interface/src/ui // // Created by Stojce Slavkovski on 1/26/14. -// Copyright (c) 2014 High Fidelity, Inc. All rights reserved. +// Copyright 2014 High Fidelity, Inc. +// +// Distributed under the Apache License, Version 2.0. +// See the accompanying file LICENSE or http://www.apache.org/licenses/LICENSE-2.0.html // #include diff --git a/interface/src/ui/Stats.cpp b/interface/src/ui/Stats.cpp index dbcbb3d8bb..0c4d8a35fd 100644 --- a/interface/src/ui/Stats.cpp +++ b/interface/src/ui/Stats.cpp @@ -1,9 +1,12 @@ // // Stats.cpp -// interface +// interface/src/ui // // Created by Lucas Crisman on 22/03/14. -// Copyright (c) 2013 High Fidelity, Inc. All rights reserved +// Copyright 2013 High Fidelity, Inc. +// +// Distributed under the Apache License, Version 2.0. +// See the accompanying file LICENSE or http://www.apache.org/licenses/LICENSE-2.0.html // #include diff --git a/interface/src/ui/TextRenderer.cpp b/interface/src/ui/TextRenderer.cpp index 06c657e96e..2743e3e572 100644 --- a/interface/src/ui/TextRenderer.cpp +++ b/interface/src/ui/TextRenderer.cpp @@ -1,9 +1,12 @@ // // TextRenderer.cpp -// interface +// interface/src/ui // // Created by Andrzej Kapolka on 4/24/13. -// Copyright (c) 2013 High Fidelity, Inc. All rights reserved. +// Copyright 2013 High Fidelity, Inc. +// +// Distributed under the Apache License, Version 2.0. +// See the accompanying file LICENSE or http://www.apache.org/licenses/LICENSE-2.0.html // #include diff --git a/interface/src/ui/UpdateDialog.cpp b/interface/src/ui/UpdateDialog.cpp index 9919cd0a7b..ace022b683 100644 --- a/interface/src/ui/UpdateDialog.cpp +++ b/interface/src/ui/UpdateDialog.cpp @@ -1,9 +1,11 @@ // // UpdateDialog.cpp -// interface +// interface/src/ui // -// Created by Leonardo Murillo on 1/8/14. -// Copyright (c) 2013, 2014 High Fidelity, Inc. All rights reserved. +// Copyright 2014 High Fidelity, Inc. +// +// Distributed under the Apache License, Version 2.0. +// See the accompanying file LICENSE or http://www.apache.org/licenses/LICENSE-2.0.html // #include "Application.h" // HACK ATTACK WARNING: for windows build to work, we need this ahead of QtGui @@ -49,4 +51,4 @@ void UpdateDialog::handleDownload() { void UpdateDialog::handleSkip() { Application::getInstance()->skipVersion(_latestVersion); this->close(); -} \ No newline at end of file +} diff --git a/interface/src/ui/overlays/Base3DOverlay.cpp b/interface/src/ui/overlays/Base3DOverlay.cpp index bcd2ca1cd2..3500f400ab 100644 --- a/interface/src/ui/overlays/Base3DOverlay.cpp +++ b/interface/src/ui/overlays/Base3DOverlay.cpp @@ -1,8 +1,11 @@ // // Base3DOverlay.cpp -// interface +// interface/src/ui/overlays // -// Copyright (c) 2014 High Fidelity, Inc. All rights reserved. +// Copyright 2014 High Fidelity, Inc. +// +// Distributed under the Apache License, Version 2.0. +// See the accompanying file LICENSE or http://www.apache.org/licenses/LICENSE-2.0.html // // include this before QGLWidget, which includes an earlier version of OpenGL diff --git a/interface/src/ui/overlays/Cube3DOverlay.cpp b/interface/src/ui/overlays/Cube3DOverlay.cpp index 992a18e451..ab9418206f 100644 --- a/interface/src/ui/overlays/Cube3DOverlay.cpp +++ b/interface/src/ui/overlays/Cube3DOverlay.cpp @@ -1,8 +1,11 @@ // // Cube3DOverlay.cpp -// interface +// interface/src/ui/overlays // -// Copyright (c) 2014 High Fidelity, Inc. All rights reserved. +// Copyright 2014 High Fidelity, Inc. +// +// Distributed under the Apache License, Version 2.0. +// See the accompanying file LICENSE or http://www.apache.org/licenses/LICENSE-2.0.html // // include this before QGLWidget, which includes an earlier version of OpenGL diff --git a/interface/src/ui/overlays/ImageOverlay.cpp b/interface/src/ui/overlays/ImageOverlay.cpp index ac5c8ecefa..aa4766488a 100644 --- a/interface/src/ui/overlays/ImageOverlay.cpp +++ b/interface/src/ui/overlays/ImageOverlay.cpp @@ -1,8 +1,11 @@ // // ImageOverlay.cpp -// interface +// interface/src/ui/overlays // -// Copyright (c) 2014 High Fidelity, Inc. All rights reserved. +// Copyright 2014 High Fidelity, Inc. +// +// Distributed under the Apache License, Version 2.0. +// See the accompanying file LICENSE or http://www.apache.org/licenses/LICENSE-2.0.html // // include this before QGLWidget, which includes an earlier version of OpenGL diff --git a/interface/src/ui/overlays/Line3DOverlay.cpp b/interface/src/ui/overlays/Line3DOverlay.cpp index c357233329..6c036a898d 100644 --- a/interface/src/ui/overlays/Line3DOverlay.cpp +++ b/interface/src/ui/overlays/Line3DOverlay.cpp @@ -1,8 +1,11 @@ // // Line3DOverlay.cpp -// interface +// interface/src/ui/overlays // -// Copyright (c) 2014 High Fidelity, Inc. All rights reserved. +// Copyright 2014 High Fidelity, Inc. +// +// Distributed under the Apache License, Version 2.0. +// See the accompanying file LICENSE or http://www.apache.org/licenses/LICENSE-2.0.html // // include this before QGLWidget, which includes an earlier version of OpenGL diff --git a/interface/src/ui/overlays/LocalVoxelsOverlay.cpp b/interface/src/ui/overlays/LocalVoxelsOverlay.cpp index e605f8879d..93736ddccb 100644 --- a/interface/src/ui/overlays/LocalVoxelsOverlay.cpp +++ b/interface/src/ui/overlays/LocalVoxelsOverlay.cpp @@ -1,9 +1,12 @@ // // LocalVoxelsOverlay.cpp -// hifi +// interface/src/ui/overlays // // Created by Clément Brisset on 2/28/14. -// Copyright (c) 2014 High Fidelity, Inc. All rights reserved. +// Copyright 2014 High Fidelity, Inc. +// +// Distributed under the Apache License, Version 2.0. +// See the accompanying file LICENSE or http://www.apache.org/licenses/LICENSE-2.0.html // // include this before QGLWidget, which includes an earlier version of OpenGL diff --git a/interface/src/ui/overlays/Overlay.cpp b/interface/src/ui/overlays/Overlay.cpp index 40da2253f4..3b38addb76 100644 --- a/interface/src/ui/overlays/Overlay.cpp +++ b/interface/src/ui/overlays/Overlay.cpp @@ -1,8 +1,11 @@ // // Overlay.cpp -// interface +// interface/src/ui/overlays // -// Copyright (c) 2014 High Fidelity, Inc. All rights reserved. +// Copyright 2014 High Fidelity, Inc. +// +// Distributed under the Apache License, Version 2.0. +// See the accompanying file LICENSE or http://www.apache.org/licenses/LICENSE-2.0.html // // include this before QGLWidget, which includes an earlier version of OpenGL diff --git a/interface/src/ui/overlays/Overlay2D.cpp b/interface/src/ui/overlays/Overlay2D.cpp index 0c459811c4..0bdb8790cc 100644 --- a/interface/src/ui/overlays/Overlay2D.cpp +++ b/interface/src/ui/overlays/Overlay2D.cpp @@ -1,8 +1,11 @@ // // Overlay2D.cpp -// interface +// interface/src/ui/overlays // -// Copyright (c) 2014 High Fidelity, Inc. All rights reserved. +// Copyright 2014 High Fidelity, Inc. +// +// Distributed under the Apache License, Version 2.0. +// See the accompanying file LICENSE or http://www.apache.org/licenses/LICENSE-2.0.html // // include this before QGLWidget, which includes an earlier version of OpenGL diff --git a/interface/src/ui/overlays/Overlays.cpp b/interface/src/ui/overlays/Overlays.cpp index 0c9415fa73..4eb4f030ac 100644 --- a/interface/src/ui/overlays/Overlays.cpp +++ b/interface/src/ui/overlays/Overlays.cpp @@ -1,8 +1,11 @@ // // Overlays.cpp -// interface +// interface/src/ui/overlays // -// Copyright (c) 2014 High Fidelity, Inc. All rights reserved. +// Copyright 2014 High Fidelity, Inc. +// +// Distributed under the Apache License, Version 2.0. +// See the accompanying file LICENSE or http://www.apache.org/licenses/LICENSE-2.0.html // diff --git a/interface/src/ui/overlays/Sphere3DOverlay.cpp b/interface/src/ui/overlays/Sphere3DOverlay.cpp index 7fded5bedb..e5f31fa1be 100644 --- a/interface/src/ui/overlays/Sphere3DOverlay.cpp +++ b/interface/src/ui/overlays/Sphere3DOverlay.cpp @@ -1,8 +1,11 @@ // // Sphere3DOverlay.cpp -// interface +// interface/src/ui/overlays // -// Copyright (c) 2014 High Fidelity, Inc. All rights reserved. +// Copyright 2014 High Fidelity, Inc. +// +// Distributed under the Apache License, Version 2.0. +// See the accompanying file LICENSE or http://www.apache.org/licenses/LICENSE-2.0.html // // include this before QGLWidget, which includes an earlier version of OpenGL diff --git a/interface/src/ui/overlays/TextOverlay.cpp b/interface/src/ui/overlays/TextOverlay.cpp index 1a6edb3ea2..e26c772b06 100644 --- a/interface/src/ui/overlays/TextOverlay.cpp +++ b/interface/src/ui/overlays/TextOverlay.cpp @@ -1,8 +1,11 @@ // // TextOverlay.cpp -// interface +// interface/src/ui/overlays // -// Copyright (c) 2014 High Fidelity, Inc. All rights reserved. +// Copyright 2014 High Fidelity, Inc. +// +// Distributed under the Apache License, Version 2.0. +// See the accompanying file LICENSE or http://www.apache.org/licenses/LICENSE-2.0.html // // include this before QGLWidget, which includes an earlier version of OpenGL diff --git a/interface/src/ui/overlays/Volume3DOverlay.cpp b/interface/src/ui/overlays/Volume3DOverlay.cpp index dbc1582cc5..ee780d8329 100644 --- a/interface/src/ui/overlays/Volume3DOverlay.cpp +++ b/interface/src/ui/overlays/Volume3DOverlay.cpp @@ -1,8 +1,11 @@ // // Volume3DOverlay.cpp -// interface +// interface/src/ui/overlays // -// Copyright (c) 2014 High Fidelity, Inc. All rights reserved. +// Copyright 2014 High Fidelity, Inc. +// +// Distributed under the Apache License, Version 2.0. +// See the accompanying file LICENSE or http://www.apache.org/licenses/LICENSE-2.0.html // // include this before QGLWidget, which includes an earlier version of OpenGL diff --git a/interface/src/voxels/PrimitiveRenderer.cpp b/interface/src/voxels/PrimitiveRenderer.cpp index 7f3607e363..a212245289 100644 --- a/interface/src/voxels/PrimitiveRenderer.cpp +++ b/interface/src/voxels/PrimitiveRenderer.cpp @@ -1,10 +1,12 @@ -/// -/// @file PrimitiveRenderer.cpp -/// A geometric primitive renderer. -/// -/// @author: Norman Crafts -/// @copyright 2014, High Fidelity, Inc. All rights reserved. -/// +// +// PrimitiveRenderer.cpp +// interface/src/voxels +// +// Copyright 2014 High Fidelity, Inc. +// +// Distributed under the Apache License, Version 2.0. +// See the accompanying file LICENSE or http://www.apache.org/licenses/LICENSE-2.0.html +// #include @@ -737,4 +739,4 @@ unsigned long PrimitiveRenderer::vGetMemoryUsage() { unsigned long PrimitiveRenderer::vGetMemoryUsageGPU() { return _gpuMemoryUsage; -} \ No newline at end of file +} diff --git a/interface/src/voxels/VoxelFade.cpp b/interface/src/voxels/VoxelFade.cpp index 8ce68c9724..c720717d7c 100644 --- a/interface/src/voxels/VoxelFade.cpp +++ b/interface/src/voxels/VoxelFade.cpp @@ -1,9 +1,12 @@ // // VoxelFade.cpp -// interface +// interface/src/voxels // // Created by Brad Hefta-Gaub on 8/6/13. -// Copyright (c) 2013 High Fidelity, Inc. All rights reserved. +// Copyright 2013 High Fidelity, Inc. +// +// Distributed under the Apache License, Version 2.0. +// See the accompanying file LICENSE or http://www.apache.org/licenses/LICENSE-2.0.html // #include "InterfaceConfig.h" diff --git a/interface/src/voxels/VoxelHideShowThread.cpp b/interface/src/voxels/VoxelHideShowThread.cpp index d7a25b4b6d..089da0d1da 100644 --- a/interface/src/voxels/VoxelHideShowThread.cpp +++ b/interface/src/voxels/VoxelHideShowThread.cpp @@ -1,11 +1,12 @@ // // VoxelHideShowThread.cpp -// interface +// interface/src/voxels // -// Created by Brad Hefta-Gaub on 12/1/13 -// Copyright (c) 2013 High Fidelity, Inc. All rights reserved. +// Created by Brad Hefta-Gaub on 12/1/13. +// Copyright 2013 High Fidelity, Inc. // -// Threaded or non-threaded interface thread for hiding and showing voxels in the local tree. +// Distributed under the Apache License, Version 2.0. +// See the accompanying file LICENSE or http://www.apache.org/licenses/LICENSE-2.0.html // #include diff --git a/interface/src/voxels/VoxelImporter.cpp b/interface/src/voxels/VoxelImporter.cpp index d3c1b259ae..f7d5562c06 100644 --- a/interface/src/voxels/VoxelImporter.cpp +++ b/interface/src/voxels/VoxelImporter.cpp @@ -1,9 +1,12 @@ // // VoxelImporter.cpp -// hifi +// interface/src/voxels // // Created by Clement Brisset on 8/9/13. -// Copyright (c) 2013 High Fidelity, Inc. All rights reserved. +// Copyright 2013 High Fidelity, Inc. +// +// Distributed under the Apache License, Version 2.0. +// See the accompanying file LICENSE or http://www.apache.org/licenses/LICENSE-2.0.html // // include this before QGLWidget, which includes an earlier version of OpenGL diff --git a/interface/src/voxels/VoxelPacketProcessor.cpp b/interface/src/voxels/VoxelPacketProcessor.cpp index 142285664e..d9d001b644 100644 --- a/interface/src/voxels/VoxelPacketProcessor.cpp +++ b/interface/src/voxels/VoxelPacketProcessor.cpp @@ -1,11 +1,12 @@ // // VoxelPacketProcessor.cpp -// interface +// interface/src/voxels // // Created by Brad Hefta-Gaub on 8/12/13. -// Copyright (c) 2013 High Fidelity, Inc. All rights reserved. +// Copyright 2013 High Fidelity, Inc. // -// Threaded or non-threaded voxel packet receiver for the Application +// Distributed under the Apache License, Version 2.0. +// See the accompanying file LICENSE or http://www.apache.org/licenses/LICENSE-2.0.html // #include diff --git a/interface/src/voxels/VoxelSystem.cpp b/interface/src/voxels/VoxelSystem.cpp index bb907c8a9a..692f299bdc 100644 --- a/interface/src/voxels/VoxelSystem.cpp +++ b/interface/src/voxels/VoxelSystem.cpp @@ -1,8 +1,12 @@ // // VoxelSystem.cpp +// interface/src/voxels // // Created by Philip on 12/31/12. -// Copyright (c) 2012 High Fidelity, Inc. All rights reserved. +// Copyright 2012 High Fidelity, Inc. +// +// Distributed under the Apache License, Version 2.0. +// See the accompanying file LICENSE or http://www.apache.org/licenses/LICENSE-2.0.html // diff --git a/libraries/audio/src/AudioInjector.cpp b/libraries/audio/src/AudioInjector.cpp index 7f0e5c7f1a..6370e51826 100644 --- a/libraries/audio/src/AudioInjector.cpp +++ b/libraries/audio/src/AudioInjector.cpp @@ -1,9 +1,12 @@ // // AudioInjector.cpp -// hifi +// libraries/audio/src // // Created by Stephen Birarda on 1/2/2014. -// Copyright (c) 2014 HighFidelity, Inc. All rights reserved. +// Copyright 2014 High Fidelity, Inc. +// +// Distributed under the Apache License, Version 2.0. +// See the accompanying file LICENSE or http://www.apache.org/licenses/LICENSE-2.0.html // #include diff --git a/libraries/audio/src/AudioInjectorOptions.cpp b/libraries/audio/src/AudioInjectorOptions.cpp index 30e8c3e490..cd6b08f6c7 100644 --- a/libraries/audio/src/AudioInjectorOptions.cpp +++ b/libraries/audio/src/AudioInjectorOptions.cpp @@ -1,9 +1,12 @@ // // AudioInjectorOptions.cpp -// hifi +// libraries/audio/src // // Created by Stephen Birarda on 1/2/2014. -// Copyright (c) 2014 HighFidelity, Inc. All rights reserved. +// Copyright 2014 High Fidelity, Inc. +// +// Distributed under the Apache License, Version 2.0. +// See the accompanying file LICENSE or http://www.apache.org/licenses/LICENSE-2.0.html // #include "AudioInjectorOptions.h" @@ -23,4 +26,4 @@ AudioInjectorOptions::AudioInjectorOptions(const AudioInjectorOptions& other) { _volume = other._volume; _orientation = other._orientation; _loopbackAudioInterface = other._loopbackAudioInterface; -} \ No newline at end of file +} diff --git a/libraries/audio/src/AudioRingBuffer.cpp b/libraries/audio/src/AudioRingBuffer.cpp index 376b60ffa1..603a8c89ac 100644 --- a/libraries/audio/src/AudioRingBuffer.cpp +++ b/libraries/audio/src/AudioRingBuffer.cpp @@ -1,9 +1,12 @@ // // AudioRingBuffer.cpp -// interface +// libraries/audio/src // // Created by Stephen Birarda on 2/1/13. -// Copyright (c) 2013 HighFidelity, Inc. All rights reserved. +// Copyright 2013 High Fidelity, Inc. +// +// Distributed under the Apache License, Version 2.0. +// See the accompanying file LICENSE or http://www.apache.org/licenses/LICENSE-2.0.html // #include diff --git a/libraries/audio/src/AudioScriptingInterface.cpp b/libraries/audio/src/AudioScriptingInterface.cpp index 1fe2c19922..0d76a42757 100644 --- a/libraries/audio/src/AudioScriptingInterface.cpp +++ b/libraries/audio/src/AudioScriptingInterface.cpp @@ -1,9 +1,12 @@ // // AudioScriptingInterface.cpp -// hifi +// libraries/audio/src // // Created by Stephen Birarda on 1/2/2014. -// Copyright (c) 2014 HighFidelity, Inc. All rights reserved. +// Copyright 2014 High Fidelity, Inc. +// +// Distributed under the Apache License, Version 2.0. +// See the accompanying file LICENSE or http://www.apache.org/licenses/LICENSE-2.0.html // #include "AudioScriptingInterface.h" diff --git a/libraries/audio/src/InjectedAudioRingBuffer.cpp b/libraries/audio/src/InjectedAudioRingBuffer.cpp index f8205a846f..2658b4c336 100644 --- a/libraries/audio/src/InjectedAudioRingBuffer.cpp +++ b/libraries/audio/src/InjectedAudioRingBuffer.cpp @@ -1,9 +1,12 @@ // // InjectedAudioRingBuffer.cpp -// hifi +// libraries/audio/src // // Created by Stephen Birarda on 6/5/13. -// Copyright (c) 2013 HighFidelity, Inc. All rights reserved. +// Copyright 2013 High Fidelity, Inc. +// +// Distributed under the Apache License, Version 2.0. +// See the accompanying file LICENSE or http://www.apache.org/licenses/LICENSE-2.0.html // #include diff --git a/libraries/audio/src/MixedAudioRingBuffer.cpp b/libraries/audio/src/MixedAudioRingBuffer.cpp index 0ffab23519..c975d7b68e 100644 --- a/libraries/audio/src/MixedAudioRingBuffer.cpp +++ b/libraries/audio/src/MixedAudioRingBuffer.cpp @@ -1,9 +1,12 @@ // // MixedAudioRingBuffer.cpp -// hifi +// libraries/audio/src // -// Created by Stephen Birarda on 2014-03-26. -// Copyright (c) 2014 HighFidelity, Inc. All rights reserved. +// Created by Stephen Birarda on 2014. +// Copyright 2014 High Fidelity, Inc. +// +// Distributed under the Apache License, Version 2.0. +// See the accompanying file LICENSE or http://www.apache.org/licenses/LICENSE-2.0.html // #include "MixedAudioRingBuffer.h" @@ -46,4 +49,4 @@ qint64 MixedAudioRingBuffer::readSamples(int16_t* destination, qint64 maxSamples _lastReadFrameAverageLoudness = averageLoudness; return AudioRingBuffer::readSamples(destination, maxSamples); -} \ No newline at end of file +} diff --git a/libraries/audio/src/PositionalAudioRingBuffer.cpp b/libraries/audio/src/PositionalAudioRingBuffer.cpp index 7bdedfc793..70da363267 100644 --- a/libraries/audio/src/PositionalAudioRingBuffer.cpp +++ b/libraries/audio/src/PositionalAudioRingBuffer.cpp @@ -1,9 +1,12 @@ // // PositionalAudioRingBuffer.cpp -// hifi +// libraries/audio/src // // Created by Stephen Birarda on 6/5/13. -// Copyright (c) 2013 HighFidelity, Inc. All rights reserved. +// Copyright 2013 High Fidelity, Inc. +// +// Distributed under the Apache License, Version 2.0. +// See the accompanying file LICENSE or http://www.apache.org/licenses/LICENSE-2.0.html // #include diff --git a/libraries/audio/src/Sound.cpp b/libraries/audio/src/Sound.cpp index 91a47b7d2c..4e657f3302 100644 --- a/libraries/audio/src/Sound.cpp +++ b/libraries/audio/src/Sound.cpp @@ -1,155 +1,12 @@ // // Sound.cpp -// hifi +// libraries/audio/src // // Created by Stephen Birarda on 1/2/2014. -// Modified by Athanasios Gaitatzes to add WAVE file support. -// Copyright (c) 2014 HighFidelity, Inc. All rights reserved. +// Copyright 2014 High Fidelity, Inc. // - -#include - -#include - -#include -#include -#include -#include -#include -#include - -#include - -#include "AudioRingBuffer.h" -#include "Sound.h" - -// procedural audio version of Sound -Sound::Sound(float volume, float frequency, float duration, float decay, QObject* parent) : - QObject(parent) -{ - static char monoAudioData[MAX_PACKET_SIZE]; - static int16_t* monoAudioSamples = (int16_t*)(monoAudioData); - - float t; - const float AUDIO_CALLBACK_MSECS = (float) NETWORK_BUFFER_LENGTH_SAMPLES_PER_CHANNEL / (float)SAMPLE_RATE * 1000.0; - const float MAX_VOLUME = 32000.f; - const float MAX_DURATION = 2.f; - const float MIN_AUDIBLE_VOLUME = 0.001f; - const float NOISE_MAGNITUDE = 0.02f; - const int MAX_SAMPLE_VALUE = std::numeric_limits::max(); - const int MIN_SAMPLE_VALUE = std::numeric_limits::min(); - int numSamples = NETWORK_BUFFER_LENGTH_SAMPLES_PER_CHANNEL; // we add sounds in chunks of this many samples - - int chunkStartingSample = 0; - float waveFrequency = (frequency / SAMPLE_RATE) * TWO_PI; - while (volume > 0.f) { - for (int i = 0; i < numSamples; i++) { - t = (float)chunkStartingSample + (float)i; - float sample = sinf(t * waveFrequency); - sample += ((randFloat() - 0.5f) * NOISE_MAGNITUDE); - sample *= volume * MAX_VOLUME; - - monoAudioSamples[i] = glm::clamp((int)sample, MIN_SAMPLE_VALUE, MAX_SAMPLE_VALUE); - volume *= (1.f - decay); - } - // add the monoAudioSamples to our actual output Byte Array - _byteArray.append(monoAudioData, numSamples * sizeof(int16_t)); - chunkStartingSample += numSamples; - duration = glm::clamp(duration - (AUDIO_CALLBACK_MSECS / 1000.f), 0.f, MAX_DURATION); - //qDebug() << "decaying... _duration=" << _duration; - if (duration == 0.f || (volume < MIN_AUDIBLE_VOLUME)) { - volume = 0.f; - } - } -} - -Sound::Sound(const QUrl& sampleURL, QObject* parent) : - QObject(parent) -{ - // assume we have a QApplication or QCoreApplication instance and use the - // QNetworkAccess manager to grab the raw audio file at the given URL - - QNetworkAccessManager *manager = new QNetworkAccessManager(this); - connect(manager, SIGNAL(finished(QNetworkReply*)), - this, SLOT(replyFinished(QNetworkReply*))); - - qDebug() << "Requesting audio file" << sampleURL.toDisplayString(); - manager->get(QNetworkRequest(sampleURL)); -} - -void Sound::replyFinished(QNetworkReply* reply) { - - // replace our byte array with the downloaded data - QByteArray rawAudioByteArray = reply->readAll(); - - // foreach(QByteArray b, reply->rawHeaderList()) - // qDebug() << b.constData() << ": " << reply->rawHeader(b).constData(); - - if (reply->hasRawHeader("Content-Type")) { - - QByteArray headerContentType = reply->rawHeader("Content-Type"); - - // WAV audio file encountered - if (headerContentType == "audio/x-wav" - || headerContentType == "audio/wav" - || headerContentType == "audio/wave") { - - QByteArray outputAudioByteArray; - - interpretAsWav(rawAudioByteArray, outputAudioByteArray); - downSample(outputAudioByteArray); - } else { - // Process as RAW file - downSample(rawAudioByteArray); - } - } else { - qDebug() << "Network reply without 'Content-Type'."; - } -} - -void Sound::downSample(const QByteArray& rawAudioByteArray) { - - // assume that this was a RAW file and is now an array of samples that are - // signed, 16-bit, 48Khz, mono - - // we want to convert it to the format that the audio-mixer wants - // which is signed, 16-bit, 24Khz, mono - - _byteArray.resize(rawAudioByteArray.size() / 2); - - int numSourceSamples = rawAudioByteArray.size() / sizeof(int16_t); - int16_t* sourceSamples = (int16_t*) rawAudioByteArray.data(); - int16_t* destinationSamples = (int16_t*) _byteArray.data(); - - for (int i = 1; i < numSourceSamples; i += 2) { - if (i + 1 >= numSourceSamples) { - destinationSamples[(i - 1) / 2] = (sourceSamples[i - 1] / 2) + (sourceSamples[i] / 2); - } else { - destinationSamples[(i - 1) / 2] = (sourceSamples[i - 1] / 4) + (sourceSamples[i] / 2) + (sourceSamples[i + 1] / 4); - } - } -} - -// -// Format description from https://ccrma.stanford.edu/courses/422/projects/WaveFormat/ -// -// The header for a WAV file looks like this: -// Positions Sample Value Description -// 00-03 "RIFF" Marks the file as a riff file. Characters are each 1 byte long. -// 04-07 File size (int) Size of the overall file - 8 bytes, in bytes (32-bit integer). -// 08-11 "WAVE" File Type Header. For our purposes, it always equals "WAVE". -// 12-15 "fmt " Format chunk marker. -// 16-19 16 Length of format data as listed above -// 20-21 1 Type of format: (1=PCM, 257=Mu-Law, 258=A-Law, 259=ADPCM) - 2 byte integer -// 22-23 2 Number of Channels - 2 byte integer -// 24-27 44100 Sample Rate - 32 byte integer. Sample Rate = Number of Samples per second, or Hertz. -// 28-31 176400 (Sample Rate * BitsPerSample * Channels) / 8. -// 32-33 4 (BitsPerSample * Channels) / 8 - 8 bit mono2 - 8 bit stereo/16 bit mono4 - 16 bit stereo -// 34-35 16 Bits per sample -// 36-39 "data" Chunk header. Marks the beginning of the data section. -// 40-43 File size (int) Size of the data section. -// 44-?? Actual sound data -// Sample values are given above for a 16-bit stereo source. +// Distributed under the Apache License, Version 2.0. +// See the accompanying file LICENSE or http://www.apache.org/licenses/LICENSE-2.0.html // struct chunk diff --git a/libraries/avatars/src/AvatarData.cpp b/libraries/avatars/src/AvatarData.cpp index e84636b5a4..606df649a4 100644 --- a/libraries/avatars/src/AvatarData.cpp +++ b/libraries/avatars/src/AvatarData.cpp @@ -1,9 +1,12 @@ // // AvatarData.cpp -// hifi +// libraries/avatars/src // // Created by Stephen Birarda on 4/9/13. -// Copyright (c) 2013 High Fidelity, Inc. All rights reserved. +// Copyright 2013 High Fidelity, Inc. +// +// Distributed under the Apache License, Version 2.0. +// See the accompanying file LICENSE or http://www.apache.org/licenses/LICENSE-2.0.html // #include diff --git a/libraries/avatars/src/AvatarHashMap.cpp b/libraries/avatars/src/AvatarHashMap.cpp index 82485691c5..27dc1bf0bb 100644 --- a/libraries/avatars/src/AvatarHashMap.cpp +++ b/libraries/avatars/src/AvatarHashMap.cpp @@ -1,9 +1,12 @@ // // AvatarHashMap.cpp -// hifi +// libraries/avatars/src // // Created by AndrewMeadows on 1/28/2014. -// Copyright (c) 2014 HighFidelity, Inc. All rights reserved. +// Copyright 2014 High Fidelity, Inc. +// +// Distributed under the Apache License, Version 2.0. +// See the accompanying file LICENSE or http://www.apache.org/licenses/LICENSE-2.0.html // #include "AvatarHashMap.h" diff --git a/libraries/avatars/src/HandData.cpp b/libraries/avatars/src/HandData.cpp index 201d17d3f5..c2e3b51cb3 100644 --- a/libraries/avatars/src/HandData.cpp +++ b/libraries/avatars/src/HandData.cpp @@ -1,9 +1,12 @@ // // HandData.cpp -// hifi +// libraries/avatars/src // // Created by Stephen Birarda on 5/20/13. -// Copyright (c) 2013 High Fidelity, Inc. All rights reserved. +// Copyright 2013 High Fidelity, Inc. +// +// Distributed under the Apache License, Version 2.0. +// See the accompanying file LICENSE or http://www.apache.org/licenses/LICENSE-2.0.html // #include diff --git a/libraries/avatars/src/HeadData.cpp b/libraries/avatars/src/HeadData.cpp index e74ac043fb..c691a2c28a 100644 --- a/libraries/avatars/src/HeadData.cpp +++ b/libraries/avatars/src/HeadData.cpp @@ -1,9 +1,12 @@ // // HeadData.cpp -// hifi +// libraries/avatars/src // // Created by Stephen Birarda on 5/20/13. -// Copyright (c) 2013 High Fidelity, Inc. All rights reserved. +// Copyright 2013 High Fidelity, Inc. +// +// Distributed under the Apache License, Version 2.0. +// See the accompanying file LICENSE or http://www.apache.org/licenses/LICENSE-2.0.html // #include diff --git a/libraries/embedded-webserver/src/HTTPConnection.cpp b/libraries/embedded-webserver/src/HTTPConnection.cpp index 8fc0a25dca..276b4e7f64 100755 --- a/libraries/embedded-webserver/src/HTTPConnection.cpp +++ b/libraries/embedded-webserver/src/HTTPConnection.cpp @@ -1,9 +1,12 @@ // // HTTPConnection.cpp -// hifi +// libraries/embedded-webserver/src // // Created by Stephen Birarda on 1/16/14. -// Copyright (c) 2014 HighFidelity, Inc. All rights reserved. +// Copyright 2014 High Fidelity, Inc. +// +// Distributed under the Apache License, Version 2.0. +// See the accompanying file LICENSE or http://www.apache.org/licenses/LICENSE-2.0.html // diff --git a/libraries/embedded-webserver/src/HTTPManager.cpp b/libraries/embedded-webserver/src/HTTPManager.cpp index d106b6df59..1fc859014a 100755 --- a/libraries/embedded-webserver/src/HTTPManager.cpp +++ b/libraries/embedded-webserver/src/HTTPManager.cpp @@ -1,9 +1,12 @@ // // HTTPManager.cpp -// hifi +// libraries/embedded-webserver/src // // Created by Stephen Birarda on 1/16/14. -// Copyright (c) 2014 HighFidelity, Inc. All rights reserved. +// Copyright 2014 High Fidelity, Inc. +// +// Distributed under the Apache License, Version 2.0. +// See the accompanying file LICENSE or http://www.apache.org/licenses/LICENSE-2.0.html // #include diff --git a/libraries/metavoxels/src/AttributeRegistry.cpp b/libraries/metavoxels/src/AttributeRegistry.cpp index 8914a9e3c9..e7a7f41850 100644 --- a/libraries/metavoxels/src/AttributeRegistry.cpp +++ b/libraries/metavoxels/src/AttributeRegistry.cpp @@ -1,9 +1,12 @@ // // AttributeRegistry.cpp -// metavoxels +// libraries/metavoxels/src // // Created by Andrzej Kapolka on 12/6/13. -// Copyright (c) 2013 High Fidelity, Inc. All rights reserved. +// Copyright 2013 High Fidelity, Inc. +// +// Distributed under the Apache License, Version 2.0. +// See the accompanying file LICENSE or http://www.apache.org/licenses/LICENSE-2.0.html // #include diff --git a/libraries/metavoxels/src/Bitstream.cpp b/libraries/metavoxels/src/Bitstream.cpp index 3f3d6e5423..ad929e533c 100644 --- a/libraries/metavoxels/src/Bitstream.cpp +++ b/libraries/metavoxels/src/Bitstream.cpp @@ -1,9 +1,12 @@ // // Bitstream.cpp -// metavoxels +// libraries/metavoxels/src // // Created by Andrzej Kapolka on 12/2/13. -// Copyright (c) 2013 High Fidelity, Inc. All rights reserved. +// Copyright 2013 High Fidelity, Inc. +// +// Distributed under the Apache License, Version 2.0. +// See the accompanying file LICENSE or http://www.apache.org/licenses/LICENSE-2.0.html // #include diff --git a/libraries/metavoxels/src/DatagramSequencer.cpp b/libraries/metavoxels/src/DatagramSequencer.cpp index 5c605dc0f4..9fadef8afc 100644 --- a/libraries/metavoxels/src/DatagramSequencer.cpp +++ b/libraries/metavoxels/src/DatagramSequencer.cpp @@ -1,9 +1,12 @@ // // DatagramSequencer.cpp -// metavoxels +// libraries/metavoxels/src // // Created by Andrzej Kapolka on 12/20/13. -// Copyright (c) 2013 High Fidelity, Inc. All rights reserved. +// Copyright 2013 High Fidelity, Inc. +// +// Distributed under the Apache License, Version 2.0. +// See the accompanying file LICENSE or http://www.apache.org/licenses/LICENSE-2.0.html // #include diff --git a/libraries/metavoxels/src/MetavoxelData.cpp b/libraries/metavoxels/src/MetavoxelData.cpp index 6ae847cea3..0d52fc5ed6 100644 --- a/libraries/metavoxels/src/MetavoxelData.cpp +++ b/libraries/metavoxels/src/MetavoxelData.cpp @@ -1,9 +1,12 @@ // // MetavoxelData.cpp -// metavoxels +// libraries/metavoxels/src // // Created by Andrzej Kapolka on 12/6/13. -// Copyright (c) 2013 High Fidelity, Inc. All rights reserved. +// Copyright 2013 High Fidelity, Inc. +// +// Distributed under the Apache License, Version 2.0. +// See the accompanying file LICENSE or http://www.apache.org/licenses/LICENSE-2.0.html // #include diff --git a/libraries/metavoxels/src/MetavoxelMessages.cpp b/libraries/metavoxels/src/MetavoxelMessages.cpp index c930688cbd..dba9bc9c5c 100644 --- a/libraries/metavoxels/src/MetavoxelMessages.cpp +++ b/libraries/metavoxels/src/MetavoxelMessages.cpp @@ -1,9 +1,12 @@ // // MetavoxelMessages.cpp -// metavoxels +// libraries/metavoxels/src // // Created by Andrzej Kapolka on 1/24/14. -// Copyright (c) 2014 High Fidelity, Inc. All rights reserved. +// Copyright 2014 High Fidelity, Inc. +// +// Distributed under the Apache License, Version 2.0. +// See the accompanying file LICENSE or http://www.apache.org/licenses/LICENSE-2.0.html // #include "MetavoxelMessages.h" diff --git a/libraries/metavoxels/src/MetavoxelUtil.cpp b/libraries/metavoxels/src/MetavoxelUtil.cpp index 2ec1c3cb57..f2f434b24d 100644 --- a/libraries/metavoxels/src/MetavoxelUtil.cpp +++ b/libraries/metavoxels/src/MetavoxelUtil.cpp @@ -1,9 +1,12 @@ // // MetavoxelUtil.cpp -// metavoxels +// libraries/metavoxels/src // // Created by Andrzej Kapolka on 12/30/13. -// Copyright (c) 2013 High Fidelity, Inc. All rights reserved. +// Copyright 2013 High Fidelity, Inc. +// +// Distributed under the Apache License, Version 2.0. +// See the accompanying file LICENSE or http://www.apache.org/licenses/LICENSE-2.0.html // #include diff --git a/libraries/metavoxels/src/ScriptCache.cpp b/libraries/metavoxels/src/ScriptCache.cpp index cabf075563..dd090613b7 100644 --- a/libraries/metavoxels/src/ScriptCache.cpp +++ b/libraries/metavoxels/src/ScriptCache.cpp @@ -1,9 +1,12 @@ // // ScriptCache.cpp -// metavoxels +// libraries/metavoxels/src // // Created by Andrzej Kapolka on 2/4/14. -// Copyright (c) 2014 High Fidelity, Inc. All rights reserved. +// Copyright 2014 High Fidelity, Inc. +// +// Distributed under the Apache License, Version 2.0. +// See the accompanying file LICENSE or http://www.apache.org/licenses/LICENSE-2.0.html // #include diff --git a/libraries/metavoxels/src/SharedObject.cpp b/libraries/metavoxels/src/SharedObject.cpp index 64ea48e016..b578d70959 100644 --- a/libraries/metavoxels/src/SharedObject.cpp +++ b/libraries/metavoxels/src/SharedObject.cpp @@ -1,9 +1,12 @@ // // SharedObject.cpp -// metavoxels +// libraries/metavoxels/src // // Created by Andrzej Kapolka on 2/5/14. -// Copyright (c) 2014 High Fidelity, Inc. All rights reserved. +// Copyright 2014 High Fidelity, Inc. +// +// Distributed under the Apache License, Version 2.0. +// See the accompanying file LICENSE or http://www.apache.org/licenses/LICENSE-2.0.html // #include diff --git a/libraries/octree/src/AABox.cpp b/libraries/octree/src/AABox.cpp index 97fd706c21..51b31d4466 100644 --- a/libraries/octree/src/AABox.cpp +++ b/libraries/octree/src/AABox.cpp @@ -1,11 +1,12 @@ // -// AABox.h - Axis Aligned Boxes -// hifi +// AABox.cpp +// libraries/octree/src // -// Added by Brad Hefta-Gaub on 04/11/13. -// Originally from lighthouse3d. Modified to utilize glm::vec3 and clean up to our coding standards +// Created by Brad Hefta-Gaub on 04/11/13. +// Copyright 2013 High Fidelity, Inc. // -// Simple axis aligned box class. +// Distributed under the Apache License, Version 2.0. +// See the accompanying file LICENSE or http://www.apache.org/licenses/LICENSE-2.0.html // #include "SharedUtil.h" diff --git a/libraries/octree/src/CoverageMap.cpp b/libraries/octree/src/CoverageMap.cpp index a7717b8107..88d2292812 100644 --- a/libraries/octree/src/CoverageMap.cpp +++ b/libraries/octree/src/CoverageMap.cpp @@ -1,44 +1,12 @@ // -// CoverageMap.cpp - -// hifi +// CoverageMap.cpp +// libraries/octree/src // -// Added by Brad Hefta-Gaub on 06/11/13. -// Copyright (c) 2013 High Fidelity, Inc. All rights reserved. +// Created by Brad Hefta-Gaub on 06/11/13. +// Copyright 2013 High Fidelity, Inc. // - -#include - -#include - -#include - -#include "CoverageMap.h" - -int CoverageMap::_mapCount = 0; -int CoverageMap::_checkMapRootCalls = 0; -int CoverageMap::_notAllInView = 0; -bool CoverageMap::wantDebugging = false; - -const int MAX_POLYGONS_PER_REGION = 50; - -const BoundingBox CoverageMap::ROOT_BOUNDING_BOX = BoundingBox(glm::vec2(-1.f,-1.f), glm::vec2(2.f,2.f)); - -// Coverage Map's polygon coordinates are from -1 to 1 in the following mapping to screen space. -// -// (0,0) (windowWidth, 0) -// -1,1 1,1 -// +-----------------------+ -// | | | -// | | | -// | -1,0 | | -// |-----------+-----------| -// | 0,0 | -// | | | -// | | | -// | | | -// +-----------------------+ -// -1,-1 1,-1 -// (0,windowHeight) (windowWidth,windowHeight) +// Distributed under the Apache License, Version 2.0. +// See the accompanying file LICENSE or http://www.apache.org/licenses/LICENSE-2.0.html // // Choosing a minimum sized polygon. Since we know a typical window is approximately 1500 pixels wide diff --git a/libraries/octree/src/CoverageMapV2.cpp b/libraries/octree/src/CoverageMapV2.cpp index afb341fcba..6535066eed 100644 --- a/libraries/octree/src/CoverageMapV2.cpp +++ b/libraries/octree/src/CoverageMapV2.cpp @@ -1,43 +1,12 @@ // -// CoverageMapV2.cpp - -// hifi +// CoverageMapV2.cpp +// libraries/octree/src // -// Added by Brad Hefta-Gaub on 06/11/13. -// Copyright (c) 2013 High Fidelity, Inc. All rights reserved. +// Created by Brad Hefta-Gaub on 06/11/13. +// Copyright 2013 High Fidelity, Inc. // - -#include -#include - -#include - -#include - -#include "CoverageMapV2.h" - -int CoverageMapV2::_mapCount = 0; -int CoverageMapV2::_checkMapRootCalls = 0; -int CoverageMapV2::_notAllInView = 0; -bool CoverageMapV2::wantDebugging = false; - -const BoundingBox CoverageMapV2::ROOT_BOUNDING_BOX = BoundingBox(glm::vec2(-1.f,-1.f), glm::vec2(2.f,2.f)); - -// Coverage Map's polygon coordinates are from -1 to 1 in the following mapping to screen space. -// -// (0,0) (windowWidth, 0) -// -1,1 1,1 -// +-----------------------+ -// | | | -// | | | -// | -1,0 | | -// |-----------+-----------| -// | 0,0 | -// | | | -// | | | -// | | | -// +-----------------------+ -// -1,-1 1,-1 -// (0,windowHeight) (windowWidth,windowHeight) +// Distributed under the Apache License, Version 2.0. +// See the accompanying file LICENSE or http://www.apache.org/licenses/LICENSE-2.0.html // // Choosing a minimum sized polygon. Since we know a typical window is approximately 1500 pixels wide @@ -245,4 +214,4 @@ void CoverageMapV2::recurseMap(const OctreeProjectedPolygon* polygon, bool store } // normal exit case... return... -} \ No newline at end of file +} diff --git a/libraries/octree/src/JurisdictionListener.cpp b/libraries/octree/src/JurisdictionListener.cpp index c280b48c99..453ff10a42 100644 --- a/libraries/octree/src/JurisdictionListener.cpp +++ b/libraries/octree/src/JurisdictionListener.cpp @@ -1,11 +1,12 @@ // // JurisdictionListener.cpp -// shared +// libraries/octree/src // // Created by Brad Hefta-Gaub on 8/12/13. -// Copyright (c) 2013 High Fidelity, Inc. All rights reserved. +// Copyright 2013 High Fidelity, Inc. // -// Threaded or non-threaded jurisdiction Sender for the Application +// Distributed under the Apache License, Version 2.0. +// See the accompanying file LICENSE or http://www.apache.org/licenses/LICENSE-2.0.html // #include diff --git a/libraries/octree/src/JurisdictionMap.cpp b/libraries/octree/src/JurisdictionMap.cpp index 0271c77012..747a05e90a 100644 --- a/libraries/octree/src/JurisdictionMap.cpp +++ b/libraries/octree/src/JurisdictionMap.cpp @@ -1,9 +1,12 @@ // // JurisdictionMap.cpp -// hifi +// libraries/octree/src // // Created by Brad Hefta-Gaub on 8/1/13. -// Copyright (c) 2013 High Fidelity, Inc. All rights reserved. +// Copyright 2013 High Fidelity, Inc. +// +// Distributed under the Apache License, Version 2.0. +// See the accompanying file LICENSE or http://www.apache.org/licenses/LICENSE-2.0.html // #include diff --git a/libraries/octree/src/JurisdictionSender.cpp b/libraries/octree/src/JurisdictionSender.cpp index 1d26e4a53a..c151999305 100644 --- a/libraries/octree/src/JurisdictionSender.cpp +++ b/libraries/octree/src/JurisdictionSender.cpp @@ -1,11 +1,12 @@ // // JurisdictionSender.cpp -// shared +// libraries/octree/src // // Created by Brad Hefta-Gaub on 8/12/13. -// Copyright (c) 2013 High Fidelity, Inc. All rights reserved. +// Copyright 2013 High Fidelity, Inc. // -// Threaded or non-threaded jurisdiction Sender for the Application +// Distributed under the Apache License, Version 2.0. +// See the accompanying file LICENSE or http://www.apache.org/licenses/LICENSE-2.0.html // #include diff --git a/libraries/octree/src/Octree.cpp b/libraries/octree/src/Octree.cpp index 58cfd9b15d..696a65b4b5 100644 --- a/libraries/octree/src/Octree.cpp +++ b/libraries/octree/src/Octree.cpp @@ -1,9 +1,12 @@ // // Octree.cpp -// hifi +// libraries/octree/src // // Created by Stephen Birarda on 3/13/13. -// Copyright (c) 2013 High Fidelity, Inc. All rights reserved. +// Copyright 2013 High Fidelity, Inc. +// +// Distributed under the Apache License, Version 2.0. +// See the accompanying file LICENSE or http://www.apache.org/licenses/LICENSE-2.0.html // #ifdef _WIN32 diff --git a/libraries/octree/src/OctreeEditPacketSender.cpp b/libraries/octree/src/OctreeEditPacketSender.cpp index bb8ff9d8a0..b606dffe44 100644 --- a/libraries/octree/src/OctreeEditPacketSender.cpp +++ b/libraries/octree/src/OctreeEditPacketSender.cpp @@ -1,11 +1,12 @@ // // OctreeEditPacketSender.cpp -// interface +// libraries/octree/src // // Created by Brad Hefta-Gaub on 8/12/13. -// Copyright (c) 2013 High Fidelity, Inc. All rights reserved. +// Copyright 2013 High Fidelity, Inc. // -// Threaded or non-threaded packet Sender for the Application +// Distributed under the Apache License, Version 2.0. +// See the accompanying file LICENSE or http://www.apache.org/licenses/LICENSE-2.0.html // #include diff --git a/libraries/octree/src/OctreeElement.cpp b/libraries/octree/src/OctreeElement.cpp index 7697338a28..e21148df5e 100644 --- a/libraries/octree/src/OctreeElement.cpp +++ b/libraries/octree/src/OctreeElement.cpp @@ -1,9 +1,12 @@ // // OctreeElement.cpp -// hifi +// libraries/octree/src // // Created by Stephen Birarda on 3/13/13. -// Copyright (c) 2013 HighFidelity, Inc. All rights reserved. +// Copyright 2013 High Fidelity, Inc. +// +// Distributed under the Apache License, Version 2.0. +// See the accompanying file LICENSE or http://www.apache.org/licenses/LICENSE-2.0.html // #include diff --git a/libraries/octree/src/OctreeElementBag.cpp b/libraries/octree/src/OctreeElementBag.cpp index 3ecdfaf2e3..f929980a75 100644 --- a/libraries/octree/src/OctreeElementBag.cpp +++ b/libraries/octree/src/OctreeElementBag.cpp @@ -1,9 +1,12 @@ // // OctreeElementBag.cpp -// hifi +// libraries/octree/src // -// Created by Brad Hefta-Gaub on 4/25/2013 -// Copyright (c) 2013 High Fidelity, Inc. All rights reserved. +// Created by Brad Hefta-Gaub on 4/25/2013. +// Copyright 2013 High Fidelity, Inc. +// +// Distributed under the Apache License, Version 2.0. +// See the accompanying file LICENSE or http://www.apache.org/licenses/LICENSE-2.0.html // #include "OctreeElementBag.h" diff --git a/libraries/octree/src/OctreeHeadlessViewer.cpp b/libraries/octree/src/OctreeHeadlessViewer.cpp index 5d2ce2d287..b25cb4ff8a 100644 --- a/libraries/octree/src/OctreeHeadlessViewer.cpp +++ b/libraries/octree/src/OctreeHeadlessViewer.cpp @@ -1,10 +1,12 @@ // // OctreeHeadlessViewer.cpp -// hifi +// libraries/octree/src // -// Created by Brad Hefta-Gaub on 2/26/14 -// Copyright (c) 2014 High Fidelity, Inc. All rights reserved. +// Created by Brad Hefta-Gaub on 2/26/14. +// Copyright 2014 High Fidelity, Inc. // +// Distributed under the Apache License, Version 2.0. +// See the accompanying file LICENSE or http://www.apache.org/licenses/LICENSE-2.0.html // #include diff --git a/libraries/octree/src/OctreePacketData.cpp b/libraries/octree/src/OctreePacketData.cpp index 5bd4fdce49..2edf560de6 100644 --- a/libraries/octree/src/OctreePacketData.cpp +++ b/libraries/octree/src/OctreePacketData.cpp @@ -1,9 +1,12 @@ // // OctreePacketData.cpp -// hifi +// libraries/octree/src // // Created by Brad Hefta-Gaub on 11/19/2013. -// Copyright (c) 2013 HighFidelity, Inc. All rights reserved. +// Copyright 2013 High Fidelity, Inc. +// +// Distributed under the Apache License, Version 2.0. +// See the accompanying file LICENSE or http://www.apache.org/licenses/LICENSE-2.0.html // #include diff --git a/libraries/octree/src/OctreePersistThread.cpp b/libraries/octree/src/OctreePersistThread.cpp index 29715f9d90..7613e2332b 100644 --- a/libraries/octree/src/OctreePersistThread.cpp +++ b/libraries/octree/src/OctreePersistThread.cpp @@ -1,11 +1,12 @@ // // OctreePersistThread.cpp -// Octree-server +// libraries/octree/src // -// Created by Brad Hefta-Gaub on 8/21/13 -// Copyright (c) 2013 High Fidelity, Inc. All rights reserved. +// Created by Brad Hefta-Gaub on 8/21/13. +// Copyright 2013 High Fidelity, Inc. // -// Threaded or non-threaded Octree persistence +// Distributed under the Apache License, Version 2.0. +// See the accompanying file LICENSE or http://www.apache.org/licenses/LICENSE-2.0.html // #include diff --git a/libraries/octree/src/OctreeProjectedPolygon.cpp b/libraries/octree/src/OctreeProjectedPolygon.cpp index 6e5cea28cd..f86d598a87 100644 --- a/libraries/octree/src/OctreeProjectedPolygon.cpp +++ b/libraries/octree/src/OctreeProjectedPolygon.cpp @@ -1,8 +1,12 @@ // -// OctreeProjectedPolygon.cpp - The projected shadow (on the 2D view plane) for a voxel -// hifi +// OctreeProjectedPolygon.cpp +// libraries/octree/src // -// Added by Brad Hefta-Gaub on 06/11/13. +// Created by Brad Hefta-Gaub on 06/11/13. +// Copyright 2013 High Fidelity, Inc. +// +// Distributed under the Apache License, Version 2.0. +// See the accompanying file LICENSE or http://www.apache.org/licenses/LICENSE-2.0.html // #include diff --git a/libraries/octree/src/OctreeQuery.cpp b/libraries/octree/src/OctreeQuery.cpp index 51e235c4e2..687dd18037 100644 --- a/libraries/octree/src/OctreeQuery.cpp +++ b/libraries/octree/src/OctreeQuery.cpp @@ -1,9 +1,12 @@ // // OctreeQuery.cpp -// hifi +// libraries/octree/src // // Created by Brad Hefta-Gaub on 10/24/13. -// Copyright (c) 2013 High Fidelity, Inc. All rights reserved. +// Copyright 2013 High Fidelity, Inc. +// +// Distributed under the Apache License, Version 2.0. +// See the accompanying file LICENSE or http://www.apache.org/licenses/LICENSE-2.0.html // #include diff --git a/libraries/octree/src/OctreeRenderer.cpp b/libraries/octree/src/OctreeRenderer.cpp index 5d4543e3aa..cde1f0923d 100644 --- a/libraries/octree/src/OctreeRenderer.cpp +++ b/libraries/octree/src/OctreeRenderer.cpp @@ -1,10 +1,12 @@ // // OctreeRenderer.cpp -// hifi +// libraries/octree/src // // Created by Brad Hefta-Gaub on 12/6/13. -// Copyright (c) 2013 High Fidelity, Inc. All rights reserved. +// Copyright 2013 High Fidelity, Inc. // +// Distributed under the Apache License, Version 2.0. +// See the accompanying file LICENSE or http://www.apache.org/licenses/LICENSE-2.0.html // #include diff --git a/libraries/octree/src/OctreeSceneStats.cpp b/libraries/octree/src/OctreeSceneStats.cpp index a21ab60493..ad8702adc2 100644 --- a/libraries/octree/src/OctreeSceneStats.cpp +++ b/libraries/octree/src/OctreeSceneStats.cpp @@ -1,10 +1,12 @@ // // OctreeSceneStats.cpp -// hifi +// libraries/octree/src // // Created by Brad Hefta-Gaub on 7/18/13. -// Copyright (c) 2013 High Fidelity, Inc. All rights reserved. +// Copyright 2013 High Fidelity, Inc. // +// Distributed under the Apache License, Version 2.0. +// See the accompanying file LICENSE or http://www.apache.org/licenses/LICENSE-2.0.html // #include diff --git a/libraries/octree/src/OctreeScriptingInterface.cpp b/libraries/octree/src/OctreeScriptingInterface.cpp index 982496bc58..97e7f67ff5 100644 --- a/libraries/octree/src/OctreeScriptingInterface.cpp +++ b/libraries/octree/src/OctreeScriptingInterface.cpp @@ -1,9 +1,12 @@ // // OctreeScriptingInterface.cpp -// hifi +// libraries/octree/src // -// Created by Brad Hefta-Gaub on 12/6/13 -// Copyright (c) 2013 HighFidelity, Inc. All rights reserved. +// Created by Brad Hefta-Gaub on 12/6/13. +// Copyright 2013 High Fidelity, Inc. +// +// Distributed under the Apache License, Version 2.0. +// See the accompanying file LICENSE or http://www.apache.org/licenses/LICENSE-2.0.html // #include diff --git a/libraries/octree/src/ViewFrustum.cpp b/libraries/octree/src/ViewFrustum.cpp index fa6873b093..9b77d39fdc 100644 --- a/libraries/octree/src/ViewFrustum.cpp +++ b/libraries/octree/src/ViewFrustum.cpp @@ -1,11 +1,12 @@ // // ViewFrustum.cpp -// hifi +// libraries/octree/src // // Created by Brad Hefta-Gaub on 04/11/13. -// Copyright (c) 2013 HighFidelity, Inc. All rights reserved. +// Copyright 2013 High Fidelity, Inc. // -// Simple view frustum class. +// Distributed under the Apache License, Version 2.0. +// See the accompanying file LICENSE or http://www.apache.org/licenses/LICENSE-2.0.html // #include diff --git a/libraries/particles/src/Particle.cpp b/libraries/particles/src/Particle.cpp index f4a5785bad..a36998aad4 100644 --- a/libraries/particles/src/Particle.cpp +++ b/libraries/particles/src/Particle.cpp @@ -1,10 +1,12 @@ // // Particle.cpp -// hifi +// libraries/particles/src // // Created by Brad Hefta-Gaub on 12/4/13. -// Copyright (c) 2013 High Fidelity, Inc. All rights reserved. +// Copyright 2013 High Fidelity, Inc. // +// Distributed under the Apache License, Version 2.0. +// See the accompanying file LICENSE or http://www.apache.org/licenses/LICENSE-2.0.html // #include diff --git a/libraries/particles/src/ParticleCollisionSystem.cpp b/libraries/particles/src/ParticleCollisionSystem.cpp index 028cf80df9..57a339d81f 100644 --- a/libraries/particles/src/ParticleCollisionSystem.cpp +++ b/libraries/particles/src/ParticleCollisionSystem.cpp @@ -1,10 +1,12 @@ // // ParticleCollisionSystem.cpp -// hifi +// libraries/particles/src // // Created by Brad Hefta-Gaub on 12/4/13. -// Copyright (c) 2013 High Fidelity, Inc. All rights reserved. +// Copyright 2013 High Fidelity, Inc. // +// Distributed under the Apache License, Version 2.0. +// See the accompanying file LICENSE or http://www.apache.org/licenses/LICENSE-2.0.html // #include diff --git a/libraries/particles/src/ParticleEditPacketSender.cpp b/libraries/particles/src/ParticleEditPacketSender.cpp index f06b19aa2d..21a910ff16 100644 --- a/libraries/particles/src/ParticleEditPacketSender.cpp +++ b/libraries/particles/src/ParticleEditPacketSender.cpp @@ -1,11 +1,12 @@ // // ParticleEditPacketSender.cpp -// interface +// libraries/particles/src // // Created by Brad Hefta-Gaub on 8/12/13. -// Copyright (c) 2013 High Fidelity, Inc. All rights reserved. +// Copyright 2013 High Fidelity, Inc. // -// Threaded or non-threaded voxel packet Sender for the Application +// Distributed under the Apache License, Version 2.0. +// See the accompanying file LICENSE or http://www.apache.org/licenses/LICENSE-2.0.html // #include diff --git a/libraries/particles/src/ParticleTree.cpp b/libraries/particles/src/ParticleTree.cpp index 57f6a6e665..aeaf25e23c 100644 --- a/libraries/particles/src/ParticleTree.cpp +++ b/libraries/particles/src/ParticleTree.cpp @@ -1,9 +1,12 @@ // // ParticleTree.cpp -// hifi +// libraries/particles/src // // Created by Brad Hefta-Gaub on 12/4/13. -// Copyright (c) 2013 High Fidelity, Inc. All rights reserved. +// Copyright 2013 High Fidelity, Inc. +// +// Distributed under the Apache License, Version 2.0. +// See the accompanying file LICENSE or http://www.apache.org/licenses/LICENSE-2.0.html // #include "ParticleTree.h" diff --git a/libraries/particles/src/ParticleTreeElement.cpp b/libraries/particles/src/ParticleTreeElement.cpp index ee916dcf2f..19353c427a 100644 --- a/libraries/particles/src/ParticleTreeElement.cpp +++ b/libraries/particles/src/ParticleTreeElement.cpp @@ -1,9 +1,12 @@ // // ParticleTreeElement.cpp -// hifi +// libraries/particles/src // // Created by Brad Hefta-Gaub on 12/4/13. -// Copyright (c) 2013 HighFidelity, Inc. All rights reserved. +// Copyright 2013 High Fidelity, Inc. +// +// Distributed under the Apache License, Version 2.0. +// See the accompanying file LICENSE or http://www.apache.org/licenses/LICENSE-2.0.html // #include diff --git a/libraries/particles/src/ParticleTreeHeadlessViewer.cpp b/libraries/particles/src/ParticleTreeHeadlessViewer.cpp index f5384c3fec..1c47447b1a 100644 --- a/libraries/particles/src/ParticleTreeHeadlessViewer.cpp +++ b/libraries/particles/src/ParticleTreeHeadlessViewer.cpp @@ -1,10 +1,12 @@ // // ParticleTreeHeadlessViewer.cpp -// hifi +// libraries/particles/src // -// Created by Brad Hefta-Gaub on 2/26/14 -// Copyright (c) 2014 High Fidelity, Inc. All rights reserved. +// Created by Brad Hefta-Gaub on 2/26/14. +// Copyright 2014 High Fidelity, Inc. // +// Distributed under the Apache License, Version 2.0. +// See the accompanying file LICENSE or http://www.apache.org/licenses/LICENSE-2.0.html // #include "ParticleTreeHeadlessViewer.h" diff --git a/libraries/particles/src/ParticlesScriptingInterface.cpp b/libraries/particles/src/ParticlesScriptingInterface.cpp index a25dde1b9e..4adfed358e 100644 --- a/libraries/particles/src/ParticlesScriptingInterface.cpp +++ b/libraries/particles/src/ParticlesScriptingInterface.cpp @@ -1,9 +1,12 @@ // // ParticlesScriptingInterface.cpp -// hifi +// libraries/particles/src // -// Created by Brad Hefta-Gaub on 12/6/13 -// Copyright (c) 2013 HighFidelity, Inc. All rights reserved. +// Created by Brad Hefta-Gaub on 12/6/13. +// Copyright 2013 High Fidelity, Inc. +// +// Distributed under the Apache License, Version 2.0. +// See the accompanying file LICENSE or http://www.apache.org/licenses/LICENSE-2.0.html // #include "ParticlesScriptingInterface.h" diff --git a/libraries/script-engine/src/EventTypes.cpp b/libraries/script-engine/src/EventTypes.cpp index d5c2d72786..e785f53c19 100644 --- a/libraries/script-engine/src/EventTypes.cpp +++ b/libraries/script-engine/src/EventTypes.cpp @@ -1,12 +1,12 @@ // // EventTypes.cpp -// hifi +// libraries/script-engine/src // // Created by Brad Hefta-Gaub on 1/28/14. -// Copyright (c) 2014 HighFidelity, Inc. All rights reserved. +// Copyright 2014 High Fidelity, Inc. // -// Used to register meta-types with Qt for very various event types so that they can be exposed to our -// scripting engine +// Distributed under the Apache License, Version 2.0. +// See the accompanying file LICENSE or http://www.apache.org/licenses/LICENSE-2.0.html // #include diff --git a/libraries/script-engine/src/LocalVoxels.cpp b/libraries/script-engine/src/LocalVoxels.cpp index 075dfb9e9a..1645c229d6 100644 --- a/libraries/script-engine/src/LocalVoxels.cpp +++ b/libraries/script-engine/src/LocalVoxels.cpp @@ -1,9 +1,12 @@ // // LocalVoxels.cpp -// hifi +// libraries/script-engine/src // // Created by Clément Brisset on 2/24/14. -// Copyright (c) 2014 High Fidelity, Inc. All rights reserved. +// Copyright 2014 High Fidelity, Inc. +// +// Distributed under the Apache License, Version 2.0. +// See the accompanying file LICENSE or http://www.apache.org/licenses/LICENSE-2.0.html // #include "LocalVoxels.h" diff --git a/libraries/script-engine/src/MenuItemProperties.cpp b/libraries/script-engine/src/MenuItemProperties.cpp index 8c91ad8fef..c1f3e92447 100644 --- a/libraries/script-engine/src/MenuItemProperties.cpp +++ b/libraries/script-engine/src/MenuItemProperties.cpp @@ -1,12 +1,12 @@ // // MenuItemProperties.cpp -// hifi +// libraries/script-engine/src // // Created by Brad Hefta-Gaub on 1/28/14. -// Copyright (c) 2014 HighFidelity, Inc. All rights reserved. +// Copyright 2014 High Fidelity, Inc. // -// Used to register meta-types with Qt for very various event types so that they can be exposed to our -// scripting engine +// Distributed under the Apache License, Version 2.0. +// See the accompanying file LICENSE or http://www.apache.org/licenses/LICENSE-2.0.html // #include diff --git a/libraries/script-engine/src/Quat.cpp b/libraries/script-engine/src/Quat.cpp index c939811db4..4acc60e7b4 100644 --- a/libraries/script-engine/src/Quat.cpp +++ b/libraries/script-engine/src/Quat.cpp @@ -1,12 +1,12 @@ // // Quat.cpp -// hifi +// libraries/script-engine/src // -// Created by Brad Hefta-Gaub on 1/29/14 -// Copyright (c) 2014 High Fidelity, Inc. All rights reserved. -// -// Scriptable Quaternion class library. +// Created by Brad Hefta-Gaub on 1/29/14. +// Copyright 2014 High Fidelity, Inc. // +// Distributed under the Apache License, Version 2.0. +// See the accompanying file LICENSE or http://www.apache.org/licenses/LICENSE-2.0.html // #include diff --git a/libraries/script-engine/src/ScriptEngine.cpp b/libraries/script-engine/src/ScriptEngine.cpp index 7572638a30..9c459518ae 100644 --- a/libraries/script-engine/src/ScriptEngine.cpp +++ b/libraries/script-engine/src/ScriptEngine.cpp @@ -1,9 +1,12 @@ // // ScriptEngine.cpp -// hifi +// libraries/script-engine/src // // Created by Brad Hefta-Gaub on 12/14/13. -// Copyright (c) 2013 HighFidelity, Inc. All rights reserved. +// Copyright 2013 High Fidelity, Inc. +// +// Distributed under the Apache License, Version 2.0. +// See the accompanying file LICENSE or http://www.apache.org/licenses/LICENSE-2.0.html // #include diff --git a/libraries/script-engine/src/Vec3.cpp b/libraries/script-engine/src/Vec3.cpp index dc5dcd9773..bab529df1f 100644 --- a/libraries/script-engine/src/Vec3.cpp +++ b/libraries/script-engine/src/Vec3.cpp @@ -1,12 +1,12 @@ // // Vec3.cpp -// hifi +// libraries/script-engine/src // -// Created by Brad Hefta-Gaub on 1/29/14 -// Copyright (c) 2014 High Fidelity, Inc. All rights reserved. -// -// Scriptable Vec3 class library. +// Created by Brad Hefta-Gaub on 1/29/14. +// Copyright 2014 High Fidelity, Inc. // +// Distributed under the Apache License, Version 2.0. +// See the accompanying file LICENSE or http://www.apache.org/licenses/LICENSE-2.0.html // #include diff --git a/libraries/shared/src/AccountManager.cpp b/libraries/shared/src/AccountManager.cpp index d284640924..6c0bcb33cb 100644 --- a/libraries/shared/src/AccountManager.cpp +++ b/libraries/shared/src/AccountManager.cpp @@ -1,9 +1,12 @@ // // AccountManager.cpp -// hifi +// libraries/shared/src // // Created by Stephen Birarda on 2/18/2014. -// Copyright (c) 2014 HighFidelity, Inc. All rights reserved. +// Copyright 2014 High Fidelity, Inc. +// +// Distributed under the Apache License, Version 2.0. +// See the accompanying file LICENSE or http://www.apache.org/licenses/LICENSE-2.0.html // #include diff --git a/libraries/shared/src/Assignment.cpp b/libraries/shared/src/Assignment.cpp index 992ec96a67..4d6740b400 100644 --- a/libraries/shared/src/Assignment.cpp +++ b/libraries/shared/src/Assignment.cpp @@ -1,9 +1,12 @@ // // Assignment.cpp -// hifi +// libraries/shared/src // // Created by Stephen Birarda on 8/22/13. -// Copyright (c) 2013 HighFidelity, Inc. All rights reserved. +// Copyright 2013 High Fidelity, Inc. +// +// Distributed under the Apache License, Version 2.0. +// See the accompanying file LICENSE or http://www.apache.org/licenses/LICENSE-2.0.html // #include "PacketHeaders.h" diff --git a/libraries/shared/src/CapsuleShape.cpp b/libraries/shared/src/CapsuleShape.cpp index bae5f201ca..15586c4938 100644 --- a/libraries/shared/src/CapsuleShape.cpp +++ b/libraries/shared/src/CapsuleShape.cpp @@ -1,9 +1,12 @@ // // CapsuleShape.cpp -// hifi +// libraries/shared/src // -// Created by Andrew Meadows on 2014.02.20 -// Copyright (c) 2014 High Fidelity, Inc. All rights reserved. +// Created by Andrew Meadows on 2014. +// Copyright 2014 High Fidelity, Inc. +// +// Distributed under the Apache License, Version 2.0. +// See the accompanying file LICENSE or http://www.apache.org/licenses/LICENSE-2.0.html // #include diff --git a/libraries/shared/src/CollisionInfo.cpp b/libraries/shared/src/CollisionInfo.cpp index f6c0d057a1..bf986705f5 100644 --- a/libraries/shared/src/CollisionInfo.cpp +++ b/libraries/shared/src/CollisionInfo.cpp @@ -1,9 +1,12 @@ // // CollisionInfo.cpp -// hifi +// libraries/shared/src // -// Created by Andrew Meadows on 2014.02.14 -// Copyright (c) 2014 High Fidelity, Inc. All rights reserved. +// Created by Andrew Meadows on 2014. +// Copyright 2014 High Fidelity, Inc. +// +// Distributed under the Apache License, Version 2.0. +// See the accompanying file LICENSE or http://www.apache.org/licenses/LICENSE-2.0.html // #include "CollisionInfo.h" diff --git a/libraries/shared/src/DataServerAccountInfo.cpp b/libraries/shared/src/DataServerAccountInfo.cpp index 1884517515..1c53bca30f 100644 --- a/libraries/shared/src/DataServerAccountInfo.cpp +++ b/libraries/shared/src/DataServerAccountInfo.cpp @@ -1,9 +1,12 @@ // // DataServerAccountInfo.cpp -// hifi +// libraries/shared/src // // Created by Stephen Birarda on 2/18/2014. -// Copyright (c) 2014 HighFidelity, Inc. All rights reserved. +// Copyright 2014 High Fidelity, Inc. +// +// Distributed under the Apache License, Version 2.0. +// See the accompanying file LICENSE or http://www.apache.org/licenses/LICENSE-2.0.html // #include diff --git a/libraries/shared/src/DomainInfo.cpp b/libraries/shared/src/DomainInfo.cpp index bed638bf59..34498f4c50 100644 --- a/libraries/shared/src/DomainInfo.cpp +++ b/libraries/shared/src/DomainInfo.cpp @@ -1,9 +1,12 @@ // // DomainInfo.cpp -// hifi +// libraries/shared/src // // Created by Stephen Birarda on 2/18/2014. -// Copyright (c) 2014 HighFidelity, Inc. All rights reserved. +// Copyright 2014 High Fidelity, Inc. +// +// Distributed under the Apache License, Version 2.0. +// See the accompanying file LICENSE or http://www.apache.org/licenses/LICENSE-2.0.html // #include diff --git a/libraries/shared/src/FileUtils.cpp b/libraries/shared/src/FileUtils.cpp index efbe1a189b..b890717a66 100644 --- a/libraries/shared/src/FileUtils.cpp +++ b/libraries/shared/src/FileUtils.cpp @@ -1,9 +1,12 @@ // // FileUtils.cpp -// hifi +// libraries/shared/src // // Created by Stojce Slavkovski on 12/23/13. +// Copyright 2013 High Fidelity, Inc. // +// Distributed under the Apache License, Version 2.0. +// See the accompanying file LICENSE or http://www.apache.org/licenses/LICENSE-2.0.html // #include "FileUtils.h" diff --git a/libraries/shared/src/GenericThread.cpp b/libraries/shared/src/GenericThread.cpp index 59f2426bdb..4be253f045 100644 --- a/libraries/shared/src/GenericThread.cpp +++ b/libraries/shared/src/GenericThread.cpp @@ -1,11 +1,12 @@ // // GenericThread.cpp -// shared +// libraries/shared/src // // Created by Brad Hefta-Gaub on 8/12/13. -// Copyright (c) 2013 High Fidelity, Inc. All rights reserved. +// Copyright 2013 High Fidelity, Inc. // -// Generic Threaded or non-threaded processing class +// Distributed under the Apache License, Version 2.0. +// See the accompanying file LICENSE or http://www.apache.org/licenses/LICENSE-2.0.html // #include diff --git a/libraries/shared/src/GeometryUtil.cpp b/libraries/shared/src/GeometryUtil.cpp index ac8e4e97c4..d586dad90e 100644 --- a/libraries/shared/src/GeometryUtil.cpp +++ b/libraries/shared/src/GeometryUtil.cpp @@ -1,299 +1,12 @@ // // GeometryUtil.cpp -// interface +// libraries/shared/src // // Created by Andrzej Kapolka on 5/21/13. -// Copyright (c) 2013 High Fidelity, Inc. All rights reserved. - -#include -#include - -#include "SharedUtil.h" -#include "GeometryUtil.h" - -glm::vec3 computeVectorFromPointToSegment(const glm::vec3& point, const glm::vec3& start, const glm::vec3& end) { - // compute the projection of the point vector onto the segment vector - glm::vec3 segmentVector = end - start; - float lengthSquared = glm::dot(segmentVector, segmentVector); - if (lengthSquared < EPSILON) { - return start - point; // start and end the same - } - float proj = glm::dot(point - start, segmentVector) / lengthSquared; - if (proj <= 0.0f) { // closest to the start - return start - point; - - } else if (proj >= 1.0f) { // closest to the end - return end - point; - - } else { // closest to the middle - return start + segmentVector*proj - point; - } -} - -// Computes the penetration between a point and a sphere (centered at the origin) -// if point is inside sphere: returns true and stores the result in 'penetration' -// (the vector that would move the point outside the sphere) -// otherwise returns false -bool findSpherePenetration(const glm::vec3& point, const glm::vec3& defaultDirection, float sphereRadius, - glm::vec3& penetration) { - float vectorLength = glm::length(point); - if (vectorLength < EPSILON) { - penetration = defaultDirection * sphereRadius; - return true; - } - float distance = vectorLength - sphereRadius; - if (distance < 0.0f) { - penetration = point * (-distance / vectorLength); - return true; - } - return false; -} - -bool findSpherePointPenetration(const glm::vec3& sphereCenter, float sphereRadius, - const glm::vec3& point, glm::vec3& penetration) { - return findSpherePenetration(point - sphereCenter, glm::vec3(0.0f, -1.0f, 0.0f), sphereRadius, penetration); -} - -bool findPointSpherePenetration(const glm::vec3& point, const glm::vec3& sphereCenter, - float sphereRadius, glm::vec3& penetration) { - return findSpherePenetration(sphereCenter - point, glm::vec3(0.0f, -1.0f, 0.0f), sphereRadius, penetration); -} - -bool findSphereSpherePenetration(const glm::vec3& firstCenter, float firstRadius, - const glm::vec3& secondCenter, float secondRadius, glm::vec3& penetration) { - return findSpherePointPenetration(firstCenter, firstRadius + secondRadius, secondCenter, penetration); -} - -bool findSphereSegmentPenetration(const glm::vec3& sphereCenter, float sphereRadius, - const glm::vec3& segmentStart, const glm::vec3& segmentEnd, glm::vec3& penetration) { - return findSpherePenetration(computeVectorFromPointToSegment(sphereCenter, segmentStart, segmentEnd), - glm::vec3(0.0f, -1.0f, 0.0f), sphereRadius, penetration); -} - -bool findSphereCapsulePenetration(const glm::vec3& sphereCenter, float sphereRadius, const glm::vec3& capsuleStart, - const glm::vec3& capsuleEnd, float capsuleRadius, glm::vec3& penetration) { - return findSphereSegmentPenetration(sphereCenter, sphereRadius + capsuleRadius, - capsuleStart, capsuleEnd, penetration); -} - -bool findPointCapsuleConePenetration(const glm::vec3& point, const glm::vec3& capsuleStart, - const glm::vec3& capsuleEnd, float startRadius, float endRadius, glm::vec3& penetration) { - // compute the projection of the point vector onto the segment vector - glm::vec3 segmentVector = capsuleEnd - capsuleStart; - float lengthSquared = glm::dot(segmentVector, segmentVector); - if (lengthSquared < EPSILON) { // start and end the same - return findPointSpherePenetration(point, capsuleStart, - glm::max(startRadius, endRadius), penetration); - } - float proj = glm::dot(point - capsuleStart, segmentVector) / lengthSquared; - if (proj <= 0.0f) { // closest to the start - return findPointSpherePenetration(point, capsuleStart, startRadius, penetration); - - } else if (proj >= 1.0f) { // closest to the end - return findPointSpherePenetration(point, capsuleEnd, endRadius, penetration); - - } else { // closest to the middle - return findPointSpherePenetration(point, capsuleStart + segmentVector * proj, - glm::mix(startRadius, endRadius, proj), penetration); - } -} - -bool findSphereCapsuleConePenetration(const glm::vec3& sphereCenter, - float sphereRadius, const glm::vec3& capsuleStart, const glm::vec3& capsuleEnd, - float startRadius, float endRadius, glm::vec3& penetration) { - return findPointCapsuleConePenetration(sphereCenter, capsuleStart, capsuleEnd, - startRadius + sphereRadius, endRadius + sphereRadius, penetration); -} - -bool findSpherePlanePenetration(const glm::vec3& sphereCenter, float sphereRadius, - const glm::vec4& plane, glm::vec3& penetration) { - float distance = glm::dot(plane, glm::vec4(sphereCenter, 1.0f)) - sphereRadius; - if (distance < 0.0f) { - penetration = glm::vec3(plane) * distance; - return true; - } - return false; -} - -bool findSphereDiskPenetration(const glm::vec3& sphereCenter, float sphereRadius, - const glm::vec3& diskCenter, float diskRadius, float diskThickness, const glm::vec3& diskNormal, - glm::vec3& penetration) { - glm::vec3 localCenter = sphereCenter - diskCenter; - float axialDistance = glm::dot(localCenter, diskNormal); - if (std::fabs(axialDistance) < (sphereRadius + 0.5f * diskThickness)) { - // sphere hit the plane, but does it hit the disk? - // Note: this algorithm ignores edge hits. - glm::vec3 axialOffset = axialDistance * diskNormal; - if (glm::length(localCenter - axialOffset) < diskRadius) { - // yes, hit the disk - penetration = (std::fabs(axialDistance) - (sphereRadius + 0.5f * diskThickness) ) * diskNormal; - if (axialDistance < 0.f) { - // hit the backside of the disk, so negate penetration vector - penetration *= -1.f; - } - return true; - } - } - return false; -} - -bool findCapsuleSpherePenetration(const glm::vec3& capsuleStart, const glm::vec3& capsuleEnd, float capsuleRadius, - const glm::vec3& sphereCenter, float sphereRadius, glm::vec3& penetration) { - if (findSphereCapsulePenetration(sphereCenter, sphereRadius, - capsuleStart, capsuleEnd, capsuleRadius, penetration)) { - penetration = -penetration; - return true; - } - return false; -} - -bool findCapsulePlanePenetration(const glm::vec3& capsuleStart, const glm::vec3& capsuleEnd, float capsuleRadius, - const glm::vec4& plane, glm::vec3& penetration) { - float distance = glm::min(glm::dot(plane, glm::vec4(capsuleStart, 1.0f)), - glm::dot(plane, glm::vec4(capsuleEnd, 1.0f))) - capsuleRadius; - if (distance < 0.0f) { - penetration = glm::vec3(plane) * distance; - return true; - } - return false; -} - -glm::vec3 addPenetrations(const glm::vec3& currentPenetration, const glm::vec3& newPenetration) { - // find the component of the new penetration in the direction of the current - float currentLength = glm::length(currentPenetration); - if (currentLength == 0.0f) { - return newPenetration; - } - glm::vec3 currentDirection = currentPenetration / currentLength; - float directionalComponent = glm::dot(newPenetration, currentDirection); - - // if orthogonal or in the opposite direction, we can simply add - if (directionalComponent <= 0.0f) { - return currentPenetration + newPenetration; - } - - // otherwise, we need to take the maximum component of current and new - return currentDirection * glm::max(directionalComponent, currentLength) + - newPenetration - (currentDirection * directionalComponent); -} - -bool findRaySphereIntersection(const glm::vec3& origin, const glm::vec3& direction, - const glm::vec3& center, float radius, float& distance) { - glm::vec3 relativeOrigin = origin - center; - float c = glm::dot(relativeOrigin, relativeOrigin) - radius * radius; - if (c < 0.0f) { - distance = 0.0f; - return true; // starts inside the sphere - } - float b = glm::dot(direction, relativeOrigin); - float radicand = b * b - c; - if (radicand < 0.0f) { - return false; // doesn't hit the sphere - } - float t = -b - sqrtf(radicand); - if (t < 0.0f) { - return false; // doesn't hit the sphere - } - distance = t; - return true; -} - -bool findRayCapsuleIntersection(const glm::vec3& origin, const glm::vec3& direction, - const glm::vec3& start, const glm::vec3& end, float radius, float& distance) { - if (start == end) { - return findRaySphereIntersection(origin, direction, start, radius, distance); // handle degenerate case - } - glm::vec3 relativeOrigin = origin - start; - glm::vec3 relativeEnd = end - start; - float capsuleLength = glm::length(relativeEnd); - relativeEnd /= capsuleLength; - float originProjection = glm::dot(relativeEnd, relativeOrigin); - glm::vec3 constant = relativeOrigin - relativeEnd * originProjection; - float c = glm::dot(constant, constant) - radius * radius; - if (c < 0.0f) { // starts inside cylinder - if (originProjection < 0.0f) { // below start - return findRaySphereIntersection(origin, direction, start, radius, distance); - - } else if (originProjection > capsuleLength) { // above end - return findRaySphereIntersection(origin, direction, end, radius, distance); - - } else { // between start and end - distance = 0.0f; - return true; - } - } - glm::vec3 coefficient = direction - relativeEnd * glm::dot(relativeEnd, direction); - float a = glm::dot(coefficient, coefficient); - if (a == 0.0f) { - return false; // parallel to enclosing cylinder - } - float b = 2.0f * glm::dot(constant, coefficient); - float radicand = b * b - 4.0f * a * c; - if (radicand < 0.0f) { - return false; // doesn't hit the enclosing cylinder - } - float t = (-b - sqrtf(radicand)) / (2.0f * a); - if (t < 0.0f) { - return false; // doesn't hit the enclosing cylinder - } - glm::vec3 intersection = relativeOrigin + direction * t; - float intersectionProjection = glm::dot(relativeEnd, intersection); - if (intersectionProjection < 0.0f) { // below start - return findRaySphereIntersection(origin, direction, start, radius, distance); - - } else if (intersectionProjection > capsuleLength) { // above end - return findRaySphereIntersection(origin, direction, end, radius, distance); - } - distance = t; // between start and end - return true; -} - -// Do line segments (r1p1.x, r1p1.y)--(r1p2.x, r1p2.y) and (r2p1.x, r2p1.y)--(r2p2.x, r2p2.y) intersect? -// from: http://ptspts.blogspot.com/2010/06/how-to-determine-if-two-line-segments.html -bool doLineSegmentsIntersect(glm::vec2 r1p1, glm::vec2 r1p2, glm::vec2 r2p1, glm::vec2 r2p2) { - int d1 = computeDirection(r2p1.x, r2p1.y, r2p2.x, r2p2.y, r1p1.x, r1p1.y); - int d2 = computeDirection(r2p1.x, r2p1.y, r2p2.x, r2p2.y, r1p2.x, r1p2.y); - int d3 = computeDirection(r1p1.x, r1p1.y, r1p2.x, r1p2.y, r2p1.x, r2p1.y); - int d4 = computeDirection(r1p1.x, r1p1.y, r1p2.x, r1p2.y, r2p2.x, r2p2.y); - return (((d1 > 0 && d2 < 0) || (d1 < 0 && d2 > 0)) && - ((d3 > 0 && d4 < 0) || (d3 < 0 && d4 > 0))) || - (d1 == 0 && isOnSegment(r2p1.x, r2p1.y, r2p2.x, r2p2.y, r1p1.x, r1p1.y)) || - (d2 == 0 && isOnSegment(r2p1.x, r2p1.y, r2p2.x, r2p2.y, r1p2.x, r1p2.y)) || - (d3 == 0 && isOnSegment(r1p1.x, r1p1.y, r1p2.x, r1p2.y, r2p1.x, r2p1.y)) || - (d4 == 0 && isOnSegment(r1p1.x, r1p1.y, r1p2.x, r1p2.y, r2p2.x, r2p2.y)); -} - -bool isOnSegment(float xi, float yi, float xj, float yj, float xk, float yk) { - return (xi <= xk || xj <= xk) && (xk <= xi || xk <= xj) && - (yi <= yk || yj <= yk) && (yk <= yi || yk <= yj); -} - -int computeDirection(float xi, float yi, float xj, float yj, float xk, float yk) { - float a = (xk - xi) * (yj - yi); - float b = (xj - xi) * (yk - yi); - return a < b ? -1 : a > b ? 1 : 0; -} - - +// Copyright 2013 High Fidelity, Inc. // -// Polygon Clipping routines inspired by, pseudo code found here: http://www.cs.rit.edu/~icss571/clipTrans/PolyClipBack.html -// -// Coverage Map's polygon coordinates are from -1 to 1 in the following mapping to screen space. -// -// (0,0) (windowWidth, 0) -// -1,1 1,1 -// +-----------------------+ -// | | | -// | | | -// | -1,0 | | -// |-----------+-----------| -// | 0,0 | -// | | | -// | | | -// | | | -// +-----------------------+ -// -1,-1 1,-1 -// (0,windowHeight) (windowWidth,windowHeight) +// Distributed under the Apache License, Version 2.0. +// See the accompanying file LICENSE or http://www.apache.org/licenses/LICENSE-2.0.html // const float PolygonClip::TOP_OF_CLIPPING_WINDOW = 1.0f; diff --git a/libraries/shared/src/HifiSockAddr.cpp b/libraries/shared/src/HifiSockAddr.cpp index cc031525d8..25e9e5637b 100644 --- a/libraries/shared/src/HifiSockAddr.cpp +++ b/libraries/shared/src/HifiSockAddr.cpp @@ -1,9 +1,12 @@ // // HifiSockAddr.cpp -// hifi +// libraries/shared/src // // Created by Stephen Birarda on 11/26/2013. -// Copyright (c) 2013 HighFidelity, Inc. All rights reserved. +// Copyright 2013 High Fidelity, Inc. +// +// Distributed under the Apache License, Version 2.0. +// See the accompanying file LICENSE or http://www.apache.org/licenses/LICENSE-2.0.html // #include "HifiSockAddr.h" diff --git a/libraries/shared/src/ListShape.cpp b/libraries/shared/src/ListShape.cpp index 593304c75a..26d1c7fea5 100644 --- a/libraries/shared/src/ListShape.cpp +++ b/libraries/shared/src/ListShape.cpp @@ -1,10 +1,12 @@ // // ListShape.cpp +// libraries/shared/src // -// ListShape: A collection of shapes, each with a local transform. +// Created by Andrew Meadows on 2014. +// Copyright 2014 High Fidelity, Inc. // -// Created by Andrew Meadows on 2014.02.20 -// Copyright (c) 2014 High Fidelity, Inc. All rights reserved. +// Distributed under the Apache License, Version 2.0. +// See the accompanying file LICENSE or http://www.apache.org/licenses/LICENSE-2.0.html // #include "ListShape.h" diff --git a/libraries/shared/src/Logging.cpp b/libraries/shared/src/Logging.cpp index f0dcd7b67b..2625cc744a 100644 --- a/libraries/shared/src/Logging.cpp +++ b/libraries/shared/src/Logging.cpp @@ -1,9 +1,12 @@ // // Logging.cpp -// hifi +// libraries/shared/src // // Created by Stephen Birarda on 6/11/13. -// Copyright (c) 2013 HighFidelity, Inc. All rights reserved. +// Copyright 2013 High Fidelity, Inc. +// +// Distributed under the Apache License, Version 2.0. +// See the accompanying file LICENSE or http://www.apache.org/licenses/LICENSE-2.0.html // #include diff --git a/libraries/shared/src/ModelUploader.cpp b/libraries/shared/src/ModelUploader.cpp index 4386704559..da809283d8 100644 --- a/libraries/shared/src/ModelUploader.cpp +++ b/libraries/shared/src/ModelUploader.cpp @@ -1,10 +1,12 @@ // // ModelUploader.cpp -// hifi +// libraries/shared/src // // Created by Clément Brisset on 3/4/14. -// Copyright (c) 2014 High Fidelity, Inc. All rights reserved. +// Copyright 2014 High Fidelity, Inc. // +// Distributed under the Apache License, Version 2.0. +// See the accompanying file LICENSE or http://www.apache.org/licenses/LICENSE-2.0.html // #include diff --git a/libraries/shared/src/NetworkPacket.cpp b/libraries/shared/src/NetworkPacket.cpp index 1671dc2435..b948b10c96 100644 --- a/libraries/shared/src/NetworkPacket.cpp +++ b/libraries/shared/src/NetworkPacket.cpp @@ -1,11 +1,12 @@ // // NetworkPacket.cpp -// shared +// libraries/shared/src // // Created by Brad Hefta-Gaub on 8/9/13. -// Copyright (c) 2013 High Fidelity, Inc. All rights reserved. +// Copyright 2013 High Fidelity, Inc. // -// A really simple class that stores a network packet between being received and being processed +// Distributed under the Apache License, Version 2.0. +// See the accompanying file LICENSE or http://www.apache.org/licenses/LICENSE-2.0.html // #include diff --git a/libraries/shared/src/Node.cpp b/libraries/shared/src/Node.cpp index 1e78bc3feb..13f700ad5a 100644 --- a/libraries/shared/src/Node.cpp +++ b/libraries/shared/src/Node.cpp @@ -1,9 +1,12 @@ // // Node.cpp -// hifi +// libraries/shared/src // // Created by Stephen Birarda on 2/15/13. -// Copyright (c) 2013 High Fidelity, Inc. All rights reserved. +// Copyright 2013 High Fidelity, Inc. +// +// Distributed under the Apache License, Version 2.0. +// See the accompanying file LICENSE or http://www.apache.org/licenses/LICENSE-2.0.html // #include diff --git a/libraries/shared/src/NodeData.cpp b/libraries/shared/src/NodeData.cpp index e3800f8b93..6b71ef8f37 100644 --- a/libraries/shared/src/NodeData.cpp +++ b/libraries/shared/src/NodeData.cpp @@ -1,9 +1,12 @@ // // NodeData.cpp -// hifi +// libraries/shared/src // // Created by Stephen Birarda on 2/19/13. -// Copyright (c) 2013 High Fidelity, Inc. All rights reserved. +// Copyright 2013 High Fidelity, Inc. +// +// Distributed under the Apache License, Version 2.0. +// See the accompanying file LICENSE or http://www.apache.org/licenses/LICENSE-2.0.html // #include "NodeData.h" @@ -16,4 +19,4 @@ NodeData::NodeData() : NodeData::~NodeData() { -} \ No newline at end of file +} diff --git a/libraries/shared/src/NodeList.cpp b/libraries/shared/src/NodeList.cpp index b725914bfd..7ca6202398 100644 --- a/libraries/shared/src/NodeList.cpp +++ b/libraries/shared/src/NodeList.cpp @@ -1,9 +1,12 @@ // // NodeList.cpp -// hifi +// libraries/shared/src // // Created by Stephen Birarda on 2/15/13. -// Copyright (c) 2013 High Fidelity, Inc. All rights reserved. +// Copyright 2013 High Fidelity, Inc. +// +// Distributed under the Apache License, Version 2.0. +// See the accompanying file LICENSE or http://www.apache.org/licenses/LICENSE-2.0.html // #include diff --git a/libraries/shared/src/OAuthAccessToken.cpp b/libraries/shared/src/OAuthAccessToken.cpp index 20a9dc3aa5..ab5ec6462a 100644 --- a/libraries/shared/src/OAuthAccessToken.cpp +++ b/libraries/shared/src/OAuthAccessToken.cpp @@ -1,9 +1,12 @@ // // OAuthAccessToken.cpp -// hifi +// libraries/shared/src // // Created by Stephen Birarda on 2/18/2014. -// Copyright (c) 2014 HighFidelity, Inc. All rights reserved. +// Copyright 2014 High Fidelity, Inc. +// +// Distributed under the Apache License, Version 2.0. +// See the accompanying file LICENSE or http://www.apache.org/licenses/LICENSE-2.0.html // #include diff --git a/libraries/shared/src/OctalCode.cpp b/libraries/shared/src/OctalCode.cpp index ba0a001fb9..82bd471975 100644 --- a/libraries/shared/src/OctalCode.cpp +++ b/libraries/shared/src/OctalCode.cpp @@ -1,9 +1,12 @@ // // OctalCode.cpp -// hifi +// libraries/shared/src // // Created by Stephen Birarda on 3/15/13. -// Copyright (c) 2013 HighFidelity, Inc. All rights reserved. +// Copyright 2013 High Fidelity, Inc. +// +// Distributed under the Apache License, Version 2.0. +// See the accompanying file LICENSE or http://www.apache.org/licenses/LICENSE-2.0.html // #include // std:min diff --git a/libraries/shared/src/PacketHeaders.cpp b/libraries/shared/src/PacketHeaders.cpp index c7518708ce..2832fde56e 100644 --- a/libraries/shared/src/PacketHeaders.cpp +++ b/libraries/shared/src/PacketHeaders.cpp @@ -1,9 +1,12 @@ // // PacketHeaders.cpp -// hifi +// libraries/shared/src // // Created by Stephen Birarda on 6/28/13. -// Copyright (c) 2013 HighFidelity, Inc. All rights reserved. +// Copyright 2013 High Fidelity, Inc. +// +// Distributed under the Apache License, Version 2.0. +// See the accompanying file LICENSE or http://www.apache.org/licenses/LICENSE-2.0.html // #include diff --git a/libraries/shared/src/PacketSender.cpp b/libraries/shared/src/PacketSender.cpp index 9fac115a39..489b083d92 100644 --- a/libraries/shared/src/PacketSender.cpp +++ b/libraries/shared/src/PacketSender.cpp @@ -1,11 +1,12 @@ // // PacketSender.cpp -// shared +// libraries/shared/src // // Created by Brad Hefta-Gaub on 8/12/13. -// Copyright (c) 2013 High Fidelity, Inc. All rights reserved. +// Copyright 2013 High Fidelity, Inc. // -// Threaded or non-threaded packet sender. +// Distributed under the Apache License, Version 2.0. +// See the accompanying file LICENSE or http://www.apache.org/licenses/LICENSE-2.0.html // #include @@ -281,4 +282,4 @@ bool PacketSender::nonThreadedProcess() { _lastSendTime = now; } return isStillRunning(); -} \ No newline at end of file +} diff --git a/libraries/shared/src/PerfStat.cpp b/libraries/shared/src/PerfStat.cpp index 7bea51dd6e..9235cb3f25 100644 --- a/libraries/shared/src/PerfStat.cpp +++ b/libraries/shared/src/PerfStat.cpp @@ -1,13 +1,12 @@ // -// HiFiPerfStat.cpp -// hifi +// PerfStat.cpp +// libraries/shared/src // // Created by Brad Hefta-Gaub on 3/29/13. -// Copyright (c) 2013 HighFidelity, Inc. All rights reserved. -// -// Poor-man's performance stats collector class. Useful for collecting timing -// details from various portions of the code. +// Copyright 2013 High Fidelity, Inc. // +// Distributed under the Apache License, Version 2.0. +// See the accompanying file LICENSE or http://www.apache.org/licenses/LICENSE-2.0.html // #include diff --git a/libraries/shared/src/ReceivedPacketProcessor.cpp b/libraries/shared/src/ReceivedPacketProcessor.cpp index df7bfad165..8394559524 100644 --- a/libraries/shared/src/ReceivedPacketProcessor.cpp +++ b/libraries/shared/src/ReceivedPacketProcessor.cpp @@ -1,11 +1,12 @@ // // ReceivedPacketProcessor.cpp -// shared +// libraries/shared/src // // Created by Brad Hefta-Gaub on 8/12/13. -// Copyright (c) 2013 High Fidelity, Inc. All rights reserved. +// Copyright 2013 High Fidelity, Inc. // -// Threaded or non-threaded packet receiver. +// Distributed under the Apache License, Version 2.0. +// See the accompanying file LICENSE or http://www.apache.org/licenses/LICENSE-2.0.html // #include "NodeList.h" diff --git a/libraries/shared/src/RegisteredMetaTypes.cpp b/libraries/shared/src/RegisteredMetaTypes.cpp index 0354fedba9..3e21a72fd5 100644 --- a/libraries/shared/src/RegisteredMetaTypes.cpp +++ b/libraries/shared/src/RegisteredMetaTypes.cpp @@ -1,12 +1,12 @@ // // RegisteredMetaTypes.cpp -// hifi +// libraries/shared/src // // Created by Stephen Birarda on 10/3/13. -// Copyright (c) 2013 HighFidelity, Inc. All rights reserved. +// Copyright 2013 High Fidelity, Inc. // -// Used to register meta-types with Qt so that they can be used as properties for objects exposed to our -// Agent scripting. +// Distributed under the Apache License, Version 2.0. +// See the accompanying file LICENSE or http://www.apache.org/licenses/LICENSE-2.0.html // #include "RegisteredMetaTypes.h" diff --git a/libraries/shared/src/ResourceCache.cpp b/libraries/shared/src/ResourceCache.cpp index c7858e6e20..30a725c010 100644 --- a/libraries/shared/src/ResourceCache.cpp +++ b/libraries/shared/src/ResourceCache.cpp @@ -1,9 +1,12 @@ // // ResourceCache.cpp -// shared +// libraries/shared/src // // Created by Andrzej Kapolka on 2/27/14. -// Copyright (c) 2014 High Fidelity, Inc. All rights reserved. +// Copyright 2014 High Fidelity, Inc. +// +// Distributed under the Apache License, Version 2.0. +// See the accompanying file LICENSE or http://www.apache.org/licenses/LICENSE-2.0.html // #include diff --git a/libraries/shared/src/ShapeCollider.cpp b/libraries/shared/src/ShapeCollider.cpp index 70f9b9c4bf..2462663405 100644 --- a/libraries/shared/src/ShapeCollider.cpp +++ b/libraries/shared/src/ShapeCollider.cpp @@ -1,9 +1,12 @@ // // ShapeCollider.cpp -// hifi +// libraries/shared/src // -// Created by Andrew Meadows on 2014.02.20 -// Copyright (c) 2014 High Fidelity, Inc. All rights reserved. +// Created by Andrew Meadows on 2014. +// Copyright 2014 High Fidelity, Inc. +// +// Distributed under the Apache License, Version 2.0. +// See the accompanying file LICENSE or http://www.apache.org/licenses/LICENSE-2.0.html // #include diff --git a/libraries/shared/src/SharedUtil.cpp b/libraries/shared/src/SharedUtil.cpp index efd5180d03..fc54c62d51 100644 --- a/libraries/shared/src/SharedUtil.cpp +++ b/libraries/shared/src/SharedUtil.cpp @@ -1,9 +1,12 @@ // // SharedUtil.cpp -// hifi +// libraries/shared/src // // Created by Stephen Birarda on 2/22/13. -// Copyright (c) 2013 HighFidelity, Inc. All rights reserved. +// Copyright 2013 High Fidelity, Inc. +// +// Distributed under the Apache License, Version 2.0. +// See the accompanying file LICENSE or http://www.apache.org/licenses/LICENSE-2.0.html // #include diff --git a/libraries/shared/src/SimpleMovingAverage.cpp b/libraries/shared/src/SimpleMovingAverage.cpp index 676c85598e..9f7e541c9a 100644 --- a/libraries/shared/src/SimpleMovingAverage.cpp +++ b/libraries/shared/src/SimpleMovingAverage.cpp @@ -1,9 +1,12 @@ // // SimpleMovingAverage.cpp -// hifi +// libraries/shared/src // // Created by Stephen Birarda on 4/18/13. -// Copyright (c) 2013 HighFidelity, Inc. All rights reserved. +// Copyright 2013 High Fidelity, Inc. +// +// Distributed under the Apache License, Version 2.0. +// See the accompanying file LICENSE or http://www.apache.org/licenses/LICENSE-2.0.html // #include "SharedUtil.h" @@ -53,4 +56,4 @@ float SimpleMovingAverage::getEventDeltaAverage() const { float SimpleMovingAverage::getAverageSampleValuePerSecond() const { return _average * (1 / getEventDeltaAverage()); -} \ No newline at end of file +} diff --git a/libraries/shared/src/StdDev.cpp b/libraries/shared/src/StdDev.cpp index 17bf60e8be..4528d0fa4f 100644 --- a/libraries/shared/src/StdDev.cpp +++ b/libraries/shared/src/StdDev.cpp @@ -1,9 +1,12 @@ // // StdDev.cpp -// hifi +// libraries/shared/src // // Created by Philip Rosedale on 3/12/13. -// Copyright (c) 2013 HighFidelity, Inc. All rights reserved. +// Copyright 2013 High Fidelity, Inc. +// +// Distributed under the Apache License, Version 2.0. +// See the accompanying file LICENSE or http://www.apache.org/licenses/LICENSE-2.0.html // #include @@ -56,4 +59,4 @@ float StDev::getStDev() { return sqrt(stdev/(float)(sampleCount - 1.0)); else return 0; -} \ No newline at end of file +} diff --git a/libraries/shared/src/StreamUtils.cpp b/libraries/shared/src/StreamUtils.cpp index 44c81f9464..d7b0c83c1f 100644 --- a/libraries/shared/src/StreamUtils.cpp +++ b/libraries/shared/src/StreamUtils.cpp @@ -1,8 +1,12 @@ // // StreamUtils.cpp +// libraries/shared/src // -// Created by Andrew Meadows on 2014.02.21 -// Copyright (c) 2014 High Fidelity, Inc. All rights reserved. +// Created by Andrew Meadows on 2014. +// Copyright 2014 High Fidelity, Inc. +// +// Distributed under the Apache License, Version 2.0. +// See the accompanying file LICENSE or http://www.apache.org/licenses/LICENSE-2.0.html // #include diff --git a/libraries/shared/src/ThreadedAssignment.cpp b/libraries/shared/src/ThreadedAssignment.cpp index fdf2d91c36..1bd79895ab 100644 --- a/libraries/shared/src/ThreadedAssignment.cpp +++ b/libraries/shared/src/ThreadedAssignment.cpp @@ -1,9 +1,12 @@ // // ThreadedAssignment.cpp -// hifi +// libraries/shared/src // // Created by Stephen Birarda on 12/3/2013. -// Copyright (c) 2013 HighFidelity, Inc. All rights reserved. +// Copyright 2013 High Fidelity, Inc. +// +// Distributed under the Apache License, Version 2.0. +// See the accompanying file LICENSE or http://www.apache.org/licenses/LICENSE-2.0.html // #include diff --git a/libraries/shared/src/UUID.cpp b/libraries/shared/src/UUID.cpp index e24c81ebe3..eafd7dd181 100644 --- a/libraries/shared/src/UUID.cpp +++ b/libraries/shared/src/UUID.cpp @@ -1,9 +1,12 @@ // // UUID.cpp -// hifi +// libraries/shared/src // // Created by Stephen Birarda on 10/7/13. -// Copyright (c) 2013 HighFidelity, Inc. All rights reserved. +// Copyright 2013 High Fidelity, Inc. +// +// Distributed under the Apache License, Version 2.0. +// See the accompanying file LICENSE or http://www.apache.org/licenses/LICENSE-2.0.html // #include "UUID.h" @@ -11,4 +14,4 @@ QString uuidStringWithoutCurlyBraces(const QUuid& uuid) { QString uuidStringNoBraces = uuid.toString().mid(1, uuid.toString().length() - 2); return uuidStringNoBraces; -} \ No newline at end of file +} diff --git a/libraries/voxels/src/EnvironmentData.cpp b/libraries/voxels/src/EnvironmentData.cpp index dc82844bd0..b9b64f72d1 100644 --- a/libraries/voxels/src/EnvironmentData.cpp +++ b/libraries/voxels/src/EnvironmentData.cpp @@ -1,9 +1,12 @@ // // EnvironmentData.cpp -// interface +// libraries/voxels/src // // Created by Andrzej Kapolka on 5/6/13. -// Copyright (c) 2013 High Fidelity, Inc. All rights reserved. +// Copyright 2013 High Fidelity, Inc. +// +// Distributed under the Apache License, Version 2.0. +// See the accompanying file LICENSE or http://www.apache.org/licenses/LICENSE-2.0.html // #include diff --git a/libraries/voxels/src/LocalVoxelsList.cpp b/libraries/voxels/src/LocalVoxelsList.cpp index e8f5a09d6d..4324306161 100644 --- a/libraries/voxels/src/LocalVoxelsList.cpp +++ b/libraries/voxels/src/LocalVoxelsList.cpp @@ -1,9 +1,12 @@ // // LocalVoxelsList.cpp -// hifi +// libraries/voxels/src // // Created by Clément Brisset on 2/24/14. -// Copyright (c) 2014 High Fidelity, Inc. All rights reserved. +// Copyright 2014 High Fidelity, Inc. +// +// Distributed under the Apache License, Version 2.0. +// See the accompanying file LICENSE or http://www.apache.org/licenses/LICENSE-2.0.html // #include "LocalVoxelsList.h" @@ -61,4 +64,4 @@ void LocalVoxelsList::remove(QString treeName) { } else { qDebug() << "[DEBUG] LocalVoxelsList : tree still in use (" << treeName << ")"; } -} \ No newline at end of file +} diff --git a/libraries/voxels/src/Tags.cpp b/libraries/voxels/src/Tags.cpp index 4d1fb322cd..8f8228faae 100644 --- a/libraries/voxels/src/Tags.cpp +++ b/libraries/voxels/src/Tags.cpp @@ -1,9 +1,12 @@ // // Tags.cpp -// hifi +// libraries/voxels/src // // Created by Clement Brisset on 7/3/13. -// Copyright (c) 2013 High Fidelity, Inc. All rights reserved. +// Copyright 2013 High Fidelity, Inc. +// +// Distributed under the Apache License, Version 2.0. +// See the accompanying file LICENSE or http://www.apache.org/licenses/LICENSE-2.0.html // #include diff --git a/libraries/voxels/src/VoxelDetail.cpp b/libraries/voxels/src/VoxelDetail.cpp index 4527f7ca2c..6c385c9387 100644 --- a/libraries/voxels/src/VoxelDetail.cpp +++ b/libraries/voxels/src/VoxelDetail.cpp @@ -1,9 +1,12 @@ // // VoxelDetail.cpp -// hifi +// libraries/voxels/src // -// Created by Brad Hefta-Gaub on 1/29/2014 -// Copyright (c) 2013 High Fidelity, Inc. All rights reserved. +// Created by Brad Hefta-Gaub on 1/29/2014. +// Copyright 2013 High Fidelity, Inc. +// +// Distributed under the Apache License, Version 2.0. +// See the accompanying file LICENSE or http://www.apache.org/licenses/LICENSE-2.0.html // #include diff --git a/libraries/voxels/src/VoxelEditPacketSender.cpp b/libraries/voxels/src/VoxelEditPacketSender.cpp index 90884f19f4..1832d5436e 100644 --- a/libraries/voxels/src/VoxelEditPacketSender.cpp +++ b/libraries/voxels/src/VoxelEditPacketSender.cpp @@ -1,11 +1,12 @@ // // VoxelEditPacketSender.cpp -// interface +// libraries/voxels/src // // Created by Brad Hefta-Gaub on 8/12/13. -// Copyright (c) 2013 High Fidelity, Inc. All rights reserved. +// Copyright 2013 High Fidelity, Inc. // -// Threaded or non-threaded voxel packet Sender for the Application +// Distributed under the Apache License, Version 2.0. +// See the accompanying file LICENSE or http://www.apache.org/licenses/LICENSE-2.0.html // #include diff --git a/libraries/voxels/src/VoxelTree.cpp b/libraries/voxels/src/VoxelTree.cpp index 5c48244a39..bb9de72e9d 100644 --- a/libraries/voxels/src/VoxelTree.cpp +++ b/libraries/voxels/src/VoxelTree.cpp @@ -1,9 +1,12 @@ // // VoxelTree.cpp -// hifi +// libraries/voxels/src // // Created by Stephen Birarda on 3/13/13. -// Copyright (c) 2013 High Fidelity, Inc. All rights reserved. +// Copyright 2013 High Fidelity, Inc. +// +// Distributed under the Apache License, Version 2.0. +// See the accompanying file LICENSE or http://www.apache.org/licenses/LICENSE-2.0.html // #include diff --git a/libraries/voxels/src/VoxelTreeCommands.cpp b/libraries/voxels/src/VoxelTreeCommands.cpp index d919f0e150..f0f092fd04 100644 --- a/libraries/voxels/src/VoxelTreeCommands.cpp +++ b/libraries/voxels/src/VoxelTreeCommands.cpp @@ -1,10 +1,12 @@ // // VoxelTreeCommands.cpp -// hifi +// libraries/voxels/src // // Created by Clement on 4/4/14. -// Copyright (c) 2013 High Fidelity, Inc. All rights reserved. +// Copyright 2013 High Fidelity, Inc. // +// Distributed under the Apache License, Version 2.0. +// See the accompanying file LICENSE or http://www.apache.org/licenses/LICENSE-2.0.html // #include "VoxelTree.h" @@ -61,4 +63,4 @@ void DeleteVoxelCommand::undo() { if (_packetSender) { _packetSender->queueVoxelEditMessages(PacketTypeVoxelSet, 1, &_voxel); } -} \ No newline at end of file +} diff --git a/libraries/voxels/src/VoxelTreeElement.cpp b/libraries/voxels/src/VoxelTreeElement.cpp index debcfee987..2582980816 100644 --- a/libraries/voxels/src/VoxelTreeElement.cpp +++ b/libraries/voxels/src/VoxelTreeElement.cpp @@ -1,9 +1,12 @@ // // VoxelTreeElement.cpp -// hifi +// libraries/voxels/src // // Created by Stephen Birarda on 3/13/13. -// Copyright (c) 2013 HighFidelity, Inc. All rights reserved. +// Copyright 2013 High Fidelity, Inc. +// +// Distributed under the Apache License, Version 2.0. +// See the accompanying file LICENSE or http://www.apache.org/licenses/LICENSE-2.0.html // #include diff --git a/libraries/voxels/src/VoxelTreeHeadlessViewer.cpp b/libraries/voxels/src/VoxelTreeHeadlessViewer.cpp index 999ef4fa36..5aaa8c8d97 100644 --- a/libraries/voxels/src/VoxelTreeHeadlessViewer.cpp +++ b/libraries/voxels/src/VoxelTreeHeadlessViewer.cpp @@ -1,10 +1,12 @@ // // VoxelTreeHeadlessViewer.cpp -// hifi +// libraries/voxels/src // -// Created by Brad Hefta-Gaub on 2/26/14 -// Copyright (c) 2014 High Fidelity, Inc. All rights reserved. +// Created by Brad Hefta-Gaub on 2/26/14. +// Copyright 2014 High Fidelity, Inc. // +// Distributed under the Apache License, Version 2.0. +// See the accompanying file LICENSE or http://www.apache.org/licenses/LICENSE-2.0.html // #include "VoxelTreeHeadlessViewer.h" diff --git a/libraries/voxels/src/VoxelsScriptingInterface.cpp b/libraries/voxels/src/VoxelsScriptingInterface.cpp index 61ee4b317d..08dcfd3f47 100644 --- a/libraries/voxels/src/VoxelsScriptingInterface.cpp +++ b/libraries/voxels/src/VoxelsScriptingInterface.cpp @@ -1,9 +1,12 @@ // // VoxelsScriptingInterface.cpp -// hifi +// libraries/voxels/src // // Created by Stephen Birarda on 9/17/13. -// Copyright (c) 2013 HighFidelity, Inc. All rights reserved. +// Copyright 2013 High Fidelity, Inc. +// +// Distributed under the Apache License, Version 2.0. +// See the accompanying file LICENSE or http://www.apache.org/licenses/LICENSE-2.0.html // #include "VoxelTreeCommands.h" diff --git a/voxel-edit/src/SceneUtils.cpp b/voxel-edit/src/SceneUtils.cpp index 2cbe73c74e..19e227c71a 100644 --- a/voxel-edit/src/SceneUtils.cpp +++ b/voxel-edit/src/SceneUtils.cpp @@ -1,9 +1,12 @@ // // SceneUtils.cpp -// hifi +// voxel-edit/src // // Created by Brad Hefta-Gaub on 5/7/2013. -// Copyright (c) 2013 HighFidelity, Inc. All rights reserved. +// Copyright 2013 High Fidelity, Inc. +// +// Distributed under the Apache License, Version 2.0. +// See the accompanying file LICENSE or http://www.apache.org/licenses/LICENSE-2.0.html // #include diff --git a/voxel-edit/src/main.cpp b/voxel-edit/src/main.cpp index 35401aa1d0..01e4cc0189 100644 --- a/voxel-edit/src/main.cpp +++ b/voxel-edit/src/main.cpp @@ -1,9 +1,12 @@ // // main.cpp -// Voxel Edit +// voxel-edit/src // // Created by Brad Hefta-Gaub on 05/03/13. -// Copyright (c) 2013 High Fidelity, Inc. All rights reserved. +// Copyright 2013 High Fidelity, Inc. +// +// Distributed under the Apache License, Version 2.0. +// See the accompanying file LICENSE or http://www.apache.org/licenses/LICENSE-2.0.html // #include From a65f8faea90887fbf4d7eed9bae41e854c679c88 Mon Sep 17 00:00:00 2001 From: Stephen Birarda Date: Wed, 9 Apr 2014 09:36:13 -0700 Subject: [PATCH 049/120] fix Plane header that was not caught --- libraries/octree/src/Plane.cpp | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/libraries/octree/src/Plane.cpp b/libraries/octree/src/Plane.cpp index 727e16724c..d7cb2c54ff 100755 --- a/libraries/octree/src/Plane.cpp +++ b/libraries/octree/src/Plane.cpp @@ -1,12 +1,16 @@ // // Plane.cpp -// hifi +// libraries/octree/src/ // // Created by Brad Hefta-Gaub on 04/11/13. -// Originally from lighthouse3d. Modified to utilize glm::vec3 and clean up to our coding standards +// Copyright 2013 High Fidelity, Inc. // +// Originally from lighthouse3d. Modified to utilize glm::vec3 and clean up to our coding standards // Simple plane class. // +// Distributed under the Apache License, Version 2.0. +// See the accompanying file LICENSE or http://www.apache.org/licenses/LICENSE-2.0.html +// #include "Plane.h" From 6ce5a244603d06d255e2bdb6ff44537d5684a7f1 Mon Sep 17 00:00:00 2001 From: Stephen Birarda Date: Wed, 9 Apr 2014 09:44:38 -0700 Subject: [PATCH 050/120] missed copyright cleanups in apache header --- cmake/macros/IncludeGLM.cmake | 2 +- cmake/macros/SetupHifiProject.cmake | 2 +- cmake/modules/FindFaceshift.cmake | 2 +- cmake/modules/FindGLEW.cmake | 3 ++- cmake/modules/FindGLUT.cmake | 1 + cmake/modules/FindLibOVR.cmake | 2 +- cmake/modules/FindQxmpp.cmake | 2 +- cmake/modules/FindSixense.cmake | 2 +- cmake/modules/FindVisage.cmake | 2 +- domain-server/src/main.cpp | 6 ++++++ examples/defaultScripts.js | 1 + examples/lookWithMouse.js | 2 +- examples/lookWithTouch.js | 2 +- examples/menuExample.js | 2 +- interface/InterfaceConfig.h.in | 7 +++++-- interface/InterfaceVersion.h.in | 9 +++++++-- 16 files changed, 32 insertions(+), 15 deletions(-) diff --git a/cmake/macros/IncludeGLM.cmake b/cmake/macros/IncludeGLM.cmake index 65974a51c5..a31324993e 100644 --- a/cmake/macros/IncludeGLM.cmake +++ b/cmake/macros/IncludeGLM.cmake @@ -1,7 +1,7 @@ # # IncludeGLM.cmake # -# Copyright (c) 2013 High Fidelity +# Copyright 2013 High Fidelity, Inc. # # Distributed under the Apache License, Version 2.0. # See the accompanying file LICENSE or http://www.apache.org/licenses/LICENSE-2.0.html diff --git a/cmake/macros/SetupHifiProject.cmake b/cmake/macros/SetupHifiProject.cmake index 11252e2a74..50cd3a4150 100644 --- a/cmake/macros/SetupHifiProject.cmake +++ b/cmake/macros/SetupHifiProject.cmake @@ -1,7 +1,7 @@ # # SetupHifiProject.cmake # -# Copyright (c) 2013 High Fidelity +# Copyright 2013 High Fidelity, Inc. # # Distributed under the Apache License, Version 2.0. # See the accompanying file LICENSE or http://www.apache.org/licenses/LICENSE-2.0.html diff --git a/cmake/modules/FindFaceshift.cmake b/cmake/modules/FindFaceshift.cmake index 9b407c353f..faf556e06c 100644 --- a/cmake/modules/FindFaceshift.cmake +++ b/cmake/modules/FindFaceshift.cmake @@ -12,7 +12,7 @@ # FACESHIFT_LIBRARIES - Link this to use Faceshift # # Created on 8/30/2013 by Andrzej Kapolka -# Copyright (c) 2013 High Fidelity +# Copyright 2013 High Fidelity, Inc. # # Distributed under the Apache License, Version 2.0. # See the accompanying file LICENSE or http://www.apache.org/licenses/LICENSE-2.0.html diff --git a/cmake/modules/FindGLEW.cmake b/cmake/modules/FindGLEW.cmake index 160cfedc5a..68e3248850 100644 --- a/cmake/modules/FindGLEW.cmake +++ b/cmake/modules/FindGLEW.cmake @@ -9,9 +9,10 @@ # GLEW_LIBRARY # # Created on 2/6/2014 by Stephen Birarda +# Copyright 2014 High Fidelity, Inc. # # Adapted from FindGLEW.cmake available in the nvidia-texture-tools repository -# (https://code.google.com/p/nvidia-texture-tools/source/browse/trunk/cmake/FindGLEW.cmake?r=96) +# (https://code.google.com/p/nvidia-texture-tools/source/browse/trunk/cmake/FindGLEW.cmake?r=96) # # Distributed under the Apache License, Version 2.0. # See the accompanying file LICENSE or http://www.apache.org/licenses/LICENSE-2.0.html diff --git a/cmake/modules/FindGLUT.cmake b/cmake/modules/FindGLUT.cmake index fe41dc5df8..280a6ac6db 100644 --- a/cmake/modules/FindGLUT.cmake +++ b/cmake/modules/FindGLUT.cmake @@ -10,6 +10,7 @@ # GLUT_DLL_PATH - Optionally defined for Win32, if not in path # # Created on 2/6/2014 by Stephen Birarda +# Copyright 2014 High Fidelity, Inc. # # Adapted from FindGLUT.cmake available in tlorach's OpenGLText Repository # https://raw.github.com/tlorach/OpenGLText/master/cmake/FindGLUT.cmake diff --git a/cmake/modules/FindLibOVR.cmake b/cmake/modules/FindLibOVR.cmake index 811fdb73d4..c07b4c14c1 100644 --- a/cmake/modules/FindLibOVR.cmake +++ b/cmake/modules/FindLibOVR.cmake @@ -12,7 +12,7 @@ # LIBOVR_LIBRARIES - Link this to use LibOVR # # Created on 5/9/2013 by Stephen Birarda -# Copyright (c) 2013 High Fidelity +# Copyright 2013 High Fidelity, Inc. # # Distributed under the Apache License, Version 2.0. # See the accompanying file LICENSE or http://www.apache.org/licenses/LICENSE-2.0.html diff --git a/cmake/modules/FindQxmpp.cmake b/cmake/modules/FindQxmpp.cmake index caeb35219d..d5f23143f6 100644 --- a/cmake/modules/FindQxmpp.cmake +++ b/cmake/modules/FindQxmpp.cmake @@ -12,7 +12,7 @@ # QXMPP_LIBRARIES - Link this to use qxmpp # # Created on 3/10/2014 by Stephen Birarda -# Copyright (c) 2014 High Fidelity +# Copyright 2014 High Fidelity, Inc. # # Distributed under the Apache License, Version 2.0. # See the accompanying file LICENSE or http://www.apache.org/licenses/LICENSE-2.0.html diff --git a/cmake/modules/FindSixense.cmake b/cmake/modules/FindSixense.cmake index 74965f5734..02b6e3fc21 100644 --- a/cmake/modules/FindSixense.cmake +++ b/cmake/modules/FindSixense.cmake @@ -12,7 +12,7 @@ # SIXENSE_LIBRARIES - Link this to use Sixense # # Created on 11/15/2013 by Andrzej Kapolka -# Copyright (c) 2013 High Fidelity +# Copyright 2013 High Fidelity, Inc. # # Distributed under the Apache License, Version 2.0. # See the accompanying file LICENSE or http://www.apache.org/licenses/LICENSE-2.0.html diff --git a/cmake/modules/FindVisage.cmake b/cmake/modules/FindVisage.cmake index 6d204e4649..0aa57f6508 100644 --- a/cmake/modules/FindVisage.cmake +++ b/cmake/modules/FindVisage.cmake @@ -12,7 +12,7 @@ # VISAGE_LIBRARIES - Link this to use Visage # # Created on 2/11/2014 by Andrzej Kapolka -# Copyright (c) 2014 High Fidelity +# Copyright 2014 High Fidelity, Inc. # # Distributed under the Apache License, Version 2.0. # See the accompanying file LICENSE or http://www.apache.org/licenses/LICENSE-2.0.html diff --git a/domain-server/src/main.cpp b/domain-server/src/main.cpp index d79f06365d..2c8c3bd4c4 100644 --- a/domain-server/src/main.cpp +++ b/domain-server/src/main.cpp @@ -5,6 +5,12 @@ // Created by Philip Rosedale on 11/20/12. // Copyright 2012 High Fidelity, Inc. // +// The Domain Server keeps a list of nodes that have connected to it, and echoes that list of +// nodes out to nodes when they check in. +// +// The connection is stateless... the domain server will set you inactive if it does not hear from +// you in LOGOFF_CHECK_INTERVAL milliseconds, meaning your info will not be sent to other users. +// // Distributed under the Apache License, Version 2.0. // See the accompanying file LICENSE or http://www.apache.org/licenses/LICENSE-2.0.html // diff --git a/examples/defaultScripts.js b/examples/defaultScripts.js index ede2d0f6b6..b3f9649883 100644 --- a/examples/defaultScripts.js +++ b/examples/defaultScripts.js @@ -6,6 +6,7 @@ // // Distributed under the Apache License, Version 2.0. // See the accompanying file LICENSE or http://www.apache.org/licenses/LICENSE-2.0.html +// Script.include("lookWithTouch.js"); Script.include("editVoxels.js"); diff --git a/examples/lookWithMouse.js b/examples/lookWithMouse.js index 9110218026..256a3ea67c 100644 --- a/examples/lookWithMouse.js +++ b/examples/lookWithMouse.js @@ -3,7 +3,7 @@ // examples // // Created by Brad Hefta-Gaub on 1/28/14. -// Copyright (c) 2014 High Fidelity, Inc. +// Copyright 2014 High Fidelity, Inc. // // This is an example script that demonstrates use of the Controller class // diff --git a/examples/lookWithTouch.js b/examples/lookWithTouch.js index 5f5e2ee41c..68b29c305b 100644 --- a/examples/lookWithTouch.js +++ b/examples/lookWithTouch.js @@ -3,7 +3,7 @@ // examples // // Created by Brad Hefta-Gaub on 1/28/14. -// Copyright (c) 2014 High Fidelity, Inc. +// Copyright 2014 High Fidelity, Inc. // // This is an example script that demonstrates use of the Controller class // diff --git a/examples/menuExample.js b/examples/menuExample.js index ed6f29d53a..00c6418269 100644 --- a/examples/menuExample.js +++ b/examples/menuExample.js @@ -3,7 +3,7 @@ // examples // // Created by Brad Hefta-Gaub on 2/24/14 -// Copyright (c) 2013 High Fidelity, Inc. +// Copyright 2013 High Fidelity, Inc. // // This is an example script that demonstrates use of the Menu object // diff --git a/interface/InterfaceConfig.h.in b/interface/InterfaceConfig.h.in index 0b570f622f..b2b1881d67 100644 --- a/interface/InterfaceConfig.h.in +++ b/interface/InterfaceConfig.h.in @@ -1,9 +1,12 @@ // // InterfaceConfig.h -// interface +// interface/src // // Created by Stephen Birarda on 2/8/13. -// Copyright (c) 2013 High Fidelity, Inc.. All rights reserved. +// Copyright 2013 High Fidelity, Inc. +// +// Distributed under the Apache License, Version 2.0. +// See the accompanying file LICENSE or http://www.apache.org/licenses/LICENSE-2.0.html // #ifndef interface__InterfaceConfig__ diff --git a/interface/InterfaceVersion.h.in b/interface/InterfaceVersion.h.in index 60e51b4ab6..2f902de41c 100644 --- a/interface/InterfaceVersion.h.in +++ b/interface/InterfaceVersion.h.in @@ -1,9 +1,14 @@ // // InterfaceVersion.h -// Declaration of version and build data +// interface/src // // Created by Leonardo Murillo on 12/16/13. -// Copyright (c) 2013 High Fidelity, Inc.. All rights reserved. +// Copyright 2013 High Fidelity, Inc. +// +// Declaration of version and build data +// +// Distributed under the Apache License, Version 2.0. +// See the accompanying file LICENSE or http://www.apache.org/licenses/LICENSE-2.0.html // const QString BUILD_VERSION = "@BUILD_SEQ@"; From cb402e3eb39935311fc3b02d6d2db37fcefd14ac Mon Sep 17 00:00:00 2001 From: Stephen Birarda Date: Wed, 9 Apr 2014 09:46:43 -0700 Subject: [PATCH 051/120] run apache header script on tests --- tests/metavoxels/src/MetavoxelTests.cpp | 7 +++++-- tests/metavoxels/src/main.cpp | 8 ++++++-- tests/physics/src/CollisionInfoTests.cpp | 9 ++++++--- tests/physics/src/PhysicsTestUtil.cpp | 9 ++++++--- tests/physics/src/ShapeColliderTests.cpp | 9 ++++++--- tests/physics/src/main.cpp | 7 ++++++- 6 files changed, 35 insertions(+), 14 deletions(-) diff --git a/tests/metavoxels/src/MetavoxelTests.cpp b/tests/metavoxels/src/MetavoxelTests.cpp index a1b79319b5..2400e086eb 100644 --- a/tests/metavoxels/src/MetavoxelTests.cpp +++ b/tests/metavoxels/src/MetavoxelTests.cpp @@ -1,9 +1,12 @@ // // MetavoxelTests.cpp -// metavoxel-tests +// tests/metavoxels/src // // Created by Andrzej Kapolka on 2/7/14. -// Copyright (c) 2014 High Fidelity, Inc. All rights reserved. +// Copyright 2014 High Fidelity, Inc. +// +// Distributed under the Apache License, Version 2.0. +// See the accompanying file LICENSE or http://www.apache.org/licenses/LICENSE-2.0.html // #include diff --git a/tests/metavoxels/src/main.cpp b/tests/metavoxels/src/main.cpp index 10bf786957..51d4e565b2 100644 --- a/tests/metavoxels/src/main.cpp +++ b/tests/metavoxels/src/main.cpp @@ -1,9 +1,13 @@ // // main.cpp -// metavoxel-tests +// tests/metavoxels/src // // Created by Andrzej Kapolka on 2/7/14. -// Copyright (c) 2014 High Fidelity, Inc. All rights reserved. +// Copyright 2014 High Fidelity, Inc. +// +// Distributed under the Apache License, Version 2.0. +// See the accompanying file LICENSE or http://www.apache.org/licenses/LICENSE-2.0.html +// #include diff --git a/tests/physics/src/CollisionInfoTests.cpp b/tests/physics/src/CollisionInfoTests.cpp index 241204d036..c4d585cedf 100644 --- a/tests/physics/src/CollisionInfoTests.cpp +++ b/tests/physics/src/CollisionInfoTests.cpp @@ -1,9 +1,12 @@ // // CollisionInfoTests.cpp -// physics-tests +// tests/physics/src // -// Created by Andrew Meadows on 2014.02.21 -// Copyright (c) 2014 High Fidelity, Inc. All rights reserved. +// Created by Andrew Meadows on 2014. +// Copyright 2014 High Fidelity, Inc. +// +// Distributed under the Apache License, Version 2.0. +// See the accompanying file LICENSE or http://www.apache.org/licenses/LICENSE-2.0.html // #include diff --git a/tests/physics/src/PhysicsTestUtil.cpp b/tests/physics/src/PhysicsTestUtil.cpp index fb940d2043..90f0952c08 100644 --- a/tests/physics/src/PhysicsTestUtil.cpp +++ b/tests/physics/src/PhysicsTestUtil.cpp @@ -1,9 +1,12 @@ // // PhysicsTestUtil.cpp -// physics-tests +// tests/physics/src // -// Created by Andrew Meadows on 2014.02.21 -// Copyright (c) 2014 High Fidelity, Inc. All rights reserved. +// Created by Andrew Meadows on 2014. +// Copyright 2014 High Fidelity, Inc. +// +// Distributed under the Apache License, Version 2.0. +// See the accompanying file LICENSE or http://www.apache.org/licenses/LICENSE-2.0.html // #include diff --git a/tests/physics/src/ShapeColliderTests.cpp b/tests/physics/src/ShapeColliderTests.cpp index 7aeec84651..dedf364b9f 100644 --- a/tests/physics/src/ShapeColliderTests.cpp +++ b/tests/physics/src/ShapeColliderTests.cpp @@ -1,9 +1,12 @@ // // ShapeColliderTests.cpp -// physics-tests +// tests/physics/src // -// Created by Andrew Meadows on 2014.02.21 -// Copyright (c) 2014 High Fidelity, Inc. All rights reserved. +// Created by Andrew Meadows on 2014. +// Copyright 2014 High Fidelity, Inc. +// +// Distributed under the Apache License, Version 2.0. +// See the accompanying file LICENSE or http://www.apache.org/licenses/LICENSE-2.0.html // //#include diff --git a/tests/physics/src/main.cpp b/tests/physics/src/main.cpp index b0a7adde4e..ca98f4d546 100644 --- a/tests/physics/src/main.cpp +++ b/tests/physics/src/main.cpp @@ -1,6 +1,11 @@ // // main.cpp -// physics-tests +// tests/physics/src +// +// Copyright 2014 High Fidelity, Inc. +// +// Distributed under the Apache License, Version 2.0. +// See the accompanying file LICENSE or http://www.apache.org/licenses/LICENSE-2.0.html // #include "ShapeColliderTests.h" From c9b58c0ee9e64c28ae9ca516b32e8ac0cb66261e Mon Sep 17 00:00:00 2001 From: Stephen Birarda Date: Wed, 9 Apr 2014 09:49:47 -0700 Subject: [PATCH 052/120] fix headers in h files in tests, fix Andrew's dates --- tests/metavoxels/src/MetavoxelTests.h | 7 +++++-- tests/physics/src/CollisionInfoTests.cpp | 2 +- tests/physics/src/CollisionInfoTests.h | 9 ++++++--- tests/physics/src/PhysicsTestUtil.cpp | 2 +- tests/physics/src/PhysicsTestUtil.h | 9 ++++++--- tests/physics/src/ShapeColliderTests.cpp | 2 +- tests/physics/src/ShapeColliderTests.h | 9 ++++++--- 7 files changed, 26 insertions(+), 14 deletions(-) diff --git a/tests/metavoxels/src/MetavoxelTests.h b/tests/metavoxels/src/MetavoxelTests.h index 22a680acbb..71f44080d3 100644 --- a/tests/metavoxels/src/MetavoxelTests.h +++ b/tests/metavoxels/src/MetavoxelTests.h @@ -1,9 +1,12 @@ // // MetavoxelTests.h -// metavoxel-tests +// tests/metavoxels/src // // Created by Andrzej Kapolka on 2/7/14. -// Copyright (c) 2014 High Fidelity, Inc. All rights reserved. +// Copyright 2014 High Fidelity, Inc. +// +// Distributed under the Apache License, Version 2.0. +// See the accompanying file LICENSE or http://www.apache.org/licenses/LICENSE-2.0.html // #ifndef __interface__MetavoxelTests__ diff --git a/tests/physics/src/CollisionInfoTests.cpp b/tests/physics/src/CollisionInfoTests.cpp index c4d585cedf..ffc7e94cc4 100644 --- a/tests/physics/src/CollisionInfoTests.cpp +++ b/tests/physics/src/CollisionInfoTests.cpp @@ -2,7 +2,7 @@ // CollisionInfoTests.cpp // tests/physics/src // -// Created by Andrew Meadows on 2014. +// Created by Andrew Meadows on 2/21/2014. // Copyright 2014 High Fidelity, Inc. // // Distributed under the Apache License, Version 2.0. diff --git a/tests/physics/src/CollisionInfoTests.h b/tests/physics/src/CollisionInfoTests.h index 51579e8f11..7877de4392 100644 --- a/tests/physics/src/CollisionInfoTests.h +++ b/tests/physics/src/CollisionInfoTests.h @@ -1,9 +1,12 @@ // // CollisionInfoTests.h -// physics-tests +// tests/physics/src // -// Created by Andrew Meadows on 2014.02.21 -// Copyright (c) 2014 High Fidelity, Inc. All rights reserved. +// Created by Andrew Meadows on 2/21/2014. +// Copyright 2014 High Fidelity, Inc. +// +// Distributed under the Apache License, Version 2.0. +// See the accompanying file LICENSE or http://www.apache.org/licenses/LICENSE-2.0.html // #ifndef __tests__CollisionInfoTests__ diff --git a/tests/physics/src/PhysicsTestUtil.cpp b/tests/physics/src/PhysicsTestUtil.cpp index 90f0952c08..f176d5e637 100644 --- a/tests/physics/src/PhysicsTestUtil.cpp +++ b/tests/physics/src/PhysicsTestUtil.cpp @@ -2,7 +2,7 @@ // PhysicsTestUtil.cpp // tests/physics/src // -// Created by Andrew Meadows on 2014. +// Created by Andrew Meadows on 02/21/2014. // Copyright 2014 High Fidelity, Inc. // // Distributed under the Apache License, Version 2.0. diff --git a/tests/physics/src/PhysicsTestUtil.h b/tests/physics/src/PhysicsTestUtil.h index c4c7962466..cc758c71bc 100644 --- a/tests/physics/src/PhysicsTestUtil.h +++ b/tests/physics/src/PhysicsTestUtil.h @@ -1,9 +1,12 @@ // // PhysicsTestUtil.h -// physics-tests +// tests/physics/src // -// Created by Andrew Meadows on 2014.02.21 -// Copyright (c) 2014 High Fidelity, Inc. All rights reserved. +// Created by Andrew Meadows on 02/21/2014. +// Copyright 2014 High Fidelity, Inc. +// +// Distributed under the Apache License, Version 2.0. +// See the accompanying file LICENSE or http://www.apache.org/licenses/LICENSE-2.0.html // #ifndef __tests__PhysicsTestUtil__ diff --git a/tests/physics/src/ShapeColliderTests.cpp b/tests/physics/src/ShapeColliderTests.cpp index dedf364b9f..2c25decdee 100644 --- a/tests/physics/src/ShapeColliderTests.cpp +++ b/tests/physics/src/ShapeColliderTests.cpp @@ -2,7 +2,7 @@ // ShapeColliderTests.cpp // tests/physics/src // -// Created by Andrew Meadows on 2014. +// Created by Andrew Meadows on 02/21/2014. // Copyright 2014 High Fidelity, Inc. // // Distributed under the Apache License, Version 2.0. diff --git a/tests/physics/src/ShapeColliderTests.h b/tests/physics/src/ShapeColliderTests.h index ecd4a7f045..9fee17b228 100644 --- a/tests/physics/src/ShapeColliderTests.h +++ b/tests/physics/src/ShapeColliderTests.h @@ -1,9 +1,12 @@ // // ShapeColliderTests.h -// physics-tests +// tests/physics/src // -// Created by Andrew Meadows on 2014.02.21 -// Copyright (c) 2014 High Fidelity, Inc. All rights reserved. +// Created by Andrew Meadows on 02/21/2014. +// Copyright 2014 High Fidelity, Inc. +// +// Distributed under the Apache License, Version 2.0. +// See the accompanying file LICENSE or http://www.apache.org/licenses/LICENSE-2.0.html // #ifndef __tests__ShapeColliderTests__ From 619e9d7cd3d19583fe91a96449be72236669c30e Mon Sep 17 00:00:00 2001 From: Stephen Birarda Date: Wed, 9 Apr 2014 09:52:00 -0700 Subject: [PATCH 053/120] more header repairs caught via find --- examples/ribbon.js | 2 +- tools/mtc/src/main.cpp | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/examples/ribbon.js b/examples/ribbon.js index 9f0cc02e52..dd3d46fbfc 100644 --- a/examples/ribbon.js +++ b/examples/ribbon.js @@ -3,7 +3,7 @@ // examples // // Created by Andrzej Kapolka on 2/24/14. -// Copyright 2014 High Fidelity, Inc. All rights reserved. +// Copyright 2014 High Fidelity, Inc. // // Distributed under the Apache License, Version 2.0. // See the accompanying file LICENSE or http://www.apache.org/licenses/LICENSE-2.0.html diff --git a/tools/mtc/src/main.cpp b/tools/mtc/src/main.cpp index b1cd154a48..096ade4625 100644 --- a/tools/mtc/src/main.cpp +++ b/tools/mtc/src/main.cpp @@ -3,7 +3,7 @@ // tools/mtc/src // // Created by Andrzej Kapolka on 12/31/13. -// Copyright (c) 2013 High Fidelity, Inc. All rights reserved. +// Copyright 2013 High Fidelity, Inc. // // Distributed under the Apache License, Version 2.0. // See the accompanying file LICENSE or http://www.apache.org/licenses/LICENSE-2.0.html From ce85e67a42c6f520844ce4cf73266ba50e9377df Mon Sep 17 00:00:00 2001 From: stojce Date: Wed, 9 Apr 2014 18:54:59 +0200 Subject: [PATCH 054/120] Modify icons in Interface "mirror" --- interface/resources/images/audio-box.svg | 12 +++ interface/resources/images/body.png | Bin 4801 -> 0 bytes interface/resources/images/close.png | Bin 3817 -> 0 bytes interface/resources/images/close.svg | 26 +++-- interface/resources/images/head.png | Bin 4453 -> 0 bytes interface/resources/images/mic-mute.svg | 115 +++++++++++++++++++++ interface/resources/images/mic.svg | 121 +++++++++++++++++++---- interface/resources/images/minus.svg | 11 +++ interface/resources/images/mute.svg | 20 ---- interface/resources/images/plus.svg | 12 +++ interface/src/Application.cpp | 25 +++-- interface/src/Audio.cpp | 69 ++++++++----- interface/src/Audio.h | 3 +- interface/src/ui/RearMirrorTools.cpp | 31 +++--- 14 files changed, 348 insertions(+), 97 deletions(-) create mode 100644 interface/resources/images/audio-box.svg delete mode 100644 interface/resources/images/body.png delete mode 100644 interface/resources/images/close.png delete mode 100644 interface/resources/images/head.png create mode 100644 interface/resources/images/mic-mute.svg create mode 100644 interface/resources/images/minus.svg delete mode 100644 interface/resources/images/mute.svg create mode 100644 interface/resources/images/plus.svg diff --git a/interface/resources/images/audio-box.svg b/interface/resources/images/audio-box.svg new file mode 100644 index 0000000000..0c0db4f51f --- /dev/null +++ b/interface/resources/images/audio-box.svg @@ -0,0 +1,12 @@ + + + Slice 1 + Created with Sketch (http://www.bohemiancoding.com/sketch) + + + + + + + + \ No newline at end of file diff --git a/interface/resources/images/body.png b/interface/resources/images/body.png deleted file mode 100644 index dda65bad07774cab5372349673b487775b22baa0..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 4801 zcmZ`*c{tST`yNc$*X${iED3ga3J;$%#`M%fn{_)=Tb3gaGgvN_pfQcRlFzF2`tA~j5&C({B zSGEht{{X(;OqP_tD<{vJ&6x98WTvg$bE|Ofd|lTAiuk8&K~%56OT`Rwo#{lX*mN!# zm~HbwY|1tFCOxL!0+9-s-99%k@crQ>fGl^4eb2mjwr8Zg9=E`1KtO@(rzl_~!l{6B_yKnI^DCF#jY{(!C%N-Ut(T|&2)IPutYV3k<-1jmzpqCl zhQg(|#jlhKt*oHl&AII~j!d2oF+b3F6}V@)A-+t_&?aY~COwxQL+W_}TcXx!rz#tg zEdf=y<65)Rk4@G&W2Q+3`=+Z^`e9}h-^QKKmS&%m z7{epo>h7qMkoUmOOyQwJ)1myz67&Kg=^or}e)fRiJ1VBt2>Mre4FK#cov4>)AZ_r{ zH4ZtZR}C-SO5@9YQkj11( z0?X1$JFp7fQt+mm00F{p8F0|urvn?%Vzq!zwW03;OxkkqY5Z@ydjkeZfp3AvVande zZGcysSiPB9Zo##f?lv3A(oB%B3}NdWJUQBr?(ycar|7)nIBCsr1Ey_yk(;g^7I}{& zL2Ku&coDzU?MK-#Q;p5D1i@Mc+uOTY^lw3m#}8lFiCpFWb|nP;u{Zm!JKa3fz!WMJdU`TWxT8_x9-}qTBaHpbeUPZ9s0D{0!#u-5 zIA@EZ8L7yGAaa-EMw^Y3L;Gh`XYES41UKsz??HcM)504e|OjiCwDB za36k@mYqqNXeP*Bj6FfqH0hi;w~3*Up3aD|ieZh`4Xqon{41jVoAJ5@)9LT%p_@;LZsM(GbQZLgc|-?uwPAU)~wZRPRgyY%GRH* zYSFlZ&`ZrpcKX99)hW{H_D7|5GqINmq=Xk-CdFC{75!rQX9RTy@^AE4S6!}B{ebx( zdkTIbZ*L%Rp?y>MbNwbGMhtUp_S~${tl(_r>nq1wWF5XMToK48Cz9*PabFeZYN#{R zQRQ;1-H(@&$vaYBQa6)Dl3kK%lH(p-vcwN@52ZiCJu(@Tbr*McbRTiw8v>WaPz$NV z3~IW);*U@J5sMYIk%85_?%!G$H5L;EQw19Y1q3YxDT*CR0;yi9U8%FF^NO8SZr04t zfY!6t^Uv&LlT%iEEL_AYqgAp?%T@|y`k;B^B^ssZqDrJ|u5o4W3EKqlwF}xWY+jfX zbxe#PNQiy8*;+Q#EVDE-uMysOE%bHMThIrGXzjG-qU@;bM#l`t+-daLNAV?nQn}W- zY8@BR&#y;qKxeLrS45^G5)d(6m(AY~PFOh9Qmd#e9&>KuiX}>QojDa_DAZ&9cUdZ} z>aT9*-bmXy&#V!Rj85kr=e3t!kv5lEk`_iuqK+YPRf`q7tsmM_J#5jzop;@5(3QOf z<8#kSi)AML8&`tWQf({7dFzbps9S7XB75R{a`YMz0TK0V+wTef=jy_Phd7r$PgnPD zkZ0&6f+U^{APOhbQN5DAti8F+EPU&HgEIU+eb=X}g?!?{&S0{AfOqzw8ol|2ACP__+VI@aWE@!o+z&Dzn`ml=7?bSIb`{Y&)&FuN6X7p^?xS z=!pjZhLT{&cgF+T1OMIeufyx}yTf}Xz>C1gjGvkEfciiydML9zBiAuMU~4l?b6uD) zq~BiDW{{UwXCLN&N1aiL#g=E+mme&x_*i`TMzv)?NB|Kiir%P$GjYK2L5Il$(S`+POQ+`kFzmPr^C*4cRl~gG1D}I9wulim!pd;oO zRdL={K|`V*(yEv%3#)yN9a^?4Osu8IVQO#BQUQE8U+?xWX}+ zug!Wm=Qcm3e)8%*)%CS&FGR^jiRkCr;Q!~{{br?A54O@f@5*dOYmAAu&9&3t8kXX4 zAe_O-dbfUe4CdsdSJcFyS(aHvgM(Y;+FXZDjgHxLy-e>lHqUlX9?z9=m&#K2QHqFN z-#4f3k5L~@#KsbqCQ-pxcgB0R!dL3^xAOOhQ~nIZvGIl4ugDZ9l-)ymsAz9UJEyS0!KcwBE4X9X?dJn72q0j7y!XUkrM&lK!D{bhvR67dk)_ zL)T6ZJWSkQ@*1yhCGn(x4iXH+&mc77LL%V1F-xe*ooXhGs2bL;tA z>nQ8&cVq7&pXVuKgDwS4F5DVOKh=9mMlDWfR>bO1a%ejZg7t{ocMMrNp&N#a1miJ-B}5?m^7E({&m5 z?UzHa3(wYY^$XsW2lr=6V;hbI&+ppqK_<3pgJ)xZq@SdVKEAsOZV38eH>R-=JaN!R zU(9Z&*%Ns2!0iCNJd-2AWFnRENVD`{==-osasB3U*02M$@(*=%3$CQ}Ax?lemN`FuOMuOu^sxL5D$)YZ1`(YKVMX*f~T zptAdJ3pell`O^RqyH-#bHBr)_xkWn2-a~J8#xE?Jd^btXjL{_CWZeG}AdYjHo7@in zx+kxS3IPBBjNS$)UjTsl#Nnm^q(0;a0DvM`3nT$~`I0Icj{`e8J?r6zvMp7E*c_k1cJ9J1VSVd!9)cx-p3Upr=p?)k(GzY%ggvUyU6(7@FF+{ z$awjl{gvdud2}(pXdkRM0gLwn9p-g(!ut_4L_`ja{$9W8Bw$_saq{y0t1UDh2RURQ za$s4=zsWEG*#99rWd5hj8U1%x-hMuwKYMaULol8g9L9^_3y}lM{i|I7&iilS|0y!S z(fgO#&msO=>W7u9Ucva{J^cG4DX5eG52;vV-5@Znd=Djd-P8m)c>+MLL3n~qg8$VoZK;J!V&bp z|E!LqE93~Q4*Az;^#Gi=>Seq$*5!t-BLM@Imz7hHk&~5?SFwJPw3AsaEC{b0$BE!@+kk8R2_17i;mo?pTsZpimpDCNgeX{{f9C+ zZC<_)0MLC$=xSRa8Q&o5j8AHFkK4|`_i41WZvz?3b+zd7va_bnFc@&|)A4X=>@)ju z(FA|c%^`(xF&i)exsI#F#?-T$tfE%fW^A{V>f+`5-PU>@2F(Rz5Fg8TK+i{giF|6f z6KY6qyJ?94kuN2bEopG@FddUQp(D~2USw4wu(!9jJ2qy+p0d0;Fp!uLX+U;J)y;J& zD=mG7U~vg^9n6+ty>K(R3dqODS84-xjr{14%Z9`5n44VB?W;Jqqs+hfR^Q1ye~?x} zLc$0JgKf=mBxkYVoYIrh{h6jh34}o@O1C&;#W2Wo5YwDKBIg?tG67Xlc~ThY;Sv3& zxA%U&e$Px&iWWQGrJW>Ou(ucF@9W#@)_nfa;wb%CasgK%Dcy|mahl32G{8j7R^Zer z%ZP{wSl6VD)QbP8H4^#R3{IAB_#vXONottj)=nnXUCgAGBpc=zVg=c*N#E&FsP3cR z{lc>DA!kryj?YL>A0iTo!f<{4)K9Z&_ljdDPs`z$ZKi-1zMTjhZEHY;n5#meWjIey z^?tdJbsuutn&}&+09V_Z*5}^S*3hHtM@L6LG&gHMvyeK7;?jSR+0+toF_6|o+FTzb zF)=#2$0^3azY1~$dT}jYlxJmQv&zxBF6$^%4D46g0h5JrhX*XsnnI!I^Q(LiA`>hU z^|S2ChdDvv;`C=v*%~n`UN%=?$>n$yD@dYIX5t$JuNa(73m*52BoWJt<~r@VtGe?1@?!P*q{Kub;W zG|Ohr@!Hz;iO+i^G#WiQWnOBfIkhDErnz=j*B(nEG(0PkfJSl4`x%>)nF&n+l&qvs*doJdHR>AJf-|T^FBLY1qFrOwl<)BXc^rB zBsVrLt}%;6`sUbkQG3b4r6rI3e9UC4k&zK((`Ab>PXd#o&$(nl!wW@(*B~WHRT*R7 zT>6b>HA_e-h{=C5?|t%S408jWo3`Qee?UezWz3=k8%Gh0M`Uy7AA>2Pnn~h zU4H$_yIY_@^nF8o`{vDTX0_}jCIR&9K!ws D(=uVu diff --git a/interface/resources/images/close.png b/interface/resources/images/close.png deleted file mode 100644 index 8090e3d3d090a60ec2e8b0591b6e088baef2db03..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 3817 zcmVX+uL$Nkc;* zP;zf(X>4Tx07wm;mUmQB*%pV-y*Itk5+Wca^cs2zAksTX6$DXM^`x7XQc?|s+0 z08spb1j2M!0f022SQPH-!CVp(%f$Br7!UytSOLJ{W@ZFO_(THK{JlMynW#v{v-a*T zfMmPdEWc1DbJqWVks>!kBnAKqMb$PuekK>?0+ds;#ThdH1j_W4DKdsJG8Ul;qO2n0 z#IJ1jr{*iW$(WZWsE0n`c;fQ!l&-AnmjxZO1uWyz`0VP>&nP`#itsL#`S=Q!g`M=rU9)45( zJ;-|dRq-b5&z?byo>|{)?5r=n76A4nTALlSzLiw~v~31J<>9PP?;rs31pu_(obw)r zY+jPY;tVGXi|p)da{-@gE-UCa`=5eu%D;v=_nFJ?`&K)q7e9d`Nfk3?MdhZarb|T3 z%nS~f&t(1g5dY)AIcd$w!z`Siz!&j_=v7hZlnI21XuE|xfmo0(WD10T)!}~_HYW!e zew}L+XmwuzeT6wtxJd`dZ#@7*BLgIEKY9Xv>st^p3dp{^Xswa2bB{85{^$B13tWnB z;Y>jyQ|9&zk7RNsqAVGs--K+z0uqo1bf5|}fi5rtEMN^BfHQCd-XH*kfJhJnmIE$G z0%<@5vOzxB0181d*a3EfYH$G5fqKvcPJ%XY23!PJzzuK<41h;K3WmW;Fah3yX$XSw z5EY_9s*o0>51B&N5F1(uc|$=^I1~fLLy3?Ol0f;;Ca4%HgQ}rJP(Ab`bQ-z{U4#0d z2hboi2K@njgb|nm(_szR0JebHusa+GN5aeCM0gdP2N%HG;Yzp`J`T6S7vUT504#-H z!jlL<$Or?`Mpy_N@kBz9SR?@vA#0H$qyni$nvf2p8@Y{0k#Xb$28W?xm>3qu8RLgp zjNxKdVb)?wFx8l2m{v>|<~C*!GlBVnrDD~wrdTJeKXwT=5u1%I#8zOBU|X=4u>;s) z>^mF|$G{ol9B_WP7+f-LHLe7=57&&lfa}8z;U@8Tyei%l?}87(bMRt(A-)QK9Dg3) zj~~XrCy)tR1Z#p1A(kK{Y$Q|=8VKhI{e%(1G*N-5Pjn)N5P8I0VkxnX*g?EW941ba z6iJ387g8iCnY4jaNopcpCOsy-A(P2EWJhusSwLP-t|XrzUnLKcKTwn?CKOLf97RIe zPB}`sKzTrUL#0v;sBY9)s+hW+T2H-1eM)^VN0T#`^Oxhvt&^*fYnAJldnHel*Ozyf zUoM{~Um<@={-*r60#U(0!Bc^wuvVc);k3d%g-J!4qLpHZVwz%!VuRu}#Ze`^l7W)9 z5>Kf>>9Eozr6C$Z)1`URxU@~QI@)F0FdauXr2Es8>BaOP=)Lp_WhG@>R;lZ?BJkMlIuMhw8ApiF&yDYW2hFJ?fJhni{?u z85&g@mo&yT8JcdI$(rSw=QPK(Xj%)k1X|@<=e1rim6`6$RAwc!i#egKuI;BS(LSWz zt39n_sIypSqfWEV6J3%nTQ@-4i zi$R;gsG*9XzhRzXqv2yCs*$VFDx+GXJH|L;wsDH_KI2;^u!)^Xl1YupO;gy^-c(?^ z&$Q1BYvyPsG^;hc$D**@Sy`+`)}T4VJji^bd7Jqw3q6Zii=7tT7GEswEK@D(EFW1Z zSp`^awCb?>!`j4}Yh7b~$A)U-W3$et-R8BesV(1jzwLcHnq9En7Q0Tn&-M=XBKs!$ zF$X<|c!#|X_tWYh)GZit z(Q)Cp9CDE^WG;+fcyOWARoj*0TI>4EP1lX*cEoMO-Pk?Z{kZ!p4@(b`M~lalr<3Oz z&kJ6Nm#vN_+kA5{dW4@^Vjg_`q%qU1ULk& z3Fr!>1V#i_2R;ij2@(Z$1jE4r!MlPVFVbHmT+|iPIq0wy5aS{>yK?9ZAjVh%SOwMWgFjair&;wpi!{CU}&@N=Eg#~ zLQ&zpEzVmGY{hI9Z0+4-0xS$$Xe-OToc?Y*V;rTcf_ zb_jRe-RZjXSeas3UfIyD;9afd%<`i0x4T#DzE)vdabOQ=k7SRuGN`h>O0Q~1)u-yD z>VX=Mn&!Rgd$;YK+Q-}1zu#?t(*cbG#Ronf6db&N$oEidtwC+YVcg-Y!_VuY>bk#Y ze_ww@?MU&F&qswvrN_dLb=5o6*Egs)ls3YRlE$&)amR1{;Ppd$6RYV^Go!iq1UMl% z@#4q$AMc(FJlT1QeX8jv{h#)>&{~RGq1N2iiMFIRX?sk2-|2wUogK~{EkB$8eDsX= znVPf8XG_nK&J~=SIiGia@9y}|z3FhX{g&gcj=lwb=lWgyFW&aLedUh- zof`v-2Kw$UzI*>(+&$@i-u=-BsSjR1%z8NeX#HdC`Hh-Z(6xI-`hmHDqv!v)W&&nrf>M(RhcN6(D;jNN*%^u_SYjF;2ng}*8Ow)d6M ztDk;%`@Lsk$;9w$(d(H%O5UixIr`T2ZRcd@fIj#Yr0i@`Lw2CjpP;8*akA`j7< z!F%8`C?og<_nv@B@C5kB(Ta$#z$g)}d!O;#9k3AmZB!t_bI_ISF!oKvxt2{)BEsQ3 z?mYrIK0+ugEEIKhb)u}SOcWOvi*!0I*4Ea~kflN}u$a$;ga?(XhN7v|>XAp=X+!n!Fd}AGTGj%ykS`AGjT8Cr)jJ;M*!co2a&kT#tep%V=pQt}`a$B#Pr>#;mNY)cG>GFDo^tO)*%3t&3h%LJn3AU^5Qe zwq8`CdU|?-{&$t2Ml(=jW21T|bajccEqqa87f-S65r_E2AZkmzaWB>1lA+ z{ui+1@e)%I%T5iJ5K%yHi>|INF+4nMb;A}Rnwy)&;v%b9H`do#>H44z=U~>~ldGx= zuJM!0pdK6?)HyTx?<;x7&|nR$9azr<;S$3EoXfPYudnA~sB@xy1Jqzau5YrqG7%+4 zRRD2(R7_R?m>l~?PF9a6wHh>%#!au%V{t_sCQ)49zP`R4GauS7K_7Tj;pss4k}5s6 zx3^_&ZLPM`Cu*J9-`}^c+O4gv-V3g-uFCxU{O@Kiv~PhS+<`?W=0IhoN3e^Ps3 zGyVj7iqA5}-rk;UXlQtE=0W={=-XKF+XK%{o1hlOvXhk_!GL^AHD)|x#2+O}iJ@zE zclQS~ex`jLS0{LG(t_A#*~wXy3;6l?$=NdwF)8HWS{MoLx;{}XUs>tp0*)EWXJY)< zAjfW2P%+OocvK1XR*tq5o{ROF;OE2{+~HB>cSLb& zb2iy}4CdUxqY6(4!9B<&l-mJUU@m&rbq4kjTw^HYXc!p$5_l2h{=@&Em4K{gSi6w3 f;4| - - - - - - - - - + + + Slice 1 + Created with Sketch (http://www.bohemiancoding.com/sketch) + + + + + + + + \ No newline at end of file diff --git a/interface/resources/images/head.png b/interface/resources/images/head.png deleted file mode 100644 index d21b453beef1d2cb597665bfb4abc647be1de990..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 4453 zcmZ`)c{r5&`+hO9FUb-qlPnQ4V{C`)W1A>s$=D4u46|qqLuJj9kljQ{Qr0X**~wB! zr%ARXTefUT$(npGI^T2r`kn9Rx;}rr_x;?@{XEb6KGz##e$I%CU4$I~04}7l{&@fZ zPVQdT0{{TT{j4Sc0J|;@fiOoR5MXmM35&yH0Kk|lE1ha(IVc!SZ%}P`!zT`wToJj% z27Y_mSO8=ZgA6rijEa!**Jn25KPY44ZuN}8C|cajfS==PIC_BXE3f&BW($3Tso^+p zwxtr~ZzGx8?WobgnW}+7kENi2TEP5AIH-kU%MhxRW6S?}zS)8AP*>X;<6&L~Zd-K2uJa~MYBEOz^;)=I=}ugo`ADYZcy1gh z$Kj^rm`Cmv7EFT`G833uJK58-e%lm)@n<-{nvu%E$G{Evg+Ir9WdvAL+tljG+_4*K zo_BzNJderipco`N@8G~q+|;KI?B;TXYw)9Xc`P#hdRc0Len&U%4r&y?@DSP{2&_uj-8x#)m}U)B z5)SB0jXyM70s~)}fy$BF-;PD$os!!=a!PZ=E-c`E8M3`0r#`7}WrveqHbtqeWpsVs zvN@e6q#bqwDWHfkn99q~Gtqzbij$j0ci&#)-I;i%hWoR#Rql57Goj_kPu3QnQrRM6 zJnJGg!fX>E?(7jEed8gARis&jgR{K(J^h@4phz|IY9vbsNfSVvV3HteUt$cJx93%0 z?`W*|EJ-T!O@LqeIkPFo;c%TeZmKJ8Ilao6;7*pjCnuac8i8+Sr1L(pt zE*}ogP$M1osAdxw!$=s8HT(;&z&+ifM8W$!8G8M^N9ukJ{ zDmW~AwI~N+uDNo8B2vrhcy;qG%NwxLfo+DMh=Vs7dtABR0Z&5*%TJ548ntwd=?4hh zW)XTeG=8R9P>Z{&MQHrU7eFr3xg~{Fr-PNL+t8Nv$g;j(qOAnO!Q4)0>Y$^wD#ml$ZxFopPm(w0Gy>neSEy~^gO!%XyPjK~N2RKo=6ja4C5LXvE-^w*E zwH#0{JHo#d&eQDs1%2gsBYTKw$g$A`u@_C!iEMTt?{J>u>0k-GgcYv{>kR95#K9IN zi?9MSig*-nV4DM4=FyFJy7fp=sdFj($S4V+^Aa){m0?y$FL6gHO{s?CDV^%>M&!dN z9VfF=iEOa5Bu}!odFn|iezP;826}_%)XvoC1nLAL9-QYYAoki8-K@>BGi%TfIuisn zN>QYJqfK;{q!cH4r_IwYOPZw)(5N(LNVc@|@sKk=^L|t_S~Tl4TZZM9+vFIISGH(I zA`LR{rJ=8(Gtn{Vs~?r0TS(R?hb33>nHB2HmcNyJa9l*M=Rx4x>dLc~>hCe{VMmQr z?{D>_%syWc`_!<)hLObBPo10+of4U3%7`jAQ) z&S|G!CT&BOD0?MMJPn)1kd{znYEA0n@5?G86q)tHyrjHby#~Fu`XI&e^n5z?4n50R zX=n0B^jvvu%%$p0ukWpMnsX^4nIerM!XnlpG^H2H!kNU(&djOI8Kw40Pdkn$AiF8M znI}%Lw2aTMtgw<5v1&ObrHlFU-CFmDi#1E!3MyY159 zZK2L(7E3u=7TG1)_nVBG>_c8Ydjo#&603Wwxgh6yPLt~$*W7Wp6GchI-LkoMxu;+J z;r8_6^<}LId#Uo6EMzh=zVoc*yWSBims)xyozr{TQ%b2=xvu?Q`3Ds0p<(}BwN{Oe zE4hKUHcoM9#@fba2@VT7%Pq=T%FoM*p=40ZwuH*L^3B%wZJFMVZb9u)UK4H=uk(hd zpOh5JkNP()2A$4yEFTuEJ6A_v7mp@V6}BXZ~zq~k2cUpwAC3WbiC~_ij5aE z5u_S+8a+4YGdgQ<*??wXLbH`aRZJSj*~NkLGzG)?XTEydsZhcytV~iWJ6e)n5U^LTxGUoT#`D@r@VQOM(u8d+~cj2G7h|2ZK9z99d z>*c2$6*Z+Bpsh-|FhuQ3T;FHwL-%yLlT1(gqOf&0Z~Qdqn+P6w}O?i%2Yp(M*p8tKbn<4dvljW_Ln*g)tsX`HrI}SZ=6pc zfCX<((^~3ON?Kj&DG|Fl4P3f3p$<(W_ z_r6xuU07(eakanb!h=h2PpE_!JZ?Bs=4I5EKX-pFOe7(5x?%2e)neBB_Mw5MQ9?)$ zLp;-S7Oi9aqV*viYv$f1x`gMhAI2ZH(&z8Z)i!yAIEUyj8ZRf&jUtU6w6`Sq^_}h= zP%ThRRcVP&e(`AHVmoPj>^tJ}q2gI{#oU^8&>zRumOr+yi!I&Z)EErB9#k|dy`8=K z^o`whyPWBXiKqrsEcLWVJSE>c&pi5vJG!o1Y<#mv@{#XwC+W zYjT)rhLwf811|K6YaR(v)d=WL+D4gK zD>J>2e#)@YaL%a2h#t2QH+<>Q%JVN>akQR^$R?SePuJ4Ai?f5NTMZuQ&bBY!-SZjR zXGRJd)i(QA2{Z1WCVQy3rM&#>BgKu{t6|$YTW%}uNwW)P>t<=$@!HfYY(KsRND;8p zqiYf0w&3chU;qHve2h`P0Kjo*_c8#Pw+{mVNE~NnOR+s`s_sT2KwRBPXbdEP-~;R) zjR5rkf)4>haRmnu@I+tr08R0|2z8>b`YsF=2k(VYyfwvb&zge~Br*o93{ir>#I@ML zV6X<+9jks`-|#Ov*&VAX?n$Bes6(MtDiuOigpkM{Pz5zLH7E=Yg~R2^?pS%>KqAF8 zK%VG(;#ZRY=F!Lax{+}{6dZ{N-p%WZCizh`#l?4x{yx9zq~NgsI1zpSYRip8fbKF- z1qclKZ!$~(?tjR3ng1zscl*05A3rjFuP1jmC{hOR9^*^G`|Xavnuw!lDQN69^gH~|M1H9dB!Uka6lI+KR zkGK8DMoSg`mta5myTFW$!w@O1yLJ6t(|+vtc+|fc><9M=c1N#njtjuxZS`>k3~{du zC78zEJNbXa??MC#Pa<3TxVm9>3){=J5BfcN&j$6sZ1xfRgzj$YzJ6#gj2mSi`rmI> z&(#CE57vPGYqUlH!AJcp$sLCc)OV#|wBRrWMR^67JY3BR4pUcvsjDb!K!1zbSHUiW zAY)u9B(fEWgxA{Zg0TAtR)oNQDfjb#Nj0FmTeNSh_K08Td3{4Ib`9v?`>(|w!OS@g z0F1Yh`np!OY>Tu%OONaFw-+n(i5)tKmQkq>P2>6~fSq8gkBKlUM&q zXz{XZSr;j>r>p6Sm)4xK_C1kek2EOW%=Qf~EcGq2gL6)>xGkKfux*}FW^xHW16<>Q z4#`1H{28|xmA0ZDVvpWlR6c7tF#o+fyKCz0L!07l4Ug#oC6}rpM?rRGle*!j3}Z>m z07_2K9s?IXArc>~$kYLgWxkd9CsrW3HHQ(f38x;NF=zT|-F!F-<^rKv0%z)&{gv~k zzHK;Xv%j1Fo_;R>TlOg`v*+EXqf0x2Vf?a+56*W!9>n7TJ+A_J!B{x*iXR;0@lyTLcB=xZw-git3*wwFdJE+e$`VV`m_RLab_)MzJFUSfo zzaAQvzuTqI8@lSt@jXzosIQ2R^MEQqsg6+B6mucQXI3~(4y?r6S)}^aIH-ukNBKRn z6(zxrC3w(`B~~cv@*CU1LI8(qPiRY0OwDvAHDUh~{GtoJ9*Vtc&~n$9-&Rn2pf(bYmm?6^pWg9rKCgxiL?rw^y{pM)Zv% zH|}s>!A&d&n1x9!Hro_qUSSoJ)4z^1(>~x;WX``wX=KxDR%IpOebPAVfJ5Po#@~^Q z_d!?Er+0uhk=0Lz-;s8@)oj|C2^K-gj}?z4R9MMAk7^x9=pb@<5!tDRjejnzT|VH9 z< + + +image/svg+xml + + + + + + + + Mic + Created with Sketch (http://www.bohemiancoding.com/sketch) + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/interface/resources/images/mic.svg b/interface/resources/images/mic.svg index a6dee50740..3329f19647 100644 --- a/interface/resources/images/mic.svg +++ b/interface/resources/images/mic.svg @@ -1,20 +1,105 @@ - - Mic - Created with Sketch (http://www.bohemiancoding.com/sketch) - - - - - - - - - - - - - - - + + +image/svg+xml + + + + + + + + Mic + Created with Sketch (http://www.bohemiancoding.com/sketch) + + + + + + + + + + + + + + \ No newline at end of file diff --git a/interface/resources/images/minus.svg b/interface/resources/images/minus.svg new file mode 100644 index 0000000000..463b24aa4c --- /dev/null +++ b/interface/resources/images/minus.svg @@ -0,0 +1,11 @@ + + + Slice 1 + Created with Sketch (http://www.bohemiancoding.com/sketch) + + + + + + + \ No newline at end of file diff --git a/interface/resources/images/mute.svg b/interface/resources/images/mute.svg deleted file mode 100644 index 1f1b238463..0000000000 --- a/interface/resources/images/mute.svg +++ /dev/null @@ -1,20 +0,0 @@ - - - mute - Created with Sketch (http://www.bohemiancoding.com/sketch) - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/interface/resources/images/plus.svg b/interface/resources/images/plus.svg new file mode 100644 index 0000000000..6efaa31abc --- /dev/null +++ b/interface/resources/images/plus.svg @@ -0,0 +1,12 @@ + + + Slice 1 + Created with Sketch (http://www.bohemiancoding.com/sketch) + + + + + + + + \ No newline at end of file diff --git a/interface/src/Application.cpp b/interface/src/Application.cpp index d54cceb245..deaab1ac10 100644 --- a/interface/src/Application.cpp +++ b/interface/src/Application.cpp @@ -2503,20 +2503,19 @@ void Application::displayOverlay() { // Audio VU Meter and Mute Icon const int MUTE_ICON_SIZE = 24; const int AUDIO_METER_INSET = 2; - const int AUDIO_METER_WIDTH = MIRROR_VIEW_WIDTH - MUTE_ICON_SIZE - AUDIO_METER_INSET; + const int MUTE_ICON_PADDING = 10; + const int AUDIO_METER_WIDTH = MIRROR_VIEW_WIDTH - MUTE_ICON_SIZE - AUDIO_METER_INSET - MUTE_ICON_PADDING; const int AUDIO_METER_SCALE_WIDTH = AUDIO_METER_WIDTH - 2 * AUDIO_METER_INSET; const int AUDIO_METER_HEIGHT = 8; - const int AUDIO_METER_Y_GAP = 8; - const int AUDIO_METER_X = MIRROR_VIEW_LEFT_PADDING + MUTE_ICON_SIZE + AUDIO_METER_INSET; + const int AUDIO_METER_GAP = 5; + const int AUDIO_METER_X = MIRROR_VIEW_LEFT_PADDING + MUTE_ICON_SIZE + AUDIO_METER_INSET + AUDIO_METER_GAP; int audioMeterY; if (Menu::getInstance()->isOptionChecked(MenuOption::Mirror)) { - audioMeterY = MIRROR_VIEW_HEIGHT + AUDIO_METER_Y_GAP; + audioMeterY = MIRROR_VIEW_HEIGHT + AUDIO_METER_GAP + MUTE_ICON_PADDING; } else { - audioMeterY = AUDIO_METER_Y_GAP; + audioMeterY = AUDIO_METER_GAP + MUTE_ICON_PADDING; } - _audio.renderMuteIcon(MIRROR_VIEW_LEFT_PADDING, audioMeterY); - const float AUDIO_METER_BLUE[] = {0.0, 0.0, 1.0}; const float AUDIO_METER_GREEN[] = {0.0, 1.0, 0.0}; @@ -2545,18 +2544,27 @@ void Application::displayOverlay() { bool isClipping = ((_audio.getTimeSinceLastClip() > 0.f) && (_audio.getTimeSinceLastClip() < CLIPPING_INDICATOR_TIME)); + _audio.renderToolBox(MIRROR_VIEW_LEFT_PADDING + AUDIO_METER_GAP, + audioMeterY, + Menu::getInstance()->isOptionChecked(MenuOption::Mirror)); + glBegin(GL_QUADS); if (isClipping) { glColor3f(1, 0, 0); } else { - glColor3f(0, 0, 0); + glColor3f(0.475f, 0.475f, 0.475f); } + + audioMeterY += AUDIO_METER_HEIGHT; + + glColor3f(0, 0, 0); // Draw audio meter background Quad glVertex2i(AUDIO_METER_X, audioMeterY); glVertex2i(AUDIO_METER_X + AUDIO_METER_WIDTH, audioMeterY); glVertex2i(AUDIO_METER_X + AUDIO_METER_WIDTH, audioMeterY + AUDIO_METER_HEIGHT); glVertex2i(AUDIO_METER_X, audioMeterY + AUDIO_METER_HEIGHT); + if (audioLevel > AUDIO_RED_START) { if (!isClipping) { glColor3fv(AUDIO_METER_RED); @@ -2596,6 +2604,7 @@ void Application::displayOverlay() { glVertex2i(AUDIO_METER_X + AUDIO_METER_INSET, audioMeterY + AUDIO_METER_HEIGHT - AUDIO_METER_INSET); glEnd(); + if (Menu::getInstance()->isOptionChecked(MenuOption::HeadMouse)) { _myAvatar->renderHeadMouse(); } diff --git a/interface/src/Audio.cpp b/interface/src/Audio.cpp index 63c683dbb0..4843b2f462 100644 --- a/interface/src/Audio.cpp +++ b/interface/src/Audio.cpp @@ -86,7 +86,8 @@ Audio::Audio(Oscilloscope* scope, int16_t initialJitterBufferSamples, QObject* p void Audio::init(QGLWidget *parent) { _micTextureId = parent->bindTexture(QImage(Application::resourcesPath() + "images/mic.svg")); - _muteTextureId = parent->bindTexture(QImage(Application::resourcesPath() + "images/mute.svg")); + _muteTextureId = parent->bindTexture(QImage(Application::resourcesPath() + "images/mic-mute.svg")); + _boxTextureId = parent->bindTexture(QImage(Application::resourcesPath() + "images/audio-box.svg")); } void Audio::reset() { @@ -817,13 +818,52 @@ void Audio::handleAudioByteArray(const QByteArray& audioByteArray) { // or send to the mixer and use delayed loopback } -void Audio::renderMuteIcon(int x, int y) { +void Audio::renderToolBox(int x, int y, bool boxed) { - _iconBounds = QRect(x, y, MUTE_ICON_SIZE, MUTE_ICON_SIZE); glEnable(GL_TEXTURE_2D); - glBindTexture(GL_TEXTURE_2D, _micTextureId); - glColor3f(.93f, .93f, .93f); + if (boxed) { + + bool isClipping = ((getTimeSinceLastClip() > 0.f) && (getTimeSinceLastClip() < 1.f)); + const int BOX_LEFT_PADDING = 5; + const int BOX_TOP_PADDING = 10; + const int BOX_WIDTH = 266; + const int BOX_HEIGHT = 44; + + QRect boxBounds = QRect(x - BOX_LEFT_PADDING, y - BOX_TOP_PADDING, BOX_WIDTH, BOX_HEIGHT); + + glBindTexture(GL_TEXTURE_2D, _boxTextureId); + + if (isClipping) { + glColor3f(1.f,0.f,0.f); + } else { + glColor3f(.41f,.41f,.41f); + } + glBegin(GL_QUADS); + + glTexCoord2f(1, 1); + glVertex2f(boxBounds.left(), boxBounds.top()); + + glTexCoord2f(0, 1); + glVertex2f(boxBounds.right(), boxBounds.top()); + + glTexCoord2f(0, 0); + glVertex2f(boxBounds.right(), boxBounds.bottom()); + + glTexCoord2f(1, 0); + glVertex2f(boxBounds.left(), boxBounds.bottom()); + + glEnd(); + } + + _iconBounds = QRect(x, y, MUTE_ICON_SIZE, MUTE_ICON_SIZE); + if (!_muted) { + glBindTexture(GL_TEXTURE_2D, _micTextureId); + } else { + glBindTexture(GL_TEXTURE_2D, _muteTextureId); + } + + glColor3f(1,1,1); glBegin(GL_QUADS); glTexCoord2f(1, 1); @@ -840,25 +880,6 @@ void Audio::renderMuteIcon(int x, int y) { glEnd(); - if (_muted) { - glBindTexture(GL_TEXTURE_2D, _muteTextureId); - glBegin(GL_QUADS); - - glTexCoord2f(1, 1); - glVertex2f(_iconBounds.left(), _iconBounds.top()); - - glTexCoord2f(0, 1); - glVertex2f(_iconBounds.right(), _iconBounds.top()); - - glTexCoord2f(0, 0); - glVertex2f(_iconBounds.right(), _iconBounds.bottom()); - - glTexCoord2f(1, 0); - glVertex2f(_iconBounds.left(), _iconBounds.bottom()); - - glEnd(); - } - glDisable(GL_TEXTURE_2D); } diff --git a/interface/src/Audio.h b/interface/src/Audio.h index 88488922f3..c6a3619865 100644 --- a/interface/src/Audio.h +++ b/interface/src/Audio.h @@ -69,7 +69,7 @@ public: void init(QGLWidget *parent = 0); bool mousePressEvent(int x, int y); - void renderMuteIcon(int x, int y); + void renderToolBox(int x, int y, bool boxed); int getNetworkSampleRate() { return SAMPLE_RATE; } int getNetworkBufferLengthSamplesPerChannel() { return NETWORK_BUFFER_LENGTH_SAMPLES_PER_CHANNEL; } @@ -161,6 +161,7 @@ private: bool _localEcho; GLuint _micTextureId; GLuint _muteTextureId; + GLuint _boxTextureId; QRect _iconBounds; // Audio callback in class context. diff --git a/interface/src/ui/RearMirrorTools.cpp b/interface/src/ui/RearMirrorTools.cpp index 314fd7157b..07503c8cb2 100644 --- a/interface/src/ui/RearMirrorTools.cpp +++ b/interface/src/ui/RearMirrorTools.cpp @@ -18,9 +18,8 @@ const char SETTINGS_GROUP_NAME[] = "Rear View Tools"; const char ZOOM_LEVEL_SETTINGS[] = "ZoomLevel"; -const int ICON_SIZE = 20; +const int ICON_SIZE = 24; const int ICON_PADDING = 5; -const int MID_ICON_PADDING = 70; RearMirrorTools::RearMirrorTools(QGLWidget* parent, QRect& bounds, QSettings* settings) : _parent(parent), @@ -29,16 +28,19 @@ RearMirrorTools::RearMirrorTools(QGLWidget* parent, QRect& bounds, QSettings* se _fullScreen(false) { _zoomLevel = HEAD; - _closeTextureId = _parent->bindTexture(QImage(Application::resourcesPath() + "images/close.png")); - _resetTextureId = _parent->bindTexture(QImage(Application::resourcesPath() + "images/reset.png")); - _zoomHeadTextureId = _parent->bindTexture(QImage(Application::resourcesPath() + "images/head.png")); - _zoomBodyTextureId = _parent->bindTexture(QImage(Application::resourcesPath() + "images/body.png")); + _closeTextureId = _parent->bindTexture(QImage(Application::resourcesPath() + "images/close.svg")); + + // Disabled for now https://worklist.net/19548 + // _resetTextureId = _parent->bindTexture(QImage(Application::resourcesPath() + "images/reset.png")); + + _zoomHeadTextureId = _parent->bindTexture(QImage(Application::resourcesPath() + "images/plus.svg")); + _zoomBodyTextureId = _parent->bindTexture(QImage(Application::resourcesPath() + "images/minus.svg")); _shrinkIconRect = QRect(ICON_PADDING, ICON_PADDING, ICON_SIZE, ICON_SIZE); _closeIconRect = QRect(_bounds.left() + ICON_PADDING, _bounds.top() + ICON_PADDING, ICON_SIZE, ICON_SIZE); _resetIconRect = QRect(_bounds.width() - ICON_SIZE - ICON_PADDING, _bounds.top() + ICON_PADDING, ICON_SIZE, ICON_SIZE); - _bodyZoomIconRect = QRect(_bounds.width() - MID_ICON_PADDING - ICON_SIZE, _bounds.bottom() - ICON_PADDING - ICON_SIZE, ICON_SIZE, ICON_SIZE); - _headZoomIconRect = QRect(_bounds.left() + MID_ICON_PADDING, _bounds.bottom() - ICON_PADDING - ICON_SIZE, ICON_SIZE, ICON_SIZE); + _bodyZoomIconRect = QRect(_bounds.width() - ICON_SIZE - ICON_PADDING, _bounds.bottom() - ICON_PADDING - ICON_SIZE, ICON_SIZE, ICON_SIZE); + _headZoomIconRect = QRect(_bounds.left() + ICON_PADDING, _bounds.bottom() - ICON_PADDING - ICON_SIZE, ICON_SIZE, ICON_SIZE); settings->beginGroup(SETTINGS_GROUP_NAME); _zoomLevel = loadSetting(settings, ZOOM_LEVEL_SETTINGS, 0) == HEAD ? HEAD : BODY; @@ -55,7 +57,10 @@ void RearMirrorTools::render(bool fullScreen) { _windowed = _bounds.contains(mousePosition.x(), mousePosition.y()); if (_windowed) { displayIcon(_bounds, _closeIconRect, _closeTextureId); - displayIcon(_bounds, _resetIconRect, _resetTextureId); + + // Disabled for now https://worklist.net/19548 + // displayIcon(_bounds, _resetIconRect, _resetTextureId); + displayIcon(_bounds, _headZoomIconRect, _zoomHeadTextureId, _zoomLevel == HEAD); displayIcon(_bounds, _bodyZoomIconRect, _zoomBodyTextureId, _zoomLevel == BODY); } @@ -69,11 +74,13 @@ bool RearMirrorTools::mousePressEvent(int x, int y) { emit closeView(); return true; } - + + /* Disabled for now https://worklist.net/19548 if (_resetIconRect.contains(x, y)) { emit resetView(); return true; } + */ if (_headZoomIconRect.contains(x, y)) { _zoomLevel = HEAD; @@ -84,7 +91,7 @@ bool RearMirrorTools::mousePressEvent(int x, int y) { _zoomLevel = BODY; return true; } - + if (_bounds.contains(x, y)) { _windowed = false; emit restoreView(); @@ -120,7 +127,7 @@ void RearMirrorTools::displayIcon(QRect bounds, QRect iconBounds, GLuint texture glEnable(GL_TEXTURE_2D); if (selected) { - glColor3f(1, 1, 0); + glColor3f(.5f, .5f, .5f); } else { glColor3f(1, 1, 1); } From f969e050cd294bc70924abcbecaba0eecc1d58b9 Mon Sep 17 00:00:00 2001 From: Stephen Birarda Date: Wed, 9 Apr 2014 09:59:05 -0700 Subject: [PATCH 055/120] add apache license to shader headers --- interface/resources/shaders/ambient_occlusion.frag | 5 ++++- interface/resources/shaders/ambient_occlusion.vert | 5 ++++- interface/resources/shaders/diffuse.frag | 5 ++++- interface/resources/shaders/glow_add.frag | 5 ++++- interface/resources/shaders/glow_add_separate.frag | 5 ++++- interface/resources/shaders/grid.frag | 5 ++++- interface/resources/shaders/horizontal_blur.frag | 5 ++++- interface/resources/shaders/metavoxel_point.vert | 5 ++++- interface/resources/shaders/model.frag | 5 ++++- interface/resources/shaders/model.vert | 5 ++++- interface/resources/shaders/model_normal_map.frag | 5 ++++- interface/resources/shaders/model_normal_map.vert | 5 ++++- interface/resources/shaders/model_shadow.frag | 5 ++++- interface/resources/shaders/model_shadow.vert | 5 ++++- interface/resources/shaders/occlusion_blur.frag | 5 ++++- interface/resources/shaders/oculus.frag | 11 +++++++---- interface/resources/shaders/passthrough.vert | 11 +++++++++++ interface/resources/shaders/perlin_modulate.frag | 5 ++++- interface/resources/shaders/perlin_modulate.vert | 5 ++++- interface/resources/shaders/point_size.vert | 10 ++++++++++ interface/resources/shaders/shadow_map.frag | 5 ++++- interface/resources/shaders/shadow_map.vert | 5 ++++- interface/resources/shaders/skin_model.vert | 5 ++++- .../resources/shaders/skin_model_normal_map.vert | 5 ++++- interface/resources/shaders/skin_model_shadow.vert | 5 ++++- interface/resources/shaders/vertical_blur.frag | 5 ++++- interface/resources/shaders/vertical_blur_add.frag | 5 ++++- interface/resources/shaders/voxel.geom | 10 ++++++++++ 28 files changed, 134 insertions(+), 28 deletions(-) diff --git a/interface/resources/shaders/ambient_occlusion.frag b/interface/resources/shaders/ambient_occlusion.frag index 6e9ed82d95..512922ca43 100644 --- a/interface/resources/shaders/ambient_occlusion.frag +++ b/interface/resources/shaders/ambient_occlusion.frag @@ -5,7 +5,10 @@ // fragment shader // // Created by Andrzej Kapolka on 7/5/13. -// Copyright (c) 2013 High Fidelity, Inc. All rights reserved. +// Copyright 2013 High Fidelity, Inc. +// +// Distributed under the Apache License, Version 2.0. +// See the accompanying file LICENSE or http://www.apache.org/licenses/LICENSE-2.0.html // // the depth texture diff --git a/interface/resources/shaders/ambient_occlusion.vert b/interface/resources/shaders/ambient_occlusion.vert index ca6af718bd..a95a0cda7d 100644 --- a/interface/resources/shaders/ambient_occlusion.vert +++ b/interface/resources/shaders/ambient_occlusion.vert @@ -5,7 +5,10 @@ // vertex shader // // Created by Andrzej Kapolka on 8/16/13. -// Copyright (c) 2013 High Fidelity, Inc. All rights reserved. +// Copyright 2013 High Fidelity, Inc. +// +// Distributed under the Apache License, Version 2.0. +// See the accompanying file LICENSE or http://www.apache.org/licenses/LICENSE-2.0.html // void main(void) { diff --git a/interface/resources/shaders/diffuse.frag b/interface/resources/shaders/diffuse.frag index ebf11dace2..bc88b6598d 100644 --- a/interface/resources/shaders/diffuse.frag +++ b/interface/resources/shaders/diffuse.frag @@ -5,7 +5,10 @@ // fragment shader // // Created by Andrzej Kapolka on 8/14/13. -// Copyright (c) 2013 High Fidelity, Inc. All rights reserved. +// Copyright 2013 High Fidelity, Inc. +// +// Distributed under the Apache License, Version 2.0. +// See the accompanying file LICENSE or http://www.apache.org/licenses/LICENSE-2.0.html // // the texture containing the original color diff --git a/interface/resources/shaders/glow_add.frag b/interface/resources/shaders/glow_add.frag index 0947292109..e8a1b504ea 100644 --- a/interface/resources/shaders/glow_add.frag +++ b/interface/resources/shaders/glow_add.frag @@ -5,7 +5,10 @@ // fragment shader // // Created by Andrzej Kapolka on 8/14/13. -// Copyright (c) 2013 High Fidelity, Inc. All rights reserved. +// Copyright 2013 High Fidelity, Inc. +// +// Distributed under the Apache License, Version 2.0. +// See the accompanying file LICENSE or http://www.apache.org/licenses/LICENSE-2.0.html // // the texture containing the original color diff --git a/interface/resources/shaders/glow_add_separate.frag b/interface/resources/shaders/glow_add_separate.frag index 7b7f538a03..e798a3b11f 100644 --- a/interface/resources/shaders/glow_add_separate.frag +++ b/interface/resources/shaders/glow_add_separate.frag @@ -5,7 +5,10 @@ // fragment shader // // Created by Andrzej Kapolka on 8/14/13. -// Copyright (c) 2013 High Fidelity, Inc. All rights reserved. +// Copyright 2013 High Fidelity, Inc. +// +// Distributed under the Apache License, Version 2.0. +// See the accompanying file LICENSE or http://www.apache.org/licenses/LICENSE-2.0.html // // the texture containing the original color diff --git a/interface/resources/shaders/grid.frag b/interface/resources/shaders/grid.frag index b9e3baccd4..17ad0fed5c 100644 --- a/interface/resources/shaders/grid.frag +++ b/interface/resources/shaders/grid.frag @@ -5,7 +5,10 @@ // fragment shader // // Created by Andrzej Kapolka on 1/21/14. -// Copyright (c) 2014 High Fidelity, Inc. All rights reserved. +// Copyright 2013 High Fidelity, Inc. +// +// Distributed under the Apache License, Version 2.0. +// See the accompanying file LICENSE or http://www.apache.org/licenses/LICENSE-2.0.html // void main(void) { diff --git a/interface/resources/shaders/horizontal_blur.frag b/interface/resources/shaders/horizontal_blur.frag index 695de1a538..916fe4b52d 100644 --- a/interface/resources/shaders/horizontal_blur.frag +++ b/interface/resources/shaders/horizontal_blur.frag @@ -5,7 +5,10 @@ // fragment shader // // Created by Andrzej Kapolka on 8/8/13. -// Copyright (c) 2013 High Fidelity, Inc. All rights reserved. +// Copyright 2013 High Fidelity, Inc. +// +// Distributed under the Apache License, Version 2.0. +// See the accompanying file LICENSE or http://www.apache.org/licenses/LICENSE-2.0.html // // the texture containing the original color diff --git a/interface/resources/shaders/metavoxel_point.vert b/interface/resources/shaders/metavoxel_point.vert index b0472088c0..fa585be099 100644 --- a/interface/resources/shaders/metavoxel_point.vert +++ b/interface/resources/shaders/metavoxel_point.vert @@ -5,7 +5,10 @@ // vertex shader // // Created by Andrzej Kapolka on 12/12/13. -// Copyright (c) 2013 High Fidelity, Inc. All rights reserved. +// Copyright 2013 High Fidelity, Inc. +// +// Distributed under the Apache License, Version 2.0. +// See the accompanying file LICENSE or http://www.apache.org/licenses/LICENSE-2.0.html // uniform float pointScale; diff --git a/interface/resources/shaders/model.frag b/interface/resources/shaders/model.frag index e035f9bfe9..29579d07ac 100644 --- a/interface/resources/shaders/model.frag +++ b/interface/resources/shaders/model.frag @@ -5,7 +5,10 @@ // fragment shader // // Created by Andrzej Kapolka on 10/14/13. -// Copyright (c) 2013 High Fidelity, Inc. All rights reserved. +// Copyright 2013 High Fidelity, Inc. +// +// Distributed under the Apache License, Version 2.0. +// See the accompanying file LICENSE or http://www.apache.org/licenses/LICENSE-2.0.html // // the diffuse texture diff --git a/interface/resources/shaders/model.vert b/interface/resources/shaders/model.vert index d07a657d25..904e3c2a8b 100644 --- a/interface/resources/shaders/model.vert +++ b/interface/resources/shaders/model.vert @@ -5,7 +5,10 @@ // vertex shader // // Created by Andrzej Kapolka on 10/14/13. -// Copyright (c) 2013 High Fidelity, Inc. All rights reserved. +// Copyright 2013 High Fidelity, Inc. +// +// Distributed under the Apache License, Version 2.0. +// See the accompanying file LICENSE or http://www.apache.org/licenses/LICENSE-2.0.html // // the interpolated normal diff --git a/interface/resources/shaders/model_normal_map.frag b/interface/resources/shaders/model_normal_map.frag index 9a0e964500..2a4af2073a 100644 --- a/interface/resources/shaders/model_normal_map.frag +++ b/interface/resources/shaders/model_normal_map.frag @@ -5,7 +5,10 @@ // fragment shader // // Created by Andrzej Kapolka on 10/29/13. -// Copyright (c) 2013 High Fidelity, Inc. All rights reserved. +// Copyright 2013 High Fidelity, Inc. +// +// Distributed under the Apache License, Version 2.0. +// See the accompanying file LICENSE or http://www.apache.org/licenses/LICENSE-2.0.html // // the diffuse texture diff --git a/interface/resources/shaders/model_normal_map.vert b/interface/resources/shaders/model_normal_map.vert index c367a30e06..3607501acf 100644 --- a/interface/resources/shaders/model_normal_map.vert +++ b/interface/resources/shaders/model_normal_map.vert @@ -5,7 +5,10 @@ // vertex shader // // Created by Andrzej Kapolka on 10/14/13. -// Copyright (c) 2013 High Fidelity, Inc. All rights reserved. +// Copyright 2013 High Fidelity, Inc. +// +// Distributed under the Apache License, Version 2.0. +// See the accompanying file LICENSE or http://www.apache.org/licenses/LICENSE-2.0.html // // the tangent vector diff --git a/interface/resources/shaders/model_shadow.frag b/interface/resources/shaders/model_shadow.frag index bcb597b13c..50a4d3895d 100644 --- a/interface/resources/shaders/model_shadow.frag +++ b/interface/resources/shaders/model_shadow.frag @@ -5,7 +5,10 @@ // fragment shader // // Created by Andrzej Kapolka on 3/24/14. -// Copyright (c) 2014 High Fidelity, Inc. All rights reserved. +// Copyright 2013 High Fidelity, Inc. +// +// Distributed under the Apache License, Version 2.0. +// See the accompanying file LICENSE or http://www.apache.org/licenses/LICENSE-2.0.html // void main(void) { diff --git a/interface/resources/shaders/model_shadow.vert b/interface/resources/shaders/model_shadow.vert index ae7e871887..a18f5fcd5d 100644 --- a/interface/resources/shaders/model_shadow.vert +++ b/interface/resources/shaders/model_shadow.vert @@ -5,7 +5,10 @@ // vertex shader // // Created by Andrzej Kapolka on 3/24/14. -// Copyright (c) 2014 High Fidelity, Inc. All rights reserved. +// Copyright 2014 High Fidelity, Inc. +// +// Distributed under the Apache License, Version 2.0. +// See the accompanying file LICENSE or http://www.apache.org/licenses/LICENSE-2.0.html // void main(void) { diff --git a/interface/resources/shaders/occlusion_blur.frag b/interface/resources/shaders/occlusion_blur.frag index 5b86aec68d..ab4b656e71 100644 --- a/interface/resources/shaders/occlusion_blur.frag +++ b/interface/resources/shaders/occlusion_blur.frag @@ -5,7 +5,10 @@ // fragment shader // // Created by Andrzej Kapolka on 8/16/13. -// Copyright (c) 2013 High Fidelity, Inc. All rights reserved. +// Copyright 2013 High Fidelity, Inc. +// +// Distributed under the Apache License, Version 2.0. +// See the accompanying file LICENSE or http://www.apache.org/licenses/LICENSE-2.0.html // // the original texture diff --git a/interface/resources/shaders/oculus.frag b/interface/resources/shaders/oculus.frag index 3e7d1a4c3e..f2b066a974 100644 --- a/interface/resources/shaders/oculus.frag +++ b/interface/resources/shaders/oculus.frag @@ -5,11 +5,14 @@ // fragment shader // // Created by Andrzej Kapolka on 11/26/13. -// Copyright (c) 2013 High Fidelity, Inc. All rights reserved. +// Copyright 2013 High Fidelity, Inc. // -// this shader is an adaptation (HLSL -> GLSL, removed conditional) of the one in the Oculus sample -// code (Samples/OculusRoomTiny/RenderTiny_D3D1X_Device.cpp), which is under the Apache license -// (http://www.apache.org/licenses/LICENSE-2.0) +// this shader is an adaptation (HLSL -> GLSL, removed conditional) of the one in the Oculus sample +// code (Samples/OculusRoomTiny/RenderTiny_D3D1X_Device.cpp), which is under the Apache license +// (http://www.apache.org/licenses/LICENSE-2.0) +// +// Distributed under the Apache License, Version 2.0. +// See the accompanying file LICENSE or http://www.apache.org/licenses/LICENSE-2.0.html // uniform sampler2D texture; diff --git a/interface/resources/shaders/passthrough.vert b/interface/resources/shaders/passthrough.vert index f3d5c5b504..bb0a18eefa 100644 --- a/interface/resources/shaders/passthrough.vert +++ b/interface/resources/shaders/passthrough.vert @@ -1,4 +1,15 @@ #version 120 + +// +// passthrough.vert +// vertex shader +// +// Copyright 2013 High Fidelity, Inc. +// +// +// Distributed under the Apache License, Version 2.0. +// See the accompanying file LICENSE or http://www.apache.org/licenses/LICENSE-2.0.html +// attribute float voxelSizeIn; varying float voxelSize; diff --git a/interface/resources/shaders/perlin_modulate.frag b/interface/resources/shaders/perlin_modulate.frag index 8ead57c238..8693b14e1b 100644 --- a/interface/resources/shaders/perlin_modulate.frag +++ b/interface/resources/shaders/perlin_modulate.frag @@ -5,7 +5,10 @@ // fragment shader // // Created by Andrzej Kapolka on 5/15/13. -// Copyright (c) 2013 High Fidelity, Inc. All rights reserved. +// Copyright 2013 High Fidelity, Inc. +// +// Distributed under the Apache License, Version 2.0. +// See the accompanying file LICENSE or http://www.apache.org/licenses/LICENSE-2.0.html // // the texture containing our permutations and normals diff --git a/interface/resources/shaders/perlin_modulate.vert b/interface/resources/shaders/perlin_modulate.vert index 5cf87fc5fd..428615017a 100644 --- a/interface/resources/shaders/perlin_modulate.vert +++ b/interface/resources/shaders/perlin_modulate.vert @@ -5,7 +5,10 @@ // vertex shader // // Created by Andrzej Kapolka on 5/15/13. -// Copyright (c) 2013 High Fidelity, Inc. All rights reserved. +// Copyright 2013 High Fidelity, Inc. +// +// Distributed under the Apache License, Version 2.0. +// See the accompanying file LICENSE or http://www.apache.org/licenses/LICENSE-2.0.html // // the position in model space diff --git a/interface/resources/shaders/point_size.vert b/interface/resources/shaders/point_size.vert index 9c93385768..88c56bf0c4 100644 --- a/interface/resources/shaders/point_size.vert +++ b/interface/resources/shaders/point_size.vert @@ -1,4 +1,14 @@ #version 120 + +// +// point_size.vert +// vertex shader +// +// Copyright 2013 High Fidelity, Inc. +// +// Distributed under the Apache License, Version 2.0. +// See the accompanying file LICENSE or http://www.apache.org/licenses/LICENSE-2.0.html +// attribute float voxelSizeIn; varying float voxelSize; diff --git a/interface/resources/shaders/shadow_map.frag b/interface/resources/shaders/shadow_map.frag index b683ed5af2..70c459ecf8 100644 --- a/interface/resources/shaders/shadow_map.frag +++ b/interface/resources/shaders/shadow_map.frag @@ -5,7 +5,10 @@ // fragment shader // // Created by Andrzej Kapolka on 11/21/13. -// Copyright (c) 2013 High Fidelity, Inc. All rights reserved. +// Copyright 2013 High Fidelity, Inc. +// +// Distributed under the Apache License, Version 2.0. +// See the accompanying file LICENSE or http://www.apache.org/licenses/LICENSE-2.0.html // uniform sampler2DShadow shadowMap; diff --git a/interface/resources/shaders/shadow_map.vert b/interface/resources/shaders/shadow_map.vert index 6809ca6e2b..abe5f99b44 100644 --- a/interface/resources/shaders/shadow_map.vert +++ b/interface/resources/shaders/shadow_map.vert @@ -5,7 +5,10 @@ // vertex shader // // Created by Andrzej Kapolka on 3/27/14. -// Copyright (c) 2014 High Fidelity, Inc. All rights reserved. +// Copyright 2014 High Fidelity, Inc. +// +// Distributed under the Apache License, Version 2.0. +// See the accompanying file LICENSE or http://www.apache.org/licenses/LICENSE-2.0.html // varying vec4 shadowColor; diff --git a/interface/resources/shaders/skin_model.vert b/interface/resources/shaders/skin_model.vert index 57e3928241..12320ba9a9 100644 --- a/interface/resources/shaders/skin_model.vert +++ b/interface/resources/shaders/skin_model.vert @@ -5,7 +5,10 @@ // vertex shader // // Created by Andrzej Kapolka on 10/14/13. -// Copyright (c) 2013 High Fidelity, Inc. All rights reserved. +// Copyright 2013 High Fidelity, Inc. +// +// Distributed under the Apache License, Version 2.0. +// See the accompanying file LICENSE or http://www.apache.org/licenses/LICENSE-2.0.html // const int MAX_CLUSTERS = 128; diff --git a/interface/resources/shaders/skin_model_normal_map.vert b/interface/resources/shaders/skin_model_normal_map.vert index 97e21dae73..872cbe2fc3 100644 --- a/interface/resources/shaders/skin_model_normal_map.vert +++ b/interface/resources/shaders/skin_model_normal_map.vert @@ -5,7 +5,10 @@ // vertex shader // // Created by Andrzej Kapolka on 10/29/13. -// Copyright (c) 2013 High Fidelity, Inc. All rights reserved. +// Copyright 2013 High Fidelity, Inc. +// +// Distributed under the Apache License, Version 2.0. +// See the accompanying file LICENSE or http://www.apache.org/licenses/LICENSE-2.0.html // const int MAX_CLUSTERS = 128; diff --git a/interface/resources/shaders/skin_model_shadow.vert b/interface/resources/shaders/skin_model_shadow.vert index b9ef05ad8a..6d9d5ebbf5 100644 --- a/interface/resources/shaders/skin_model_shadow.vert +++ b/interface/resources/shaders/skin_model_shadow.vert @@ -5,7 +5,10 @@ // vertex shader // // Created by Andrzej Kapolka on 3/24/14. -// Copyright (c) 2014 High Fidelity, Inc. All rights reserved. +// Copyright 2014 High Fidelity, Inc. +// +// Distributed under the Apache License, Version 2.0. +// See the accompanying file LICENSE or http://www.apache.org/licenses/LICENSE-2.0.html // const int MAX_CLUSTERS = 128; diff --git a/interface/resources/shaders/vertical_blur.frag b/interface/resources/shaders/vertical_blur.frag index 96ab95ea9e..1b8c447cc7 100644 --- a/interface/resources/shaders/vertical_blur.frag +++ b/interface/resources/shaders/vertical_blur.frag @@ -5,7 +5,10 @@ // fragment shader // // Created by Andrzej Kapolka on 8/14/13. -// Copyright (c) 2013 High Fidelity, Inc. All rights reserved. +// Copyright 2013 High Fidelity, Inc. +// +// Distributed under the Apache License, Version 2.0. +// See the accompanying file LICENSE or http://www.apache.org/licenses/LICENSE-2.0.html // // the texture containing the horizontally blurred color diff --git a/interface/resources/shaders/vertical_blur_add.frag b/interface/resources/shaders/vertical_blur_add.frag index 5cda2622b4..919e9d1268 100644 --- a/interface/resources/shaders/vertical_blur_add.frag +++ b/interface/resources/shaders/vertical_blur_add.frag @@ -5,7 +5,10 @@ // fragment shader // // Created by Andrzej Kapolka on 8/8/13. -// Copyright (c) 2013 High Fidelity, Inc. All rights reserved. +// Copyright 2013 High Fidelity, Inc. +// +// Distributed under the Apache License, Version 2.0. +// See the accompanying file LICENSE or http://www.apache.org/licenses/LICENSE-2.0.html // // the texture containing the original color diff --git a/interface/resources/shaders/voxel.geom b/interface/resources/shaders/voxel.geom index ca8f729542..4c850ed608 100644 --- a/interface/resources/shaders/voxel.geom +++ b/interface/resources/shaders/voxel.geom @@ -1,6 +1,16 @@ #version 120 #extension GL_ARB_geometry_shader4 : enable +// +// voxel.geom +// geometry shader +// +// Copyright 2013 High Fidelity, Inc. +// +// Distributed under the Apache License, Version 2.0. +// See the accompanying file LICENSE or http://www.apache.org/licenses/LICENSE-2.0.html +// + // // VOXEL GEOMETRY SHADER // From b8bfe325a029fe78372df7198cf33d8657f4b9f9 Mon Sep 17 00:00:00 2001 From: Stephen Birarda Date: Wed, 9 Apr 2014 10:03:26 -0700 Subject: [PATCH 056/120] add back code blow away in regex replacements --- interface/src/Physics.cpp | 26 ++++++++++++++++++++++++-- 1 file changed, 24 insertions(+), 2 deletions(-) diff --git a/interface/src/Physics.cpp b/interface/src/Physics.cpp index a9f9f6b17d..30ea829c4e 100644 --- a/interface/src/Physics.cpp +++ b/interface/src/Physics.cpp @@ -8,6 +8,29 @@ // See the accompanying file LICENSE or http://www.apache.org/licenses/LICENSE-2.0.html // +#include +#include + +#include "Util.h" +#include "world.h" +#include "Physics.h" + +// +// Applies static friction: maxVelocity is the largest velocity for which there +// there is friction, and strength is the amount of friction force applied to reduce +// velocity. +// +void applyStaticFriction(float deltaTime, glm::vec3& velocity, float maxVelocity, float strength) { + float v = glm::length(velocity); + if (v < maxVelocity) { + velocity *= glm::clamp((1.0f - deltaTime * strength * (1.f - v / maxVelocity)), 0.0f, 1.0f); + } +} + +// +// Applies velocity damping, with a strength value for linear and squared velocity damping +// + void applyDamping(float deltaTime, glm::vec3& velocity, float linearStrength, float squaredStrength) { if (squaredStrength == 0.f) { velocity *= glm::clamp(1.f - deltaTime * linearStrength, 0.f, 1.f); @@ -18,5 +41,4 @@ void applyDamping(float deltaTime, glm::vec3& velocity, float linearStrength, fl void applyDampedSpring(float deltaTime, glm::vec3& velocity, glm::vec3& position, glm::vec3& targetPosition, float k, float damping) { -} - +} \ No newline at end of file From b5a641d60f022a1778d4260c2e55b9d97817a8f9 Mon Sep 17 00:00:00 2001 From: Stephen Birarda Date: Wed, 9 Apr 2014 10:04:19 -0700 Subject: [PATCH 057/120] add back Util code blown away in merge --- interface/src/Util.cpp | 34 +++++++++++++++++++++++++++++++++- 1 file changed, 33 insertions(+), 1 deletion(-) diff --git a/interface/src/Util.cpp b/interface/src/Util.cpp index 4fe5636329..36e39a46a5 100644 --- a/interface/src/Util.cpp +++ b/interface/src/Util.cpp @@ -9,6 +9,38 @@ // See the accompanying file LICENSE or http://www.apache.org/licenses/LICENSE-2.0.html // +#include +#include +#include +#include + +#include +#include +#include +#include + +#include + +#include "InterfaceConfig.h" +#include "ui/TextRenderer.h" +#include "VoxelConstants.h" +#include "world.h" + +#include "Util.h" + +using namespace std; + +// no clue which versions are affected... +#define WORKAROUND_BROKEN_GLUT_STROKES +// see http://www.opengl.org/resources/libraries/glut/spec3/node78.html + +void eulerToOrthonormals(glm::vec3 * angles, glm::vec3 * front, glm::vec3 * right, glm::vec3 * up) { + // + // Converts from three euler angles to the associated orthonormal vectors + // + // Angles contains (pitch, yaw, roll) in radians + // + // First, create the quaternion associated with these euler angles glm::quat q(glm::vec3(angles->x, -(angles->y), angles->z)); @@ -597,4 +629,4 @@ bool pointInSphere(glm::vec3& point, glm::vec3& sphereCenter, double sphereRadiu return true; } return false; -} +} \ No newline at end of file From d2c6ea238ee75772f4324885e64ac26c18f300b3 Mon Sep 17 00:00:00 2001 From: Stephen Birarda Date: Wed, 9 Apr 2014 10:10:00 -0700 Subject: [PATCH 058/120] repairs to starfield headers --- interface/src/starfield/Config.h | 6 ++++-- interface/src/starfield/Controller.h | 1 + interface/src/starfield/data/GpuVertex.cpp | 1 + interface/src/starfield/data/GpuVertex.h | 1 + interface/src/starfield/data/InputVertex.cpp | 3 ++- interface/src/starfield/data/InputVertex.h | 1 + interface/src/starfield/renderer/Renderer.cpp | 1 + interface/src/starfield/renderer/Renderer.h | 1 + interface/src/starfield/renderer/VertexOrder.cpp | 1 + 9 files changed, 13 insertions(+), 3 deletions(-) diff --git a/interface/src/starfield/Config.h b/interface/src/starfield/Config.h index 6f44f24093..a44006fb17 100755 --- a/interface/src/starfield/Config.h +++ b/interface/src/starfield/Config.h @@ -9,6 +9,9 @@ // See the accompanying file LICENSE or http://www.apache.org/licenses/LICENSE-2.0.html // +#ifndef __interface__starfield__Config__ +#define __interface__starfield__Config__ + #include "InterfaceConfig.h" #include "renderer/ProgramObject.h" @@ -55,5 +58,4 @@ namespace starfield { } -#endif - +#endif \ No newline at end of file diff --git a/interface/src/starfield/Controller.h b/interface/src/starfield/Controller.h index 12963fa2e2..b994d48580 100755 --- a/interface/src/starfield/Controller.h +++ b/interface/src/starfield/Controller.h @@ -3,6 +3,7 @@ // interface/src/starfield // // Created by Tobias Schwinger on 3/29/13. +// Modified by Chris Barnard on 10/16/13. // Copyright 2013 High Fidelity, Inc. // // Distributed under the Apache License, Version 2.0. diff --git a/interface/src/starfield/data/GpuVertex.cpp b/interface/src/starfield/data/GpuVertex.cpp index 5c1a8ea711..b7fee1f2b1 100755 --- a/interface/src/starfield/data/GpuVertex.cpp +++ b/interface/src/starfield/data/GpuVertex.cpp @@ -3,6 +3,7 @@ // interface/src/starfield/data // // Created by Chris Barnard on 10/17/13. +// Based on code by Tobias Schwinger on 3/29/13. // Copyright 2013 High Fidelity, Inc. // // Distributed under the Apache License, Version 2.0. diff --git a/interface/src/starfield/data/GpuVertex.h b/interface/src/starfield/data/GpuVertex.h index 7c435a559f..71cef97061 100755 --- a/interface/src/starfield/data/GpuVertex.h +++ b/interface/src/starfield/data/GpuVertex.h @@ -3,6 +3,7 @@ // interface/src/starfield/data // // Created by Tobias Schwinger on 3/29/13. +// Modified by Chris Barnard on 10/17/13. // Copyright 2013 High Fidelity, Inc. // // Distributed under the Apache License, Version 2.0. diff --git a/interface/src/starfield/data/InputVertex.cpp b/interface/src/starfield/data/InputVertex.cpp index ffb7e725fc..5dead34beb 100755 --- a/interface/src/starfield/data/InputVertex.cpp +++ b/interface/src/starfield/data/InputVertex.cpp @@ -2,7 +2,8 @@ // InputVertex.cpp // interface/src/starfield/data // -// Created by Chris Barnard on 10/17. +// Created by Chris Barnard on 10/17/13. +// Based on code by Tobias Schwinger 3/29/13. // Copyright 2013 High Fidelity, Inc. // // Distributed under the Apache License, Version 2.0. diff --git a/interface/src/starfield/data/InputVertex.h b/interface/src/starfield/data/InputVertex.h index 01b15c297f..f78f3ea136 100755 --- a/interface/src/starfield/data/InputVertex.h +++ b/interface/src/starfield/data/InputVertex.h @@ -3,6 +3,7 @@ // interface/src/starfield/data // // Created by Tobias Schwinger on 3/29/13. +// Modified by Chris Barnard on 10/17/13. // Copyright 2013 High Fidelity, Inc. // // Distributed under the Apache License, Version 2.0. diff --git a/interface/src/starfield/renderer/Renderer.cpp b/interface/src/starfield/renderer/Renderer.cpp index c571cb0977..034a571814 100755 --- a/interface/src/starfield/renderer/Renderer.cpp +++ b/interface/src/starfield/renderer/Renderer.cpp @@ -3,6 +3,7 @@ // interface/src/starfield/renderer // // Created by Chris Barnard on 10/17/13. +// Based on earlier work by Tobias Schwinger 3/22/13. // Copyright 2013 High Fidelity, Inc. // // Distributed under the Apache License, Version 2.0. diff --git a/interface/src/starfield/renderer/Renderer.h b/interface/src/starfield/renderer/Renderer.h index 8b75f4e953..2494377180 100755 --- a/interface/src/starfield/renderer/Renderer.h +++ b/interface/src/starfield/renderer/Renderer.h @@ -3,6 +3,7 @@ // interface/src/starfield/renderer // // Created by Tobias Schwinger on 3/22/13. +// Modified by Chris Barnard on 10/17/13. // Copyright 2013 High Fidelity, Inc. // // Distributed under the Apache License, Version 2.0. diff --git a/interface/src/starfield/renderer/VertexOrder.cpp b/interface/src/starfield/renderer/VertexOrder.cpp index baffb81f4e..ec36f1eea2 100755 --- a/interface/src/starfield/renderer/VertexOrder.cpp +++ b/interface/src/starfield/renderer/VertexOrder.cpp @@ -3,6 +3,7 @@ // interface/src/starfield/renderer // // Created by Chris Barnard on 10/17/13. +// Based on code by Tobias Schwinger on 3/22/13. // Copyright 2013 High Fidelity, Inc. // // Distributed under the Apache License, Version 2.0. From 86d236faef58bcd6be422885d809f6798112a7cf Mon Sep 17 00:00:00 2001 From: Stephen Birarda Date: Wed, 9 Apr 2014 10:11:04 -0700 Subject: [PATCH 059/120] repairs to date and author name in RearMirrorTools --- interface/src/ui/RearMirrorTools.cpp | 2 +- interface/src/ui/RearMirrorTools.h | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/interface/src/ui/RearMirrorTools.cpp b/interface/src/ui/RearMirrorTools.cpp index e52d59e81a..d416805e6f 100644 --- a/interface/src/ui/RearMirrorTools.cpp +++ b/interface/src/ui/RearMirrorTools.cpp @@ -2,7 +2,7 @@ // RearMirrorTools.cpp // interface/src/ui // -// Created by stojce on 23. +// Created by Stojce Slavkovski on 10/23/2013. // Copyright 2013 High Fidelity, Inc. // // Distributed under the Apache License, Version 2.0. diff --git a/interface/src/ui/RearMirrorTools.h b/interface/src/ui/RearMirrorTools.h index 6230771b4b..a25aeec1bd 100644 --- a/interface/src/ui/RearMirrorTools.h +++ b/interface/src/ui/RearMirrorTools.h @@ -2,7 +2,7 @@ // RearMirrorTools.h // interface/src/ui // -// Created by stojce on 10/23/2013. +// Created by Stojce Slavkovski on 10/23/2013. // Copyright 2013 High Fidelity, Inc. // // Distributed under the Apache License, Version 2.0. From 11c235a29e6b1acdaa3ae444f78db6b5504cffbb Mon Sep 17 00:00:00 2001 From: Stephen Birarda Date: Wed, 9 Apr 2014 10:16:56 -0700 Subject: [PATCH 060/120] fixes to source files for code remove in regex replace --- libraries/octree/src/CoverageMap.cpp | 37 +++- libraries/shared/src/GeometryUtil.cpp | 293 +++++++++++++++++++++++++- 2 files changed, 328 insertions(+), 2 deletions(-) diff --git a/libraries/octree/src/CoverageMap.cpp b/libraries/octree/src/CoverageMap.cpp index 88d2292812..65d5734b68 100644 --- a/libraries/octree/src/CoverageMap.cpp +++ b/libraries/octree/src/CoverageMap.cpp @@ -9,6 +9,41 @@ // See the accompanying file LICENSE or http://www.apache.org/licenses/LICENSE-2.0.html // +#include + +#include + +#include + +#include "CoverageMap.h" + +int CoverageMap::_mapCount = 0; +int CoverageMap::_checkMapRootCalls = 0; +int CoverageMap::_notAllInView = 0; +bool CoverageMap::wantDebugging = false; + +const int MAX_POLYGONS_PER_REGION = 50; + +const BoundingBox CoverageMap::ROOT_BOUNDING_BOX = BoundingBox(glm::vec2(-1.f,-1.f), glm::vec2(2.f,2.f)); + +// Coverage Map's polygon coordinates are from -1 to 1 in the following mapping to screen space. +// +// (0,0) (windowWidth, 0) +// -1,1 1,1 +// +-----------------------+ +// | | | +// | | | +// | -1,0 | | +// |-----------+-----------| +// | 0,0 | +// | | | +// | | | +// | | | +// +-----------------------+ +// -1,-1 1,-1 +// (0,windowHeight) (windowWidth,windowHeight) +// + // Choosing a minimum sized polygon. Since we know a typical window is approximately 1500 pixels wide // then a pixel on our screen will be ~ 2.0/1500 or 0.0013 "units" wide, similarly pixels are typically // about that tall as well. If we say that polygons should be at least 10x10 pixels to be considered "big enough" @@ -523,4 +558,4 @@ CoverageMapStorageResult CoverageRegion::checkRegion(OctreeProjectedPolygon* pol } } return result; -} +} \ No newline at end of file diff --git a/libraries/shared/src/GeometryUtil.cpp b/libraries/shared/src/GeometryUtil.cpp index d586dad90e..cb2e829811 100644 --- a/libraries/shared/src/GeometryUtil.cpp +++ b/libraries/shared/src/GeometryUtil.cpp @@ -9,6 +9,297 @@ // See the accompanying file LICENSE or http://www.apache.org/licenses/LICENSE-2.0.html // +#include +#include + +#include "SharedUtil.h" +#include "GeometryUtil.h" + +glm::vec3 computeVectorFromPointToSegment(const glm::vec3& point, const glm::vec3& start, const glm::vec3& end) { + // compute the projection of the point vector onto the segment vector + glm::vec3 segmentVector = end - start; + float lengthSquared = glm::dot(segmentVector, segmentVector); + if (lengthSquared < EPSILON) { + return start - point; // start and end the same + } + float proj = glm::dot(point - start, segmentVector) / lengthSquared; + if (proj <= 0.0f) { // closest to the start + return start - point; + + } else if (proj >= 1.0f) { // closest to the end + return end - point; + + } else { // closest to the middle + return start + segmentVector*proj - point; + } +} + +// Computes the penetration between a point and a sphere (centered at the origin) +// if point is inside sphere: returns true and stores the result in 'penetration' +// (the vector that would move the point outside the sphere) +// otherwise returns false +bool findSpherePenetration(const glm::vec3& point, const glm::vec3& defaultDirection, float sphereRadius, + glm::vec3& penetration) { + float vectorLength = glm::length(point); + if (vectorLength < EPSILON) { + penetration = defaultDirection * sphereRadius; + return true; + } + float distance = vectorLength - sphereRadius; + if (distance < 0.0f) { + penetration = point * (-distance / vectorLength); + return true; + } + return false; +} + +bool findSpherePointPenetration(const glm::vec3& sphereCenter, float sphereRadius, + const glm::vec3& point, glm::vec3& penetration) { + return findSpherePenetration(point - sphereCenter, glm::vec3(0.0f, -1.0f, 0.0f), sphereRadius, penetration); +} + +bool findPointSpherePenetration(const glm::vec3& point, const glm::vec3& sphereCenter, + float sphereRadius, glm::vec3& penetration) { + return findSpherePenetration(sphereCenter - point, glm::vec3(0.0f, -1.0f, 0.0f), sphereRadius, penetration); +} + +bool findSphereSpherePenetration(const glm::vec3& firstCenter, float firstRadius, + const glm::vec3& secondCenter, float secondRadius, glm::vec3& penetration) { + return findSpherePointPenetration(firstCenter, firstRadius + secondRadius, secondCenter, penetration); +} + +bool findSphereSegmentPenetration(const glm::vec3& sphereCenter, float sphereRadius, + const glm::vec3& segmentStart, const glm::vec3& segmentEnd, glm::vec3& penetration) { + return findSpherePenetration(computeVectorFromPointToSegment(sphereCenter, segmentStart, segmentEnd), + glm::vec3(0.0f, -1.0f, 0.0f), sphereRadius, penetration); +} + +bool findSphereCapsulePenetration(const glm::vec3& sphereCenter, float sphereRadius, const glm::vec3& capsuleStart, + const glm::vec3& capsuleEnd, float capsuleRadius, glm::vec3& penetration) { + return findSphereSegmentPenetration(sphereCenter, sphereRadius + capsuleRadius, + capsuleStart, capsuleEnd, penetration); +} + +bool findPointCapsuleConePenetration(const glm::vec3& point, const glm::vec3& capsuleStart, + const glm::vec3& capsuleEnd, float startRadius, float endRadius, glm::vec3& penetration) { + // compute the projection of the point vector onto the segment vector + glm::vec3 segmentVector = capsuleEnd - capsuleStart; + float lengthSquared = glm::dot(segmentVector, segmentVector); + if (lengthSquared < EPSILON) { // start and end the same + return findPointSpherePenetration(point, capsuleStart, + glm::max(startRadius, endRadius), penetration); + } + float proj = glm::dot(point - capsuleStart, segmentVector) / lengthSquared; + if (proj <= 0.0f) { // closest to the start + return findPointSpherePenetration(point, capsuleStart, startRadius, penetration); + + } else if (proj >= 1.0f) { // closest to the end + return findPointSpherePenetration(point, capsuleEnd, endRadius, penetration); + + } else { // closest to the middle + return findPointSpherePenetration(point, capsuleStart + segmentVector * proj, + glm::mix(startRadius, endRadius, proj), penetration); + } +} + +bool findSphereCapsuleConePenetration(const glm::vec3& sphereCenter, + float sphereRadius, const glm::vec3& capsuleStart, const glm::vec3& capsuleEnd, + float startRadius, float endRadius, glm::vec3& penetration) { + return findPointCapsuleConePenetration(sphereCenter, capsuleStart, capsuleEnd, + startRadius + sphereRadius, endRadius + sphereRadius, penetration); +} + +bool findSpherePlanePenetration(const glm::vec3& sphereCenter, float sphereRadius, + const glm::vec4& plane, glm::vec3& penetration) { + float distance = glm::dot(plane, glm::vec4(sphereCenter, 1.0f)) - sphereRadius; + if (distance < 0.0f) { + penetration = glm::vec3(plane) * distance; + return true; + } + return false; +} + +bool findSphereDiskPenetration(const glm::vec3& sphereCenter, float sphereRadius, + const glm::vec3& diskCenter, float diskRadius, float diskThickness, const glm::vec3& diskNormal, + glm::vec3& penetration) { + glm::vec3 localCenter = sphereCenter - diskCenter; + float axialDistance = glm::dot(localCenter, diskNormal); + if (std::fabs(axialDistance) < (sphereRadius + 0.5f * diskThickness)) { + // sphere hit the plane, but does it hit the disk? + // Note: this algorithm ignores edge hits. + glm::vec3 axialOffset = axialDistance * diskNormal; + if (glm::length(localCenter - axialOffset) < diskRadius) { + // yes, hit the disk + penetration = (std::fabs(axialDistance) - (sphereRadius + 0.5f * diskThickness) ) * diskNormal; + if (axialDistance < 0.f) { + // hit the backside of the disk, so negate penetration vector + penetration *= -1.f; + } + return true; + } + } + return false; +} + +bool findCapsuleSpherePenetration(const glm::vec3& capsuleStart, const glm::vec3& capsuleEnd, float capsuleRadius, + const glm::vec3& sphereCenter, float sphereRadius, glm::vec3& penetration) { + if (findSphereCapsulePenetration(sphereCenter, sphereRadius, + capsuleStart, capsuleEnd, capsuleRadius, penetration)) { + penetration = -penetration; + return true; + } + return false; +} + +bool findCapsulePlanePenetration(const glm::vec3& capsuleStart, const glm::vec3& capsuleEnd, float capsuleRadius, + const glm::vec4& plane, glm::vec3& penetration) { + float distance = glm::min(glm::dot(plane, glm::vec4(capsuleStart, 1.0f)), + glm::dot(plane, glm::vec4(capsuleEnd, 1.0f))) - capsuleRadius; + if (distance < 0.0f) { + penetration = glm::vec3(plane) * distance; + return true; + } + return false; +} + +glm::vec3 addPenetrations(const glm::vec3& currentPenetration, const glm::vec3& newPenetration) { + // find the component of the new penetration in the direction of the current + float currentLength = glm::length(currentPenetration); + if (currentLength == 0.0f) { + return newPenetration; + } + glm::vec3 currentDirection = currentPenetration / currentLength; + float directionalComponent = glm::dot(newPenetration, currentDirection); + + // if orthogonal or in the opposite direction, we can simply add + if (directionalComponent <= 0.0f) { + return currentPenetration + newPenetration; + } + + // otherwise, we need to take the maximum component of current and new + return currentDirection * glm::max(directionalComponent, currentLength) + + newPenetration - (currentDirection * directionalComponent); +} + +bool findRaySphereIntersection(const glm::vec3& origin, const glm::vec3& direction, + const glm::vec3& center, float radius, float& distance) { + glm::vec3 relativeOrigin = origin - center; + float c = glm::dot(relativeOrigin, relativeOrigin) - radius * radius; + if (c < 0.0f) { + distance = 0.0f; + return true; // starts inside the sphere + } + float b = glm::dot(direction, relativeOrigin); + float radicand = b * b - c; + if (radicand < 0.0f) { + return false; // doesn't hit the sphere + } + float t = -b - sqrtf(radicand); + if (t < 0.0f) { + return false; // doesn't hit the sphere + } + distance = t; + return true; +} + +bool findRayCapsuleIntersection(const glm::vec3& origin, const glm::vec3& direction, + const glm::vec3& start, const glm::vec3& end, float radius, float& distance) { + if (start == end) { + return findRaySphereIntersection(origin, direction, start, radius, distance); // handle degenerate case + } + glm::vec3 relativeOrigin = origin - start; + glm::vec3 relativeEnd = end - start; + float capsuleLength = glm::length(relativeEnd); + relativeEnd /= capsuleLength; + float originProjection = glm::dot(relativeEnd, relativeOrigin); + glm::vec3 constant = relativeOrigin - relativeEnd * originProjection; + float c = glm::dot(constant, constant) - radius * radius; + if (c < 0.0f) { // starts inside cylinder + if (originProjection < 0.0f) { // below start + return findRaySphereIntersection(origin, direction, start, radius, distance); + + } else if (originProjection > capsuleLength) { // above end + return findRaySphereIntersection(origin, direction, end, radius, distance); + + } else { // between start and end + distance = 0.0f; + return true; + } + } + glm::vec3 coefficient = direction - relativeEnd * glm::dot(relativeEnd, direction); + float a = glm::dot(coefficient, coefficient); + if (a == 0.0f) { + return false; // parallel to enclosing cylinder + } + float b = 2.0f * glm::dot(constant, coefficient); + float radicand = b * b - 4.0f * a * c; + if (radicand < 0.0f) { + return false; // doesn't hit the enclosing cylinder + } + float t = (-b - sqrtf(radicand)) / (2.0f * a); + if (t < 0.0f) { + return false; // doesn't hit the enclosing cylinder + } + glm::vec3 intersection = relativeOrigin + direction * t; + float intersectionProjection = glm::dot(relativeEnd, intersection); + if (intersectionProjection < 0.0f) { // below start + return findRaySphereIntersection(origin, direction, start, radius, distance); + + } else if (intersectionProjection > capsuleLength) { // above end + return findRaySphereIntersection(origin, direction, end, radius, distance); + } + distance = t; // between start and end + return true; +} + +// Do line segments (r1p1.x, r1p1.y)--(r1p2.x, r1p2.y) and (r2p1.x, r2p1.y)--(r2p2.x, r2p2.y) intersect? +// from: http://ptspts.blogspot.com/2010/06/how-to-determine-if-two-line-segments.html +bool doLineSegmentsIntersect(glm::vec2 r1p1, glm::vec2 r1p2, glm::vec2 r2p1, glm::vec2 r2p2) { + int d1 = computeDirection(r2p1.x, r2p1.y, r2p2.x, r2p2.y, r1p1.x, r1p1.y); + int d2 = computeDirection(r2p1.x, r2p1.y, r2p2.x, r2p2.y, r1p2.x, r1p2.y); + int d3 = computeDirection(r1p1.x, r1p1.y, r1p2.x, r1p2.y, r2p1.x, r2p1.y); + int d4 = computeDirection(r1p1.x, r1p1.y, r1p2.x, r1p2.y, r2p2.x, r2p2.y); + return (((d1 > 0 && d2 < 0) || (d1 < 0 && d2 > 0)) && + ((d3 > 0 && d4 < 0) || (d3 < 0 && d4 > 0))) || + (d1 == 0 && isOnSegment(r2p1.x, r2p1.y, r2p2.x, r2p2.y, r1p1.x, r1p1.y)) || + (d2 == 0 && isOnSegment(r2p1.x, r2p1.y, r2p2.x, r2p2.y, r1p2.x, r1p2.y)) || + (d3 == 0 && isOnSegment(r1p1.x, r1p1.y, r1p2.x, r1p2.y, r2p1.x, r2p1.y)) || + (d4 == 0 && isOnSegment(r1p1.x, r1p1.y, r1p2.x, r1p2.y, r2p2.x, r2p2.y)); +} + +bool isOnSegment(float xi, float yi, float xj, float yj, float xk, float yk) { + return (xi <= xk || xj <= xk) && (xk <= xi || xk <= xj) && + (yi <= yk || yj <= yk) && (yk <= yi || yk <= yj); +} + +int computeDirection(float xi, float yi, float xj, float yj, float xk, float yk) { + float a = (xk - xi) * (yj - yi); + float b = (xj - xi) * (yk - yi); + return a < b ? -1 : a > b ? 1 : 0; +} + + +// +// Polygon Clipping routines inspired by, pseudo code found here: http://www.cs.rit.edu/~icss571/clipTrans/PolyClipBack.html +// +// Coverage Map's polygon coordinates are from -1 to 1 in the following mapping to screen space. +// +// (0,0) (windowWidth, 0) +// -1,1 1,1 +// +-----------------------+ +// | | | +// | | | +// | -1,0 | | +// |-----------+-----------| +// | 0,0 | +// | | | +// | | | +// | | | +// +-----------------------+ +// -1,-1 1,-1 +// (0,windowHeight) (windowWidth,windowHeight) +// + const float PolygonClip::TOP_OF_CLIPPING_WINDOW = 1.0f; const float PolygonClip::BOTTOM_OF_CLIPPING_WINDOW = -1.0f; const float PolygonClip::LEFT_OF_CLIPPING_WINDOW = -1.0f; @@ -175,4 +466,4 @@ void PolygonClip::copyCleanArray(int& lengthA, glm::vec2* vertexArrayA, int& len vertexArrayA[i] = vertexArrayB[i]; } } -} +} \ No newline at end of file From 2d755adfc05f623a8fe33b132c93222bf7ac3278 Mon Sep 17 00:00:00 2001 From: Stephen Birarda Date: Wed, 9 Apr 2014 10:46:20 -0700 Subject: [PATCH 061/120] repairs to good code blown away by regex --- assignment-client/src/avatars/AvatarMixer.h | 3 + interface/src/Audio.cpp | 75 +++++++-- libraries/audio/src/Sound.cpp | 158 +++++++++++++++++- .../embedded-webserver/src/HTTPConnection.h | 4 + libraries/octree/src/CoverageMap.h | 2 + libraries/octree/src/CoverageMapV2.cpp | 36 +++- libraries/script-engine/src/Vec3.h | 2 + libraries/shared/src/CapsuleShape.cpp | 2 +- libraries/shared/src/CollisionInfo.cpp | 2 +- libraries/shared/src/CollisionInfo.h | 2 +- libraries/shared/src/ListShape.cpp | 2 +- libraries/shared/src/PacketSender.h | 2 + libraries/shared/src/ShapeCollider.cpp | 2 +- libraries/shared/src/ShapeCollider.h | 2 +- 14 files changed, 261 insertions(+), 33 deletions(-) diff --git a/assignment-client/src/avatars/AvatarMixer.h b/assignment-client/src/avatars/AvatarMixer.h index af25a6f0e2..b9add245a6 100644 --- a/assignment-client/src/avatars/AvatarMixer.h +++ b/assignment-client/src/avatars/AvatarMixer.h @@ -5,6 +5,9 @@ // Created by Stephen Birarda on 9/5/13. // Copyright 2013 High Fidelity, Inc. // +// The avatar mixer receives head, hand and positional data from all connected +// nodes, and broadcasts that data back to them, every BROADCAST_INTERVAL ms. +// // Distributed under the Apache License, Version 2.0. // See the accompanying file LICENSE or http://www.apache.org/licenses/LICENSE-2.0.html // diff --git a/interface/src/Audio.cpp b/interface/src/Audio.cpp index 719bfd8aa1..90797c7eef 100644 --- a/interface/src/Audio.cpp +++ b/interface/src/Audio.cpp @@ -18,6 +18,15 @@ #include #endif +#ifdef WIN32 +#define WIN32_LEAN_AND_MEAN +#include +#include +#include +#include +#include +#endif + #include #include #include @@ -150,24 +159,56 @@ QAudioDeviceInfo defaultAudioDeviceForMode(QAudio::Mode mode) { #endif #ifdef WIN32 QString deviceName; - if (mode == QAudio::AudioInput) { - WAVEINCAPS wic; - // first use WAVE_MAPPER to get the default devices manufacturer ID - waveInGetDevCaps(WAVE_MAPPER, &wic, sizeof(wic)); - //Use the received manufacturer id to get the device's real name - waveInGetDevCaps(wic.wMid, &wic, sizeof(wic)); - qDebug() << "input device:" << wic.szPname; - deviceName = wic.szPname; + //Check for Windows Vista or higher, IMMDeviceEnumerator doesn't work below that. + OSVERSIONINFO osvi; + ZeroMemory(&osvi, sizeof(OSVERSIONINFO)); + osvi.dwOSVersionInfoSize = sizeof(OSVERSIONINFO); + GetVersionEx(&osvi); + const DWORD VISTA_MAJOR_VERSION = 6; + if (osvi.dwMajorVersion < VISTA_MAJOR_VERSION) {// lower then vista + if (mode == QAudio::AudioInput) { + WAVEINCAPS wic; + // first use WAVE_MAPPER to get the default devices manufacturer ID + waveInGetDevCaps(WAVE_MAPPER, &wic, sizeof(wic)); + //Use the received manufacturer id to get the device's real name + waveInGetDevCaps(wic.wMid, &wic, sizeof(wic)); + qDebug() << "input device:" << wic.szPname; + deviceName = wic.szPname; + } else { + WAVEOUTCAPS woc; + // first use WAVE_MAPPER to get the default devices manufacturer ID + waveOutGetDevCaps(WAVE_MAPPER, &woc, sizeof(woc)); + //Use the received manufacturer id to get the device's real name + waveOutGetDevCaps(woc.wMid, &woc, sizeof(woc)); + qDebug() << "output device:" << woc.szPname; + deviceName = woc.szPname; + } } else { - WAVEOUTCAPS woc; - // first use WAVE_MAPPER to get the default devices manufacturer ID - waveOutGetDevCaps(WAVE_MAPPER, &woc, sizeof(woc)); - //Use the received manufacturer id to get the device's real name - waveOutGetDevCaps(woc.wMid, &woc, sizeof(woc)); - qDebug() << "output device:" << woc.szPname; - deviceName = woc.szPname; + HRESULT hr = S_OK; + CoInitialize(NULL); + IMMDeviceEnumerator* pMMDeviceEnumerator = NULL; + CoCreateInstance(__uuidof(MMDeviceEnumerator), NULL, CLSCTX_ALL, __uuidof(IMMDeviceEnumerator), (void**)&pMMDeviceEnumerator); + IMMDevice* pEndpoint; + pMMDeviceEnumerator->GetDefaultAudioEndpoint(mode == QAudio::AudioOutput ? eRender : eCapture, eMultimedia, &pEndpoint); + IPropertyStore* pPropertyStore; + pEndpoint->OpenPropertyStore(STGM_READ, &pPropertyStore); + pEndpoint->Release(); + pEndpoint = NULL; + PROPVARIANT pv; + PropVariantInit(&pv); + hr = pPropertyStore->GetValue(PKEY_Device_FriendlyName, &pv); + pPropertyStore->Release(); + pPropertyStore = NULL; + //QAudio devices seems to only take the 31 first characters of the Friendly Device Name. + const DWORD QT_WIN_MAX_AUDIO_DEVICENAME_LEN = 31; + deviceName = QString::fromWCharArray((wchar_t*)pv.pwszVal).left(QT_WIN_MAX_AUDIO_DEVICENAME_LEN); + qDebug() << (mode == QAudio::AudioOutput ? "output" : "input") << " device:" << deviceName; + PropVariantClear(&pv); + pMMDeviceEnumerator->Release(); + pMMDeviceEnumerator = NULL; + CoUninitialize(); } - qDebug() << "DEBUG [" << deviceName << "] [" << getNamedAudioDeviceForMode(mode, deviceName).deviceName() << "]"; + qDebug() << "DEBUG [" << deviceName << "] [" << getNamedAudioDeviceForMode(mode, deviceName).deviceName() << "]"; return getNamedAudioDeviceForMode(mode, deviceName); #endif @@ -988,4 +1029,4 @@ float Audio::calculateDeviceToNetworkInputRatio(int numBytes) { int Audio::calculateNumberOfFrameSamples(int numBytes) { int frameSamples = (int)(numBytes * CALLBACK_ACCELERATOR_RATIO + 0.5f) / sizeof(int16_t); return frameSamples; -} +} \ No newline at end of file diff --git a/libraries/audio/src/Sound.cpp b/libraries/audio/src/Sound.cpp index 4e657f3302..420576ece9 100644 --- a/libraries/audio/src/Sound.cpp +++ b/libraries/audio/src/Sound.cpp @@ -9,20 +9,162 @@ // See the accompanying file LICENSE or http://www.apache.org/licenses/LICENSE-2.0.html // -struct chunk +#include + +#include + +#include +#include +#include +#include +#include +#include + +#include + +#include "AudioRingBuffer.h" +#include "Sound.h" + +// procedural audio version of Sound +Sound::Sound(float volume, float frequency, float duration, float decay, QObject* parent) : + QObject(parent) { + static char monoAudioData[MAX_PACKET_SIZE]; + static int16_t* monoAudioSamples = (int16_t*)(monoAudioData); + + float t; + const float AUDIO_CALLBACK_MSECS = (float) NETWORK_BUFFER_LENGTH_SAMPLES_PER_CHANNEL / (float)SAMPLE_RATE * 1000.0; + const float MAX_VOLUME = 32000.f; + const float MAX_DURATION = 2.f; + const float MIN_AUDIBLE_VOLUME = 0.001f; + const float NOISE_MAGNITUDE = 0.02f; + const int MAX_SAMPLE_VALUE = std::numeric_limits::max(); + const int MIN_SAMPLE_VALUE = std::numeric_limits::min(); + int numSamples = NETWORK_BUFFER_LENGTH_SAMPLES_PER_CHANNEL; // we add sounds in chunks of this many samples + + int chunkStartingSample = 0; + float waveFrequency = (frequency / SAMPLE_RATE) * TWO_PI; + while (volume > 0.f) { + for (int i = 0; i < numSamples; i++) { + t = (float)chunkStartingSample + (float)i; + float sample = sinf(t * waveFrequency); + sample += ((randFloat() - 0.5f) * NOISE_MAGNITUDE); + sample *= volume * MAX_VOLUME; + + monoAudioSamples[i] = glm::clamp((int)sample, MIN_SAMPLE_VALUE, MAX_SAMPLE_VALUE); + volume *= (1.f - decay); + } + // add the monoAudioSamples to our actual output Byte Array + _byteArray.append(monoAudioData, numSamples * sizeof(int16_t)); + chunkStartingSample += numSamples; + duration = glm::clamp(duration - (AUDIO_CALLBACK_MSECS / 1000.f), 0.f, MAX_DURATION); + //qDebug() << "decaying... _duration=" << _duration; + if (duration == 0.f || (volume < MIN_AUDIBLE_VOLUME)) { + volume = 0.f; + } + } +} + +Sound::Sound(const QUrl& sampleURL, QObject* parent) : + QObject(parent) +{ + // assume we have a QApplication or QCoreApplication instance and use the + // QNetworkAccess manager to grab the raw audio file at the given URL + + QNetworkAccessManager *manager = new QNetworkAccessManager(this); + connect(manager, SIGNAL(finished(QNetworkReply*)), + this, SLOT(replyFinished(QNetworkReply*))); + + qDebug() << "Requesting audio file" << sampleURL.toDisplayString(); + manager->get(QNetworkRequest(sampleURL)); +} + +void Sound::replyFinished(QNetworkReply* reply) { + + // replace our byte array with the downloaded data + QByteArray rawAudioByteArray = reply->readAll(); + + // foreach(QByteArray b, reply->rawHeaderList()) + // qDebug() << b.constData() << ": " << reply->rawHeader(b).constData(); + + if (reply->hasRawHeader("Content-Type")) { + + QByteArray headerContentType = reply->rawHeader("Content-Type"); + + // WAV audio file encountered + if (headerContentType == "audio/x-wav" + || headerContentType == "audio/wav" + || headerContentType == "audio/wave") { + + QByteArray outputAudioByteArray; + + interpretAsWav(rawAudioByteArray, outputAudioByteArray); + downSample(outputAudioByteArray); + } else { + // Process as RAW file + downSample(rawAudioByteArray); + } + } else { + qDebug() << "Network reply without 'Content-Type'."; + } +} + +void Sound::downSample(const QByteArray& rawAudioByteArray) { + + // assume that this was a RAW file and is now an array of samples that are + // signed, 16-bit, 48Khz, mono + + // we want to convert it to the format that the audio-mixer wants + // which is signed, 16-bit, 24Khz, mono + + _byteArray.resize(rawAudioByteArray.size() / 2); + + int numSourceSamples = rawAudioByteArray.size() / sizeof(int16_t); + int16_t* sourceSamples = (int16_t*) rawAudioByteArray.data(); + int16_t* destinationSamples = (int16_t*) _byteArray.data(); + + for (int i = 1; i < numSourceSamples; i += 2) { + if (i + 1 >= numSourceSamples) { + destinationSamples[(i - 1) / 2] = (sourceSamples[i - 1] / 2) + (sourceSamples[i] / 2); + } else { + destinationSamples[(i - 1) / 2] = (sourceSamples[i - 1] / 4) + (sourceSamples[i] / 2) + (sourceSamples[i + 1] / 4); + } + } +} + +// +// Format description from https://ccrma.stanford.edu/courses/422/projects/WaveFormat/ +// +// The header for a WAV file looks like this: +// Positions Sample Value Description +// 00-03 "RIFF" Marks the file as a riff file. Characters are each 1 byte long. +// 04-07 File size (int) Size of the overall file - 8 bytes, in bytes (32-bit integer). +// 08-11 "WAVE" File Type Header. For our purposes, it always equals "WAVE". +// 12-15 "fmt " Format chunk marker. +// 16-19 16 Length of format data as listed above +// 20-21 1 Type of format: (1=PCM, 257=Mu-Law, 258=A-Law, 259=ADPCM) - 2 byte integer +// 22-23 2 Number of Channels - 2 byte integer +// 24-27 44100 Sample Rate - 32 byte integer. Sample Rate = Number of Samples per second, or Hertz. +// 28-31 176400 (Sample Rate * BitsPerSample * Channels) / 8. +// 32-33 4 (BitsPerSample * Channels) / 8 - 8 bit mono2 - 8 bit stereo/16 bit mono4 - 16 bit stereo +// 34-35 16 Bits per sample +// 36-39 "data" Chunk header. Marks the beginning of the data section. +// 40-43 File size (int) Size of the data section. +// 44-?? Actual sound data +// Sample values are given above for a 16-bit stereo source. +// + +struct chunk { char id[4]; quint32 size; }; -struct RIFFHeader -{ +struct RIFFHeader { chunk descriptor; // "RIFF" char type[4]; // "WAVE" }; -struct WAVEHeader -{ +struct WAVEHeader { chunk descriptor; quint16 audioFormat; // Format type: 1=PCM, 257=Mu-Law, 258=A-Law, 259=ADPCM quint16 numChannels; // Number of channels: 1=mono, 2=stereo @@ -32,13 +174,11 @@ struct WAVEHeader quint16 bitsPerSample; }; -struct DATAHeader -{ +struct DATAHeader { chunk descriptor; }; -struct CombinedHeader -{ +struct CombinedHeader { RIFFHeader riff; WAVEHeader wave; }; diff --git a/libraries/embedded-webserver/src/HTTPConnection.h b/libraries/embedded-webserver/src/HTTPConnection.h index 2da4027334..7eb0c6108d 100644 --- a/libraries/embedded-webserver/src/HTTPConnection.h +++ b/libraries/embedded-webserver/src/HTTPConnection.h @@ -5,6 +5,10 @@ // Created by Stephen Birarda on 1/16/14. // Copyright 2014 High Fidelity, Inc. // +// Heavily based on Andrzej Kapolka's original HTTPConnection class +// found from another one of his projects. +// https://github.com/ey6es/witgap/tree/master/src/cpp/server/http +// // Distributed under the Apache License, Version 2.0. // See the accompanying file LICENSE or http://www.apache.org/licenses/LICENSE-2.0.html // diff --git a/libraries/octree/src/CoverageMap.h b/libraries/octree/src/CoverageMap.h index d1fada141e..e06696ff66 100644 --- a/libraries/octree/src/CoverageMap.h +++ b/libraries/octree/src/CoverageMap.h @@ -5,6 +5,8 @@ // Created by Brad Hefta-Gaub on 06/11/13. // Copyright 2013 High Fidelity, Inc. // +// 2D CoverageMap Quad tree for storage of OctreeProjectedPolygons +// // Distributed under the Apache License, Version 2.0. // See the accompanying file LICENSE or http://www.apache.org/licenses/LICENSE-2.0.html // diff --git a/libraries/octree/src/CoverageMapV2.cpp b/libraries/octree/src/CoverageMapV2.cpp index 6535066eed..1ad800ab6b 100644 --- a/libraries/octree/src/CoverageMapV2.cpp +++ b/libraries/octree/src/CoverageMapV2.cpp @@ -9,6 +9,40 @@ // See the accompanying file LICENSE or http://www.apache.org/licenses/LICENSE-2.0.html // +#include +#include + +#include + +#include + +#include "CoverageMapV2.h" + +int CoverageMapV2::_mapCount = 0; +int CoverageMapV2::_checkMapRootCalls = 0; +int CoverageMapV2::_notAllInView = 0; +bool CoverageMapV2::wantDebugging = false; + +const BoundingBox CoverageMapV2::ROOT_BOUNDING_BOX = BoundingBox(glm::vec2(-1.f,-1.f), glm::vec2(2.f,2.f)); + +// Coverage Map's polygon coordinates are from -1 to 1 in the following mapping to screen space. +// +// (0,0) (windowWidth, 0) +// -1,1 1,1 +// +-----------------------+ +// | | | +// | | | +// | -1,0 | | +// |-----------+-----------| +// | 0,0 | +// | | | +// | | | +// | | | +// +-----------------------+ +// -1,-1 1,-1 +// (0,windowHeight) (windowWidth,windowHeight) +// + // Choosing a minimum sized polygon. Since we know a typical window is approximately 1500 pixels wide // then a pixel on our screen will be ~ 2.0/1500 or 0.0013 "units" wide, similarly pixels are typically // about that tall as well. If we say that polygons should be at least 10x10 pixels to be considered "big enough" @@ -214,4 +248,4 @@ void CoverageMapV2::recurseMap(const OctreeProjectedPolygon* polygon, bool store } // normal exit case... return... -} +} \ No newline at end of file diff --git a/libraries/script-engine/src/Vec3.h b/libraries/script-engine/src/Vec3.h index 9e962ca4fd..7d420adca3 100644 --- a/libraries/script-engine/src/Vec3.h +++ b/libraries/script-engine/src/Vec3.h @@ -5,6 +5,8 @@ // Created by Brad Hefta-Gaub on 1/29/14. // Copyright 2014 High Fidelity, Inc. // +// Scriptable Vec3 class library. +// // Distributed under the Apache License, Version 2.0. // See the accompanying file LICENSE or http://www.apache.org/licenses/LICENSE-2.0.html // diff --git a/libraries/shared/src/CapsuleShape.cpp b/libraries/shared/src/CapsuleShape.cpp index 15586c4938..be3a165082 100644 --- a/libraries/shared/src/CapsuleShape.cpp +++ b/libraries/shared/src/CapsuleShape.cpp @@ -2,7 +2,7 @@ // CapsuleShape.cpp // libraries/shared/src // -// Created by Andrew Meadows on 2014. +// Created by Andrew Meadows on 02/20/2014. // Copyright 2014 High Fidelity, Inc. // // Distributed under the Apache License, Version 2.0. diff --git a/libraries/shared/src/CollisionInfo.cpp b/libraries/shared/src/CollisionInfo.cpp index bf986705f5..5a4188a1ef 100644 --- a/libraries/shared/src/CollisionInfo.cpp +++ b/libraries/shared/src/CollisionInfo.cpp @@ -2,7 +2,7 @@ // CollisionInfo.cpp // libraries/shared/src // -// Created by Andrew Meadows on 2014. +// Created by Andrew Meadows on 02/14/2014. // Copyright 2014 High Fidelity, Inc. // // Distributed under the Apache License, Version 2.0. diff --git a/libraries/shared/src/CollisionInfo.h b/libraries/shared/src/CollisionInfo.h index fb7450671b..b8c4aa6523 100644 --- a/libraries/shared/src/CollisionInfo.h +++ b/libraries/shared/src/CollisionInfo.h @@ -2,7 +2,7 @@ // CollisionInfo.h // libraries/shared/src // -// Created by Andrew Meadows on 2014. +// Created by Andrew Meadows on 02/14/2014. // Copyright 2014 High Fidelity, Inc. // // Distributed under the Apache License, Version 2.0. diff --git a/libraries/shared/src/ListShape.cpp b/libraries/shared/src/ListShape.cpp index 26d1c7fea5..dcea97826e 100644 --- a/libraries/shared/src/ListShape.cpp +++ b/libraries/shared/src/ListShape.cpp @@ -2,7 +2,7 @@ // ListShape.cpp // libraries/shared/src // -// Created by Andrew Meadows on 2014. +// Created by Andrew Meadows on 02/20/2014. // Copyright 2014 High Fidelity, Inc. // // Distributed under the Apache License, Version 2.0. diff --git a/libraries/shared/src/PacketSender.h b/libraries/shared/src/PacketSender.h index 01023f8ca3..d517da6d17 100644 --- a/libraries/shared/src/PacketSender.h +++ b/libraries/shared/src/PacketSender.h @@ -5,6 +5,8 @@ // Created by Brad Hefta-Gaub on 8/12/13. // Copyright 2013 High Fidelity, Inc. // +// Threaded or non-threaded packet sender. +// // Distributed under the Apache License, Version 2.0. // See the accompanying file LICENSE or http://www.apache.org/licenses/LICENSE-2.0.html // diff --git a/libraries/shared/src/ShapeCollider.cpp b/libraries/shared/src/ShapeCollider.cpp index 2462663405..b13775dfa8 100644 --- a/libraries/shared/src/ShapeCollider.cpp +++ b/libraries/shared/src/ShapeCollider.cpp @@ -2,7 +2,7 @@ // ShapeCollider.cpp // libraries/shared/src // -// Created by Andrew Meadows on 2014. +// Created by Andrew Meadows on 02/20/2014. // Copyright 2014 High Fidelity, Inc. // // Distributed under the Apache License, Version 2.0. diff --git a/libraries/shared/src/ShapeCollider.h b/libraries/shared/src/ShapeCollider.h index 7154a158d0..c1018bec42 100644 --- a/libraries/shared/src/ShapeCollider.h +++ b/libraries/shared/src/ShapeCollider.h @@ -2,7 +2,7 @@ // ShapeCollider.h // libraries/shared/src // -// Created by Andrew Meadows on 2014. +// Created by Andrew Meadows on 02/20/2014. // Copyright 2014 High Fidelity, Inc. // // Distributed under the Apache License, Version 2.0. From ced5e72d39bb59bd5627a8f68403ec3f769a4a08 Mon Sep 17 00:00:00 2001 From: Stephen Birarda Date: Wed, 9 Apr 2014 10:46:36 -0700 Subject: [PATCH 062/120] add date to capsule shape --- libraries/shared/src/CapsuleShape.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libraries/shared/src/CapsuleShape.h b/libraries/shared/src/CapsuleShape.h index b721633601..062c3aff6f 100644 --- a/libraries/shared/src/CapsuleShape.h +++ b/libraries/shared/src/CapsuleShape.h @@ -2,7 +2,7 @@ // CapsuleShape.h // libraries/shared/src // -// Created by Andrew Meadows on 2014. +// Created by Andrew Meadows on 02/20/2014. // Copyright 2014 High Fidelity, Inc. // // Distributed under the Apache License, Version 2.0. From 55e0035fc890b0e618e0c6439cc4a8a9c316a990 Mon Sep 17 00:00:00 2001 From: Andrzej Kapolka Date: Wed, 9 Apr 2014 11:14:47 -0700 Subject: [PATCH 063/120] More progress on Faceplus integration. --- interface/src/Menu.cpp | 5 ++ interface/src/Menu.h | 1 + interface/src/devices/Faceplus.cpp | 113 ++++++++++++++++++++++++++++- interface/src/devices/Faceplus.h | 17 +++++ interface/src/devices/Faceshift.h | 3 - interface/src/devices/Visage.cpp | 1 + interface/src/devices/Visage.h | 3 - 7 files changed, 135 insertions(+), 8 deletions(-) diff --git a/interface/src/Menu.cpp b/interface/src/Menu.cpp index 8a97c98f02..b85f83ab05 100644 --- a/interface/src/Menu.cpp +++ b/interface/src/Menu.cpp @@ -301,6 +301,11 @@ Menu::Menu() : true, appInstance->getFaceshift(), SLOT(setTCPEnabled(bool))); +#ifdef HAVE_FACEPLUS + addCheckableActionToQMenuAndActionHash(avatarOptionsMenu, MenuOption::Faceplus, 0, true, + appInstance->getFaceplus(), SLOT(updateEnabled())); +#endif + #ifdef HAVE_VISAGE addCheckableActionToQMenuAndActionHash(avatarOptionsMenu, MenuOption::Visage, 0, true, appInstance->getVisage(), SLOT(updateEnabled())); diff --git a/interface/src/Menu.h b/interface/src/Menu.h index 7bb0b75675..b7a82b0b0e 100644 --- a/interface/src/Menu.h +++ b/interface/src/Menu.h @@ -250,6 +250,7 @@ namespace MenuOption { const QString EchoLocalAudio = "Echo Local Audio"; const QString EchoServerAudio = "Echo Server Audio"; const QString Enable3DTVMode = "Enable 3DTV Mode"; + const QString Faceplus = "Faceplus"; const QString Faceshift = "Faceshift"; const QString FilterSixense = "Smooth Sixense Movement"; const QString FirstPerson = "First Person"; diff --git a/interface/src/devices/Faceplus.cpp b/interface/src/devices/Faceplus.cpp index 64dd4bf52d..2e02126240 100644 --- a/interface/src/devices/Faceplus.cpp +++ b/interface/src/devices/Faceplus.cpp @@ -10,23 +10,132 @@ #include #endif +#include "Application.h" #include "Faceplus.h" +#include "renderer/FBXReader.h" Faceplus::Faceplus() : + _enabled(false), _active(false) { -} -void Faceplus::init() { #ifdef HAVE_FACEPLUS // these are ignored--any values will do faceplus_log_in("username", "password"); #endif } +Faceplus::~Faceplus() { + setEnabled(false); +} + +void Faceplus::init() { + connect(Application::getInstance()->getFaceshift(), SIGNAL(connectionStateChanged()), SLOT(updateEnabled())); + updateEnabled(); +} + +#ifdef HAVE_FACEPLUS +static QMultiHash > createChannelNameMap() { + QMultiHash > blendshapeMap; + blendshapeMap.insert("JawFwd", QPair("au_jaw_z_push", 1.0f)); + blendshapeMap.insert("JawLeft", QPair("au_jaw_x_push", 1.0f)); + blendshapeMap.insert("JawOpen", QPair("au_jaw_drop", 1.0f)); + blendshapeMap.insert("LipsLowerDown", QPair("au_lower_lip_drop", 1.0f)); + blendshapeMap.insert("LipsUpperOpen", QPair("au_upper_lip_raiser", 1.0f)); + blendshapeMap.insert("LipsStretch_R", QPair("au_lip_stretcher_left", 0.5f)); + blendshapeMap.insert("MouthSmile_L", QPair("au_lip_corner_depressor", -1.0f)); + blendshapeMap.insert("MouthSmile_R", QPair("au_lip_corner_depressor", -1.0f)); + blendshapeMap.insert("BrowsU_R", QPair("au_left_outer_brow_raiser", 1.0f)); + blendshapeMap.insert("BrowsU_C", QPair("au_left_inner_brow_raiser", 1.0f)); + blendshapeMap.insert("BrowsD_R", QPair("au_left_brow_lowerer", 1.0f)); + blendshapeMap.insert("EyeBlink_L", QPair("au_leye_closed", 1.0f)); + blendshapeMap.insert("EyeBlink_R", QPair("au_reye_closed", 1.0f)); + blendshapeMap.insert("EyeOpen_L", QPair("au_upper_lid_raiser", 1.0f)); + blendshapeMap.insert("EyeOpen_R", QPair("au_upper_lid_raiser", 1.0f)); + blendshapeMap.insert("LipLowerOpen", QPair("au_lower_lip_x_push", 1.0f)); + blendshapeMap.insert("LipsStretch_L", QPair("au_lip_stretcher_right", 0.5f)); + blendshapeMap.insert("BrowsU_L", QPair("au_right_outer_brow_raiser", 1.0f)); + blendshapeMap.insert("BrowsU_C", QPair("au_right_inner_brow_raiser", 1.0f)); + blendshapeMap.insert("BrowsD_L", QPair("au_right_brow_lowerer", 1.0f)); + + QMultiHash > channelNameMap; + for (int i = 0;; i++) { + QByteArray blendshape = FACESHIFT_BLENDSHAPES[i]; + if (blendshape.isEmpty()) { + break; + } + for (QMultiHash >::const_iterator it = blendshapeMap.constFind(blendshape); + it != blendshapeMap.constEnd() && it.key() == blendshape; it++) { + channelNameMap.insert(it.value().first, QPair(i, it.value().second)); + } + } + + return channelNameMap; +} + +static const QMultiHash >& getChannelNameMap() { + static QMultiHash > channelNameMap = createChannelNameMap(); + return channelNameMap; +} +#endif + void Faceplus::update() { +#ifdef HAVE_FACEPLUS + if (!_active) { + return; + } + if (!(_active = faceplus_current_output_vector(_outputVector.data()))) { + return; + } + qFill(_blendshapeCoefficients.begin(), _blendshapeCoefficients.end(), 0.0f); + for (int i = 0; i < _outputVector.size(); i++) { + for (QMultiHash >::const_iterator it = _channelIndexMap.constFind(i); + it != _channelIndexMap.constEnd() && it.key() == i; it++) { + _blendshapeCoefficients[it.value().first] += _outputVector.at(i) * it.value().second; + } + } +#endif } void Faceplus::reset() { } +void Faceplus::updateEnabled() { + setEnabled(Menu::getInstance()->isOptionChecked(MenuOption::Faceplus) && + !(Menu::getInstance()->isOptionChecked(MenuOption::Faceshift) && + Application::getInstance()->getFaceshift()->isConnectedOrConnecting())); +} +void Faceplus::setEnabled(bool enabled) { +#ifdef HAVE_FACEPLUS + if (_enabled == enabled) { + return; + } + if ((_enabled = enabled)) { + if (faceplus_init("VGA")) { + qDebug() << "Faceplus initialized."; + _active = true; + + int channelCount = faceplus_output_channels_count(); + _outputVector.resize(channelCount); + + int maxIndex = -1; + _channelIndexMap.clear(); + for (int i = 0; i < channelCount; i++) { + QByteArray channelName = faceplus_output_channel_name(i); + + qDebug() << channelName; + + for (QMultiHash >::const_iterator it = getChannelNameMap().constFind(name); + it != getChannelNameMap().constEnd() && it.key() == name; it++) { + _channelIndexMap.insert(i, it.value()); + maxIndex = qMax(maxIndex, it.value().first); + } + } + _blendshapeCoefficients.resize(maxIndex + 1); + } + } else if (faceplus_teardown()) { + qDebug() << "Faceplus torn down."; + _active = false; + } +#endif +} diff --git a/interface/src/devices/Faceplus.h b/interface/src/devices/Faceplus.h index cf7a6583a1..a511313d0c 100644 --- a/interface/src/devices/Faceplus.h +++ b/interface/src/devices/Faceplus.h @@ -9,6 +9,10 @@ #ifndef __interface__Faceplus__ #define __interface__Faceplus__ +#include +#include +#include + #include "FaceTracker.h" /// Interface for Mixamo FacePlus. @@ -18,6 +22,7 @@ class Faceplus : public FaceTracker { public: Faceplus(); + virtual ~Faceplus(); void init(); @@ -26,9 +31,21 @@ public: void update(); void reset(); +public slots: + + void updateEnabled(); + private: + void setEnabled(bool enabled); + + bool _enabled; bool _active; + +#ifdef HAVE_VISAGE + QMultiHash > _channelIndexMap; + QVector _outputVector; +#endif }; #endif /* defined(__interface__Faceplus__) */ diff --git a/interface/src/devices/Faceshift.h b/interface/src/devices/Faceshift.h index c49c6661e7..c245d648b8 100644 --- a/interface/src/devices/Faceshift.h +++ b/interface/src/devices/Faceshift.h @@ -12,9 +12,6 @@ #include #include -#include -#include - #include #include "FaceTracker.h" diff --git a/interface/src/devices/Visage.cpp b/interface/src/devices/Visage.cpp index 0cb534f8c3..3792cc913d 100644 --- a/interface/src/devices/Visage.cpp +++ b/interface/src/devices/Visage.cpp @@ -159,6 +159,7 @@ void Visage::reset() { void Visage::updateEnabled() { setEnabled(Menu::getInstance()->isOptionChecked(MenuOption::Visage) && + !Menu::getInstance()->isOptionChecked(MenuOption::Faceplus) && !(Menu::getInstance()->isOptionChecked(MenuOption::Faceshift) && Application::getInstance()->getFaceshift()->isConnectedOrConnecting())); } diff --git a/interface/src/devices/Visage.h b/interface/src/devices/Visage.h index 0da87fb332..1a02f5d7c3 100644 --- a/interface/src/devices/Visage.h +++ b/interface/src/devices/Visage.h @@ -13,9 +13,6 @@ #include #include -#include -#include - #include "FaceTracker.h" namespace VisageSDK { From 4b306401afd026e8a737af85d0520988c9998c9b Mon Sep 17 00:00:00 2001 From: Andrew Meadows Date: Wed, 9 Apr 2014 11:32:52 -0700 Subject: [PATCH 064/120] use slot to change AvatarData::_sessionUUID --- interface/src/Application.cpp | 6 +----- libraries/avatars/src/AvatarData.h | 2 +- 2 files changed, 2 insertions(+), 6 deletions(-) diff --git a/interface/src/Application.cpp b/interface/src/Application.cpp index 2a97e536e4..ae80cdef48 100644 --- a/interface/src/Application.cpp +++ b/interface/src/Application.cpp @@ -232,6 +232,7 @@ Application::Application(int& argc, char** argv, timeval &startup_time) : connect(nodeList, SIGNAL(nodeAdded(SharedNodePointer)), &_voxels, SLOT(nodeAdded(SharedNodePointer))); connect(nodeList, SIGNAL(nodeKilled(SharedNodePointer)), &_voxels, SLOT(nodeKilled(SharedNodePointer))); connect(nodeList, &NodeList::uuidChanged, this, &Application::updateWindowTitle); + connect(nodeList, SIGNAL(uuidChanged(const QUuid&)), _myAvatar, SLOT(setSessionUUID(const QUuid&))); connect(nodeList, &NodeList::limitOfSilentDomainCheckInsReached, nodeList, &NodeList::reset); // connect to appropriate slots on AccountManager @@ -1216,11 +1217,6 @@ void Application::timer() { // ask the node list to check in with the domain server NodeList::getInstance()->sendDomainServerCheckIn(); - - // as soon as we have a valid sessionUUID, store it in the avatar for reference - if (_myAvatar->getSessionUUID().isNull()) { - _myAvatar->setSessionUUID(NodeList::getInstance()->getSessionUUID()); - } } void Application::idle() { diff --git a/libraries/avatars/src/AvatarData.h b/libraries/avatars/src/AvatarData.h index e8b287ceed..2b8dfe8861 100755 --- a/libraries/avatars/src/AvatarData.h +++ b/libraries/avatars/src/AvatarData.h @@ -102,7 +102,6 @@ public: virtual ~AvatarData(); const QUuid& getSessionUUID() { return _sessionUUID; } - void setSessionUUID(const QUuid& id) { _sessionUUID = id; } const glm::vec3& getPosition() const { return _position; } void setPosition(const glm::vec3 position) { _position = position; } @@ -225,6 +224,7 @@ public slots: void sendBillboardPacket(); void setBillboardFromNetworkReply(); void setJointMappingsFromNetworkReply(); + void setSessionUUID(const QUuid& id) { _sessionUUID = id; } protected: QUuid _sessionUUID; glm::vec3 _position; From 0a9c7e3d744ce9003643e653c2422fa6e766289d Mon Sep 17 00:00:00 2001 From: Stephen Birarda Date: Wed, 9 Apr 2014 11:35:20 -0700 Subject: [PATCH 065/120] add an include guard to Stats --- interface/src/ui/Stats.h | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/interface/src/ui/Stats.h b/interface/src/ui/Stats.h index ad2a3c9bf5..3d3e930b85 100644 --- a/interface/src/ui/Stats.h +++ b/interface/src/ui/Stats.h @@ -9,6 +9,9 @@ // See the accompanying file LICENSE or http://www.apache.org/licenses/LICENSE-2.0.html // +#ifndef _hifi_Stats_h +#define _hifi_Stats_h + #include #include @@ -42,3 +45,5 @@ private: int _lastHorizontalOffset; }; + +#endif From 4deb052d5dde2f36d1c0771a015d81b57d487655 Mon Sep 17 00:00:00 2001 From: Andrzej Kapolka Date: Wed, 9 Apr 2014 11:54:55 -0700 Subject: [PATCH 066/120] More work on Faceplus integration. --- .gitignore | 4 ++ interface/external/faceplus/readme.txt | 4 +- interface/src/devices/Faceplus.cpp | 53 +++++++++++++++++++++++++- interface/src/devices/Faceplus.h | 2 +- 4 files changed, 59 insertions(+), 4 deletions(-) diff --git a/.gitignore b/.gitignore index eb2f3ec303..c296a918af 100644 --- a/.gitignore +++ b/.gitignore @@ -42,5 +42,9 @@ interface/external/visage/* interface/resources/visage/* !interface/resources/visage/tracker.cfg +# Ignore Faceplus +interface/external/faceplus/* +!interface/external/faceplus/readme.txt + # Ignore interfaceCache for Linux users interface/interfaceCache/ diff --git a/interface/external/faceplus/readme.txt b/interface/external/faceplus/readme.txt index 322ea846bb..e98f8becdc 100644 --- a/interface/external/faceplus/readme.txt +++ b/interface/external/faceplus/readme.txt @@ -5,5 +5,7 @@ Andrzej Kapolka, April 8, 2014 1. Copy the Faceplus sdk folders (include, win32) into the interface/external/faceplus folder. This readme.txt should be there as well. -2. Delete your build directory, run cmake and build, and you should be all set. +2. Copy the Faceplus DLLs from the win32 folder into your path. + +3. Delete your build directory, run cmake and build, and you should be all set. diff --git a/interface/src/devices/Faceplus.cpp b/interface/src/devices/Faceplus.cpp index 2e02126240..89197a5acf 100644 --- a/interface/src/devices/Faceplus.cpp +++ b/interface/src/devices/Faceplus.cpp @@ -33,6 +33,55 @@ void Faceplus::init() { updateEnabled(); } +/* +[2014-04-09T11:42:11] "Mix::Blink_Left" +[2014-04-09T11:42:11] "Mix::Blink_Right" +[2014-04-09T11:42:11] "Mix::BrowsDown_Left" +[2014-04-09T11:42:11] "Mix::BrowsDown_Right" +[2014-04-09T11:42:11] "Mix::BrowsIn_Left" +[2014-04-09T11:42:11] "Mix::BrowsIn_Right" +[2014-04-09T11:42:11] "Mix::BrowsOuterLower_Left" +[2014-04-09T11:42:11] "Mix::BrowsOuterLower_Right" +[2014-04-09T11:42:11] "Mix::BrowsUp_Left" +[2014-04-09T11:42:11] "Mix::BrowsUp_Right" +[2014-04-09T11:42:11] "Mix::EyesWide_Left" +[2014-04-09T11:42:11] "Mix::EyesWide_Right" +[2014-04-09T11:42:11] "Mix::Frown_Left" +[2014-04-09T11:42:11] "Mix::Frown_Right" +[2014-04-09T11:42:11] "Mix::Jaw_RotateY_Left" +[2014-04-09T11:42:11] "Mix::Jaw_RotateY_Right" +[2014-04-09T11:42:11] "Mix::LowerLipDown_Left" +[2014-04-09T11:42:11] "Mix::LowerLipDown_Right" +[2014-04-09T11:42:11] "Mix::LowerLipIn" +[2014-04-09T11:42:11] "Mix::LowerLipOut" +[2014-04-09T11:42:11] "Mix::Midmouth_Left" +[2014-04-09T11:42:11] "Mix::Midmouth_Right" +[2014-04-09T11:42:11] "Mix::MouthDown" +[2014-04-09T11:42:11] "Mix::MouthNarrow_Left" +[2014-04-09T11:42:11] "Mix::MouthNarrow_Right" +[2014-04-09T11:42:11] "Mix::MouthOpen" +[2014-04-09T11:42:11] "Mix::MouthUp" +[2014-04-09T11:42:11] "Mix::MouthWhistle_NarrowAdjust_Left" +[2014-04-09T11:42:11] "Mix::MouthWhistle_NarrowAdjust_Right" +[2014-04-09T11:42:11] "Mix::NoseScrunch_Left" +[2014-04-09T11:42:11] "Mix::NoseScrunch_Right" +[2014-04-09T11:42:11] "Mix::Smile_Left" +[2014-04-09T11:42:11] "Mix::Smile_Right" +[2014-04-09T11:42:11] "Mix::Squint_Left" +[2014-04-09T11:42:11] "Mix::Squint_Right" +[2014-04-09T11:42:11] "Mix::UpperLipIn" +[2014-04-09T11:42:11] "Mix::UpperLipOut" +[2014-04-09T11:42:11] "Mix::UpperLipUp_Left" +[2014-04-09T11:42:11] "Mix::UpperLipUp_Right" +[2014-04-09T11:42:11] "Head_Joint::Rotation_X" +[2014-04-09T11:42:11] "Head_Joint::Rotation_Y" +[2014-04-09T11:42:11] "Head_Joint::Rotation_Z" +[2014-04-09T11:42:11] "Left_Eye_Joint::Rotation_X" +[2014-04-09T11:42:11] "Left_Eye_Joint::Rotation_Y" +[2014-04-09T11:42:11] "Right_Eye_Joint::Rotation_X" +[2014-04-09T11:42:11] "Right_Eye_Joint::Rotation_Y" +*/ + #ifdef HAVE_FACEPLUS static QMultiHash > createChannelNameMap() { QMultiHash > blendshapeMap; @@ -121,9 +170,9 @@ void Faceplus::setEnabled(bool enabled) { int maxIndex = -1; _channelIndexMap.clear(); for (int i = 0; i < channelCount; i++) { - QByteArray channelName = faceplus_output_channel_name(i); + QByteArray name = faceplus_output_channel_name(i); - qDebug() << channelName; + qDebug() << name; for (QMultiHash >::const_iterator it = getChannelNameMap().constFind(name); it != getChannelNameMap().constEnd() && it.key() == name; it++) { diff --git a/interface/src/devices/Faceplus.h b/interface/src/devices/Faceplus.h index a511313d0c..1e3272906c 100644 --- a/interface/src/devices/Faceplus.h +++ b/interface/src/devices/Faceplus.h @@ -42,7 +42,7 @@ private: bool _enabled; bool _active; -#ifdef HAVE_VISAGE +#ifdef HAVE_FACEPLUS QMultiHash > _channelIndexMap; QVector _outputVector; #endif From ae4b8348a246c5a398aee743c5498862cdf0ca5e Mon Sep 17 00:00:00 2001 From: Stephen Birarda Date: Wed, 9 Apr 2014 12:03:17 -0700 Subject: [PATCH 067/120] fix header include guards via regex --- animation-server/src/AnimationServer.h | 6 +++--- assignment-client/src/Agent.h | 6 +++--- assignment-client/src/AssignmentClient.h | 6 +++--- assignment-client/src/AssignmentClientMonitor.h | 6 +++--- assignment-client/src/AssignmentFactory.h | 6 +++--- assignment-client/src/AssignmentThread.h | 6 +++--- assignment-client/src/audio/AudioMixer.h | 6 +++--- assignment-client/src/audio/AudioMixerClientData.h | 6 +++--- assignment-client/src/audio/AvatarAudioRingBuffer.h | 6 +++--- assignment-client/src/avatars/AvatarMixer.h | 6 +++--- assignment-client/src/avatars/AvatarMixerClientData.h | 6 +++--- assignment-client/src/metavoxels/MetavoxelServer.h | 6 +++--- .../src/octree/OctreeInboundPacketProcessor.h | 6 +++--- assignment-client/src/octree/OctreeQueryNode.h | 6 +++--- assignment-client/src/octree/OctreeSendThread.h | 6 +++--- assignment-client/src/octree/OctreeServer.h | 6 +++--- assignment-client/src/octree/OctreeServerConsts.h | 6 +++--- assignment-client/src/particles/ParticleNodeData.h | 6 +++--- assignment-client/src/particles/ParticleServer.h | 6 +++--- assignment-client/src/particles/ParticleServerConsts.h | 6 +++--- assignment-client/src/voxels/VoxelNodeData.h | 6 +++--- assignment-client/src/voxels/VoxelServer.h | 6 +++--- assignment-client/src/voxels/VoxelServerConsts.h | 6 +++--- domain-server/src/DomainServer.h | 6 +++--- domain-server/src/DomainServerNodeData.h | 6 +++--- interface/src/AbstractLoggerInterface.h | 6 +++--- interface/src/Application.h | 6 +++--- interface/src/Audio.h | 6 +++--- interface/src/BuckyBalls.h | 6 +++--- interface/src/Camera.h | 6 +++--- interface/src/DatagramProcessor.h | 6 +++--- interface/src/Environment.h | 6 +++--- interface/src/FileLogger.h | 2 +- interface/src/GLCanvas.h | 6 +++--- interface/src/Menu.h | 6 +++--- interface/src/MetavoxelSystem.h | 6 +++--- interface/src/ParticleTreeRenderer.h | 6 +++--- interface/src/Physics.h | 2 +- interface/src/Stars.h | 7 +++---- interface/src/Util.h | 6 +++--- interface/src/XmppClient.h | 6 +++--- interface/src/avatar/Avatar.h | 6 +++--- interface/src/avatar/AvatarManager.h | 6 +++--- interface/src/avatar/FaceModel.h | 6 +++--- interface/src/avatar/Hand.h | 3 +-- interface/src/avatar/Head.h | 2 +- interface/src/avatar/MyAvatar.h | 6 +++--- interface/src/avatar/SkeletonModel.h | 6 +++--- interface/src/devices/Faceshift.h | 6 +++--- interface/src/devices/OculusManager.h | 6 +++--- interface/src/devices/SixenseManager.h | 7 +++---- interface/src/devices/TV3DManager.h | 6 +++--- interface/src/devices/Visage.h | 6 +++--- interface/src/location/LocationManager.h | 6 +++--- interface/src/location/NamedLocation.h | 6 +++--- interface/src/renderer/AmbientOcclusionEffect.h | 6 +++--- interface/src/renderer/FBXReader.h | 6 +++--- interface/src/renderer/GeometryCache.h | 6 +++--- interface/src/renderer/GlowEffect.h | 6 +++--- interface/src/renderer/Model.h | 6 +++--- interface/src/renderer/PointShader.h | 6 +++--- interface/src/renderer/ProgramObject.h | 6 +++--- interface/src/renderer/RenderUtil.h | 6 +++--- interface/src/renderer/TextureCache.h | 6 +++--- interface/src/renderer/VoxelShader.h | 6 +++--- interface/src/scripting/AudioDeviceScriptingInterface.h | 6 +++--- interface/src/scripting/ClipboardScriptingInterface.h | 6 +++--- interface/src/scripting/ControllerScriptingInterface.h | 6 +++--- interface/src/scripting/MenuScriptingInterface.h | 6 +++--- interface/src/scripting/SettingsScriptingInterface.h | 6 +++--- interface/src/starfield/Config.h | 6 +++--- interface/src/starfield/Controller.h | 6 +++--- interface/src/starfield/Generator.h | 6 +++--- interface/src/starfield/data/GpuVertex.h | 7 +++---- interface/src/starfield/data/InputVertex.h | 7 +++---- interface/src/starfield/data/Tile.h | 7 +++---- interface/src/starfield/renderer/Renderer.h | 6 +++--- interface/src/starfield/renderer/Tiling.h | 7 +++---- interface/src/starfield/renderer/VertexOrder.h | 7 +++---- interface/src/ui/BandwidthDialog.h | 7 +++---- interface/src/ui/BandwidthMeter.h | 7 +++---- interface/src/ui/ChatWindow.h | 6 +++--- interface/src/ui/ImportDialog.h | 6 +++--- interface/src/ui/InfoView.h | 6 +++--- interface/src/ui/LodToolsDialog.h | 7 +++---- interface/src/ui/LogDialog.h | 7 +++---- interface/src/ui/MetavoxelEditor.h | 6 +++--- interface/src/ui/ModelsBrowser.h | 6 +++--- interface/src/ui/OctreeStatsDialog.h | 7 +++---- interface/src/ui/Oscilloscope.h | 6 +++--- interface/src/ui/RearMirrorTools.h | 6 +++--- interface/src/ui/RunningScriptsWidget.h | 6 +++--- interface/src/ui/Snapshot.h | 6 +++--- interface/src/ui/Stats.h | 6 +++--- interface/src/ui/TextRenderer.h | 6 +++--- interface/src/ui/UpdateDialog.h | 6 +++--- interface/src/ui/overlays/Base3DOverlay.h | 6 +++--- interface/src/ui/overlays/Cube3DOverlay.h | 6 +++--- interface/src/ui/overlays/ImageOverlay.h | 6 +++--- interface/src/ui/overlays/Line3DOverlay.h | 6 +++--- interface/src/ui/overlays/LocalVoxelsOverlay.h | 6 +++--- interface/src/ui/overlays/Overlay.h | 6 +++--- interface/src/ui/overlays/Overlay2D.h | 6 +++--- interface/src/ui/overlays/Overlays.h | 6 +++--- interface/src/ui/overlays/Sphere3DOverlay.h | 6 +++--- interface/src/ui/overlays/TextOverlay.h | 6 +++--- interface/src/ui/overlays/Volume3DOverlay.h | 6 +++--- interface/src/voxels/PrimitiveRenderer.h | 6 +++--- interface/src/voxels/VoxelFade.h | 6 +++--- interface/src/voxels/VoxelHideShowThread.h | 6 +++--- interface/src/voxels/VoxelImporter.h | 6 +++--- interface/src/voxels/VoxelPacketProcessor.h | 6 +++--- interface/src/voxels/VoxelSystem.h | 6 +++--- interface/src/windowshacks.h | 6 +++--- interface/src/world.h | 6 +++--- libraries/audio/src/AbstractAudioInterface.h | 6 +++--- libraries/audio/src/AudioInjector.h | 6 +++--- libraries/audio/src/AudioInjectorOptions.h | 6 +++--- libraries/audio/src/AudioRingBuffer.h | 6 +++--- libraries/audio/src/AudioScriptingInterface.h | 6 +++--- libraries/audio/src/InjectedAudioRingBuffer.h | 6 +++--- libraries/audio/src/MixedAudioRingBuffer.h | 6 +++--- libraries/audio/src/PositionalAudioRingBuffer.h | 6 +++--- libraries/audio/src/Sound.h | 6 +++--- libraries/avatars/src/AvatarData.h | 6 +++--- libraries/avatars/src/AvatarHashMap.h | 6 +++--- libraries/avatars/src/HandData.h | 6 +++--- libraries/avatars/src/HeadData.h | 6 +++--- libraries/embedded-webserver/src/HTTPConnection.h | 6 +++--- libraries/embedded-webserver/src/HTTPManager.h | 6 +++--- libraries/metavoxels/src/AttributeRegistry.h | 6 +++--- libraries/metavoxels/src/Bitstream.h | 6 +++--- libraries/metavoxels/src/DatagramSequencer.h | 6 +++--- libraries/metavoxels/src/MetavoxelData.h | 6 +++--- libraries/metavoxels/src/MetavoxelMessages.h | 6 +++--- libraries/metavoxels/src/MetavoxelUtil.h | 6 +++--- libraries/metavoxels/src/ScriptCache.h | 6 +++--- libraries/metavoxels/src/SharedObject.h | 6 +++--- libraries/octree/src/AABox.h | 6 +++--- libraries/octree/src/CoverageMap.h | 6 +++--- libraries/octree/src/CoverageMapV2.h | 6 +++--- libraries/octree/src/JurisdictionListener.h | 6 +++--- libraries/octree/src/JurisdictionMap.h | 8 +++----- libraries/octree/src/JurisdictionSender.h | 6 +++--- libraries/octree/src/Octree.h | 6 +++--- libraries/octree/src/OctreeConstants.h | 6 +++--- libraries/octree/src/OctreeEditPacketSender.h | 6 +++--- libraries/octree/src/OctreeElement.h | 6 +++--- libraries/octree/src/OctreeElementBag.h | 6 +++--- libraries/octree/src/OctreeHeadlessViewer.h | 6 +++--- libraries/octree/src/OctreePacketData.h | 6 +++--- libraries/octree/src/OctreePersistThread.h | 6 +++--- libraries/octree/src/OctreeProjectedPolygon.h | 6 +++--- libraries/octree/src/OctreeQuery.h | 6 +++--- libraries/octree/src/OctreeRenderer.h | 6 +++--- libraries/octree/src/OctreeSceneStats.h | 6 +++--- libraries/octree/src/OctreeScriptingInterface.h | 6 +++--- libraries/octree/src/ViewFrustum.h | 6 +++--- libraries/particles/src/Particle.h | 6 +++--- libraries/particles/src/ParticleCollisionSystem.h | 6 +++--- libraries/particles/src/ParticleEditPacketSender.h | 6 +++--- libraries/particles/src/ParticleTree.h | 6 +++--- libraries/particles/src/ParticleTreeElement.h | 6 +++--- libraries/particles/src/ParticleTreeHeadlessViewer.h | 6 +++--- libraries/particles/src/ParticlesScriptingInterface.h | 6 +++--- .../src/AbstractControllerScriptingInterface.h | 6 +++--- libraries/script-engine/src/EventTypes.h | 6 +++--- libraries/script-engine/src/LocalVoxels.h | 6 +++--- libraries/script-engine/src/MenuItemProperties.h | 6 +++--- libraries/script-engine/src/Quat.h | 6 +++--- libraries/script-engine/src/ScriptEngine.h | 6 +++--- libraries/script-engine/src/Vec3.h | 6 +++--- libraries/shared/src/AccountManager.h | 6 +++--- libraries/shared/src/AngleUtil.h | 7 +++---- libraries/shared/src/Assignment.h | 6 +++--- libraries/shared/src/CapsuleShape.h | 6 +++--- libraries/shared/src/CollisionInfo.h | 6 +++--- libraries/shared/src/DataServerAccountInfo.h | 6 +++--- libraries/shared/src/DomainInfo.h | 6 +++--- libraries/shared/src/FileUtils.h | 2 +- libraries/shared/src/FloodFill.h | 7 +++---- libraries/shared/src/GenericThread.h | 6 +++--- libraries/shared/src/GeometryUtil.h | 6 +++--- libraries/shared/src/HifiSockAddr.h | 6 +++--- libraries/shared/src/ListShape.h | 6 +++--- libraries/shared/src/Logging.h | 6 +++--- libraries/shared/src/ModelUploader.h | 6 +++--- libraries/shared/src/NetworkPacket.h | 6 +++--- libraries/shared/src/Node.h | 6 +++--- libraries/shared/src/NodeData.h | 2 +- libraries/shared/src/NodeList.h | 6 +++--- libraries/shared/src/OAuthAccessToken.h | 6 +++--- libraries/shared/src/OctalCode.h | 6 +++--- libraries/shared/src/PacketHeaders.h | 2 +- libraries/shared/src/PacketSender.h | 6 +++--- libraries/shared/src/PerfStat.h | 6 +++--- libraries/shared/src/Radix2InplaceSort.h | 6 +++--- libraries/shared/src/Radix2IntegerScanner.h | 7 +++---- libraries/shared/src/ReceivedPacketProcessor.h | 6 +++--- libraries/shared/src/RegisteredMetaTypes.h | 2 +- libraries/shared/src/ResourceCache.h | 6 +++--- libraries/shared/src/Shape.h | 6 +++--- libraries/shared/src/ShapeCollider.h | 6 +++--- libraries/shared/src/SharedUtil.h | 6 +++--- libraries/shared/src/SimpleMovingAverage.h | 6 +++--- libraries/shared/src/SphereShape.h | 6 +++--- libraries/shared/src/StdDev.h | 6 +++--- libraries/shared/src/StreamUtils.h | 6 +++--- libraries/shared/src/ThreadedAssignment.h | 6 +++--- libraries/shared/src/UUID.h | 6 +++--- libraries/voxels/src/EnvironmentData.h | 6 +++--- libraries/voxels/src/LocalVoxelsList.h | 6 +++--- libraries/voxels/src/Tags.h | 6 +++--- libraries/voxels/src/VoxelConstants.h | 6 +++--- libraries/voxels/src/VoxelDetail.h | 6 +++--- libraries/voxels/src/VoxelEditPacketSender.h | 6 +++--- libraries/voxels/src/VoxelTree.h | 6 +++--- libraries/voxels/src/VoxelTreeCommands.h | 6 +++--- libraries/voxels/src/VoxelTreeElement.h | 7 +++---- libraries/voxels/src/VoxelTreeHeadlessViewer.h | 6 +++--- libraries/voxels/src/VoxelsScriptingInterface.h | 6 +++--- tests/metavoxels/src/MetavoxelTests.h | 6 +++--- tests/physics/src/CollisionInfoTests.h | 7 +++---- tests/physics/src/PhysicsTestUtil.h | 6 +++--- tests/physics/src/ShapeColliderTests.h | 6 +++--- voxel-edit/src/SceneUtils.h | 6 +++--- 226 files changed, 662 insertions(+), 682 deletions(-) diff --git a/animation-server/src/AnimationServer.h b/animation-server/src/AnimationServer.h index 924e973599..58f05c32c5 100644 --- a/animation-server/src/AnimationServer.h +++ b/animation-server/src/AnimationServer.h @@ -9,8 +9,8 @@ // See the accompanying file LICENSE or http://www.apache.org/licenses/LICENSE-2.0.html // -#ifndef __hifi__AnimationServer__ -#define __hifi__AnimationServer__ +#ifndef hifi_AnimationServer_h +#define hifi_AnimationServer_h #include @@ -24,4 +24,4 @@ private slots: }; -#endif /* defined(__hifi__AnimationServer__) */ +#endif // hifi_AnimationServer_h diff --git a/assignment-client/src/Agent.h b/assignment-client/src/Agent.h index 6423514894..2dcd7e3107 100644 --- a/assignment-client/src/Agent.h +++ b/assignment-client/src/Agent.h @@ -9,8 +9,8 @@ // See the accompanying file LICENSE or http://www.apache.org/licenses/LICENSE-2.0.html // -#ifndef __hifi__Agent__ -#define __hifi__Agent__ +#ifndef hifi_Agent_h +#define hifi_Agent_h #include @@ -67,4 +67,4 @@ private: MixedAudioRingBuffer _receivedAudioBuffer; }; -#endif /* defined(__hifi__Agent__) */ +#endif // hifi_Agent_h diff --git a/assignment-client/src/AssignmentClient.h b/assignment-client/src/AssignmentClient.h index 26e3a47255..1ad8cca244 100644 --- a/assignment-client/src/AssignmentClient.h +++ b/assignment-client/src/AssignmentClient.h @@ -9,8 +9,8 @@ // See the accompanying file LICENSE or http://www.apache.org/licenses/LICENSE-2.0.html // -#ifndef __hifi__AssignmentClient__ -#define __hifi__AssignmentClient__ +#ifndef hifi_AssignmentClient_h +#define hifi_AssignmentClient_h #include @@ -30,4 +30,4 @@ private: SharedAssignmentPointer _currentAssignment; }; -#endif /* defined(__hifi__AssignmentClient__) */ +#endif // hifi_AssignmentClient_h diff --git a/assignment-client/src/AssignmentClientMonitor.h b/assignment-client/src/AssignmentClientMonitor.h index 4bb82ab715..1df08a345e 100644 --- a/assignment-client/src/AssignmentClientMonitor.h +++ b/assignment-client/src/AssignmentClientMonitor.h @@ -9,8 +9,8 @@ // See the accompanying file LICENSE or http://www.apache.org/licenses/LICENSE-2.0.html // -#ifndef __hifi__AssignmentClientMonitor__ -#define __hifi__AssignmentClientMonitor__ +#ifndef hifi_AssignmentClientMonitor_h +#define hifi_AssignmentClientMonitor_h #include #include @@ -31,4 +31,4 @@ private: QStringList _childArguments; }; -#endif /* defined(__hifi__AssignmentClientMonitor__) */ +#endif // hifi_AssignmentClientMonitor_h diff --git a/assignment-client/src/AssignmentFactory.h b/assignment-client/src/AssignmentFactory.h index 2a63bffd37..9c197f5747 100644 --- a/assignment-client/src/AssignmentFactory.h +++ b/assignment-client/src/AssignmentFactory.h @@ -9,8 +9,8 @@ // See the accompanying file LICENSE or http://www.apache.org/licenses/LICENSE-2.0.html // -#ifndef __hifi__AssignmentFactory__ -#define __hifi__AssignmentFactory__ +#ifndef hifi_AssignmentFactory_h +#define hifi_AssignmentFactory_h #include @@ -19,4 +19,4 @@ public: static ThreadedAssignment* unpackAssignment(const QByteArray& packet); }; -#endif /* defined(__hifi__AssignmentFactory__) */ +#endif // hifi_AssignmentFactory_h diff --git a/assignment-client/src/AssignmentThread.h b/assignment-client/src/AssignmentThread.h index a76c118192..848c4614ba 100644 --- a/assignment-client/src/AssignmentThread.h +++ b/assignment-client/src/AssignmentThread.h @@ -9,8 +9,8 @@ // See the accompanying file LICENSE or http://www.apache.org/licenses/LICENSE-2.0.html // -#ifndef __hifi__AssignmentThread__ -#define __hifi__AssignmentThread__ +#ifndef hifi_AssignmentThread_h +#define hifi_AssignmentThread_h #include @@ -23,4 +23,4 @@ private: SharedAssignmentPointer _assignment; }; -#endif /* defined(__hifi__AssignmentThread__) */ +#endif // hifi_AssignmentThread_h diff --git a/assignment-client/src/audio/AudioMixer.h b/assignment-client/src/audio/AudioMixer.h index cea8bba083..659227dffb 100644 --- a/assignment-client/src/audio/AudioMixer.h +++ b/assignment-client/src/audio/AudioMixer.h @@ -9,8 +9,8 @@ // See the accompanying file LICENSE or http://www.apache.org/licenses/LICENSE-2.0.html // -#ifndef __hifi__AudioMixer__ -#define __hifi__AudioMixer__ +#ifndef hifi_AudioMixer_h +#define hifi_AudioMixer_h #include @@ -53,4 +53,4 @@ private: int _sumMixes; }; -#endif /* defined(__hifi__AudioMixer__) */ +#endif // hifi_AudioMixer_h diff --git a/assignment-client/src/audio/AudioMixerClientData.h b/assignment-client/src/audio/AudioMixerClientData.h index aa449d20a3..a5f03ebd15 100644 --- a/assignment-client/src/audio/AudioMixerClientData.h +++ b/assignment-client/src/audio/AudioMixerClientData.h @@ -9,8 +9,8 @@ // See the accompanying file LICENSE or http://www.apache.org/licenses/LICENSE-2.0.html // -#ifndef __hifi__AudioMixerClientData__ -#define __hifi__AudioMixerClientData__ +#ifndef hifi_AudioMixerClientData_h +#define hifi_AudioMixerClientData_h #include @@ -34,4 +34,4 @@ private: std::vector _ringBuffers; }; -#endif /* defined(__hifi__AudioMixerClientData__) */ +#endif // hifi_AudioMixerClientData_h diff --git a/assignment-client/src/audio/AvatarAudioRingBuffer.h b/assignment-client/src/audio/AvatarAudioRingBuffer.h index fb9e68543f..1e61a82f68 100644 --- a/assignment-client/src/audio/AvatarAudioRingBuffer.h +++ b/assignment-client/src/audio/AvatarAudioRingBuffer.h @@ -9,8 +9,8 @@ // See the accompanying file LICENSE or http://www.apache.org/licenses/LICENSE-2.0.html // -#ifndef __hifi__AvatarAudioRingBuffer__ -#define __hifi__AvatarAudioRingBuffer__ +#ifndef hifi_AvatarAudioRingBuffer_h +#define hifi_AvatarAudioRingBuffer_h #include @@ -27,4 +27,4 @@ private: AvatarAudioRingBuffer& operator= (const AvatarAudioRingBuffer&); }; -#endif /* defined(__hifi__AvatarAudioRingBuffer__) */ +#endif // hifi_AvatarAudioRingBuffer_h diff --git a/assignment-client/src/avatars/AvatarMixer.h b/assignment-client/src/avatars/AvatarMixer.h index b9add245a6..a69019427b 100644 --- a/assignment-client/src/avatars/AvatarMixer.h +++ b/assignment-client/src/avatars/AvatarMixer.h @@ -12,8 +12,8 @@ // See the accompanying file LICENSE or http://www.apache.org/licenses/LICENSE-2.0.html // -#ifndef __hifi__AvatarMixer__ -#define __hifi__AvatarMixer__ +#ifndef hifi_AvatarMixer_h +#define hifi_AvatarMixer_h #include @@ -49,4 +49,4 @@ private: int _sumIdentityPackets; }; -#endif /* defined(__hifi__AvatarMixer__) */ +#endif // hifi_AvatarMixer_h diff --git a/assignment-client/src/avatars/AvatarMixerClientData.h b/assignment-client/src/avatars/AvatarMixerClientData.h index 75affca7ff..18c29c4b0f 100644 --- a/assignment-client/src/avatars/AvatarMixerClientData.h +++ b/assignment-client/src/avatars/AvatarMixerClientData.h @@ -9,8 +9,8 @@ // See the accompanying file LICENSE or http://www.apache.org/licenses/LICENSE-2.0.html // -#ifndef __hifi__AvatarMixerClientData__ -#define __hifi__AvatarMixerClientData__ +#ifndef hifi_AvatarMixerClientData_h +#define hifi_AvatarMixerClientData_h #include @@ -40,4 +40,4 @@ private: quint64 _identityChangeTimestamp; }; -#endif /* defined(__hifi__AvatarMixerClientData__) */ +#endif // hifi_AvatarMixerClientData_h diff --git a/assignment-client/src/metavoxels/MetavoxelServer.h b/assignment-client/src/metavoxels/MetavoxelServer.h index 749ab93b2a..b01bb9b412 100644 --- a/assignment-client/src/metavoxels/MetavoxelServer.h +++ b/assignment-client/src/metavoxels/MetavoxelServer.h @@ -9,8 +9,8 @@ // See the accompanying file LICENSE or http://www.apache.org/licenses/LICENSE-2.0.html // -#ifndef __hifi__MetavoxelServer__ -#define __hifi__MetavoxelServer__ +#ifndef hifi_MetavoxelServer_h +#define hifi_MetavoxelServer_h #include #include @@ -95,4 +95,4 @@ private: QList _sendRecords; }; -#endif /* defined(__hifi__MetavoxelServer__) */ +#endif // hifi_MetavoxelServer_h diff --git a/assignment-client/src/octree/OctreeInboundPacketProcessor.h b/assignment-client/src/octree/OctreeInboundPacketProcessor.h index e14065a9c1..f637a9e7c9 100644 --- a/assignment-client/src/octree/OctreeInboundPacketProcessor.h +++ b/assignment-client/src/octree/OctreeInboundPacketProcessor.h @@ -11,8 +11,8 @@ // See the accompanying file LICENSE or http://www.apache.org/licenses/LICENSE-2.0.html // -#ifndef __octree_server__OctreeInboundPacketProcessor__ -#define __octree_server__OctreeInboundPacketProcessor__ +#ifndef hifi_OctreeInboundPacketProcessor_h +#define hifi_OctreeInboundPacketProcessor_h #include @@ -83,4 +83,4 @@ private: NodeToSenderStatsMap _singleSenderStats; }; -#endif // __octree_server__OctreeInboundPacketProcessor__ +#endif // hifi_OctreeInboundPacketProcessor_h diff --git a/assignment-client/src/octree/OctreeQueryNode.h b/assignment-client/src/octree/OctreeQueryNode.h index 6c46679a0c..aa445db8a6 100644 --- a/assignment-client/src/octree/OctreeQueryNode.h +++ b/assignment-client/src/octree/OctreeQueryNode.h @@ -9,8 +9,8 @@ // See the accompanying file LICENSE or http://www.apache.org/licenses/LICENSE-2.0.html // -#ifndef __hifi__OctreeQueryNode__ -#define __hifi__OctreeQueryNode__ +#ifndef hifi_OctreeQueryNode_h +#define hifi_OctreeQueryNode_h #include #include @@ -138,4 +138,4 @@ private: bool _isShuttingDown; }; -#endif /* defined(__hifi__OctreeQueryNode__) */ +#endif // hifi_OctreeQueryNode_h diff --git a/assignment-client/src/octree/OctreeSendThread.h b/assignment-client/src/octree/OctreeSendThread.h index 423d9fc2bb..95205af32f 100644 --- a/assignment-client/src/octree/OctreeSendThread.h +++ b/assignment-client/src/octree/OctreeSendThread.h @@ -11,8 +11,8 @@ // See the accompanying file LICENSE or http://www.apache.org/licenses/LICENSE-2.0.html // -#ifndef __octree_server__OctreeSendThread__ -#define __octree_server__OctreeSendThread__ +#ifndef hifi_OctreeSendThread_h +#define hifi_OctreeSendThread_h #include #include @@ -55,4 +55,4 @@ private: bool _isShuttingDown; }; -#endif // __octree_server__OctreeSendThread__ +#endif // hifi_OctreeSendThread_h diff --git a/assignment-client/src/octree/OctreeServer.h b/assignment-client/src/octree/OctreeServer.h index bd37b4f896..d02764bc59 100644 --- a/assignment-client/src/octree/OctreeServer.h +++ b/assignment-client/src/octree/OctreeServer.h @@ -9,8 +9,8 @@ // See the accompanying file LICENSE or http://www.apache.org/licenses/LICENSE-2.0.html // -#ifndef __octree_server__OctreeServer__ -#define __octree_server__OctreeServer__ +#ifndef hifi_OctreeServer_h +#define hifi_OctreeServer_h #include #include @@ -219,4 +219,4 @@ protected: static QMutex _threadsDidCallWriteDatagramMutex; }; -#endif // __octree_server__OctreeServer__ +#endif // hifi_OctreeServer_h diff --git a/assignment-client/src/octree/OctreeServerConsts.h b/assignment-client/src/octree/OctreeServerConsts.h index 995a7d5b24..a10c81494c 100644 --- a/assignment-client/src/octree/OctreeServerConsts.h +++ b/assignment-client/src/octree/OctreeServerConsts.h @@ -9,8 +9,8 @@ // See the accompanying file LICENSE or http://www.apache.org/licenses/LICENSE-2.0.html // -#ifndef __octree_server__OctreeServerConsts__ -#define __octree_server__OctreeServerConsts__ +#ifndef hifi_OctreeServerConsts_h +#define hifi_OctreeServerConsts_h #include #include // for MAX_PACKET_SIZE @@ -21,4 +21,4 @@ const int INTERVALS_PER_SECOND = 60; const int OCTREE_SEND_INTERVAL_USECS = (1000 * 1000)/INTERVALS_PER_SECOND; const int SENDING_TIME_TO_SPARE = 5 * 1000; // usec of sending interval to spare for calculating voxels -#endif // __octree_server__OctreeServerConsts__ +#endif // hifi_OctreeServerConsts_h diff --git a/assignment-client/src/particles/ParticleNodeData.h b/assignment-client/src/particles/ParticleNodeData.h index d6995ebb0c..340ce4844f 100644 --- a/assignment-client/src/particles/ParticleNodeData.h +++ b/assignment-client/src/particles/ParticleNodeData.h @@ -9,8 +9,8 @@ // See the accompanying file LICENSE or http://www.apache.org/licenses/LICENSE-2.0.html // -#ifndef __hifi__ParticleNodeData__ -#define __hifi__ParticleNodeData__ +#ifndef hifi_ParticleNodeData_h +#define hifi_ParticleNodeData_h #include @@ -31,4 +31,4 @@ private: quint64 _lastDeletedParticlesSentAt; }; -#endif /* defined(__hifi__ParticleNodeData__) */ +#endif // hifi_ParticleNodeData_h diff --git a/assignment-client/src/particles/ParticleServer.h b/assignment-client/src/particles/ParticleServer.h index 8371ba0301..495fc02c68 100644 --- a/assignment-client/src/particles/ParticleServer.h +++ b/assignment-client/src/particles/ParticleServer.h @@ -9,8 +9,8 @@ // See the accompanying file LICENSE or http://www.apache.org/licenses/LICENSE-2.0.html // -#ifndef __particle_server__ParticleServer__ -#define __particle_server__ParticleServer__ +#ifndef hifi_ParticleServer_h +#define hifi_ParticleServer_h #include "../octree/OctreeServer.h" @@ -47,4 +47,4 @@ public slots: private: }; -#endif // __particle_server__ParticleServer__ +#endif // hifi_ParticleServer_h diff --git a/assignment-client/src/particles/ParticleServerConsts.h b/assignment-client/src/particles/ParticleServerConsts.h index be9764ffbf..49df2a181e 100644 --- a/assignment-client/src/particles/ParticleServerConsts.h +++ b/assignment-client/src/particles/ParticleServerConsts.h @@ -9,11 +9,11 @@ // See the accompanying file LICENSE or http://www.apache.org/licenses/LICENSE-2.0.html // -#ifndef __particle_server__ParticleServerConsts__ -#define __particle_server__ParticleServerConsts__ +#ifndef hifi_ParticleServerConsts_h +#define hifi_ParticleServerConsts_h extern const char* PARTICLE_SERVER_NAME; extern const char* PARTICLE_SERVER_LOGGING_TARGET_NAME; extern const char* LOCAL_PARTICLES_PERSIST_FILE; -#endif // __particle_server__ParticleServerConsts__ +#endif // hifi_ParticleServerConsts_h diff --git a/assignment-client/src/voxels/VoxelNodeData.h b/assignment-client/src/voxels/VoxelNodeData.h index da6f41c10e..86d241852d 100644 --- a/assignment-client/src/voxels/VoxelNodeData.h +++ b/assignment-client/src/voxels/VoxelNodeData.h @@ -9,8 +9,8 @@ // See the accompanying file LICENSE or http://www.apache.org/licenses/LICENSE-2.0.html // -#ifndef __hifi__VoxelNodeData__ -#define __hifi__VoxelNodeData__ +#ifndef hifi_VoxelNodeData_h +#define hifi_VoxelNodeData_h #include @@ -22,4 +22,4 @@ public: virtual PacketType getMyPacketType() const { return PacketTypeVoxelData; } }; -#endif /* defined(__hifi__VoxelNodeData__) */ +#endif // hifi_VoxelNodeData_h diff --git a/assignment-client/src/voxels/VoxelServer.h b/assignment-client/src/voxels/VoxelServer.h index 2014012f2c..e81c16fc38 100644 --- a/assignment-client/src/voxels/VoxelServer.h +++ b/assignment-client/src/voxels/VoxelServer.h @@ -9,8 +9,8 @@ // See the accompanying file LICENSE or http://www.apache.org/licenses/LICENSE-2.0.html // -#ifndef __voxel_server__VoxelServer__ -#define __voxel_server__VoxelServer__ +#ifndef hifi_VoxelServer_h +#define hifi_VoxelServer_h #include #include @@ -55,4 +55,4 @@ private: unsigned char _tempOutputBuffer[MAX_PACKET_SIZE]; }; -#endif // __voxel_server__VoxelServer__ +#endif // hifi_VoxelServer_h diff --git a/assignment-client/src/voxels/VoxelServerConsts.h b/assignment-client/src/voxels/VoxelServerConsts.h index 373a75f1e8..5764e7d4cf 100644 --- a/assignment-client/src/voxels/VoxelServerConsts.h +++ b/assignment-client/src/voxels/VoxelServerConsts.h @@ -9,8 +9,8 @@ // See the accompanying file LICENSE or http://www.apache.org/licenses/LICENSE-2.0.html // -#ifndef __voxel_server__VoxelServerConsts__ -#define __voxel_server__VoxelServerConsts__ +#ifndef hifi_VoxelServerConsts_h +#define hifi_VoxelServerConsts_h extern const char* VOXEL_SERVER_NAME; extern const char* VOXEL_SERVER_LOGGING_TARGET_NAME; @@ -18,4 +18,4 @@ extern const char* LOCAL_VOXELS_PERSIST_FILE; const int ENVIRONMENT_SEND_INTERVAL_USECS = 1000000; -#endif // __voxel_server__VoxelServerConsts__ +#endif // hifi_VoxelServerConsts_h diff --git a/domain-server/src/DomainServer.h b/domain-server/src/DomainServer.h index 9a1853bdcc..c2f0eee995 100644 --- a/domain-server/src/DomainServer.h +++ b/domain-server/src/DomainServer.h @@ -9,8 +9,8 @@ // See the accompanying file LICENSE or http://www.apache.org/licenses/LICENSE-2.0.html // -#ifndef __hifi__DomainServer__ -#define __hifi__DomainServer__ +#ifndef hifi_DomainServer_h +#define hifi_DomainServer_h #include #include @@ -89,4 +89,4 @@ private slots: void readAvailableDatagrams(); }; -#endif /* defined(__hifi__DomainServer__) */ +#endif // hifi_DomainServer_h diff --git a/domain-server/src/DomainServerNodeData.h b/domain-server/src/DomainServerNodeData.h index 6da91c54fb..3b73ec17d2 100644 --- a/domain-server/src/DomainServerNodeData.h +++ b/domain-server/src/DomainServerNodeData.h @@ -9,8 +9,8 @@ // See the accompanying file LICENSE or http://www.apache.org/licenses/LICENSE-2.0.html // -#ifndef __hifi__DomainServerNodeData__ -#define __hifi__DomainServerNodeData__ +#ifndef hifi_DomainServerNodeData_h +#define hifi_DomainServerNodeData_h #include #include @@ -38,4 +38,4 @@ private: QJsonObject _statsJSONObject; }; -#endif /* defined(__hifi__DomainServerNodeData__) */ +#endif // hifi_DomainServerNodeData_h diff --git a/interface/src/AbstractLoggerInterface.h b/interface/src/AbstractLoggerInterface.h index 647c104743..f6cf136a71 100644 --- a/interface/src/AbstractLoggerInterface.h +++ b/interface/src/AbstractLoggerInterface.h @@ -9,8 +9,8 @@ // See the accompanying file LICENSE or http://www.apache.org/licenses/LICENSE-2.0.html // -#ifndef __interface__AbstractLoggerInterface__ -#define __interface__AbstractLoggerInterface__ +#ifndef hifi_AbstractLoggerInterface_h +#define hifi_AbstractLoggerInterface_h #include #include @@ -35,4 +35,4 @@ private: bool _extraDebugging; }; -#endif /* defined(__interface__AbstractLoggerInterface__) */ +#endif // hifi_AbstractLoggerInterface_h diff --git a/interface/src/Application.h b/interface/src/Application.h index e7af91e997..61c2a15f95 100644 --- a/interface/src/Application.h +++ b/interface/src/Application.h @@ -9,8 +9,8 @@ // See the accompanying file LICENSE or http://www.apache.org/licenses/LICENSE-2.0.html // -#ifndef __interface__Application__ -#define __interface__Application__ +#ifndef hifi_Application_h +#define hifi_Application_h #include #include @@ -508,4 +508,4 @@ private: QHash _scriptEnginesHash; }; -#endif /* defined(__interface__Application__) */ +#endif // hifi_Application_h diff --git a/interface/src/Audio.h b/interface/src/Audio.h index 647b88a4a9..84ab6c69cf 100644 --- a/interface/src/Audio.h +++ b/interface/src/Audio.h @@ -9,8 +9,8 @@ // See the accompanying file LICENSE or http://www.apache.org/licenses/LICENSE-2.0.html // -#ifndef __interface__Audio__ -#define __interface__Audio__ +#ifndef hifi_Audio_h +#define hifi_Audio_h #ifdef _WIN32 #define WANT_TIMEVAL @@ -192,4 +192,4 @@ private: }; -#endif /* defined(__interface__audio__) */ +#endif // hifi_Audio_h diff --git a/interface/src/BuckyBalls.h b/interface/src/BuckyBalls.h index 305ac4640c..f7690408d3 100644 --- a/interface/src/BuckyBalls.h +++ b/interface/src/BuckyBalls.h @@ -9,8 +9,8 @@ // See the accompanying file LICENSE or http://www.apache.org/licenses/LICENSE-2.0.html // -#ifndef __hifi__BuckyBalls__ -#define __hifi__BuckyBalls__ +#ifndef hifi_BuckyBalls_h +#define hifi_BuckyBalls_h #include @@ -47,4 +47,4 @@ private: }; -#endif /* defined(__hifi__BuckyBalls__) */ +#endif // hifi_BuckyBalls_h diff --git a/interface/src/Camera.h b/interface/src/Camera.h index 6e4b533cdc..5e189c1111 100644 --- a/interface/src/Camera.h +++ b/interface/src/Camera.h @@ -8,8 +8,8 @@ // See the accompanying file LICENSE or http://www.apache.org/licenses/LICENSE-2.0.html // -#ifndef __interface__camera__ -#define __interface__camera__ +#ifndef hifi_Camera_h +#define hifi_Camera_h #include #include @@ -154,4 +154,4 @@ private: Camera* _camera; ViewFrustum* _viewFrustum; }; -#endif +#endif // hifi_Camera_h diff --git a/interface/src/DatagramProcessor.h b/interface/src/DatagramProcessor.h index 6a55820e9d..7d337ec02b 100644 --- a/interface/src/DatagramProcessor.h +++ b/interface/src/DatagramProcessor.h @@ -9,8 +9,8 @@ // See the accompanying file LICENSE or http://www.apache.org/licenses/LICENSE-2.0.html // -#ifndef __hifi__DatagramProcessor__ -#define __hifi__DatagramProcessor__ +#ifndef hifi_DatagramProcessor_h +#define hifi_DatagramProcessor_h #include @@ -31,4 +31,4 @@ private: int _byteCount; }; -#endif /* defined(__hifi__DatagramProcessor__) */ +#endif // hifi_DatagramProcessor_h diff --git a/interface/src/Environment.h b/interface/src/Environment.h index aca5fac9d8..525f3b7eb4 100644 --- a/interface/src/Environment.h +++ b/interface/src/Environment.h @@ -9,8 +9,8 @@ // See the accompanying file LICENSE or http://www.apache.org/licenses/LICENSE-2.0.html // -#ifndef __interface__Environment__ -#define __interface__Environment__ +#ifndef hifi_Environment_h +#define hifi_Environment_h #include #include @@ -78,4 +78,4 @@ private: QMutex _mutex; }; -#endif /* defined(__interface__Environment__) */ +#endif // hifi_Environment_h diff --git a/interface/src/FileLogger.h b/interface/src/FileLogger.h index a65aa3321c..5da86044ab 100644 --- a/interface/src/FileLogger.h +++ b/interface/src/FileLogger.h @@ -32,4 +32,4 @@ private: }; -#endif +#endif // hifi_FileLogger_h diff --git a/interface/src/GLCanvas.h b/interface/src/GLCanvas.h index 0b75ef5c5f..73b70de19e 100644 --- a/interface/src/GLCanvas.h +++ b/interface/src/GLCanvas.h @@ -9,8 +9,8 @@ // See the accompanying file LICENSE or http://www.apache.org/licenses/LICENSE-2.0.html // -#ifndef __hifi__GLCanvas__ -#define __hifi__GLCanvas__ +#ifndef hifi_GLCanvas_h +#define hifi_GLCanvas_h #include #include @@ -52,4 +52,4 @@ private slots: void throttleRender(); }; -#endif /* defined(__hifi__GLCanvas__) */ +#endif // hifi_GLCanvas_h diff --git a/interface/src/Menu.h b/interface/src/Menu.h index 2b90d4e3c9..5bc48f916f 100644 --- a/interface/src/Menu.h +++ b/interface/src/Menu.h @@ -9,8 +9,8 @@ // See the accompanying file LICENSE or http://www.apache.org/licenses/LICENSE-2.0.html // -#ifndef __hifi__Menu__ -#define __hifi__Menu__ +#ifndef hifi_Menu_h +#define hifi_Menu_h #include #include @@ -323,4 +323,4 @@ namespace MenuOption { void sendFakeEnterEvent(); -#endif /* defined(__hifi__Menu__) */ +#endif // hifi_Menu_h diff --git a/interface/src/MetavoxelSystem.h b/interface/src/MetavoxelSystem.h index cc6fa6e743..f98a260ab1 100644 --- a/interface/src/MetavoxelSystem.h +++ b/interface/src/MetavoxelSystem.h @@ -9,8 +9,8 @@ // See the accompanying file LICENSE or http://www.apache.org/licenses/LICENSE-2.0.html // -#ifndef __interface__MetavoxelSystem__ -#define __interface__MetavoxelSystem__ +#ifndef hifi_MetavoxelSystem_h +#define hifi_MetavoxelSystem_h #include #include @@ -201,4 +201,4 @@ private: Model* _model; }; -#endif /* defined(__interface__MetavoxelSystem__) */ +#endif // hifi_MetavoxelSystem_h diff --git a/interface/src/ParticleTreeRenderer.h b/interface/src/ParticleTreeRenderer.h index 531cbc23f7..7dc866c731 100644 --- a/interface/src/ParticleTreeRenderer.h +++ b/interface/src/ParticleTreeRenderer.h @@ -9,8 +9,8 @@ // See the accompanying file LICENSE or http://www.apache.org/licenses/LICENSE-2.0.html // -#ifndef __hifi__ParticleTreeRenderer__ -#define __hifi__ParticleTreeRenderer__ +#ifndef hifi_ParticleTreeRenderer_h +#define hifi_ParticleTreeRenderer_h #include #include @@ -51,4 +51,4 @@ protected: QMap _particleModels; }; -#endif /* defined(__hifi__ParticleTreeRenderer__) */ +#endif // hifi_ParticleTreeRenderer_h diff --git a/interface/src/Physics.h b/interface/src/Physics.h index bf1673a0fe..97e873d920 100644 --- a/interface/src/Physics.h +++ b/interface/src/Physics.h @@ -15,4 +15,4 @@ void applyStaticFriction(float deltaTime, glm::vec3& velocity, float maxVelocity, float strength); void applyDamping(float deltaTime, glm::vec3& velocity, float linearStrength, float squaredStrength); -#endif +#endif // hifi_Physics_h diff --git a/interface/src/Stars.h b/interface/src/Stars.h index b38c1a2748..08f218b9fa 100755 --- a/interface/src/Stars.h +++ b/interface/src/Stars.h @@ -9,8 +9,8 @@ // See the accompanying file LICENSE or http://www.apache.org/licenses/LICENSE-2.0.html // -#ifndef __interface__Stars__ -#define __interface__Stars__ +#ifndef hifi_Stars_h +#define hifi_Stars_h #include @@ -52,5 +52,4 @@ private: }; -#endif - +#endif // hifi_Stars_h diff --git a/interface/src/Util.h b/interface/src/Util.h index 26a3c85e3c..4f0e76adf8 100644 --- a/interface/src/Util.h +++ b/interface/src/Util.h @@ -9,8 +9,8 @@ // See the accompanying file LICENSE or http://www.apache.org/licenses/LICENSE-2.0.html // -#ifndef __interface__Util__ -#define __interface__Util__ +#ifndef hifi_Util_h +#define hifi_Util_h #ifdef _WIN32 #include "Systime.h" @@ -80,4 +80,4 @@ bool rayIntersectsSphere(const glm::vec3& rayStarting, const glm::vec3& rayNorma bool pointInSphere(glm::vec3& point, glm::vec3& sphereCenter, double sphereRadius); -#endif +#endif // hifi_Util_h diff --git a/interface/src/XmppClient.h b/interface/src/XmppClient.h index ac724a4d68..8af3204377 100644 --- a/interface/src/XmppClient.h +++ b/interface/src/XmppClient.h @@ -11,8 +11,8 @@ #ifdef HAVE_QXMPP -#ifndef __interface__XmppClient__ -#define __interface__XmppClient__ +#ifndef hifi_XmppClient_h +#define hifi_XmppClient_h #include #include @@ -47,4 +47,4 @@ private: #endif // __interface__XmppClient__ -#endif +#endif // hifi_XmppClient_h diff --git a/interface/src/avatar/Avatar.h b/interface/src/avatar/Avatar.h index a1bc7ad0bd..4e24c00c7e 100755 --- a/interface/src/avatar/Avatar.h +++ b/interface/src/avatar/Avatar.h @@ -8,8 +8,8 @@ // See the accompanying file LICENSE or http://www.apache.org/licenses/LICENSE-2.0.html // -#ifndef __interface__avatar__ -#define __interface__avatar__ +#ifndef hifi_Avatar_h +#define hifi_Avatar_h #include #include @@ -202,4 +202,4 @@ private: float getBillboardSize() const; }; -#endif +#endif // hifi_Avatar_h diff --git a/interface/src/avatar/AvatarManager.h b/interface/src/avatar/AvatarManager.h index db3c9dbf44..78491b3a5d 100644 --- a/interface/src/avatar/AvatarManager.h +++ b/interface/src/avatar/AvatarManager.h @@ -9,8 +9,8 @@ // See the accompanying file LICENSE or http://www.apache.org/licenses/LICENSE-2.0.html // -#ifndef __hifi__AvatarManager__ -#define __hifi__AvatarManager__ +#ifndef hifi_AvatarManager_h +#define hifi_AvatarManager_h #include #include @@ -59,4 +59,4 @@ private: QSharedPointer _myAvatar; }; -#endif /* defined(__hifi__AvatarManager__) */ +#endif // hifi_AvatarManager_h diff --git a/interface/src/avatar/FaceModel.h b/interface/src/avatar/FaceModel.h index 3fec640bdd..fdf8ab1fd2 100644 --- a/interface/src/avatar/FaceModel.h +++ b/interface/src/avatar/FaceModel.h @@ -9,8 +9,8 @@ // See the accompanying file LICENSE or http://www.apache.org/licenses/LICENSE-2.0.html // -#ifndef __interface__FaceModel__ -#define __interface__FaceModel__ +#ifndef hifi_FaceModel_h +#define hifi_FaceModel_h #include "renderer/Model.h" @@ -36,4 +36,4 @@ private: Head* _owningHead; }; -#endif /* defined(__interface__FaceModel__) */ +#endif // hifi_FaceModel_h diff --git a/interface/src/avatar/Hand.h b/interface/src/avatar/Hand.h index f3054a7080..1c857a198a 100755 --- a/interface/src/avatar/Hand.h +++ b/interface/src/avatar/Hand.h @@ -84,5 +84,4 @@ private: void playSlaps(PalmData& palm, Avatar* avatar); }; -#endif - +#endif // hifi_Hand_h diff --git a/interface/src/avatar/Head.h b/interface/src/avatar/Head.h index f4840121a6..a6cda5622c 100644 --- a/interface/src/avatar/Head.h +++ b/interface/src/avatar/Head.h @@ -140,4 +140,4 @@ private: friend class FaceModel; }; -#endif +#endif // hifi_Head_h diff --git a/interface/src/avatar/MyAvatar.h b/interface/src/avatar/MyAvatar.h index d0589687df..946481f3e6 100644 --- a/interface/src/avatar/MyAvatar.h +++ b/interface/src/avatar/MyAvatar.h @@ -9,8 +9,8 @@ // See the accompanying file LICENSE or http://www.apache.org/licenses/LICENSE-2.0.html // -#ifndef __interface__myavatar__ -#define __interface__myavatar__ +#ifndef hifi_MyAvatar_h +#define hifi_MyAvatar_h #include @@ -143,4 +143,4 @@ private: void maybeUpdateBillboard(); }; -#endif +#endif // hifi_MyAvatar_h diff --git a/interface/src/avatar/SkeletonModel.h b/interface/src/avatar/SkeletonModel.h index b3a7c4c7e4..2020ccf3b2 100644 --- a/interface/src/avatar/SkeletonModel.h +++ b/interface/src/avatar/SkeletonModel.h @@ -9,8 +9,8 @@ // See the accompanying file LICENSE or http://www.apache.org/licenses/LICENSE-2.0.html // -#ifndef __interface__SkeletonModel__ -#define __interface__SkeletonModel__ +#ifndef hifi_SkeletonModel_h +#define hifi_SkeletonModel_h #include "renderer/Model.h" @@ -50,4 +50,4 @@ private: Avatar* _owningAvatar; }; -#endif /* defined(__interface__SkeletonModel__) */ +#endif // hifi_SkeletonModel_h diff --git a/interface/src/devices/Faceshift.h b/interface/src/devices/Faceshift.h index abac2c74a1..157409882c 100644 --- a/interface/src/devices/Faceshift.h +++ b/interface/src/devices/Faceshift.h @@ -9,8 +9,8 @@ // See the accompanying file LICENSE or http://www.apache.org/licenses/LICENSE-2.0.html // -#ifndef __interface__Faceshift__ -#define __interface__Faceshift__ +#ifndef hifi_Faceshift_h +#define hifi_Faceshift_h #include #include @@ -141,4 +141,4 @@ private: float _estimatedEyeYaw; }; -#endif /* defined(__interface__Faceshift__) */ +#endif // hifi_Faceshift_h diff --git a/interface/src/devices/OculusManager.h b/interface/src/devices/OculusManager.h index 7927c84341..09e204d795 100644 --- a/interface/src/devices/OculusManager.h +++ b/interface/src/devices/OculusManager.h @@ -9,8 +9,8 @@ // See the accompanying file LICENSE or http://www.apache.org/licenses/LICENSE-2.0.html // -#ifndef __hifi__OculusManager__ -#define __hifi__OculusManager__ +#ifndef hifi_OculusManager_h +#define hifi_OculusManager_h #include @@ -62,4 +62,4 @@ private: #endif }; -#endif /* defined(__hifi__OculusManager__) */ +#endif // hifi_OculusManager_h diff --git a/interface/src/devices/SixenseManager.h b/interface/src/devices/SixenseManager.h index 24c37a027f..2fc6b3dcb3 100644 --- a/interface/src/devices/SixenseManager.h +++ b/interface/src/devices/SixenseManager.h @@ -9,8 +9,8 @@ // See the accompanying file LICENSE or http://www.apache.org/licenses/LICENSE-2.0.html // -#ifndef __interface__SixenseManager__ -#define __interface__SixenseManager__ +#ifndef hifi_SixenseManager_h +#define hifi_SixenseManager_h #include @@ -66,5 +66,4 @@ private: quint64 _lastMovement; }; -#endif /* defined(__interface__SixenseManager__) */ - +#endif // hifi_SixenseManager_h diff --git a/interface/src/devices/TV3DManager.h b/interface/src/devices/TV3DManager.h index aa1f927676..91a78e9bce 100644 --- a/interface/src/devices/TV3DManager.h +++ b/interface/src/devices/TV3DManager.h @@ -9,8 +9,8 @@ // See the accompanying file LICENSE or http://www.apache.org/licenses/LICENSE-2.0.html // -#ifndef __hifi__TV3DManager__ -#define __hifi__TV3DManager__ +#ifndef hifi_TV3DManager_h +#define hifi_TV3DManager_h #include @@ -41,4 +41,4 @@ private: static eyeFrustum _rightEye; }; -#endif /* defined(__hifi__TV3DManager__) */ +#endif // hifi_TV3DManager_h diff --git a/interface/src/devices/Visage.h b/interface/src/devices/Visage.h index 02cceb8afa..68c5055954 100644 --- a/interface/src/devices/Visage.h +++ b/interface/src/devices/Visage.h @@ -9,8 +9,8 @@ // See the accompanying file LICENSE or http://www.apache.org/licenses/LICENSE-2.0.html // -#ifndef __interface__Visage__ -#define __interface__Visage__ +#ifndef hifi_Visage_h +#define hifi_Visage_h #include #include @@ -75,4 +75,4 @@ private: QVector _blendshapeCoefficients; }; -#endif /* defined(__interface__Visage__) */ +#endif // hifi_Visage_h diff --git a/interface/src/location/LocationManager.h b/interface/src/location/LocationManager.h index cda64e5058..26e1cb52d5 100644 --- a/interface/src/location/LocationManager.h +++ b/interface/src/location/LocationManager.h @@ -9,8 +9,8 @@ // See the accompanying file LICENSE or http://www.apache.org/licenses/LICENSE-2.0.html // -#ifndef __hifi__LocationManager__ -#define __hifi__LocationManager__ +#ifndef hifi_LocationManager_h +#define hifi_LocationManager_h #include @@ -58,4 +58,4 @@ private slots: }; -#endif /* defined(__hifi__LocationManager__) */ +#endif // hifi_LocationManager_h diff --git a/interface/src/location/NamedLocation.h b/interface/src/location/NamedLocation.h index 7aa020f8e9..ffbd157263 100644 --- a/interface/src/location/NamedLocation.h +++ b/interface/src/location/NamedLocation.h @@ -9,8 +9,8 @@ // See the accompanying file LICENSE or http://www.apache.org/licenses/LICENSE-2.0.html // -#ifndef __hifi__NamedLocation__ -#define __hifi__NamedLocation__ +#ifndef hifi_NamedLocation_h +#define hifi_NamedLocation_h #include #include @@ -58,4 +58,4 @@ private: }; -#endif /* defined(__hifi__NamedLocation__) */ +#endif // hifi_NamedLocation_h diff --git a/interface/src/renderer/AmbientOcclusionEffect.h b/interface/src/renderer/AmbientOcclusionEffect.h index 1711b89d16..3b22c7629a 100644 --- a/interface/src/renderer/AmbientOcclusionEffect.h +++ b/interface/src/renderer/AmbientOcclusionEffect.h @@ -9,8 +9,8 @@ // See the accompanying file LICENSE or http://www.apache.org/licenses/LICENSE-2.0.html // -#ifndef __interface__AmbientOcclusionEffect__ -#define __interface__AmbientOcclusionEffect__ +#ifndef hifi_AmbientOcclusionEffect_h +#define hifi_AmbientOcclusionEffect_h class ProgramObject; @@ -40,4 +40,4 @@ private: GLuint _rotationTextureID; }; -#endif /* defined(__interface__AmbientOcclusionEffect__) */ +#endif // hifi_AmbientOcclusionEffect_h diff --git a/interface/src/renderer/FBXReader.h b/interface/src/renderer/FBXReader.h index 85ca23c53f..73c305e2eb 100644 --- a/interface/src/renderer/FBXReader.h +++ b/interface/src/renderer/FBXReader.h @@ -9,8 +9,8 @@ // See the accompanying file LICENSE or http://www.apache.org/licenses/LICENSE-2.0.html // -#ifndef __interface__FBXReader__ -#define __interface__FBXReader__ +#ifndef hifi_FBXReader_h +#define hifi_FBXReader_h #include #include @@ -203,4 +203,4 @@ FBXGeometry readFBX(const QByteArray& model, const QVariantHash& mapping); /// Reads SVO geometry from the supplied model data. FBXGeometry readSVO(const QByteArray& model); -#endif /* defined(__interface__FBXReader__) */ +#endif // hifi_FBXReader_h diff --git a/interface/src/renderer/GeometryCache.h b/interface/src/renderer/GeometryCache.h index ea6b3c2e0f..c2d276fb5e 100644 --- a/interface/src/renderer/GeometryCache.h +++ b/interface/src/renderer/GeometryCache.h @@ -9,8 +9,8 @@ // See the accompanying file LICENSE or http://www.apache.org/licenses/LICENSE-2.0.html // -#ifndef __interface__GeometryCache__ -#define __interface__GeometryCache__ +#ifndef hifi_GeometryCache_h +#define hifi_GeometryCache_h // include this before QOpenGLBuffer, which includes an earlier version of OpenGL #include "InterfaceConfig.h" @@ -140,4 +140,4 @@ public: int getTranslucentPartCount() const; }; -#endif /* defined(__interface__GeometryCache__) */ +#endif // hifi_GeometryCache_h diff --git a/interface/src/renderer/GlowEffect.h b/interface/src/renderer/GlowEffect.h index cf635083c6..b675589526 100644 --- a/interface/src/renderer/GlowEffect.h +++ b/interface/src/renderer/GlowEffect.h @@ -9,8 +9,8 @@ // See the accompanying file LICENSE or http://www.apache.org/licenses/LICENSE-2.0.html // -#ifndef __interface__GlowEffect__ -#define __interface__GlowEffect__ +#ifndef hifi_GlowEffect_h +#define hifi_GlowEffect_h #include #include @@ -83,4 +83,4 @@ public: ~Glower(); }; -#endif /* defined(__interface__GlowEffect__) */ +#endif // hifi_GlowEffect_h diff --git a/interface/src/renderer/Model.h b/interface/src/renderer/Model.h index dea5e3aa59..30625cc16f 100644 --- a/interface/src/renderer/Model.h +++ b/interface/src/renderer/Model.h @@ -9,8 +9,8 @@ // See the accompanying file LICENSE or http://www.apache.org/licenses/LICENSE-2.0.html // -#ifndef __interface__Model__ -#define __interface__Model__ +#ifndef hifi_Model_h +#define hifi_Model_h #include #include @@ -309,4 +309,4 @@ Q_DECLARE_METATYPE(QPointer) Q_DECLARE_METATYPE(QWeakPointer) Q_DECLARE_METATYPE(QVector) -#endif /* defined(__interface__Model__) */ +#endif // hifi_Model_h diff --git a/interface/src/renderer/PointShader.h b/interface/src/renderer/PointShader.h index f67e2239cc..1db4f1b201 100644 --- a/interface/src/renderer/PointShader.h +++ b/interface/src/renderer/PointShader.h @@ -9,8 +9,8 @@ // See the accompanying file LICENSE or http://www.apache.org/licenses/LICENSE-2.0.html // -#ifndef __interface__PointShader__ -#define __interface__PointShader__ +#ifndef hifi_PointShader_h +#define hifi_PointShader_h #include @@ -45,4 +45,4 @@ private: ProgramObject* _program; }; -#endif /* defined(__interface__PointShader__) */ +#endif // hifi_PointShader_h diff --git a/interface/src/renderer/ProgramObject.h b/interface/src/renderer/ProgramObject.h index 3c902cd215..21e01ac8b3 100644 --- a/interface/src/renderer/ProgramObject.h +++ b/interface/src/renderer/ProgramObject.h @@ -9,8 +9,8 @@ // See the accompanying file LICENSE or http://www.apache.org/licenses/LICENSE-2.0.html // -#ifndef __interface__ProgramObject__ -#define __interface__ProgramObject__ +#ifndef hifi_ProgramObject_h +#define hifi_ProgramObject_h #include @@ -25,4 +25,4 @@ public: void setUniform(const char* name, const glm::vec3& value); }; -#endif /* defined(__interface__ProgramObject__) */ +#endif // hifi_ProgramObject_h diff --git a/interface/src/renderer/RenderUtil.h b/interface/src/renderer/RenderUtil.h index fb71f46e9e..637596c78b 100644 --- a/interface/src/renderer/RenderUtil.h +++ b/interface/src/renderer/RenderUtil.h @@ -9,10 +9,10 @@ // See the accompanying file LICENSE or http://www.apache.org/licenses/LICENSE-2.0.html // -#ifndef __interface__RenderUtil__ -#define __interface__RenderUtil__ +#ifndef hifi_RenderUtil_h +#define hifi_RenderUtil_h /// Renders a quad from (-1, -1, 0) to (1, 1, 0) with texture coordinates from (sMin, 0) to (sMax, 1). void renderFullscreenQuad(float sMin = 0.0f, float sMax = 1.0f); -#endif /* defined(__interface__RenderUtil__) */ +#endif // hifi_RenderUtil_h diff --git a/interface/src/renderer/TextureCache.h b/interface/src/renderer/TextureCache.h index d8884c310f..e66044d843 100644 --- a/interface/src/renderer/TextureCache.h +++ b/interface/src/renderer/TextureCache.h @@ -9,8 +9,8 @@ // See the accompanying file LICENSE or http://www.apache.org/licenses/LICENSE-2.0.html // -#ifndef __interface__TextureCache__ -#define __interface__TextureCache__ +#ifndef hifi_TextureCache_h +#define hifi_TextureCache_h #include #include @@ -158,4 +158,4 @@ private: QMap > _dilatedTextures; }; -#endif /* defined(__interface__TextureCache__) */ +#endif // hifi_TextureCache_h diff --git a/interface/src/renderer/VoxelShader.h b/interface/src/renderer/VoxelShader.h index 4d8a4c749c..cfcd27bba7 100644 --- a/interface/src/renderer/VoxelShader.h +++ b/interface/src/renderer/VoxelShader.h @@ -9,8 +9,8 @@ // See the accompanying file LICENSE or http://www.apache.org/licenses/LICENSE-2.0.html // -#ifndef __interface__VoxelShader__ -#define __interface__VoxelShader__ +#ifndef hifi_VoxelShader_h +#define hifi_VoxelShader_h #include @@ -46,4 +46,4 @@ private: ProgramObject* _program; }; -#endif /* defined(__interface__VoxelShader__) */ +#endif // hifi_VoxelShader_h diff --git a/interface/src/scripting/AudioDeviceScriptingInterface.h b/interface/src/scripting/AudioDeviceScriptingInterface.h index 0495517139..62f1153a0b 100644 --- a/interface/src/scripting/AudioDeviceScriptingInterface.h +++ b/interface/src/scripting/AudioDeviceScriptingInterface.h @@ -9,8 +9,8 @@ // See the accompanying file LICENSE or http://www.apache.org/licenses/LICENSE-2.0.html // -#ifndef __hifi__AudioDeviceScriptingInterface__ -#define __hifi__AudioDeviceScriptingInterface__ +#ifndef hifi_AudioDeviceScriptingInterface_h +#define hifi_AudioDeviceScriptingInterface_h #include #include @@ -41,4 +41,4 @@ public slots: void setInputVolume(float volume); }; -#endif /* defined(__hifi__AudioDeviceScriptingInterface__) */ +#endif // hifi_AudioDeviceScriptingInterface_h diff --git a/interface/src/scripting/ClipboardScriptingInterface.h b/interface/src/scripting/ClipboardScriptingInterface.h index 16872b1952..f0258b0cc7 100644 --- a/interface/src/scripting/ClipboardScriptingInterface.h +++ b/interface/src/scripting/ClipboardScriptingInterface.h @@ -8,8 +8,8 @@ // See the accompanying file LICENSE or http://www.apache.org/licenses/LICENSE-2.0.html // -#ifndef __interface__Clipboard__ -#define __interface__Clipboard__ +#ifndef hifi_ClipboardScriptingInterface_h +#define hifi_ClipboardScriptingInterface_h #include #include @@ -44,4 +44,4 @@ public slots: void nudgeVoxel(float x, float y, float z, float s, const glm::vec3& nudgeVec); }; -#endif // __interface__Clipboard__ +#endif // hifi_ClipboardScriptingInterface_h diff --git a/interface/src/scripting/ControllerScriptingInterface.h b/interface/src/scripting/ControllerScriptingInterface.h index ebe5f4d943..c5d805dca5 100644 --- a/interface/src/scripting/ControllerScriptingInterface.h +++ b/interface/src/scripting/ControllerScriptingInterface.h @@ -9,8 +9,8 @@ // See the accompanying file LICENSE or http://www.apache.org/licenses/LICENSE-2.0.html // -#ifndef __hifi__ControllerScriptingInterface__ -#define __hifi__ControllerScriptingInterface__ +#ifndef hifi_ControllerScriptingInterface_h +#define hifi_ControllerScriptingInterface_h #include @@ -98,4 +98,4 @@ const int NUMBER_OF_BUTTONS_PER_PALM = 6; const int PALM_SPATIALCONTROL = 0; const int TIP_SPATIALCONTROL = 1; -#endif /* defined(__hifi__ControllerScriptingInterface__) */ +#endif // hifi_ControllerScriptingInterface_h diff --git a/interface/src/scripting/MenuScriptingInterface.h b/interface/src/scripting/MenuScriptingInterface.h index 15042fd355..d127bd6edc 100644 --- a/interface/src/scripting/MenuScriptingInterface.h +++ b/interface/src/scripting/MenuScriptingInterface.h @@ -9,8 +9,8 @@ // See the accompanying file LICENSE or http://www.apache.org/licenses/LICENSE-2.0.html // -#ifndef __hifi__MenuScriptingInterface__ -#define __hifi__MenuScriptingInterface__ +#ifndef hifi_MenuScriptingInterface_h +#define hifi_MenuScriptingInterface_h #include #include @@ -50,4 +50,4 @@ signals: void menuItemEvent(const QString& menuItem); }; -#endif /* defined(__hifi__MenuScriptingInterface__) */ +#endif // hifi_MenuScriptingInterface_h diff --git a/interface/src/scripting/SettingsScriptingInterface.h b/interface/src/scripting/SettingsScriptingInterface.h index 84855c1b3c..e3138be4a0 100644 --- a/interface/src/scripting/SettingsScriptingInterface.h +++ b/interface/src/scripting/SettingsScriptingInterface.h @@ -9,8 +9,8 @@ // See the accompanying file LICENSE or http://www.apache.org/licenses/LICENSE-2.0.html // -#ifndef __hifi__SettingsScriptingInterface__ -#define __hifi__SettingsScriptingInterface__ +#ifndef hifi_SettingsScriptingInterface_h +#define hifi_SettingsScriptingInterface_h #include #include @@ -30,4 +30,4 @@ public slots: void setValue(const QString& setting, const QVariant& value); }; -#endif /* defined(__hifi__SettingsScriptingInterface__) */ +#endif // hifi_SettingsScriptingInterface_h diff --git a/interface/src/starfield/Config.h b/interface/src/starfield/Config.h index a44006fb17..7777c5207b 100755 --- a/interface/src/starfield/Config.h +++ b/interface/src/starfield/Config.h @@ -9,8 +9,8 @@ // See the accompanying file LICENSE or http://www.apache.org/licenses/LICENSE-2.0.html // -#ifndef __interface__starfield__Config__ -#define __interface__starfield__Config__ +#ifndef hifi_Config_h +#define hifi_Config_h #include "InterfaceConfig.h" #include "renderer/ProgramObject.h" @@ -58,4 +58,4 @@ namespace starfield { } -#endif \ No newline at end of file +#endif // hifi_Config_h diff --git a/interface/src/starfield/Controller.h b/interface/src/starfield/Controller.h index b994d48580..06db5cb833 100755 --- a/interface/src/starfield/Controller.h +++ b/interface/src/starfield/Controller.h @@ -10,8 +10,8 @@ // See the accompanying file LICENSE or http://www.apache.org/licenses/LICENSE-2.0.html // -#ifndef __interface__starfield__Controller__ -#define __interface__starfield__Controller__ +#ifndef hifi_Controller_h +#define hifi_Controller_h #include @@ -41,4 +41,4 @@ namespace starfield { Renderer* _renderer; }; } -#endif +#endif // hifi_Controller_h diff --git a/interface/src/starfield/Generator.h b/interface/src/starfield/Generator.h index 238ff99f80..5352b3daf1 100644 --- a/interface/src/starfield/Generator.h +++ b/interface/src/starfield/Generator.h @@ -9,8 +9,8 @@ // See the accompanying file LICENSE or http://www.apache.org/licenses/LICENSE-2.0.html // -#ifndef __interface__starfield__Generator__ -#define __interface__starfield__Generator__ +#ifndef hifi_Generator_h +#define hifi_Generator_h #include #include @@ -37,4 +37,4 @@ namespace starfield { }; } -#endif +#endif // hifi_Generator_h diff --git a/interface/src/starfield/data/GpuVertex.h b/interface/src/starfield/data/GpuVertex.h index 71cef97061..f3b3ccd451 100755 --- a/interface/src/starfield/data/GpuVertex.h +++ b/interface/src/starfield/data/GpuVertex.h @@ -10,8 +10,8 @@ // See the accompanying file LICENSE or http://www.apache.org/licenses/LICENSE-2.0.html // -#ifndef __interface__starfield__data__GpuVertex__ -#define __interface__starfield__data__GpuVertex__ +#ifndef hifi_GpuVertex_h +#define hifi_GpuVertex_h #include "starfield/data/InputVertex.h" @@ -34,5 +34,4 @@ namespace starfield { } -#endif - +#endif // hifi_GpuVertex_h diff --git a/interface/src/starfield/data/InputVertex.h b/interface/src/starfield/data/InputVertex.h index f78f3ea136..2eeda183ec 100755 --- a/interface/src/starfield/data/InputVertex.h +++ b/interface/src/starfield/data/InputVertex.h @@ -10,8 +10,8 @@ // See the accompanying file LICENSE or http://www.apache.org/licenses/LICENSE-2.0.html // -#ifndef __interface__starfield__data__InputVertex__ -#define __interface__starfield__data__InputVertex__ +#ifndef hifi_InputVertex_h +#define hifi_InputVertex_h #include "starfield/Config.h" @@ -36,5 +36,4 @@ namespace starfield { } -#endif - +#endif // hifi_InputVertex_h diff --git a/interface/src/starfield/data/Tile.h b/interface/src/starfield/data/Tile.h index 17e737af38..7273394984 100755 --- a/interface/src/starfield/data/Tile.h +++ b/interface/src/starfield/data/Tile.h @@ -9,8 +9,8 @@ // See the accompanying file LICENSE or http://www.apache.org/licenses/LICENSE-2.0.html // -#ifndef __interface__starfield__data__Tile__ -#define __interface__starfield__data__Tile__ +#ifndef hifi_Tile_h +#define hifi_Tile_h #include "starfield/Config.h" @@ -29,5 +29,4 @@ namespace starfield { } -#endif - +#endif // hifi_Tile_h diff --git a/interface/src/starfield/renderer/Renderer.h b/interface/src/starfield/renderer/Renderer.h index 2494377180..1e271512d2 100755 --- a/interface/src/starfield/renderer/Renderer.h +++ b/interface/src/starfield/renderer/Renderer.h @@ -10,8 +10,8 @@ // See the accompanying file LICENSE or http://www.apache.org/licenses/LICENSE-2.0.html // -#ifndef __interface__starfield__renderer__Renderer__ -#define __interface__starfield__renderer__Renderer__ +#ifndef hifi_Renderer_h +#define hifi_Renderer_h #include "starfield/Config.h" #include "starfield/data/InputVertex.h" @@ -139,4 +139,4 @@ namespace starfield { } -#endif \ No newline at end of file +#endif // hifi_Renderer_h diff --git a/interface/src/starfield/renderer/Tiling.h b/interface/src/starfield/renderer/Tiling.h index 91547d87ca..e299b0998f 100755 --- a/interface/src/starfield/renderer/Tiling.h +++ b/interface/src/starfield/renderer/Tiling.h @@ -9,8 +9,8 @@ // See the accompanying file LICENSE or http://www.apache.org/licenses/LICENSE-2.0.html // -#ifndef __interface__starfield__renderer__Tiling__ -#define __interface__starfield__renderer__Tiling__ +#ifndef hifi_Tiling_h +#define hifi_Tiling_h #include "starfield/Config.h" @@ -45,5 +45,4 @@ namespace starfield { }; } -#endif - +#endif // hifi_Tiling_h diff --git a/interface/src/starfield/renderer/VertexOrder.h b/interface/src/starfield/renderer/VertexOrder.h index 704af857cf..e45ccdedb0 100755 --- a/interface/src/starfield/renderer/VertexOrder.h +++ b/interface/src/starfield/renderer/VertexOrder.h @@ -9,8 +9,8 @@ // See the accompanying file LICENSE or http://www.apache.org/licenses/LICENSE-2.0.html // -#ifndef __interface__starfield__renderer__VertexOrder__ -#define __interface__starfield__renderer__VertexOrder__ +#ifndef hifi_VertexOrder_h +#define hifi_VertexOrder_h #include "starfield/Config.h" #include "starfield/data/InputVertex.h" @@ -38,5 +38,4 @@ namespace starfield { } // anonymous namespace -#endif - +#endif // hifi_VertexOrder_h diff --git a/interface/src/ui/BandwidthDialog.h b/interface/src/ui/BandwidthDialog.h index 51ed3453cd..c1e9c5b82e 100644 --- a/interface/src/ui/BandwidthDialog.h +++ b/interface/src/ui/BandwidthDialog.h @@ -9,8 +9,8 @@ // See the accompanying file LICENSE or http://www.apache.org/licenses/LICENSE-2.0.html // -#ifndef __hifi__BandwidthDialog__ -#define __hifi__BandwidthDialog__ +#ifndef hifi_BandwidthDialog_h +#define hifi_BandwidthDialog_h #include #include @@ -46,5 +46,4 @@ private: QLabel* _labels[BandwidthMeter::N_STREAMS]; }; -#endif /* defined(__interface__BandwidthDialog__) */ - +#endif // hifi_BandwidthDialog_h diff --git a/interface/src/ui/BandwidthMeter.h b/interface/src/ui/BandwidthMeter.h index 830bc6502d..45226c8e82 100644 --- a/interface/src/ui/BandwidthMeter.h +++ b/interface/src/ui/BandwidthMeter.h @@ -9,8 +9,8 @@ // See the accompanying file LICENSE or http://www.apache.org/licenses/LICENSE-2.0.html // -#ifndef __interface__BandwidthMeter__ -#define __interface__BandwidthMeter__ +#ifndef hifi_BandwidthMeter_h +#define hifi_BandwidthMeter_h #ifdef _WIN32 #define WANT_TIMEVAL @@ -87,5 +87,4 @@ private: int _scaleMaxIndex; }; -#endif /* defined(__interface__BandwidthMeter__) */ - +#endif // hifi_BandwidthMeter_h diff --git a/interface/src/ui/ChatWindow.h b/interface/src/ui/ChatWindow.h index 9ab17c067b..cb9619cc42 100644 --- a/interface/src/ui/ChatWindow.h +++ b/interface/src/ui/ChatWindow.h @@ -9,8 +9,8 @@ // See the accompanying file LICENSE or http://www.apache.org/licenses/LICENSE-2.0.html // -#ifndef __interface__ChatWindow__ -#define __interface__ChatWindow__ +#ifndef hifi_ChatWindow_h +#define hifi_ChatWindow_h #include #include @@ -63,4 +63,4 @@ private slots: #endif }; -#endif /* defined(__interface__ChatWindow__) */ +#endif // hifi_ChatWindow_h diff --git a/interface/src/ui/ImportDialog.h b/interface/src/ui/ImportDialog.h index dc707395de..88cfda7a7c 100644 --- a/interface/src/ui/ImportDialog.h +++ b/interface/src/ui/ImportDialog.h @@ -9,8 +9,8 @@ // See the accompanying file LICENSE or http://www.apache.org/licenses/LICENSE-2.0.html // -#ifndef __hifi__ImportDialog__ -#define __hifi__ImportDialog__ +#ifndef hifi_ImportDialog_h +#define hifi_ImportDialog_h #include "InterfaceConfig.h" @@ -70,4 +70,4 @@ private: void setImportTypes(); }; -#endif /* defined(__hifi__ImportDialog__) */ +#endif // hifi_ImportDialog_h diff --git a/interface/src/ui/InfoView.h b/interface/src/ui/InfoView.h index a400e8dacf..94d18ff6a1 100644 --- a/interface/src/ui/InfoView.h +++ b/interface/src/ui/InfoView.h @@ -9,8 +9,8 @@ // See the accompanying file LICENSE or http://www.apache.org/licenses/LICENSE-2.0.html // -#ifndef __hifi__InfoView__ -#define __hifi__InfoView__ +#ifndef hifi_InfoView_h +#define hifi_InfoView_h #include @@ -29,4 +29,4 @@ private slots: void loaded(bool ok); }; -#endif /* defined(__hifi__InfoView__) */ +#endif // hifi_InfoView_h diff --git a/interface/src/ui/LodToolsDialog.h b/interface/src/ui/LodToolsDialog.h index 200fb44ca1..a3223806aa 100644 --- a/interface/src/ui/LodToolsDialog.h +++ b/interface/src/ui/LodToolsDialog.h @@ -9,8 +9,8 @@ // See the accompanying file LICENSE or http://www.apache.org/licenses/LICENSE-2.0.html // -#ifndef __hifi__LodToolsDialog__ -#define __hifi__LodToolsDialog__ +#ifndef hifi_LodToolsDialog_h +#define hifi_LodToolsDialog_h #include #include @@ -44,5 +44,4 @@ private: QLabel* _feedback; }; -#endif /* defined(__interface__LodToolsDialog__) */ - +#endif // hifi_LodToolsDialog_h diff --git a/interface/src/ui/LogDialog.h b/interface/src/ui/LogDialog.h index c4d4676189..914e1b4949 100644 --- a/interface/src/ui/LogDialog.h +++ b/interface/src/ui/LogDialog.h @@ -9,8 +9,8 @@ // See the accompanying file LICENSE or http://www.apache.org/licenses/LICENSE-2.0.html // -#ifndef __interface__LogDialog__ -#define __interface__LogDialog__ +#ifndef hifi_LogDialog_h +#define hifi_LogDialog_h #include "InterfaceConfig.h" @@ -74,5 +74,4 @@ private: void showLogData(); }; -#endif - +#endif // hifi_LogDialog_h diff --git a/interface/src/ui/MetavoxelEditor.h b/interface/src/ui/MetavoxelEditor.h index f0e8dff7ec..79ffd1e64c 100644 --- a/interface/src/ui/MetavoxelEditor.h +++ b/interface/src/ui/MetavoxelEditor.h @@ -9,8 +9,8 @@ // See the accompanying file LICENSE or http://www.apache.org/licenses/LICENSE-2.0.html // -#ifndef __interface__MetavoxelEditor__ -#define __interface__MetavoxelEditor__ +#ifndef hifi_MetavoxelEditor_h +#define hifi_MetavoxelEditor_h #include #include @@ -223,4 +223,4 @@ protected: virtual void applyEdit(const AttributePointer& attribute, const SharedObjectPointer& spanner); }; -#endif /* defined(__interface__MetavoxelEditor__) */ +#endif // hifi_MetavoxelEditor_h diff --git a/interface/src/ui/ModelsBrowser.h b/interface/src/ui/ModelsBrowser.h index 01b3e2e405..81f64c6730 100644 --- a/interface/src/ui/ModelsBrowser.h +++ b/interface/src/ui/ModelsBrowser.h @@ -9,8 +9,8 @@ // See the accompanying file LICENSE or http://www.apache.org/licenses/LICENSE-2.0.html // -#ifndef __hifi__ModelsBrowser__ -#define __hifi__ModelsBrowser__ +#ifndef hifi_ModelsBrowser_h +#define hifi_ModelsBrowser_h #include #include @@ -78,4 +78,4 @@ private: QTreeView _view; }; -#endif /* defined(__hifi__ModelBrowser__) */ +#endif // hifi_ModelsBrowser_h diff --git a/interface/src/ui/OctreeStatsDialog.h b/interface/src/ui/OctreeStatsDialog.h index 0a0d7af5fd..2488667a09 100644 --- a/interface/src/ui/OctreeStatsDialog.h +++ b/interface/src/ui/OctreeStatsDialog.h @@ -9,8 +9,8 @@ // See the accompanying file LICENSE or http://www.apache.org/licenses/LICENSE-2.0.html // -#ifndef __hifi__OctreeStatsDialog__ -#define __hifi__OctreeStatsDialog__ +#ifndef hifi_OctreeStatsDialog_h +#define hifi_OctreeStatsDialog_h #include #include @@ -69,5 +69,4 @@ private: details _extraServerDetails[MAX_VOXEL_SERVERS]; }; -#endif /* defined(__interface__OctreeStatsDialog__) */ - +#endif // hifi_OctreeStatsDialog_h diff --git a/interface/src/ui/Oscilloscope.h b/interface/src/ui/Oscilloscope.h index d51a1d8242..6eff547530 100644 --- a/interface/src/ui/Oscilloscope.h +++ b/interface/src/ui/Oscilloscope.h @@ -9,8 +9,8 @@ // See the accompanying file LICENSE or http://www.apache.org/licenses/LICENSE-2.0.html // -#ifndef __interface__Oscilloscope__ -#define __interface__Oscilloscope__ +#ifndef hifi_Oscilloscope_h +#define hifi_Oscilloscope_h #include @@ -81,4 +81,4 @@ private: unsigned _colors[MAX_CHANNELS]; }; -#endif /* defined(__interface__oscilloscope__) */ +#endif // hifi_Oscilloscope_h diff --git a/interface/src/ui/RearMirrorTools.h b/interface/src/ui/RearMirrorTools.h index a25aeec1bd..a595572e7a 100644 --- a/interface/src/ui/RearMirrorTools.h +++ b/interface/src/ui/RearMirrorTools.h @@ -9,8 +9,8 @@ // See the accompanying file LICENSE or http://www.apache.org/licenses/LICENSE-2.0.html // -#ifndef __hifi__RearMirrorTools__ -#define __hifi__RearMirrorTools__ +#ifndef hifi_RearMirrorTools_h +#define hifi_RearMirrorTools_h #include "InterfaceConfig.h" @@ -58,4 +58,4 @@ private: void displayIcon(QRect bounds, QRect iconBounds, GLuint textureId, bool selected = false); }; -#endif /* defined(__hifi__RearMirrorTools__) */ +#endif // hifi_RearMirrorTools_h diff --git a/interface/src/ui/RunningScriptsWidget.h b/interface/src/ui/RunningScriptsWidget.h index 718c417ba8..c4e1316e15 100644 --- a/interface/src/ui/RunningScriptsWidget.h +++ b/interface/src/ui/RunningScriptsWidget.h @@ -9,8 +9,8 @@ // See the accompanying file LICENSE or http://www.apache.org/licenses/LICENSE-2.0.html // -#ifndef __hifi__RunningScriptsWidget__ -#define __hifi__RunningScriptsWidget__ +#ifndef hifi_RunningScriptsWidget_h +#define hifi_RunningScriptsWidget_h // Qt #include @@ -47,4 +47,4 @@ private: void createRecentlyLoadedScriptsTable(); }; -#endif /* defined(__hifi__RunningScriptsWidget__) */ +#endif // hifi_RunningScriptsWidget_h diff --git a/interface/src/ui/Snapshot.h b/interface/src/ui/Snapshot.h index ec5e9d5f13..0fa9017b0a 100644 --- a/interface/src/ui/Snapshot.h +++ b/interface/src/ui/Snapshot.h @@ -9,8 +9,8 @@ // See the accompanying file LICENSE or http://www.apache.org/licenses/LICENSE-2.0.html // -#ifndef __hifi__Snapshot__ -#define __hifi__Snapshot__ +#ifndef hifi_Snapshot_h +#define hifi_Snapshot_h #include "InterfaceConfig.h" @@ -45,4 +45,4 @@ public: static SnapshotMetaData* parseSnapshotData(QString snapshotPath); }; -#endif /* defined(__hifi__Snapshot__) */ +#endif // hifi_Snapshot_h diff --git a/interface/src/ui/Stats.h b/interface/src/ui/Stats.h index 3d3e930b85..1ce0807ee8 100644 --- a/interface/src/ui/Stats.h +++ b/interface/src/ui/Stats.h @@ -9,8 +9,8 @@ // See the accompanying file LICENSE or http://www.apache.org/licenses/LICENSE-2.0.html // -#ifndef _hifi_Stats_h -#define _hifi_Stats_h +#ifndef hifi_Stats_h +#define hifi_Stats_h #include @@ -46,4 +46,4 @@ private: int _lastHorizontalOffset; }; -#endif +#endif // hifi_Stats_h diff --git a/interface/src/ui/TextRenderer.h b/interface/src/ui/TextRenderer.h index a24612ab93..813f15a5ac 100644 --- a/interface/src/ui/TextRenderer.h +++ b/interface/src/ui/TextRenderer.h @@ -9,8 +9,8 @@ // See the accompanying file LICENSE or http://www.apache.org/licenses/LICENSE-2.0.html // -#ifndef __interface__TextRenderer__ -#define __interface__TextRenderer__ +#ifndef hifi_TextRenderer_h +#define hifi_TextRenderer_h #include #include @@ -114,4 +114,4 @@ private: int _width; }; -#endif /* defined(__interface__TextRenderer__) */ +#endif // hifi_TextRenderer_h diff --git a/interface/src/ui/UpdateDialog.h b/interface/src/ui/UpdateDialog.h index e346330f71..15a97bf024 100644 --- a/interface/src/ui/UpdateDialog.h +++ b/interface/src/ui/UpdateDialog.h @@ -8,8 +8,8 @@ // See the accompanying file LICENSE or http://www.apache.org/licenses/LICENSE-2.0.html // -#ifndef __hifi__UpdateDialog__ -#define __hifi__UpdateDialog__ +#ifndef hifi_UpdateDialog_h +#define hifi_UpdateDialog_h #include @@ -28,4 +28,4 @@ private slots: void handleSkip(); }; -#endif /* defined(__hifi__UpdateDialog__) */ +#endif // hifi_UpdateDialog_h diff --git a/interface/src/ui/overlays/Base3DOverlay.h b/interface/src/ui/overlays/Base3DOverlay.h index c464bfc2a7..e2dcb82454 100644 --- a/interface/src/ui/overlays/Base3DOverlay.h +++ b/interface/src/ui/overlays/Base3DOverlay.h @@ -8,8 +8,8 @@ // See the accompanying file LICENSE or http://www.apache.org/licenses/LICENSE-2.0.html // -#ifndef __interface__Base3DOverlay__ -#define __interface__Base3DOverlay__ +#ifndef hifi_Base3DOverlay_h +#define hifi_Base3DOverlay_h #include "Overlay.h" @@ -36,4 +36,4 @@ protected: }; -#endif /* defined(__interface__Base3DOverlay__) */ +#endif // hifi_Base3DOverlay_h diff --git a/interface/src/ui/overlays/Cube3DOverlay.h b/interface/src/ui/overlays/Cube3DOverlay.h index 0bdebea5b2..828048e697 100644 --- a/interface/src/ui/overlays/Cube3DOverlay.h +++ b/interface/src/ui/overlays/Cube3DOverlay.h @@ -8,8 +8,8 @@ // See the accompanying file LICENSE or http://www.apache.org/licenses/LICENSE-2.0.html // -#ifndef __interface__Cube3DOverlay__ -#define __interface__Cube3DOverlay__ +#ifndef hifi_Cube3DOverlay_h +#define hifi_Cube3DOverlay_h #include "Volume3DOverlay.h" @@ -23,4 +23,4 @@ public: }; -#endif /* defined(__interface__Cube3DOverlay__) */ +#endif // hifi_Cube3DOverlay_h diff --git a/interface/src/ui/overlays/ImageOverlay.h b/interface/src/ui/overlays/ImageOverlay.h index 9d3f21fdae..613cd95989 100644 --- a/interface/src/ui/overlays/ImageOverlay.h +++ b/interface/src/ui/overlays/ImageOverlay.h @@ -8,8 +8,8 @@ // See the accompanying file LICENSE or http://www.apache.org/licenses/LICENSE-2.0.html // -#ifndef __interface__ImageOverlay__ -#define __interface__ImageOverlay__ +#ifndef hifi_ImageOverlay_h +#define hifi_ImageOverlay_h // include this before QGLWidget, which includes an earlier version of OpenGL #include "InterfaceConfig.h" @@ -62,4 +62,4 @@ private: }; -#endif /* defined(__interface__ImageOverlay__) */ +#endif // hifi_ImageOverlay_h diff --git a/interface/src/ui/overlays/Line3DOverlay.h b/interface/src/ui/overlays/Line3DOverlay.h index 250be03cd4..5b802f49c8 100644 --- a/interface/src/ui/overlays/Line3DOverlay.h +++ b/interface/src/ui/overlays/Line3DOverlay.h @@ -8,8 +8,8 @@ // See the accompanying file LICENSE or http://www.apache.org/licenses/LICENSE-2.0.html // -#ifndef __interface__Line3DOverlay__ -#define __interface__Line3DOverlay__ +#ifndef hifi_Line3DOverlay_h +#define hifi_Line3DOverlay_h #include "Base3DOverlay.h" @@ -34,4 +34,4 @@ protected: }; -#endif /* defined(__interface__Line3DOverlay__) */ +#endif // hifi_Line3DOverlay_h diff --git a/interface/src/ui/overlays/LocalVoxelsOverlay.h b/interface/src/ui/overlays/LocalVoxelsOverlay.h index bdc4273693..cc23b05ff6 100644 --- a/interface/src/ui/overlays/LocalVoxelsOverlay.h +++ b/interface/src/ui/overlays/LocalVoxelsOverlay.h @@ -9,8 +9,8 @@ // See the accompanying file LICENSE or http://www.apache.org/licenses/LICENSE-2.0.html // -#ifndef __hifi__LocalVoxelsOverlay__ -#define __hifi__LocalVoxelsOverlay__ +#ifndef hifi_LocalVoxelsOverlay_h +#define hifi_LocalVoxelsOverlay_h // include this before QGLWidget, which includes an earlier version of OpenGL #include "InterfaceConfig.h" @@ -48,4 +48,4 @@ private: StrongVoxelSystemPointer _voxelSystem; }; -#endif /* defined(__hifi__LocalVoxelsOverlay__) */ +#endif // hifi_LocalVoxelsOverlay_h diff --git a/interface/src/ui/overlays/Overlay.h b/interface/src/ui/overlays/Overlay.h index a80d6a403f..6feb159e05 100644 --- a/interface/src/ui/overlays/Overlay.h +++ b/interface/src/ui/overlays/Overlay.h @@ -8,8 +8,8 @@ // See the accompanying file LICENSE or http://www.apache.org/licenses/LICENSE-2.0.html // -#ifndef __interface__Overlay__ -#define __interface__Overlay__ +#ifndef hifi_Overlay_h +#define hifi_Overlay_h // include this before QGLWidget, which includes an earlier version of OpenGL #include "InterfaceConfig.h" @@ -54,4 +54,4 @@ protected: }; -#endif /* defined(__interface__Overlay__) */ +#endif // hifi_Overlay_h diff --git a/interface/src/ui/overlays/Overlay2D.h b/interface/src/ui/overlays/Overlay2D.h index cb9c588603..34028de89a 100644 --- a/interface/src/ui/overlays/Overlay2D.h +++ b/interface/src/ui/overlays/Overlay2D.h @@ -8,8 +8,8 @@ // See the accompanying file LICENSE or http://www.apache.org/licenses/LICENSE-2.0.html // -#ifndef __interface__Overlay2D__ -#define __interface__Overlay2D__ +#ifndef hifi_Overlay2D_h +#define hifi_Overlay2D_h // include this before QGLWidget, which includes an earlier version of OpenGL #include "InterfaceConfig.h" @@ -51,4 +51,4 @@ protected: }; -#endif /* defined(__interface__Overlay2D__) */ +#endif // hifi_Overlay2D_h diff --git a/interface/src/ui/overlays/Overlays.h b/interface/src/ui/overlays/Overlays.h index f6cbabe1f9..b3477be0c2 100644 --- a/interface/src/ui/overlays/Overlays.h +++ b/interface/src/ui/overlays/Overlays.h @@ -8,8 +8,8 @@ // See the accompanying file LICENSE or http://www.apache.org/licenses/LICENSE-2.0.html // -#ifndef __interface__Overlays__ -#define __interface__Overlays__ +#ifndef hifi_Overlays_h +#define hifi_Overlays_h #include @@ -48,4 +48,4 @@ private: }; -#endif /* defined(__interface__Overlays__) */ +#endif // hifi_Overlays_h diff --git a/interface/src/ui/overlays/Sphere3DOverlay.h b/interface/src/ui/overlays/Sphere3DOverlay.h index 0fbfc5e3de..9a2816611b 100644 --- a/interface/src/ui/overlays/Sphere3DOverlay.h +++ b/interface/src/ui/overlays/Sphere3DOverlay.h @@ -8,8 +8,8 @@ // See the accompanying file LICENSE or http://www.apache.org/licenses/LICENSE-2.0.html // -#ifndef __interface__Sphere3DOverlay__ -#define __interface__Sphere3DOverlay__ +#ifndef hifi_Sphere3DOverlay_h +#define hifi_Sphere3DOverlay_h #include "Volume3DOverlay.h" @@ -23,4 +23,4 @@ public: }; -#endif /* defined(__interface__Sphere3DOverlay__) */ +#endif // hifi_Sphere3DOverlay_h diff --git a/interface/src/ui/overlays/TextOverlay.h b/interface/src/ui/overlays/TextOverlay.h index 9ea7a724b8..fc04966d07 100644 --- a/interface/src/ui/overlays/TextOverlay.h +++ b/interface/src/ui/overlays/TextOverlay.h @@ -8,8 +8,8 @@ // See the accompanying file LICENSE or http://www.apache.org/licenses/LICENSE-2.0.html // -#ifndef __interface__TextOverlay__ -#define __interface__TextOverlay__ +#ifndef hifi_TextOverlay_h +#define hifi_TextOverlay_h // include this before QGLWidget, which includes an earlier version of OpenGL #include "InterfaceConfig.h" @@ -59,4 +59,4 @@ private: }; -#endif /* defined(__interface__TextOverlay__) */ +#endif // hifi_TextOverlay_h diff --git a/interface/src/ui/overlays/Volume3DOverlay.h b/interface/src/ui/overlays/Volume3DOverlay.h index a90074822b..b06aea27fd 100644 --- a/interface/src/ui/overlays/Volume3DOverlay.h +++ b/interface/src/ui/overlays/Volume3DOverlay.h @@ -8,8 +8,8 @@ // See the accompanying file LICENSE or http://www.apache.org/licenses/LICENSE-2.0.html // -#ifndef __interface__Volume3DOverlay__ -#define __interface__Volume3DOverlay__ +#ifndef hifi_Volume3DOverlay_h +#define hifi_Volume3DOverlay_h // include this before QGLWidget, which includes an earlier version of OpenGL #include "InterfaceConfig.h" @@ -42,4 +42,4 @@ protected: }; -#endif /* defined(__interface__Volume3DOverlay__) */ +#endif // hifi_Volume3DOverlay_h diff --git a/interface/src/voxels/PrimitiveRenderer.h b/interface/src/voxels/PrimitiveRenderer.h index 268b4f3175..8626e2e2a4 100644 --- a/interface/src/voxels/PrimitiveRenderer.h +++ b/interface/src/voxels/PrimitiveRenderer.h @@ -9,8 +9,8 @@ // See the accompanying file LICENSE or http://www.apache.org/licenses/LICENSE-2.0.html // -#ifndef __interface__PrimitiveRenderer__ -#define __interface__PrimitiveRenderer__ +#ifndef hifi_PrimitiveRenderer_h +#define hifi_PrimitiveRenderer_h #include #include @@ -488,4 +488,4 @@ private: }; -#endif +#endif // hifi_PrimitiveRenderer_h diff --git a/interface/src/voxels/VoxelFade.h b/interface/src/voxels/VoxelFade.h index 2bfe65f03b..1843fa2d67 100644 --- a/interface/src/voxels/VoxelFade.h +++ b/interface/src/voxels/VoxelFade.h @@ -9,8 +9,8 @@ // See the accompanying file LICENSE or http://www.apache.org/licenses/LICENSE-2.0.html // -#ifndef __interface__VoxelFade__ -#define __interface__VoxelFade__ +#ifndef hifi_VoxelFade_h +#define hifi_VoxelFade_h #include // for VoxelPositionSize @@ -43,4 +43,4 @@ public: bool isDone() const; }; -#endif // __interface__VoxelFade__ +#endif // hifi_VoxelFade_h diff --git a/interface/src/voxels/VoxelHideShowThread.h b/interface/src/voxels/VoxelHideShowThread.h index b12befc9de..6aa3c108ba 100644 --- a/interface/src/voxels/VoxelHideShowThread.h +++ b/interface/src/voxels/VoxelHideShowThread.h @@ -11,8 +11,8 @@ // See the accompanying file LICENSE or http://www.apache.org/licenses/LICENSE-2.0.html // -#ifndef __interface__VoxelHideShowThread__ -#define __interface__VoxelHideShowThread__ +#ifndef hifi_VoxelHideShowThread_h +#define hifi_VoxelHideShowThread_h #include #include "VoxelSystem.h" @@ -32,4 +32,4 @@ private: VoxelSystem* _theSystem; }; -#endif // __interface__VoxelHideShowThread__ +#endif // hifi_VoxelHideShowThread_h diff --git a/interface/src/voxels/VoxelImporter.h b/interface/src/voxels/VoxelImporter.h index fb9fe7b589..7da89c5a11 100644 --- a/interface/src/voxels/VoxelImporter.h +++ b/interface/src/voxels/VoxelImporter.h @@ -9,8 +9,8 @@ // See the accompanying file LICENSE or http://www.apache.org/licenses/LICENSE-2.0.html // -#ifndef __hifi__VoxelImporter__ -#define __hifi__VoxelImporter__ +#ifndef hifi_VoxelImporter_h +#define hifi_VoxelImporter_h #include #include @@ -47,4 +47,4 @@ private: void cleanupTask(); }; -#endif /* defined(__hifi__VoxelImporter__) */ +#endif // hifi_VoxelImporter_h diff --git a/interface/src/voxels/VoxelPacketProcessor.h b/interface/src/voxels/VoxelPacketProcessor.h index c71bc07c31..36456c5cc2 100644 --- a/interface/src/voxels/VoxelPacketProcessor.h +++ b/interface/src/voxels/VoxelPacketProcessor.h @@ -9,8 +9,8 @@ // See the accompanying file LICENSE or http://www.apache.org/licenses/LICENSE-2.0.html // -#ifndef __shared__VoxelPacketProcessor__ -#define __shared__VoxelPacketProcessor__ +#ifndef hifi_VoxelPacketProcessor_h +#define hifi_VoxelPacketProcessor_h #include @@ -21,4 +21,4 @@ class VoxelPacketProcessor : public ReceivedPacketProcessor { protected: virtual void processPacket(const SharedNodePointer& sendingNode, const QByteArray& packet); }; -#endif // __shared__VoxelPacketProcessor__ +#endif // hifi_VoxelPacketProcessor_h diff --git a/interface/src/voxels/VoxelSystem.h b/interface/src/voxels/VoxelSystem.h index eae7e21246..b134fe1539 100644 --- a/interface/src/voxels/VoxelSystem.h +++ b/interface/src/voxels/VoxelSystem.h @@ -9,8 +9,8 @@ // See the accompanying file LICENSE or http://www.apache.org/licenses/LICENSE-2.0.html // -#ifndef __interface__VoxelSystem__ -#define __interface__VoxelSystem__ +#ifndef hifi_VoxelSystem_h +#define hifi_VoxelSystem_h #include "InterfaceConfig.h" #include @@ -274,4 +274,4 @@ private: }; -#endif +#endif // hifi_VoxelSystem_h diff --git a/interface/src/windowshacks.h b/interface/src/windowshacks.h index 3563c2a765..fcd2f5a7f2 100644 --- a/interface/src/windowshacks.h +++ b/interface/src/windowshacks.h @@ -11,8 +11,8 @@ // See the accompanying file LICENSE or http://www.apache.org/licenses/LICENSE-2.0.html // -#ifndef __hifi__windowshacks__ -#define __hifi__windowshacks__ +#ifndef hifi_windowshacks_h +#define hifi_windowshacks_h #ifdef WIN32 #undef NOMINMAX @@ -57,4 +57,4 @@ inline int c99_snprintf(char* str, size_t size, const char* format, ...) { #endif // WIN32 -#endif // __hifi__windowshacks__ +#endif // hifi_windowshacks_h diff --git a/interface/src/world.h b/interface/src/world.h index 95767e7b15..8e680f3d95 100644 --- a/interface/src/world.h +++ b/interface/src/world.h @@ -9,10 +9,10 @@ // See the accompanying file LICENSE or http://www.apache.org/licenses/LICENSE-2.0.html // -#ifndef __interface__world__ -#define __interface__world__ +#ifndef hifi_world_h +#define hifi_world_h const float GRAVITY_EARTH = 9.80665f; const float EDGE_SIZE_GROUND_PLANE = 20.f; -#endif +#endif // hifi_world_h diff --git a/libraries/audio/src/AbstractAudioInterface.h b/libraries/audio/src/AbstractAudioInterface.h index 28cb0653f8..f950eefcbd 100644 --- a/libraries/audio/src/AbstractAudioInterface.h +++ b/libraries/audio/src/AbstractAudioInterface.h @@ -9,8 +9,8 @@ // See the accompanying file LICENSE or http://www.apache.org/licenses/LICENSE-2.0.html // -#ifndef __hifi__AbstractAudioInterface__ -#define __hifi__AbstractAudioInterface__ +#ifndef hifi_AbstractAudioInterface_h +#define hifi_AbstractAudioInterface_h #include @@ -27,4 +27,4 @@ public slots: Q_DECLARE_METATYPE(AbstractAudioInterface*) -#endif /* defined(__hifi__AbstractAudioInterface__) */ +#endif // hifi_AbstractAudioInterface_h diff --git a/libraries/audio/src/AudioInjector.h b/libraries/audio/src/AudioInjector.h index 988ea46444..abaa804fb0 100644 --- a/libraries/audio/src/AudioInjector.h +++ b/libraries/audio/src/AudioInjector.h @@ -9,8 +9,8 @@ // See the accompanying file LICENSE or http://www.apache.org/licenses/LICENSE-2.0.html // -#ifndef __hifi__AudioInjector__ -#define __hifi__AudioInjector__ +#ifndef hifi_AudioInjector_h +#define hifi_AudioInjector_h #include #include @@ -34,4 +34,4 @@ signals: void finished(); }; -#endif /* defined(__hifi__AudioInjector__) */ +#endif // hifi_AudioInjector_h diff --git a/libraries/audio/src/AudioInjectorOptions.h b/libraries/audio/src/AudioInjectorOptions.h index 866f95bde4..bbe3d57b08 100644 --- a/libraries/audio/src/AudioInjectorOptions.h +++ b/libraries/audio/src/AudioInjectorOptions.h @@ -9,8 +9,8 @@ // See the accompanying file LICENSE or http://www.apache.org/licenses/LICENSE-2.0.html // -#ifndef __hifi__AudioInjectorOptions__ -#define __hifi__AudioInjectorOptions__ +#ifndef hifi_AudioInjectorOptions_h +#define hifi_AudioInjectorOptions_h #include @@ -49,4 +49,4 @@ private: AbstractAudioInterface* _loopbackAudioInterface; }; -#endif /* defined(__hifi__AudioInjectorOptions__) */ +#endif // hifi_AudioInjectorOptions_h diff --git a/libraries/audio/src/AudioRingBuffer.h b/libraries/audio/src/AudioRingBuffer.h index 7a1a75e43b..ef4427d633 100644 --- a/libraries/audio/src/AudioRingBuffer.h +++ b/libraries/audio/src/AudioRingBuffer.h @@ -9,8 +9,8 @@ // See the accompanying file LICENSE or http://www.apache.org/licenses/LICENSE-2.0.html // -#ifndef __interface__AudioRingBuffer__ -#define __interface__AudioRingBuffer__ +#ifndef hifi_AudioRingBuffer_h +#define hifi_AudioRingBuffer_h #include #include @@ -89,4 +89,4 @@ protected: bool _hasStarted; }; -#endif /* defined(__interface__AudioRingBuffer__) */ +#endif // hifi_AudioRingBuffer_h diff --git a/libraries/audio/src/AudioScriptingInterface.h b/libraries/audio/src/AudioScriptingInterface.h index 9371597075..f2e9b02e9a 100644 --- a/libraries/audio/src/AudioScriptingInterface.h +++ b/libraries/audio/src/AudioScriptingInterface.h @@ -9,8 +9,8 @@ // See the accompanying file LICENSE or http://www.apache.org/licenses/LICENSE-2.0.html // -#ifndef __hifi__AudioScriptingInterface__ -#define __hifi__AudioScriptingInterface__ +#ifndef hifi_AudioScriptingInterface_h +#define hifi_AudioScriptingInterface_h #include "AudioInjector.h" #include "Sound.h" @@ -25,4 +25,4 @@ public slots: const AudioInjectorOptions* injectorOptions = NULL); }; -#endif /* defined(__hifi__AudioScriptingInterface__) */ +#endif // hifi_AudioScriptingInterface_h diff --git a/libraries/audio/src/InjectedAudioRingBuffer.h b/libraries/audio/src/InjectedAudioRingBuffer.h index 8a1a430c78..fd766e2848 100644 --- a/libraries/audio/src/InjectedAudioRingBuffer.h +++ b/libraries/audio/src/InjectedAudioRingBuffer.h @@ -9,8 +9,8 @@ // See the accompanying file LICENSE or http://www.apache.org/licenses/LICENSE-2.0.html // -#ifndef __hifi__InjectedAudioRingBuffer__ -#define __hifi__InjectedAudioRingBuffer__ +#ifndef hifi_InjectedAudioRingBuffer_h +#define hifi_InjectedAudioRingBuffer_h #include @@ -35,4 +35,4 @@ private: float _attenuationRatio; }; -#endif /* defined(__hifi__InjectedAudioRingBuffer__) */ +#endif // hifi_InjectedAudioRingBuffer_h diff --git a/libraries/audio/src/MixedAudioRingBuffer.h b/libraries/audio/src/MixedAudioRingBuffer.h index 2d672f6ada..25574a3ea6 100644 --- a/libraries/audio/src/MixedAudioRingBuffer.h +++ b/libraries/audio/src/MixedAudioRingBuffer.h @@ -9,8 +9,8 @@ // See the accompanying file LICENSE or http://www.apache.org/licenses/LICENSE-2.0.html // -#ifndef __hifi__MixedAudioRingBuffer__ -#define __hifi__MixedAudioRingBuffer__ +#ifndef hifi_MixedAudioRingBuffer_h +#define hifi_MixedAudioRingBuffer_h #include "AudioRingBuffer.h" @@ -26,4 +26,4 @@ private: float _lastReadFrameAverageLoudness; }; -#endif /* defined(__hifi__MixedAudioRingBuffer__) */ +#endif // hifi_MixedAudioRingBuffer_h diff --git a/libraries/audio/src/PositionalAudioRingBuffer.h b/libraries/audio/src/PositionalAudioRingBuffer.h index c34e6f8bc7..b130a9b216 100644 --- a/libraries/audio/src/PositionalAudioRingBuffer.h +++ b/libraries/audio/src/PositionalAudioRingBuffer.h @@ -9,8 +9,8 @@ // See the accompanying file LICENSE or http://www.apache.org/licenses/LICENSE-2.0.html // -#ifndef __hifi__PositionalAudioRingBuffer__ -#define __hifi__PositionalAudioRingBuffer__ +#ifndef hifi_PositionalAudioRingBuffer_h +#define hifi_PositionalAudioRingBuffer_h #include #include @@ -60,4 +60,4 @@ protected: float _nextOutputTrailingLoudness; }; -#endif /* defined(__hifi__PositionalAudioRingBuffer__) */ +#endif // hifi_PositionalAudioRingBuffer_h diff --git a/libraries/audio/src/Sound.h b/libraries/audio/src/Sound.h index 27e46bec57..e1613fec51 100644 --- a/libraries/audio/src/Sound.h +++ b/libraries/audio/src/Sound.h @@ -9,8 +9,8 @@ // See the accompanying file LICENSE or http://www.apache.org/licenses/LICENSE-2.0.html // -#ifndef __hifi__Sound__ -#define __hifi__Sound__ +#ifndef hifi_Sound_h +#define hifi_Sound_h #include @@ -34,4 +34,4 @@ private slots: void replyFinished(QNetworkReply* reply); }; -#endif /* defined(__hifi__Sound__) */ +#endif // hifi_Sound_h diff --git a/libraries/avatars/src/AvatarData.h b/libraries/avatars/src/AvatarData.h index 79c2075323..24910034b3 100755 --- a/libraries/avatars/src/AvatarData.h +++ b/libraries/avatars/src/AvatarData.h @@ -9,8 +9,8 @@ // See the accompanying file LICENSE or http://www.apache.org/licenses/LICENSE-2.0.html // -#ifndef __hifi__AvatarData__ -#define __hifi__AvatarData__ +#ifndef hifi_AvatarData_h +#define hifi_AvatarData_h #include /* VS2010 defines stdint.h, but not inttypes.h */ @@ -285,4 +285,4 @@ public: glm::quat rotation; }; -#endif /* defined(__hifi__AvatarData__) */ +#endif // hifi_AvatarData_h diff --git a/libraries/avatars/src/AvatarHashMap.h b/libraries/avatars/src/AvatarHashMap.h index fcfd735073..aee9cd09f1 100644 --- a/libraries/avatars/src/AvatarHashMap.h +++ b/libraries/avatars/src/AvatarHashMap.h @@ -9,8 +9,8 @@ // See the accompanying file LICENSE or http://www.apache.org/licenses/LICENSE-2.0.html // -#ifndef __hifi__AvatarHashMap__ -#define __hifi__AvatarHashMap__ +#ifndef hifi_AvatarHashMap_h +#define hifi_AvatarHashMap_h #include #include @@ -36,4 +36,4 @@ protected: AvatarHash _avatarHash; }; -#endif /* defined(__hifi__AvatarHashMap__) */ +#endif // hifi_AvatarHashMap_h diff --git a/libraries/avatars/src/HandData.h b/libraries/avatars/src/HandData.h index 662ad493b1..a37e3a5814 100755 --- a/libraries/avatars/src/HandData.h +++ b/libraries/avatars/src/HandData.h @@ -9,8 +9,8 @@ // See the accompanying file LICENSE or http://www.apache.org/licenses/LICENSE-2.0.html // -#ifndef __hifi__HandData__ -#define __hifi__HandData__ +#ifndef hifi_HandData_h +#define hifi_HandData_h #include #include @@ -226,4 +226,4 @@ private: quint64 _collisionlessPaddleExpiry; /// Timestamp after which paddle starts colliding }; -#endif /* defined(__hifi__HandData__) */ +#endif // hifi_HandData_h diff --git a/libraries/avatars/src/HeadData.h b/libraries/avatars/src/HeadData.h index 044966da04..b76bd189bf 100644 --- a/libraries/avatars/src/HeadData.h +++ b/libraries/avatars/src/HeadData.h @@ -9,8 +9,8 @@ // See the accompanying file LICENSE or http://www.apache.org/licenses/LICENSE-2.0.html // -#ifndef __hifi__HeadData__ -#define __hifi__HeadData__ +#ifndef hifi_HeadData_h +#define hifi_HeadData_h #include @@ -95,4 +95,4 @@ private: HeadData& operator= (const HeadData&); }; -#endif /* defined(__hifi__HeadData__) */ +#endif // hifi_HeadData_h diff --git a/libraries/embedded-webserver/src/HTTPConnection.h b/libraries/embedded-webserver/src/HTTPConnection.h index 7eb0c6108d..a131a22a9e 100644 --- a/libraries/embedded-webserver/src/HTTPConnection.h +++ b/libraries/embedded-webserver/src/HTTPConnection.h @@ -13,8 +13,8 @@ // See the accompanying file LICENSE or http://www.apache.org/licenses/LICENSE-2.0.html // -#ifndef __hifi__HTTPConnection__ -#define __hifi__HTTPConnection__ +#ifndef hifi_HTTPConnection_h +#define hifi_HTTPConnection_h #include #include @@ -121,4 +121,4 @@ protected: QByteArray _requestContent; }; -#endif /* defined(__hifi__HTTPConnection__) */ +#endif // hifi_HTTPConnection_h diff --git a/libraries/embedded-webserver/src/HTTPManager.h b/libraries/embedded-webserver/src/HTTPManager.h index c7bb479ab2..1e3afca1b5 100755 --- a/libraries/embedded-webserver/src/HTTPManager.h +++ b/libraries/embedded-webserver/src/HTTPManager.h @@ -13,8 +13,8 @@ // See the accompanying file LICENSE or http://www.apache.org/licenses/LICENSE-2.0.html // -#ifndef __hifi__HTTPManager__ -#define __hifi__HTTPManager__ +#ifndef hifi_HTTPManager_h +#define hifi_HTTPManager_h #include @@ -43,4 +43,4 @@ protected: HTTPRequestHandler* _requestHandler; }; -#endif /* defined(__hifi__HTTPManager__) */ +#endif // hifi_HTTPManager_h diff --git a/libraries/metavoxels/src/AttributeRegistry.h b/libraries/metavoxels/src/AttributeRegistry.h index 084ef4426f..00d974b8b6 100644 --- a/libraries/metavoxels/src/AttributeRegistry.h +++ b/libraries/metavoxels/src/AttributeRegistry.h @@ -9,8 +9,8 @@ // See the accompanying file LICENSE or http://www.apache.org/licenses/LICENSE-2.0.html // -#ifndef __interface__AttributeRegistry__ -#define __interface__AttributeRegistry__ +#ifndef hifi_AttributeRegistry_h +#define hifi_AttributeRegistry_h #include #include @@ -464,4 +464,4 @@ public: virtual void writeMetavoxelSubdivision(const MetavoxelNode& root, MetavoxelStreamState& state); }; -#endif /* defined(__interface__AttributeRegistry__) */ +#endif // hifi_AttributeRegistry_h diff --git a/libraries/metavoxels/src/Bitstream.h b/libraries/metavoxels/src/Bitstream.h index 3c5f738730..34b66eb9f2 100644 --- a/libraries/metavoxels/src/Bitstream.h +++ b/libraries/metavoxels/src/Bitstream.h @@ -9,8 +9,8 @@ // See the accompanying file LICENSE or http://www.apache.org/licenses/LICENSE-2.0.html // -#ifndef __interface__Bitstream__ -#define __interface__Bitstream__ +#ifndef hifi_Bitstream_h +#define hifi_Bitstream_h #include #include @@ -953,4 +953,4 @@ template int registerStreamableMetaType() { /// Flags a field or base class as streaming. #define STREAM -#endif /* defined(__interface__Bitstream__) */ +#endif // hifi_Bitstream_h diff --git a/libraries/metavoxels/src/DatagramSequencer.h b/libraries/metavoxels/src/DatagramSequencer.h index 40a8a7e9e7..ce9f36ba33 100644 --- a/libraries/metavoxels/src/DatagramSequencer.h +++ b/libraries/metavoxels/src/DatagramSequencer.h @@ -9,8 +9,8 @@ // See the accompanying file LICENSE or http://www.apache.org/licenses/LICENSE-2.0.html // -#ifndef __interface__DatagramSequencer__ -#define __interface__DatagramSequencer__ +#ifndef hifi_DatagramSequencer_h +#define hifi_DatagramSequencer_h #include #include @@ -321,4 +321,4 @@ private: bool _messagesEnabled; }; -#endif /* defined(__interface__DatagramSequencer__) */ +#endif // hifi_DatagramSequencer_h diff --git a/libraries/metavoxels/src/MetavoxelData.h b/libraries/metavoxels/src/MetavoxelData.h index 49df417b71..2e6f6c4437 100644 --- a/libraries/metavoxels/src/MetavoxelData.h +++ b/libraries/metavoxels/src/MetavoxelData.h @@ -9,8 +9,8 @@ // See the accompanying file LICENSE or http://www.apache.org/licenses/LICENSE-2.0.html // -#ifndef __interface__MetavoxelData__ -#define __interface__MetavoxelData__ +#ifndef hifi_MetavoxelData_h +#define hifi_MetavoxelData_h #include #include @@ -631,4 +631,4 @@ private: QUrl _url; }; -#endif /* defined(__interface__MetavoxelData__) */ +#endif // hifi_MetavoxelData_h diff --git a/libraries/metavoxels/src/MetavoxelMessages.h b/libraries/metavoxels/src/MetavoxelMessages.h index d4d2183091..8f819fe3d8 100644 --- a/libraries/metavoxels/src/MetavoxelMessages.h +++ b/libraries/metavoxels/src/MetavoxelMessages.h @@ -9,8 +9,8 @@ // See the accompanying file LICENSE or http://www.apache.org/licenses/LICENSE-2.0.html // -#ifndef __interface__MetavoxelMessages__ -#define __interface__MetavoxelMessages__ +#ifndef hifi_MetavoxelMessages_h +#define hifi_MetavoxelMessages_h #include "MetavoxelData.h" @@ -196,4 +196,4 @@ public: DECLARE_STREAMABLE_METATYPE(SetDataEdit) -#endif /* defined(__interface__MetavoxelMessages__) */ +#endif // hifi_MetavoxelMessages_h diff --git a/libraries/metavoxels/src/MetavoxelUtil.h b/libraries/metavoxels/src/MetavoxelUtil.h index e72408b9ed..34c2bac6be 100644 --- a/libraries/metavoxels/src/MetavoxelUtil.h +++ b/libraries/metavoxels/src/MetavoxelUtil.h @@ -9,8 +9,8 @@ // See the accompanying file LICENSE or http://www.apache.org/licenses/LICENSE-2.0.html // -#ifndef __interface__MetavoxelUtil__ -#define __interface__MetavoxelUtil__ +#ifndef hifi_MetavoxelUtil_h +#define hifi_MetavoxelUtil_h #include #include @@ -283,4 +283,4 @@ private: QUrlEditor _urlEditor; }; -#endif /* defined(__interface__MetavoxelUtil__) */ +#endif // hifi_MetavoxelUtil_h diff --git a/libraries/metavoxels/src/ScriptCache.h b/libraries/metavoxels/src/ScriptCache.h index 810da46eb2..f393d0e0a8 100644 --- a/libraries/metavoxels/src/ScriptCache.h +++ b/libraries/metavoxels/src/ScriptCache.h @@ -9,8 +9,8 @@ // See the accompanying file LICENSE or http://www.apache.org/licenses/LICENSE-2.0.html // -#ifndef __interface__ScriptCache__ -#define __interface__ScriptCache__ +#ifndef hifi_ScriptCache_h +#define hifi_ScriptCache_h #include #include @@ -145,4 +145,4 @@ private: ScriptHash _parameters; }; -#endif /* defined(__interface__ScriptCache__) */ +#endif // hifi_ScriptCache_h diff --git a/libraries/metavoxels/src/SharedObject.h b/libraries/metavoxels/src/SharedObject.h index 736984fa41..aba6b86bea 100644 --- a/libraries/metavoxels/src/SharedObject.h +++ b/libraries/metavoxels/src/SharedObject.h @@ -9,8 +9,8 @@ // See the accompanying file LICENSE or http://www.apache.org/licenses/LICENSE-2.0.html // -#ifndef __interface__SharedObject__ -#define __interface__SharedObject__ +#ifndef hifi_SharedObject_h +#define hifi_SharedObject_h #include #include @@ -218,4 +218,4 @@ private: SharedObjectPointer _object; }; -#endif /* defined(__interface__SharedObject__) */ +#endif // hifi_SharedObject_h diff --git a/libraries/octree/src/AABox.h b/libraries/octree/src/AABox.h index 1d5fad696c..093a111a69 100644 --- a/libraries/octree/src/AABox.h +++ b/libraries/octree/src/AABox.h @@ -12,8 +12,8 @@ // See the accompanying file LICENSE or http://www.apache.org/licenses/LICENSE-2.0.html // -#ifndef _AABOX_ -#define _AABOX_ +#ifndef hifi_AABox_h +#define hifi_AABox_h #include @@ -82,4 +82,4 @@ private: float _scale; }; -#endif +#endif // hifi_AABox_h diff --git a/libraries/octree/src/CoverageMap.h b/libraries/octree/src/CoverageMap.h index e06696ff66..bff6bb1078 100644 --- a/libraries/octree/src/CoverageMap.h +++ b/libraries/octree/src/CoverageMap.h @@ -11,8 +11,8 @@ // See the accompanying file LICENSE or http://www.apache.org/licenses/LICENSE-2.0.html // -#ifndef _COVERAGE_MAP_ -#define _COVERAGE_MAP_ +#ifndef hifi_CoverageMap_h +#define hifi_CoverageMap_h #include #include "OctreeProjectedPolygon.h" @@ -117,4 +117,4 @@ private: }; -#endif // _COVERAGE_MAP_ +#endif // hifi_CoverageMap_h diff --git a/libraries/octree/src/CoverageMapV2.h b/libraries/octree/src/CoverageMapV2.h index 7221c7d5de..fc9a3ea70e 100644 --- a/libraries/octree/src/CoverageMapV2.h +++ b/libraries/octree/src/CoverageMapV2.h @@ -9,8 +9,8 @@ // See the accompanying file LICENSE or http://www.apache.org/licenses/LICENSE-2.0.html // -#ifndef _COVERAGE_MAP_V2_ -#define _COVERAGE_MAP_V2_ +#ifndef hifi_CoverageMapV2_h +#define hifi_CoverageMapV2_h #include @@ -69,4 +69,4 @@ private: }; -#endif // _COVERAGE_MAP_V2_ +#endif // hifi_CoverageMapV2_h diff --git a/libraries/octree/src/JurisdictionListener.h b/libraries/octree/src/JurisdictionListener.h index 2d5cd75560..01f0392796 100644 --- a/libraries/octree/src/JurisdictionListener.h +++ b/libraries/octree/src/JurisdictionListener.h @@ -11,8 +11,8 @@ // See the accompanying file LICENSE or http://www.apache.org/licenses/LICENSE-2.0.html // -#ifndef __shared__JurisdictionListener__ -#define __shared__JurisdictionListener__ +#ifndef hifi_JurisdictionListener_h +#define hifi_JurisdictionListener_h #include #include @@ -61,4 +61,4 @@ private: PacketSender _packetSender; }; -#endif // __shared__JurisdictionListener__ +#endif // hifi_JurisdictionListener_h diff --git a/libraries/octree/src/JurisdictionMap.h b/libraries/octree/src/JurisdictionMap.h index 4c189bfac0..b4174e6432 100644 --- a/libraries/octree/src/JurisdictionMap.h +++ b/libraries/octree/src/JurisdictionMap.h @@ -9,8 +9,8 @@ // See the accompanying file LICENSE or http://www.apache.org/licenses/LICENSE-2.0.html // -#ifndef __hifi__JurisdictionMap__ -#define __hifi__JurisdictionMap__ +#ifndef hifi_JurisdictionMap_h +#define hifi_JurisdictionMap_h #include #include @@ -86,6 +86,4 @@ typedef QMap NodeToJurisdictionMap; typedef QMap::iterator NodeToJurisdictionMapIterator; -#endif /* defined(__hifi__JurisdictionMap__) */ - - +#endif // hifi_JurisdictionMap_h diff --git a/libraries/octree/src/JurisdictionSender.h b/libraries/octree/src/JurisdictionSender.h index 20c54824e7..bfa370c6ca 100644 --- a/libraries/octree/src/JurisdictionSender.h +++ b/libraries/octree/src/JurisdictionSender.h @@ -9,8 +9,8 @@ // See the accompanying file LICENSE or http://www.apache.org/licenses/LICENSE-2.0.html // -#ifndef __shared__JurisdictionSender__ -#define __shared__JurisdictionSender__ +#ifndef hifi_JurisdictionSender_h +#define hifi_JurisdictionSender_h #include #include @@ -55,4 +55,4 @@ private: PacketSender _packetSender; }; -#endif // __shared__JurisdictionSender__ +#endif // hifi_JurisdictionSender_h diff --git a/libraries/octree/src/Octree.h b/libraries/octree/src/Octree.h index 6451b91a26..839e61d1c2 100644 --- a/libraries/octree/src/Octree.h +++ b/libraries/octree/src/Octree.h @@ -9,8 +9,8 @@ // See the accompanying file LICENSE or http://www.apache.org/licenses/LICENSE-2.0.html // -#ifndef __hifi__Octree__ -#define __hifi__Octree__ +#ifndef hifi_Octree_h +#define hifi_Octree_h #include #include @@ -314,4 +314,4 @@ protected: float boundaryDistanceForRenderLevel(unsigned int renderLevel, float voxelSizeScale); -#endif /* defined(__hifi__Octree__) */ +#endif // hifi_Octree_h diff --git a/libraries/octree/src/OctreeConstants.h b/libraries/octree/src/OctreeConstants.h index ceb3a4de20..18c5eb0108 100644 --- a/libraries/octree/src/OctreeConstants.h +++ b/libraries/octree/src/OctreeConstants.h @@ -9,8 +9,8 @@ // See the accompanying file LICENSE or http://www.apache.org/licenses/LICENSE-2.0.html // -#ifndef __hifi_OctreeConstants_h__ -#define __hifi_OctreeConstants_h__ +#ifndef hifi_OctreeConstants_h +#define hifi_OctreeConstants_h #include #include @@ -44,4 +44,4 @@ const int DANGEROUSLY_DEEP_RECURSION = 200; // use this for something that needs const int DEFAULT_MAX_OCTREE_PPS = 600; // the default maximum PPS we think any octree based server should send to a client -#endif +#endif // hifi_OctreeConstants_h diff --git a/libraries/octree/src/OctreeEditPacketSender.h b/libraries/octree/src/OctreeEditPacketSender.h index 36d2f837cf..f9326b6ed3 100644 --- a/libraries/octree/src/OctreeEditPacketSender.h +++ b/libraries/octree/src/OctreeEditPacketSender.h @@ -9,8 +9,8 @@ // See the accompanying file LICENSE or http://www.apache.org/licenses/LICENSE-2.0.html // -#ifndef __shared__OctreeEditPacketSender__ -#define __shared__OctreeEditPacketSender__ +#ifndef hifi_OctreeEditPacketSender_h +#define hifi_OctreeEditPacketSender_h #include #include @@ -115,4 +115,4 @@ protected: unsigned short int _sequenceNumber; int _maxPacketSize; }; -#endif // __shared__OctreeEditPacketSender__ +#endif // hifi_OctreeEditPacketSender_h diff --git a/libraries/octree/src/OctreeElement.h b/libraries/octree/src/OctreeElement.h index b634acdf2a..682516cf0a 100644 --- a/libraries/octree/src/OctreeElement.h +++ b/libraries/octree/src/OctreeElement.h @@ -9,8 +9,8 @@ // See the accompanying file LICENSE or http://www.apache.org/licenses/LICENSE-2.0.html // -#ifndef __hifi__OctreeElement__ -#define __hifi__OctreeElement__ +#ifndef hifi_OctreeElement_h +#define hifi_OctreeElement_h //#define HAS_AUDIT_CHILDREN //#define SIMPLE_CHILD_ARRAY @@ -319,4 +319,4 @@ protected: static quint64 _childrenCount[NUMBER_OF_CHILDREN + 1]; }; -#endif /* defined(__hifi__OctreeElement__) */ +#endif // hifi_OctreeElement_h diff --git a/libraries/octree/src/OctreeElementBag.h b/libraries/octree/src/OctreeElementBag.h index 0c17d9f1fa..afc34bf1a6 100644 --- a/libraries/octree/src/OctreeElementBag.h +++ b/libraries/octree/src/OctreeElementBag.h @@ -14,8 +14,8 @@ // See the accompanying file LICENSE or http://www.apache.org/licenses/LICENSE-2.0.html // -#ifndef __hifi__OctreeElementBag__ -#define __hifi__OctreeElementBag__ +#ifndef hifi_OctreeElementBag_h +#define hifi_OctreeElementBag_h #include "OctreeElement.h" @@ -40,4 +40,4 @@ private: QSet _bagElements; }; -#endif /* defined(__hifi__OctreeElementBag__) */ +#endif // hifi_OctreeElementBag_h diff --git a/libraries/octree/src/OctreeHeadlessViewer.h b/libraries/octree/src/OctreeHeadlessViewer.h index 5d98d0291f..ebabf1dbad 100644 --- a/libraries/octree/src/OctreeHeadlessViewer.h +++ b/libraries/octree/src/OctreeHeadlessViewer.h @@ -9,8 +9,8 @@ // See the accompanying file LICENSE or http://www.apache.org/licenses/LICENSE-2.0.html // -#ifndef __hifi__OctreeHeadlessViewer__ -#define __hifi__OctreeHeadlessViewer__ +#ifndef hifi_OctreeHeadlessViewer_h +#define hifi_OctreeHeadlessViewer_h #include #include @@ -72,4 +72,4 @@ private: int _maxPacketsPerSecond; }; -#endif /* defined(__hifi__OctreeHeadlessViewer__) */ +#endif // hifi_OctreeHeadlessViewer_h diff --git a/libraries/octree/src/OctreePacketData.h b/libraries/octree/src/OctreePacketData.h index 64e7c07161..d802f8e808 100644 --- a/libraries/octree/src/OctreePacketData.h +++ b/libraries/octree/src/OctreePacketData.h @@ -19,8 +19,8 @@ // See the accompanying file LICENSE or http://www.apache.org/licenses/LICENSE-2.0.html // -#ifndef __hifi__OctreePacketData__ -#define __hifi__OctreePacketData__ +#ifndef hifi_OctreePacketData_h +#define hifi_OctreePacketData_h #include #include "OctreeConstants.h" @@ -227,4 +227,4 @@ private: static quint64 _totalBytesOfRawData; }; -#endif /* defined(__hifi__OctreePacketData__) */ +#endif // hifi_OctreePacketData_h diff --git a/libraries/octree/src/OctreePersistThread.h b/libraries/octree/src/OctreePersistThread.h index 90b83b4c86..2f86320b2e 100644 --- a/libraries/octree/src/OctreePersistThread.h +++ b/libraries/octree/src/OctreePersistThread.h @@ -11,8 +11,8 @@ // See the accompanying file LICENSE or http://www.apache.org/licenses/LICENSE-2.0.html // -#ifndef __Octree_server__OctreePersistThread__ -#define __Octree_server__OctreePersistThread__ +#ifndef hifi_OctreePersistThread_h +#define hifi_OctreePersistThread_h #include #include @@ -45,4 +45,4 @@ private: quint64 _lastCheck; }; -#endif // __Octree_server__OctreePersistThread__ +#endif // hifi_OctreePersistThread_h diff --git a/libraries/octree/src/OctreeProjectedPolygon.h b/libraries/octree/src/OctreeProjectedPolygon.h index ff3a28649e..5a2a36f280 100644 --- a/libraries/octree/src/OctreeProjectedPolygon.h +++ b/libraries/octree/src/OctreeProjectedPolygon.h @@ -11,8 +11,8 @@ // See the accompanying file LICENSE or http://www.apache.org/licenses/LICENSE-2.0.html // -#ifndef _VOXEL_PROJECTED_SHADOW_ -#define _VOXEL_PROJECTED_SHADOW_ +#ifndef hifi_OctreeProjectedPolygon_h +#define hifi_OctreeProjectedPolygon_h #include @@ -132,4 +132,4 @@ private: }; -#endif // _VOXEL_PROJECTED_SHADOW_ +#endif // hifi_OctreeProjectedPolygon_h diff --git a/libraries/octree/src/OctreeQuery.h b/libraries/octree/src/OctreeQuery.h index 6e2b651a5b..8c4460bc73 100644 --- a/libraries/octree/src/OctreeQuery.h +++ b/libraries/octree/src/OctreeQuery.h @@ -9,8 +9,8 @@ // See the accompanying file LICENSE or http://www.apache.org/licenses/LICENSE-2.0.html // -#ifndef __hifi__OctreeQuery__ -#define __hifi__OctreeQuery__ +#ifndef hifi_OctreeQuery_h +#define hifi_OctreeQuery_h /* VS2010 defines stdint.h, but not inttypes.h */ #if defined(_MSC_VER) @@ -116,4 +116,4 @@ private: OctreeQuery& operator= (const OctreeQuery&); }; -#endif /* defined(__hifi__OctreeQuery__) */ +#endif // hifi_OctreeQuery_h diff --git a/libraries/octree/src/OctreeRenderer.h b/libraries/octree/src/OctreeRenderer.h index e61ac145b8..fbd82fad8f 100644 --- a/libraries/octree/src/OctreeRenderer.h +++ b/libraries/octree/src/OctreeRenderer.h @@ -9,8 +9,8 @@ // See the accompanying file LICENSE or http://www.apache.org/licenses/LICENSE-2.0.html // -#ifndef __hifi__OctreeRenderer__ -#define __hifi__OctreeRenderer__ +#ifndef hifi_OctreeRenderer_h +#define hifi_OctreeRenderer_h #include #include @@ -71,4 +71,4 @@ protected: ViewFrustum* _viewFrustum; }; -#endif /* defined(__hifi__OctreeRenderer__) */ +#endif // hifi_OctreeRenderer_h diff --git a/libraries/octree/src/OctreeSceneStats.h b/libraries/octree/src/OctreeSceneStats.h index b74fbbc8d1..140e33aedf 100644 --- a/libraries/octree/src/OctreeSceneStats.h +++ b/libraries/octree/src/OctreeSceneStats.h @@ -9,8 +9,8 @@ // See the accompanying file LICENSE or http://www.apache.org/licenses/LICENSE-2.0.html // -#ifndef __hifi__OctreeSceneStats__ -#define __hifi__OctreeSceneStats__ +#ifndef hifi_OctreeSceneStats_h +#define hifi_OctreeSceneStats_h #include #include @@ -292,4 +292,4 @@ private: typedef std::map NodeToOctreeSceneStats; typedef std::map::iterator NodeToOctreeSceneStatsIterator; -#endif /* defined(__hifi__OctreeSceneStats__) */ +#endif // hifi_OctreeSceneStats_h diff --git a/libraries/octree/src/OctreeScriptingInterface.h b/libraries/octree/src/OctreeScriptingInterface.h index 4c6c6aa54f..52d7c8be34 100644 --- a/libraries/octree/src/OctreeScriptingInterface.h +++ b/libraries/octree/src/OctreeScriptingInterface.h @@ -9,8 +9,8 @@ // See the accompanying file LICENSE or http://www.apache.org/licenses/LICENSE-2.0.html // -#ifndef __hifi__OctreeScriptingInterface__ -#define __hifi__OctreeScriptingInterface__ +#ifndef hifi_OctreeScriptingInterface_h +#define hifi_OctreeScriptingInterface_h #include @@ -99,4 +99,4 @@ protected: bool _initialized; }; -#endif /* defined(__hifi__OctreeScriptingInterface__) */ +#endif // hifi_OctreeScriptingInterface_h diff --git a/libraries/octree/src/ViewFrustum.h b/libraries/octree/src/ViewFrustum.h index 65ff992ee4..5c9d7f06c2 100644 --- a/libraries/octree/src/ViewFrustum.h +++ b/libraries/octree/src/ViewFrustum.h @@ -11,8 +11,8 @@ // See the accompanying file LICENSE or http://www.apache.org/licenses/LICENSE-2.0.html // -#ifndef __hifi__ViewFrustum__ -#define __hifi__ViewFrustum__ +#ifndef hifi_ViewFrustum_h +#define hifi_ViewFrustum_h #include #include @@ -175,4 +175,4 @@ private: }; -#endif /* defined(__hifi__ViewFrustum__) */ +#endif // hifi_ViewFrustum_h diff --git a/libraries/particles/src/Particle.h b/libraries/particles/src/Particle.h index 8a49dd273a..c243363241 100644 --- a/libraries/particles/src/Particle.h +++ b/libraries/particles/src/Particle.h @@ -9,8 +9,8 @@ // See the accompanying file LICENSE or http://www.apache.org/licenses/LICENSE-2.0.html // -#ifndef __hifi__Particle__ -#define __hifi__Particle__ +#ifndef hifi_Particle_h +#define hifi_Particle_h #include #include @@ -430,4 +430,4 @@ private: -#endif /* defined(__hifi__Particle__) */ +#endif // hifi_Particle_h diff --git a/libraries/particles/src/ParticleCollisionSystem.h b/libraries/particles/src/ParticleCollisionSystem.h index 50e262a736..cf9c4b938c 100644 --- a/libraries/particles/src/ParticleCollisionSystem.h +++ b/libraries/particles/src/ParticleCollisionSystem.h @@ -9,8 +9,8 @@ // See the accompanying file LICENSE or http://www.apache.org/licenses/LICENSE-2.0.html // -#ifndef __hifi__ParticleCollisionSystem__ -#define __hifi__ParticleCollisionSystem__ +#ifndef hifi_ParticleCollisionSystem_h +#define hifi_ParticleCollisionSystem_h #include #include @@ -71,4 +71,4 @@ private: CollisionList _collisions; }; -#endif /* defined(__hifi__ParticleCollisionSystem__) */ +#endif // hifi_ParticleCollisionSystem_h diff --git a/libraries/particles/src/ParticleEditPacketSender.h b/libraries/particles/src/ParticleEditPacketSender.h index 3a22b311a5..15e3196785 100644 --- a/libraries/particles/src/ParticleEditPacketSender.h +++ b/libraries/particles/src/ParticleEditPacketSender.h @@ -9,8 +9,8 @@ // See the accompanying file LICENSE or http://www.apache.org/licenses/LICENSE-2.0.html // -#ifndef __shared__ParticleEditPacketSender__ -#define __shared__ParticleEditPacketSender__ +#ifndef hifi_ParticleEditPacketSender_h +#define hifi_ParticleEditPacketSender_h #include #include "Particle.h" @@ -33,4 +33,4 @@ public: virtual unsigned char getMyNodeType() const { return NodeType::ParticleServer; } virtual void adjustEditPacketForClockSkew(unsigned char* codeColorBuffer, ssize_t length, int clockSkew); }; -#endif // __shared__ParticleEditPacketSender__ +#endif // hifi_ParticleEditPacketSender_h diff --git a/libraries/particles/src/ParticleTree.h b/libraries/particles/src/ParticleTree.h index 20503085a2..a31c2d38aa 100644 --- a/libraries/particles/src/ParticleTree.h +++ b/libraries/particles/src/ParticleTree.h @@ -9,8 +9,8 @@ // See the accompanying file LICENSE or http://www.apache.org/licenses/LICENSE-2.0.html // -#ifndef __hifi__ParticleTree__ -#define __hifi__ParticleTree__ +#ifndef hifi_ParticleTree_h +#define hifi_ParticleTree_h #include #include "ParticleTreeElement.h" @@ -95,4 +95,4 @@ private: QMultiMap _recentlyDeletedParticleIDs; }; -#endif /* defined(__hifi__ParticleTree__) */ +#endif // hifi_ParticleTree_h diff --git a/libraries/particles/src/ParticleTreeElement.h b/libraries/particles/src/ParticleTreeElement.h index 95ba27b51e..59f80d588a 100644 --- a/libraries/particles/src/ParticleTreeElement.h +++ b/libraries/particles/src/ParticleTreeElement.h @@ -9,8 +9,8 @@ // See the accompanying file LICENSE or http://www.apache.org/licenses/LICENSE-2.0.html // -#ifndef __hifi__ParticleTreeElement__ -#define __hifi__ParticleTreeElement__ +#ifndef hifi_ParticleTreeElement_h +#define hifi_ParticleTreeElement_h //#include @@ -129,4 +129,4 @@ protected: QList* _particles; }; -#endif /* defined(__hifi__ParticleTreeElement__) */ +#endif // hifi_ParticleTreeElement_h diff --git a/libraries/particles/src/ParticleTreeHeadlessViewer.h b/libraries/particles/src/ParticleTreeHeadlessViewer.h index eafef3cf34..1d539bd46f 100644 --- a/libraries/particles/src/ParticleTreeHeadlessViewer.h +++ b/libraries/particles/src/ParticleTreeHeadlessViewer.h @@ -9,8 +9,8 @@ // See the accompanying file LICENSE or http://www.apache.org/licenses/LICENSE-2.0.html // -#ifndef __hifi__ParticleTreeHeadlessViewer__ -#define __hifi__ParticleTreeHeadlessViewer__ +#ifndef hifi_ParticleTreeHeadlessViewer_h +#define hifi_ParticleTreeHeadlessViewer_h #include #include @@ -41,4 +41,4 @@ public: virtual void init(); }; -#endif /* defined(__hifi__ParticleTreeHeadlessViewer__) */ +#endif // hifi_ParticleTreeHeadlessViewer_h diff --git a/libraries/particles/src/ParticlesScriptingInterface.h b/libraries/particles/src/ParticlesScriptingInterface.h index dbf80efa61..e1d628f45a 100644 --- a/libraries/particles/src/ParticlesScriptingInterface.h +++ b/libraries/particles/src/ParticlesScriptingInterface.h @@ -9,8 +9,8 @@ // See the accompanying file LICENSE or http://www.apache.org/licenses/LICENSE-2.0.html // -#ifndef __hifi__ParticlesScriptingInterface__ -#define __hifi__ParticlesScriptingInterface__ +#ifndef hifi_ParticlesScriptingInterface_h +#define hifi_ParticlesScriptingInterface_h #include @@ -70,4 +70,4 @@ private: ParticleTree* _particleTree; }; -#endif /* defined(__hifi__ParticlesScriptingInterface__) */ +#endif // hifi_ParticlesScriptingInterface_h diff --git a/libraries/script-engine/src/AbstractControllerScriptingInterface.h b/libraries/script-engine/src/AbstractControllerScriptingInterface.h index 23f1cc8477..677ca27e04 100644 --- a/libraries/script-engine/src/AbstractControllerScriptingInterface.h +++ b/libraries/script-engine/src/AbstractControllerScriptingInterface.h @@ -9,8 +9,8 @@ // See the accompanying file LICENSE or http://www.apache.org/licenses/LICENSE-2.0.html // -#ifndef __hifi__AbstractControllerScriptingInterface__ -#define __hifi__AbstractControllerScriptingInterface__ +#ifndef hifi_AbstractControllerScriptingInterface_h +#define hifi_AbstractControllerScriptingInterface_h #include @@ -76,4 +76,4 @@ signals: }; -#endif /* defined(__hifi__AbstractControllerScriptingInterface__) */ +#endif // hifi_AbstractControllerScriptingInterface_h diff --git a/libraries/script-engine/src/EventTypes.h b/libraries/script-engine/src/EventTypes.h index 66f7523162..6994225fd7 100644 --- a/libraries/script-engine/src/EventTypes.h +++ b/libraries/script-engine/src/EventTypes.h @@ -9,8 +9,8 @@ // See the accompanying file LICENSE or http://www.apache.org/licenses/LICENSE-2.0.html // -#ifndef __hifi_EventTypes_h__ -#define __hifi_EventTypes_h__ +#ifndef hifi_EventTypes_h +#define hifi_EventTypes_h #include @@ -126,4 +126,4 @@ void touchEventFromScriptValue(const QScriptValue& object, TouchEvent& event); QScriptValue wheelEventToScriptValue(QScriptEngine* engine, const WheelEvent& event); void wheelEventFromScriptValue(const QScriptValue& object, WheelEvent& event); -#endif // __hifi_EventTypes_h__ +#endif // hifi_EventTypes_h diff --git a/libraries/script-engine/src/LocalVoxels.h b/libraries/script-engine/src/LocalVoxels.h index 82ed95fa66..c382d35c09 100644 --- a/libraries/script-engine/src/LocalVoxels.h +++ b/libraries/script-engine/src/LocalVoxels.h @@ -9,8 +9,8 @@ // See the accompanying file LICENSE or http://www.apache.org/licenses/LICENSE-2.0.html // -#ifndef __hifi__LocalVoxels__ -#define __hifi__LocalVoxels__ +#ifndef hifi_LocalVoxels_h +#define hifi_LocalVoxels_h #include @@ -90,4 +90,4 @@ private: -#endif /* defined(__hifi__LocalVoxels__) */ +#endif // hifi_LocalVoxels_h diff --git a/libraries/script-engine/src/MenuItemProperties.h b/libraries/script-engine/src/MenuItemProperties.h index 22853d7fca..9dd3c6107c 100644 --- a/libraries/script-engine/src/MenuItemProperties.h +++ b/libraries/script-engine/src/MenuItemProperties.h @@ -9,8 +9,8 @@ // See the accompanying file LICENSE or http://www.apache.org/licenses/LICENSE-2.0.html // -#ifndef __hifi_MenuItemProperties_h__ -#define __hifi_MenuItemProperties_h__ +#ifndef hifi_MenuItemProperties_h +#define hifi_MenuItemProperties_h #include @@ -51,4 +51,4 @@ void registerMenuItemProperties(QScriptEngine* engine); -#endif // __hifi_MenuItemProperties_h__ +#endif // hifi_MenuItemProperties_h diff --git a/libraries/script-engine/src/Quat.h b/libraries/script-engine/src/Quat.h index 418488fe2e..c97ccf9a1e 100644 --- a/libraries/script-engine/src/Quat.h +++ b/libraries/script-engine/src/Quat.h @@ -11,8 +11,8 @@ // See the accompanying file LICENSE or http://www.apache.org/licenses/LICENSE-2.0.html // -#ifndef __hifi__Quat__ -#define __hifi__Quat__ +#ifndef hifi_Quat_h +#define hifi_Quat_h #include @@ -39,4 +39,4 @@ public slots: void print(const QString& lable, const glm::quat& q); }; -#endif /* defined(__hifi__Quat__) */ +#endif // hifi_Quat_h diff --git a/libraries/script-engine/src/ScriptEngine.h b/libraries/script-engine/src/ScriptEngine.h index 7fe4f23b53..0796aa4f50 100644 --- a/libraries/script-engine/src/ScriptEngine.h +++ b/libraries/script-engine/src/ScriptEngine.h @@ -9,8 +9,8 @@ // See the accompanying file LICENSE or http://www.apache.org/licenses/LICENSE-2.0.html // -#ifndef __hifi__ScriptEngine__ -#define __hifi__ScriptEngine__ +#ifndef hifi_ScriptEngine_h +#define hifi_ScriptEngine_h #include @@ -126,4 +126,4 @@ private: Vec3 _vec3Library; }; -#endif /* defined(__hifi__ScriptEngine__) */ +#endif // hifi_ScriptEngine_h diff --git a/libraries/script-engine/src/Vec3.h b/libraries/script-engine/src/Vec3.h index 7d420adca3..b30e274d89 100644 --- a/libraries/script-engine/src/Vec3.h +++ b/libraries/script-engine/src/Vec3.h @@ -11,8 +11,8 @@ // See the accompanying file LICENSE or http://www.apache.org/licenses/LICENSE-2.0.html // -#ifndef __hifi__Vec3__ -#define __hifi__Vec3__ +#ifndef hifi_Vec3_h +#define hifi_Vec3_h #include #include @@ -37,4 +37,4 @@ public slots: -#endif /* defined(__hifi__Vec3__) */ +#endif // hifi_Vec3_h diff --git a/libraries/shared/src/AccountManager.h b/libraries/shared/src/AccountManager.h index 992223f9ce..fed6a61772 100644 --- a/libraries/shared/src/AccountManager.h +++ b/libraries/shared/src/AccountManager.h @@ -9,8 +9,8 @@ // See the accompanying file LICENSE or http://www.apache.org/licenses/LICENSE-2.0.html // -#ifndef __hifi__AccountManager__ -#define __hifi__AccountManager__ +#ifndef hifi_AccountManager_h +#define hifi_AccountManager_h #include #include @@ -94,4 +94,4 @@ private: DataServerAccountInfo _accountInfo; }; -#endif /* defined(__hifi__AccountManager__) */ +#endif // hifi_AccountManager_h diff --git a/libraries/shared/src/AngleUtil.h b/libraries/shared/src/AngleUtil.h index e4d8abc28f..d700e41f3d 100644 --- a/libraries/shared/src/AngleUtil.h +++ b/libraries/shared/src/AngleUtil.h @@ -9,8 +9,8 @@ // See the accompanying file LICENSE or http://www.apache.org/licenses/LICENSE-2.0.html // -#ifndef __hifi__AngleUtils__ -#define __hifi__AngleUtils__ +#ifndef hifi_AngleUtil_h +#define hifi_AngleUtil_h #include @@ -98,5 +98,4 @@ void angleHorizontalPolar(float& azimuth, float& altitude) { azimuth = angleUnsignedNormal(azimuth); } -#endif - +#endif // hifi_AngleUtil_h diff --git a/libraries/shared/src/Assignment.h b/libraries/shared/src/Assignment.h index 437112a64f..c5a83cf417 100644 --- a/libraries/shared/src/Assignment.h +++ b/libraries/shared/src/Assignment.h @@ -9,8 +9,8 @@ // See the accompanying file LICENSE or http://www.apache.org/licenses/LICENSE-2.0.html // -#ifndef __hifi__Assignment__ -#define __hifi__Assignment__ +#ifndef hifi_Assignment_h +#define hifi_Assignment_h #ifdef _WIN32 #include "Systime.h" @@ -101,4 +101,4 @@ protected: QByteArray _payload; /// an optional payload attached to this assignment, a maximum for 1024 bytes will be packed }; -#endif /* defined(__hifi__Assignment__) */ +#endif // hifi_Assignment_h diff --git a/libraries/shared/src/CapsuleShape.h b/libraries/shared/src/CapsuleShape.h index 062c3aff6f..9421bf1789 100644 --- a/libraries/shared/src/CapsuleShape.h +++ b/libraries/shared/src/CapsuleShape.h @@ -9,8 +9,8 @@ // See the accompanying file LICENSE or http://www.apache.org/licenses/LICENSE-2.0.html // -#ifndef __hifi__CapsuleShape__ -#define __hifi__CapsuleShape__ +#ifndef hifi_CapsuleShape_h +#define hifi_CapsuleShape_h #include "Shape.h" @@ -46,4 +46,4 @@ protected: float _halfHeight; }; -#endif /* defined(__hifi__CapsuleShape__) */ +#endif // hifi_CapsuleShape_h diff --git a/libraries/shared/src/CollisionInfo.h b/libraries/shared/src/CollisionInfo.h index b8c4aa6523..f575dd8595 100644 --- a/libraries/shared/src/CollisionInfo.h +++ b/libraries/shared/src/CollisionInfo.h @@ -9,8 +9,8 @@ // See the accompanying file LICENSE or http://www.apache.org/licenses/LICENSE-2.0.html // -#ifndef __hifi__CollisionInfo__ -#define __hifi__CollisionInfo__ +#ifndef hifi_CollisionInfo_h +#define hifi_CollisionInfo_h #include #include @@ -101,4 +101,4 @@ private: QVector _collisions; }; -#endif /* defined(__hifi__CollisionInfo__) */ +#endif // hifi_CollisionInfo_h diff --git a/libraries/shared/src/DataServerAccountInfo.h b/libraries/shared/src/DataServerAccountInfo.h index 04d2e7fabd..ae5de6de64 100644 --- a/libraries/shared/src/DataServerAccountInfo.h +++ b/libraries/shared/src/DataServerAccountInfo.h @@ -9,8 +9,8 @@ // See the accompanying file LICENSE or http://www.apache.org/licenses/LICENSE-2.0.html // -#ifndef __hifi__DataServerAccountInfo__ -#define __hifi__DataServerAccountInfo__ +#ifndef hifi_DataServerAccountInfo_h +#define hifi_DataServerAccountInfo_h #include @@ -42,4 +42,4 @@ private: QString _xmppPassword; }; -#endif /* defined(__hifi__DataServerAccountInfo__) */ +#endif // hifi_DataServerAccountInfo_h diff --git a/libraries/shared/src/DomainInfo.h b/libraries/shared/src/DomainInfo.h index 563e2f8db0..b52b2f71c3 100644 --- a/libraries/shared/src/DomainInfo.h +++ b/libraries/shared/src/DomainInfo.h @@ -9,8 +9,8 @@ // See the accompanying file LICENSE or http://www.apache.org/licenses/LICENSE-2.0.html // -#ifndef __hifi__DomainInfo__ -#define __hifi__DomainInfo__ +#ifndef hifi_DomainInfo_h +#define hifi_DomainInfo_h #include #include @@ -80,4 +80,4 @@ private: bool _isConnected; }; -#endif /* defined(__hifi__DomainInfo__) */ +#endif // hifi_DomainInfo_h diff --git a/libraries/shared/src/FileUtils.h b/libraries/shared/src/FileUtils.h index 6953676b83..8b31d1473b 100644 --- a/libraries/shared/src/FileUtils.h +++ b/libraries/shared/src/FileUtils.h @@ -22,4 +22,4 @@ public: }; -#endif +#endif // hifi_FileUtils_h diff --git a/libraries/shared/src/FloodFill.h b/libraries/shared/src/FloodFill.h index 5aeede2450..cd77534697 100644 --- a/libraries/shared/src/FloodFill.h +++ b/libraries/shared/src/FloodFill.h @@ -8,8 +8,8 @@ // See the accompanying file LICENSE or http://www.apache.org/licenses/LICENSE-2.0.html // -#ifndef __hifi__FloodFill__ -#define __hifi__FloodFill__ +#ifndef hifi_FloodFill_h +#define hifi_FloodFill_h // // Line scanning, iterative flood fill algorithm. @@ -106,5 +106,4 @@ void floodFill(Cursor const& p, Strategy const& s) { } -#endif /* defined(__hifi__FloodFill__) */ - +#endif // hifi_FloodFill_h diff --git a/libraries/shared/src/GenericThread.h b/libraries/shared/src/GenericThread.h index 2aaa081aa8..bbb01894ed 100644 --- a/libraries/shared/src/GenericThread.h +++ b/libraries/shared/src/GenericThread.h @@ -11,8 +11,8 @@ // See the accompanying file LICENSE or http://www.apache.org/licenses/LICENSE-2.0.html // -#ifndef __shared__GenericThread__ -#define __shared__GenericThread__ +#ifndef hifi_GenericThread_h +#define hifi_GenericThread_h #include #include @@ -65,4 +65,4 @@ private: QThread* _thread; }; -#endif // __shared__GenericThread__ +#endif // hifi_GenericThread_h diff --git a/libraries/shared/src/GeometryUtil.h b/libraries/shared/src/GeometryUtil.h index 3446956ffd..b521a79771 100644 --- a/libraries/shared/src/GeometryUtil.h +++ b/libraries/shared/src/GeometryUtil.h @@ -9,8 +9,8 @@ // See the accompanying file LICENSE or http://www.apache.org/licenses/LICENSE-2.0.html // -#ifndef __interface__GeometryUtil__ -#define __interface__GeometryUtil__ +#ifndef hifi_GeometryUtil_h +#define hifi_GeometryUtil_h #include @@ -115,4 +115,4 @@ private: }; -#endif /* defined(__interface__GeometryUtil__) */ +#endif // hifi_GeometryUtil_h diff --git a/libraries/shared/src/HifiSockAddr.h b/libraries/shared/src/HifiSockAddr.h index da8c75baee..f44ebf6dbd 100644 --- a/libraries/shared/src/HifiSockAddr.h +++ b/libraries/shared/src/HifiSockAddr.h @@ -9,8 +9,8 @@ // See the accompanying file LICENSE or http://www.apache.org/licenses/LICENSE-2.0.html // -#ifndef __hifi__HifiSockAddr__ -#define __hifi__HifiSockAddr__ +#ifndef hifi_HifiSockAddr_h +#define hifi_HifiSockAddr_h #include @@ -52,4 +52,4 @@ quint32 getHostOrderLocalAddress(); Q_DECLARE_METATYPE(HifiSockAddr) -#endif /* defined(__hifi__HifiSockAddr__) */ +#endif // hifi_HifiSockAddr_h diff --git a/libraries/shared/src/ListShape.h b/libraries/shared/src/ListShape.h index b8a8fb018d..7ba2410a23 100644 --- a/libraries/shared/src/ListShape.h +++ b/libraries/shared/src/ListShape.h @@ -11,8 +11,8 @@ // See the accompanying file LICENSE or http://www.apache.org/licenses/LICENSE-2.0.html // -#ifndef __hifi__ListShape__ -#define __hifi__ListShape__ +#ifndef hifi_ListShape_h +#define hifi_ListShape_h #include @@ -66,4 +66,4 @@ private: ListShape(const ListShape& otherList); // don't implement this }; -#endif // __hifi__ListShape__ +#endif // hifi_ListShape_h diff --git a/libraries/shared/src/Logging.h b/libraries/shared/src/Logging.h index e17f3f3019..edbe8f62ee 100644 --- a/libraries/shared/src/Logging.h +++ b/libraries/shared/src/Logging.h @@ -9,8 +9,8 @@ // See the accompanying file LICENSE or http://www.apache.org/licenses/LICENSE-2.0.html // -#ifndef __hifi__Logging__ -#define __hifi__Logging__ +#ifndef hifi_Logging_h +#define hifi_Logging_h #ifdef _WIN32 #include "Syssocket.h" @@ -57,4 +57,4 @@ private: static QString _targetName; }; -#endif /* defined(__hifi__Logstash__) */ +#endif // hifi_Logging_h diff --git a/libraries/shared/src/ModelUploader.h b/libraries/shared/src/ModelUploader.h index 7500b0fbb1..26c34d4eb7 100644 --- a/libraries/shared/src/ModelUploader.h +++ b/libraries/shared/src/ModelUploader.h @@ -9,8 +9,8 @@ // See the accompanying file LICENSE or http://www.apache.org/licenses/LICENSE-2.0.html // -#ifndef __hifi__ModelUploader__ -#define __hifi__ModelUploader__ +#ifndef hifi_ModelUploader_h +#define hifi_ModelUploader_h #include @@ -61,4 +61,4 @@ private: bool addPart(const QString& path, const QString& name); }; -#endif /* defined(__hifi__ModelUploader__) */ +#endif // hifi_ModelUploader_h diff --git a/libraries/shared/src/NetworkPacket.h b/libraries/shared/src/NetworkPacket.h index bc9e3def40..6c086e2f5a 100644 --- a/libraries/shared/src/NetworkPacket.h +++ b/libraries/shared/src/NetworkPacket.h @@ -11,8 +11,8 @@ // See the accompanying file LICENSE or http://www.apache.org/licenses/LICENSE-2.0.html // -#ifndef __shared_NetworkPacket__ -#define __shared_NetworkPacket__ +#ifndef hifi_NetworkPacket_h +#define hifi_NetworkPacket_h #include @@ -46,4 +46,4 @@ private: QByteArray _byteArray; }; -#endif /* defined(__shared_NetworkPacket__) */ +#endif // hifi_NetworkPacket_h diff --git a/libraries/shared/src/Node.h b/libraries/shared/src/Node.h index fd3c123df8..e7ebbcfb13 100644 --- a/libraries/shared/src/Node.h +++ b/libraries/shared/src/Node.h @@ -9,8 +9,8 @@ // See the accompanying file LICENSE or http://www.apache.org/licenses/LICENSE-2.0.html // -#ifndef __hifi__Node__ -#define __hifi__Node__ +#ifndef hifi_Node_h +#define hifi_Node_h #include #include @@ -129,4 +129,4 @@ private: QDebug operator<<(QDebug debug, const Node &message); -#endif /* defined(__hifi__Node__) */ +#endif // hifi_Node_h diff --git a/libraries/shared/src/NodeData.h b/libraries/shared/src/NodeData.h index 6dea803b3f..3b26d5b6d5 100644 --- a/libraries/shared/src/NodeData.h +++ b/libraries/shared/src/NodeData.h @@ -30,4 +30,4 @@ private: QMutex _mutex; }; -#endif +#endif // hifi_NodeData_h diff --git a/libraries/shared/src/NodeList.h b/libraries/shared/src/NodeList.h index 4071127131..86c487e2d6 100644 --- a/libraries/shared/src/NodeList.h +++ b/libraries/shared/src/NodeList.h @@ -9,8 +9,8 @@ // See the accompanying file LICENSE or http://www.apache.org/licenses/LICENSE-2.0.html // -#ifndef __hifi__NodeList__ -#define __hifi__NodeList__ +#ifndef hifi_NodeList_h +#define hifi_NodeList_h #ifdef _WIN32 #include "Syssocket.h" @@ -183,4 +183,4 @@ private: QElapsedTimer _packetStatTimer; }; -#endif /* defined(__hifi__NodeList__) */ +#endif // hifi_NodeList_h diff --git a/libraries/shared/src/OAuthAccessToken.h b/libraries/shared/src/OAuthAccessToken.h index 2159f595f2..7f7c621231 100644 --- a/libraries/shared/src/OAuthAccessToken.h +++ b/libraries/shared/src/OAuthAccessToken.h @@ -9,8 +9,8 @@ // See the accompanying file LICENSE or http://www.apache.org/licenses/LICENSE-2.0.html // -#ifndef __hifi__OAuthAccessToken__ -#define __hifi__OAuthAccessToken__ +#ifndef hifi_OAuthAccessToken_h +#define hifi_OAuthAccessToken_h #include #include @@ -37,4 +37,4 @@ private: void swap(OAuthAccessToken& otherToken); }; -#endif /* defined(__hifi__OAuthAccessToken__) */ +#endif // hifi_OAuthAccessToken_h diff --git a/libraries/shared/src/OctalCode.h b/libraries/shared/src/OctalCode.h index 535b8a0021..07895ff67f 100644 --- a/libraries/shared/src/OctalCode.h +++ b/libraries/shared/src/OctalCode.h @@ -9,8 +9,8 @@ // See the accompanying file LICENSE or http://www.apache.org/licenses/LICENSE-2.0.html // -#ifndef __hifi__OctalCode__ -#define __hifi__OctalCode__ +#ifndef hifi_OctalCode_h +#define hifi_OctalCode_h #include #include @@ -65,4 +65,4 @@ OctalCodeComparison compareOctalCodes(const unsigned char* code1, const unsigned QString octalCodeToHexString(const unsigned char* octalCode); unsigned char* hexStringToOctalCode(const QString& input); -#endif /* defined(__hifi__OctalCode__) */ +#endif // hifi_OctalCode_h diff --git a/libraries/shared/src/PacketHeaders.h b/libraries/shared/src/PacketHeaders.h index 491bdf5ac5..3183e8f12d 100644 --- a/libraries/shared/src/PacketHeaders.h +++ b/libraries/shared/src/PacketHeaders.h @@ -92,4 +92,4 @@ PacketType packetTypeForPacket(const char* packet); int arithmeticCodingValueFromBuffer(const char* checkValue); int numBytesArithmeticCodingFromBuffer(const char* checkValue); -#endif +#endif // hifi_PacketHeaders_h diff --git a/libraries/shared/src/PacketSender.h b/libraries/shared/src/PacketSender.h index d517da6d17..cc65564461 100644 --- a/libraries/shared/src/PacketSender.h +++ b/libraries/shared/src/PacketSender.h @@ -11,8 +11,8 @@ // See the accompanying file LICENSE or http://www.apache.org/licenses/LICENSE-2.0.html // -#ifndef __shared__PacketSender__ -#define __shared__PacketSender__ +#ifndef hifi_PacketSender_h +#define hifi_PacketSender_h #include @@ -124,4 +124,4 @@ private: QMutex _waitingOnPacketsMutex; }; -#endif // __shared__PacketSender__ +#endif // hifi_PacketSender_h diff --git a/libraries/shared/src/PerfStat.h b/libraries/shared/src/PerfStat.h index c3ae12a825..478c9afead 100644 --- a/libraries/shared/src/PerfStat.h +++ b/libraries/shared/src/PerfStat.h @@ -12,8 +12,8 @@ // See the accompanying file LICENSE or http://www.apache.org/licenses/LICENSE-2.0.html // -#ifndef __hifi__PerfStat__ -#define __hifi__PerfStat__ +#ifndef hifi_PerfStat_h +#define hifi_PerfStat_h #include #include "SharedUtil.h" @@ -56,4 +56,4 @@ public: }; -#endif /* defined(__hifi__PerfStat__) */ +#endif // hifi_PerfStat_h diff --git a/libraries/shared/src/Radix2InplaceSort.h b/libraries/shared/src/Radix2InplaceSort.h index 38c7b0b73c..dfa455a32d 100644 --- a/libraries/shared/src/Radix2InplaceSort.h +++ b/libraries/shared/src/Radix2InplaceSort.h @@ -9,8 +9,8 @@ // See the accompanying file LICENSE or http://www.apache.org/licenses/LICENSE-2.0.html // -#ifndef __hifi__Radix2InplaceSort__ -#define __hifi__Radix2InplaceSort__ +#ifndef hifi_Radix2InplaceSort_h +#define hifi_Radix2InplaceSort_h #include @@ -94,4 +94,4 @@ void radix2InplaceSort( BidiIterator from, BidiIterator to, .go(from, to, scanner.initial_state()); } -#endif /* defined(__hifi__Radix2InplaceSort__) */ +#endif // hifi_Radix2InplaceSort_h diff --git a/libraries/shared/src/Radix2IntegerScanner.h b/libraries/shared/src/Radix2IntegerScanner.h index 2137db0548..16a6224778 100644 --- a/libraries/shared/src/Radix2IntegerScanner.h +++ b/libraries/shared/src/Radix2IntegerScanner.h @@ -9,8 +9,8 @@ // See the accompanying file LICENSE or http://www.apache.org/licenses/LICENSE-2.0.html // -#ifndef __hifi__Radix2IntegerScanner__ -#define __hifi__Radix2IntegerScanner__ +#ifndef hifi_Radix2IntegerScanner_h +#define hifi_Radix2IntegerScanner_h #include #include @@ -85,5 +85,4 @@ class Radix2IntegerScanner< Int, true > bool bit(Int const& v, state_type const& s) const { return !!((v-valMsb) & s); } }; -#endif /* defined(__hifi__Radix2IntegerScanner__) */ - +#endif // hifi_Radix2IntegerScanner_h diff --git a/libraries/shared/src/ReceivedPacketProcessor.h b/libraries/shared/src/ReceivedPacketProcessor.h index e4365f4e18..a34b43626c 100644 --- a/libraries/shared/src/ReceivedPacketProcessor.h +++ b/libraries/shared/src/ReceivedPacketProcessor.h @@ -9,8 +9,8 @@ // See the accompanying file LICENSE or http://www.apache.org/licenses/LICENSE-2.0.html // -#ifndef __shared__ReceivedPacketProcessor__ -#define __shared__ReceivedPacketProcessor__ +#ifndef hifi_ReceivedPacketProcessor_h +#define hifi_ReceivedPacketProcessor_h #include @@ -56,4 +56,4 @@ private: QMutex _waitingOnPacketsMutex; }; -#endif // __shared__PacketReceiver__ +#endif // hifi_ReceivedPacketProcessor_h diff --git a/libraries/shared/src/RegisteredMetaTypes.h b/libraries/shared/src/RegisteredMetaTypes.h index 93fb4e7f57..d876965723 100644 --- a/libraries/shared/src/RegisteredMetaTypes.h +++ b/libraries/shared/src/RegisteredMetaTypes.h @@ -56,4 +56,4 @@ Q_DECLARE_METATYPE(CollisionInfo) QScriptValue collisionToScriptValue(QScriptEngine* engine, const CollisionInfo& collision); void collisionFromScriptValue(const QScriptValue &object, CollisionInfo& collision); -#endif +#endif // hifi_RegisteredMetaTypes_h diff --git a/libraries/shared/src/ResourceCache.h b/libraries/shared/src/ResourceCache.h index 984ab7aaa2..da217516e1 100644 --- a/libraries/shared/src/ResourceCache.h +++ b/libraries/shared/src/ResourceCache.h @@ -9,8 +9,8 @@ // See the accompanying file LICENSE or http://www.apache.org/licenses/LICENSE-2.0.html // -#ifndef __shared__ResourceCache__ -#define __shared__ResourceCache__ +#ifndef hifi_ResourceCache_h +#define hifi_ResourceCache_h #include #include @@ -177,4 +177,4 @@ private: uint qHash(const QPointer& value, uint seed = 0); -#endif /* defined(__shared__ResourceCache__) */ +#endif // hifi_ResourceCache_h diff --git a/libraries/shared/src/Shape.h b/libraries/shared/src/Shape.h index 11ce41d103..fd16eafeae 100644 --- a/libraries/shared/src/Shape.h +++ b/libraries/shared/src/Shape.h @@ -9,8 +9,8 @@ // See the accompanying file LICENSE or http://www.apache.org/licenses/LICENSE-2.0.html // -#ifndef __hifi__Shape__ -#define __hifi__Shape__ +#ifndef hifi_Shape_h +#define hifi_Shape_h #include #include @@ -55,4 +55,4 @@ protected: glm::quat _rotation; }; -#endif /* defined(__hifi__Shape__) */ +#endif // hifi_Shape_h diff --git a/libraries/shared/src/ShapeCollider.h b/libraries/shared/src/ShapeCollider.h index c1018bec42..7f02acf15c 100644 --- a/libraries/shared/src/ShapeCollider.h +++ b/libraries/shared/src/ShapeCollider.h @@ -9,8 +9,8 @@ // See the accompanying file LICENSE or http://www.apache.org/licenses/LICENSE-2.0.html // -#ifndef __hifi__ShapeCollider__ -#define __hifi__ShapeCollider__ +#ifndef hifi_ShapeCollider_h +#define hifi_ShapeCollider_h #include "CapsuleShape.h" #include "CollisionInfo.h" @@ -82,4 +82,4 @@ namespace ShapeCollider { } // namespace ShapeCollider -#endif // __hifi__ShapeCollider__ +#endif // hifi_ShapeCollider_h diff --git a/libraries/shared/src/SharedUtil.h b/libraries/shared/src/SharedUtil.h index 90dd0ccfe8..f07995dce1 100644 --- a/libraries/shared/src/SharedUtil.h +++ b/libraries/shared/src/SharedUtil.h @@ -9,8 +9,8 @@ // See the accompanying file LICENSE or http://www.apache.org/licenses/LICENSE-2.0.html // -#ifndef __hifi__SharedUtil__ -#define __hifi__SharedUtil__ +#ifndef hifi_SharedUtil_h +#define hifi_SharedUtil_h #include #include @@ -171,4 +171,4 @@ int unpackFloatVec3FromSignedTwoByteFixed(const unsigned char* sourceBuffer, glm /// \return vec3 with euler angles in radians glm::vec3 safeEulerAngles(const glm::quat& q); -#endif /* defined(__hifi__SharedUtil__) */ +#endif // hifi_SharedUtil_h diff --git a/libraries/shared/src/SimpleMovingAverage.h b/libraries/shared/src/SimpleMovingAverage.h index 16d30279b0..3eec9d5be8 100644 --- a/libraries/shared/src/SimpleMovingAverage.h +++ b/libraries/shared/src/SimpleMovingAverage.h @@ -11,8 +11,8 @@ // See the accompanying file LICENSE or http://www.apache.org/licenses/LICENSE-2.0.html // -#ifndef __hifi__Stats__ -#define __hifi__Stats__ +#ifndef hifi_SimpleMovingAverage_h +#define hifi_SimpleMovingAverage_h #include @@ -37,4 +37,4 @@ private: float ONE_MINUS_WEIGHTING; }; -#endif /* defined(__hifi__Stats__) */ +#endif // hifi_SimpleMovingAverage_h diff --git a/libraries/shared/src/SphereShape.h b/libraries/shared/src/SphereShape.h index 746f93be80..62783ab340 100644 --- a/libraries/shared/src/SphereShape.h +++ b/libraries/shared/src/SphereShape.h @@ -9,8 +9,8 @@ // See the accompanying file LICENSE or http://www.apache.org/licenses/LICENSE-2.0.html // -#ifndef __hifi__SphereShape__ -#define __hifi__SphereShape__ +#ifndef hifi_SphereShape_h +#define hifi_SphereShape_h #include "Shape.h" @@ -31,4 +31,4 @@ public: void setRadius(float radius) { _boundingRadius = radius; } }; -#endif /* defined(__hifi__SphereShape__) */ +#endif // hifi_SphereShape_h diff --git a/libraries/shared/src/StdDev.h b/libraries/shared/src/StdDev.h index 82fccdd79a..77873a3549 100644 --- a/libraries/shared/src/StdDev.h +++ b/libraries/shared/src/StdDev.h @@ -9,8 +9,8 @@ // See the accompanying file LICENSE or http://www.apache.org/licenses/LICENSE-2.0.html // -#ifndef __hifi__StdDev__ -#define __hifi__StdDev__ +#ifndef hifi_StdDev_h +#define hifi_StdDev_h class StDev { public: @@ -25,4 +25,4 @@ class StDev { int sampleCount; }; -#endif /* defined(__hifi__StdDev__) */ +#endif // hifi_StdDev_h diff --git a/libraries/shared/src/StreamUtils.h b/libraries/shared/src/StreamUtils.h index d70096bd27..2546d49ffc 100644 --- a/libraries/shared/src/StreamUtils.h +++ b/libraries/shared/src/StreamUtils.h @@ -9,8 +9,8 @@ // See the accompanying file LICENSE or http://www.apache.org/licenses/LICENSE-2.0.html // -#ifndef __tests__StreamUtils__ -#define __tests__StreamUtils__ +#ifndef hifi_StreamUtils_h +#define hifi_StreamUtils_h #include @@ -40,4 +40,4 @@ std::ostream& operator<<(std::ostream& s, const CapsuleShape& capsule); #endif // DEBUG -#endif // __tests__StreamUtils__ +#endif // hifi_StreamUtils_h diff --git a/libraries/shared/src/ThreadedAssignment.h b/libraries/shared/src/ThreadedAssignment.h index 9f1f45c1a9..e9241d0272 100644 --- a/libraries/shared/src/ThreadedAssignment.h +++ b/libraries/shared/src/ThreadedAssignment.h @@ -9,8 +9,8 @@ // See the accompanying file LICENSE or http://www.apache.org/licenses/LICENSE-2.0.html // -#ifndef __hifi__ThreadedAssignment__ -#define __hifi__ThreadedAssignment__ +#ifndef hifi_ThreadedAssignment_h +#define hifi_ThreadedAssignment_h #include @@ -42,4 +42,4 @@ signals: typedef QSharedPointer SharedAssignmentPointer; -#endif /* defined(__hifi__ThreadedAssignment__) */ +#endif // hifi_ThreadedAssignment_h diff --git a/libraries/shared/src/UUID.h b/libraries/shared/src/UUID.h index da0025d425..7e7048486f 100644 --- a/libraries/shared/src/UUID.h +++ b/libraries/shared/src/UUID.h @@ -9,8 +9,8 @@ // See the accompanying file LICENSE or http://www.apache.org/licenses/LICENSE-2.0.html // -#ifndef __hifi__UUID__ -#define __hifi__UUID__ +#ifndef hifi_UUID_h +#define hifi_UUID_h #include @@ -18,4 +18,4 @@ const int NUM_BYTES_RFC4122_UUID = 16; QString uuidStringWithoutCurlyBraces(const QUuid& uuid); -#endif /* defined(__hifi__UUID__) */ +#endif // hifi_UUID_h diff --git a/libraries/voxels/src/EnvironmentData.h b/libraries/voxels/src/EnvironmentData.h index fe0e279ba8..3eac4048c2 100644 --- a/libraries/voxels/src/EnvironmentData.h +++ b/libraries/voxels/src/EnvironmentData.h @@ -9,8 +9,8 @@ // See the accompanying file LICENSE or http://www.apache.org/licenses/LICENSE-2.0.html // -#ifndef __interface__EnvironmentData__ -#define __interface__EnvironmentData__ +#ifndef hifi_EnvironmentData_h +#define hifi_EnvironmentData_h #include @@ -75,4 +75,4 @@ private: float _sunBrightness; }; -#endif /* defined(__interface__EnvironmentData__) */ +#endif // hifi_EnvironmentData_h diff --git a/libraries/voxels/src/LocalVoxelsList.h b/libraries/voxels/src/LocalVoxelsList.h index 2ec68d3234..d22d72446f 100644 --- a/libraries/voxels/src/LocalVoxelsList.h +++ b/libraries/voxels/src/LocalVoxelsList.h @@ -9,8 +9,8 @@ // See the accompanying file LICENSE or http://www.apache.org/licenses/LICENSE-2.0.html // -#ifndef __hifi__LocalVoxelsList__ -#define __hifi__LocalVoxelsList__ +#ifndef hifi_LocalVoxelsList_h +#define hifi_LocalVoxelsList_h #include #include @@ -59,4 +59,4 @@ private: QList _persistantTrees; }; -#endif /* defined(__hifi__LocalVoxelsList__) */ +#endif // hifi_LocalVoxelsList_h diff --git a/libraries/voxels/src/Tags.h b/libraries/voxels/src/Tags.h index ec1ae8c0e8..1ac231f27c 100644 --- a/libraries/voxels/src/Tags.h +++ b/libraries/voxels/src/Tags.h @@ -9,8 +9,8 @@ // See the accompanying file LICENSE or http://www.apache.org/licenses/LICENSE-2.0.html // -#ifndef __hifi__Tags__ -#define __hifi__Tags__ +#ifndef hifi_Tags_h +#define hifi_Tags_h #include @@ -180,4 +180,4 @@ private: int* _data; }; -#endif /* defined(__hifi__Tags__) */ +#endif // hifi_Tags_h diff --git a/libraries/voxels/src/VoxelConstants.h b/libraries/voxels/src/VoxelConstants.h index fc2c502a65..34a7667273 100644 --- a/libraries/voxels/src/VoxelConstants.h +++ b/libraries/voxels/src/VoxelConstants.h @@ -11,8 +11,8 @@ // See the accompanying file LICENSE or http://www.apache.org/licenses/LICENSE-2.0.html // -#ifndef __hifi_VoxelConstants_h__ -#define __hifi_VoxelConstants_h__ +#ifndef hifi_VoxelConstants_h +#define hifi_VoxelConstants_h #include #include @@ -47,4 +47,4 @@ const quint64 CLIENT_TO_SERVER_VOXEL_SEND_INTERVAL_USECS = 1000 * 5; // 1 packet const int DEFAULT_MAX_VOXEL_PPS = 600; // the default maximum PPS we think a voxel server should send to a client -#endif +#endif // hifi_VoxelConstants_h diff --git a/libraries/voxels/src/VoxelDetail.h b/libraries/voxels/src/VoxelDetail.h index 5ed68f540e..d30255bbb1 100644 --- a/libraries/voxels/src/VoxelDetail.h +++ b/libraries/voxels/src/VoxelDetail.h @@ -9,8 +9,8 @@ // See the accompanying file LICENSE or http://www.apache.org/licenses/LICENSE-2.0.html // -#ifndef __hifi__VoxelDetail__ -#define __hifi__VoxelDetail__ +#ifndef hifi_VoxelDetail_h +#define hifi_VoxelDetail_h #include @@ -50,4 +50,4 @@ Q_DECLARE_METATYPE(RayToVoxelIntersectionResult) QScriptValue rayToVoxelIntersectionResultToScriptValue(QScriptEngine* engine, const RayToVoxelIntersectionResult& results); void rayToVoxelIntersectionResultFromScriptValue(const QScriptValue& object, RayToVoxelIntersectionResult& results); -#endif /* defined(__hifi__VoxelDetail__) */ +#endif // hifi_VoxelDetail_h diff --git a/libraries/voxels/src/VoxelEditPacketSender.h b/libraries/voxels/src/VoxelEditPacketSender.h index fdf70fb96d..ff72e5704a 100644 --- a/libraries/voxels/src/VoxelEditPacketSender.h +++ b/libraries/voxels/src/VoxelEditPacketSender.h @@ -11,8 +11,8 @@ // See the accompanying file LICENSE or http://www.apache.org/licenses/LICENSE-2.0.html // -#ifndef __shared__VoxelEditPacketSender__ -#define __shared__VoxelEditPacketSender__ +#ifndef hifi_VoxelEditPacketSender_h +#define hifi_VoxelEditPacketSender_h #include #include "VoxelDetail.h" @@ -50,4 +50,4 @@ public: // My server type is the voxel server virtual unsigned char getMyNodeType() const { return NodeType::VoxelServer; } }; -#endif // __shared__VoxelEditPacketSender__ +#endif // hifi_VoxelEditPacketSender_h diff --git a/libraries/voxels/src/VoxelTree.h b/libraries/voxels/src/VoxelTree.h index 1fafd429ed..e0bc1d9a47 100644 --- a/libraries/voxels/src/VoxelTree.h +++ b/libraries/voxels/src/VoxelTree.h @@ -9,8 +9,8 @@ // See the accompanying file LICENSE or http://www.apache.org/licenses/LICENSE-2.0.html // -#ifndef __hifi__VoxelTree__ -#define __hifi__VoxelTree__ +#ifndef hifi_VoxelTree_h +#define hifi_VoxelTree_h #include @@ -57,4 +57,4 @@ private: void readCodeColorBufferToTreeRecursion(VoxelTreeElement* node, ReadCodeColorBufferToTreeArgs& args); }; -#endif /* defined(__hifi__VoxelTree__) */ +#endif // hifi_VoxelTree_h diff --git a/libraries/voxels/src/VoxelTreeCommands.h b/libraries/voxels/src/VoxelTreeCommands.h index 314a49b845..4f2610577e 100644 --- a/libraries/voxels/src/VoxelTreeCommands.h +++ b/libraries/voxels/src/VoxelTreeCommands.h @@ -9,8 +9,8 @@ // See the accompanying file LICENSE or http://www.apache.org/licenses/LICENSE-2.0.html // -#ifndef __hifi__VoxelTreeCommands__ -#define __hifi__VoxelTreeCommands__ +#ifndef hifi_VoxelTreeCommands_h +#define hifi_VoxelTreeCommands_h #include #include @@ -46,4 +46,4 @@ private: VoxelDetail _voxel; }; -#endif /* defined(__hifi__VoxelTreeCommands__) */ +#endif // hifi_VoxelTreeCommands_h diff --git a/libraries/voxels/src/VoxelTreeElement.h b/libraries/voxels/src/VoxelTreeElement.h index 757cffc8bc..140744afb0 100644 --- a/libraries/voxels/src/VoxelTreeElement.h +++ b/libraries/voxels/src/VoxelTreeElement.h @@ -9,8 +9,8 @@ // See the accompanying file LICENSE or http://www.apache.org/licenses/LICENSE-2.0.html // -#ifndef __hifi__VoxelTreeElement__ -#define __hifi__VoxelTreeElement__ +#ifndef hifi_VoxelTreeElement_h +#define hifi_VoxelTreeElement_h //#define HAS_AUDIT_CHILDREN //#define SIMPLE_CHILD_ARRAY @@ -120,5 +120,4 @@ inline unsigned char VoxelTreeElement::getExteriorOcclusions() const { return _exteriorOcclusions; } -#endif /* defined(__hifi__VoxelTreeElement__) */ - +#endif // hifi_VoxelTreeElement_h diff --git a/libraries/voxels/src/VoxelTreeHeadlessViewer.h b/libraries/voxels/src/VoxelTreeHeadlessViewer.h index 55366010ad..3a9f00d754 100644 --- a/libraries/voxels/src/VoxelTreeHeadlessViewer.h +++ b/libraries/voxels/src/VoxelTreeHeadlessViewer.h @@ -9,8 +9,8 @@ // See the accompanying file LICENSE or http://www.apache.org/licenses/LICENSE-2.0.html // -#ifndef __hifi__VoxelTreeHeadlessViewer__ -#define __hifi__VoxelTreeHeadlessViewer__ +#ifndef hifi_VoxelTreeHeadlessViewer_h +#define hifi_VoxelTreeHeadlessViewer_h #include #include @@ -37,4 +37,4 @@ public: virtual void init(); }; -#endif /* defined(__hifi__VoxelTreeHeadlessViewer__) */ +#endif // hifi_VoxelTreeHeadlessViewer_h diff --git a/libraries/voxels/src/VoxelsScriptingInterface.h b/libraries/voxels/src/VoxelsScriptingInterface.h index 05c93aab8e..71a8405be6 100644 --- a/libraries/voxels/src/VoxelsScriptingInterface.h +++ b/libraries/voxels/src/VoxelsScriptingInterface.h @@ -9,8 +9,8 @@ // See the accompanying file LICENSE or http://www.apache.org/licenses/LICENSE-2.0.html // -#ifndef __hifi__VoxelsScriptingInterface__ -#define __hifi__VoxelsScriptingInterface__ +#ifndef hifi_VoxelsScriptingInterface_h +#define hifi_VoxelsScriptingInterface_h #include @@ -88,4 +88,4 @@ private: QUndoStack* _undoStack; }; -#endif /* defined(__hifi__VoxelsScriptingInterface__) */ +#endif // hifi_VoxelsScriptingInterface_h diff --git a/tests/metavoxels/src/MetavoxelTests.h b/tests/metavoxels/src/MetavoxelTests.h index 71f44080d3..206c818c6e 100644 --- a/tests/metavoxels/src/MetavoxelTests.h +++ b/tests/metavoxels/src/MetavoxelTests.h @@ -9,8 +9,8 @@ // See the accompanying file LICENSE or http://www.apache.org/licenses/LICENSE-2.0.html // -#ifndef __interface__MetavoxelTests__ -#define __interface__MetavoxelTests__ +#ifndef hifi_MetavoxelTests_h +#define hifi_MetavoxelTests_h #include #include @@ -160,4 +160,4 @@ public: DECLARE_STREAMABLE_METATYPE(SequencedTestMessage) -#endif /* defined(__interface__MetavoxelTests__) */ +#endif // hifi_MetavoxelTests_h diff --git a/tests/physics/src/CollisionInfoTests.h b/tests/physics/src/CollisionInfoTests.h index 7877de4392..54c4e89e95 100644 --- a/tests/physics/src/CollisionInfoTests.h +++ b/tests/physics/src/CollisionInfoTests.h @@ -9,8 +9,8 @@ // See the accompanying file LICENSE or http://www.apache.org/licenses/LICENSE-2.0.html // -#ifndef __tests__CollisionInfoTests__ -#define __tests__CollisionInfoTests__ +#ifndef hifi_CollisionInfoTests_h +#define hifi_CollisionInfoTests_h namespace CollisionInfoTests { @@ -20,5 +20,4 @@ namespace CollisionInfoTests { void runAllTests(); } -#endif // __tests__CollisionInfoTests__ - +#endif // hifi_CollisionInfoTests_h diff --git a/tests/physics/src/PhysicsTestUtil.h b/tests/physics/src/PhysicsTestUtil.h index cc758c71bc..998a18ff5d 100644 --- a/tests/physics/src/PhysicsTestUtil.h +++ b/tests/physics/src/PhysicsTestUtil.h @@ -9,8 +9,8 @@ // See the accompanying file LICENSE or http://www.apache.org/licenses/LICENSE-2.0.html // -#ifndef __tests__PhysicsTestUtil__ -#define __tests__PhysicsTestUtil__ +#ifndef hifi_PhysicsTestUtil_h +#define hifi_PhysicsTestUtil_h #include #include @@ -26,4 +26,4 @@ std::ostream& operator<<(std::ostream& s, const glm::quat& q); std::ostream& operator<<(std::ostream& s, const glm::mat4& m); std::ostream& operator<<(std::ostream& s, const CollisionInfo& c); -#endif // __tests__PhysicsTestUtil__ +#endif // hifi_PhysicsTestUtil_h diff --git a/tests/physics/src/ShapeColliderTests.h b/tests/physics/src/ShapeColliderTests.h index 9fee17b228..1d468a65d2 100644 --- a/tests/physics/src/ShapeColliderTests.h +++ b/tests/physics/src/ShapeColliderTests.h @@ -9,8 +9,8 @@ // See the accompanying file LICENSE or http://www.apache.org/licenses/LICENSE-2.0.html // -#ifndef __tests__ShapeColliderTests__ -#define __tests__ShapeColliderTests__ +#ifndef hifi_ShapeColliderTests_h +#define hifi_ShapeColliderTests_h namespace ShapeColliderTests { @@ -26,4 +26,4 @@ namespace ShapeColliderTests { void runAllTests(); } -#endif // __tests__ShapeColliderTests__ +#endif // hifi_ShapeColliderTests_h diff --git a/voxel-edit/src/SceneUtils.h b/voxel-edit/src/SceneUtils.h index 90b605f2c7..26c8130c4b 100644 --- a/voxel-edit/src/SceneUtils.h +++ b/voxel-edit/src/SceneUtils.h @@ -9,8 +9,8 @@ // See the accompanying file LICENSE or http://www.apache.org/licenses/LICENSE-2.0.html // -#ifndef __hifi__SceneUtil__ -#define __hifi__SceneUtil__ +#ifndef hifi_SceneUtils_h +#define hifi_SceneUtils_h #include "VoxelTree.h" #include @@ -19,4 +19,4 @@ void addCornersAndAxisLines(VoxelTree* tree); void addSurfaceScene(VoxelTree * tree); -#endif /* defined(__hifi__SceneUtil__) */ +#endif // hifi_SceneUtils_h From 29f8ed3c0920aec1fa10615e3321b692f169a64a Mon Sep 17 00:00:00 2001 From: Stephen Birarda Date: Wed, 9 Apr 2014 12:03:57 -0700 Subject: [PATCH 068/120] manually fix Plane include guard since regex did not catch --- libraries/octree/src/Plane.h | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/libraries/octree/src/Plane.h b/libraries/octree/src/Plane.h index 1a37499183..0f481dee57 100755 --- a/libraries/octree/src/Plane.h +++ b/libraries/octree/src/Plane.h @@ -12,8 +12,8 @@ // See the accompanying file LICENSE or http://www.apache.org/licenses/LICENSE-2.0.html // -#ifndef _PLANE_ -#define _PLANE_ +#ifndef hifi_Plane_h +#define hifi_Plane_h #include @@ -44,4 +44,4 @@ private: }; -#endif \ No newline at end of file +#endif // hifi_Plane_h \ No newline at end of file From 4d9f3a4aee436af3295455201df83923560d2b52 Mon Sep 17 00:00:00 2001 From: Andrzej Kapolka Date: Wed, 9 Apr 2014 12:36:02 -0700 Subject: [PATCH 069/120] Added basic mappings to start off with. --- interface/src/devices/Faceplus.cpp | 133 ++++++++++++++--------------- interface/src/devices/Faceplus.h | 3 + 2 files changed, 66 insertions(+), 70 deletions(-) diff --git a/interface/src/devices/Faceplus.cpp b/interface/src/devices/Faceplus.cpp index 89197a5acf..ccbc494fe3 100644 --- a/interface/src/devices/Faceplus.cpp +++ b/interface/src/devices/Faceplus.cpp @@ -33,78 +33,48 @@ void Faceplus::init() { updateEnabled(); } -/* -[2014-04-09T11:42:11] "Mix::Blink_Left" -[2014-04-09T11:42:11] "Mix::Blink_Right" -[2014-04-09T11:42:11] "Mix::BrowsDown_Left" -[2014-04-09T11:42:11] "Mix::BrowsDown_Right" -[2014-04-09T11:42:11] "Mix::BrowsIn_Left" -[2014-04-09T11:42:11] "Mix::BrowsIn_Right" -[2014-04-09T11:42:11] "Mix::BrowsOuterLower_Left" -[2014-04-09T11:42:11] "Mix::BrowsOuterLower_Right" -[2014-04-09T11:42:11] "Mix::BrowsUp_Left" -[2014-04-09T11:42:11] "Mix::BrowsUp_Right" -[2014-04-09T11:42:11] "Mix::EyesWide_Left" -[2014-04-09T11:42:11] "Mix::EyesWide_Right" -[2014-04-09T11:42:11] "Mix::Frown_Left" -[2014-04-09T11:42:11] "Mix::Frown_Right" -[2014-04-09T11:42:11] "Mix::Jaw_RotateY_Left" -[2014-04-09T11:42:11] "Mix::Jaw_RotateY_Right" -[2014-04-09T11:42:11] "Mix::LowerLipDown_Left" -[2014-04-09T11:42:11] "Mix::LowerLipDown_Right" -[2014-04-09T11:42:11] "Mix::LowerLipIn" -[2014-04-09T11:42:11] "Mix::LowerLipOut" -[2014-04-09T11:42:11] "Mix::Midmouth_Left" -[2014-04-09T11:42:11] "Mix::Midmouth_Right" -[2014-04-09T11:42:11] "Mix::MouthDown" -[2014-04-09T11:42:11] "Mix::MouthNarrow_Left" -[2014-04-09T11:42:11] "Mix::MouthNarrow_Right" -[2014-04-09T11:42:11] "Mix::MouthOpen" -[2014-04-09T11:42:11] "Mix::MouthUp" -[2014-04-09T11:42:11] "Mix::MouthWhistle_NarrowAdjust_Left" -[2014-04-09T11:42:11] "Mix::MouthWhistle_NarrowAdjust_Right" -[2014-04-09T11:42:11] "Mix::NoseScrunch_Left" -[2014-04-09T11:42:11] "Mix::NoseScrunch_Right" -[2014-04-09T11:42:11] "Mix::Smile_Left" -[2014-04-09T11:42:11] "Mix::Smile_Right" -[2014-04-09T11:42:11] "Mix::Squint_Left" -[2014-04-09T11:42:11] "Mix::Squint_Right" -[2014-04-09T11:42:11] "Mix::UpperLipIn" -[2014-04-09T11:42:11] "Mix::UpperLipOut" -[2014-04-09T11:42:11] "Mix::UpperLipUp_Left" -[2014-04-09T11:42:11] "Mix::UpperLipUp_Right" -[2014-04-09T11:42:11] "Head_Joint::Rotation_X" -[2014-04-09T11:42:11] "Head_Joint::Rotation_Y" -[2014-04-09T11:42:11] "Head_Joint::Rotation_Z" -[2014-04-09T11:42:11] "Left_Eye_Joint::Rotation_X" -[2014-04-09T11:42:11] "Left_Eye_Joint::Rotation_Y" -[2014-04-09T11:42:11] "Right_Eye_Joint::Rotation_X" -[2014-04-09T11:42:11] "Right_Eye_Joint::Rotation_Y" -*/ - #ifdef HAVE_FACEPLUS static QMultiHash > createChannelNameMap() { QMultiHash > blendshapeMap; - blendshapeMap.insert("JawFwd", QPair("au_jaw_z_push", 1.0f)); - blendshapeMap.insert("JawLeft", QPair("au_jaw_x_push", 1.0f)); - blendshapeMap.insert("JawOpen", QPair("au_jaw_drop", 1.0f)); - blendshapeMap.insert("LipsLowerDown", QPair("au_lower_lip_drop", 1.0f)); - blendshapeMap.insert("LipsUpperOpen", QPair("au_upper_lip_raiser", 1.0f)); - blendshapeMap.insert("LipsStretch_R", QPair("au_lip_stretcher_left", 0.5f)); - blendshapeMap.insert("MouthSmile_L", QPair("au_lip_corner_depressor", -1.0f)); - blendshapeMap.insert("MouthSmile_R", QPair("au_lip_corner_depressor", -1.0f)); - blendshapeMap.insert("BrowsU_R", QPair("au_left_outer_brow_raiser", 1.0f)); - blendshapeMap.insert("BrowsU_C", QPair("au_left_inner_brow_raiser", 1.0f)); - blendshapeMap.insert("BrowsD_R", QPair("au_left_brow_lowerer", 1.0f)); - blendshapeMap.insert("EyeBlink_L", QPair("au_leye_closed", 1.0f)); - blendshapeMap.insert("EyeBlink_R", QPair("au_reye_closed", 1.0f)); - blendshapeMap.insert("EyeOpen_L", QPair("au_upper_lid_raiser", 1.0f)); - blendshapeMap.insert("EyeOpen_R", QPair("au_upper_lid_raiser", 1.0f)); - blendshapeMap.insert("LipLowerOpen", QPair("au_lower_lip_x_push", 1.0f)); - blendshapeMap.insert("LipsStretch_L", QPair("au_lip_stretcher_right", 0.5f)); - blendshapeMap.insert("BrowsU_L", QPair("au_right_outer_brow_raiser", 1.0f)); - blendshapeMap.insert("BrowsU_C", QPair("au_right_inner_brow_raiser", 1.0f)); - blendshapeMap.insert("BrowsD_L", QPair("au_right_brow_lowerer", 1.0f)); + blendshapeMap.insert("EyeBlink_L", QPair("Mix::Blink_Left", 1.0f)); + blendshapeMap.insert("EyeBlink_R", QPair("Mix::Blink_Right", 1.0f)); + blendshapeMap.insert("BrowsD_L", QPair("Mix::BrowsDown_Left", 1.0f)); + blendshapeMap.insert("BrowsD_R", QPair("Mix::BrowsDown_Right", 1.0f)); + blendshapeMap.insert("...", QPair("Mix::BrowsIn_Left", 1.0f)); + blendshapeMap.insert("...", QPair("Mix::BrowsIn_Right", 1.0f)); + blendshapeMap.insert("...", QPair("Mix::BrowsOuterLower_Left", 1.0f)); + blendshapeMap.insert("...", QPair("Mix::BrowsOuterLower_Right", 1.0f)); + blendshapeMap.insert("BrowsU_L", QPair("Mix::BrowsUp_Left", 1.0f)); + blendshapeMap.insert("BrowsU_R", QPair("Mix::BrowsUp_Right", 1.0f)); + blendshapeMap.insert("EyeOpen_L", QPair("Mix::EyesWide_Left", 1.0f)); + blendshapeMap.insert("EyeOpen_R", QPair("Mix::EyesWide_Right", 1.0f)); + blendshapeMap.insert("MouthFrown_L", QPair("Mix::Frown_Left", 1.0f)); + blendshapeMap.insert("MouthFrown_R", QPair("Mix::Frown_Right", 1.0f)); + blendshapeMap.insert("JawLeft", QPair("Mix::Jaw_RotateY_Left", 1.0f)); + blendshapeMap.insert("JawRight", QPair("Mix::Jaw_RotateY_Right", 1.0f)); + blendshapeMap.insert("LipsLowerDown", QPair("Mix::LowerLipDown_Left", 0.5f)); + blendshapeMap.insert("LipsLowerDown", QPair("Mix::LowerLipDown_Right", 0.5f)); + blendshapeMap.insert("...", QPair("Mix::LowerLipIn", 1.0f)); + blendshapeMap.insert("...", QPair("Mix::LowerLipOut", 1.0f)); + blendshapeMap.insert("MouthLeft", QPair("Mix::Midmouth_Left", 1.0f)); + blendshapeMap.insert("MouthRight", QPair("Mix::Midmouth_Right", 1.0f)); + blendshapeMap.insert("...", QPair("Mix::MouthDown", 1.0f)); + blendshapeMap.insert("...", QPair("Mix::MouthNarrow_Left", 1.0f)); + blendshapeMap.insert("...", QPair("Mix::MouthNarrow_Right", 1.0f)); + blendshapeMap.insert("JawOpen", QPair("Mix::MouthOpen", 1.0f)); + blendshapeMap.insert("...", QPair("Mix::MouthUp", 1.0f)); + blendshapeMap.insert("LipsPucker", QPair("Mix::MouthWhistle_NarrowAdjust_Left", 0.5f)); + blendshapeMap.insert("LipsPucker", QPair("Mix::MouthWhistle_NarrowAdjust_Right", 0.5f)); + blendshapeMap.insert("Sneer", QPair("Mix::NoseScrunch_Left", 0.5f)); + blendshapeMap.insert("Sneer", QPair("Mix::NoseScrunch_Right", 0.5f)); + blendshapeMap.insert("MouthSmile_L", QPair("Mix::Smile_Left", 1.0f)); + blendshapeMap.insert("MouthSmile_R", QPair("Mix::Smile_Right", 1.0f)); + blendshapeMap.insert("EyeSquint_L", QPair("Mix::Squint_Left", 1.0f)); + blendshapeMap.insert("EyeSquint_R", QPair("Mix::Squint_Right", 1.0f)); + blendshapeMap.insert("...", QPair("Mix::UpperLipIn", 1.0f)); + blendshapeMap.insert("...", QPair("Mix::UpperLipOut", 1.0f)); + blendshapeMap.insert("LipsUpperUp", QPair("Mix::UpperLipUp_Left", 0.5f)); + blendshapeMap.insert("LipsUpperUp", QPair("Mix::UpperLipUp_Right", 0.5f)); QMultiHash > channelNameMap; for (int i = 0;; i++) { @@ -135,6 +105,11 @@ void Faceplus::update() { if (!(_active = faceplus_current_output_vector(_outputVector.data()))) { return; } + _headRotation = glm::quat(glm::radians(_outputVector.at(_headRotationIndices[0]), + _outputVector.at(_headRotationIndices[1]), _outputVector.at(_headRotationIndices[2]))); + _estimatedEyePitch = (_outputVector.at(_leftEyeRotationIndices[0]) + _outputVector.at(_rightEyeRotationIndices[0])) * 0.5f; + _estimatedEyeYaw = (_outputVector.at(_leftEyeRotationIndices[1]) + _outputVector.at(_rightEyeRotationIndices[1])) * 0.5f; + qFill(_blendshapeCoefficients.begin(), _blendshapeCoefficients.end(), 0.0f); for (int i = 0; i < _outputVector.size(); i++) { for (QMultiHash >::const_iterator it = _channelIndexMap.constFind(i); @@ -171,9 +146,27 @@ void Faceplus::setEnabled(bool enabled) { _channelIndexMap.clear(); for (int i = 0; i < channelCount; i++) { QByteArray name = faceplus_output_channel_name(i); + if (name == "Head_Joint::Rotation_X") { + _headRotationIndices[0] = i; - qDebug() << name; + } else if (name == "Head_Joint::Rotation_Y") { + _headRotationIndices[1] = i; + } else if (name == "Head_Joint::Rotation_Z") { + _headRotationIndices[2] = i; + + } else if (name == "Left_Eye_Joint::Rotation_X") { + _leftEyeRotationIndices[0] = i; + + } else if (name == "Left_Eye_Joint::Rotation_Y") { + _leftEyeRotationIndices[1] = i; + + } else if (name == "Right_Eye_Joint::Rotation_X") { + _rightEyeRotationIndices[0] = i; + + } else if (name == "Right_Eye_Joint::Rotation_Y") { + _rightEyeRotationIndices[1] = i; + } for (QMultiHash >::const_iterator it = getChannelNameMap().constFind(name); it != getChannelNameMap().constEnd() && it.key() == name; it++) { _channelIndexMap.insert(i, it.value()); diff --git a/interface/src/devices/Faceplus.h b/interface/src/devices/Faceplus.h index 1e3272906c..164cf4d031 100644 --- a/interface/src/devices/Faceplus.h +++ b/interface/src/devices/Faceplus.h @@ -45,6 +45,9 @@ private: #ifdef HAVE_FACEPLUS QMultiHash > _channelIndexMap; QVector _outputVector; + int _headRotationIndices[3]; + int _leftEyeRotationIndices[2]; + int _rightEyeRotationIndices[2]; #endif }; From 7304049f83df687ea9df7b11b5e7e4fa8c4011f2 Mon Sep 17 00:00:00 2001 From: Andrew Meadows Date: Wed, 9 Apr 2014 12:55:29 -0700 Subject: [PATCH 070/120] update boiler plate to abide by new standard --- libraries/script-engine/src/ScriptUUID.cpp | 11 ++++++++--- libraries/script-engine/src/ScriptUUID.h | 19 +++++++++++-------- 2 files changed, 19 insertions(+), 11 deletions(-) diff --git a/libraries/script-engine/src/ScriptUUID.cpp b/libraries/script-engine/src/ScriptUUID.cpp index cea7247e90..f19ed99417 100644 --- a/libraries/script-engine/src/ScriptUUID.cpp +++ b/libraries/script-engine/src/ScriptUUID.cpp @@ -1,10 +1,15 @@ // -// ScriptUUID.h -// hifi +// ScriptUUID.cpp +// libraries/script-engine/src/ // -// Created by Andrew Meadows on 2014.04.07 +// Created by Andrew Meadows on 2014-04-07 // Copyright (c) 2014 High Fidelity, Inc. All rights reserved. // +// Scriptable interface for a UUID helper class object. Used exclusively in the JavaScript API +// +// Distributed under the Apache License, Version 2.0. +// See the accompanying file LICENSE or http://www.apache.org/licenses/LICENSE-2.0.html +// #include diff --git a/libraries/script-engine/src/ScriptUUID.h b/libraries/script-engine/src/ScriptUUID.h index 43e885cf98..32ab40a106 100644 --- a/libraries/script-engine/src/ScriptUUID.h +++ b/libraries/script-engine/src/ScriptUUID.h @@ -1,17 +1,22 @@ // // ScriptUUID.h -// hifi +// libraries/script-engine/src/ // -// Created by Andrew Meadows on 2014.04.07 +// Created by Andrew Meadows on 2014-04-07 // Copyright (c) 2014 High Fidelity, Inc. All rights reserved. // +// Scriptable interface for a UUID helper class object. Used exclusively in the JavaScript API +// +// 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__ScriptUUID__ -#define __hifi__ScriptUUID__ +#ifndef hifi_ScriptUUID_h +#define hifi_ScriptUUID_h #include -/// Scriptable interface a UUID helper class object. Used exclusively in the JavaScript API +/// Scriptable interface for a UUID helper class object. Used exclusively in the JavaScript API class ScriptUUID : public QObject { Q_OBJECT @@ -24,6 +29,4 @@ public slots: void print(const QString& lable, const QUuid& id); }; - - -#endif /* defined(__hifi__Vec3__) */ +#endif // hifi_ScriptUUID_h From 635f832dfe486bd83f55e86702745e66b2c09e48 Mon Sep 17 00:00:00 2001 From: Andrew Meadows Date: Wed, 9 Apr 2014 13:04:17 -0700 Subject: [PATCH 071/120] rename shapeShape() to be collideShapes() Also add collideShapesCoarse() --- libraries/shared/src/ShapeCollider.cpp | 29 +++++++++++- libraries/shared/src/ShapeCollider.h | 10 ++++- tests/physics/src/ShapeColliderTests.cpp | 56 ++++++++++++------------ 3 files changed, 63 insertions(+), 32 deletions(-) diff --git a/libraries/shared/src/ShapeCollider.cpp b/libraries/shared/src/ShapeCollider.cpp index 70f9b9c4bf..6ccf9df9c6 100644 --- a/libraries/shared/src/ShapeCollider.cpp +++ b/libraries/shared/src/ShapeCollider.cpp @@ -10,6 +10,7 @@ #include +#include "GeometryUtil.h" #include "ShapeCollider.h" // NOTE: @@ -19,7 +20,7 @@ namespace ShapeCollider { -bool shapeShape(const Shape* shapeA, const Shape* shapeB, CollisionList& collisions) { +bool collideShapes(const Shape* shapeA, const Shape* shapeB, CollisionList& collisions) { // ATM we only have two shape types so we just check every case. // TODO: make a fast lookup for correct method int typeA = shapeA->getType(); @@ -49,6 +50,30 @@ bool shapeShape(const Shape* shapeA, const Shape* shapeB, CollisionList& collisi return false; } +static CollisionList tempCollisions(32); + +bool collideShapesCoarse(const QVector& shapesA, const QVector& shapesB, CollisionInfo& collision) { + tempCollisions.clear(); + foreach (const Shape* shapeA, shapesA) { + foreach (const Shape* shapeB, shapesB) { + ShapeCollider::collideShapes(shapeA, shapeB, tempCollisions); + } + } + if (tempCollisions.size() > 0) { + glm::vec3 totalPenetration(0.f); + glm::vec3 averageContactPoint(0.f); + for (int j = 0; j < tempCollisions.size(); ++j) { + CollisionInfo* c = tempCollisions.getCollision(j); + totalPenetration = addPenetrations(totalPenetration, c->_penetration); + averageContactPoint += c->_contactPoint; + } + collision._penetration = totalPenetration; + collision._contactPoint = averageContactPoint / (float)(tempCollisions.size()); + return true; + } + return false; +} + bool sphereSphere(const SphereShape* sphereA, const SphereShape* sphereB, CollisionList& collisions) { glm::vec3 BA = sphereB->getPosition() - sphereA->getPosition(); float distanceSquared = glm::dot(BA, BA); @@ -407,7 +432,7 @@ bool listList(const ListShape* listA, const ListShape* listB, CollisionList& col for (int i = 0; i < listA->size() && !collisions.isFull(); ++i) { const Shape* subShape = listA->getSubShape(i); for (int j = 0; j < listB->size() && !collisions.isFull(); ++j) { - touching = shapeShape(subShape, listB->getSubShape(j), collisions) || touching; + touching = collideShapes(subShape, listB->getSubShape(j), collisions) || touching; } } return touching; diff --git a/libraries/shared/src/ShapeCollider.h b/libraries/shared/src/ShapeCollider.h index e3e044c8fe..841a607bc3 100644 --- a/libraries/shared/src/ShapeCollider.h +++ b/libraries/shared/src/ShapeCollider.h @@ -19,9 +19,15 @@ namespace ShapeCollider { /// \param shapeA pointer to first shape /// \param shapeB pointer to second shape - /// \param[out] collisions where to append collision details + /// \param collisions[out] collision details /// \return true if shapes collide - bool shapeShape(const Shape* shapeA, const Shape* shapeB, CollisionList& collisions); + bool collideShapes(const Shape* shapeA, const Shape* shapeB, CollisionList& collisions); + + /// \param shapesA list of shapes + /// \param shapeB list of shapes + /// \param collisions[out] average collision details + /// \return true if any shapes collide + bool collideShapesCoarse(const QVector& shapesA, const QVector& shapesB, CollisionInfo& collision); /// \param sphereA pointer to first shape /// \param sphereB pointer to second shape diff --git a/tests/physics/src/ShapeColliderTests.cpp b/tests/physics/src/ShapeColliderTests.cpp index 7aeec84651..0960f7628a 100644 --- a/tests/physics/src/ShapeColliderTests.cpp +++ b/tests/physics/src/ShapeColliderTests.cpp @@ -40,7 +40,7 @@ void ShapeColliderTests::sphereMissesSphere() { // collide A to B... { - bool touching = ShapeCollider::shapeShape(&sphereA, &sphereB, collisions); + bool touching = ShapeCollider::collideShapes(&sphereA, &sphereB, collisions); if (touching) { std::cout << __FILE__ << ":" << __LINE__ << " ERROR: sphereA and sphereB should NOT touch" << std::endl; @@ -49,7 +49,7 @@ void ShapeColliderTests::sphereMissesSphere() { // collide B to A... { - bool touching = ShapeCollider::shapeShape(&sphereB, &sphereA, collisions); + bool touching = ShapeCollider::collideShapes(&sphereB, &sphereA, collisions); if (touching) { std::cout << __FILE__ << ":" << __LINE__ << " ERROR: sphereA and sphereB should NOT touch" << std::endl; @@ -58,7 +58,7 @@ void ShapeColliderTests::sphereMissesSphere() { // also test shapeShape { - bool touching = ShapeCollider::shapeShape(&sphereB, &sphereA, collisions); + bool touching = ShapeCollider::collideShapes(&sphereB, &sphereA, collisions); if (touching) { std::cout << __FILE__ << ":" << __LINE__ << " ERROR: sphereA and sphereB should NOT touch" << std::endl; @@ -90,7 +90,7 @@ void ShapeColliderTests::sphereTouchesSphere() { // collide A to B... { - bool touching = ShapeCollider::shapeShape(&sphereA, &sphereB, collisions); + bool touching = ShapeCollider::collideShapes(&sphereA, &sphereB, collisions); if (!touching) { std::cout << __FILE__ << ":" << __LINE__ << " ERROR: sphereA and sphereB should touch" << std::endl; @@ -133,7 +133,7 @@ void ShapeColliderTests::sphereTouchesSphere() { // collide B to A... { - bool touching = ShapeCollider::shapeShape(&sphereB, &sphereA, collisions); + bool touching = ShapeCollider::collideShapes(&sphereB, &sphereA, collisions); if (!touching) { std::cout << __FILE__ << ":" << __LINE__ << " ERROR: sphereA and sphereB should touch" << std::endl; @@ -196,7 +196,7 @@ void ShapeColliderTests::sphereMissesCapsule() { sphereA.setPosition(rotation * localPosition + translation); // sphereA agains capsuleB - if (ShapeCollider::shapeShape(&sphereA, &capsuleB, collisions)) + if (ShapeCollider::collideShapes(&sphereA, &capsuleB, collisions)) { std::cout << __FILE__ << ":" << __LINE__ << " ERROR: sphere and capsule should NOT touch" @@ -204,7 +204,7 @@ void ShapeColliderTests::sphereMissesCapsule() { } // capsuleB against sphereA - if (ShapeCollider::shapeShape(&capsuleB, &sphereA, collisions)) + if (ShapeCollider::collideShapes(&capsuleB, &sphereA, collisions)) { std::cout << __FILE__ << ":" << __LINE__ << " ERROR: sphere and capsule should NOT touch" @@ -238,7 +238,7 @@ void ShapeColliderTests::sphereTouchesCapsule() { { // sphereA collides with capsuleB's cylindrical wall sphereA.setPosition(radialOffset * xAxis); - if (!ShapeCollider::shapeShape(&sphereA, &capsuleB, collisions)) + if (!ShapeCollider::collideShapes(&sphereA, &capsuleB, collisions)) { std::cout << __FILE__ << ":" << __LINE__ << " ERROR: sphere and capsule should touch" @@ -269,7 +269,7 @@ void ShapeColliderTests::sphereTouchesCapsule() { } // capsuleB collides with sphereA - if (!ShapeCollider::shapeShape(&capsuleB, &sphereA, collisions)) + if (!ShapeCollider::collideShapes(&capsuleB, &sphereA, collisions)) { std::cout << __FILE__ << ":" << __LINE__ << " ERROR: capsule and sphere should touch" @@ -305,7 +305,7 @@ void ShapeColliderTests::sphereTouchesCapsule() { glm::vec3 axialOffset = (halfHeightB + alpha * radiusA + beta * radiusB) * yAxis; sphereA.setPosition(axialOffset * yAxis); - if (!ShapeCollider::shapeShape(&sphereA, &capsuleB, collisions)) + if (!ShapeCollider::collideShapes(&sphereA, &capsuleB, collisions)) { std::cout << __FILE__ << ":" << __LINE__ << " ERROR: sphere and capsule should touch" @@ -336,7 +336,7 @@ void ShapeColliderTests::sphereTouchesCapsule() { } // capsuleB collides with sphereA - if (!ShapeCollider::shapeShape(&capsuleB, &sphereA, collisions)) + if (!ShapeCollider::collideShapes(&capsuleB, &sphereA, collisions)) { std::cout << __FILE__ << ":" << __LINE__ << " ERROR: capsule and sphere should touch" @@ -372,7 +372,7 @@ void ShapeColliderTests::sphereTouchesCapsule() { glm::vec3 axialOffset = - (halfHeightB + alpha * radiusA + beta * radiusB) * yAxis; sphereA.setPosition(axialOffset * yAxis); - if (!ShapeCollider::shapeShape(&sphereA, &capsuleB, collisions)) + if (!ShapeCollider::collideShapes(&sphereA, &capsuleB, collisions)) { std::cout << __FILE__ << ":" << __LINE__ << " ERROR: sphere and capsule should touch" @@ -403,7 +403,7 @@ void ShapeColliderTests::sphereTouchesCapsule() { } // capsuleB collides with sphereA - if (!ShapeCollider::shapeShape(&capsuleB, &sphereA, collisions)) + if (!ShapeCollider::collideShapes(&capsuleB, &sphereA, collisions)) { std::cout << __FILE__ << ":" << __LINE__ << " ERROR: capsule and sphere should touch" @@ -459,13 +459,13 @@ void ShapeColliderTests::capsuleMissesCapsule() { // side by side capsuleB.setPosition((1.01f * totalRadius) * xAxis); - if (ShapeCollider::shapeShape(&capsuleA, &capsuleB, collisions)) + if (ShapeCollider::collideShapes(&capsuleA, &capsuleB, collisions)) { std::cout << __FILE__ << ":" << __LINE__ << " ERROR: capsule and capsule should NOT touch" << std::endl; } - if (ShapeCollider::shapeShape(&capsuleB, &capsuleA, collisions)) + if (ShapeCollider::collideShapes(&capsuleB, &capsuleA, collisions)) { std::cout << __FILE__ << ":" << __LINE__ << " ERROR: capsule and capsule should NOT touch" @@ -474,13 +474,13 @@ void ShapeColliderTests::capsuleMissesCapsule() { // end to end capsuleB.setPosition((1.01f * totalHalfLength) * xAxis); - if (ShapeCollider::shapeShape(&capsuleA, &capsuleB, collisions)) + if (ShapeCollider::collideShapes(&capsuleA, &capsuleB, collisions)) { std::cout << __FILE__ << ":" << __LINE__ << " ERROR: capsule and capsule should NOT touch" << std::endl; } - if (ShapeCollider::shapeShape(&capsuleB, &capsuleA, collisions)) + if (ShapeCollider::collideShapes(&capsuleB, &capsuleA, collisions)) { std::cout << __FILE__ << ":" << __LINE__ << " ERROR: capsule and capsule should NOT touch" @@ -491,13 +491,13 @@ void ShapeColliderTests::capsuleMissesCapsule() { glm::quat rotation = glm::angleAxis(PI_OVER_TWO, zAxis); capsuleB.setRotation(rotation); capsuleB.setPosition((1.01f * (totalRadius + capsuleB.getHalfHeight())) * xAxis); - if (ShapeCollider::shapeShape(&capsuleA, &capsuleB, collisions)) + if (ShapeCollider::collideShapes(&capsuleA, &capsuleB, collisions)) { std::cout << __FILE__ << ":" << __LINE__ << " ERROR: capsule and capsule should NOT touch" << std::endl; } - if (ShapeCollider::shapeShape(&capsuleB, &capsuleA, collisions)) + if (ShapeCollider::collideShapes(&capsuleB, &capsuleA, collisions)) { std::cout << __FILE__ << ":" << __LINE__ << " ERROR: capsule and capsule should NOT touch" @@ -529,7 +529,7 @@ void ShapeColliderTests::capsuleTouchesCapsule() { { // side by side capsuleB.setPosition((0.99f * totalRadius) * xAxis); - if (!ShapeCollider::shapeShape(&capsuleA, &capsuleB, collisions)) + if (!ShapeCollider::collideShapes(&capsuleA, &capsuleB, collisions)) { std::cout << __FILE__ << ":" << __LINE__ << " ERROR: capsule and capsule should touch" @@ -537,7 +537,7 @@ void ShapeColliderTests::capsuleTouchesCapsule() { } else { ++numCollisions; } - if (!ShapeCollider::shapeShape(&capsuleB, &capsuleA, collisions)) + if (!ShapeCollider::collideShapes(&capsuleB, &capsuleA, collisions)) { std::cout << __FILE__ << ":" << __LINE__ << " ERROR: capsule and capsule should touch" @@ -550,7 +550,7 @@ void ShapeColliderTests::capsuleTouchesCapsule() { { // end to end capsuleB.setPosition((0.99f * totalHalfLength) * yAxis); - if (!ShapeCollider::shapeShape(&capsuleA, &capsuleB, collisions)) + if (!ShapeCollider::collideShapes(&capsuleA, &capsuleB, collisions)) { std::cout << __FILE__ << ":" << __LINE__ << " ERROR: capsule and capsule should touch" @@ -558,7 +558,7 @@ void ShapeColliderTests::capsuleTouchesCapsule() { } else { ++numCollisions; } - if (!ShapeCollider::shapeShape(&capsuleB, &capsuleA, collisions)) + if (!ShapeCollider::collideShapes(&capsuleB, &capsuleA, collisions)) { std::cout << __FILE__ << ":" << __LINE__ << " ERROR: capsule and capsule should touch" @@ -573,7 +573,7 @@ void ShapeColliderTests::capsuleTouchesCapsule() { capsuleB.setRotation(rotation); capsuleB.setPosition((0.99f * (totalRadius + capsuleB.getHalfHeight())) * xAxis); - if (!ShapeCollider::shapeShape(&capsuleA, &capsuleB, collisions)) + if (!ShapeCollider::collideShapes(&capsuleA, &capsuleB, collisions)) { std::cout << __FILE__ << ":" << __LINE__ << " ERROR: capsule and capsule should touch" @@ -581,7 +581,7 @@ void ShapeColliderTests::capsuleTouchesCapsule() { } else { ++numCollisions; } - if (!ShapeCollider::shapeShape(&capsuleB, &capsuleA, collisions)) + if (!ShapeCollider::collideShapes(&capsuleB, &capsuleA, collisions)) { std::cout << __FILE__ << ":" << __LINE__ << " ERROR: capsule and capsule should touch" @@ -599,7 +599,7 @@ void ShapeColliderTests::capsuleTouchesCapsule() { capsuleB.setPosition(positionB); // capsuleA vs capsuleB - if (!ShapeCollider::shapeShape(&capsuleA, &capsuleB, collisions)) + if (!ShapeCollider::collideShapes(&capsuleA, &capsuleB, collisions)) { std::cout << __FILE__ << ":" << __LINE__ << " ERROR: capsule and capsule should touch" @@ -628,7 +628,7 @@ void ShapeColliderTests::capsuleTouchesCapsule() { } // capsuleB vs capsuleA - if (!ShapeCollider::shapeShape(&capsuleB, &capsuleA, collisions)) + if (!ShapeCollider::collideShapes(&capsuleB, &capsuleA, collisions)) { std::cout << __FILE__ << ":" << __LINE__ << " ERROR: capsule and capsule should touch" @@ -666,7 +666,7 @@ void ShapeColliderTests::capsuleTouchesCapsule() { capsuleB.setPosition(positionB); // capsuleA vs capsuleB - if (!ShapeCollider::shapeShape(&capsuleA, &capsuleB, collisions)) + if (!ShapeCollider::collideShapes(&capsuleA, &capsuleB, collisions)) { std::cout << __FILE__ << ":" << __LINE__ << " ERROR: capsule and capsule should touch" From f8e66b4e0d196d306c719a3706b21a99b9e8906b Mon Sep 17 00:00:00 2001 From: Andrew Meadows Date: Wed, 9 Apr 2014 13:05:26 -0700 Subject: [PATCH 072/120] remove cruft --- interface/src/avatar/Avatar.h | 2 -- libraries/script-engine/src/ScriptEngine.h | 1 - 2 files changed, 3 deletions(-) diff --git a/interface/src/avatar/Avatar.h b/interface/src/avatar/Avatar.h index f57982b514..e23ed316ac 100755 --- a/interface/src/avatar/Avatar.h +++ b/interface/src/avatar/Avatar.h @@ -140,8 +140,6 @@ public: static void renderJointConnectingCone(glm::vec3 position1, glm::vec3 position2, float radius1, float radius2); - - /// \return true if we expect the avatar would move as a result of the collision bool collisionWouldMoveAvatar(CollisionInfo& collision) const; diff --git a/libraries/script-engine/src/ScriptEngine.h b/libraries/script-engine/src/ScriptEngine.h index 2b98549d66..99f4e81ea1 100644 --- a/libraries/script-engine/src/ScriptEngine.h +++ b/libraries/script-engine/src/ScriptEngine.h @@ -113,7 +113,6 @@ private: static VoxelsScriptingInterface _voxelsScriptingInterface; static ParticlesScriptingInterface _particlesScriptingInterface; - static int _scriptNumber; AbstractControllerScriptingInterface* _controllerScriptingInterface; AudioScriptingInterface _audioScriptingInterface; From 698e3783e0fb05fb172424c3459f0d1a81bc77a0 Mon Sep 17 00:00:00 2001 From: Andrew Meadows Date: Wed, 9 Apr 2014 13:06:29 -0700 Subject: [PATCH 073/120] fixing formatting --- libraries/script-engine/src/ScriptUUID.cpp | 2 +- libraries/script-engine/src/ScriptUUID.h | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/libraries/script-engine/src/ScriptUUID.cpp b/libraries/script-engine/src/ScriptUUID.cpp index f19ed99417..9e00f9c095 100644 --- a/libraries/script-engine/src/ScriptUUID.cpp +++ b/libraries/script-engine/src/ScriptUUID.cpp @@ -5,7 +5,7 @@ // Created by Andrew Meadows on 2014-04-07 // Copyright (c) 2014 High Fidelity, Inc. All rights reserved. // -// Scriptable interface for a UUID helper class object. Used exclusively in the JavaScript API +// Scriptable interface for a UUID helper class object. Used exclusively in the JavaScript API // // Distributed under the Apache License, Version 2.0. // See the accompanying file LICENSE or http://www.apache.org/licenses/LICENSE-2.0.html diff --git a/libraries/script-engine/src/ScriptUUID.h b/libraries/script-engine/src/ScriptUUID.h index 32ab40a106..db94b5082b 100644 --- a/libraries/script-engine/src/ScriptUUID.h +++ b/libraries/script-engine/src/ScriptUUID.h @@ -5,7 +5,7 @@ // Created by Andrew Meadows on 2014-04-07 // Copyright (c) 2014 High Fidelity, Inc. All rights reserved. // -// Scriptable interface for a UUID helper class object. Used exclusively in the JavaScript API +// Scriptable interface for a UUID helper class object. Used exclusively in the JavaScript API // // Distributed under the Apache License, Version 2.0. // See the accompanying file LICENSE or http://www.apache.org/licenses/LICENSE-2.0.html From 79455d5850936f1483dc7e2532be76311c46ae7b Mon Sep 17 00:00:00 2001 From: Andrzej Kapolka Date: Wed, 9 Apr 2014 13:07:02 -0700 Subject: [PATCH 074/120] More Faceplus work. Starting to get results. --- interface/src/Application.cpp | 4 ++-- interface/src/avatar/Head.cpp | 19 +++++++------------ interface/src/devices/Faceplus.cpp | 12 ++++++------ 3 files changed, 15 insertions(+), 20 deletions(-) diff --git a/interface/src/Application.cpp b/interface/src/Application.cpp index 5c50f76767..dedbbced30 100644 --- a/interface/src/Application.cpp +++ b/interface/src/Application.cpp @@ -1568,9 +1568,9 @@ void Application::init() { qDebug("Loaded settings"); // initialize our face trackers after loading the menu settings - _faceplus.init(); _faceshift.init(); - _visage.init(); + _faceplus.init(); + _visage.init(); // fire off an immediate domain-server check in now that settings are loaded NodeList::getInstance()->sendDomainServerCheckIn(); diff --git a/interface/src/avatar/Head.cpp b/interface/src/avatar/Head.cpp index f42220c0f4..c3cff15c70 100644 --- a/interface/src/avatar/Head.cpp +++ b/interface/src/avatar/Head.cpp @@ -60,17 +60,11 @@ void Head::reset() { void Head::simulate(float deltaTime, bool isMine, bool billboard) { // Update audio trailing average for rendering facial animations - Faceshift* faceshift = Application::getInstance()->getFaceshift(); - Visage* visage = Application::getInstance()->getVisage(); if (isMine) { - _isFaceshiftConnected = false; - if (faceshift->isActive()) { - _blendshapeCoefficients = faceshift->getBlendshapeCoefficients(); - _isFaceshiftConnected = true; - - } else if (visage->isActive()) { - _blendshapeCoefficients = visage->getBlendshapeCoefficients(); - _isFaceshiftConnected = true; + FaceTracker* faceTracker = Application::getInstance()->getActiveFaceTracker(); + if ((_isFaceshiftConnected = faceTracker)) { + _blendshapeCoefficients = faceTracker->getBlendshapeCoefficients(); + _isFaceshiftConnected = true; } } @@ -152,8 +146,9 @@ void Head::simulate(float deltaTime, bool isMine, bool billboard) { const float BROW_LIFT_SCALE = 500.0f; const float JAW_OPEN_SCALE = 0.01f; const float JAW_OPEN_DEAD_ZONE = 0.75f; - faceshift->updateFakeCoefficients(_leftEyeBlink, _rightEyeBlink, min(1.0f, _browAudioLift * BROW_LIFT_SCALE), - glm::clamp(sqrt(_averageLoudness * JAW_OPEN_SCALE) - JAW_OPEN_DEAD_ZONE, 0.0f, 1.0f), _blendshapeCoefficients); + Application::getInstance()->getFaceshift()->updateFakeCoefficients(_leftEyeBlink, _rightEyeBlink, + min(1.0f, _browAudioLift * BROW_LIFT_SCALE), glm::clamp(sqrt(_averageLoudness * JAW_OPEN_SCALE) - + JAW_OPEN_DEAD_ZONE, 0.0f, 1.0f), _blendshapeCoefficients); } if (!isMine) { diff --git a/interface/src/devices/Faceplus.cpp b/interface/src/devices/Faceplus.cpp index ccbc494fe3..9a3067e48f 100644 --- a/interface/src/devices/Faceplus.cpp +++ b/interface/src/devices/Faceplus.cpp @@ -44,8 +44,8 @@ static QMultiHash > createChannelNameMap() { blendshapeMap.insert("...", QPair("Mix::BrowsIn_Right", 1.0f)); blendshapeMap.insert("...", QPair("Mix::BrowsOuterLower_Left", 1.0f)); blendshapeMap.insert("...", QPair("Mix::BrowsOuterLower_Right", 1.0f)); - blendshapeMap.insert("BrowsU_L", QPair("Mix::BrowsUp_Left", 1.0f)); - blendshapeMap.insert("BrowsU_R", QPair("Mix::BrowsUp_Right", 1.0f)); + blendshapeMap.insert("BrowsU_L", QPair("Mix::BrowsUp_Left", 5.0f)); + blendshapeMap.insert("BrowsU_R", QPair("Mix::BrowsUp_Right", 5.0f)); blendshapeMap.insert("EyeOpen_L", QPair("Mix::EyesWide_Left", 1.0f)); blendshapeMap.insert("EyeOpen_R", QPair("Mix::EyesWide_Right", 1.0f)); blendshapeMap.insert("MouthFrown_L", QPair("Mix::Frown_Left", 1.0f)); @@ -102,12 +102,12 @@ void Faceplus::update() { if (!_active) { return; } - if (!(_active = faceplus_current_output_vector(_outputVector.data()))) { + if (!(_active = faceplus_synchronous_track() && faceplus_current_output_vector(_outputVector.data()))) { return; } - _headRotation = glm::quat(glm::radians(_outputVector.at(_headRotationIndices[0]), - _outputVector.at(_headRotationIndices[1]), _outputVector.at(_headRotationIndices[2]))); - _estimatedEyePitch = (_outputVector.at(_leftEyeRotationIndices[0]) + _outputVector.at(_rightEyeRotationIndices[0])) * 0.5f; + _headRotation = glm::quat(glm::radians(glm::vec3(-_outputVector.at(_headRotationIndices[0]), + _outputVector.at(_headRotationIndices[1]), -_outputVector.at(_headRotationIndices[2])))); + _estimatedEyePitch = (_outputVector.at(_leftEyeRotationIndices[0]) + _outputVector.at(_rightEyeRotationIndices[0])) * -0.5f; _estimatedEyeYaw = (_outputVector.at(_leftEyeRotationIndices[1]) + _outputVector.at(_rightEyeRotationIndices[1])) * 0.5f; qFill(_blendshapeCoefficients.begin(), _blendshapeCoefficients.end(), 0.0f); From e480064e6637f012fd3d3d0935ba3374be2246a8 Mon Sep 17 00:00:00 2001 From: Andrew Meadows Date: Wed, 9 Apr 2014 13:07:54 -0700 Subject: [PATCH 075/120] rename more shapeShape() to be collideShapes() --- interface/src/renderer/Model.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/interface/src/renderer/Model.cpp b/interface/src/renderer/Model.cpp index 36fbbe3833..4118c483ec 100644 --- a/interface/src/renderer/Model.cpp +++ b/interface/src/renderer/Model.cpp @@ -592,7 +592,7 @@ bool Model::findCollisions(const QVector shapes, CollisionList& co const Shape* theirShape = shapes[i]; for (int j = 0; j < _jointShapes.size(); ++j) { const Shape* ourShape = _jointShapes[j]; - if (ShapeCollider::shapeShape(theirShape, ourShape, collisions)) { + if (ShapeCollider::collideShapes(theirShape, ourShape, collisions)) { collided = true; } } @@ -619,7 +619,7 @@ bool Model::findSphereCollisions(const glm::vec3& sphereCenter, float sphereRadi } while (ancestorIndex != -1); } } - if (ShapeCollider::shapeShape(&sphere, _jointShapes[i], collisions)) { + if (ShapeCollider::collideShapes(&sphere, _jointShapes[i], collisions)) { CollisionInfo* collision = collisions.getLastCollision(); collision->_type = MODEL_COLLISION; collision->_data = (void*)(this); From a1c6843bd409555ce44b9f1a36fe02508295bffd Mon Sep 17 00:00:00 2001 From: stojce Date: Wed, 9 Apr 2014 22:14:35 +0200 Subject: [PATCH 076/120] CR Fixes --- interface/src/ui/FramelessDialog.cpp | 15 ++++----------- interface/src/ui/FramelessDialog.h | 13 ++++++++----- interface/src/ui/PreferencesDialog.cpp | 8 ++++++-- interface/src/ui/PreferencesDialog.h | 13 ++++++++----- 4 files changed, 26 insertions(+), 23 deletions(-) diff --git a/interface/src/ui/FramelessDialog.cpp b/interface/src/ui/FramelessDialog.cpp index 14f7e57f3b..18e3bca89a 100644 --- a/interface/src/ui/FramelessDialog.cpp +++ b/interface/src/ui/FramelessDialog.cpp @@ -1,9 +1,12 @@ // // FramelessDialog.cpp -// hifi +// interface/src/ui // // Created by Stojce Slavkovski on 2/20/14. +// Copyright 2014 High Fidelity, Inc. // +// Distributed under the Apache License, Version 2.0. +// See the accompanying file LICENSE or http://www.apache.org/licenses/LICENSE-2.0.html // #include "Application.h" @@ -25,20 +28,17 @@ QDialog(parent, flags | Qt::FramelessWindowHint | Qt::WindowStaysOnTopHint) { bool FramelessDialog::eventFilter(QObject* sender, QEvent* event) { switch (event->type()) { case QEvent::Move: - if (sender == parentWidget()) { // move to upper left corner on app move move(parentWidget()->geometry().topLeft()); } break; - case QEvent::Resize: if (sender == parentWidget()) { // keep full app height on resizing the app setFixedHeight(parentWidget()->size().height()); } break; - case QEvent::WindowStateChange: if (parentWidget()->isMinimized()) { setHidden(true); @@ -46,16 +46,13 @@ bool FramelessDialog::eventFilter(QObject* sender, QEvent* event) { setHidden(false); } break; - case QEvent::ApplicationDeactivate: // hide on minimize and focus lost setHidden(true); break; - case QEvent::ApplicationActivate: setHidden(false); break; - default: break; } @@ -63,10 +60,6 @@ bool FramelessDialog::eventFilter(QObject* sender, QEvent* event) { return false; } -FramelessDialog::~FramelessDialog() { - deleteLater(); -} - void FramelessDialog::setStyleSheetFile(const QString& fileName) { QFile globalStyleSheet(Application::resourcesPath() + "styles/global.qss"); QFile styleSheet(Application::resourcesPath() + fileName); diff --git a/interface/src/ui/FramelessDialog.h b/interface/src/ui/FramelessDialog.h index aa83960b8b..db9f6dfd6c 100644 --- a/interface/src/ui/FramelessDialog.h +++ b/interface/src/ui/FramelessDialog.h @@ -1,13 +1,17 @@ // // FramelessDialog.h -// hifi +// interface/src/ui // // Created by Stojce Slavkovski on 2/20/14. +// Copyright 2014 High Fidelity, Inc. // +// 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__FramelessDialog__ -#define __hifi__FramelessDialog__ + +#ifndef hifi_FramelessDialog_h +#define hifi_FramelessDialog_h #include @@ -16,7 +20,6 @@ class FramelessDialog : public QDialog { public: FramelessDialog(QWidget* parent = 0, Qt::WindowFlags flags = 0); - ~FramelessDialog(); void setStyleSheetFile(const QString& fileName); protected: @@ -32,4 +35,4 @@ private: }; -#endif /* defined(__hifi__FramelessDialog__) */ +#endif // hifi_FramelessDialog_h diff --git a/interface/src/ui/PreferencesDialog.cpp b/interface/src/ui/PreferencesDialog.cpp index 96ffe662c7..c6a994b4d5 100644 --- a/interface/src/ui/PreferencesDialog.cpp +++ b/interface/src/ui/PreferencesDialog.cpp @@ -1,11 +1,15 @@ // // PreferencesDialog.cpp -// hifi +// interface/src/ui // -// Created by Stojce Slavkovski on 2/22/14. +// Created by Stojce Slavkovski on 2/20/14. +// Copyright 2014 High Fidelity, Inc. // +// Distributed under the Apache License, Version 2.0. +// See the accompanying file LICENSE or http://www.apache.org/licenses/LICENSE-2.0.html // + #include "Application.h" #include "Menu.h" #include "PreferencesDialog.h" diff --git a/interface/src/ui/PreferencesDialog.h b/interface/src/ui/PreferencesDialog.h index c7f8f43616..25a1e1b6cf 100644 --- a/interface/src/ui/PreferencesDialog.h +++ b/interface/src/ui/PreferencesDialog.h @@ -1,13 +1,16 @@ // // PreferencesDialog.h -// hifi +// interface/src/ui // -// Created by Stojce Slavkovski on 2/22/14. +// Created by Stojce Slavkovski on 2/20/14. +// Copyright 2014 High Fidelity, Inc. // +// 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__PreferencesDialog__ -#define __hifi__PreferencesDialog__ +#ifndef hifi_PreferencesDialog_h +#define hifi_PreferencesDialog_h #include "FramelessDialog.h" #include "ui_preferencesDialog.h" @@ -42,4 +45,4 @@ private slots: }; -#endif /* defined(__hifi__PreferencesDialog__) */ +#endif // hifi_PreferencesDialog_h From 9ab61faacbabbe448ad45735042fc4423b0f3781 Mon Sep 17 00:00:00 2001 From: stojce Date: Wed, 9 Apr 2014 22:32:15 +0200 Subject: [PATCH 077/120] additional CR fixes --- interface/src/ui/PreferencesDialog.cpp | 4 ---- interface/src/ui/PreferencesDialog.h | 1 - 2 files changed, 5 deletions(-) diff --git a/interface/src/ui/PreferencesDialog.cpp b/interface/src/ui/PreferencesDialog.cpp index c6a994b4d5..d1c9b4f6ca 100644 --- a/interface/src/ui/PreferencesDialog.cpp +++ b/interface/src/ui/PreferencesDialog.cpp @@ -30,10 +30,6 @@ PreferencesDialog::PreferencesDialog(QWidget* parent, Qt::WindowFlags flags) : F connect(ui.buttonBrowseBody, &QPushButton::clicked, this, &PreferencesDialog::openBodyModelBrowser); } -PreferencesDialog::~PreferencesDialog() { - deleteLater(); -} - void PreferencesDialog::accept() { savePreferences(); close(); diff --git a/interface/src/ui/PreferencesDialog.h b/interface/src/ui/PreferencesDialog.h index 25a1e1b6cf..c9514e584a 100644 --- a/interface/src/ui/PreferencesDialog.h +++ b/interface/src/ui/PreferencesDialog.h @@ -22,7 +22,6 @@ class PreferencesDialog : public FramelessDialog { public: PreferencesDialog(QWidget* parent = 0, Qt::WindowFlags flags = 0); - ~PreferencesDialog(); protected: void resizeEvent(QResizeEvent* resizeEvent); From 7578b282e296c2e79d654dba5c384f2e764483d8 Mon Sep 17 00:00:00 2001 From: Atlante45 Date: Wed, 9 Apr 2014 14:12:11 -0700 Subject: [PATCH 078/120] CR --- interface/src/ModelUploader.cpp | 1 - 1 file changed, 1 deletion(-) diff --git a/interface/src/ModelUploader.cpp b/interface/src/ModelUploader.cpp index 93a2c96c7c..3f496c9890 100644 --- a/interface/src/ModelUploader.cpp +++ b/interface/src/ModelUploader.cpp @@ -306,7 +306,6 @@ bool ModelUploader::addTextures(const QString& texdir, const QString fbxFile) { } bool ModelUploader::addPart(const QString &path, const QString& name) { - qDebug() << path; QFile file(path); if (!file.open(QIODevice::ReadOnly)) { QMessageBox::warning(NULL, From 034f518d40c59bb1b2a7ca22f0b6c3bcbe455101 Mon Sep 17 00:00:00 2001 From: Andrew Meadows Date: Wed, 9 Apr 2014 14:15:45 -0700 Subject: [PATCH 079/120] emit signal on avatar body-body collisions --- interface/src/avatar/MyAvatar.cpp | 29 +++++++++++------------------ interface/src/avatar/MyAvatar.h | 3 +++ 2 files changed, 14 insertions(+), 18 deletions(-) diff --git a/interface/src/avatar/MyAvatar.cpp b/interface/src/avatar/MyAvatar.cpp index 73d2a84eb7..ebcba72f7e 100644 --- a/interface/src/avatar/MyAvatar.cpp +++ b/interface/src/avatar/MyAvatar.cpp @@ -20,6 +20,7 @@ #include #include #include +#include #include @@ -868,8 +869,7 @@ bool findAvatarAvatarPenetration(const glm::vec3 positionA, float radiusA, float return false; } -static CollisionList bodyCollisions(16); -const float BODY_COLLISION_RESOLVE_TIMESCALE = 0.5f; // seconds +const float BODY_COLLISION_RESOLUTION_TIMESCALE = 0.5f; // seconds void MyAvatar::updateCollisionWithAvatars(float deltaTime) { // Reset detector for nearest avatar @@ -882,7 +882,7 @@ void MyAvatar::updateCollisionWithAvatars(float deltaTime) { updateShapePositions(); float myBoundingRadius = getBoundingRadius(); - const float BODY_COLLISION_RESOLVE_FACTOR = deltaTime / BODY_COLLISION_RESOLVE_TIMESCALE; + const float BODY_COLLISION_RESOLUTION_FACTOR = deltaTime / BODY_COLLISION_RESOLUTION_TIMESCALE; foreach (const AvatarSharedPointer& avatarPointer, avatars) { Avatar* avatar = static_cast(avatarPointer.data()); @@ -902,26 +902,19 @@ void MyAvatar::updateCollisionWithAvatars(float deltaTime) { _skeletonModel.getBodyShapes(myShapes); QVector theirShapes; avatar->getSkeletonModel().getBodyShapes(theirShapes); - bodyCollisions.clear(); - // TODO: add method to ShapeCollider for colliding lists of shapes - foreach (const Shape* myShape, myShapes) { - foreach (const Shape* theirShape, theirShapes) { - ShapeCollider::shapeShape(myShape, theirShape, bodyCollisions); + + CollisionInfo collision; + if (ShapeCollider::collideShapesCoarse(myShapes, theirShapes, collision)) { + if (glm::length2(collision._penetration) > EPSILON) { + setPosition(getPosition() - BODY_COLLISION_RESOLUTION_FACTOR * collision._penetration); + _lastBodyPenetration += collision._penetration; + emit collisionWithAvatar(getSessionUUID(), avatar->getSessionUUID(), collision); } } - glm::vec3 totalPenetration(0.f); - for (int j = 0; j < bodyCollisions.size(); ++j) { - CollisionInfo* collision = bodyCollisions.getCollision(j); - totalPenetration = addPenetrations(totalPenetration, collision->_penetration); - } - if (glm::length2(totalPenetration) > EPSILON) { - setPosition(getPosition() - BODY_COLLISION_RESOLVE_FACTOR * totalPenetration); - } - _lastBodyPenetration += totalPenetration; // collide our hands against them // TODO: make this work when we can figure out when the other avatar won't yeild - // (for example, we're colling against their chest or leg) + // (for example, we're colliding against their chest or leg) //getHand()->collideAgainstAvatar(avatar, true); // collide their hands against us diff --git a/interface/src/avatar/MyAvatar.h b/interface/src/avatar/MyAvatar.h index 2125b126b3..08e1054829 100644 --- a/interface/src/avatar/MyAvatar.h +++ b/interface/src/avatar/MyAvatar.h @@ -104,6 +104,9 @@ public slots: glm::vec3 getThrust() { return _thrust; }; void setThrust(glm::vec3 newThrust) { _thrust = newThrust; } +signals: + void collisionWithAvatar(const QUuid&, const QUuid&, const CollisionInfo&); + private: bool _mousePressed; float _bodyPitchDelta; // degrees From 07b343ec03fe4c8ca2565fa58cb422f61acc91d7 Mon Sep 17 00:00:00 2001 From: Andrew Meadows Date: Wed, 9 Apr 2014 14:32:57 -0700 Subject: [PATCH 080/120] emit events for hand-avatar collisions --- interface/src/avatar/Avatar.h | 3 +++ interface/src/avatar/Hand.cpp | 5 +++++ interface/src/avatar/MyAvatar.h | 3 --- 3 files changed, 8 insertions(+), 3 deletions(-) diff --git a/interface/src/avatar/Avatar.h b/interface/src/avatar/Avatar.h index e23ed316ac..32700d5d99 100755 --- a/interface/src/avatar/Avatar.h +++ b/interface/src/avatar/Avatar.h @@ -152,6 +152,9 @@ public: public slots: void updateCollisionFlags(); +signals: + void collisionWithAvatar(const QUuid&, const QUuid&, const CollisionInfo&); + protected: SkeletonModel _skeletonModel; float _bodyYawDelta; diff --git a/interface/src/avatar/Hand.cpp b/interface/src/avatar/Hand.cpp index fc47520c83..e50c73d573 100644 --- a/interface/src/avatar/Hand.cpp +++ b/interface/src/avatar/Hand.cpp @@ -159,6 +159,11 @@ void Hand::collideAgainstAvatar(Avatar* avatar, bool isMyHand) { // TODO: submit collision info to MyAvatar which should lean accordingly averageContactPoint /= (float)handCollisions.size(); avatar->applyCollision(averageContactPoint, totalPenetration); + + CollisionInfo collision; + collision._penetration = totalPenetration; + collision._contactPoint = averageContactPoint; + emit avatar->collisionWithAvatar(avatar->getSessionUUID(), _owningAvatar->getSessionUUID(), collision); } } } diff --git a/interface/src/avatar/MyAvatar.h b/interface/src/avatar/MyAvatar.h index 08e1054829..2125b126b3 100644 --- a/interface/src/avatar/MyAvatar.h +++ b/interface/src/avatar/MyAvatar.h @@ -104,9 +104,6 @@ public slots: glm::vec3 getThrust() { return _thrust; }; void setThrust(glm::vec3 newThrust) { _thrust = newThrust; } -signals: - void collisionWithAvatar(const QUuid&, const QUuid&, const CollisionInfo&); - private: bool _mousePressed; float _bodyPitchDelta; // degrees From 5d812c8cb221253e160f1664609e05dfb9db129f Mon Sep 17 00:00:00 2001 From: Thijs Wenker Date: Wed, 9 Apr 2014 23:44:40 +0200 Subject: [PATCH 081/120] Fixed loading local stored scripts on Windows machines --- libraries/script-engine/src/ScriptEngine.cpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/libraries/script-engine/src/ScriptEngine.cpp b/libraries/script-engine/src/ScriptEngine.cpp index 7d3dd650ae..c5c1fdb2bf 100644 --- a/libraries/script-engine/src/ScriptEngine.cpp +++ b/libraries/script-engine/src/ScriptEngine.cpp @@ -92,8 +92,9 @@ ScriptEngine::ScriptEngine(const QUrl& scriptURL, QUrl url(scriptURL); - // if the scheme is empty, maybe they typed in a file, let's try - if (url.scheme().isEmpty()) { + // if the scheme length is one or lower, maybe they typed in a file, let's try + const DWORD WINDOWS_DRIVE_LETTER_SIZE = 1; + if (url.scheme().size() <= WINDOWS_DRIVE_LETTER_SIZE) { url = QUrl::fromLocalFile(scriptURLString); } From 7dec499b79467966e59f15fae08a56f62478f09a Mon Sep 17 00:00:00 2001 From: Stephen Birarda Date: Wed, 9 Apr 2014 14:52:01 -0700 Subject: [PATCH 082/120] fix accidental changes to Audio.cpp --- interface/src/Audio.cpp | 69 +++++++++++++++++++++++++++-------------- 1 file changed, 45 insertions(+), 24 deletions(-) diff --git a/interface/src/Audio.cpp b/interface/src/Audio.cpp index 90797c7eef..108a785e95 100644 --- a/interface/src/Audio.cpp +++ b/interface/src/Audio.cpp @@ -98,7 +98,8 @@ Audio::Audio(Oscilloscope* scope, int16_t initialJitterBufferSamples, QObject* p void Audio::init(QGLWidget *parent) { _micTextureId = parent->bindTexture(QImage(Application::resourcesPath() + "images/mic.svg")); - _muteTextureId = parent->bindTexture(QImage(Application::resourcesPath() + "images/mute.svg")); + _muteTextureId = parent->bindTexture(QImage(Application::resourcesPath() + "images/mic-mute.svg")); + _boxTextureId = parent->bindTexture(QImage(Application::resourcesPath() + "images/audio-box.svg")); } void Audio::reset() { @@ -861,13 +862,52 @@ void Audio::handleAudioByteArray(const QByteArray& audioByteArray) { // or send to the mixer and use delayed loopback } -void Audio::renderMuteIcon(int x, int y) { +void Audio::renderToolBox(int x, int y, bool boxed) { - _iconBounds = QRect(x, y, MUTE_ICON_SIZE, MUTE_ICON_SIZE); glEnable(GL_TEXTURE_2D); - glBindTexture(GL_TEXTURE_2D, _micTextureId); - glColor3f(.93f, .93f, .93f); + if (boxed) { + + bool isClipping = ((getTimeSinceLastClip() > 0.f) && (getTimeSinceLastClip() < 1.f)); + const int BOX_LEFT_PADDING = 5; + const int BOX_TOP_PADDING = 10; + const int BOX_WIDTH = 266; + const int BOX_HEIGHT = 44; + + QRect boxBounds = QRect(x - BOX_LEFT_PADDING, y - BOX_TOP_PADDING, BOX_WIDTH, BOX_HEIGHT); + + glBindTexture(GL_TEXTURE_2D, _boxTextureId); + + if (isClipping) { + glColor3f(1.f,0.f,0.f); + } else { + glColor3f(.41f,.41f,.41f); + } + glBegin(GL_QUADS); + + glTexCoord2f(1, 1); + glVertex2f(boxBounds.left(), boxBounds.top()); + + glTexCoord2f(0, 1); + glVertex2f(boxBounds.right(), boxBounds.top()); + + glTexCoord2f(0, 0); + glVertex2f(boxBounds.right(), boxBounds.bottom()); + + glTexCoord2f(1, 0); + glVertex2f(boxBounds.left(), boxBounds.bottom()); + + glEnd(); + } + + _iconBounds = QRect(x, y, MUTE_ICON_SIZE, MUTE_ICON_SIZE); + if (!_muted) { + glBindTexture(GL_TEXTURE_2D, _micTextureId); + } else { + glBindTexture(GL_TEXTURE_2D, _muteTextureId); + } + + glColor3f(1,1,1); glBegin(GL_QUADS); glTexCoord2f(1, 1); @@ -884,25 +924,6 @@ void Audio::renderMuteIcon(int x, int y) { glEnd(); - if (_muted) { - glBindTexture(GL_TEXTURE_2D, _muteTextureId); - glBegin(GL_QUADS); - - glTexCoord2f(1, 1); - glVertex2f(_iconBounds.left(), _iconBounds.top()); - - glTexCoord2f(0, 1); - glVertex2f(_iconBounds.right(), _iconBounds.top()); - - glTexCoord2f(0, 0); - glVertex2f(_iconBounds.right(), _iconBounds.bottom()); - - glTexCoord2f(1, 0); - glVertex2f(_iconBounds.left(), _iconBounds.bottom()); - - glEnd(); - } - glDisable(GL_TEXTURE_2D); } From 28d3eae12b08eed5655a3419d3eace5036d068da Mon Sep 17 00:00:00 2001 From: Andrzej Kapolka Date: Wed, 9 Apr 2014 14:52:27 -0700 Subject: [PATCH 083/120] Move Faceplus reading to its own thread to avoid blocking the main one. --- interface/src/Application.cpp | 11 -- interface/src/Application.h | 1 - interface/src/devices/Faceplus.cpp | 173 ++++++++++++++++++----------- interface/src/devices/Faceplus.h | 24 +++- 4 files changed, 127 insertions(+), 82 deletions(-) diff --git a/interface/src/Application.cpp b/interface/src/Application.cpp index dedbbced30..6e05167d6f 100644 --- a/interface/src/Application.cpp +++ b/interface/src/Application.cpp @@ -1689,15 +1689,6 @@ void Application::updateMouseRay() { _myAvatar->setMouseRay(_mouseRayOrigin, _mouseRayDirection); } -void Application::updateFaceplus() { - - bool showWarnings = Menu::getInstance()->isOptionChecked(MenuOption::PipelineWarnings); - PerformanceWarning warn(showWarnings, "Application::updateFaceplus()"); - - // Update faceplus - _faceplus.update(); -} - void Application::updateFaceshift() { bool showWarnings = Menu::getInstance()->isOptionChecked(MenuOption::PipelineWarnings); @@ -1894,7 +1885,6 @@ void Application::update(float deltaTime) { // check what's under the mouse and update the mouse voxel updateMouseRay(); - updateFaceplus(); updateFaceshift(); updateVisage(); _myAvatar->updateLookAtTargetAvatar(); @@ -2945,7 +2935,6 @@ void Application::resetSensors() { _mouseX = _glWidget->width() / 2; _mouseY = _glWidget->height() / 2; - _faceplus.reset(); _faceshift.reset(); _visage.reset(); diff --git a/interface/src/Application.h b/interface/src/Application.h index c6b38b1644..7182010050 100644 --- a/interface/src/Application.h +++ b/interface/src/Application.h @@ -174,7 +174,6 @@ public: bool isMouseHidden() const { return _mouseHidden; } const glm::vec3& getMouseRayOrigin() const { return _mouseRayOrigin; } const glm::vec3& getMouseRayDirection() const { return _mouseRayDirection; } - Faceplus* getFaceplus() { return &_faceplus; } Faceshift* getFaceshift() { return &_faceshift; } Visage* getVisage() { return &_visage; } FaceTracker* getActiveFaceTracker(); diff --git a/interface/src/devices/Faceplus.cpp b/interface/src/devices/Faceplus.cpp index 9a3067e48f..34547c2a6a 100644 --- a/interface/src/devices/Faceplus.cpp +++ b/interface/src/devices/Faceplus.cpp @@ -6,6 +6,8 @@ // Copyright (c) 2014 High Fidelity, Inc. All rights reserved. // +#include + #ifdef HAVE_FACEPLUS #include #endif @@ -33,6 +35,41 @@ void Faceplus::init() { updateEnabled(); } +void Faceplus::setState(const glm::quat& headRotation, float estimatedEyePitch, float estimatedEyeYaw, + const QVector& blendshapeCoefficients) { + _headRotation = headRotation; + _estimatedEyePitch = estimatedEyePitch; + _estimatedEyeYaw = estimatedEyeYaw; + _blendshapeCoefficients = blendshapeCoefficients; + _active = true; +} + +void Faceplus::updateEnabled() { + setEnabled(Menu::getInstance()->isOptionChecked(MenuOption::Faceplus) && + !(Menu::getInstance()->isOptionChecked(MenuOption::Faceshift) && + Application::getInstance()->getFaceshift()->isConnectedOrConnecting())); +} + +void Faceplus::setEnabled(bool enabled) { + if (_enabled == enabled) { + return; + } + if ((_enabled = enabled)) { + _reader = new FaceplusReader(); + QThread* readerThread = new QThread(this); + _reader->moveToThread(readerThread); + readerThread->start(); + QMetaObject::invokeMethod(_reader, "init"); + + } else { + QThread* readerThread = _reader->thread(); + QMetaObject::invokeMethod(_reader, "shutdown"); + readerThread->wait(); + delete readerThread; + _active = false; + } +} + #ifdef HAVE_FACEPLUS static QMultiHash > createChannelNameMap() { QMultiHash > blendshapeMap; @@ -97,18 +134,76 @@ static const QMultiHash >& getChannelNameMap() { } #endif -void Faceplus::update() { +void FaceplusReader::init() { #ifdef HAVE_FACEPLUS - if (!_active) { + if (!faceplus_init("VGA")) { + qDebug() << "Failed to initialized Faceplus."; return; } - if (!(_active = faceplus_synchronous_track() && faceplus_current_output_vector(_outputVector.data()))) { + qDebug() << "Faceplus initialized."; + + int channelCount = faceplus_output_channels_count(); + _outputVector.resize(channelCount); + + int maxIndex = -1; + _channelIndexMap.clear(); + for (int i = 0; i < channelCount; i++) { + QByteArray name = faceplus_output_channel_name(i); + if (name == "Head_Joint::Rotation_X") { + _headRotationIndices[0] = i; + + } else if (name == "Head_Joint::Rotation_Y") { + _headRotationIndices[1] = i; + + } else if (name == "Head_Joint::Rotation_Z") { + _headRotationIndices[2] = i; + + } else if (name == "Left_Eye_Joint::Rotation_X") { + _leftEyeRotationIndices[0] = i; + + } else if (name == "Left_Eye_Joint::Rotation_Y") { + _leftEyeRotationIndices[1] = i; + + } else if (name == "Right_Eye_Joint::Rotation_X") { + _rightEyeRotationIndices[0] = i; + + } else if (name == "Right_Eye_Joint::Rotation_Y") { + _rightEyeRotationIndices[1] = i; + } + for (QMultiHash >::const_iterator it = getChannelNameMap().constFind(name); + it != getChannelNameMap().constEnd() && it.key() == name; it++) { + _channelIndexMap.insert(i, it.value()); + maxIndex = qMax(maxIndex, it.value().first); + } + } + _blendshapeCoefficients.resize(maxIndex + 1); + + QMetaObject::invokeMethod(this, "update", Qt::QueuedConnection); +#endif +} + +void FaceplusReader::shutdown() { +#ifdef HAVE_FACEPLUS + if (faceplus_teardown()) { + qDebug() << "Faceplus torn down."; + } +#endif + deleteLater(); + thread()->quit(); +} + +void FaceplusReader::update() { +#ifdef HAVE_FACEPLUS + if (!(faceplus_synchronous_track() && faceplus_current_output_vector(_outputVector.data()))) { + QMetaObject::invokeMethod(this, "update", Qt::QueuedConnection); return; } - _headRotation = glm::quat(glm::radians(glm::vec3(-_outputVector.at(_headRotationIndices[0]), + glm::quat headRotation(glm::radians(glm::vec3(-_outputVector.at(_headRotationIndices[0]), _outputVector.at(_headRotationIndices[1]), -_outputVector.at(_headRotationIndices[2])))); - _estimatedEyePitch = (_outputVector.at(_leftEyeRotationIndices[0]) + _outputVector.at(_rightEyeRotationIndices[0])) * -0.5f; - _estimatedEyeYaw = (_outputVector.at(_leftEyeRotationIndices[1]) + _outputVector.at(_rightEyeRotationIndices[1])) * 0.5f; + float estimatedEyePitch = (_outputVector.at(_leftEyeRotationIndices[0]) + + _outputVector.at(_rightEyeRotationIndices[0])) * -0.5f; + float estimatedEyeYaw = (_outputVector.at(_leftEyeRotationIndices[1]) + + _outputVector.at(_rightEyeRotationIndices[1])) * 0.5f; qFill(_blendshapeCoefficients.begin(), _blendshapeCoefficients.end(), 0.0f); for (int i = 0; i < _outputVector.size(); i++) { @@ -117,67 +212,11 @@ void Faceplus::update() { _blendshapeCoefficients[it.value().first] += _outputVector.at(i) * it.value().second; } } + + QMetaObject::invokeMethod(Application::getInstance()->getFaceplus(), "setState", Q_ARG(const glm::quat&, headRotation), + Q_ARG(float, estimatedEyePitch), Q_ARG(float, estimatedEyeYaw), Q_ARG(const QVector&, _blendshapeCoefficients)); + + QMetaObject::invokeMethod(this, "update", Qt::QueuedConnection); #endif } -void Faceplus::reset() { -} - -void Faceplus::updateEnabled() { - setEnabled(Menu::getInstance()->isOptionChecked(MenuOption::Faceplus) && - !(Menu::getInstance()->isOptionChecked(MenuOption::Faceshift) && - Application::getInstance()->getFaceshift()->isConnectedOrConnecting())); -} - -void Faceplus::setEnabled(bool enabled) { -#ifdef HAVE_FACEPLUS - if (_enabled == enabled) { - return; - } - if ((_enabled = enabled)) { - if (faceplus_init("VGA")) { - qDebug() << "Faceplus initialized."; - _active = true; - - int channelCount = faceplus_output_channels_count(); - _outputVector.resize(channelCount); - - int maxIndex = -1; - _channelIndexMap.clear(); - for (int i = 0; i < channelCount; i++) { - QByteArray name = faceplus_output_channel_name(i); - if (name == "Head_Joint::Rotation_X") { - _headRotationIndices[0] = i; - - } else if (name == "Head_Joint::Rotation_Y") { - _headRotationIndices[1] = i; - - } else if (name == "Head_Joint::Rotation_Z") { - _headRotationIndices[2] = i; - - } else if (name == "Left_Eye_Joint::Rotation_X") { - _leftEyeRotationIndices[0] = i; - - } else if (name == "Left_Eye_Joint::Rotation_Y") { - _leftEyeRotationIndices[1] = i; - - } else if (name == "Right_Eye_Joint::Rotation_X") { - _rightEyeRotationIndices[0] = i; - - } else if (name == "Right_Eye_Joint::Rotation_Y") { - _rightEyeRotationIndices[1] = i; - } - for (QMultiHash >::const_iterator it = getChannelNameMap().constFind(name); - it != getChannelNameMap().constEnd() && it.key() == name; it++) { - _channelIndexMap.insert(i, it.value()); - maxIndex = qMax(maxIndex, it.value().first); - } - } - _blendshapeCoefficients.resize(maxIndex + 1); - } - } else if (faceplus_teardown()) { - qDebug() << "Faceplus torn down."; - _active = false; - } -#endif -} diff --git a/interface/src/devices/Faceplus.h b/interface/src/devices/Faceplus.h index 164cf4d031..5c5f26e64d 100644 --- a/interface/src/devices/Faceplus.h +++ b/interface/src/devices/Faceplus.h @@ -15,6 +15,8 @@ #include "FaceTracker.h" +class FaceplusReader; + /// Interface for Mixamo FacePlus. class Faceplus : public FaceTracker { Q_OBJECT @@ -28,9 +30,9 @@ public: bool isActive() const { return _active; } - void update(); - void reset(); - + Q_INVOKABLE void setState(const glm::quat& headRotation, float estimatedEyePitch, float estimatedEyeYaw, + const QVector& blendshapeCoefficients); + public slots: void updateEnabled(); @@ -42,12 +44,28 @@ private: bool _enabled; bool _active; + FaceplusReader* _reader; +}; + +/// The reader object that lives in its own thread. +class FaceplusReader : public QObject { + Q_OBJECT + +public: + + Q_INVOKABLE void init(); + Q_INVOKABLE void shutdown(); + Q_INVOKABLE void update(); + +private: + #ifdef HAVE_FACEPLUS QMultiHash > _channelIndexMap; QVector _outputVector; int _headRotationIndices[3]; int _leftEyeRotationIndices[2]; int _rightEyeRotationIndices[2]; + QVector _blendshapeIndices; #endif }; From 11d8d0596a62a403daae132820fb6ebe61941b29 Mon Sep 17 00:00:00 2001 From: Stephen Birarda Date: Wed, 9 Apr 2014 15:15:43 -0700 Subject: [PATCH 084/120] fix ModelUploader header after move --- interface/src/ModelUploader.cpp | 2 +- interface/src/ModelUploader.h | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/interface/src/ModelUploader.cpp b/interface/src/ModelUploader.cpp index 9a0c305bf7..9c4755e388 100644 --- a/interface/src/ModelUploader.cpp +++ b/interface/src/ModelUploader.cpp @@ -1,6 +1,6 @@ // // ModelUploader.cpp -// libraries/shared/src +// interface/src // // Created by Clément Brisset on 3/4/14. // Copyright 2014 High Fidelity, Inc. diff --git a/interface/src/ModelUploader.h b/interface/src/ModelUploader.h index bec75903af..ff22673cdd 100644 --- a/interface/src/ModelUploader.h +++ b/interface/src/ModelUploader.h @@ -1,6 +1,6 @@ // // ModelUploader.h -// libraries/shared/src +// interface/src // // Created by Clément Brisset on 3/4/14. // Copyright 2014 High Fidelity, Inc. From cbfaf9709efc948f591611e5e14112f0dc6448ce Mon Sep 17 00:00:00 2001 From: Andrzej Kapolka Date: Wed, 9 Apr 2014 15:18:22 -0700 Subject: [PATCH 085/120] Faceplus fixes. --- interface/src/Application.h | 1 + interface/src/devices/Faceplus.cpp | 19 ++++++++++++------- interface/src/devices/Faceplus.h | 6 +++++- 3 files changed, 18 insertions(+), 8 deletions(-) diff --git a/interface/src/Application.h b/interface/src/Application.h index 7182010050..d76bd38c5f 100644 --- a/interface/src/Application.h +++ b/interface/src/Application.h @@ -174,6 +174,7 @@ public: bool isMouseHidden() const { return _mouseHidden; } const glm::vec3& getMouseRayOrigin() const { return _mouseRayOrigin; } const glm::vec3& getMouseRayDirection() const { return _mouseRayDirection; } + Faceplus* getFaceplus() { return &_faceplus; } Faceshift* getFaceshift() { return &_faceshift; } Visage* getVisage() { return &_visage; } FaceTracker* getActiveFaceTracker(); diff --git a/interface/src/devices/Faceplus.cpp b/interface/src/devices/Faceplus.cpp index 34547c2a6a..62f39d3b91 100644 --- a/interface/src/devices/Faceplus.cpp +++ b/interface/src/devices/Faceplus.cpp @@ -16,6 +16,8 @@ #include "Faceplus.h" #include "renderer/FBXReader.h" +static int floatVectorMetaTypeId = qRegisterMetaType >(); + Faceplus::Faceplus() : _enabled(false), _active(false) { @@ -81,8 +83,8 @@ static QMultiHash > createChannelNameMap() { blendshapeMap.insert("...", QPair("Mix::BrowsIn_Right", 1.0f)); blendshapeMap.insert("...", QPair("Mix::BrowsOuterLower_Left", 1.0f)); blendshapeMap.insert("...", QPair("Mix::BrowsOuterLower_Right", 1.0f)); - blendshapeMap.insert("BrowsU_L", QPair("Mix::BrowsUp_Left", 5.0f)); - blendshapeMap.insert("BrowsU_R", QPair("Mix::BrowsUp_Right", 5.0f)); + blendshapeMap.insert("BrowsU_L", QPair("Mix::BrowsUp_Left", 10.0f)); + blendshapeMap.insert("BrowsU_R", QPair("Mix::BrowsUp_Right", 10.0f)); blendshapeMap.insert("EyeOpen_L", QPair("Mix::EyesWide_Left", 1.0f)); blendshapeMap.insert("EyeOpen_R", QPair("Mix::EyesWide_Right", 1.0f)); blendshapeMap.insert("MouthFrown_L", QPair("Mix::Frown_Left", 1.0f)); @@ -134,6 +136,14 @@ static const QMultiHash >& getChannelNameMap() { } #endif +FaceplusReader::~FaceplusReader() { +#ifdef HAVE_FACEPLUS + if (faceplus_teardown()) { + qDebug() << "Faceplus torn down."; + } +#endif +} + void FaceplusReader::init() { #ifdef HAVE_FACEPLUS if (!faceplus_init("VGA")) { @@ -183,11 +193,6 @@ void FaceplusReader::init() { } void FaceplusReader::shutdown() { -#ifdef HAVE_FACEPLUS - if (faceplus_teardown()) { - qDebug() << "Faceplus torn down."; - } -#endif deleteLater(); thread()->quit(); } diff --git a/interface/src/devices/Faceplus.h b/interface/src/devices/Faceplus.h index 5c5f26e64d..f90c3449bf 100644 --- a/interface/src/devices/Faceplus.h +++ b/interface/src/devices/Faceplus.h @@ -47,12 +47,16 @@ private: FaceplusReader* _reader; }; +Q_DECLARE_METATYPE(QVector) + /// The reader object that lives in its own thread. class FaceplusReader : public QObject { Q_OBJECT public: + virtual ~FaceplusReader(); + Q_INVOKABLE void init(); Q_INVOKABLE void shutdown(); Q_INVOKABLE void update(); @@ -65,7 +69,7 @@ private: int _headRotationIndices[3]; int _leftEyeRotationIndices[2]; int _rightEyeRotationIndices[2]; - QVector _blendshapeIndices; + QVector _blendshapeCoefficients; #endif }; From ead05c4d992481693daa49957bc83abd8eab214e Mon Sep 17 00:00:00 2001 From: Andrzej Kapolka Date: Wed, 9 Apr 2014 15:22:53 -0700 Subject: [PATCH 086/120] Tab fixes. --- interface/src/Application.cpp | 2 +- interface/src/Application.h | 2 +- interface/src/devices/Faceplus.h | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/interface/src/Application.cpp b/interface/src/Application.cpp index 6e05167d6f..0d0ec96ce5 100644 --- a/interface/src/Application.cpp +++ b/interface/src/Application.cpp @@ -1570,7 +1570,7 @@ void Application::init() { // initialize our face trackers after loading the menu settings _faceshift.init(); _faceplus.init(); - _visage.init(); + _visage.init(); // fire off an immediate domain-server check in now that settings are loaded NodeList::getInstance()->sendDomainServerCheckIn(); diff --git a/interface/src/Application.h b/interface/src/Application.h index d76bd38c5f..c6b38b1644 100644 --- a/interface/src/Application.h +++ b/interface/src/Application.h @@ -174,7 +174,7 @@ public: bool isMouseHidden() const { return _mouseHidden; } const glm::vec3& getMouseRayOrigin() const { return _mouseRayOrigin; } const glm::vec3& getMouseRayDirection() const { return _mouseRayDirection; } - Faceplus* getFaceplus() { return &_faceplus; } + Faceplus* getFaceplus() { return &_faceplus; } Faceshift* getFaceshift() { return &_faceshift; } Visage* getVisage() { return &_visage; } FaceTracker* getActiveFaceTracker(); diff --git a/interface/src/devices/Faceplus.h b/interface/src/devices/Faceplus.h index f90c3449bf..6cfdac2640 100644 --- a/interface/src/devices/Faceplus.h +++ b/interface/src/devices/Faceplus.h @@ -55,7 +55,7 @@ class FaceplusReader : public QObject { public: - virtual ~FaceplusReader(); + virtual ~FaceplusReader(); Q_INVOKABLE void init(); Q_INVOKABLE void shutdown(); From 3a93096093c2a706860b37b4bf24272af1310a1c Mon Sep 17 00:00:00 2001 From: Andrew Meadows Date: Wed, 9 Apr 2014 15:31:26 -0700 Subject: [PATCH 087/120] fixing floats to be *.0f instead of *.f --- interface/src/avatar/MyAvatar.cpp | 152 +++++++++++++++--------------- 1 file changed, 76 insertions(+), 76 deletions(-) diff --git a/interface/src/avatar/MyAvatar.cpp b/interface/src/avatar/MyAvatar.cpp index 99fe020cb6..65a958dfb9 100644 --- a/interface/src/avatar/MyAvatar.cpp +++ b/interface/src/avatar/MyAvatar.cpp @@ -63,7 +63,7 @@ MyAvatar::MyAvatar() : _lookAtTargetAvatar(), _shouldRender(true), _billboardValid(false), - _oculusYawOffset(0.f) + _oculusYawOffset(0.0f) { for (int i = 0; i < MAX_DRIVE_KEYS; i++) { _driveKeys[i] = 0.0f; @@ -86,11 +86,11 @@ void MyAvatar::reset() { _skeletonModel.reset(); getHead()->reset(); getHand()->reset(); - _oculusYawOffset = 0.f; + _oculusYawOffset = 0.0f; - setVelocity(glm::vec3(0.f)); - setThrust(glm::vec3(0.f)); - setOrientation(glm::quat(glm::vec3(0.f))); + setVelocity(glm::vec3(0.0f)); + setThrust(glm::vec3(0.0f)); + setOrientation(glm::quat(glm::vec3(0.0f))); } void MyAvatar::setMoveTarget(const glm::vec3 moveTarget) { @@ -113,8 +113,8 @@ void MyAvatar::update(float deltaTime) { // TODO? resurrect headMouse stuff? //glm::vec3 headVelocity = faceshift->getHeadAngularVelocity(); //// sets how quickly head angular rotation moves the head mouse - //const float HEADMOUSE_FACESHIFT_YAW_SCALE = 40.f; - //const float HEADMOUSE_FACESHIFT_PITCH_SCALE = 30.f; + //const float HEADMOUSE_FACESHIFT_YAW_SCALE = 40.0f; + //const float HEADMOUSE_FACESHIFT_PITCH_SCALE = 30.0f; //_headMouseX -= headVelocity.y * HEADMOUSE_FACESHIFT_YAW_SCALE; //_headMouseY -= headVelocity.x * HEADMOUSE_FACESHIFT_PITCH_SCALE; // @@ -145,15 +145,15 @@ void MyAvatar::simulate(float deltaTime) { _elapsedTimeSinceCollision += deltaTime; const float VELOCITY_MOVEMENT_TIMER_THRESHOLD = 0.2f; if (glm::length(_velocity) < VELOCITY_MOVEMENT_TIMER_THRESHOLD) { - _elapsedTimeMoving = 0.f; + _elapsedTimeMoving = 0.0f; _elapsedTimeStopped += deltaTime; } else { - _elapsedTimeStopped = 0.f; + _elapsedTimeStopped = 0.0f; _elapsedTimeMoving += deltaTime; } if (_scale != _targetScale) { - float scale = (1.f - SMOOTHING_RATIO) * _scale + SMOOTHING_RATIO * _targetScale; + float scale = (1.0f - SMOOTHING_RATIO) * _scale + SMOOTHING_RATIO * _targetScale; setScale(scale); Application::getInstance()->getCamera()->setScale(scale); } @@ -181,19 +181,19 @@ void MyAvatar::simulate(float deltaTime) { // decay body rotation momentum const float BODY_SPIN_FRICTION = 7.5f; - float bodySpinMomentum = 1.f - BODY_SPIN_FRICTION * deltaTime; + float bodySpinMomentum = 1.0f - BODY_SPIN_FRICTION * deltaTime; if (bodySpinMomentum < 0.0f) { bodySpinMomentum = 0.0f; } _bodyPitchDelta *= bodySpinMomentum; _bodyYawDelta *= bodySpinMomentum; _bodyRollDelta *= bodySpinMomentum; float MINIMUM_ROTATION_RATE = 2.0f; - if (fabs(_bodyYawDelta) < MINIMUM_ROTATION_RATE) { _bodyYawDelta = 0.f; } - if (fabs(_bodyRollDelta) < MINIMUM_ROTATION_RATE) { _bodyRollDelta = 0.f; } - if (fabs(_bodyPitchDelta) < MINIMUM_ROTATION_RATE) { _bodyPitchDelta = 0.f; } + if (fabs(_bodyYawDelta) < MINIMUM_ROTATION_RATE) { _bodyYawDelta = 0.0f; } + if (fabs(_bodyRollDelta) < MINIMUM_ROTATION_RATE) { _bodyRollDelta = 0.0f; } + if (fabs(_bodyPitchDelta) < MINIMUM_ROTATION_RATE) { _bodyPitchDelta = 0.0f; } const float MAX_STATIC_FRICTION_SPEED = 0.5f; - const float STATIC_FRICTION_STRENGTH = _scale * 20.f; + const float STATIC_FRICTION_STRENGTH = _scale * 20.0f; applyStaticFriction(deltaTime, _velocity, MAX_STATIC_FRICTION_SPEED, STATIC_FRICTION_STRENGTH); // Damp avatar velocity @@ -201,11 +201,11 @@ void MyAvatar::simulate(float deltaTime) { const float SPEED_BRAKE_POWER = _scale * 10.0f; const float SQUARED_DAMPING_STRENGTH = 0.007f; - const float SLOW_NEAR_RADIUS = 5.f; + const float SLOW_NEAR_RADIUS = 5.0f; float linearDamping = LINEAR_DAMPING_STRENGTH; - const float NEAR_AVATAR_DAMPING_FACTOR = 50.f; + const float NEAR_AVATAR_DAMPING_FACTOR = 50.0f; if (_distanceToNearestAvatar < _scale * SLOW_NEAR_RADIUS) { - linearDamping *= 1.f + NEAR_AVATAR_DAMPING_FACTOR * + linearDamping *= 1.0f + NEAR_AVATAR_DAMPING_FACTOR * ((SLOW_NEAR_RADIUS - _distanceToNearestAvatar) / SLOW_NEAR_RADIUS); } if (_speedBrakes) { @@ -224,34 +224,34 @@ void MyAvatar::simulate(float deltaTime) { // yaw from the body and yaw the body if necessary. yaw *= DEGREES_PER_RADIAN; float bodyToHeadYaw = yaw - _oculusYawOffset; - const float MAX_NECK_YAW = 85.f; // degrees - if ((fabs(bodyToHeadYaw) > 2.f * MAX_NECK_YAW) && (yaw * _oculusYawOffset < 0.f)) { + const float MAX_NECK_YAW = 85.0f; // degrees + if ((fabs(bodyToHeadYaw) > 2.0f * MAX_NECK_YAW) && (yaw * _oculusYawOffset < 0.0f)) { // We've wrapped around the range for yaw so adjust // the measured yaw to be relative to _oculusYawOffset. - if (yaw > 0.f) { - yaw -= 360.f; + if (yaw > 0.0f) { + yaw -= 360.0f; } else { - yaw += 360.f; + yaw += 360.0f; } bodyToHeadYaw = yaw - _oculusYawOffset; } float delta = fabs(bodyToHeadYaw) - MAX_NECK_YAW; - if (delta > 0.f) { + if (delta > 0.0f) { yaw = MAX_NECK_YAW; - if (bodyToHeadYaw < 0.f) { - delta *= -1.f; + if (bodyToHeadYaw < 0.0f) { + delta *= -1.0f; bodyToHeadYaw = -MAX_NECK_YAW; } else { bodyToHeadYaw = MAX_NECK_YAW; } // constrain _oculusYawOffset to be within range [-180,180] - _oculusYawOffset = fmod((_oculusYawOffset + delta) + 180.f, 360.f) - 180.f; + _oculusYawOffset = fmod((_oculusYawOffset + delta) + 180.0f, 360.0f) - 180.0f; // We must adjust the body orientation using a delta rotation (rather than // doing yaw math) because the body's yaw ranges are not the same // as what the Oculus API provides. - glm::vec3 UP_AXIS = glm::vec3(0.f, 1.f, 0.f); + glm::vec3 UP_AXIS = glm::vec3(0.0f, 1.0f, 0.0f); glm::quat bodyCorrection = glm::angleAxis(glm::radians(delta), UP_AXIS); orientation = orientation * bodyCorrection; } @@ -280,7 +280,7 @@ void MyAvatar::simulate(float deltaTime) { // If a move target is set, update position explicitly const float MOVE_FINISHED_TOLERANCE = 0.1f; - const float MOVE_SPEED_FACTOR = 2.f; + const float MOVE_SPEED_FACTOR = 2.0f; const int MOVE_TARGET_MAX_STEPS = 250; if ((glm::length(_moveTarget) > EPSILON) && (_moveTargetStepCounter < MOVE_TARGET_MAX_STEPS)) { if (glm::length(_position - _moveTarget) > MOVE_FINISHED_TOLERANCE) { @@ -320,7 +320,7 @@ void MyAvatar::simulate(float deltaTime) { head->simulate(deltaTime, true); // Zero thrust out now that we've added it to velocity in this frame - _thrust = glm::vec3(0.f); + _thrust = glm::vec3(0.0f); // now that we're done stepping the avatar forward in time, compute new collisions if (_collisionFlags != 0) { @@ -328,7 +328,7 @@ void MyAvatar::simulate(float deltaTime) { float radius = getSkeletonHeight() * COLLISION_RADIUS_SCALE; if (myCamera->getMode() == CAMERA_MODE_FIRST_PERSON && !OculusManager::isConnected()) { - radius = myCamera->getAspectRatio() * (myCamera->getNearClip() / cos(myCamera->getFieldOfView() / 2.f)); + radius = myCamera->getAspectRatio() * (myCamera->getNearClip() / cos(myCamera->getFieldOfView() / 2.0f)); radius *= COLLISION_RADIUS_SCALAR; } @@ -370,11 +370,11 @@ void MyAvatar::updateFromGyros(float deltaTime) { // Rotate the body if the head is turned beyond the screen if (Menu::getInstance()->isOptionChecked(MenuOption::TurnWithHead)) { const float TRACKER_YAW_TURN_SENSITIVITY = 0.5f; - const float TRACKER_MIN_YAW_TURN = 15.f; - const float TRACKER_MAX_YAW_TURN = 50.f; + const float TRACKER_MIN_YAW_TURN = 15.0f; + const float TRACKER_MAX_YAW_TURN = 50.0f; if ( (fabs(estimatedRotation.y) > TRACKER_MIN_YAW_TURN) && (fabs(estimatedRotation.y) < TRACKER_MAX_YAW_TURN) ) { - if (estimatedRotation.y > 0.f) { + if (estimatedRotation.y > 0.0f) { _bodyYawDelta += (estimatedRotation.y - TRACKER_MIN_YAW_TURN) * TRACKER_YAW_TURN_SENSITIVITY; } else { _bodyYawDelta += (estimatedRotation.y + TRACKER_MIN_YAW_TURN) * TRACKER_YAW_TURN_SENSITIVITY; @@ -412,20 +412,20 @@ void MyAvatar::moveWithLean() { float leanSideways = head->getLeanSideways(); // Degrees of 'dead zone' when leaning, and amount of acceleration to apply to lean angle - const float LEAN_FWD_DEAD_ZONE = 15.f; - const float LEAN_SIDEWAYS_DEAD_ZONE = 10.f; - const float LEAN_FWD_THRUST_SCALE = 4.f; - const float LEAN_SIDEWAYS_THRUST_SCALE = 3.f; + const float LEAN_FWD_DEAD_ZONE = 15.0f; + const float LEAN_SIDEWAYS_DEAD_ZONE = 10.0f; + const float LEAN_FWD_THRUST_SCALE = 4.0f; + const float LEAN_SIDEWAYS_THRUST_SCALE = 3.0f; if (fabs(leanForward) > LEAN_FWD_DEAD_ZONE) { - if (leanForward > 0.f) { + if (leanForward > 0.0f) { addThrust(front * -(leanForward - LEAN_FWD_DEAD_ZONE) * LEAN_FWD_THRUST_SCALE); } else { addThrust(front * -(leanForward + LEAN_FWD_DEAD_ZONE) * LEAN_FWD_THRUST_SCALE); } } if (fabs(leanSideways) > LEAN_SIDEWAYS_DEAD_ZONE) { - if (leanSideways > 0.f) { + if (leanSideways > 0.0f) { addThrust(right * -(leanSideways - LEAN_SIDEWAYS_DEAD_ZONE) * LEAN_SIDEWAYS_THRUST_SCALE); } else { addThrust(right * -(leanSideways + LEAN_SIDEWAYS_DEAD_ZONE) * LEAN_SIDEWAYS_THRUST_SCALE); @@ -472,7 +472,7 @@ void MyAvatar::renderHeadMouse() const { // TODO? resurrect headMouse stuff? /* // Display small target box at center or head mouse target that can also be used to measure LOD - glColor3f(1.f, 1.f, 1.f); + glColor3f(1.0f, 1.0f, 1.0f); glDisable(GL_LINE_SMOOTH); const int PIXEL_BOX = 16; glBegin(GL_LINES); @@ -482,7 +482,7 @@ void MyAvatar::renderHeadMouse() const { glVertex2f(_headMouseX, _headMouseY + PIXEL_BOX/2); glEnd(); glEnable(GL_LINE_SMOOTH); - glColor3f(1.f, 0.f, 0.f); + glColor3f(1.0f, 0.0f, 0.0f); glPointSize(3.0f); glDisable(GL_POINT_SMOOTH); glBegin(GL_POINTS); @@ -494,7 +494,7 @@ void MyAvatar::renderHeadMouse() const { int eyeTargetX = (_glWidget->width() / 2) - _faceshift.getEstimatedEyeYaw() * EYE_TARGET_PIXELS_PER_DEGREE; int eyeTargetY = (_glWidget->height() / 2) - _faceshift.getEstimatedEyePitch() * EYE_TARGET_PIXELS_PER_DEGREE; - glColor3f(0.f, 1.f, 1.f); + glColor3f(0.0f, 1.0f, 1.0f); glDisable(GL_LINE_SMOOTH); glBegin(GL_LINES); glVertex2f(eyeTargetX - PIXEL_BOX/2, eyeTargetY); @@ -673,11 +673,11 @@ void MyAvatar::updateThrust(float deltaTime) { glm::vec3 up = orientation * IDENTITY_UP; const float THRUST_MAG_UP = 800.0f; - const float THRUST_MAG_DOWN = 300.f; - const float THRUST_MAG_FWD = 500.f; - const float THRUST_MAG_BACK = 300.f; - const float THRUST_MAG_LATERAL = 250.f; - const float THRUST_JUMP = 120.f; + const float THRUST_MAG_DOWN = 300.0f; + const float THRUST_MAG_FWD = 500.0f; + const float THRUST_MAG_BACK = 300.0f; + const float THRUST_MAG_LATERAL = 250.0f; + const float THRUST_JUMP = 120.0f; // Add Thrusts from keyboard _thrust += _driveKeys[FWD] * _scale * THRUST_MAG_FWD * _thrustMultiplier * deltaTime * front; @@ -688,25 +688,25 @@ void MyAvatar::updateThrust(float deltaTime) { _thrust -= _driveKeys[DOWN] * _scale * THRUST_MAG_DOWN * _thrustMultiplier * deltaTime * up; // attenuate thrust when in penetration - if (glm::dot(_thrust, _lastBodyPenetration) > 0.f) { + if (glm::dot(_thrust, _lastBodyPenetration) > 0.0f) { const float MAX_BODY_PENETRATION_DEPTH = 0.6f * _skeletonModel.getBoundingShapeRadius(); - float penetrationFactor = glm::min(1.f, glm::length(_lastBodyPenetration) / MAX_BODY_PENETRATION_DEPTH); + float penetrationFactor = glm::min(1.0f, glm::length(_lastBodyPenetration) / MAX_BODY_PENETRATION_DEPTH); glm::vec3 penetrationDirection = glm::normalize(_lastBodyPenetration); // attenuate parallel component glm::vec3 parallelThrust = glm::dot(_thrust, penetrationDirection) * penetrationDirection; // attenuate perpendicular component (friction) glm::vec3 perpendicularThrust = _thrust - parallelThrust; // recombine to get the final thrust - _thrust = (1.f - penetrationFactor) * parallelThrust + (1.f - penetrationFactor * penetrationFactor) * perpendicularThrust; + _thrust = (1.0f - penetrationFactor) * parallelThrust + (1.0f - penetrationFactor * penetrationFactor) * perpendicularThrust; // attenuate the growth of _thrustMultiplier when in penetration // otherwise the avatar will eventually be able to tunnel through the obstacle - _thrustMultiplier *= (1.f - penetrationFactor * penetrationFactor); - } else if (_thrustMultiplier < 1.f) { + _thrustMultiplier *= (1.0f - penetrationFactor * penetrationFactor); + } else if (_thrustMultiplier < 1.0f) { // rapid healing of attenuated thrustMultiplier after penetration event - _thrustMultiplier = 1.f; + _thrustMultiplier = 1.0f; } - _lastBodyPenetration = glm::vec3(0.f); + _lastBodyPenetration = glm::vec3(0.0f); _bodyYawDelta -= _driveKeys[ROT_RIGHT] * YAW_SPEED * deltaTime; _bodyYawDelta += _driveKeys[ROT_LEFT] * YAW_SPEED * deltaTime; @@ -716,12 +716,12 @@ void MyAvatar::updateThrust(float deltaTime) { if (_driveKeys[FWD] || _driveKeys[BACK] || _driveKeys[RIGHT] || _driveKeys[LEFT] || _driveKeys[UP] || _driveKeys[DOWN]) { const float THRUST_INCREASE_RATE = 1.05f; const float MAX_THRUST_MULTIPLIER = 75.0f; - _thrustMultiplier *= 1.f + deltaTime * THRUST_INCREASE_RATE; + _thrustMultiplier *= 1.0f + deltaTime * THRUST_INCREASE_RATE; if (_thrustMultiplier > MAX_THRUST_MULTIPLIER) { _thrustMultiplier = MAX_THRUST_MULTIPLIER; } } else { - _thrustMultiplier = 1.f; + _thrustMultiplier = 1.0f; } // Add one time jumping force if requested @@ -826,11 +826,11 @@ void MyAvatar::applyHardCollision(const glm::vec3& penetration, float elasticity if (penetrationLength > EPSILON) { _elapsedTimeSinceCollision = 0.0f; glm::vec3 direction = penetration / penetrationLength; - _velocity -= glm::dot(_velocity, direction) * direction * (1.f + elasticity); - _velocity *= glm::clamp(1.f - damping, 0.0f, 1.0f); - if ((glm::length(_velocity) < HALTING_VELOCITY) && (glm::length(_thrust) == 0.f)) { + _velocity -= glm::dot(_velocity, direction) * direction * (1.0f + elasticity); + _velocity *= glm::clamp(1.0f - damping, 0.0f, 1.0f); + if ((glm::length(_velocity) < HALTING_VELOCITY) && (glm::length(_thrust) == 0.0f)) { // If moving really slowly after a collision, and not applying forces, stop altogether - _velocity *= 0.f; + _velocity *= 0.0f; } } } @@ -838,7 +838,7 @@ void MyAvatar::applyHardCollision(const glm::vec3& penetration, float elasticity void MyAvatar::updateCollisionSound(const glm::vec3 &penetration, float deltaTime, float frequency) { // consider whether to have the collision make a sound const float AUDIBLE_COLLISION_THRESHOLD = 0.02f; - const float COLLISION_LOUDNESS = 1.f; + const float COLLISION_LOUDNESS = 1.0f; const float DURATION_SCALING = 0.004f; const float NOISE_SCALING = 0.1f; glm::vec3 velocity = _velocity; @@ -858,10 +858,10 @@ void MyAvatar::updateCollisionSound(const glm::vec3 &penetration, float deltaTim // Noise is a function of the angle of collision // Duration of the sound is a function of both base frequency and velocity of impact Application::getInstance()->getAudio()->startCollisionSound( - std::min(COLLISION_LOUDNESS * velocityTowardCollision, 1.f), - frequency * (1.f + velocityTangentToCollision / velocityTowardCollision), - std::min(velocityTangentToCollision / velocityTowardCollision * NOISE_SCALING, 1.f), - 1.f - DURATION_SCALING * powf(frequency, 0.5f) / velocityTowardCollision, true); + std::min(COLLISION_LOUDNESS * velocityTowardCollision, 1.0f), + frequency * (1.0f + velocityTangentToCollision / velocityTowardCollision), + std::min(velocityTangentToCollision / velocityTowardCollision * NOISE_SCALING, 1.0f), + 1.0f - DURATION_SCALING * powf(frequency, 0.5f) / velocityTowardCollision, true); } } @@ -874,8 +874,8 @@ bool findAvatarAvatarPenetration(const glm::vec3 positionA, float radiusA, float float halfHeights = 0.5 * (heightA + heightB); if (yDistance < halfHeights) { // cylinders collide - if (xzDistance > 0.f) { - positionBA.y = 0.f; + if (xzDistance > 0.0f) { + positionBA.y = 0.0f; // note, penetration should point from A into B penetration = positionBA * ((radiusA + radiusB - xzDistance) / xzDistance); return true; @@ -885,7 +885,7 @@ bool findAvatarAvatarPenetration(const glm::vec3 positionA, float radiusA, float } } else if (yDistance < halfHeights + radiusA + radiusB) { // caps collide - if (positionBA.y < 0.f) { + if (positionBA.y < 0.0f) { // A is above B positionBA.y += halfHeights; float BA = glm::length(positionBA); @@ -944,7 +944,7 @@ void MyAvatar::updateCollisionWithAvatars(float deltaTime) { ShapeCollider::shapeShape(myShape, theirShape, bodyCollisions); } } - glm::vec3 totalPenetration(0.f); + glm::vec3 totalPenetration(0.0f); for (int j = 0; j < bodyCollisions.size(); ++j) { CollisionInfo* collision = bodyCollisions.getCollision(j); totalPenetration = addPenetrations(totalPenetration, collision->_penetration); @@ -1108,15 +1108,15 @@ void MyAvatar::goHome() { } void MyAvatar::increaseSize() { - if ((1.f + SCALING_RATIO) * _targetScale < MAX_AVATAR_SCALE) { - _targetScale *= (1.f + SCALING_RATIO); + if ((1.0f + SCALING_RATIO) * _targetScale < MAX_AVATAR_SCALE) { + _targetScale *= (1.0f + SCALING_RATIO); qDebug("Changed scale to %f", _targetScale); } } void MyAvatar::decreaseSize() { - if (MIN_AVATAR_SCALE < (1.f - SCALING_RATIO) * _targetScale) { - _targetScale *= (1.f - SCALING_RATIO); + if (MIN_AVATAR_SCALE < (1.0f - SCALING_RATIO) * _targetScale) { + _targetScale *= (1.0f - SCALING_RATIO); qDebug("Changed scale to %f", _targetScale); } } @@ -1192,8 +1192,8 @@ void MyAvatar::applyCollision(const glm::vec3& contactPoint, const glm::vec3& pe if (leverLength > EPSILON) { // compute lean perturbation angles glm::quat bodyRotation = getOrientation(); - glm::vec3 xAxis = bodyRotation * glm::vec3(1.f, 0.f, 0.f); - glm::vec3 zAxis = bodyRotation * glm::vec3(0.f, 0.f, 1.f); + glm::vec3 xAxis = bodyRotation * glm::vec3(1.0f, 0.0f, 0.0f); + glm::vec3 zAxis = bodyRotation * glm::vec3(0.0f, 0.0f, 1.0f); leverAxis = leverAxis / leverLength; glm::vec3 effectivePenetration = penetration - glm::dot(penetration, leverAxis) * leverAxis; From f0dfb7fc38cc05cc1d6e32f702353cd1ea309c5c Mon Sep 17 00:00:00 2001 From: Andrzej Kapolka Date: Wed, 9 Apr 2014 15:38:54 -0700 Subject: [PATCH 088/120] Updated headers to match the new standard. --- interface/src/devices/FaceTracker.cpp | 9 ++++++--- interface/src/devices/FaceTracker.h | 15 +++++++++------ interface/src/devices/Faceplus.cpp | 9 ++++++--- interface/src/devices/Faceplus.h | 15 +++++++++------ 4 files changed, 30 insertions(+), 18 deletions(-) diff --git a/interface/src/devices/FaceTracker.cpp b/interface/src/devices/FaceTracker.cpp index 45f789fbfe..52fe04de77 100644 --- a/interface/src/devices/FaceTracker.cpp +++ b/interface/src/devices/FaceTracker.cpp @@ -1,9 +1,12 @@ // // FaceTracker.cpp -// interface +// interface/src/devices // -// Created by Andrzej Kapolka on 4/8/14. -// Copyright (c) 2014 High Fidelity, Inc. All rights reserved. +// Created by Andrzej Kapolka on 4/9/14. +// Copyright 2014 High Fidelity, Inc. +// +// Distributed under the Apache License, Version 2.0. +// See the accompanying file LICENSE or http://www.apache.org/licenses/LICENSE-2.0.html // #include "FaceTracker.h" diff --git a/interface/src/devices/FaceTracker.h b/interface/src/devices/FaceTracker.h index 659defe591..459f38cafc 100644 --- a/interface/src/devices/FaceTracker.h +++ b/interface/src/devices/FaceTracker.h @@ -1,13 +1,16 @@ // // FaceTracker.h -// interface +// interface/src/devices // -// Created by Andrzej Kapolka on 4/8/14. -// Copyright (c) 2014 High Fidelity, Inc. All rights reserved. +// Created by Andrzej Kapolka on 4/9/14. +// Copyright 2014 High Fidelity, Inc. +// +// Distributed under the Apache License, Version 2.0. +// See the accompanying file LICENSE or http://www.apache.org/licenses/LICENSE-2.0.html // -#ifndef __interface__FaceTracker__ -#define __interface__FaceTracker__ +#ifndef hifi_FaceTracker_h +#define hifi_FaceTracker_h #include #include @@ -40,4 +43,4 @@ protected: QVector _blendshapeCoefficients; }; -#endif /* defined(__interface__FaceTracker__) */ +#endif // hifi_FaceTracker_h diff --git a/interface/src/devices/Faceplus.cpp b/interface/src/devices/Faceplus.cpp index 62f39d3b91..f7f2f1f1bd 100644 --- a/interface/src/devices/Faceplus.cpp +++ b/interface/src/devices/Faceplus.cpp @@ -1,9 +1,12 @@ // // Faceplus.cpp -// interface +// interface/src/devices // -// Created by Andrzej Kapolka on 4/8/14. -// Copyright (c) 2014 High Fidelity, Inc. All rights reserved. +// Created by Andrzej Kapolka on 4/9/14. +// Copyright 2014 High Fidelity, Inc. +// +// Distributed under the Apache License, Version 2.0. +// See the accompanying file LICENSE or http://www.apache.org/licenses/LICENSE-2.0.html // #include diff --git a/interface/src/devices/Faceplus.h b/interface/src/devices/Faceplus.h index 6cfdac2640..2b9219f3fd 100644 --- a/interface/src/devices/Faceplus.h +++ b/interface/src/devices/Faceplus.h @@ -1,13 +1,16 @@ // // Faceplus.h -// interface +// interface/src/devices // -// Created by Andrzej Kapolka on 4/8/14. -// Copyright (c) 2014 High Fidelity, Inc. All rights reserved. +// Created by Andrzej Kapolka on 4/9/14. +// Copyright 2014 High Fidelity, Inc. +// +// Distributed under the Apache License, Version 2.0. +// See the accompanying file LICENSE or http://www.apache.org/licenses/LICENSE-2.0.html // -#ifndef __interface__Faceplus__ -#define __interface__Faceplus__ +#ifndef hifi_Faceplus_h +#define hifi_Faceplus_h #include #include @@ -73,4 +76,4 @@ private: #endif }; -#endif /* defined(__interface__Faceplus__) */ +#endif // hifi_Faceplus_h From e33da2a74198b40c426a0fb06a7b9bd21aa64d49 Mon Sep 17 00:00:00 2001 From: Atlante45 Date: Wed, 9 Apr 2014 17:08:50 -0700 Subject: [PATCH 089/120] Some QSettings cleanup + persistant script location --- interface/src/Application.cpp | 102 +++++++++++++++++++--------------- interface/src/Application.h | 2 + 2 files changed, 60 insertions(+), 44 deletions(-) diff --git a/interface/src/Application.cpp b/interface/src/Application.cpp index 331ba51643..acd4e07c6a 100644 --- a/interface/src/Application.cpp +++ b/interface/src/Application.cpp @@ -338,7 +338,8 @@ Application::Application(int& argc, char** argv, timeval &startup_time) : // clear the scripts, and set out script to our default scripts clearScriptsBeforeRunning(); loadScript("http://public.highfidelity.io/scripts/defaultScripts.js"); - + + QMutexLocker locker(&_settingsMutex); _settings->setValue("firstRun",QVariant(false)); } else { // do this as late as possible so that all required subsystems are inialized @@ -352,16 +353,12 @@ Application::~Application() { // make sure we don't call the idle timer any more delete idleTimer; - - Menu::getInstance()->saveSettings(); - _rearMirrorTools->saveSettings(_settings); - + _sharedVoxelSystem.changeTree(new VoxelTree); - if (_voxelImporter) { - _voxelImporter->saveSettings(_settings); - delete _voxelImporter; - } - _settings->sync(); + + saveSettings(); + + delete _voxelImporter; // let the avatar mixer know we're out MyAvatar::sendKillAvatar(); @@ -395,35 +392,45 @@ Application::~Application() { AccountManager::getInstance().destroy(); } +void Application::saveSettings() { + Menu::getInstance()->saveSettings(); + _rearMirrorTools->saveSettings(_settings); + + if (_voxelImporter) { + _voxelImporter->saveSettings(_settings); + } + _settings->sync(); +} + + void Application::restoreSizeAndPosition() { - QSettings* settings = new QSettings(this); QRect available = desktop()->availableGeometry(); - settings->beginGroup("Window"); + QMutexLocker locker(&_settingsMutex); + _settings->beginGroup("Window"); - int x = (int)loadSetting(settings, "x", 0); - int y = (int)loadSetting(settings, "y", 0); + int x = (int)loadSetting(_settings, "x", 0); + int y = (int)loadSetting(_settings, "y", 0); _window->move(x, y); - int width = (int)loadSetting(settings, "width", available.width()); - int height = (int)loadSetting(settings, "height", available.height()); + int width = (int)loadSetting(_settings, "width", available.width()); + int height = (int)loadSetting(_settings, "height", available.height()); _window->resize(width, height); - settings->endGroup(); + _settings->endGroup(); } void Application::storeSizeAndPosition() { - QSettings* settings = new QSettings(this); + QMutexLocker locker(&_settingsMutex); + _settings->beginGroup("Window"); - settings->beginGroup("Window"); + _settings->setValue("width", _window->rect().width()); + _settings->setValue("height", _window->rect().height()); - settings->setValue("width", _window->rect().width()); - settings->setValue("height", _window->rect().height()); + _settings->setValue("x", _window->pos().x()); + _settings->setValue("y", _window->pos().y()); - settings->setValue("x", _window->pos().x()); - settings->setValue("y", _window->pos().y()); - - settings->endGroup(); + _settings->endGroup(); } void Application::initializeGL() { @@ -3177,35 +3184,37 @@ void Application::packetSent(quint64 length) { void Application::loadScripts() { // loads all saved scripts - QSettings* settings = new QSettings(this); - int size = settings->beginReadArray("Settings"); - + + lockSettings(); + int size = _settings->beginReadArray("Settings"); for (int i = 0; i < size; ++i){ - settings->setArrayIndex(i); - QString string = settings->value("script").toString(); - loadScript(string); + _settings->setArrayIndex(i); + QString string = _settings->value("script").toString(); + unlockSettings(); + if (!string.isEmpty()) { + loadScript(string); + } } - - settings->endArray(); + + QMutexLocker locker(&_settingsMutex); + _settings->endArray(); } void Application::clearScriptsBeforeRunning() { // clears all scripts from the settings - QSettings* settings = new QSettings(this); - settings->beginWriteArray("Settings"); - settings->endArray(); + QMutexLocker locker(&_settingsMutex); + _settings->remove("Settings"); } void Application::saveScripts() { // saves all current running scripts - QSettings* settings = new QSettings(this); - settings->beginWriteArray("Settings"); + QMutexLocker locker(&_settingsMutex); + _settings->beginWriteArray("Settings"); for (int i = 0; i < getRunningScripts().size(); ++i){ - settings->setArrayIndex(i); - settings->setValue("script", getRunningScripts().at(i)); + _settings->setArrayIndex(i); + _settings->setValue("script", getRunningScripts().at(i)); } - - settings->endArray(); + _settings->endArray(); } void Application::stopAllScripts() { @@ -3346,7 +3355,10 @@ void Application::loadDialog() { if (_previousScriptLocation.isEmpty()) { QString desktopLocation = QStandardPaths::writableLocation(QStandardPaths::DesktopLocation); +// Temporary fix to Qt bug: http://stackoverflow.com/questions/16194475 +#ifdef __APPLE__ suggestedName = desktopLocation.append("/script.js"); +#endif } else { suggestedName = _previousScriptLocation; } @@ -3355,9 +3367,11 @@ void Application::loadDialog() { tr("JavaScript Files (*.js)")); if (!fileNameString.isEmpty()) { _previousScriptLocation = fileNameString; + QMutexLocker locker(&_settingsMutex); + _settings->setValue("LastScriptLocation", _previousScriptLocation); + + loadScript(fileNameString); } - - loadScript(fileNameString); } void Application::loadScriptURLDialog() { diff --git a/interface/src/Application.h b/interface/src/Application.h index 7c1cb9cab1..c1c2b9bf01 100644 --- a/interface/src/Application.h +++ b/interface/src/Application.h @@ -182,6 +182,8 @@ public: /// if you need to access the application settings, use lockSettings()/unlockSettings() QSettings* lockSettings() { _settingsMutex.lock(); return _settings; } void unlockSettings() { _settingsMutex.unlock(); } + + void saveSettings(); QMainWindow* getWindow() { return _window; } NodeToOctreeSceneStats* getOcteeSceneStats() { return &_octreeServerSceneStats; } From cf47418d5883b4f54cf92b568ea10b92ccb7aeaf Mon Sep 17 00:00:00 2001 From: Stephen Birarda Date: Wed, 9 Apr 2014 17:16:29 -0700 Subject: [PATCH 090/120] remove the audio scope --- interface/src/Application.cpp | 15 +-- interface/src/Application.h | 1 - interface/src/Audio.cpp | 14 +-- interface/src/Audio.h | 6 +- interface/src/Menu.cpp | 1 - interface/src/Menu.h | 1 - interface/src/ui/Oscilloscope.cpp | 192 ------------------------------ interface/src/ui/Oscilloscope.h | 84 ------------- 8 files changed, 3 insertions(+), 311 deletions(-) delete mode 100644 interface/src/ui/Oscilloscope.cpp delete mode 100644 interface/src/ui/Oscilloscope.h diff --git a/interface/src/Application.cpp b/interface/src/Application.cpp index 6005ae085e..85efdcc2b4 100644 --- a/interface/src/Application.cpp +++ b/interface/src/Application.cpp @@ -150,7 +150,6 @@ Application::Application(int& argc, char** argv, timeval &startup_time) : _viewFrustum(), _lastQueriedViewFrustum(), _lastQueriedTime(usecTimestampNow()), - _audioScope(256, 200, true), _mirrorViewRect(QRect(MIRROR_VIEW_LEFT_PADDING, MIRROR_VIEW_TOP_PADDING, MIRROR_VIEW_WIDTH, MIRROR_VIEW_HEIGHT)), _mouseX(0), _mouseY(0), @@ -161,7 +160,7 @@ Application::Application(int& argc, char** argv, timeval &startup_time) : _touchAvgY(0.0f), _isTouchPressed(false), _mousePressed(false), - _audio(&_audioScope, STARTUP_JITTER_SAMPLES), + _audio(STARTUP_JITTER_SAMPLES), _enableProcessVoxelsThread(true), _voxelProcessor(), _voxelHideShowThread(&_voxels), @@ -744,9 +743,6 @@ void Application::keyPressEvent(QKeyEvent* event) { case Qt::Key_Period: Menu::getInstance()->handleViewFrustumOffsetKeyModifier(event->key()); break; - case Qt::Key_Apostrophe: - _audioScope.inputPaused = !_audioScope.inputPaused; - break; case Qt::Key_L: if (isShifted) { Menu::getInstance()->triggerOption(MenuOption::LodTools); @@ -2509,15 +2505,6 @@ void Application::displayOverlay() { } } - // Audio Scope - const int AUDIO_SCOPE_Y_OFFSET = 135; - if (Menu::getInstance()->isOptionChecked(MenuOption::Stats)) { - if (Menu::getInstance()->isOptionChecked(MenuOption::Oscilloscope)) { - int oscilloscopeTop = _glWidget->height() - AUDIO_SCOPE_Y_OFFSET; - _audioScope.render(MIRROR_VIEW_LEFT_PADDING, oscilloscopeTop); - } - } - // Audio VU Meter and Mute Icon const int MUTE_ICON_SIZE = 24; const int AUDIO_METER_INSET = 2; diff --git a/interface/src/Application.h b/interface/src/Application.h index 61c2a15f95..6238d09ded 100644 --- a/interface/src/Application.h +++ b/interface/src/Application.h @@ -407,7 +407,6 @@ private: ViewFrustum _shadowViewFrustum; quint64 _lastQueriedTime; - Oscilloscope _audioScope; float _trailingAudioLoudness; OctreeQuery _octreeQuery; // NodeData derived class for querying voxels from voxel server diff --git a/interface/src/Audio.cpp b/interface/src/Audio.cpp index a98d276acc..5dcd54050c 100644 --- a/interface/src/Audio.cpp +++ b/interface/src/Audio.cpp @@ -50,7 +50,7 @@ static const int NUMBER_OF_NOISE_SAMPLE_FRAMES = 300; // Mute icon configration static const int MUTE_ICON_SIZE = 24; -Audio::Audio(Oscilloscope* scope, int16_t initialJitterBufferSamples, QObject* parent) : +Audio::Audio(int16_t initialJitterBufferSamples, QObject* parent) : AbstractAudioInterface(parent), _audioInput(NULL), _desiredInputFormat(), @@ -67,7 +67,6 @@ Audio::Audio(Oscilloscope* scope, int16_t initialJitterBufferSamples, QObject* p _proceduralOutputDevice(NULL), _inputRingBuffer(0), _ringBuffer(NETWORK_BUFFER_LENGTH_BYTES_PER_CHANNEL), - _scope(scope), _averagedLatency(0.0), _measuredJitter(0), _jitterBufferSamples(initialJitterBufferSamples), @@ -555,12 +554,6 @@ void Audio::handleAudioInput() { _lastInputLoudness = 0; } } - - // add input data just written to the scope - QMetaObject::invokeMethod(_scope, "addSamples", Qt::QueuedConnection, - Q_ARG(QByteArray, QByteArray((char*) monoAudioSamples, - NETWORK_BUFFER_LENGTH_BYTES_PER_CHANNEL)), - Q_ARG(bool, false), Q_ARG(bool, true)); } else { // our input loudness is 0, since we're muted _lastInputLoudness = 0; @@ -724,11 +717,6 @@ void Audio::processReceivedAudio(const QByteArray& audioByteArray) { if (_outputDevice) { _outputDevice->write(outputBuffer); - - // add output (@speakers) data just written to the scope - QMetaObject::invokeMethod(_scope, "addSamples", Qt::QueuedConnection, - Q_ARG(QByteArray, QByteArray((char*) ringBufferSamples, numNetworkOutputSamples)), - Q_ARG(bool, true), Q_ARG(bool, false)); } delete[] ringBufferSamples; } diff --git a/interface/src/Audio.h b/interface/src/Audio.h index c529fc2651..bfb3450d72 100644 --- a/interface/src/Audio.h +++ b/interface/src/Audio.h @@ -34,9 +34,6 @@ #include #include -#include "ui/Oscilloscope.h" - - static const int NUM_AUDIO_CHANNELS = 2; class QAudioInput; @@ -47,7 +44,7 @@ class Audio : public AbstractAudioInterface { Q_OBJECT public: // setup for audio I/O - Audio(Oscilloscope* scope, int16_t initialJitterBufferSamples, QObject* parent = 0); + Audio(int16_t initialJitterBufferSamples, QObject* parent = 0); float getLastInputLoudness() const { return glm::max(_lastInputLoudness - _noiseGateMeasuredFloor, 0.f); } float getTimeSinceLastClip() const { return _timeSinceLastClip; } @@ -126,7 +123,6 @@ private: QString _inputAudioDeviceName; QString _outputAudioDeviceName; - Oscilloscope* _scope; StDev _stdev; timeval _lastReceiveTime; float _averagedLatency; diff --git a/interface/src/Menu.cpp b/interface/src/Menu.cpp index 70e69597f6..f0aa746d00 100644 --- a/interface/src/Menu.cpp +++ b/interface/src/Menu.cpp @@ -252,7 +252,6 @@ Menu::Menu() : addDisabledActionAndSeparator(viewMenu, "Stats"); addCheckableActionToQMenuAndActionHash(viewMenu, MenuOption::Stats, Qt::Key_Slash); addActionToQMenuAndActionHash(viewMenu, MenuOption::Log, Qt::CTRL | Qt::Key_L, appInstance, SLOT(toggleLogDialog())); - addCheckableActionToQMenuAndActionHash(viewMenu, MenuOption::Oscilloscope, 0, false); addCheckableActionToQMenuAndActionHash(viewMenu, MenuOption::Bandwidth, 0, true); addActionToQMenuAndActionHash(viewMenu, MenuOption::BandwidthDetails, 0, this, SLOT(bandwidthDetails())); addActionToQMenuAndActionHash(viewMenu, MenuOption::OctreeStats, 0, this, SLOT(octreeStatsDetails())); diff --git a/interface/src/Menu.h b/interface/src/Menu.h index 5bc48f916f..cdefa18273 100644 --- a/interface/src/Menu.h +++ b/interface/src/Menu.h @@ -287,7 +287,6 @@ namespace MenuOption { const QString OctreeStats = "Voxel and Particle Statistics"; const QString OffAxisProjection = "Off-Axis Projection"; const QString OldVoxelCullingMode = "Old Voxel Culling Mode"; - const QString Oscilloscope = "Audio Oscilloscope"; const QString Pair = "Pair"; const QString Particles = "Particles"; const QString PasteToVoxel = "Paste to Voxel..."; diff --git a/interface/src/ui/Oscilloscope.cpp b/interface/src/ui/Oscilloscope.cpp deleted file mode 100644 index af10539c43..0000000000 --- a/interface/src/ui/Oscilloscope.cpp +++ /dev/null @@ -1,192 +0,0 @@ -// -// Oscilloscope.cpp -// interface/src/ui -// -// Created by Philip on 1/28/13. -// Copyright 2013 High Fidelity, Inc. -// -// Distributed under the Apache License, Version 2.0. -// See the accompanying file LICENSE or http://www.apache.org/licenses/LICENSE-2.0.html -// - -#include -#include -#include - -#include -#include - -#include "InterfaceConfig.h" - -#include "Oscilloscope.h" - -// Reimplemented 4/26/13 (tosh) - don't blame Philip for bugs - -using namespace std; - -namespace { // everything in here only exists while compiling this .cpp file - - // one sample buffer per channel - unsigned const MAX_SAMPLES = Oscilloscope::MAX_SAMPLES_PER_CHANNEL * Oscilloscope::MAX_CHANNELS; - - // adding an x-coordinate yields twice the amount of vertices - unsigned const MAX_COORDS_PER_CHANNEL = Oscilloscope::MAX_SAMPLES_PER_CHANNEL * 2; - // allocated once for each channel - unsigned const MAX_COORDS = MAX_COORDS_PER_CHANNEL * Oscilloscope::MAX_CHANNELS; - - // total amount of memory to allocate (in 16-bit integers) - unsigned const N_INT16_TO_ALLOC = MAX_SAMPLES + MAX_COORDS; -} - - -Oscilloscope::Oscilloscope(int w, int h, bool isEnabled) : - enabled(isEnabled), - inputPaused(false), - _width(w), - _height(h), - _samples(0l), - _vertices(0l), - // some filtering (see details in Log.h) - _lowPassCoeff(0.4f), - // three in -> one out - _downsampleRatio(3) { - - // allocate enough space for the sample data and to turn it into - // vertices and since they're all 'short', do so in one shot - _samples = new short[N_INT16_TO_ALLOC]; - memset(_samples, 0, N_INT16_TO_ALLOC * sizeof(short)); - _vertices = _samples + MAX_SAMPLES; - - // initialize write positions to start of each channel's region - for (unsigned ch = 0; ch < MAX_CHANNELS; ++ch) { - _writePos[ch] = MAX_SAMPLES_PER_CHANNEL * ch; - } - - _colors[0] = 0xffffff; - _colors[1] = 0x00ffff; - _colors[2] = 0x00ffff; -} - -Oscilloscope::~Oscilloscope() { - - delete[] _samples; -} - -void Oscilloscope::addSamples(const QByteArray& audioByteArray, bool isStereo, bool isInput) { - - if (! enabled || inputPaused) { - return; - } - - unsigned numSamplesPerChannel = audioByteArray.size() / (sizeof(int16_t) * (isStereo ? 2 : 1)); - int16_t* samples = (int16_t*) audioByteArray.data(); - - for (int channel = 0; channel < (isStereo ? 2 : 1); channel++) { - // add samples for each of the channels - - // determine start/end offset of this channel's region - unsigned baseOffs = MAX_SAMPLES_PER_CHANNEL * (channel + !isInput); - unsigned endOffs = baseOffs + MAX_SAMPLES_PER_CHANNEL; - - // fetch write position for this channel - unsigned writePos = _writePos[channel + !isInput]; - - // determine write position after adding the samples - unsigned newWritePos = writePos + numSamplesPerChannel; - unsigned n2 = 0; - if (newWritePos >= endOffs) { - // passed boundary of the circular buffer? -> we need to copy two blocks - n2 = newWritePos - endOffs; - newWritePos = baseOffs + n2; - numSamplesPerChannel -= n2; - } - - if (!isStereo) { - // copy data - memcpy(_samples + writePos, samples, numSamplesPerChannel * sizeof(int16_t)); - if (n2 > 0) { - memcpy(_samples + baseOffs, samples + numSamplesPerChannel, n2 * sizeof(int16_t)); - } - } else { - // we have interleaved samples we need to separate into two channels - for (unsigned i = 0; i < numSamplesPerChannel + n2; i++) { - if (i < numSamplesPerChannel - n2) { - _samples[writePos] = samples[(i * 2) + channel]; - } else { - _samples[baseOffs] = samples[(i * 2) + channel]; - } - } - } - - // set new write position for this channel - _writePos[channel + !isInput] = newWritePos; - } -} - -void Oscilloscope::render(int x, int y) { - - if (! enabled) { - return; - } - - // fetch low pass factor (and convert to fix point) / downsample factor - int lowPassFixPt = -(int)(std::numeric_limits::min()) * _lowPassCoeff; - unsigned downsample = _downsampleRatio; - // keep half of the buffer for writing and ensure an even vertex count - unsigned usedWidth = min(_width, MAX_SAMPLES_PER_CHANNEL / (downsample * 2)) & ~1u; - unsigned usedSamples = usedWidth * downsample; - - // expand samples to vertex data - for (unsigned ch = 0; ch < MAX_CHANNELS; ++ch) { - // for each channel: determine memory regions - short const* basePtr = _samples + MAX_SAMPLES_PER_CHANNEL * ch; - short const* endPtr = basePtr + MAX_SAMPLES_PER_CHANNEL; - short const* inPtr = _samples + _writePos[ch]; - short* outPtr = _vertices + MAX_COORDS_PER_CHANNEL * ch; - int sample = 0, x = usedWidth; - for (int i = (int)usedSamples; --i >= 0 ;) { - if (inPtr == basePtr) { - // handle boundary, reading the circular sample buffer - inPtr = endPtr; - } - // read and (eventually) filter sample - sample += ((*--inPtr - sample) * lowPassFixPt) >> 15; - // write every nth as y with a corresponding x-coordinate - if (i % downsample == 0) { - *outPtr++ = short(--x); - *outPtr++ = short(sample); - } - } - } - - // set up rendering state (vertex data lives at _vertices) - glLineWidth(1.0); - glDisable(GL_LINE_SMOOTH); - glPushMatrix(); - glTranslatef((float)x + 0.0f, (float)y + _height / 2.0f, 0.0f); - glScaled(1.0f, _height / 32767.0f, 1.0f); - glVertexPointer(2, GL_SHORT, 0, _vertices); - glEnableClientState(GL_VERTEX_ARRAY); - glDisableClientState(GL_COLOR_ARRAY); - glDisableClientState(GL_INDEX_ARRAY); - glDisableClientState(GL_NORMAL_ARRAY); - glDisableClientState(GL_TEXTURE_COORD_ARRAY); - - // render channel 0 - glColor3ub(GLubyte(_colors[0] >> 16), GLubyte((_colors[0] >> 8) & 0xff), GLubyte(_colors[0] & 0xff)); - glDrawArrays(GL_LINES, MAX_SAMPLES_PER_CHANNEL * 0, usedWidth); - - // render channel 1 - glColor3f(0.0f, 1.0f ,1.0f); - glColor3ub(GLubyte(_colors[1] >> 16), GLubyte((_colors[1] >> 8) & 0xff), GLubyte(_colors[1] & 0xff)); - glDrawArrays(GL_LINES, MAX_SAMPLES_PER_CHANNEL * 1, usedWidth); - - // render channel 2 - glColor3ub(GLubyte(_colors[2] >> 16), GLubyte((_colors[2] >> 8) & 0xff), GLubyte(_colors[2] & 0xff)); - glDrawArrays(GL_LINES, MAX_SAMPLES_PER_CHANNEL * 2, usedWidth); - - // reset rendering state - glDisableClientState(GL_VERTEX_ARRAY); - glPopMatrix(); -} - diff --git a/interface/src/ui/Oscilloscope.h b/interface/src/ui/Oscilloscope.h deleted file mode 100644 index 6eff547530..0000000000 --- a/interface/src/ui/Oscilloscope.h +++ /dev/null @@ -1,84 +0,0 @@ -// -// Oscilloscope.h -// interface/src/ui -// -// Created by Philip on 1/28/13. -// Copyright 2013 High Fidelity, Inc. -// -// 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_Oscilloscope_h -#define hifi_Oscilloscope_h - -#include - -#include - -class Oscilloscope : public QObject { - Q_OBJECT -public: - Oscilloscope(int width, int height, bool isEnabled); - ~Oscilloscope(); - - void render(int x, int y); - - // Switches: On/Off, Stop Time - volatile bool enabled; - volatile bool inputPaused; - - // Limits - static unsigned const MAX_CHANNELS = 3; - static unsigned const MAX_SAMPLES_PER_CHANNEL = 4096; - - // Sets the color for a specific channel. - void setColor(unsigned ch, unsigned rgb) { assert(ch < MAX_CHANNELS); if (! inputPaused) { _colors[ch] = rgb; } } - - // Controls a simple one pole IIR low pass filter that is provided to - // reduce high frequencies aliasing (to lower ones) when downsampling. - // - // The parameter sets the influence of the input in respect to the - // feed-back signal on the output. - // - // +---------+ - // in O--------------|+ ideal |--o--------------O out - // .---|- op amp | | - // | +---------+ | - // | | - // o-------||-------o - // | | - // | __V__ - // -------------|_____|-------+ - // : : | - // 0.0 - 1.0 (GND) - // - // The values in range 0.0 - 1.0 correspond to "all closed" (input has - // no influence on the output) to "all open" (feedback has no influence - // on the output) configurations. - void setLowpassOpenness(float w) { assert(w >= 0.0f && w <= 1.0f); _lowPassCoeff = w; } - - // Sets the number of input samples per output sample. Without filtering - // just uses every nTh sample. - void setDownsampleRatio(unsigned n) { assert(n > 0); _downsampleRatio = n; } -public slots: - void addSamples(const QByteArray& audioByteArray, bool isStereo, bool isInput); -private: - // don't copy/assign - Oscilloscope(Oscilloscope const&); // = delete; - Oscilloscope& operator=(Oscilloscope const&); // = delete; - - // state variables - - unsigned _width; - unsigned _height; - short* _samples; - short* _vertices; - unsigned _writePos[MAX_CHANNELS]; - - float _lowPassCoeff; - unsigned _downsampleRatio; - unsigned _colors[MAX_CHANNELS]; -}; - -#endif // hifi_Oscilloscope_h From f27f8e39c8950701684ad4f931f986838447e19c Mon Sep 17 00:00:00 2001 From: Andrew Meadows Date: Wed, 9 Apr 2014 17:22:17 -0700 Subject: [PATCH 091/120] example JS for handling avatar collisions --- examples/avatarCollision.js | 68 +++++++++++++++++++++++++++++++++++++ 1 file changed, 68 insertions(+) create mode 100644 examples/avatarCollision.js diff --git a/examples/avatarCollision.js b/examples/avatarCollision.js new file mode 100644 index 0000000000..5ade894365 --- /dev/null +++ b/examples/avatarCollision.js @@ -0,0 +1,68 @@ +// +// avatarCollision.js +// examples +// +// Created by Andrew Meadows on 2014-04-09 +// Copyright 2014 High Fidelity, Inc. +// +// Play a sound on collisions with your avatar +// +// Distributed under the Apache License, Version 2.0. +// See the accompanying file LICENSE or http://www.apache.org/licenses/LICENSE-2.0.html +// + +var SOUND_TRIGGER_CLEAR = 1000; // milliseconds +var SOUND_TRIGGER_DELAY = 200; // milliseconds +var soundExpiry = 0; +var DateObj = new Date(); +var audioOptions = new AudioInjectionOptions(); +audioOptions.volume = 0.5; +audioOptions.position = { x: 0, y: 0, z: 0 }; + +var hitSounds = new Array(); +hitSounds[0] = new Sound("http://highfidelity-public.s3-us-west-1.amazonaws.com/sounds/Collisions-hitsandslaps/Hit1.raw"); +hitSounds[1] = new Sound("http://highfidelity-public.s3-us-west-1.amazonaws.com/sounds/Collisions-hitsandslaps/Hit2.raw"); +hitSounds[2] = new Sound("http://highfidelity-public.s3-us-west-1.amazonaws.com/sounds/Collisions-hitsandslaps/Hit3.raw"); +hitSounds[3] = new Sound("http://highfidelity-public.s3-us-west-1.amazonaws.com/sounds/Collisions-hitsandslaps/Hit4.raw"); +hitSounds[4] = new Sound("http://highfidelity-public.s3-us-west-1.amazonaws.com/sounds/Collisions-hitsandslaps/Hit5.raw"); +hitSounds[5] = new Sound("http://highfidelity-public.s3-us-west-1.amazonaws.com/sounds/Collisions-hitsandslaps/Hit6.raw"); +hitSounds[6] = new Sound("http://highfidelity-public.s3-us-west-1.amazonaws.com/sounds/Collisions-hitsandslaps/Hit7.raw"); +hitSounds[7] = new Sound("http://highfidelity-public.s3-us-west-1.amazonaws.com/sounds/Collisions-hitsandslaps/Hit8.raw"); +hitSounds[8] = new Sound("http://highfidelity-public.s3-us-west-1.amazonaws.com/sounds/Collisions-hitsandslaps/Hit9.raw"); +hitSounds[9] = new Sound("http://highfidelity-public.s3-us-west-1.amazonaws.com/sounds/Collisions-hitsandslaps/Hit10.raw"); +hitSounds[10] = new Sound("http://highfidelity-public.s3-us-west-1.amazonaws.com/sounds/Collisions-hitsandslaps/Hit11.raw"); +hitSounds[11] = new Sound("http://highfidelity-public.s3-us-west-1.amazonaws.com/sounds/Collisions-hitsandslaps/Hit12.raw"); +hitSounds[12] = new Sound("http://highfidelity-public.s3-us-west-1.amazonaws.com/sounds/Collisions-hitsandslaps/Hit13.raw"); +hitSounds[13] = new Sound("http://highfidelity-public.s3-us-west-1.amazonaws.com/sounds/Collisions-hitsandslaps/Hit14.raw"); +hitSounds[14] = new Sound("http://highfidelity-public.s3-us-west-1.amazonaws.com/sounds/Collisions-hitsandslaps/Hit15.raw"); +hitSounds[15] = new Sound("http://highfidelity-public.s3-us-west-1.amazonaws.com/sounds/Collisions-hitsandslaps/Hit16.raw"); +hitSounds[16] = new Sound("http://highfidelity-public.s3-us-west-1.amazonaws.com/sounds/Collisions-hitsandslaps/Hit17.raw"); +hitSounds[17] = new Sound("http://highfidelity-public.s3-us-west-1.amazonaws.com/sounds/Collisions-hitsandslaps/Hit18.raw"); +hitSounds[18] = new Sound("http://highfidelity-public.s3-us-west-1.amazonaws.com/sounds/Collisions-hitsandslaps/Hit19.raw"); +hitSounds[19] = new Sound("http://highfidelity-public.s3-us-west-1.amazonaws.com/sounds/Collisions-hitsandslaps/Hit20.raw"); +hitSounds[20] = new Sound("http://highfidelity-public.s3-us-west-1.amazonaws.com/sounds/Collisions-hitsandslaps/Hit21.raw"); +hitSounds[21] = new Sound("http://highfidelity-public.s3-us-west-1.amazonaws.com/sounds/Collisions-hitsandslaps/Hit22.raw"); + +function playHitSound(mySessionID, theirSessionID, collision) { + var now = new Date(); + var msec = now.getTime(); + if (msec > soundExpiry) { + // this is a new contact --> play a new sound + var soundIndex = Math.floor((Math.random() * hitSounds.length) % hitSounds.length); + audioOptions.position = collision.contactPoint; + Audio.playSound(hitSounds[soundIndex], audioOptions); + + // bump the expiry + soundExpiry = msec + SOUND_TRIGGER_CLEAR; + + // log the collision info + Uuid.print("my sessionID = ", mySessionID); + Uuid.print(" their sessionID = ", theirSessionID); + Vec3.print(" penetration = ", collision.penetration); + Vec3.print(" contactPoint = ", collision.contactPoint); + } else { + // this is a recurring contact --> continue to delay sound trigger + soundExpiry = msec + SOUND_TRIGGER_DELAY; + } +} +MyAvatar.collisionWithAvatar.connect(playHitSound); From c88be1ac3475e446bcc874bc96fe0fde13fd3df2 Mon Sep 17 00:00:00 2001 From: Andrew Meadows Date: Wed, 9 Apr 2014 17:26:05 -0700 Subject: [PATCH 092/120] remove unnecessary change --- interface/src/avatar/MyAvatar.cpp | 1 - 1 file changed, 1 deletion(-) diff --git a/interface/src/avatar/MyAvatar.cpp b/interface/src/avatar/MyAvatar.cpp index 3c358646a9..72c8544165 100644 --- a/interface/src/avatar/MyAvatar.cpp +++ b/interface/src/avatar/MyAvatar.cpp @@ -23,7 +23,6 @@ #include #include #include -#include #include From 2b44b03a27d8e9461355db4fd9f64a3345725b40 Mon Sep 17 00:00:00 2001 From: Atlante45 Date: Wed, 9 Apr 2014 17:34:17 -0700 Subject: [PATCH 093/120] Added temp fix to ModelUploader dialog too --- interface/src/Application.cpp | 10 ++++++---- interface/src/ModelUploader.cpp | 26 ++++++++++++++++++++++---- 2 files changed, 28 insertions(+), 8 deletions(-) diff --git a/interface/src/Application.cpp b/interface/src/Application.cpp index acd4e07c6a..a6d4819016 100644 --- a/interface/src/Application.cpp +++ b/interface/src/Application.cpp @@ -344,6 +344,9 @@ Application::Application(int& argc, char** argv, timeval &startup_time) : } else { // do this as late as possible so that all required subsystems are inialized loadScripts(); + + QMutexLocker locker(&_settingsMutex); + _previousScriptLocation = _settings->value("LastScriptLocation", QVariant("")).toString(); } } @@ -3184,11 +3187,10 @@ void Application::packetSent(quint64 length) { void Application::loadScripts() { // loads all saved scripts - - lockSettings(); - int size = _settings->beginReadArray("Settings"); + int size = lockSettings()->beginReadArray("Settings"); + unlockSettings(); for (int i = 0; i < size; ++i){ - _settings->setArrayIndex(i); + lockSettings()->setArrayIndex(i); QString string = _settings->value("script").toString(); unlockSettings(); if (!string.isEmpty()) { diff --git a/interface/src/ModelUploader.cpp b/interface/src/ModelUploader.cpp index 3f496c9890..ddb7c57cf3 100644 --- a/interface/src/ModelUploader.cpp +++ b/interface/src/ModelUploader.cpp @@ -20,7 +20,9 @@ #include +#include "Application.h" #include "renderer/FBXReader.h" + #include "ModelUploader.h" @@ -32,6 +34,8 @@ static const QString LOD_FIELD = "lod"; static const QString S3_URL = "http://highfidelity-public.s3-us-west-1.amazonaws.com"; static const QString MODEL_URL = "/api/v1/models"; +static const QString SETTING_NAME = "LastModelUploadLocation"; + static const int MAX_SIZE = 10 * 1024 * 1024; // 10 MB static const int TIMEOUT = 1000; static const int MAX_CHECK = 30; @@ -49,6 +53,7 @@ ModelUploader::ModelUploader(bool isHead) : _numberOfChecks(MAX_CHECK) { connect(&_timer, SIGNAL(timeout()), SLOT(checkS3())); + } ModelUploader::~ModelUploader() { @@ -57,14 +62,27 @@ ModelUploader::~ModelUploader() { bool ModelUploader::zip() { // File Dialog - QString filename = QFileDialog::getOpenFileName(NULL, - "Select your .fst file ...", - QStandardPaths::writableLocation(QStandardPaths::HomeLocation), - "*.fst"); + QSettings* settings = Application::getInstance()->lockSettings(); + QString lastLocation = settings->value(SETTING_NAME).toString(); + + if (lastLocation.isEmpty()) { + lastLocation = QStandardPaths::writableLocation(QStandardPaths::DownloadLocation); + // Temporary fix to Qt bug: http://stackoverflow.com/questions/16194475 +#ifdef __APPLE__ + lastLocation.append("/model.fst"); +#endif + } + + + QString filename = QFileDialog::getOpenFileName(NULL, "Select your .fst file ...", lastLocation, "*.fst"); if (filename == "") { // If the user canceled we return. + Application::getInstance()->unlockSettings(); return false; } + settings->setValue(SETTING_NAME, filename); + Application::getInstance()->unlockSettings(); + bool _nameIsPresent = false; QString texDir; QString fbxFile; From ef89b8c3868602fd1a582973ed9890bd49dc7b2e Mon Sep 17 00:00:00 2001 From: Atlante45 Date: Wed, 9 Apr 2014 17:37:37 -0700 Subject: [PATCH 094/120] Removed extra line --- interface/src/ModelUploader.cpp | 1 - 1 file changed, 1 deletion(-) diff --git a/interface/src/ModelUploader.cpp b/interface/src/ModelUploader.cpp index 4c3a6758fe..d22097a00c 100644 --- a/interface/src/ModelUploader.cpp +++ b/interface/src/ModelUploader.cpp @@ -55,7 +55,6 @@ ModelUploader::ModelUploader(bool isHead) : _numberOfChecks(MAX_CHECK) { connect(&_timer, SIGNAL(timeout()), SLOT(checkS3())); - } ModelUploader::~ModelUploader() { From 9f58264cb692f6518013e7da8cecdfbba2c8974e Mon Sep 17 00:00:00 2001 From: Andrzej Kapolka Date: Wed, 9 Apr 2014 18:07:56 -0700 Subject: [PATCH 095/120] Working on plane collisions, pushing back camera from intersecting avatars. --- interface/src/Application.cpp | 13 ++++ interface/src/avatar/Avatar.cpp | 5 ++ interface/src/avatar/Avatar.h | 6 ++ interface/src/renderer/Model.cpp | 15 +++++ interface/src/renderer/Model.h | 2 + libraries/shared/src/PlaneShape.h | 30 +++++++++ libraries/shared/src/Shape.h | 1 + libraries/shared/src/ShapeCollider.cpp | 86 ++++++++++++++++++++++++++ libraries/shared/src/ShapeCollider.h | 43 +++++++++++++ 9 files changed, 201 insertions(+) create mode 100644 libraries/shared/src/PlaneShape.h diff --git a/interface/src/Application.cpp b/interface/src/Application.cpp index 6005ae085e..f91ede9f3e 100644 --- a/interface/src/Application.cpp +++ b/interface/src/Application.cpp @@ -522,6 +522,19 @@ void Application::paintGL() { _myCamera.setTargetPosition(_myAvatar->getHead()->calculateAverageEyePosition()); _myCamera.setTargetRotation(_myAvatar->getHead()->getCameraOrientation()); + // push camera out of any intersecting avatars + float pushback = 0.0f; + foreach (const AvatarSharedPointer& avatarData, _avatarManager.getAvatarHash()) { + Avatar* avatar = static_cast(avatarData.data()); + const float RADIUS_MULTIPLIER = 2.0f; + CollisionList collisions(4); + if (!avatar->isMyAvatar() && avatar->findSphereCollisions(_myCamera.getTargetPosition(), + _myCamera.getNearClip() * RADIUS_MULTIPLIER, collisions)) { + for (int i = 0; i < collisions.size(); i++) { + collisions.getCollision(i)->_penetration; + } + } + } } else if (_myCamera.getMode() == CAMERA_MODE_THIRD_PERSON) { _myCamera.setTightness(0.0f); // Camera is directly connected to head without smoothing _myCamera.setTargetPosition(_myAvatar->getUprightHeadPosition()); diff --git a/interface/src/avatar/Avatar.cpp b/interface/src/avatar/Avatar.cpp index 47ced025aa..70a328eeea 100644 --- a/interface/src/avatar/Avatar.cpp +++ b/interface/src/avatar/Avatar.cpp @@ -522,6 +522,11 @@ bool Avatar::findSphereCollisions(const glm::vec3& penetratorCenter, float penet //return getHead()->getFaceModel().findSphereCollisions(penetratorCenter, penetratorRadius, collisions); } +bool Avatar::findPlaneCollisions(const glm::vec4& plane, CollisionList& collisions) { + return _skeletonModel.findPlaneCollisions(plane, collisions) || + getHead()->getFaceModel().findPlaneCollisions(plane, collisions); +} + void Avatar::updateShapePositions() { _skeletonModel.updateShapePositions(); Model& headModel = getHead()->getFaceModel(); diff --git a/interface/src/avatar/Avatar.h b/interface/src/avatar/Avatar.h index 4e24c00c7e..78a815cca5 100755 --- a/interface/src/avatar/Avatar.h +++ b/interface/src/avatar/Avatar.h @@ -119,6 +119,12 @@ public: bool findSphereCollisions(const glm::vec3& penetratorCenter, float penetratorRadius, CollisionList& collisions, int skeletonSkipIndex = -1); + /// Checks for penetration between the described plane and the avatar. + /// \param plane the penetration plane + /// \param collisions[out] a list to which collisions get appended + /// \return whether or not the plane penetrated + bool findPlaneCollisions(const glm::vec4& plane, CollisionList& collisions); + /// Checks for collision between the a spherical particle and the avatar (including paddle hands) /// \param collisionCenter the center of particle's bounding sphere /// \param collisionRadius the radius of particle's bounding sphere diff --git a/interface/src/renderer/Model.cpp b/interface/src/renderer/Model.cpp index 819d1164c0..2635c6a8bc 100644 --- a/interface/src/renderer/Model.cpp +++ b/interface/src/renderer/Model.cpp @@ -634,6 +634,21 @@ bool Model::findSphereCollisions(const glm::vec3& sphereCenter, float sphereRadi return collided; } +bool Model::findPlaneCollisions(const glm::vec4& plane, CollisionList& collisions) { + bool collided = false; + PlaneShape planeShape(plane); + for (int i = 0; i < _jointShapes.size(); i++) { + if (ShapeCollider::shapeShape(&planeShape, _jointShapes[i], collisions)) { + CollisionInfo* collision = collisions.getLastCollision(); + collision->_type = MODEL_COLLISION; + collision->_data = (void*)(this); + collision->_flags = i; + collided = true; + } + } + return collided; +} + class Blender : public QRunnable { public: diff --git a/interface/src/renderer/Model.h b/interface/src/renderer/Model.h index 30625cc16f..65b79fffdd 100644 --- a/interface/src/renderer/Model.h +++ b/interface/src/renderer/Model.h @@ -176,6 +176,8 @@ public: bool findSphereCollisions(const glm::vec3& penetratorCenter, float penetratorRadius, CollisionList& collisions, int skipIndex = -1); + + bool findPlaneCollisions(const glm::vec4& plane, CollisionList& collisions); /// \param collision details about the collisions /// \return true if the collision is against a moveable joint diff --git a/libraries/shared/src/PlaneShape.h b/libraries/shared/src/PlaneShape.h new file mode 100644 index 0000000000..11823da701 --- /dev/null +++ b/libraries/shared/src/PlaneShape.h @@ -0,0 +1,30 @@ +// +// PlaneShape.h +// libraries/shared/src +// +// Created by Andrzej Kapolka on 4/9/2014. +// Copyright 2014 High Fidelity, Inc. +// +// 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_PlaneShape_h +#define hifi_PlaneShape_h + +#include "Shape.h" + +class PlaneShape : public Shape { +public: + PlaneShape() : Shape(Shape::PLANE_SHAPE) {} + + PlaneShape(const glm::vec4& coefficients) : Shape(Shape::PLANE_SHAPE), _coefficients(coefficients) { } + + const glm::vec4& getCoefficients() const { return _coefficients; } + +private: + + glm::vec4 _coefficients; +}; + +#endif // hifi_PlaneShape_h diff --git a/libraries/shared/src/Shape.h b/libraries/shared/src/Shape.h index fd16eafeae..87b84ea73b 100644 --- a/libraries/shared/src/Shape.h +++ b/libraries/shared/src/Shape.h @@ -22,6 +22,7 @@ public: UNKNOWN_SHAPE = 0, SPHERE_SHAPE, CAPSULE_SHAPE, + PLANE_SHAPE, BOX_SHAPE, LIST_SHAPE }; diff --git a/libraries/shared/src/ShapeCollider.cpp b/libraries/shared/src/ShapeCollider.cpp index b13775dfa8..15b01719af 100644 --- a/libraries/shared/src/ShapeCollider.cpp +++ b/libraries/shared/src/ShapeCollider.cpp @@ -13,6 +13,7 @@ #include +#include "GeometryUtil.h" #include "ShapeCollider.h" // NOTE: @@ -33,6 +34,8 @@ bool shapeShape(const Shape* shapeA, const Shape* shapeB, CollisionList& collisi return sphereSphere(sphereA, static_cast(shapeB), collisions); } else if (typeB == Shape::CAPSULE_SHAPE) { return sphereCapsule(sphereA, static_cast(shapeB), collisions); + } else if (typeB == Shape::PLANE_SHAPE) { + return spherePlane(sphereA, static_cast(shapeB), collisions); } } else if (typeA == Shape::CAPSULE_SHAPE) { const CapsuleShape* capsuleA = static_cast(shapeA); @@ -40,6 +43,17 @@ bool shapeShape(const Shape* shapeA, const Shape* shapeB, CollisionList& collisi return capsuleSphere(capsuleA, static_cast(shapeB), collisions); } else if (typeB == Shape::CAPSULE_SHAPE) { return capsuleCapsule(capsuleA, static_cast(shapeB), collisions); + } else if (typeB == Shape::PLANE_SHAPE) { + return capsulePlane(capsuleA, static_cast(shapeB), collisions); + } + } else if (typeA == Shape::PLANE_SHAPE) { + const PlaneShape* planeA = static_cast(shapeA); + if (typeB == Shape::SPHERE_SHAPE) { + return planeSphere(planeA, static_cast(shapeB), collisions); + } else if (typeB == Shape::CAPSULE_SHAPE) { + return planeCapsule(planeA, static_cast(shapeB), collisions); + } else if (typeB == Shape::PLANE_SHAPE) { + return planePlane(planeA, static_cast(shapeB), collisions); } } else if (typeA == Shape::LIST_SHAPE) { const ListShape* listA = static_cast(shapeA); @@ -47,6 +61,8 @@ bool shapeShape(const Shape* shapeA, const Shape* shapeB, CollisionList& collisi return listSphere(listA, static_cast(shapeB), collisions); } else if (typeB == Shape::CAPSULE_SHAPE) { return listCapsule(listA, static_cast(shapeB), collisions); + } else if (typeB == Shape::PLANE_SHAPE) { + return listPlane(listA, static_cast(shapeB), collisions); } } return false; @@ -143,6 +159,20 @@ bool sphereCapsule(const SphereShape* sphereA, const CapsuleShape* capsuleB, Col return false; } +bool spherePlane(const SphereShape* sphereA, const PlaneShape* planeB, CollisionList& collisions) { + glm::vec3 penetration; + if (findSpherePlanePenetration(sphereA->getPosition(), sphereA->getRadius(), planeB->getCoefficients(), penetration)) { + CollisionInfo* collision = collisions.getNewCollision(); + if (!collision) { + return false; // collision list is full + } + collision->_penetration = penetration; + collision->_contactPoint = glm::vec3(); + return true; + } + return false; +} + bool capsuleSphere(const CapsuleShape* capsuleA, const SphereShape* sphereB, CollisionList& collisions) { // find sphereB's closest approach to axis of capsuleA glm::vec3 AB = capsuleA->getPosition() - sphereB->getPosition(); @@ -349,6 +379,22 @@ bool capsuleCapsule(const CapsuleShape* capsuleA, const CapsuleShape* capsuleB, return false; } +bool capsulePlane(const CapsuleShape* capsuleA, const PlaneShape* planeB, CollisionList& collisions) { + return false; +} + +bool planeSphere(const PlaneShape* planeA, const SphereShape* sphereB, CollisionList& collisions) { + return false; +} + +bool planeCapsule(const PlaneShape* planeA, const CapsuleShape* capsuleB, CollisionList& collisions) { + return false; +} + +bool planePlane(const PlaneShape* planeA, const PlaneShape* planeB, CollisionList& collisions) { + return false; +} + bool sphereList(const SphereShape* sphereA, const ListShape* listB, CollisionList& collisions) { bool touching = false; for (int i = 0; i < listB->size() && !collisions.isFull(); ++i) { @@ -358,6 +404,8 @@ bool sphereList(const SphereShape* sphereA, const ListShape* listB, CollisionLis touching = sphereSphere(sphereA, static_cast(subShape), collisions) || touching; } else if (subType == Shape::CAPSULE_SHAPE) { touching = sphereCapsule(sphereA, static_cast(subShape), collisions) || touching; + } else if (subType == Shape::PLANE_SHAPE) { + touching = spherePlane(sphereA, static_cast(subShape), collisions) || touching; } } return touching; @@ -372,6 +420,24 @@ bool capsuleList(const CapsuleShape* capsuleA, const ListShape* listB, Collision touching = capsuleSphere(capsuleA, static_cast(subShape), collisions) || touching; } else if (subType == Shape::CAPSULE_SHAPE) { touching = capsuleCapsule(capsuleA, static_cast(subShape), collisions) || touching; + } else if (subType == Shape::PLANE_SHAPE) { + touching = capsulePlane(capsuleA, static_cast(subShape), collisions) || touching; + } + } + return touching; +} + +bool planeList(const PlaneShape* planeA, const ListShape* listB, CollisionList& collisions) { + bool touching = false; + for (int i = 0; i < listB->size() && !collisions.isFull(); ++i) { + const Shape* subShape = listB->getSubShape(i); + int subType = subShape->getType(); + if (subType == Shape::SPHERE_SHAPE) { + touching = planeSphere(planeA, static_cast(subShape), collisions) || touching; + } else if (subType == Shape::CAPSULE_SHAPE) { + touching = planeCapsule(planeA, static_cast(subShape), collisions) || touching; + } else if (subType == Shape::PLANE_SHAPE) { + touching = planePlane(planeA, static_cast(subShape), collisions) || touching; } } return touching; @@ -386,6 +452,8 @@ bool listSphere(const ListShape* listA, const SphereShape* sphereB, CollisionLis touching = sphereSphere(static_cast(subShape), sphereB, collisions) || touching; } else if (subType == Shape::CAPSULE_SHAPE) { touching = capsuleSphere(static_cast(subShape), sphereB, collisions) || touching; + } else if (subType == Shape::PLANE_SHAPE) { + touching = planeSphere(static_cast(subShape), sphereB, collisions) || touching; } } return touching; @@ -400,6 +468,24 @@ bool listCapsule(const ListShape* listA, const CapsuleShape* capsuleB, Collision touching = sphereCapsule(static_cast(subShape), capsuleB, collisions) || touching; } else if (subType == Shape::CAPSULE_SHAPE) { touching = capsuleCapsule(static_cast(subShape), capsuleB, collisions) || touching; + } else if (subType == Shape::PLANE_SHAPE) { + touching = planeCapsule(static_cast(subShape), capsuleB, collisions) || touching; + } + } + return touching; +} + +bool listPlane(const ListShape* listA, const PlaneShape* planeB, CollisionList& collisions) { + bool touching = false; + for (int i = 0; i < listA->size() && !collisions.isFull(); ++i) { + const Shape* subShape = listA->getSubShape(i); + int subType = subShape->getType(); + if (subType == Shape::SPHERE_SHAPE) { + touching = spherePlane(static_cast(subShape), planeB, collisions) || touching; + } else if (subType == Shape::CAPSULE_SHAPE) { + touching = capsulePlane(static_cast(subShape), planeB, collisions) || touching; + } else if (subType == Shape::PLANE_SHAPE) { + touching = planePlane(static_cast(subShape), planeB, collisions) || touching; } } return touching; diff --git a/libraries/shared/src/ShapeCollider.h b/libraries/shared/src/ShapeCollider.h index 7f02acf15c..0e6dac208c 100644 --- a/libraries/shared/src/ShapeCollider.h +++ b/libraries/shared/src/ShapeCollider.h @@ -15,6 +15,7 @@ #include "CapsuleShape.h" #include "CollisionInfo.h" #include "ListShape.h" +#include "PlaneShape.h" #include "SharedUtil.h" #include "SphereShape.h" @@ -38,6 +39,12 @@ namespace ShapeCollider { /// \return true if shapes collide bool sphereCapsule(const SphereShape* sphereA, const CapsuleShape* capsuleB, CollisionList& collisions); + /// \param sphereA pointer to first shape + /// \param planeB pointer to second shape + /// \param[out] collisions where to append collision details + /// \return true if shapes collide + bool spherePlane(const SphereShape* sphereA, const PlaneShape* planeB, CollisionList& collisions); + /// \param capsuleA pointer to first shape /// \param sphereB pointer to second shape /// \param[out] collisions where to append collision details @@ -50,6 +57,30 @@ namespace ShapeCollider { /// \return true if shapes collide bool capsuleCapsule(const CapsuleShape* capsuleA, const CapsuleShape* capsuleB, CollisionList& collisions); + /// \param capsuleA pointer to first shape + /// \param planeB pointer to second shape + /// \param[out] collisions where to append collision details + /// \return true if shapes collide + bool capsulePlane(const CapsuleShape* capsuleA, const PlaneShape* planeB, CollisionList& collisions); + + /// \param planeA pointer to first shape + /// \param sphereB pointer to second shape + /// \param[out] collisions where to append collision details + /// \return true if shapes collide + bool planeSphere(const PlaneShape* planeA, const SphereShape* sphereB, CollisionList& collisions); + + /// \param planeA pointer to first shape + /// \param capsuleB pointer to second shape + /// \param[out] collisions where to append collision details + /// \return true if shapes collide + bool planeCapsule(const PlaneShape* planeA, const CapsuleShape* capsuleB, CollisionList& collisions); + + /// \param planeA pointer to first shape + /// \param planeB pointer to second shape + /// \param[out] collisions where to append collision details + /// \return true if shapes collide + bool planePlane(const PlaneShape* planeA, const PlaneShape* planeB, CollisionList& collisions); + /// \param sphereA pointer to first shape /// \param listB pointer to second shape /// \param[out] collisions where to append collision details @@ -62,6 +93,12 @@ namespace ShapeCollider { /// \return true if shapes collide bool capsuleList(const CapsuleShape* capsuleA, const ListShape* listB, CollisionList& collisions); + /// \param planeA pointer to first shape + /// \param listB pointer to second shape + /// \param[out] collisions where to append collision details + /// \return true if shapes collide + bool planeList(const PlaneShape* planeA, const ListShape* listB, CollisionList& collisions); + /// \param listA pointer to first shape /// \param sphereB pointer to second shape /// \param[out] collisions where to append collision details @@ -74,6 +111,12 @@ namespace ShapeCollider { /// \return true if shapes collide bool listCapsule(const ListShape* listA, const CapsuleShape* capsuleB, CollisionList& collisions); + /// \param listA pointer to first shape + /// \param planeB pointer to second shape + /// \param[out] collisions where to append collision details + /// \return true if shapes collide + bool listPlane(const ListShape* listA, const PlaneShape* planeB, CollisionList& collisions); + /// \param listA pointer to first shape /// \param capsuleB pointer to second shape /// \param[out] collisions where to append collision details From 825acbbd9cfe529745af12a45cf5a6e8efa1532d Mon Sep 17 00:00:00 2001 From: Thijs Wenker Date: Thu, 10 Apr 2014 10:47:21 +0200 Subject: [PATCH 096/120] Update ScriptEngine.cpp DWORD is not defined in UNIX based systems. int should be fine --- libraries/script-engine/src/ScriptEngine.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libraries/script-engine/src/ScriptEngine.cpp b/libraries/script-engine/src/ScriptEngine.cpp index c5c1fdb2bf..c857e1193a 100644 --- a/libraries/script-engine/src/ScriptEngine.cpp +++ b/libraries/script-engine/src/ScriptEngine.cpp @@ -93,7 +93,7 @@ ScriptEngine::ScriptEngine(const QUrl& scriptURL, QUrl url(scriptURL); // if the scheme length is one or lower, maybe they typed in a file, let's try - const DWORD WINDOWS_DRIVE_LETTER_SIZE = 1; + const int WINDOWS_DRIVE_LETTER_SIZE = 1; if (url.scheme().size() <= WINDOWS_DRIVE_LETTER_SIZE) { url = QUrl::fromLocalFile(scriptURLString); } From 4942e93daacf3298feac28f89105888dcb3ceb99 Mon Sep 17 00:00:00 2001 From: Andrew Meadows Date: Thu, 10 Apr 2014 07:53:11 -0700 Subject: [PATCH 097/120] replace .f with .0f as per coding standard --- interface/src/avatar/Avatar.cpp | 28 +++++++++++++------------- libraries/shared/src/ShapeCollider.cpp | 28 +++++++++++++------------- 2 files changed, 28 insertions(+), 28 deletions(-) diff --git a/interface/src/avatar/Avatar.cpp b/interface/src/avatar/Avatar.cpp index 47ced025aa..698d58c25a 100644 --- a/interface/src/avatar/Avatar.cpp +++ b/interface/src/avatar/Avatar.cpp @@ -233,22 +233,22 @@ void Avatar::render(const glm::vec3& cameraPosition, RenderMode renderMode) { // quick check before falling into the code below: // (a 10 degree breadth of an almost 2 meter avatar kicks in at about 12m) - const float MIN_VOICE_SPHERE_DISTANCE = 12.f; + const float MIN_VOICE_SPHERE_DISTANCE = 12.0f; if (distanceToTarget > MIN_VOICE_SPHERE_DISTANCE) { // render voice intensity sphere for avatars that are farther away - const float MAX_SPHERE_ANGLE = 10.f * RADIANS_PER_DEGREE; - const float MIN_SPHERE_ANGLE = 1.f * RADIANS_PER_DEGREE; + const float MAX_SPHERE_ANGLE = 10.0f * RADIANS_PER_DEGREE; + const float MIN_SPHERE_ANGLE = 1.0f * RADIANS_PER_DEGREE; const float MIN_SPHERE_SIZE = 0.01f; const float SPHERE_LOUDNESS_SCALING = 0.0005f; const float SPHERE_COLOR[] = { 0.5f, 0.8f, 0.8f }; float height = getSkeletonHeight(); - glm::vec3 delta = height * (getHead()->getCameraOrientation() * IDENTITY_UP) / 2.f; + glm::vec3 delta = height * (getHead()->getCameraOrientation() * IDENTITY_UP) / 2.0f; float angle = abs(angleBetween(toTarget + delta, toTarget - delta)); float sphereRadius = getHead()->getAverageLoudness() * SPHERE_LOUDNESS_SCALING; if (renderMode == NORMAL_RENDER_MODE && (sphereRadius > MIN_SPHERE_SIZE) && (angle < MAX_SPHERE_ANGLE) && (angle > MIN_SPHERE_ANGLE)) { - glColor4f(SPHERE_COLOR[0], SPHERE_COLOR[1], SPHERE_COLOR[2], 1.f - angle / MAX_SPHERE_ANGLE); + glColor4f(SPHERE_COLOR[0], SPHERE_COLOR[1], SPHERE_COLOR[2], 1.0f - angle / MAX_SPHERE_ANGLE); glPushMatrix(); glTranslatef(_position.x, _position.y, _position.z); glScalef(height, height, height); @@ -280,9 +280,9 @@ void Avatar::render(const glm::vec3& cameraPosition, RenderMode renderMode) { glm::vec3 chatAxis = glm::axis(chatRotation); glRotatef(glm::degrees(glm::angle(chatRotation)), chatAxis.x, chatAxis.y, chatAxis.z); - glColor3f(0.f, 0.8f, 0.f); - glRotatef(180.f, 0.f, 1.f, 0.f); - glRotatef(180.f, 0.f, 0.f, 1.f); + glColor3f(0.0f, 0.8f, 0.0f); + glRotatef(180.0f, 0.0f, 1.0f, 0.0f); + glRotatef(180.0f, 0.0f, 0.0f, 1.0f); glScalef(_scale * CHAT_MESSAGE_SCALE, _scale * CHAT_MESSAGE_SCALE, 1.0f); glDisable(GL_LIGHTING); @@ -298,7 +298,7 @@ void Avatar::render(const glm::vec3& cameraPosition, RenderMode renderMode) { _chatMessage[lastIndex] = '\0'; textRenderer(CHAT)->draw(-width / 2.0f, 0, _chatMessage.c_str()); _chatMessage[lastIndex] = lastChar; - glColor3f(0.f, 1.f, 0.f); + glColor3f(0.0f, 1.0f, 0.0f); textRenderer(CHAT)->draw(width / 2.0f - lastWidth, 0, _chatMessage.c_str() + lastIndex); } glEnable(GL_LIGHTING); @@ -550,7 +550,7 @@ bool Avatar::findParticleCollisions(const glm::vec3& particleCenter, float parti const PalmData* palm = handData->getPalm(i); if (palm && palm->hasPaddle()) { // create a disk collision proxy where the hand is - glm::vec3 fingerAxis(0.f); + glm::vec3 fingerAxis(0.0f); for (size_t f = 0; f < palm->getNumFingers(); ++f) { const FingerData& finger = (palm->getFingers())[f]; if (finger.isActive()) { @@ -692,8 +692,8 @@ void Avatar::renderJointConnectingCone(glm::vec3 position1, glm::vec3 position2, glm::vec3 perpCos = glm::normalize(glm::cross(axis, perpSin)); perpSin = glm::cross(perpCos, axis); - float anglea = 0.f; - float angleb = 0.f; + float anglea = 0.0f; + float angleb = 0.0f; for (int i = 0; i < NUM_BODY_CONE_SIDES; i ++) { @@ -743,8 +743,8 @@ void Avatar::updateCollisionFlags() { void Avatar::setScale(float scale) { _scale = scale; - if (_targetScale * (1.f - RESCALING_TOLERANCE) < _scale && - _scale < _targetScale * (1.f + RESCALING_TOLERANCE)) { + if (_targetScale * (1.0f - RESCALING_TOLERANCE) < _scale && + _scale < _targetScale * (1.0f + RESCALING_TOLERANCE)) { _scale = _targetScale; } } diff --git a/libraries/shared/src/ShapeCollider.cpp b/libraries/shared/src/ShapeCollider.cpp index 217009ecf3..32789aa388 100644 --- a/libraries/shared/src/ShapeCollider.cpp +++ b/libraries/shared/src/ShapeCollider.cpp @@ -63,8 +63,8 @@ bool collideShapesCoarse(const QVector& shapesA, const QVector 0) { - glm::vec3 totalPenetration(0.f); - glm::vec3 averageContactPoint(0.f); + glm::vec3 totalPenetration(0.0f); + glm::vec3 averageContactPoint(0.0f); for (int j = 0; j < tempCollisions.size(); ++j) { CollisionInfo* c = tempCollisions.getCollision(j); totalPenetration = addPenetrations(totalPenetration, c->_penetration); @@ -86,7 +86,7 @@ bool sphereSphere(const SphereShape* sphereA, const SphereShape* sphereB, Collis float distance = sqrtf(distanceSquared); if (distance < EPSILON) { // the spheres are on top of each other, so we pick an arbitrary penetration direction - BA = glm::vec3(0.f, 1.f, 0.f); + BA = glm::vec3(0.0f, 1.0f, 0.0f); distance = totalRadius; } else { BA /= distance; @@ -121,7 +121,7 @@ bool sphereCapsule(const SphereShape* sphereA, const CapsuleShape* capsuleB, Col } if (absAxialDistance > capsuleB->getHalfHeight()) { // sphere hits capsule on a cap --> recompute radialAxis to point from spherA to cap center - float sign = (axialDistance > 0.f) ? 1.f : -1.f; + float sign = (axialDistance > 0.0f) ? 1.0f : -1.0f; radialAxis = BA + (sign * capsuleB->getHalfHeight()) * capsuleAxis; radialDistance2 = glm::length2(radialAxis); if (radialDistance2 > totalRadius2) { @@ -153,12 +153,12 @@ bool sphereCapsule(const SphereShape* sphereA, const CapsuleShape* capsuleB, Col return false; } // ... but still defined for the cap case - if (axialDistance < 0.f) { + if (axialDistance < 0.0f) { // we're hitting the start cap, so we negate the capsuleAxis capsuleAxis *= -1; } // penetration points from A into B - float sign = (axialDistance > 0.f) ? -1.f : 1.f; + float sign = (axialDistance > 0.0f) ? -1.0f : 1.0f; collision->_penetration = (sign * (totalRadius + capsuleB->getHalfHeight() - absAxialDistance)) * capsuleAxis; // contactPoint is on surface of sphereA collision->_contactPoint = sphereA->getPosition() + (sign * sphereA->getRadius()) * capsuleAxis; @@ -191,7 +191,7 @@ bool capsuleSphere(const CapsuleShape* capsuleA, const SphereShape* sphereB, Col if (absAxialDistance > capsuleA->getHalfHeight()) { // sphere hits capsule on a cap // --> recompute radialAxis and closestApproach - float sign = (axialDistance > 0.f) ? 1.f : -1.f; + float sign = (axialDistance > 0.0f) ? 1.0f : -1.0f; closestApproach = capsuleA->getPosition() + (sign * capsuleA->getHalfHeight()) * capsuleAxis; radialAxis = closestApproach - sphereB->getPosition(); radialDistance2 = glm::length2(radialAxis); @@ -224,11 +224,11 @@ bool capsuleSphere(const CapsuleShape* capsuleA, const SphereShape* sphereB, Col return false; } // ... but still defined for the cap case - if (axialDistance < 0.f) { + if (axialDistance < 0.0f) { // we're hitting the start cap, so we negate the capsuleAxis capsuleAxis *= -1; } - float sign = (axialDistance > 0.f) ? 1.f : -1.f; + float sign = (axialDistance > 0.0f) ? 1.0f : -1.0f; collision->_penetration = (sign * (totalRadius + capsuleA->getHalfHeight() - absAxialDistance)) * capsuleAxis; // contactPoint is on surface of sphereA collision->_contactPoint = closestApproach + (sign * capsuleA->getRadius()) * capsuleAxis; @@ -251,7 +251,7 @@ bool capsuleCapsule(const CapsuleShape* capsuleA, const CapsuleShape* capsuleB, // d = [(B - A) . (a - (a.b)b)] / (1 - (a.b)^2) float aDotB = glm::dot(axisA, axisB); - float denominator = 1.f - aDotB * aDotB; + float denominator = 1.0f - aDotB * aDotB; float totalRadius = capsuleA->getRadius() + capsuleB->getRadius(); if (denominator > EPSILON) { // distances to points of closest approach @@ -261,12 +261,12 @@ bool capsuleCapsule(const CapsuleShape* capsuleA, const CapsuleShape* capsuleB, // clamp the distances to the ends of the capsule line segments float absDistanceA = fabs(distanceA); if (absDistanceA > capsuleA->getHalfHeight() + capsuleA->getRadius()) { - float signA = distanceA < 0.f ? -1.f : 1.f; + float signA = distanceA < 0.0f ? -1.0f : 1.0f; distanceA = signA * capsuleA->getHalfHeight(); } float absDistanceB = fabs(distanceB); if (absDistanceB > capsuleB->getHalfHeight() + capsuleB->getRadius()) { - float signB = distanceB < 0.f ? -1.f : 1.f; + float signB = distanceB < 0.0f ? -1.0f : 1.0f; distanceB = signB * capsuleB->getHalfHeight(); } @@ -293,7 +293,7 @@ bool capsuleCapsule(const CapsuleShape* capsuleA, const CapsuleShape* capsuleB, { // the capsule centers are on top of each other! // give up on a valid penetration direction and just use the yAxis - BA = glm::vec3(0.f, 1.f, 0.f); + BA = glm::vec3(0.0f, 1.0f, 0.0f); distance = glm::max(capsuleB->getRadius(), capsuleA->getRadius()); } } else { @@ -325,7 +325,7 @@ bool capsuleCapsule(const CapsuleShape* capsuleA, const CapsuleShape* capsuleB, float distance = sqrtf(distanceSquared); if (distance < EPSILON) { // the spheres are on top of each other, so we pick an arbitrary penetration direction - BA = glm::vec3(0.f, 1.f, 0.f); + BA = glm::vec3(0.0f, 1.0f, 0.0f); } else { BA /= distance; } From f9fb8b46a54ee2518a10c64a50a6d8cd0f415f5f Mon Sep 17 00:00:00 2001 From: Andrew Meadows Date: Thu, 10 Apr 2014 07:53:39 -0700 Subject: [PATCH 098/120] adding names to arguments in collisionWithAvatar() declaration --- interface/src/avatar/Avatar.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/interface/src/avatar/Avatar.h b/interface/src/avatar/Avatar.h index 2dd7b6b037..cad0ddcdf0 100755 --- a/interface/src/avatar/Avatar.h +++ b/interface/src/avatar/Avatar.h @@ -64,7 +64,7 @@ enum ScreenTintLayer { // Where one's own Avatar begins in the world (will be overwritten if avatar data file is found) // this is basically in the center of the ground plane. Slightly adjusted. This was asked for by // Grayson as he's building a street around here for demo dinner 2 -const glm::vec3 START_LOCATION(0.485f * TREE_SCALE, 0.f, 0.5f * TREE_SCALE); +const glm::vec3 START_LOCATION(0.485f * TREE_SCALE, 0.0f, 0.5f * TREE_SCALE); class Texture; @@ -156,7 +156,7 @@ public slots: void updateCollisionFlags(); signals: - void collisionWithAvatar(const QUuid&, const QUuid&, const CollisionInfo&); + void collisionWithAvatar(const QUuid& myUUID, const QUuid& theirUUID, const CollisionInfo& collision); protected: SkeletonModel _skeletonModel; From a12dd916fafe29cdc532c267af84e169c1392ab0 Mon Sep 17 00:00:00 2001 From: Andrzej Kapolka Date: Thu, 10 Apr 2014 11:24:45 -0700 Subject: [PATCH 099/120] More plane intersection bits. --- interface/src/renderer/Model.cpp | 2 +- libraries/shared/src/PlaneShape.h | 10 ++---- libraries/shared/src/ShapeCollider.cpp | 43 +++++++++++++++++++++++++- 3 files changed, 45 insertions(+), 10 deletions(-) diff --git a/interface/src/renderer/Model.cpp b/interface/src/renderer/Model.cpp index a317ddc07a..2d47a077b7 100644 --- a/interface/src/renderer/Model.cpp +++ b/interface/src/renderer/Model.cpp @@ -638,7 +638,7 @@ bool Model::findPlaneCollisions(const glm::vec4& plane, CollisionList& collision bool collided = false; PlaneShape planeShape(plane); for (int i = 0; i < _jointShapes.size(); i++) { - if (ShapeCollider::shapeShape(&planeShape, _jointShapes[i], collisions)) { + if (ShapeCollider::collideShapes(&planeShape, _jointShapes[i], collisions)) { CollisionInfo* collision = collisions.getLastCollision(); collision->_type = MODEL_COLLISION; collision->_data = (void*)(this); diff --git a/libraries/shared/src/PlaneShape.h b/libraries/shared/src/PlaneShape.h index 11823da701..524d53ec73 100644 --- a/libraries/shared/src/PlaneShape.h +++ b/libraries/shared/src/PlaneShape.h @@ -16,15 +16,9 @@ class PlaneShape : public Shape { public: - PlaneShape() : Shape(Shape::PLANE_SHAPE) {} - - PlaneShape(const glm::vec4& coefficients) : Shape(Shape::PLANE_SHAPE), _coefficients(coefficients) { } + PlaneShape(const glm::vec4& coefficients = glm::vec4(0.0f, 1.0f, 0.0f, 0.0f)); - const glm::vec4& getCoefficients() const { return _coefficients; } - -private: - - glm::vec4 _coefficients; + glm::vec4 getCoefficients() const; }; #endif // hifi_PlaneShape_h diff --git a/libraries/shared/src/ShapeCollider.cpp b/libraries/shared/src/ShapeCollider.cpp index 10211f1d78..c53c7fab7d 100644 --- a/libraries/shared/src/ShapeCollider.cpp +++ b/libraries/shared/src/ShapeCollider.cpp @@ -191,7 +191,7 @@ bool spherePlane(const SphereShape* sphereA, const PlaneShape* planeB, Collision return false; // collision list is full } collision->_penetration = penetration; - collision->_contactPoint = glm::vec3(); + collision->_contactPoint = sphereA->getPosition() + sphereA->getRadius() * glm::normalize(penetration); return true; } return false; @@ -404,18 +404,59 @@ bool capsuleCapsule(const CapsuleShape* capsuleA, const CapsuleShape* capsuleB, } bool capsulePlane(const CapsuleShape* capsuleA, const PlaneShape* planeB, CollisionList& collisions) { + glm::vec3 start, end, penetration; + capsuleA->getStartPoint(start); + capsuleA->getEndPoint(end); + glm::vec4 plane = planeB->getCoefficients(); + if (findCapsulePlanePenetration(start, end, capsuleA->getRadius(), plane, penetration)) { + CollisionInfo* collision = collisions.getNewCollision(); + if (!collision) { + return false; // collision list is full + } + collision->_penetration = penetration; + glm::vec3 deepestEnd = (glm::dot(start, glm::vec3(plane)) < glm::dot(end, glm::vec3(plane))) ? start : end; + collision->_contactPoint = deepestEnd + capsuleA->getRadius() * glm::normalize(penetration); + return true; + } return false; } bool planeSphere(const PlaneShape* planeA, const SphereShape* sphereB, CollisionList& collisions) { + glm::vec3 penetration; + if (findSpherePlanePenetration(sphereB->getPosition(), sphereB->getRadius(), planeA->getCoefficients(), penetration)) { + CollisionInfo* collision = collisions.getNewCollision(); + if (!collision) { + return false; // collision list is full + } + collision->_penetration = -penetration; + collision->_contactPoint = sphereB->getPosition() + + (sphereB->getRadius() / glm::length(penetration) - 1.0f) * penetration; + return true; + } return false; } bool planeCapsule(const PlaneShape* planeA, const CapsuleShape* capsuleB, CollisionList& collisions) { + glm::vec3 start, end, penetration; + capsuleB->getStartPoint(start); + capsuleB->getEndPoint(end); + glm::vec4 plane = planeA->getCoefficients(); + if (findCapsulePlanePenetration(start, end, capsuleB->getRadius(), plane, penetration)) { + CollisionInfo* collision = collisions.getNewCollision(); + if (!collision) { + return false; // collision list is full + } + collision->_penetration = -penetration; + glm::vec3 deepestEnd = (glm::dot(start, glm::vec3(plane)) < glm::dot(end, glm::vec3(plane))) ? start : end; + collision->_contactPoint = deepestEnd + (capsuleB->getRadius() / glm::length(penetration) - 1.0f) * penetration; + return true; + } return false; } bool planePlane(const PlaneShape* planeA, const PlaneShape* planeB, CollisionList& collisions) { + // technically, planes always collide unless they're parallel and not coincident; however, that's + // not going to give us any useful information return false; } From 2cc21496478cb5aea6852f69fd80dff9e5fd7c46 Mon Sep 17 00:00:00 2001 From: Atlante45 Date: Thu, 10 Apr 2014 11:54:14 -0700 Subject: [PATCH 100/120] Glow when you talk, flash when you clip closes #2592 --- interface/src/Application.cpp | 6 ++++++ interface/src/Util.cpp | 4 ++-- interface/src/Util.h | 2 +- interface/src/avatar/Avatar.cpp | 5 ++++- 4 files changed, 13 insertions(+), 4 deletions(-) diff --git a/interface/src/Application.cpp b/interface/src/Application.cpp index f6b0d37dd4..ad216458bd 100644 --- a/interface/src/Application.cpp +++ b/interface/src/Application.cpp @@ -2557,6 +2557,12 @@ void Application::displayOverlay() { } bool isClipping = ((_audio.getTimeSinceLastClip() > 0.f) && (_audio.getTimeSinceLastClip() < CLIPPING_INDICATOR_TIME)); + + if ((_audio.getTimeSinceLastClip() > 0.f) && (_audio.getTimeSinceLastClip() < CLIPPING_INDICATOR_TIME)) { + const float MAX_MAGNITUDE = 0.7f; + float magnitude = MAX_MAGNITUDE * (1 - _audio.getTimeSinceLastClip() / CLIPPING_INDICATOR_TIME); + renderCollisionOverlay(_glWidget->width(), _glWidget->height(), magnitude, 1.0f); + } _audio.renderToolBox(MIRROR_VIEW_LEFT_PADDING + AUDIO_METER_GAP, audioMeterY, diff --git a/interface/src/Util.cpp b/interface/src/Util.cpp index 36e39a46a5..cecc363daa 100644 --- a/interface/src/Util.cpp +++ b/interface/src/Util.cpp @@ -351,10 +351,10 @@ void drawvec3(int x, int y, float scale, float radians, float thick, int mono, g glPopMatrix(); } -void renderCollisionOverlay(int width, int height, float magnitude) { +void renderCollisionOverlay(int width, int height, float magnitude, float red, float blue, float green) { const float MIN_VISIBLE_COLLISION = 0.01f; if (magnitude > MIN_VISIBLE_COLLISION) { - glColor4f(0, 0, 0, magnitude); + glColor4f(red, blue, green, magnitude); glBegin(GL_QUADS); glVertex2f(0, 0); glVertex2d(width, 0); diff --git a/interface/src/Util.h b/interface/src/Util.h index 4f0e76adf8..ac680645a9 100644 --- a/interface/src/Util.h +++ b/interface/src/Util.h @@ -62,7 +62,7 @@ float extractUniformScale(const glm::vec3& scale); double diffclock(timeval *clock1,timeval *clock2); -void renderCollisionOverlay(int width, int height, float magnitude); +void renderCollisionOverlay(int width, int height, float magnitude, float red = 0, float blue = 0, float green = 0); void renderOrientationDirections( glm::vec3 position, const glm::quat& orientation, float size ); diff --git a/interface/src/avatar/Avatar.cpp b/interface/src/avatar/Avatar.cpp index 698d58c25a..1107bcd21a 100644 --- a/interface/src/avatar/Avatar.cpp +++ b/interface/src/avatar/Avatar.cpp @@ -210,7 +210,10 @@ void Avatar::render(const glm::vec3& cameraPosition, RenderMode renderMode) { { // glow when moving far away const float GLOW_DISTANCE = 20.0f; - Glower glower(_moving && distanceToTarget > GLOW_DISTANCE && renderMode == NORMAL_RENDER_MODE ? 1.0f : 0.0f); + const float GLOW_MAX_LOUDNESS = 2500.0f; + const float MAX_GLOW = 0.7f; + const float GLOW_FROM_AVERAGE_LOUDNESS = MAX_GLOW * getHeadData()->getAudioLoudness() / GLOW_MAX_LOUDNESS; + Glower glower(_moving && distanceToTarget > GLOW_DISTANCE && renderMode == NORMAL_RENDER_MODE ? 1.0f : GLOW_FROM_AVERAGE_LOUDNESS); // render body if (Menu::getInstance()->isOptionChecked(MenuOption::Avatars)) { From 873541dd7bcfae76691e6b9b12d0f429db8bdf32 Mon Sep 17 00:00:00 2001 From: Andrzej Kapolka Date: Thu, 10 Apr 2014 11:56:17 -0700 Subject: [PATCH 101/120] Trying out basic pushback for other avatars. --- interface/src/Application.cpp | 30 +++++++++++++++++------- libraries/shared/src/PlaneShape.cpp | 36 +++++++++++++++++++++++++++++ 2 files changed, 58 insertions(+), 8 deletions(-) create mode 100644 libraries/shared/src/PlaneShape.cpp diff --git a/interface/src/Application.cpp b/interface/src/Application.cpp index de612c80c0..d90b5835e5 100644 --- a/interface/src/Application.cpp +++ b/interface/src/Application.cpp @@ -519,6 +519,7 @@ void Application::paintGL() { glEnable(GL_LINE_SMOOTH); + const float PUSHBACK_RADIUS = 0.2f; if (OculusManager::isConnected()) { _myCamera.setUpShift(0.0f); _myCamera.setDistance(0.0f); @@ -531,18 +532,32 @@ void Application::paintGL() { _myCamera.setTargetPosition(_myAvatar->getHead()->calculateAverageEyePosition()); _myCamera.setTargetRotation(_myAvatar->getHead()->getCameraOrientation()); + glm::vec3 planeNormal = _myCamera.getTargetRotation() * IDENTITY_FRONT; + float combinedRadius = _myCamera.getNearClip() + _myAvatar->getScale() * PUSHBACK_RADIUS; + glm::vec4 plane(planeNormal, -glm::dot(planeNormal, _myCamera.getTargetPosition()) - combinedRadius); + // push camera out of any intersecting avatars float pushback = 0.0f; foreach (const AvatarSharedPointer& avatarData, _avatarManager.getAvatarHash()) { Avatar* avatar = static_cast(avatarData.data()); - const float RADIUS_MULTIPLIER = 2.0f; - CollisionList collisions(4); - if (!avatar->isMyAvatar() && avatar->findSphereCollisions(_myCamera.getTargetPosition(), - _myCamera.getNearClip() * RADIUS_MULTIPLIER, collisions)) { - for (int i = 0; i < collisions.size(); i++) { - collisions.getCollision(i)->_penetration; - } + if (avatar->isMyAvatar()) { + continue; } + if (glm::distance(avatar->getPosition(), _myCamera.getTargetPosition()) > + avatar->getBoundingRadius() + combinedRadius) { + continue; + } + CollisionList collisions(4); + if (!avatar->findPlaneCollisions(plane, collisions)) { + continue; + } + for (int i = 0; i < collisions.size(); i++) { + pushback = qMax(pushback, glm::length(collisions.getCollision(i)->_penetration)); + } + } + if (pushback > 0.0f) { + _myCamera.setTargetPosition(_myCamera.getTargetPosition() + + _myCamera.getTargetRotation() * glm::vec3(0.0f, 0.0f, pushback)); } } else if (_myCamera.getMode() == CAMERA_MODE_THIRD_PERSON) { _myCamera.setTightness(0.0f); // Camera is directly connected to head without smoothing @@ -560,7 +575,6 @@ void Application::paintGL() { // if the head would intersect the near clip plane, we must push the camera out glm::vec3 relativePosition = glm::inverse(_myCamera.getTargetRotation()) * (eyePosition - _myCamera.getTargetPosition()); - const float PUSHBACK_RADIUS = 0.2f; float pushback = relativePosition.z + _myCamera.getNearClip() + _myAvatar->getScale() * PUSHBACK_RADIUS - _myCamera.getDistance(); if (pushback > 0.0f) { diff --git a/libraries/shared/src/PlaneShape.cpp b/libraries/shared/src/PlaneShape.cpp new file mode 100644 index 0000000000..a8b4468c93 --- /dev/null +++ b/libraries/shared/src/PlaneShape.cpp @@ -0,0 +1,36 @@ +// +// PlaneShape.cpp +// libraries/shared/src +// +// Created by Andrzej Kapolka on 4/10/2014. +// Copyright 2014 High Fidelity, Inc. +// +// Distributed under the Apache License, Version 2.0. +// See the accompanying file LICENSE or http://www.apache.org/licenses/LICENSE-2.0.html +// + +#include "PlaneShape.h" +#include "SharedUtil.h" + +const glm::vec3 UNROTATED_NORMAL(0.0f, 1.0f, 0.0f); + +PlaneShape::PlaneShape(const glm::vec4& coefficients) : + Shape(Shape::PLANE_SHAPE) { + + glm::vec3 normal = glm::vec3(coefficients); + _position = -normal * coefficients.w; + + float angle = acosf(glm::dot(normal, UNROTATED_NORMAL)); + if (angle > EPSILON) { + if (angle > PI - EPSILON) { + _rotation = glm::angleAxis(PI, glm::vec3(1.0f, 0.0f, 0.0f)); + } else { + _rotation = glm::angleAxis(angle, glm::normalize(glm::cross(UNROTATED_NORMAL, normal))); + } + } +} + +glm::vec4 PlaneShape::getCoefficients() const { + glm::vec3 normal = _rotation * UNROTATED_NORMAL; + return glm::vec4(normal.x, normal.y, normal.z, -glm::dot(normal, _position)); +} From ea93be15f1b59df4c2568f0ab65d6f37cb54d612 Mon Sep 17 00:00:00 2001 From: Atlante45 Date: Thu, 10 Apr 2014 12:44:51 -0700 Subject: [PATCH 102/120] Fixed dometime using wrong texdir --- interface/src/ModelUploader.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/interface/src/ModelUploader.cpp b/interface/src/ModelUploader.cpp index d22097a00c..edbc6c0ad9 100644 --- a/interface/src/ModelUploader.cpp +++ b/interface/src/ModelUploader.cpp @@ -307,13 +307,13 @@ bool ModelUploader::addTextures(const QString& texdir, const QString fbxFile) { foreach (FBXMesh mesh, geometry.meshes) { foreach (FBXMeshPart part, mesh.parts) { if (!part.diffuseFilename.isEmpty()) { - if (!addPart(QFileInfo(fbxFile).path() + "/" + part.diffuseFilename, + if (!addPart(texdir + "/" + part.diffuseFilename, QString("texture%1").arg(++_texturesCount))) { return false; } } if (!part.normalFilename.isEmpty()) { - if (!addPart(QFileInfo(fbxFile).path() + "/" + part.normalFilename, + if (!addPart(texdir + "/" + part.normalFilename, QString("texture%1").arg(++_texturesCount))) { return false; } From ac9ead36e29baf63709c017e1f746817bd21aa39 Mon Sep 17 00:00:00 2001 From: Andrew Meadows Date: Thu, 10 Apr 2014 13:10:24 -0700 Subject: [PATCH 103/120] fix crash: don't access null action In particular, don't crash on pressing Enter when lacking qxmpp support --- interface/src/Menu.cpp | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/interface/src/Menu.cpp b/interface/src/Menu.cpp index 8eead4acdc..80007da485 100644 --- a/interface/src/Menu.cpp +++ b/interface/src/Menu.cpp @@ -707,7 +707,12 @@ bool Menu::isOptionChecked(const QString& menuOption) { } void Menu::triggerOption(const QString& menuOption) { - _actionHash.value(menuOption)->trigger(); + QAction* action = _actionHash.value(menuOption); + if (action) { + action->trigger(); + } else { + qDebug() << "NULL Action for menuOption '" << menuOption << "'"; + } } QAction* Menu::getActionForOption(const QString& menuOption) { From 9c662acc9d6dba0202c27044f5c4299d73c6b81d Mon Sep 17 00:00:00 2001 From: Atlante45 Date: Thu, 10 Apr 2014 14:40:35 -0700 Subject: [PATCH 104/120] Modified max glow + don't glow you own avatar --- interface/src/avatar/Avatar.cpp | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/interface/src/avatar/Avatar.cpp b/interface/src/avatar/Avatar.cpp index 1107bcd21a..4a6d0fbcf2 100644 --- a/interface/src/avatar/Avatar.cpp +++ b/interface/src/avatar/Avatar.cpp @@ -211,9 +211,13 @@ void Avatar::render(const glm::vec3& cameraPosition, RenderMode renderMode) { // glow when moving far away const float GLOW_DISTANCE = 20.0f; const float GLOW_MAX_LOUDNESS = 2500.0f; - const float MAX_GLOW = 0.7f; - const float GLOW_FROM_AVERAGE_LOUDNESS = MAX_GLOW * getHeadData()->getAudioLoudness() / GLOW_MAX_LOUDNESS; - Glower glower(_moving && distanceToTarget > GLOW_DISTANCE && renderMode == NORMAL_RENDER_MODE ? 1.0f : GLOW_FROM_AVERAGE_LOUDNESS); + const float MAX_GLOW = 0.5f; + const float GLOW_FROM_AVERAGE_LOUDNESS = ((this == Application::getInstance()->getAvatar()) + ? 0.0f + : MAX_GLOW * getHeadData()->getAudioLoudness() / GLOW_MAX_LOUDNESS); + Glower glower(_moving && distanceToTarget > GLOW_DISTANCE && renderMode == NORMAL_RENDER_MODE + ? 1.0f + : GLOW_FROM_AVERAGE_LOUDNESS); // render body if (Menu::getInstance()->isOptionChecked(MenuOption::Avatars)) { From 6cf971c849b6d9dd623aa4f40e29310709102202 Mon Sep 17 00:00:00 2001 From: Andrzej Kapolka Date: Thu, 10 Apr 2014 14:51:43 -0700 Subject: [PATCH 105/120] More intersection-avoidance tweaks. --- interface/src/Application.cpp | 21 ++++++++++++--------- interface/src/avatar/MyAvatar.cpp | 2 +- 2 files changed, 13 insertions(+), 10 deletions(-) diff --git a/interface/src/Application.cpp b/interface/src/Application.cpp index d90b5835e5..2ab73c9daf 100644 --- a/interface/src/Application.cpp +++ b/interface/src/Application.cpp @@ -519,7 +519,6 @@ void Application::paintGL() { glEnable(GL_LINE_SMOOTH); - const float PUSHBACK_RADIUS = 0.2f; if (OculusManager::isConnected()) { _myCamera.setUpShift(0.0f); _myCamera.setDistance(0.0f); @@ -533,8 +532,9 @@ void Application::paintGL() { _myCamera.setTargetRotation(_myAvatar->getHead()->getCameraOrientation()); glm::vec3 planeNormal = _myCamera.getTargetRotation() * IDENTITY_FRONT; - float combinedRadius = _myCamera.getNearClip() + _myAvatar->getScale() * PUSHBACK_RADIUS; - glm::vec4 plane(planeNormal, -glm::dot(planeNormal, _myCamera.getTargetPosition()) - combinedRadius); + const float BASE_PUSHBACK_RADIUS = 0.25f; + float pushbackRadius = _myCamera.getNearClip() + _myAvatar->getScale() * BASE_PUSHBACK_RADIUS; + glm::vec4 plane(planeNormal, -glm::dot(planeNormal, _myCamera.getTargetPosition()) - pushbackRadius); // push camera out of any intersecting avatars float pushback = 0.0f; @@ -544,10 +544,11 @@ void Application::paintGL() { continue; } if (glm::distance(avatar->getPosition(), _myCamera.getTargetPosition()) > - avatar->getBoundingRadius() + combinedRadius) { + avatar->getBoundingRadius() + pushbackRadius) { continue; } - CollisionList collisions(4); + static CollisionList collisions(64); + collisions.clear(); if (!avatar->findPlaneCollisions(plane, collisions)) { continue; } @@ -555,10 +556,11 @@ void Application::paintGL() { pushback = qMax(pushback, glm::length(collisions.getCollision(i)->_penetration)); } } - if (pushback > 0.0f) { - _myCamera.setTargetPosition(_myCamera.getTargetPosition() + - _myCamera.getTargetRotation() * glm::vec3(0.0f, 0.0f, pushback)); - } + const float MAX_PUSHBACK = 0.35f; + const float PUSHBACK_DECAY = 0.5f; + _myCamera.setDistance(qMax(qMin(pushback, MAX_PUSHBACK * _myAvatar->getScale()), + _myCamera.getDistance() * PUSHBACK_DECAY)); + } else if (_myCamera.getMode() == CAMERA_MODE_THIRD_PERSON) { _myCamera.setTightness(0.0f); // Camera is directly connected to head without smoothing _myCamera.setTargetPosition(_myAvatar->getUprightHeadPosition()); @@ -575,6 +577,7 @@ void Application::paintGL() { // if the head would intersect the near clip plane, we must push the camera out glm::vec3 relativePosition = glm::inverse(_myCamera.getTargetRotation()) * (eyePosition - _myCamera.getTargetPosition()); + const float PUSHBACK_RADIUS = 0.2f; float pushback = relativePosition.z + _myCamera.getNearClip() + _myAvatar->getScale() * PUSHBACK_RADIUS - _myCamera.getDistance(); if (pushback > 0.0f) { diff --git a/interface/src/avatar/MyAvatar.cpp b/interface/src/avatar/MyAvatar.cpp index 7a05c593db..a4f4cce79d 100644 --- a/interface/src/avatar/MyAvatar.cpp +++ b/interface/src/avatar/MyAvatar.cpp @@ -647,7 +647,7 @@ void MyAvatar::renderBody(RenderMode renderMode) { _skeletonModel.render(1.0f, modelRenderMode); // Render head so long as the camera isn't inside it - const float RENDER_HEAD_CUTOFF_DISTANCE = 0.40f; + const float RENDER_HEAD_CUTOFF_DISTANCE = 0.50f; Camera* myCamera = Application::getInstance()->getCamera(); if (renderMode != NORMAL_RENDER_MODE || (glm::length(myCamera->getPosition() - getHead()->calculateAverageEyePosition()) > RENDER_HEAD_CUTOFF_DISTANCE * _scale)) { From f0463a5679eb9ce774582403b1bd57ba5e7b88d8 Mon Sep 17 00:00:00 2001 From: Thijs Wenker Date: Fri, 11 Apr 2014 00:45:38 +0200 Subject: [PATCH 106/120] Fixed docking of ChatWindow Temporary Pin Icon, replace with a nice looking one please --- interface/resources/images/pin.svg | 98 ++++++++++++++++++++++++ interface/resources/images/pinned.svg | 106 ++++++++++++++++++++++++++ interface/resources/resources.qrc | 2 + interface/src/Menu.cpp | 2 +- interface/src/ui/ChatWindow.cpp | 19 ++++- interface/src/ui/ChatWindow.h | 2 + interface/ui/chatWindow.ui | 57 +++++++++++++- 7 files changed, 283 insertions(+), 3 deletions(-) create mode 100644 interface/resources/images/pin.svg create mode 100644 interface/resources/images/pinned.svg diff --git a/interface/resources/images/pin.svg b/interface/resources/images/pin.svg new file mode 100644 index 0000000000..ec968a1ec1 --- /dev/null +++ b/interface/resources/images/pin.svg @@ -0,0 +1,98 @@ + + + + + + image/svg+xml + + Slice 1 + + + + + Slice 1 + Created with Sketch (http://www.bohemiancoding.com/sketch) + + + + + + + + diff --git a/interface/resources/images/pinned.svg b/interface/resources/images/pinned.svg new file mode 100644 index 0000000000..bda6f0e747 --- /dev/null +++ b/interface/resources/images/pinned.svg @@ -0,0 +1,106 @@ + + + + + + image/svg+xml + + Slice 1 + + + + + Slice 1 + Created with Sketch (http://www.bohemiancoding.com/sketch) + + + + + + + + + diff --git a/interface/resources/resources.qrc b/interface/resources/resources.qrc index 35c0e40270..40428f0f80 100644 --- a/interface/resources/resources.qrc +++ b/interface/resources/resources.qrc @@ -4,5 +4,7 @@ images/kill-script.svg images/reload.svg images/stop.svg + images/pin.svg + images/pinned.svg diff --git a/interface/src/Menu.cpp b/interface/src/Menu.cpp index 8eead4acdc..9408f18c24 100644 --- a/interface/src/Menu.cpp +++ b/interface/src/Menu.cpp @@ -1207,7 +1207,7 @@ void Menu::showMetavoxelEditor() { void Menu::showChat() { QMainWindow* mainWindow = Application::getInstance()->getWindow(); if (!_chatWindow) { - mainWindow->addDockWidget(Qt::NoDockWidgetArea, _chatWindow = new ChatWindow()); + mainWindow->addDockWidget(Qt::RightDockWidgetArea, _chatWindow = new ChatWindow()); } if (!_chatWindow->toggleViewAction()->isChecked()) { int width = _chatWindow->width(); diff --git a/interface/src/ui/ChatWindow.cpp b/interface/src/ui/ChatWindow.cpp index 0060cb839c..8a83ba680b 100644 --- a/interface/src/ui/ChatWindow.cpp +++ b/interface/src/ui/ChatWindow.cpp @@ -12,10 +12,12 @@ #include #include #include +#include #include #include #include #include +#include #include "Application.h" #include "FlowLayout.h" @@ -35,7 +37,9 @@ ChatWindow::ChatWindow() : { ui->setupUi(this); - // remove the title bar (see the Qt docs on setTitleBarWidget) + // remove the title bar (see the Qt docs on setTitleBarWidget), but we keep it for undocking + // + titleBar = titleBarWidget(); setTitleBarWidget(new QWidget()); FlowLayout* flowLayout = new FlowLayout(0, 4, 4); @@ -260,3 +264,16 @@ void ChatWindow::messageReceived(const QXmppMessage& message) { } #endif + +void ChatWindow::togglePinned() { + QMainWindow* mainWindow = Application::getInstance()->getWindow(); + mainWindow->removeDockWidget(this); + if (ui->togglePinnedButton->isChecked()) { + mainWindow->addDockWidget(ui->togglePinnedButton->isChecked() ? Qt::RightDockWidgetArea : Qt::NoDockWidgetArea, this); + } + if (!this->toggleViewAction()->isChecked()) { + this->toggleViewAction()->trigger(); + } + this->setFloating(!ui->togglePinnedButton->isChecked()); + setTitleBarWidget(ui->togglePinnedButton->isChecked()?new QWidget():titleBar); +} \ No newline at end of file diff --git a/interface/src/ui/ChatWindow.h b/interface/src/ui/ChatWindow.h index cb9619cc42..614afc1ef1 100644 --- a/interface/src/ui/ChatWindow.h +++ b/interface/src/ui/ChatWindow.h @@ -50,12 +50,14 @@ private: void addTimeStamp(); Ui::ChatWindow* ui; + QWidget* titleBar; int numMessagesAfterLastTimeStamp; QDateTime lastMessageStamp; private slots: void connected(); void timeout(); + void togglePinned(); #ifdef HAVE_QXMPP void error(QXmppClient::Error error); void participantsChanged(); diff --git a/interface/ui/chatWindow.ui b/interface/ui/chatWindow.ui index 60a0c6badd..c46e692fc6 100644 --- a/interface/ui/chatWindow.ui +++ b/interface/ui/chatWindow.ui @@ -20,7 +20,7 @@ font-family: Helvetica, Arial, sans-serif; - QDockWidget::NoDockWidgetFeatures + QDockWidget::DockWidgetFloatable|QDockWidget::DockWidgetMovable Qt::NoDockWidgetArea @@ -79,6 +79,45 @@ + + + + + 0 + 0 + + + + + 16 + 16 + + + + Qt::NoFocus + + + + + + + :/images/pin.svg + :/images/pinned.svg:/images/pin.svg + + + true + + + true + + + false + + + true + + + @@ -204,6 +243,22 @@ + + togglePinnedButton + clicked() + ChatWindow + togglePinned() + + + 390 + 42 + + + 550 + 42 + + + closeButton clicked() From 3af3b29588d0f9060425e5af4e1d00e5f7b2842b Mon Sep 17 00:00:00 2001 From: Stojce Slavkovski Date: Fri, 11 Apr 2014 00:54:54 +0200 Subject: [PATCH 107/120] removed dependency on QT resource --- interface/resources/styles/preferences.qss | 10 ++++++ interface/ui/preferencesDialog.ui | 42 +++++++++++++--------- 2 files changed, 35 insertions(+), 17 deletions(-) diff --git a/interface/resources/styles/preferences.qss b/interface/resources/styles/preferences.qss index ee587b70da..643fd13a77 100644 --- a/interface/resources/styles/preferences.qss +++ b/interface/resources/styles/preferences.qss @@ -9,3 +9,13 @@ QLabel#advancedTuningLabel { background-repeat: no-repeat; background-position: left center; } + +QPushButton#buttonBrowseHead, +QPushButton#buttonBrowseBody { + background-image: url(styles/search.svg); + background-repeat: no-repeat; + background-position: center center; + background-color: #fff; + border-radius: 0; + padding: 0; +} diff --git a/interface/ui/preferencesDialog.ui b/interface/ui/preferencesDialog.ui index f28bcde60c..a151a499c6 100644 --- a/interface/ui/preferencesDialog.ui +++ b/interface/ui/preferencesDialog.ui @@ -351,18 +351,23 @@ color: #0e7077 30 + + + 30 + 30 + + - background-color: #fff; -border-radius: 0; -padding: 0; + - - - :/styles/search.svg - + + + 30 + 30 + @@ -449,18 +454,23 @@ padding: 0; 30 + + + 30 + 30 + + - background-color: #fff; -border-radius: 0; -padding: 0; + - - - :/styles/search.svg - + + + 30 + 30 + @@ -1327,9 +1337,7 @@ padding: 0; 1 - - - + cancelButton From 66b6328687114ff429ac00b00f0103db316ac3ab Mon Sep 17 00:00:00 2001 From: Andrew Meadows Date: Thu, 10 Apr 2014 16:58:52 -0700 Subject: [PATCH 108/120] protection against bad avatar-avatar collisions Also with logging if we encounter incorrectly large penetration depths --- interface/src/avatar/MyAvatar.cpp | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/interface/src/avatar/MyAvatar.cpp b/interface/src/avatar/MyAvatar.cpp index 7a05c593db..6c69fd3e3a 100644 --- a/interface/src/avatar/MyAvatar.cpp +++ b/interface/src/avatar/MyAvatar.cpp @@ -62,6 +62,7 @@ MyAvatar::MyAvatar() : _isThrustOn(false), _thrustMultiplier(1.0f), _moveTarget(0,0,0), + _lastBodyPenetration(0.0f), _moveTargetStepCounter(0), _lookAtTargetAvatar(), _shouldRender(true), @@ -681,7 +682,7 @@ void MyAvatar::updateThrust(float deltaTime) { _thrust -= _driveKeys[DOWN] * _scale * THRUST_MAG_DOWN * _thrustMultiplier * deltaTime * up; // attenuate thrust when in penetration - if (glm::dot(_thrust, _lastBodyPenetration) > 0.0f) { + if (glm::dot(_thrust, _lastBodyPenetration) > EPSILON) { const float MAX_BODY_PENETRATION_DEPTH = 0.6f * _skeletonModel.getBoundingShapeRadius(); float penetrationFactor = glm::min(1.0f, glm::length(_lastBodyPenetration) / MAX_BODY_PENETRATION_DEPTH); glm::vec3 penetrationDirection = glm::normalize(_lastBodyPenetration); @@ -932,7 +933,11 @@ void MyAvatar::updateCollisionWithAvatars(float deltaTime) { CollisionInfo collision; if (ShapeCollider::collideShapesCoarse(myShapes, theirShapes, collision)) { - if (glm::length2(collision._penetration) > EPSILON) { + float penetrationDepth = glm::length(collision._penetration); + if (penetrationDepth > myBoundingRadius) { + qDebug() << "WARNING: ignoring avatar-avatar penetration depth " << penetrationDepth; + } + else if (penetrationDepth > EPSILON) { setPosition(getPosition() - BODY_COLLISION_RESOLUTION_FACTOR * collision._penetration); _lastBodyPenetration += collision._penetration; emit collisionWithAvatar(getSessionUUID(), avatar->getSessionUUID(), collision); From 197adce4debef454f373a40169341b8c8044723f Mon Sep 17 00:00:00 2001 From: Andrzej Kapolka Date: Thu, 10 Apr 2014 17:14:49 -0700 Subject: [PATCH 109/120] Fall intersection off with angle to other avatar. --- interface/src/Application.cpp | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/interface/src/Application.cpp b/interface/src/Application.cpp index 8caf339a75..1f7ca11d71 100644 --- a/interface/src/Application.cpp +++ b/interface/src/Application.cpp @@ -547,13 +547,19 @@ void Application::paintGL() { avatar->getBoundingRadius() + pushbackRadius) { continue; } + float angle = angleBetween(avatar->getPosition() - _myCamera.getTargetPosition(), planeNormal); + if (angle > PI_OVER_TWO) { + continue; + } + float scale = qMax(angle / PI_OVER_TWO, 0.0f); + scale = 1.0f - powf(scale, 4.0f); static CollisionList collisions(64); collisions.clear(); if (!avatar->findPlaneCollisions(plane, collisions)) { continue; } for (int i = 0; i < collisions.size(); i++) { - pushback = qMax(pushback, glm::length(collisions.getCollision(i)->_penetration)); + pushback = qMax(pushback, glm::length(collisions.getCollision(i)->_penetration) * scale); } } const float MAX_PUSHBACK = 0.35f; From a436b599718580f0325566f1af01e76449f8f876 Mon Sep 17 00:00:00 2001 From: Andrew Meadows Date: Thu, 10 Apr 2014 17:14:51 -0700 Subject: [PATCH 110/120] save settings for change in: identity, position --- interface/src/Application.cpp | 6 ++++++ interface/src/Application.h | 3 +++ interface/src/Menu.cpp | 2 +- interface/src/avatar/MyAvatar.cpp | 1 + interface/src/avatar/MyAvatar.h | 3 +++ interface/src/location/LocationManager.cpp | 4 ++-- interface/src/location/LocationManager.h | 1 - 7 files changed, 16 insertions(+), 4 deletions(-) diff --git a/interface/src/Application.cpp b/interface/src/Application.cpp index f6b0d37dd4..768009183e 100644 --- a/interface/src/Application.cpp +++ b/interface/src/Application.cpp @@ -250,6 +250,7 @@ Application::Application(int& argc, char** argv, timeval &startup_time) : QMetaObject::invokeMethod(&accountManager, "checkAndSignalForAccessToken", Qt::QueuedConnection); _settings = new QSettings(this); + _numChangedSettings = 0; // Check to see if the user passed in a command line option for loading a local // Voxel File. @@ -406,6 +407,7 @@ void Application::saveSettings() { _voxelImporter->saveSettings(_settings); } _settings->sync(); + _numChangedSettings = 0; } @@ -1271,6 +1273,9 @@ void Application::idle() { // After finishing all of the above work, restart the idle timer, allowing 2ms to process events. idleTimer->start(2); } + if (_numChangedSettings > 0) { + saveSettings(); + } } } @@ -1617,6 +1622,7 @@ void Application::init() { connect(_rearMirrorTools, SIGNAL(restoreView()), SLOT(restoreMirrorView())); connect(_rearMirrorTools, SIGNAL(shrinkView()), SLOT(shrinkMirrorView())); connect(_rearMirrorTools, SIGNAL(resetView()), SLOT(resetSensors())); + connect(_myAvatar, SIGNAL(transformChanged()), this, SLOT(bumpSettings())); } void Application::closeMirrorView() { diff --git a/interface/src/Application.h b/interface/src/Application.h index eedb866d53..278283a7e2 100644 --- a/interface/src/Application.h +++ b/interface/src/Application.h @@ -286,6 +286,8 @@ public slots: void uploadHead(); void uploadSkeleton(); + void bumpSettings() { ++_numChangedSettings; } + private slots: void timer(); void idle(); @@ -376,6 +378,7 @@ private: QNetworkAccessManager* _networkAccessManager; QMutex _settingsMutex; QSettings* _settings; + int _numChangedSettings; QUndoStack _undoStack; diff --git a/interface/src/Menu.cpp b/interface/src/Menu.cpp index 8eead4acdc..a074a7995b 100644 --- a/interface/src/Menu.cpp +++ b/interface/src/Menu.cpp @@ -898,6 +898,7 @@ void Menu::editPreferences() { if (shouldDispatchIdentityPacket) { applicationInstance->getAvatar()->sendIdentityPacket(); + applicationInstance->bumpSettings(); } applicationInstance->getAvatar()->getHead()->setPupilDilation(pupilDilation->value() / (float)pupilDilation->maximum()); @@ -1063,7 +1064,6 @@ void Menu::goToLocation() { QString currentLocation = QString("%1, %2, %3").arg(QString::number(avatarPos.x), QString::number(avatarPos.y), QString::number(avatarPos.z)); - QInputDialog coordinateDialog(Application::getInstance()->getWindow()); coordinateDialog.setWindowTitle("Go to Location"); coordinateDialog.setLabelText("Coordinate as x,y,z:"); diff --git a/interface/src/avatar/MyAvatar.cpp b/interface/src/avatar/MyAvatar.cpp index 8f77f6226a..e587f38ed0 100644 --- a/interface/src/avatar/MyAvatar.cpp +++ b/interface/src/avatar/MyAvatar.cpp @@ -1175,6 +1175,7 @@ void MyAvatar::goToLocationFromResponse(const QJsonObject& jsonObject) { glm::vec3 newPosition = glm::vec3(coordinateItems[0].toFloat(), coordinateItems[1].toFloat(), coordinateItems[2].toFloat()) - newOrientation * IDENTITY_FRONT * DISTANCE_TO_USER; setPosition(newPosition); + emit transformChanged(); } } diff --git a/interface/src/avatar/MyAvatar.h b/interface/src/avatar/MyAvatar.h index ec33847255..66ab322444 100644 --- a/interface/src/avatar/MyAvatar.h +++ b/interface/src/avatar/MyAvatar.h @@ -106,6 +106,9 @@ public slots: glm::vec3 getThrust() { return _thrust; }; void setThrust(glm::vec3 newThrust) { _thrust = newThrust; } +signals: + void transformChanged(); + private: bool _mousePressed; float _bodyPitchDelta; // degrees diff --git a/interface/src/location/LocationManager.cpp b/interface/src/location/LocationManager.cpp index 7d22dde040..8009551b6c 100644 --- a/interface/src/location/LocationManager.cpp +++ b/interface/src/location/LocationManager.cpp @@ -118,8 +118,6 @@ void LocationManager::checkForMultipleDestinations() { Application::getInstance()->getAvatar()->goToLocationFromResponse(_placeData); return; } - - emit locationChanged(); } } @@ -178,6 +176,7 @@ void LocationManager::goToOrientation(QString orientation) { glm::quat avatarOrientation = myAvatar->getOrientation(); if (newAvatarOrientation != avatarOrientation) { myAvatar->setOrientation(newAvatarOrientation); + emit myAvatar->transformChanged(); } } } @@ -211,6 +210,7 @@ bool LocationManager::goToDestination(QString destination) { qDebug("Going To Location: %f, %f, %f...", x, y, z); myAvatar->setPosition(newAvatarPos); + emit myAvatar->transformChanged(); } return true; diff --git a/interface/src/location/LocationManager.h b/interface/src/location/LocationManager.h index 26e1cb52d5..ac66b3d08b 100644 --- a/interface/src/location/LocationManager.h +++ b/interface/src/location/LocationManager.h @@ -48,7 +48,6 @@ private: signals: void creationCompleted(LocationManager::NamedLocationCreateResponse response); void multipleDestinationsFound(const QJsonObject& userData, const QJsonObject& placeData); - void locationChanged(); private slots: void namedLocationDataReceived(const QJsonObject& data); From af158a3a94b55d74db036c45131724eb58cf450f Mon Sep 17 00:00:00 2001 From: Andrew Meadows Date: Thu, 10 Apr 2014 17:34:12 -0700 Subject: [PATCH 111/120] save settings when any checkable menu item changes --- interface/src/Menu.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/interface/src/Menu.cpp b/interface/src/Menu.cpp index a074a7995b..ece747221e 100644 --- a/interface/src/Menu.cpp +++ b/interface/src/Menu.cpp @@ -683,6 +683,7 @@ QAction* Menu::addCheckableActionToQMenuAndActionHash(QMenu* destinationMenu, QAction::NoRole, menuItemLocation); action->setCheckable(true); action->setChecked(checked); + connect(action, SIGNAL(changed()), Application::getInstance(), SLOT(bumpSettings())); return action; } From d712588b3616d20ef865267cf3633d07f728fe34 Mon Sep 17 00:00:00 2001 From: Andrzej Kapolka Date: Thu, 10 Apr 2014 17:35:47 -0700 Subject: [PATCH 112/120] Better rolloff. --- interface/src/Application.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/interface/src/Application.cpp b/interface/src/Application.cpp index 1f7ca11d71..84ce1f7efe 100644 --- a/interface/src/Application.cpp +++ b/interface/src/Application.cpp @@ -551,8 +551,8 @@ void Application::paintGL() { if (angle > PI_OVER_TWO) { continue; } - float scale = qMax(angle / PI_OVER_TWO, 0.0f); - scale = 1.0f - powf(scale, 4.0f); + float scale = 1.0f - angle / PI_OVER_TWO; + scale = qMin(1.0f, scale * 2.5f); static CollisionList collisions(64); collisions.clear(); if (!avatar->findPlaneCollisions(plane, collisions)) { From f7862eb600056e6f9955af89137281c7aac95164 Mon Sep 17 00:00:00 2001 From: Andrew Meadows Date: Fri, 11 Apr 2014 08:58:26 -0700 Subject: [PATCH 113/120] check for bad deltaTime during avatar-avatar collisions --- interface/src/avatar/MyAvatar.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/interface/src/avatar/MyAvatar.cpp b/interface/src/avatar/MyAvatar.cpp index 6c69fd3e3a..a716d6f49a 100644 --- a/interface/src/avatar/MyAvatar.cpp +++ b/interface/src/avatar/MyAvatar.cpp @@ -910,7 +910,7 @@ void MyAvatar::updateCollisionWithAvatars(float deltaTime) { updateShapePositions(); float myBoundingRadius = getBoundingRadius(); - const float BODY_COLLISION_RESOLUTION_FACTOR = deltaTime / BODY_COLLISION_RESOLUTION_TIMESCALE; + const float BODY_COLLISION_RESOLUTION_FACTOR = glm::max(1.0f, deltaTime / BODY_COLLISION_RESOLUTION_TIMESCALE); foreach (const AvatarSharedPointer& avatarPointer, avatars) { Avatar* avatar = static_cast(avatarPointer.data()); From 00e2ff93e39a53f92830bbe0ff38446939f9fd17 Mon Sep 17 00:00:00 2001 From: Andrzej Kapolka Date: Fri, 11 Apr 2014 10:08:44 -0700 Subject: [PATCH 114/120] Playing around with zooming in while pulling back. --- interface/src/Application.cpp | 3 +++ 1 file changed, 3 insertions(+) diff --git a/interface/src/Application.cpp b/interface/src/Application.cpp index 84ce1f7efe..b3b8c24b69 100644 --- a/interface/src/Application.cpp +++ b/interface/src/Application.cpp @@ -589,6 +589,9 @@ void Application::paintGL() { if (pushback > 0.0f) { _myCamera.setTargetPosition(_myCamera.getTargetPosition() + _myCamera.getTargetRotation() * glm::vec3(0.0f, 0.0f, pushback)); + float enlargement = _myCamera.getDistance() / (_myCamera.getDistance() + pushback); + _myCamera.setFieldOfView(glm::degrees(2.0f * atanf(enlargement * tanf( + glm::radians(Menu::getInstance()->getFieldOfView() * 0.5f))))); } } From b7725f094da474fbd1068cd686679560cbd590a1 Mon Sep 17 00:00:00 2001 From: Andrzej Kapolka Date: Fri, 11 Apr 2014 10:19:16 -0700 Subject: [PATCH 115/120] Trying the narrowing effect with pushback for other avatars. --- interface/src/Application.cpp | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/interface/src/Application.cpp b/interface/src/Application.cpp index b3b8c24b69..df31349624 100644 --- a/interface/src/Application.cpp +++ b/interface/src/Application.cpp @@ -566,6 +566,9 @@ void Application::paintGL() { const float PUSHBACK_DECAY = 0.5f; _myCamera.setDistance(qMax(qMin(pushback, MAX_PUSHBACK * _myAvatar->getScale()), _myCamera.getDistance() * PUSHBACK_DECAY)); + float enlargement = pushbackRadius / (pushbackRadius + _myCamera.getDistance()); + _myCamera.setFieldOfView(glm::degrees(2.0f * atanf(enlargement * tanf( + glm::radians(Menu::getInstance()->getFieldOfView() * 0.5f))))); } else if (_myCamera.getMode() == CAMERA_MODE_THIRD_PERSON) { _myCamera.setTightness(0.0f); // Camera is directly connected to head without smoothing @@ -583,15 +586,17 @@ void Application::paintGL() { // if the head would intersect the near clip plane, we must push the camera out glm::vec3 relativePosition = glm::inverse(_myCamera.getTargetRotation()) * (eyePosition - _myCamera.getTargetPosition()); - const float PUSHBACK_RADIUS = 0.2f; - float pushback = relativePosition.z + _myCamera.getNearClip() + - _myAvatar->getScale() * PUSHBACK_RADIUS - _myCamera.getDistance(); + const float BASE_PUSHBACK_RADIUS = 0.2f; + float pushbackRadius = _myCamera.getNearClip() + _myAvatar->getScale() * BASE_PUSHBACK_RADIUS; + float pushback = relativePosition.z + pushbackRadius - _myCamera.getDistance(); if (pushback > 0.0f) { _myCamera.setTargetPosition(_myCamera.getTargetPosition() + _myCamera.getTargetRotation() * glm::vec3(0.0f, 0.0f, pushback)); - float enlargement = _myCamera.getDistance() / (_myCamera.getDistance() + pushback); + float enlargement = pushbackRadius / (pushbackRadius + pushback); _myCamera.setFieldOfView(glm::degrees(2.0f * atanf(enlargement * tanf( glm::radians(Menu::getInstance()->getFieldOfView() * 0.5f))))); + } else { + _myCamera.setFieldOfView(Menu::getInstance()->getFieldOfView()); } } From d6534d6026a26b8a68a9ffe21e8b8903f7694a31 Mon Sep 17 00:00:00 2001 From: Andrzej Kapolka Date: Fri, 11 Apr 2014 11:10:22 -0700 Subject: [PATCH 116/120] Tweak to zoom on pushback. --- interface/src/Application.cpp | 29 ++++++++++++++++++----------- interface/src/Application.h | 1 + 2 files changed, 19 insertions(+), 11 deletions(-) diff --git a/interface/src/Application.cpp b/interface/src/Application.cpp index df31349624..a7f2d7d7ec 100644 --- a/interface/src/Application.cpp +++ b/interface/src/Application.cpp @@ -151,6 +151,7 @@ Application::Application(int& argc, char** argv, timeval &startup_time) : _lastQueriedViewFrustum(), _lastQueriedTime(usecTimestampNow()), _mirrorViewRect(QRect(MIRROR_VIEW_LEFT_PADDING, MIRROR_VIEW_TOP_PADDING, MIRROR_VIEW_WIDTH, MIRROR_VIEW_HEIGHT)), + _cameraPushback(0.0f), _mouseX(0), _mouseY(0), _lastMouseMove(usecTimestampNow()), @@ -519,6 +520,8 @@ void Application::paintGL() { glEnable(GL_LINE_SMOOTH); + float pushback = 0.0f; + float pushbackFocalLength = 0.0f; if (OculusManager::isConnected()) { _myCamera.setUpShift(0.0f); _myCamera.setDistance(0.0f); @@ -537,7 +540,6 @@ void Application::paintGL() { glm::vec4 plane(planeNormal, -glm::dot(planeNormal, _myCamera.getTargetPosition()) - pushbackRadius); // push camera out of any intersecting avatars - float pushback = 0.0f; foreach (const AvatarSharedPointer& avatarData, _avatarManager.getAvatarHash()) { Avatar* avatar = static_cast(avatarData.data()); if (avatar->isMyAvatar()) { @@ -563,12 +565,9 @@ void Application::paintGL() { } } const float MAX_PUSHBACK = 0.35f; - const float PUSHBACK_DECAY = 0.5f; - _myCamera.setDistance(qMax(qMin(pushback, MAX_PUSHBACK * _myAvatar->getScale()), - _myCamera.getDistance() * PUSHBACK_DECAY)); - float enlargement = pushbackRadius / (pushbackRadius + _myCamera.getDistance()); - _myCamera.setFieldOfView(glm::degrees(2.0f * atanf(enlargement * tanf( - glm::radians(Menu::getInstance()->getFieldOfView() * 0.5f))))); + pushback = qMin(pushback, MAX_PUSHBACK * _myAvatar->getScale()); + const float BASE_PUSHBACK_FOCAL_LENGTH = 0.5f; + pushbackFocalLength = BASE_PUSHBACK_FOCAL_LENGTH * _myAvatar->getScale(); } else if (_myCamera.getMode() == CAMERA_MODE_THIRD_PERSON) { _myCamera.setTightness(0.0f); // Camera is directly connected to head without smoothing @@ -588,16 +587,24 @@ void Application::paintGL() { (eyePosition - _myCamera.getTargetPosition()); const float BASE_PUSHBACK_RADIUS = 0.2f; float pushbackRadius = _myCamera.getNearClip() + _myAvatar->getScale() * BASE_PUSHBACK_RADIUS; - float pushback = relativePosition.z + pushbackRadius - _myCamera.getDistance(); - if (pushback > 0.0f) { + pushback = relativePosition.z + pushbackRadius - _myCamera.getDistance(); + pushbackFocalLength = _myCamera.getDistance(); + } + + // handle pushback, if any + if (pushbackFocalLength > 0.0f) { + const float PUSHBACK_DECAY = 0.5f; + _cameraPushback = qMax(pushback, _cameraPushback * PUSHBACK_DECAY); + if (_cameraPushback > EPSILON) { _myCamera.setTargetPosition(_myCamera.getTargetPosition() + - _myCamera.getTargetRotation() * glm::vec3(0.0f, 0.0f, pushback)); - float enlargement = pushbackRadius / (pushbackRadius + pushback); + _myCamera.getTargetRotation() * glm::vec3(0.0f, 0.0f, _cameraPushback)); + float enlargement = pushbackFocalLength / (pushbackFocalLength + _cameraPushback); _myCamera.setFieldOfView(glm::degrees(2.0f * atanf(enlargement * tanf( glm::radians(Menu::getInstance()->getFieldOfView() * 0.5f))))); } else { _myCamera.setFieldOfView(Menu::getInstance()->getFieldOfView()); } + updateProjectionMatrix(_myCamera, true); } // Update camera position diff --git a/interface/src/Application.h b/interface/src/Application.h index eedb866d53..ed269226fe 100644 --- a/interface/src/Application.h +++ b/interface/src/Application.h @@ -432,6 +432,7 @@ private: QRect _mirrorViewRect; RearMirrorTools* _rearMirrorTools; + float _cameraPushback; glm::mat4 _untranslatedViewMatrix; glm::vec3 _viewMatrixTranslation; glm::mat4 _projectionMatrix; From 18b364d9d90ecacccb8524ca771b444c9dbfe219 Mon Sep 17 00:00:00 2001 From: Atlante45 Date: Fri, 11 Apr 2014 11:57:25 -0700 Subject: [PATCH 117/120] Removed QResources from Interface --- interface/resources/resources.qrc | 9 --------- 1 file changed, 9 deletions(-) delete mode 100644 interface/resources/resources.qrc diff --git a/interface/resources/resources.qrc b/interface/resources/resources.qrc deleted file mode 100644 index 0dc5a27651..0000000000 --- a/interface/resources/resources.qrc +++ /dev/null @@ -1,9 +0,0 @@ - - - styles/search.svg - images/close.svg - images/kill-script.svg - images/reload.svg - images/stop.svg - - From 100c3f8da40658161255f9307db6cd4332caff11 Mon Sep 17 00:00:00 2001 From: Atlante45 Date: Fri, 11 Apr 2014 11:59:23 -0700 Subject: [PATCH 118/120] Modify UIs that were using the qrc --- interface/CMakeLists.txt | 5 ----- interface/src/ui/RunningScriptsWidget.cpp | 2 +- interface/ui/chatWindow.ui | 8 +++----- interface/ui/runningScriptsWidget.ui | 16 +++++++--------- 4 files changed, 11 insertions(+), 20 deletions(-) diff --git a/interface/CMakeLists.txt b/interface/CMakeLists.txt index 29943eb4cb..4e58d898af 100644 --- a/interface/CMakeLists.txt +++ b/interface/CMakeLists.txt @@ -74,11 +74,6 @@ file (GLOB_RECURSE QT_UI_FILES ui/*.ui) # have qt5 wrap them and generate the appropriate header files qt5_wrap_ui(QT_UI_HEADERS "${QT_UI_FILES}") -# grab the resource files in resources -file (GLOB_RECURSE QT_RESOURCE_FILES resources/*.qrc) -# have qt5 wrap them and generate the appropriate source files -qt5_add_resources(QT_RESOURCES "${QT_RESOURCE_FILES}") - # add them to the interface source files set(INTERFACE_SRCS ${INTERFACE_SRCS} "${QT_UI_HEADERS}" "${QT_RESOURCES}") diff --git a/interface/src/ui/RunningScriptsWidget.cpp b/interface/src/ui/RunningScriptsWidget.cpp index dc9ae7c5f8..9a9a1c7486 100644 --- a/interface/src/ui/RunningScriptsWidget.cpp +++ b/interface/src/ui/RunningScriptsWidget.cpp @@ -77,7 +77,7 @@ void RunningScriptsWidget::setRunningScripts(const QStringList& list) scriptName->setToolTip(list.at(i)); scriptName->setTextAlignment(Qt::AlignCenter); QTableWidgetItem *closeIcon = new QTableWidgetItem; - closeIcon->setIcon(QIcon(":/images/kill-script.svg")); + closeIcon->setIcon(QIcon(Application::resourcesPath() + "/images/kill-script.svg")); ui->runningScriptsTableWidget->setItem(i, 0, scriptName); ui->runningScriptsTableWidget->setItem(i, 1, closeIcon); diff --git a/interface/ui/chatWindow.ui b/interface/ui/chatWindow.ui index 60a0c6badd..3c0fe4cd80 100644 --- a/interface/ui/chatWindow.ui +++ b/interface/ui/chatWindow.ui @@ -100,8 +100,8 @@ - - :/images/close.svg:/images/close.svg + + ../resources/images/close.svg../resources/images/close.svg true @@ -200,9 +200,7 @@ messagePlainTextEdit messagesScrollArea - - - + closeButton diff --git a/interface/ui/runningScriptsWidget.ui b/interface/ui/runningScriptsWidget.ui index 9494d4ed09..c7fc9e43e8 100644 --- a/interface/ui/runningScriptsWidget.ui +++ b/interface/ui/runningScriptsWidget.ui @@ -70,8 +70,8 @@ border-radius: 6px; Reload All - - :/images/reload.svg:/images/reload.svg + + ../resources/images/reload.svg../resources/images/reload.svg @@ -95,8 +95,8 @@ border-radius: 6px; Stop All - - :/images/stop.svg:/images/stop.svg + + ../resources/images/stop.svg../resources/images/stop.svg @@ -166,8 +166,8 @@ border-radius: 6px; - - :/images/close.svg:/images/close.svg + + ../resources/images/close.svg../resources/images/close.svg @@ -241,8 +241,6 @@ border-radius: 6px; - - - + From 508d4f216df93ee608c481c3375de2836a4c7668 Mon Sep 17 00:00:00 2001 From: Andrew Meadows Date: Fri, 11 Apr 2014 15:55:18 -0700 Subject: [PATCH 119/120] fix #2656 avatar jumps very far away This was caused by a bad CapsuleShape::_radius when the default CapsuleShape was used to create a default bounding capsule. The penetration against such a shape could be arbitrarily large. --- libraries/shared/src/CapsuleShape.cpp | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/libraries/shared/src/CapsuleShape.cpp b/libraries/shared/src/CapsuleShape.cpp index be3a165082..5055b3636e 100644 --- a/libraries/shared/src/CapsuleShape.cpp +++ b/libraries/shared/src/CapsuleShape.cpp @@ -17,9 +17,9 @@ // default axis of CapsuleShape is Y-axis -const glm::vec3 localAxis(0.f, 1.f, 0.f); +const glm::vec3 localAxis(0.0f, 1.0f, 0.0f); -CapsuleShape::CapsuleShape() : Shape(Shape::CAPSULE_SHAPE) {} +CapsuleShape::CapsuleShape() : Shape(Shape::CAPSULE_SHAPE), _radius(0.0f), _halfHeight(0.0f) {} CapsuleShape::CapsuleShape(float radius, float halfHeight) : Shape(Shape::CAPSULE_SHAPE), _radius(radius), _halfHeight(halfHeight) { @@ -32,13 +32,13 @@ CapsuleShape::CapsuleShape(float radius, float halfHeight, const glm::vec3& posi } CapsuleShape::CapsuleShape(float radius, const glm::vec3& startPoint, const glm::vec3& endPoint) : - Shape(Shape::CAPSULE_SHAPE), _radius(radius), _halfHeight(0.f) { + Shape(Shape::CAPSULE_SHAPE), _radius(radius), _halfHeight(0.0f) { glm::vec3 axis = endPoint - startPoint; float height = glm::length(axis); if (height > EPSILON) { _halfHeight = 0.5f * height; axis /= height; - glm::vec3 yAxis(0.f, 1.f, 0.f); + glm::vec3 yAxis(0.0f, 1.0f, 0.0f); float angle = glm::angle(axis, yAxis); if (angle > EPSILON) { axis = glm::normalize(glm::cross(yAxis, axis)); @@ -50,17 +50,17 @@ CapsuleShape::CapsuleShape(float radius, const glm::vec3& startPoint, const glm: /// \param[out] startPoint is the center of start cap void CapsuleShape::getStartPoint(glm::vec3& startPoint) const { - startPoint = getPosition() - _rotation * glm::vec3(0.f, _halfHeight, 0.f); + startPoint = getPosition() - _rotation * glm::vec3(0.0f, _halfHeight, 0.0f); } /// \param[out] endPoint is the center of the end cap void CapsuleShape::getEndPoint(glm::vec3& endPoint) const { - endPoint = getPosition() + _rotation * glm::vec3(0.f, _halfHeight, 0.f); + endPoint = getPosition() + _rotation * glm::vec3(0.0f, _halfHeight, 0.0f); } void CapsuleShape::computeNormalizedAxis(glm::vec3& axis) const { // default axis of a capsule is along the yAxis - axis = _rotation * glm::vec3(0.f, 1.f, 0.f); + axis = _rotation * glm::vec3(0.0f, 1.0f, 0.0f); } void CapsuleShape::setRadius(float radius) { From f84249ac6cce0750d14646c1ac94cc6f8a5a9858 Mon Sep 17 00:00:00 2001 From: Leonardo Murillo Date: Fri, 11 Apr 2014 19:58:49 -0600 Subject: [PATCH 120/120] switching to https --- interface/src/Application.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/interface/src/Application.cpp b/interface/src/Application.cpp index 9e812ac954..d63fa2293e 100644 --- a/interface/src/Application.cpp +++ b/interface/src/Application.cpp @@ -112,7 +112,7 @@ const float MIRROR_REARVIEW_DISTANCE = 0.65f; const float MIRROR_REARVIEW_BODY_DISTANCE = 2.3f; const float MIRROR_FIELD_OF_VIEW = 30.0f; -const QString CHECK_VERSION_URL = "http://highfidelity.io/latestVersion.xml"; +const QString CHECK_VERSION_URL = "https://highfidelity.io/latestVersion.xml"; const QString SKIP_FILENAME = QStandardPaths::writableLocation(QStandardPaths::DataLocation) + "/hifi.skipversion"; void messageHandler(QtMsgType type, const QMessageLogContext& context, const QString& message) {