mirror of
https://github.com/lubosz/overte.git
synced 2025-04-26 23:55:34 +02:00
Merge branch 'master' of https://github.com/highfidelity/hifi into metavoxels
This commit is contained in:
commit
00490af837
8 changed files with 119 additions and 9 deletions
examples
interface/src
|
@ -1312,7 +1312,6 @@ var toolBar = (function () {
|
|||
if (clickedOverlay === loadFileMenuItem) {
|
||||
toggleNewModelButton(false);
|
||||
|
||||
// TODO BUG: this is bug, if the user has never uploaded a model, this will throw an JS exception
|
||||
file = Window.browse("Select your model file ...",
|
||||
Settings.getValue("LastModelUploadLocation").path(),
|
||||
"Model files (*.fst *.fbx)");
|
||||
|
|
|
@ -60,9 +60,17 @@ SelectionDisplay = (function () {
|
|||
var rotateHandleColor = { red: 0, green: 0, blue: 0 };
|
||||
var rotateHandleAlpha = 0.7;
|
||||
|
||||
var highlightedHandleColor = { red: 255, green: 0, blue: 0 };
|
||||
var highlightedHandleAlpha = 0.7;
|
||||
|
||||
var previousHandle = false;
|
||||
var previousHandleColor;
|
||||
var previousHandleAlpha;
|
||||
|
||||
var grabberSizeCorner = 0.025;
|
||||
var grabberSizeEdge = 0.015;
|
||||
var grabberSizeFace = 0.025;
|
||||
var grabberAlpha = 1;
|
||||
var grabberColorCorner = { red: 120, green: 120, blue: 120 };
|
||||
var grabberColorEdge = { red: 0, green: 0, blue: 0 };
|
||||
var grabberColorFace = { red: 120, green: 120, blue: 120 };
|
||||
|
@ -2320,7 +2328,96 @@ SelectionDisplay = (function () {
|
|||
that.stretchLEFT(event);
|
||||
break;
|
||||
default:
|
||||
// nothing to do by default
|
||||
// if not in any specific mode, then just look for handles to highlight...
|
||||
var pickRay = Camera.computePickRay(event.x, event.y);
|
||||
var result = Overlays.findRayIntersection(pickRay);
|
||||
var pickedColor;
|
||||
var pickedAlpha;
|
||||
var highlightNeeded = false;
|
||||
|
||||
if (result.intersects) {
|
||||
switch(result.overlayID) {
|
||||
case yawHandle:
|
||||
case pitchHandle:
|
||||
case rollHandle:
|
||||
pickedColor = rotateHandleColor;
|
||||
pickedAlpha = rotateHandleAlpha;
|
||||
highlightNeeded = true;
|
||||
break;
|
||||
|
||||
case grabberMoveUp:
|
||||
pickedColor = rotateHandleColor;
|
||||
pickedAlpha = rotateHandleAlpha;
|
||||
highlightNeeded = true;
|
||||
break;
|
||||
|
||||
case grabberLBN:
|
||||
case grabberLBF:
|
||||
case grabberRBN:
|
||||
case grabberRBF:
|
||||
case grabberLTN:
|
||||
case grabberLTF:
|
||||
case grabberRTN:
|
||||
case grabberRTF:
|
||||
pickedColor = grabberColorCorner;
|
||||
pickedAlpha = grabberAlpha;
|
||||
highlightNeeded = true;
|
||||
break;
|
||||
|
||||
case grabberTOP:
|
||||
case grabberBOTTOM:
|
||||
case grabberLEFT:
|
||||
case grabberRIGHT:
|
||||
case grabberNEAR:
|
||||
case grabberFAR:
|
||||
pickedColor = grabberColorFace;
|
||||
pickedAlpha = grabberAlpha;
|
||||
highlightNeeded = true;
|
||||
break;
|
||||
|
||||
case grabberEdgeTR:
|
||||
case grabberEdgeTL:
|
||||
case grabberEdgeTF:
|
||||
case grabberEdgeTN:
|
||||
case grabberEdgeBR:
|
||||
case grabberEdgeBL:
|
||||
case grabberEdgeBF:
|
||||
case grabberEdgeBN:
|
||||
case grabberEdgeNR:
|
||||
case grabberEdgeNL:
|
||||
case grabberEdgeFR:
|
||||
case grabberEdgeFL:
|
||||
pickedColor = grabberColorEdge;
|
||||
pickedAlpha = grabberAlpha;
|
||||
highlightNeeded = true;
|
||||
break;
|
||||
|
||||
default:
|
||||
if (previousHandle) {
|
||||
Overlays.editOverlay(previousHandle, { color: previousHandleColor, alpha: previousHandleAlpha });
|
||||
previousHandle = false;
|
||||
}
|
||||
break;
|
||||
}
|
||||
|
||||
if (highlightNeeded) {
|
||||
if (previousHandle) {
|
||||
Overlays.editOverlay(previousHandle, { color: previousHandleColor, alpha: previousHandleAlpha });
|
||||
previousHandle = false;
|
||||
}
|
||||
Overlays.editOverlay(result.overlayID, { color: highlightedHandleColor, alpha: highlightedHandleAlpha });
|
||||
previousHandle = result.overlayID;
|
||||
previousHandleColor = pickedColor;
|
||||
previousHandleAlpha = pickedAlpha;
|
||||
}
|
||||
|
||||
} else {
|
||||
if (previousHandle) {
|
||||
Overlays.editOverlay(previousHandle, { color: previousHandleColor, alpha: previousHandleAlpha });
|
||||
previousHandle = false;
|
||||
}
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
|
|
|
@ -238,7 +238,6 @@ var toolBar = (function () {
|
|||
if (clickedOverlay === loadFileMenuItem) {
|
||||
toggleNewModelButton(false);
|
||||
|
||||
// TODO BUG: this is bug, if the user has never uploaded a model, this will throw an JS exception
|
||||
file = Window.browse("Select your model file ...",
|
||||
Settings.getValue("LastModelUploadLocation").path(),
|
||||
"Model files (*.fst *.fbx)");
|
||||
|
|
|
@ -187,8 +187,6 @@ Application::Application(int& argc, char** argv, QElapsedTimer &startup_time) :
|
|||
// set the associated application properties
|
||||
applicationInfo.beginGroup("INFO");
|
||||
|
||||
qDebug() << "[VERSION] Build sequence: " << qPrintable(applicationVersion());
|
||||
|
||||
setApplicationName(applicationInfo.value("name").toString());
|
||||
setApplicationVersion(BUILD_VERSION);
|
||||
setOrganizationName(applicationInfo.value("organizationName").toString());
|
||||
|
@ -207,6 +205,8 @@ Application::Application(int& argc, char** argv, QElapsedTimer &startup_time) :
|
|||
|
||||
qInstallMessageHandler(messageHandler);
|
||||
|
||||
qDebug() << "[VERSION] Build sequence: " << qPrintable(applicationVersion());
|
||||
|
||||
// call Menu getInstance static method to set up the menu
|
||||
_window->setMenuBar(Menu::getInstance());
|
||||
|
||||
|
|
|
@ -246,10 +246,16 @@ Menu::Menu() :
|
|||
#endif
|
||||
|
||||
addActionToQMenuAndActionHash(toolsMenu,
|
||||
MenuOption::Console,
|
||||
Qt::CTRL | Qt::ALT | Qt::Key_J,
|
||||
this,
|
||||
SLOT(toggleConsole()));
|
||||
MenuOption::Console,
|
||||
Qt::CTRL | Qt::ALT | Qt::Key_J,
|
||||
this,
|
||||
SLOT(toggleConsole()));
|
||||
|
||||
addActionToQMenuAndActionHash(toolsMenu,
|
||||
MenuOption::ResetSensors,
|
||||
Qt::Key_Apostrophe,
|
||||
appInstance,
|
||||
SLOT(resetSensors()));
|
||||
|
||||
QMenu* avatarMenu = addMenu("Avatar");
|
||||
|
||||
|
|
|
@ -442,6 +442,7 @@ namespace MenuOption {
|
|||
const QString RenderLookAtVectors = "Show Look-at Vectors";
|
||||
const QString RenderSkeletonCollisionShapes = "Show Skeleton Collision Shapes";
|
||||
const QString ResetAvatarSize = "Reset Avatar Size";
|
||||
const QString ResetSensors = "Reset Sensors";
|
||||
const QString RunningScripts = "Running Scripts";
|
||||
const QString RunTimingTests = "Run Timing Tests";
|
||||
const QString ScriptEditor = "Script Editor...";
|
||||
|
|
|
@ -78,6 +78,8 @@ void OculusManager::connect() {
|
|||
#ifdef HAVE_LIBOVR
|
||||
_calibrationState = UNCALIBRATED;
|
||||
|
||||
qDebug() << "Oculus SDK" << OVR_VERSION_STRING;
|
||||
|
||||
ovr_Initialize();
|
||||
|
||||
_ovrHmd = ovrHmd_Create(0);
|
||||
|
|
|
@ -22,6 +22,9 @@ QVariant SettingsScriptingInterface::getValue(const QString& setting) {
|
|||
QSettings* settings = Application::getInstance()->lockSettings();
|
||||
QVariant value = settings->value(setting);
|
||||
Application::getInstance()->unlockSettings();
|
||||
if (!value.isValid()) {
|
||||
value = "";
|
||||
}
|
||||
return value;
|
||||
}
|
||||
|
||||
|
@ -29,6 +32,9 @@ QVariant SettingsScriptingInterface::getValue(const QString& setting, const QVar
|
|||
QSettings* settings = Application::getInstance()->lockSettings();
|
||||
QVariant value = settings->value(setting, defaultValue);
|
||||
Application::getInstance()->unlockSettings();
|
||||
if (!value.isValid()) {
|
||||
value = "";
|
||||
}
|
||||
return value;
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue