mirror of
https://github.com/HifiExperiments/overte.git
synced 2025-08-10 02:08:23 +02:00
Merge branch 'baseball' of github.com:birarda/hifi into baseball
This commit is contained in:
commit
8c08ad38d7
14 changed files with 229 additions and 98 deletions
|
@ -16,6 +16,7 @@
|
||||||
#include <QtNetwork/QNetworkRequest>
|
#include <QtNetwork/QNetworkRequest>
|
||||||
#include <QtNetwork/QNetworkReply>
|
#include <QtNetwork/QNetworkReply>
|
||||||
|
|
||||||
|
#include <AssetClient.h>
|
||||||
#include <AvatarHashMap.h>
|
#include <AvatarHashMap.h>
|
||||||
#include <NetworkAccessManager.h>
|
#include <NetworkAccessManager.h>
|
||||||
#include <NodeList.h>
|
#include <NodeList.h>
|
||||||
|
@ -42,7 +43,8 @@ Agent::Agent(NLPacket& packet) :
|
||||||
DEFAULT_WINDOW_SECONDS_FOR_DESIRED_REDUCTION, false))
|
DEFAULT_WINDOW_SECONDS_FOR_DESIRED_REDUCTION, false))
|
||||||
{
|
{
|
||||||
DependencyManager::get<EntityScriptingInterface>()->setPacketSender(&_entityEditSender);
|
DependencyManager::get<EntityScriptingInterface>()->setPacketSender(&_entityEditSender);
|
||||||
|
|
||||||
|
DependencyManager::set<AssetClient>();
|
||||||
DependencyManager::set<ResourceCacheSharedItems>();
|
DependencyManager::set<ResourceCacheSharedItems>();
|
||||||
DependencyManager::set<SoundCache>();
|
DependencyManager::set<SoundCache>();
|
||||||
|
|
||||||
|
@ -110,11 +112,12 @@ void Agent::run() {
|
||||||
ThreadedAssignment::commonInit(AGENT_LOGGING_NAME, NodeType::Agent);
|
ThreadedAssignment::commonInit(AGENT_LOGGING_NAME, NodeType::Agent);
|
||||||
|
|
||||||
auto nodeList = DependencyManager::get<NodeList>();
|
auto nodeList = DependencyManager::get<NodeList>();
|
||||||
nodeList->addSetOfNodeTypesToNodeInterestSet(NodeSet()
|
nodeList->addSetOfNodeTypesToNodeInterestSet({
|
||||||
<< NodeType::AudioMixer
|
NodeType::AudioMixer,
|
||||||
<< NodeType::AvatarMixer
|
NodeType::AvatarMixer,
|
||||||
<< NodeType::EntityServer
|
NodeType::EntityServer,
|
||||||
);
|
NodeType::AssetServer
|
||||||
|
});
|
||||||
|
|
||||||
_pingTimer = new QTimer(this);
|
_pingTimer = new QTimer(this);
|
||||||
connect(_pingTimer, SIGNAL(timeout()), SLOT(sendPingRequests()));
|
connect(_pingTimer, SIGNAL(timeout()), SLOT(sendPingRequests()));
|
||||||
|
|
21
examples/acScripts/baseballCrowd.js
Normal file
21
examples/acScripts/baseballCrowd.js
Normal file
|
@ -0,0 +1,21 @@
|
||||||
|
//
|
||||||
|
// baseballCrowd.js
|
||||||
|
// examples/acScripts
|
||||||
|
//
|
||||||
|
// Created by Stephen Birarda on 10/20/15.
|
||||||
|
// Copyright 2015 High Fidelity, 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 crowd1 = SoundCache.getSound("atp:0e921b644464d56d5b412ea2ea1d83f8ff3f7506c4b0471ea336a4770daf3b82.wav");
|
||||||
|
|
||||||
|
function maybePlaySound(deltaTime) {
|
||||||
|
if (crowd1.downloaded && !crowd1.isPlaying) {
|
||||||
|
Audio.playSound(crowd1, { position: { x: 0, y: 0, z: 0}, loop: true});
|
||||||
|
Script.update.disconnect(maybePlaySound);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
Script.update.connect(maybePlaySound);
|
|
@ -579,7 +579,8 @@ function MyController(hand, triggerAction) {
|
||||||
timeScale: NEAR_GRABBING_ACTION_TIMEFRAME,
|
timeScale: NEAR_GRABBING_ACTION_TIMEFRAME,
|
||||||
relativePosition: this.offsetPosition,
|
relativePosition: this.offsetPosition,
|
||||||
relativeRotation: this.offsetRotation,
|
relativeRotation: this.offsetRotation,
|
||||||
lifetime: ACTION_LIFETIME
|
lifetime: ACTION_LIFETIME,
|
||||||
|
kinematic: (grabbableData.kinematicGrab && (grabbableData.kinematicGrab === true))
|
||||||
});
|
});
|
||||||
if (this.actionID === NULL_ACTION_ID) {
|
if (this.actionID === NULL_ACTION_ID) {
|
||||||
this.actionID = null;
|
this.actionID = null;
|
||||||
|
|
92
examples/toys/baseball.js
Executable file
92
examples/toys/baseball.js
Executable file
|
@ -0,0 +1,92 @@
|
||||||
|
//
|
||||||
|
// baseball.js
|
||||||
|
// examples/toys
|
||||||
|
//
|
||||||
|
// Created by Stephen Birarda on 10/20/15.
|
||||||
|
// Copyright 2015 High Fidelity, 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 ROBOT_MODEL = "atp:ea02100c2ee63a8b9c0495557f32041be18ec94def157592e84a816665ce2f6e.fbx";
|
||||||
|
var ROBOT_POSITION = { x: -0.54, y: 1.21, z: 2.57 }
|
||||||
|
|
||||||
|
var BAT_MODEL = "atp:07bdd769a57ff15ebe9331ae4e2c2eae8886a6792b4790cce03b4716eb3a81c7.fbx"
|
||||||
|
var BAT_COLLISION_MODEL = "atp:1211ee12bc8ab0bb744e8582e15e728a00ca70a808550fc46d7284799b9a868a.obj"
|
||||||
|
|
||||||
|
// add the fresh robot at home plate
|
||||||
|
var robot = Entities.addEntity({
|
||||||
|
name: 'Robot',
|
||||||
|
type: 'Model',
|
||||||
|
modelURL: ROBOT_MODEL,
|
||||||
|
position: ROBOT_POSITION,
|
||||||
|
animation: {
|
||||||
|
url: ROBOT_MODEL
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
// add the bat
|
||||||
|
var bat = Entities.addEntity({
|
||||||
|
name: 'Bat',
|
||||||
|
type: 'Model',
|
||||||
|
modelURL: BAT_MODEL
|
||||||
|
})
|
||||||
|
|
||||||
|
var lastTriggerValue = 0.0;
|
||||||
|
|
||||||
|
function checkTriggers() {
|
||||||
|
var rightTrigger = Controller.getTriggerValue(1);
|
||||||
|
|
||||||
|
if (rightTrigger == 0) {
|
||||||
|
if (lastTriggerValue > 0) {
|
||||||
|
// the trigger was just released, play out to the last frame of the swing
|
||||||
|
Entities.editEntity(robot, {
|
||||||
|
animation: {
|
||||||
|
running: true,
|
||||||
|
currentFrame: 21,
|
||||||
|
lastFrame: 115
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
if (lastTriggerValue == 0) {
|
||||||
|
// the trigger was just depressed, start the swing
|
||||||
|
Entities.editEntity(robot, {
|
||||||
|
animation: {
|
||||||
|
running: true,
|
||||||
|
currentFrame: 0,
|
||||||
|
lastFrame: 21
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
lastTriggerValue = rightTrigger;
|
||||||
|
}
|
||||||
|
|
||||||
|
var DISTANCE_HOLDING_ACTION_TIMEFRAME = 0.1; // how quickly objects move to their new position
|
||||||
|
var ACTION_LIFETIME = 15; // seconds
|
||||||
|
|
||||||
|
function moveBat() {
|
||||||
|
var forearmPosition = Entities.getJointPosition(robot, 40);
|
||||||
|
var forearmRotation = Entities.getJointRotation(robot, 40);
|
||||||
|
|
||||||
|
Vec3.print("forearmPosition=", forearmPosition);
|
||||||
|
|
||||||
|
Entities.addAction("spring", bat, {
|
||||||
|
targetPosition: forearmPosition,
|
||||||
|
targetRotation: forearmRotation,
|
||||||
|
tag: "bat-to-forearm",
|
||||||
|
linearTimeScale: DISTANCE_HOLDING_ACTION_TIMEFRAME,
|
||||||
|
angularTimeScale: DISTANCE_HOLDING_ACTION_TIMEFRAME
|
||||||
|
lifetime: ACTION_LIFETIME
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
function update() {
|
||||||
|
checkTriggers();
|
||||||
|
}
|
||||||
|
|
||||||
|
// hook the update so we can check controller triggers
|
||||||
|
Script.update.connect(update);
|
|
@ -575,3 +575,28 @@ bool RenderableModelEntityItem::contains(const glm::vec3& point) const {
|
||||||
|
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
glm::vec3 RenderableModelEntityItem::getJointPosition(int jointIndex) const {
|
||||||
|
glm::vec3 position;
|
||||||
|
|
||||||
|
if (_model) {
|
||||||
|
if (!_model->getJointPositionInWorldFrame(jointIndex, position)) {
|
||||||
|
position = glm::vec3();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return position;
|
||||||
|
}
|
||||||
|
|
||||||
|
glm::quat RenderableModelEntityItem::getJointRotation(int jointIndex) const {
|
||||||
|
glm::quat rotation;
|
||||||
|
|
||||||
|
if (_model) {
|
||||||
|
if (!_model->getJointRotationInWorldFrame(jointIndex, rotation)) {
|
||||||
|
rotation = glm::quat();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return rotation;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
|
@ -67,6 +67,9 @@ public:
|
||||||
void computeShapeInfo(ShapeInfo& info);
|
void computeShapeInfo(ShapeInfo& info);
|
||||||
|
|
||||||
virtual bool contains(const glm::vec3& point) const;
|
virtual bool contains(const glm::vec3& point) const;
|
||||||
|
|
||||||
|
virtual glm::vec3 getJointPosition(int jointIndex) const override;
|
||||||
|
virtual glm::quat getJointRotation(int jointIndex) const override;
|
||||||
|
|
||||||
private:
|
private:
|
||||||
void remapTextures();
|
void remapTextures();
|
||||||
|
|
|
@ -681,82 +681,75 @@ QVariantMap EntityScriptingInterface::getActionArguments(const QUuid& entityID,
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
glm::vec3 EntityScriptingInterface::voxelCoordsToWorldCoords(const QUuid& entityID, glm::vec3 voxelCoords) {
|
EntityItemPointer EntityScriptingInterface::checkForTreeEntityAndTypeMatch(const QUuid& entityID,
|
||||||
|
EntityTypes::EntityType entityType) {
|
||||||
if (!_entityTree) {
|
if (!_entityTree) {
|
||||||
return glm::vec3(0.0f);
|
return EntityItemPointer();
|
||||||
}
|
}
|
||||||
|
|
||||||
EntityItemPointer entity = _entityTree->findEntityByEntityItemID(entityID);
|
EntityItemPointer entity = _entityTree->findEntityByEntityItemID(entityID);
|
||||||
if (!entity) {
|
if (!entity) {
|
||||||
qCDebug(entities) << "EntityScriptingInterface::voxelCoordsToWorldCoords no entity with ID" << entityID;
|
qDebug() << "EntityScriptingInterface::checkForTreeEntityAndTypeMatch - no entity with ID" << entityID;
|
||||||
|
return entity;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (entityType != EntityTypes::Unknown && entity->getType() != entityType) {
|
||||||
|
return EntityItemPointer();
|
||||||
|
}
|
||||||
|
|
||||||
|
return entity;
|
||||||
|
}
|
||||||
|
|
||||||
|
glm::vec3 EntityScriptingInterface::voxelCoordsToWorldCoords(const QUuid& entityID, glm::vec3 voxelCoords) {
|
||||||
|
if (auto entity = checkForTreeEntityAndTypeMatch(entityID, EntityTypes::PolyVox)) {
|
||||||
|
auto polyVoxEntity = std::dynamic_pointer_cast<PolyVoxEntityItem>(entity);
|
||||||
|
return polyVoxEntity->voxelCoordsToWorldCoords(voxelCoords);
|
||||||
|
} else {
|
||||||
return glm::vec3(0.0f);
|
return glm::vec3(0.0f);
|
||||||
}
|
}
|
||||||
|
|
||||||
EntityTypes::EntityType entityType = entity->getType();
|
|
||||||
if (entityType != EntityTypes::PolyVox) {
|
|
||||||
return glm::vec3(0.0f);
|
|
||||||
}
|
|
||||||
|
|
||||||
auto polyVoxEntity = std::dynamic_pointer_cast<PolyVoxEntityItem>(entity);
|
|
||||||
return polyVoxEntity->voxelCoordsToWorldCoords(voxelCoords);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
glm::vec3 EntityScriptingInterface::worldCoordsToVoxelCoords(const QUuid& entityID, glm::vec3 worldCoords) {
|
glm::vec3 EntityScriptingInterface::worldCoordsToVoxelCoords(const QUuid& entityID, glm::vec3 worldCoords) {
|
||||||
if (!_entityTree) {
|
if (auto entity = checkForTreeEntityAndTypeMatch(entityID, EntityTypes::PolyVox)) {
|
||||||
|
auto polyVoxEntity = std::dynamic_pointer_cast<PolyVoxEntityItem>(entity);
|
||||||
|
return polyVoxEntity->worldCoordsToVoxelCoords(worldCoords);
|
||||||
|
} else {
|
||||||
return glm::vec3(0.0f);
|
return glm::vec3(0.0f);
|
||||||
}
|
}
|
||||||
|
|
||||||
EntityItemPointer entity = _entityTree->findEntityByEntityItemID(entityID);
|
|
||||||
if (!entity) {
|
|
||||||
qCDebug(entities) << "EntityScriptingInterface::worldCoordsToVoxelCoords no entity with ID" << entityID;
|
|
||||||
return glm::vec3(0.0f);
|
|
||||||
}
|
|
||||||
|
|
||||||
EntityTypes::EntityType entityType = entity->getType();
|
|
||||||
if (entityType != EntityTypes::PolyVox) {
|
|
||||||
return glm::vec3(0.0f);
|
|
||||||
}
|
|
||||||
|
|
||||||
auto polyVoxEntity = std::dynamic_pointer_cast<PolyVoxEntityItem>(entity);
|
|
||||||
return polyVoxEntity->worldCoordsToVoxelCoords(worldCoords);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
glm::vec3 EntityScriptingInterface::voxelCoordsToLocalCoords(const QUuid& entityID, glm::vec3 voxelCoords) {
|
glm::vec3 EntityScriptingInterface::voxelCoordsToLocalCoords(const QUuid& entityID, glm::vec3 voxelCoords) {
|
||||||
if (!_entityTree) {
|
if (auto entity = checkForTreeEntityAndTypeMatch(entityID, EntityTypes::PolyVox)) {
|
||||||
|
auto polyVoxEntity = std::dynamic_pointer_cast<PolyVoxEntityItem>(entity);
|
||||||
|
return polyVoxEntity->voxelCoordsToLocalCoords(voxelCoords);
|
||||||
|
} else {
|
||||||
return glm::vec3(0.0f);
|
return glm::vec3(0.0f);
|
||||||
}
|
}
|
||||||
|
|
||||||
EntityItemPointer entity = _entityTree->findEntityByEntityItemID(entityID);
|
|
||||||
if (!entity) {
|
|
||||||
qCDebug(entities) << "EntityScriptingInterface::voxelCoordsToLocalCoords no entity with ID" << entityID;
|
|
||||||
return glm::vec3(0.0f);
|
|
||||||
}
|
|
||||||
|
|
||||||
EntityTypes::EntityType entityType = entity->getType();
|
|
||||||
if (entityType != EntityTypes::PolyVox) {
|
|
||||||
return glm::vec3(0.0f);
|
|
||||||
}
|
|
||||||
|
|
||||||
auto polyVoxEntity = std::dynamic_pointer_cast<PolyVoxEntityItem>(entity);
|
|
||||||
return polyVoxEntity->voxelCoordsToLocalCoords(voxelCoords);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
glm::vec3 EntityScriptingInterface::localCoordsToVoxelCoords(const QUuid& entityID, glm::vec3 localCoords) {
|
glm::vec3 EntityScriptingInterface::localCoordsToVoxelCoords(const QUuid& entityID, glm::vec3 localCoords) {
|
||||||
if (!_entityTree) {
|
if (auto entity = checkForTreeEntityAndTypeMatch(entityID, EntityTypes::PolyVox)) {
|
||||||
|
auto polyVoxEntity = std::dynamic_pointer_cast<PolyVoxEntityItem>(entity);
|
||||||
|
return polyVoxEntity->localCoordsToVoxelCoords(localCoords);
|
||||||
|
} else {
|
||||||
return glm::vec3(0.0f);
|
return glm::vec3(0.0f);
|
||||||
}
|
}
|
||||||
|
}
|
||||||
EntityItemPointer entity = _entityTree->findEntityByEntityItemID(entityID);
|
|
||||||
if (!entity) {
|
glm::vec3 EntityScriptingInterface::getJointPosition(const QUuid& entityID, int jointIndex) {
|
||||||
qCDebug(entities) << "EntityScriptingInterface::localCoordsToVoxelCoords no entity with ID" << entityID;
|
if (auto entity = checkForTreeEntityAndTypeMatch(entityID, EntityTypes::Model)) {
|
||||||
return glm::vec3(0.0f);
|
auto modelEntity = std::dynamic_pointer_cast<ModelEntityItem>(entity);
|
||||||
}
|
return modelEntity->getJointPosition(jointIndex);
|
||||||
|
} else {
|
||||||
EntityTypes::EntityType entityType = entity->getType();
|
return glm::vec3(0.0f);
|
||||||
if (entityType != EntityTypes::PolyVox) {
|
}
|
||||||
return glm::vec3(0.0f);
|
}
|
||||||
}
|
|
||||||
|
glm::quat EntityScriptingInterface::getJointRotation(const QUuid& entityID, int jointIndex) {
|
||||||
auto polyVoxEntity = std::dynamic_pointer_cast<PolyVoxEntityItem>(entity);
|
if (auto entity = checkForTreeEntityAndTypeMatch(entityID, EntityTypes::Model)) {
|
||||||
return polyVoxEntity->localCoordsToVoxelCoords(localCoords);
|
auto modelEntity = std::dynamic_pointer_cast<ModelEntityItem>(entity);
|
||||||
|
return modelEntity->getJointRotation(jointIndex);
|
||||||
|
} else {
|
||||||
|
return glm::quat();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -150,6 +150,9 @@ public slots:
|
||||||
Q_INVOKABLE glm::vec3 worldCoordsToVoxelCoords(const QUuid& entityID, glm::vec3 worldCoords);
|
Q_INVOKABLE glm::vec3 worldCoordsToVoxelCoords(const QUuid& entityID, glm::vec3 worldCoords);
|
||||||
Q_INVOKABLE glm::vec3 voxelCoordsToLocalCoords(const QUuid& entityID, glm::vec3 voxelCoords);
|
Q_INVOKABLE glm::vec3 voxelCoordsToLocalCoords(const QUuid& entityID, glm::vec3 voxelCoords);
|
||||||
Q_INVOKABLE glm::vec3 localCoordsToVoxelCoords(const QUuid& entityID, glm::vec3 localCoords);
|
Q_INVOKABLE glm::vec3 localCoordsToVoxelCoords(const QUuid& entityID, glm::vec3 localCoords);
|
||||||
|
|
||||||
|
Q_INVOKABLE glm::vec3 getJointPosition(const QUuid& entityID, int jointIndex);
|
||||||
|
Q_INVOKABLE glm::quat getJointRotation(const QUuid& entityID, int jointIndex);
|
||||||
|
|
||||||
signals:
|
signals:
|
||||||
void entityCollisionWithEntity(const EntityItemID& idA, const EntityItemID& idB, const Collision& collision);
|
void entityCollisionWithEntity(const EntityItemID& idA, const EntityItemID& idB, const Collision& collision);
|
||||||
|
@ -182,6 +185,9 @@ private:
|
||||||
bool setVoxels(QUuid entityID, std::function<bool(PolyVoxEntityItem&)> actor);
|
bool setVoxels(QUuid entityID, std::function<bool(PolyVoxEntityItem&)> actor);
|
||||||
bool setPoints(QUuid entityID, std::function<bool(LineEntityItem&)> actor);
|
bool setPoints(QUuid entityID, std::function<bool(LineEntityItem&)> actor);
|
||||||
void queueEntityMessage(PacketType packetType, EntityItemID entityID, const EntityItemProperties& properties);
|
void queueEntityMessage(PacketType packetType, EntityItemID entityID, const EntityItemProperties& properties);
|
||||||
|
|
||||||
|
EntityItemPointer checkForTreeEntityAndTypeMatch(const QUuid& entityID,
|
||||||
|
EntityTypes::EntityType entityType = EntityTypes::Unknown);
|
||||||
|
|
||||||
|
|
||||||
/// actually does the work of finding the ray intersection, can be called in locking mode or tryLock mode
|
/// actually does the work of finding the ray intersection, can be called in locking mode or tryLock mode
|
||||||
|
|
|
@ -120,6 +120,9 @@ public:
|
||||||
virtual bool shouldBePhysical() const;
|
virtual bool shouldBePhysical() const;
|
||||||
|
|
||||||
static void cleanupLoadedAnimations();
|
static void cleanupLoadedAnimations();
|
||||||
|
|
||||||
|
virtual glm::vec3 getJointPosition(int jointIndex) const { return glm::vec3(); }
|
||||||
|
virtual glm::quat getJointRotation(int jointIndex) const { return glm::quat(); }
|
||||||
|
|
||||||
private:
|
private:
|
||||||
void setAnimationSettings(const QString& value); // only called for old bitstream format
|
void setAnimationSettings(const QString& value); // only called for old bitstream format
|
||||||
|
|
|
@ -89,7 +89,6 @@ AssetRequest* AssetClient::createRequest(const QString& hash, const QString& ext
|
||||||
|
|
||||||
// Move to the AssetClient thread in case we are not currently on that thread (which will usually be the case)
|
// Move to the AssetClient thread in case we are not currently on that thread (which will usually be the case)
|
||||||
request->moveToThread(thread());
|
request->moveToThread(thread());
|
||||||
request->setParent(this);
|
|
||||||
|
|
||||||
return request;
|
return request;
|
||||||
} else {
|
} else {
|
||||||
|
@ -105,7 +104,6 @@ AssetUpload* AssetClient::createUpload(const QString& filename) {
|
||||||
auto upload = new AssetUpload(filename);
|
auto upload = new AssetUpload(filename);
|
||||||
|
|
||||||
upload->moveToThread(thread());
|
upload->moveToThread(thread());
|
||||||
upload->setParent(this);
|
|
||||||
|
|
||||||
return upload;
|
return upload;
|
||||||
} else {
|
} else {
|
||||||
|
@ -118,7 +116,6 @@ AssetUpload* AssetClient::createUpload(const QByteArray& data, const QString& ex
|
||||||
auto upload = new AssetUpload(data, extension);
|
auto upload = new AssetUpload(data, extension);
|
||||||
|
|
||||||
upload->moveToThread(thread());
|
upload->moveToThread(thread());
|
||||||
upload->setParent(this);
|
|
||||||
|
|
||||||
return upload;
|
return upload;
|
||||||
} else {
|
} else {
|
||||||
|
|
|
@ -46,6 +46,7 @@ public slots:
|
||||||
// setters for camera attributes
|
// setters for camera attributes
|
||||||
void setPosition(const glm::vec3& position) { _viewFrustum.setPosition(position); }
|
void setPosition(const glm::vec3& position) { _viewFrustum.setPosition(position); }
|
||||||
void setOrientation(const glm::quat& orientation) { _viewFrustum.setOrientation(orientation); }
|
void setOrientation(const glm::quat& orientation) { _viewFrustum.setOrientation(orientation); }
|
||||||
|
void setKeyholeRadius(float keyholdRadius) { _viewFrustum.setKeyholeRadius(keyholdRadius); }
|
||||||
|
|
||||||
// setters for LOD and PPS
|
// setters for LOD and PPS
|
||||||
void setVoxelSizeScale(float sizeScale) { _voxelSizeScale = sizeScale; }
|
void setVoxelSizeScale(float sizeScale) { _voxelSizeScale = sizeScale; }
|
||||||
|
|
|
@ -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;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -147,7 +147,7 @@ void MeshPartPayload::bindMaterial(gpu::Batch& batch, const ModelRender::Locatio
|
||||||
batch.setResourceTexture(ModelRender::DIFFUSE_MAP_SLOT, textureCache->getGrayTexture());
|
batch.setResourceTexture(ModelRender::DIFFUSE_MAP_SLOT, textureCache->getGrayTexture());
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
batch.setResourceTexture(ModelRender::DIFFUSE_MAP_SLOT, textureCache->getGrayTexture());
|
batch.setResourceTexture(ModelRender::DIFFUSE_MAP_SLOT, textureCache->getWhiteTexture());
|
||||||
}
|
}
|
||||||
|
|
||||||
// Normal map
|
// Normal map
|
||||||
|
|
|
@ -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
|
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue