mirror of
https://github.com/overte-org/overte.git
synced 2025-08-09 22:51:20 +02:00
Merge branch 'controllers' of https://github.com/highfidelity/hifi into controllers
This commit is contained in:
commit
9015e98b70
34 changed files with 43 additions and 53 deletions
|
@ -1,6 +1,5 @@
|
||||||
//
|
//
|
||||||
// breakdanceCore.js
|
// breakdanceCore.js
|
||||||
// examples/toys
|
|
||||||
//
|
//
|
||||||
// This is the core breakdance game library, it can be used as part of an entity script, or an omniTool module, or bootstapped on it's own
|
// This is the core breakdance game library, it can be used as part of an entity script, or an omniTool module, or bootstapped on it's own
|
||||||
// Created by Brad Hefta-Gaub on August 24, 2015
|
// Created by Brad Hefta-Gaub on August 24, 2015
|
|
@ -7,10 +7,10 @@
|
||||||
//
|
//
|
||||||
|
|
||||||
// FIXME Script paths have to be relative to the caller, in this case libraries/OmniTool.js
|
// FIXME Script paths have to be relative to the caller, in this case libraries/OmniTool.js
|
||||||
Script.include("../toys/magBalls/constants.js");
|
Script.include("../entityScripts/magBalls/constants.js");
|
||||||
Script.include("../toys/magBalls/graph.js");
|
Script.include("../entityScripts/magBalls/graph.js");
|
||||||
Script.include("../toys/magBalls/edgeSpring.js");
|
Script.include("../entityScripts/magBalls/edgeSpring.js");
|
||||||
Script.include("../toys/magBalls/magBalls.js");
|
Script.include("../entityScripts/magBalls/magBalls.js");
|
||||||
Script.include("avatarRelativeOverlays.js");
|
Script.include("avatarRelativeOverlays.js");
|
||||||
|
|
||||||
OmniToolModuleType = "MagBallsController"
|
OmniToolModuleType = "MagBallsController"
|
|
@ -17,7 +17,7 @@
|
||||||
|
|
||||||
(function () {
|
(function () {
|
||||||
var _this;
|
var _this;
|
||||||
var utilitiesScript = Script.resolvePath("../libraries/utils.js");
|
var utilitiesScript = Script.resolvePath("../../libraries/utils.js");
|
||||||
Script.include(utilitiesScript);
|
Script.include(utilitiesScript);
|
||||||
LightSwitch = function () {
|
LightSwitch = function () {
|
||||||
_this = this;
|
_this = this;
|
|
@ -13,7 +13,7 @@
|
||||||
// Script.include("../libraries/utils.js");
|
// Script.include("../libraries/utils.js");
|
||||||
//Need absolute path for now, for testing before PR merge and s3 cloning. Will change post-merge
|
//Need absolute path for now, for testing before PR merge and s3 cloning. Will change post-merge
|
||||||
|
|
||||||
Script.include("../libraries/utils.js");
|
Script.include("../../libraries/utils.js");
|
||||||
|
|
||||||
this.spraySound = SoundCache.getSound("https://s3.amazonaws.com/hifi-public/sounds/sprayPaintSound.wav");
|
this.spraySound = SoundCache.getSound("https://s3.amazonaws.com/hifi-public/sounds/sprayPaintSound.wav");
|
||||||
|
|
|
@ -245,6 +245,8 @@ QByteArray AvatarActionHold::serialize() const {
|
||||||
|
|
||||||
dataStream << _expires + getEntityServerClockSkew();
|
dataStream << _expires + getEntityServerClockSkew();
|
||||||
dataStream << _tag;
|
dataStream << _tag;
|
||||||
|
dataStream << _kinematic;
|
||||||
|
dataStream << _kinematicSetVelocity;
|
||||||
});
|
});
|
||||||
|
|
||||||
return serializedActionArguments;
|
return serializedActionArguments;
|
||||||
|
@ -278,6 +280,8 @@ void AvatarActionHold::deserialize(QByteArray serializedArguments) {
|
||||||
dataStream >> _expires;
|
dataStream >> _expires;
|
||||||
_expires -= getEntityServerClockSkew();
|
_expires -= getEntityServerClockSkew();
|
||||||
dataStream >> _tag;
|
dataStream >> _tag;
|
||||||
|
dataStream >> _kinematic;
|
||||||
|
dataStream >> _kinematicSetVelocity;
|
||||||
|
|
||||||
#if WANT_DEBUG
|
#if WANT_DEBUG
|
||||||
qDebug() << "deserialize AvatarActionHold: " << _holderID
|
qDebug() << "deserialize AvatarActionHold: " << _holderID
|
||||||
|
|
|
@ -43,11 +43,9 @@ bool GlWindow::makeCurrent() {
|
||||||
qDebug() << "GL Renderer: " << QString((const char*) glGetString(GL_RENDERER));
|
qDebug() << "GL Renderer: " << QString((const char*) glGetString(GL_RENDERER));
|
||||||
});
|
});
|
||||||
|
|
||||||
#ifndef QT_NO_DEBUG
|
QOpenGLContext * currentContext = QOpenGLContext::currentContext();
|
||||||
QOpenGLContext * currentContext =
|
|
||||||
#endif
|
|
||||||
QOpenGLContext::currentContext();
|
|
||||||
Q_ASSERT(_context == currentContext);
|
Q_ASSERT(_context == currentContext);
|
||||||
|
|
||||||
return makeCurrentResult;
|
return makeCurrentResult;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -108,13 +108,10 @@ void VrMenu::addMenu(QMenu* menu) {
|
||||||
Q_ASSERT(false);
|
Q_ASSERT(false);
|
||||||
}
|
}
|
||||||
QVariant returnedValue;
|
QVariant returnedValue;
|
||||||
#ifndef QT_NO_DEBUG
|
bool invokeResult = QMetaObject::invokeMethod(this, "addMenu", Qt::DirectConnection,
|
||||||
bool invokeResult =
|
Q_RETURN_ARG(QVariant, returnedValue),
|
||||||
#endif
|
Q_ARG(QVariant, QVariant::fromValue(qmlParent)),
|
||||||
QMetaObject::invokeMethod(this, "addMenu", Qt::DirectConnection,
|
Q_ARG(QVariant, QVariant::fromValue(menu->title())));
|
||||||
Q_RETURN_ARG(QVariant, returnedValue),
|
|
||||||
Q_ARG(QVariant, QVariant::fromValue(qmlParent)),
|
|
||||||
Q_ARG(QVariant, QVariant::fromValue(menu->title())));
|
|
||||||
Q_ASSERT(invokeResult);
|
Q_ASSERT(invokeResult);
|
||||||
QObject* result = returnedValue.value<QObject*>();
|
QObject* result = returnedValue.value<QObject*>();
|
||||||
Q_ASSERT(result);
|
Q_ASSERT(result);
|
||||||
|
@ -150,13 +147,11 @@ void VrMenu::addAction(QMenu* menu, QAction* action) {
|
||||||
QObject* menuQml = findMenuObject(userData->uuid.toString());
|
QObject* menuQml = findMenuObject(userData->uuid.toString());
|
||||||
Q_ASSERT(menuQml);
|
Q_ASSERT(menuQml);
|
||||||
QVariant returnedValue;
|
QVariant returnedValue;
|
||||||
#ifndef QT_NO_DEBUG
|
|
||||||
bool invokeResult =
|
bool invokeResult = QMetaObject::invokeMethod(this, "addItem", Qt::DirectConnection,
|
||||||
#endif
|
Q_RETURN_ARG(QVariant, returnedValue),
|
||||||
QMetaObject::invokeMethod(this, "addItem", Qt::DirectConnection,
|
Q_ARG(QVariant, QVariant::fromValue(menuQml)),
|
||||||
Q_RETURN_ARG(QVariant, returnedValue),
|
Q_ARG(QVariant, QVariant::fromValue(action->text())));
|
||||||
Q_ARG(QVariant, QVariant::fromValue(menuQml)),
|
|
||||||
Q_ARG(QVariant, QVariant::fromValue(action->text())));
|
|
||||||
Q_ASSERT(invokeResult);
|
Q_ASSERT(invokeResult);
|
||||||
QObject* result = returnedValue.value<QObject*>();
|
QObject* result = returnedValue.value<QObject*>();
|
||||||
Q_ASSERT(result);
|
Q_ASSERT(result);
|
||||||
|
@ -173,14 +168,11 @@ void VrMenu::insertAction(QAction* before, QAction* action) {
|
||||||
}
|
}
|
||||||
QObject* menu = beforeQml->parent();
|
QObject* menu = beforeQml->parent();
|
||||||
QVariant returnedValue;
|
QVariant returnedValue;
|
||||||
#ifndef QT_NO_DEBUG
|
bool invokeResult = QMetaObject::invokeMethod(this, "insertItem", Qt::DirectConnection,
|
||||||
bool invokeResult =
|
Q_RETURN_ARG(QVariant, returnedValue),
|
||||||
#endif
|
Q_ARG(QVariant, QVariant::fromValue(menu)),
|
||||||
QMetaObject::invokeMethod(this, "insertItem", Qt::DirectConnection,
|
Q_ARG(QVariant, QVariant::fromValue(beforeQml)),
|
||||||
Q_RETURN_ARG(QVariant, returnedValue),
|
Q_ARG(QVariant, QVariant::fromValue(action->text())));
|
||||||
Q_ARG(QVariant, QVariant::fromValue(menu)),
|
|
||||||
Q_ARG(QVariant, QVariant::fromValue(beforeQml)),
|
|
||||||
Q_ARG(QVariant, QVariant::fromValue(action->text())));
|
|
||||||
Q_ASSERT(invokeResult);
|
Q_ASSERT(invokeResult);
|
||||||
QObject* result = returnedValue.value<QObject*>();
|
QObject* result = returnedValue.value<QObject*>();
|
||||||
Q_ASSERT(result);
|
Q_ASSERT(result);
|
||||||
|
@ -199,9 +191,5 @@ void VrMenu::removeAction(QAction* action) {
|
||||||
bool invokeResult = QMetaObject::invokeMethod(this, "removeItem", Qt::DirectConnection,
|
bool invokeResult = QMetaObject::invokeMethod(this, "removeItem", Qt::DirectConnection,
|
||||||
Q_ARG(QVariant, QVariant::fromValue(menu)),
|
Q_ARG(QVariant, QVariant::fromValue(menu)),
|
||||||
Q_ARG(QVariant, QVariant::fromValue(item)));
|
Q_ARG(QVariant, QVariant::fromValue(item)));
|
||||||
#ifndef QT_NO_DEBUG
|
|
||||||
Q_ASSERT(invokeResult);
|
Q_ASSERT(invokeResult);
|
||||||
#else
|
|
||||||
Q_UNUSED(invokeResult);
|
|
||||||
#endif
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -14,14 +14,15 @@
|
||||||
|
|
||||||
var _this;
|
var _this;
|
||||||
|
|
||||||
var sprayPaintScriptURL = Script.resolvePath("../examples/toys/sprayPaintCan.js");
|
var sprayPaintScriptURL = Script.resolvePath("../examples/toybox/spray_paint/sprayPaintCan.js");
|
||||||
var catScriptURL = Script.resolvePath("../examples/toys/cat.js");
|
var catScriptURL = Script.resolvePath("../examples/toybox/cat/cat.js");
|
||||||
var flashlightScriptURL = Script.resolvePath('../examples/toys/flashlight/flashlight.js');
|
var flashlightScriptURL = Script.resolvePath('../examples/toybox/flashlight/flashlight.js');
|
||||||
var pingPongScriptURL = Script.resolvePath('../examples/toys/ping_pong_gun/pingPongGun.js');
|
var pingPongScriptURL = Script.resolvePath('../examples/toybox/ping_pong_gun/pingPongGun.js');
|
||||||
var wandScriptURL = Script.resolvePath("../examples/toys/bubblewand/wand.js");
|
var wandScriptURL = Script.resolvePath("../examples/toybox/bubblewand/wand.js");
|
||||||
var dollScriptURL = Script.resolvePath("../examples/toys/doll/doll.js");
|
var dollScriptURL = Script.resolvePath("../examples/toybox/doll/doll.js");
|
||||||
var lightsScriptURL = Script.resolvePath("../examples/toys/lightSwitch.js");
|
var lightsScriptURL = Script.resolvePath("../examples/toybox/lights/lightSwitch.js");
|
||||||
var targetsScriptURL = Script.resolvePath('../examples/toys/ping_pong_gun/wallTarget.js');
|
var targetsScriptURL = Script.resolvePath('../examples/toybox/ping_pong_gun/wallTarget.js');
|
||||||
|
|
||||||
|
|
||||||
ResetSwitch = function() {
|
ResetSwitch = function() {
|
||||||
_this = this;
|
_this = this;
|
||||||
|
|
|
@ -14,14 +14,14 @@
|
||||||
var utilitiesScript = Script.resolvePath("../examples/libraries/utils.js");
|
var utilitiesScript = Script.resolvePath("../examples/libraries/utils.js");
|
||||||
Script.include(utilitiesScript);
|
Script.include(utilitiesScript);
|
||||||
|
|
||||||
var sprayPaintScriptURL = Script.resolvePath("../examples/toys/sprayPaintCan.js");
|
var sprayPaintScriptURL = Script.resolvePath("../examples/toybox/spray_paint/sprayPaintCan.js");
|
||||||
var catScriptURL = Script.resolvePath("../examples/toys/cat.js");
|
var catScriptURL = Script.resolvePath("../examples/toybox/cat/cat.js");
|
||||||
var flashlightScriptURL = Script.resolvePath('../examples/toys/flashlight/flashlight.js');
|
var flashlightScriptURL = Script.resolvePath('../examples/toybox/flashlight/flashlight.js');
|
||||||
var pingPongScriptURL = Script.resolvePath('../examples/toys/ping_pong_gun/pingPongGun.js');
|
var pingPongScriptURL = Script.resolvePath('../examples/toybox/ping_pong_gun/pingPongGun.js');
|
||||||
var wandScriptURL = Script.resolvePath("../examples/toys/bubblewand/wand.js");
|
var wandScriptURL = Script.resolvePath("../examples/toybox/bubblewand/wand.js");
|
||||||
var dollScriptURL = Script.resolvePath("../examples/toys/doll/doll.js");
|
var dollScriptURL = Script.resolvePath("../examples/toybox/doll/doll.js");
|
||||||
var lightsScriptURL = Script.resolvePath("../examples/toys/lightSwitch.js");
|
var lightsScriptURL = Script.resolvePath("../examples/toybox/lights/lightSwitch.js");
|
||||||
var targetsScriptURL = Script.resolvePath('../examples/toys/ping_pong_gun/wallTarget.js');
|
var targetsScriptURL = Script.resolvePath('../examples/toybox/ping_pong_gun/wallTarget.js');
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue