mirror of
https://github.com/overte-org/overte.git
synced 2025-04-21 19:04:32 +02:00
Merge branch 'master' of github.com:highfidelity/hifi into parents
This commit is contained in:
commit
7f6ac0207d
39 changed files with 58 additions and 71 deletions
|
@ -1,6 +1,5 @@
|
|||
//
|
||||
// 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
|
||||
// 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
|
||||
Script.include("../toys/magBalls/constants.js");
|
||||
Script.include("../toys/magBalls/graph.js");
|
||||
Script.include("../toys/magBalls/edgeSpring.js");
|
||||
Script.include("../toys/magBalls/magBalls.js");
|
||||
Script.include("../entityScripts/magBalls/constants.js");
|
||||
Script.include("../entityScripts/magBalls/graph.js");
|
||||
Script.include("../entityScripts/magBalls/edgeSpring.js");
|
||||
Script.include("../entityScripts/magBalls/magBalls.js");
|
||||
Script.include("avatarRelativeOverlays.js");
|
||||
|
||||
OmniToolModuleType = "MagBallsController"
|
|
@ -17,7 +17,7 @@
|
|||
|
||||
(function () {
|
||||
var _this;
|
||||
var utilitiesScript = Script.resolvePath("../libraries/utils.js");
|
||||
var utilitiesScript = Script.resolvePath("../../libraries/utils.js");
|
||||
Script.include(utilitiesScript);
|
||||
LightSwitch = function () {
|
||||
_this = this;
|
|
@ -13,7 +13,7 @@
|
|||
// Script.include("../libraries/utils.js");
|
||||
//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");
|
||||
|
|
@ -52,3 +52,19 @@ QScriptValue EntityItemIDtoScriptValue(QScriptEngine* engine, const EntityItemID
|
|||
void EntityItemIDfromScriptValue(const QScriptValue &object, EntityItemID& id) {
|
||||
quuidFromScriptValue(object, id);
|
||||
}
|
||||
|
||||
QVector<EntityItemID> qVectorEntityItemIDFromScriptValue(const QScriptValue& array) {
|
||||
if (!array.isArray()) {
|
||||
return QVector<EntityItemID>();
|
||||
}
|
||||
QVector<EntityItemID> newVector;
|
||||
int length = array.property("length").toInteger();
|
||||
newVector.reserve(length);
|
||||
for (int i = 0; i < length; i++) {
|
||||
QString uuidAsString = array.property(i).toString();
|
||||
EntityItemID fromString(uuidAsString);
|
||||
newVector << fromString;
|
||||
}
|
||||
return newVector;
|
||||
}
|
||||
|
||||
|
|
|
@ -43,5 +43,6 @@ Q_DECLARE_METATYPE(EntityItemID);
|
|||
Q_DECLARE_METATYPE(QVector<EntityItemID>);
|
||||
QScriptValue EntityItemIDtoScriptValue(QScriptEngine* engine, const EntityItemID& properties);
|
||||
void EntityItemIDfromScriptValue(const QScriptValue &object, EntityItemID& properties);
|
||||
QVector<EntityItemID> qVectorEntityItemIDFromScriptValue(const QScriptValue& array);
|
||||
|
||||
#endif // hifi_EntityItemID_h
|
||||
|
|
|
@ -46,6 +46,7 @@ public slots:
|
|||
// setters for camera attributes
|
||||
void setPosition(const glm::vec3& position) { _viewFrustum.setPosition(position); }
|
||||
void setOrientation(const glm::quat& orientation) { _viewFrustum.setOrientation(orientation); }
|
||||
void setKeyholeRadius(float keyholdRadius) { _viewFrustum.setKeyholeRadius(keyholdRadius); }
|
||||
|
||||
// setters for LOD and PPS
|
||||
void setVoxelSizeScale(float sizeScale) { _voxelSizeScale = sizeScale; }
|
||||
|
|
|
@ -43,11 +43,9 @@ bool GlWindow::makeCurrent() {
|
|||
qDebug() << "GL Renderer: " << QString((const char*) glGetString(GL_RENDERER));
|
||||
});
|
||||
|
||||
#ifndef QT_NO_DEBUG
|
||||
QOpenGLContext * currentContext =
|
||||
#endif
|
||||
QOpenGLContext::currentContext();
|
||||
QOpenGLContext * currentContext = QOpenGLContext::currentContext();
|
||||
Q_ASSERT(_context == currentContext);
|
||||
|
||||
return makeCurrentResult;
|
||||
}
|
||||
|
||||
|
|
|
@ -157,7 +157,7 @@ void MeshPartPayload::bindMaterial(gpu::Batch& batch, const ModelRender::Locatio
|
|||
batch.setResourceTexture(ModelRender::DIFFUSE_MAP_SLOT, textureCache->getGrayTexture());
|
||||
}
|
||||
} else {
|
||||
batch.setResourceTexture(ModelRender::DIFFUSE_MAP_SLOT, textureCache->getGrayTexture());
|
||||
batch.setResourceTexture(ModelRender::DIFFUSE_MAP_SLOT, textureCache->getWhiteTexture());
|
||||
}
|
||||
|
||||
// Normal map
|
||||
|
|
|
@ -118,21 +118,6 @@ QVector<QUuid> qVectorQUuidFromScriptValue(const QScriptValue& array) {
|
|||
return newVector;
|
||||
}
|
||||
|
||||
QVector<EntityItemID> qVectorEntityItemIDFromScriptValue(const QScriptValue& array) {
|
||||
if (!array.isArray()) {
|
||||
return QVector<EntityItemID>();
|
||||
}
|
||||
QVector<EntityItemID> newVector;
|
||||
int length = array.property("length").toInteger();
|
||||
newVector.reserve(length);
|
||||
for (int i = 0; i < length; i++) {
|
||||
QString uuidAsString = array.property(i).toString();
|
||||
EntityItemID fromString(uuidAsString);
|
||||
newVector << fromString;
|
||||
}
|
||||
return newVector;
|
||||
}
|
||||
|
||||
QScriptValue qVectorFloatToScriptValue(QScriptEngine* engine, const QVector<float>& vector) {
|
||||
QScriptValue array = engine->newArray();
|
||||
for (int i = 0; i < vector.size(); i++) {
|
||||
|
|
|
@ -14,7 +14,6 @@
|
|||
|
||||
#include <QtScript/QScriptEngine>
|
||||
#include <QtCore/QUuid>
|
||||
#include "../../entities/src/EntityItemID.h"
|
||||
|
||||
#include <glm/glm.hpp>
|
||||
#include <glm/gtc/quaternion.hpp>
|
||||
|
@ -67,7 +66,6 @@ void qVectorFloatFromScriptValue(const QScriptValue& array, QVector<float>& vect
|
|||
QVector<float> qVectorFloatFromScriptValue(const QScriptValue& array);
|
||||
|
||||
QVector<QUuid> qVectorQUuidFromScriptValue(const QScriptValue& array);
|
||||
QVector<EntityItemID> qVectorEntityItemIDFromScriptValue(const QScriptValue& array);
|
||||
|
||||
class PickRay {
|
||||
public:
|
||||
|
|
|
@ -108,13 +108,10 @@ void VrMenu::addMenu(QMenu* menu) {
|
|||
Q_ASSERT(false);
|
||||
}
|
||||
QVariant returnedValue;
|
||||
#ifndef QT_NO_DEBUG
|
||||
bool invokeResult =
|
||||
#endif
|
||||
QMetaObject::invokeMethod(this, "addMenu", Qt::DirectConnection,
|
||||
Q_RETURN_ARG(QVariant, returnedValue),
|
||||
Q_ARG(QVariant, QVariant::fromValue(qmlParent)),
|
||||
Q_ARG(QVariant, QVariant::fromValue(menu->title())));
|
||||
bool invokeResult = QMetaObject::invokeMethod(this, "addMenu", Qt::DirectConnection,
|
||||
Q_RETURN_ARG(QVariant, returnedValue),
|
||||
Q_ARG(QVariant, QVariant::fromValue(qmlParent)),
|
||||
Q_ARG(QVariant, QVariant::fromValue(menu->title())));
|
||||
Q_ASSERT(invokeResult);
|
||||
QObject* result = returnedValue.value<QObject*>();
|
||||
Q_ASSERT(result);
|
||||
|
@ -150,13 +147,11 @@ void VrMenu::addAction(QMenu* menu, QAction* action) {
|
|||
QObject* menuQml = findMenuObject(userData->uuid.toString());
|
||||
Q_ASSERT(menuQml);
|
||||
QVariant returnedValue;
|
||||
#ifndef QT_NO_DEBUG
|
||||
bool invokeResult =
|
||||
#endif
|
||||
QMetaObject::invokeMethod(this, "addItem", Qt::DirectConnection,
|
||||
Q_RETURN_ARG(QVariant, returnedValue),
|
||||
Q_ARG(QVariant, QVariant::fromValue(menuQml)),
|
||||
Q_ARG(QVariant, QVariant::fromValue(action->text())));
|
||||
|
||||
bool invokeResult = QMetaObject::invokeMethod(this, "addItem", Qt::DirectConnection,
|
||||
Q_RETURN_ARG(QVariant, returnedValue),
|
||||
Q_ARG(QVariant, QVariant::fromValue(menuQml)),
|
||||
Q_ARG(QVariant, QVariant::fromValue(action->text())));
|
||||
Q_ASSERT(invokeResult);
|
||||
QObject* result = returnedValue.value<QObject*>();
|
||||
Q_ASSERT(result);
|
||||
|
@ -173,14 +168,11 @@ void VrMenu::insertAction(QAction* before, QAction* action) {
|
|||
}
|
||||
QObject* menu = beforeQml->parent();
|
||||
QVariant returnedValue;
|
||||
#ifndef QT_NO_DEBUG
|
||||
bool invokeResult =
|
||||
#endif
|
||||
QMetaObject::invokeMethod(this, "insertItem", Qt::DirectConnection,
|
||||
Q_RETURN_ARG(QVariant, returnedValue),
|
||||
Q_ARG(QVariant, QVariant::fromValue(menu)),
|
||||
Q_ARG(QVariant, QVariant::fromValue(beforeQml)),
|
||||
Q_ARG(QVariant, QVariant::fromValue(action->text())));
|
||||
bool invokeResult = QMetaObject::invokeMethod(this, "insertItem", Qt::DirectConnection,
|
||||
Q_RETURN_ARG(QVariant, returnedValue),
|
||||
Q_ARG(QVariant, QVariant::fromValue(menu)),
|
||||
Q_ARG(QVariant, QVariant::fromValue(beforeQml)),
|
||||
Q_ARG(QVariant, QVariant::fromValue(action->text())));
|
||||
Q_ASSERT(invokeResult);
|
||||
QObject* result = returnedValue.value<QObject*>();
|
||||
Q_ASSERT(result);
|
||||
|
@ -199,9 +191,5 @@ void VrMenu::removeAction(QAction* action) {
|
|||
bool invokeResult = QMetaObject::invokeMethod(this, "removeItem", Qt::DirectConnection,
|
||||
Q_ARG(QVariant, QVariant::fromValue(menu)),
|
||||
Q_ARG(QVariant, QVariant::fromValue(item)));
|
||||
#ifndef QT_NO_DEBUG
|
||||
Q_ASSERT(invokeResult);
|
||||
#else
|
||||
Q_UNUSED(invokeResult);
|
||||
#endif
|
||||
}
|
||||
|
|
|
@ -14,14 +14,15 @@
|
|||
|
||||
var _this;
|
||||
|
||||
var sprayPaintScriptURL = Script.resolvePath("../examples/toys/sprayPaintCan.js");
|
||||
var catScriptURL = Script.resolvePath("../examples/toys/cat.js");
|
||||
var flashlightScriptURL = Script.resolvePath('../examples/toys/flashlight/flashlight.js');
|
||||
var pingPongScriptURL = Script.resolvePath('../examples/toys/ping_pong_gun/pingPongGun.js');
|
||||
var wandScriptURL = Script.resolvePath("../examples/toys/bubblewand/wand.js");
|
||||
var dollScriptURL = Script.resolvePath("../examples/toys/doll/doll.js");
|
||||
var lightsScriptURL = Script.resolvePath("../examples/toys/lightSwitch.js");
|
||||
var targetsScriptURL = Script.resolvePath('../examples/toys/ping_pong_gun/wallTarget.js');
|
||||
var sprayPaintScriptURL = Script.resolvePath("../examples/toybox/spray_paint/sprayPaintCan.js");
|
||||
var catScriptURL = Script.resolvePath("../examples/toybox/cat/cat.js");
|
||||
var flashlightScriptURL = Script.resolvePath('../examples/toybox/flashlight/flashlight.js');
|
||||
var pingPongScriptURL = Script.resolvePath('../examples/toybox/ping_pong_gun/pingPongGun.js');
|
||||
var wandScriptURL = Script.resolvePath("../examples/toybox/bubblewand/wand.js");
|
||||
var dollScriptURL = Script.resolvePath("../examples/toybox/doll/doll.js");
|
||||
var lightsScriptURL = Script.resolvePath("../examples/toybox/lights/lightSwitch.js");
|
||||
var targetsScriptURL = Script.resolvePath('../examples/toybox/ping_pong_gun/wallTarget.js');
|
||||
|
||||
|
||||
ResetSwitch = function() {
|
||||
_this = this;
|
||||
|
|
|
@ -14,14 +14,14 @@
|
|||
var utilitiesScript = Script.resolvePath("../examples/libraries/utils.js");
|
||||
Script.include(utilitiesScript);
|
||||
|
||||
var sprayPaintScriptURL = Script.resolvePath("../examples/toys/sprayPaintCan.js");
|
||||
var catScriptURL = Script.resolvePath("../examples/toys/cat.js");
|
||||
var flashlightScriptURL = Script.resolvePath('../examples/toys/flashlight/flashlight.js');
|
||||
var pingPongScriptURL = Script.resolvePath('../examples/toys/ping_pong_gun/pingPongGun.js');
|
||||
var wandScriptURL = Script.resolvePath("../examples/toys/bubblewand/wand.js");
|
||||
var dollScriptURL = Script.resolvePath("../examples/toys/doll/doll.js");
|
||||
var lightsScriptURL = Script.resolvePath("../examples/toys/lightSwitch.js");
|
||||
var targetsScriptURL = Script.resolvePath('../examples/toys/ping_pong_gun/wallTarget.js');
|
||||
var sprayPaintScriptURL = Script.resolvePath("../examples/toybox/spray_paint/sprayPaintCan.js");
|
||||
var catScriptURL = Script.resolvePath("../examples/toybox/cat/cat.js");
|
||||
var flashlightScriptURL = Script.resolvePath('../examples/toybox/flashlight/flashlight.js');
|
||||
var pingPongScriptURL = Script.resolvePath('../examples/toybox/ping_pong_gun/pingPongGun.js');
|
||||
var wandScriptURL = Script.resolvePath("../examples/toybox/bubblewand/wand.js");
|
||||
var dollScriptURL = Script.resolvePath("../examples/toybox/doll/doll.js");
|
||||
var lightsScriptURL = Script.resolvePath("../examples/toybox/lights/lightSwitch.js");
|
||||
var targetsScriptURL = Script.resolvePath('../examples/toybox/ping_pong_gun/wallTarget.js');
|
||||
|
||||
|
||||
|
||||
|
|
Loading…
Reference in a new issue