mirror of
https://github.com/overte-org/overte.git
synced 2025-08-06 17:00:13 +02:00
Merge branch 'master' of github.com:highfidelity/hifi into yellow
This commit is contained in:
commit
760eac6f83
42 changed files with 486 additions and 126 deletions
|
@ -17,7 +17,6 @@
|
||||||
#include <QJsonDocument>
|
#include <QJsonDocument>
|
||||||
|
|
||||||
#include <EntityTree.h>
|
#include <EntityTree.h>
|
||||||
#include <SimpleEntitySimulation.h>
|
|
||||||
#include <ResourceCache.h>
|
#include <ResourceCache.h>
|
||||||
#include <ScriptCache.h>
|
#include <ScriptCache.h>
|
||||||
#include <EntityEditFilters.h>
|
#include <EntityEditFilters.h>
|
||||||
|
@ -36,7 +35,7 @@ const char* LOCAL_MODELS_PERSIST_FILE = "resources/models.svo";
|
||||||
|
|
||||||
EntityServer::EntityServer(ReceivedMessage& message) :
|
EntityServer::EntityServer(ReceivedMessage& message) :
|
||||||
OctreeServer(message),
|
OctreeServer(message),
|
||||||
_entitySimulation(NULL),
|
_entitySimulation(nullptr),
|
||||||
_dynamicDomainVerificationTimer(this)
|
_dynamicDomainVerificationTimer(this)
|
||||||
{
|
{
|
||||||
DependencyManager::set<ResourceManager>();
|
DependencyManager::set<ResourceManager>();
|
||||||
|
|
|
@ -16,9 +16,11 @@
|
||||||
|
|
||||||
#include <memory>
|
#include <memory>
|
||||||
|
|
||||||
#include "EntityItem.h"
|
#include <EntityItem.h>
|
||||||
|
#include <EntityTree.h>
|
||||||
|
#include <SimpleEntitySimulation.h>
|
||||||
|
|
||||||
#include "EntityServerConsts.h"
|
#include "EntityServerConsts.h"
|
||||||
#include "EntityTree.h"
|
|
||||||
|
|
||||||
/// Handles assignments of type EntityServer - sending entities to various clients.
|
/// Handles assignments of type EntityServer - sending entities to various clients.
|
||||||
|
|
||||||
|
@ -27,9 +29,6 @@ struct ViewerSendingStats {
|
||||||
quint64 lastEdited;
|
quint64 lastEdited;
|
||||||
};
|
};
|
||||||
|
|
||||||
class SimpleEntitySimulation;
|
|
||||||
using SimpleEntitySimulationPointer = std::shared_ptr<SimpleEntitySimulation>;
|
|
||||||
|
|
||||||
class EntityServer : public OctreeServer, public NewlyCreatedEntityHook {
|
class EntityServer : public OctreeServer, public NewlyCreatedEntityHook {
|
||||||
Q_OBJECT
|
Q_OBJECT
|
||||||
public:
|
public:
|
||||||
|
|
|
@ -301,10 +301,17 @@ void EntityScriptServer::run() {
|
||||||
|
|
||||||
entityScriptingInterface->setEntityTree(_entityViewer.getTree());
|
entityScriptingInterface->setEntityTree(_entityViewer.getTree());
|
||||||
|
|
||||||
DependencyManager::set<AssignmentParentFinder>(_entityViewer.getTree());
|
auto treePtr = _entityViewer.getTree();
|
||||||
|
DependencyManager::set<AssignmentParentFinder>(treePtr);
|
||||||
|
|
||||||
|
if (!_entitySimulation) {
|
||||||
|
SimpleEntitySimulationPointer simpleSimulation { new SimpleEntitySimulation() };
|
||||||
|
simpleSimulation->setEntityTree(treePtr);
|
||||||
|
treePtr->setSimulation(simpleSimulation);
|
||||||
|
_entitySimulation = simpleSimulation;
|
||||||
|
}
|
||||||
|
|
||||||
auto tree = _entityViewer.getTree().get();
|
auto tree = treePtr.get();
|
||||||
connect(tree, &EntityTree::deletingEntity, this, &EntityScriptServer::deletingEntity, Qt::QueuedConnection);
|
connect(tree, &EntityTree::deletingEntity, this, &EntityScriptServer::deletingEntity, Qt::QueuedConnection);
|
||||||
connect(tree, &EntityTree::addingEntity, this, &EntityScriptServer::addingEntity, Qt::QueuedConnection);
|
connect(tree, &EntityTree::addingEntity, this, &EntityScriptServer::addingEntity, Qt::QueuedConnection);
|
||||||
connect(tree, &EntityTree::entityServerScriptChanging, this, &EntityScriptServer::entityServerScriptChanging, Qt::QueuedConnection);
|
connect(tree, &EntityTree::entityServerScriptChanging, this, &EntityScriptServer::entityServerScriptChanging, Qt::QueuedConnection);
|
||||||
|
@ -451,6 +458,7 @@ void EntityScriptServer::resetEntitiesScriptEngine() {
|
||||||
|
|
||||||
connect(newEngine.data(), &ScriptEngine::update, this, [this] {
|
connect(newEngine.data(), &ScriptEngine::update, this, [this] {
|
||||||
_entityViewer.queryOctree();
|
_entityViewer.queryOctree();
|
||||||
|
_entityViewer.getTree()->preUpdate();
|
||||||
_entityViewer.getTree()->update();
|
_entityViewer.getTree()->update();
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
|
@ -21,6 +21,7 @@
|
||||||
#include <EntityEditPacketSender.h>
|
#include <EntityEditPacketSender.h>
|
||||||
#include <plugins/CodecPlugin.h>
|
#include <plugins/CodecPlugin.h>
|
||||||
#include <ScriptEngine.h>
|
#include <ScriptEngine.h>
|
||||||
|
#include <SimpleEntitySimulation.h>
|
||||||
#include <ThreadedAssignment.h>
|
#include <ThreadedAssignment.h>
|
||||||
#include "../entities/EntityTreeHeadlessViewer.h"
|
#include "../entities/EntityTreeHeadlessViewer.h"
|
||||||
|
|
||||||
|
@ -75,6 +76,7 @@ private:
|
||||||
|
|
||||||
static int _entitiesScriptEngineCount;
|
static int _entitiesScriptEngineCount;
|
||||||
ScriptEnginePointer _entitiesScriptEngine;
|
ScriptEnginePointer _entitiesScriptEngine;
|
||||||
|
SimpleEntitySimulationPointer _entitySimulation;
|
||||||
EntityEditPacketSender _entityEditSender;
|
EntityEditPacketSender _entityEditSender;
|
||||||
EntityTreeHeadlessViewer _entityViewer;
|
EntityTreeHeadlessViewer _entityViewer;
|
||||||
|
|
||||||
|
|
|
@ -38,7 +38,7 @@ macro(SET_PACKAGING_PARAMETERS)
|
||||||
set(BUILD_ORGANIZATION "High Fidelity")
|
set(BUILD_ORGANIZATION "High Fidelity")
|
||||||
set(HIGH_FIDELITY_PROTOCOL "hifi")
|
set(HIGH_FIDELITY_PROTOCOL "hifi")
|
||||||
set(HIGH_FIDELITY_APP_PROTOCOL "hifiapp")
|
set(HIGH_FIDELITY_APP_PROTOCOL "hifiapp")
|
||||||
set(INTERFACE_BUNDLE_NAME "Interface")
|
set(INTERFACE_BUNDLE_NAME "interface")
|
||||||
set(INTERFACE_ICON_PREFIX "interface")
|
set(INTERFACE_ICON_PREFIX "interface")
|
||||||
|
|
||||||
# add definition for this release type
|
# add definition for this release type
|
||||||
|
@ -61,7 +61,7 @@ macro(SET_PACKAGING_PARAMETERS)
|
||||||
set(PR_BUILD 1)
|
set(PR_BUILD 1)
|
||||||
set(BUILD_VERSION "PR${RELEASE_NUMBER}")
|
set(BUILD_VERSION "PR${RELEASE_NUMBER}")
|
||||||
set(BUILD_ORGANIZATION "High Fidelity - PR${RELEASE_NUMBER}")
|
set(BUILD_ORGANIZATION "High Fidelity - PR${RELEASE_NUMBER}")
|
||||||
set(INTERFACE_BUNDLE_NAME "Interface")
|
set(INTERFACE_BUNDLE_NAME "interface")
|
||||||
set(INTERFACE_ICON_PREFIX "interface-beta")
|
set(INTERFACE_ICON_PREFIX "interface-beta")
|
||||||
|
|
||||||
# add definition for this release type
|
# add definition for this release type
|
||||||
|
@ -70,7 +70,7 @@ macro(SET_PACKAGING_PARAMETERS)
|
||||||
set(DEV_BUILD 1)
|
set(DEV_BUILD 1)
|
||||||
set(BUILD_VERSION "dev")
|
set(BUILD_VERSION "dev")
|
||||||
set(BUILD_ORGANIZATION "High Fidelity - ${BUILD_VERSION}")
|
set(BUILD_ORGANIZATION "High Fidelity - ${BUILD_VERSION}")
|
||||||
set(INTERFACE_BUNDLE_NAME "Interface")
|
set(INTERFACE_BUNDLE_NAME "interface")
|
||||||
set(INTERFACE_ICON_PREFIX "interface-beta")
|
set(INTERFACE_ICON_PREFIX "interface-beta")
|
||||||
|
|
||||||
# add definition for this release type
|
# add definition for this release type
|
||||||
|
|
20
interface/interface.entitlements
Normal file
20
interface/interface.entitlements
Normal file
|
@ -0,0 +1,20 @@
|
||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
|
||||||
|
<plist version="1.0">
|
||||||
|
<dict>
|
||||||
|
<key>com.apple.security.application-groups</key>
|
||||||
|
<array>
|
||||||
|
<string>high-fidelity.hifi</string>
|
||||||
|
</array>
|
||||||
|
<key>com.apple.security.cs.allow-jit</key>
|
||||||
|
<true/>
|
||||||
|
<key>com.apple.security.cs.allow-unsigned-executable-memory</key>
|
||||||
|
<true/>
|
||||||
|
<key>com.apple.security.device.audio-input</key>
|
||||||
|
<true/>
|
||||||
|
<key>com.apple.security.network.client</key>
|
||||||
|
<true/>
|
||||||
|
<key>com.apple.security.network.server</key>
|
||||||
|
<true/>
|
||||||
|
</dict>
|
||||||
|
</plist>
|
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
|
@ -822,6 +822,19 @@
|
||||||
},
|
},
|
||||||
"id": "seatedReactionPositiveCheer",
|
"id": "seatedReactionPositiveCheer",
|
||||||
"type": "clip"
|
"type": "clip"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"children": [
|
||||||
|
],
|
||||||
|
"data": {
|
||||||
|
"endFrame": 64,
|
||||||
|
"loopFlag": false,
|
||||||
|
"startFrame": 1,
|
||||||
|
"timeScale": 1,
|
||||||
|
"url": "qrc:///avatar/animations/sitting_emote_agree_acknowledge.fbx"
|
||||||
|
},
|
||||||
|
"id": "seatedReactionPositiveAcknowledge",
|
||||||
|
"type": "clip"
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
"data": {
|
"data": {
|
||||||
|
@ -867,6 +880,15 @@
|
||||||
"resume": false,
|
"resume": false,
|
||||||
"transitions": [
|
"transitions": [
|
||||||
]
|
]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"id": "seatedReactionPositiveAcknowledge",
|
||||||
|
"interpDuration": 1,
|
||||||
|
"interpTarget": 1,
|
||||||
|
"priority": 1,
|
||||||
|
"resume": false,
|
||||||
|
"transitions": [
|
||||||
|
]
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
"timeScale": 1,
|
"timeScale": 1,
|
||||||
|
@ -916,6 +938,19 @@
|
||||||
},
|
},
|
||||||
"id": "seatedReactionNegativeDisagreeDisbelief",
|
"id": "seatedReactionNegativeDisagreeDisbelief",
|
||||||
"type": "clip"
|
"type": "clip"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"children": [
|
||||||
|
],
|
||||||
|
"data": {
|
||||||
|
"endFrame": 70,
|
||||||
|
"loopFlag": false,
|
||||||
|
"startFrame": 0,
|
||||||
|
"timeScale": 1,
|
||||||
|
"url": "qrc:///avatar/animations/sitting_emote_disagree_dismiss.fbx"
|
||||||
|
},
|
||||||
|
"id": "seatedReactionNegativeDisagreeDismiss",
|
||||||
|
"type": "clip"
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
"data": {
|
"data": {
|
||||||
|
@ -958,6 +993,17 @@
|
||||||
"resume": false,
|
"resume": false,
|
||||||
"transitions": [
|
"transitions": [
|
||||||
]
|
]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"easingType": "easeInOutQuad",
|
||||||
|
"id": "seatedReactionNegativeDisagreeDismiss",
|
||||||
|
"interpDuration": 1,
|
||||||
|
"interpTarget": 1,
|
||||||
|
"interpType": "evaluateBoth",
|
||||||
|
"priority": 1,
|
||||||
|
"resume": false,
|
||||||
|
"transitions": [
|
||||||
|
]
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
"timeScale": 1,
|
"timeScale": 1,
|
||||||
|
@ -1046,6 +1092,47 @@
|
||||||
},
|
},
|
||||||
"id": "seatedReactionRaiseHand02Outro",
|
"id": "seatedReactionRaiseHand02Outro",
|
||||||
"type": "clip"
|
"type": "clip"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"children": [
|
||||||
|
],
|
||||||
|
"data": {
|
||||||
|
"endFrame": 15,
|
||||||
|
"loopFlag": false,
|
||||||
|
"startFrame": 0,
|
||||||
|
"timeScale": 1,
|
||||||
|
"url": "qrc:///avatar/animations/sitting_emote_raisehand03_all.fbx"
|
||||||
|
},
|
||||||
|
"id": "seatedReactionRaiseHand03Intro",
|
||||||
|
"type": "clip"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"children": [
|
||||||
|
],
|
||||||
|
"data": {
|
||||||
|
"endFrame": 233,
|
||||||
|
"loopFlag": true,
|
||||||
|
"mirrorFlag": false,
|
||||||
|
"startFrame": 15,
|
||||||
|
"timeScale": 1,
|
||||||
|
"url": "qrc:///avatar/animations/sitting_emote_raisehand03_all.fbx"
|
||||||
|
},
|
||||||
|
"id": "seatedReactionRaiseHand03Loop",
|
||||||
|
"type": "clip"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"children": [
|
||||||
|
],
|
||||||
|
"data": {
|
||||||
|
"endFrame": 296,
|
||||||
|
"loopFlag": false,
|
||||||
|
"mirrorFlag": false,
|
||||||
|
"startFrame": 233,
|
||||||
|
"timeScale": 1,
|
||||||
|
"url": "qrc:///avatar/animations/sitting_emote_raisehand03_all.fbx"
|
||||||
|
},
|
||||||
|
"id": "seatedReactionRaiseHand03Outro",
|
||||||
|
"type": "clip"
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
"data": {
|
"data": {
|
||||||
|
@ -1057,7 +1144,7 @@
|
||||||
"easingType": "easeInOutQuad",
|
"easingType": "easeInOutQuad",
|
||||||
"id": "seatedReactionRaiseHandIntro",
|
"id": "seatedReactionRaiseHandIntro",
|
||||||
"interpDuration": 8,
|
"interpDuration": 8,
|
||||||
"interpTarget": 8,
|
"interpTarget": 9,
|
||||||
"interpType": "evaluateBoth",
|
"interpType": "evaluateBoth",
|
||||||
"priority": 1,
|
"priority": 1,
|
||||||
"resume": false,
|
"resume": false,
|
||||||
|
@ -1138,6 +1225,49 @@
|
||||||
"var": "reactionRaiseHandEnabled"
|
"var": "reactionRaiseHandEnabled"
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"easingType": "easeInOutQuad",
|
||||||
|
"id": "seatedReactionRaiseHand03Intro",
|
||||||
|
"interpDuration": 8,
|
||||||
|
"interpTarget": 8,
|
||||||
|
"interpType": "evaluateBoth",
|
||||||
|
"priority": 1,
|
||||||
|
"resume": false,
|
||||||
|
"transitions": [
|
||||||
|
{
|
||||||
|
"randomSwitchState": "seatedReactionRaiseHand03Loop",
|
||||||
|
"var": "seatedReactionRaiseHand03IntroOnDone"
|
||||||
|
}
|
||||||
|
]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"id": "seatedReactionRaiseHand03Loop",
|
||||||
|
"interpDuration": 1,
|
||||||
|
"interpTarget": 1,
|
||||||
|
"priority": 0,
|
||||||
|
"resume": false,
|
||||||
|
"transitions": [
|
||||||
|
{
|
||||||
|
"randomSwitchState": "seatedReactionRaiseHand03Outro",
|
||||||
|
"var": "reactionRaiseHandDisabled"
|
||||||
|
}
|
||||||
|
]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"easingType": "easeInOutQuad",
|
||||||
|
"id": "seatedReactionRaiseHand03Outro",
|
||||||
|
"interpDuration": 12,
|
||||||
|
"interpTarget": 12,
|
||||||
|
"interpType": "evaluateBoth",
|
||||||
|
"priority": 0,
|
||||||
|
"resume": false,
|
||||||
|
"transitions": [
|
||||||
|
{
|
||||||
|
"randomSwitchState": "seatedReactionRaiseHand03Loop",
|
||||||
|
"var": "reactionRaiseHandEnabled"
|
||||||
|
}
|
||||||
|
]
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
"triggerRandomSwitch": ""
|
"triggerRandomSwitch": ""
|
||||||
|
@ -1224,6 +1354,45 @@
|
||||||
},
|
},
|
||||||
"id": "seatedReactionApplaud02Outro",
|
"id": "seatedReactionApplaud02Outro",
|
||||||
"type": "clip"
|
"type": "clip"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"children": [
|
||||||
|
],
|
||||||
|
"data": {
|
||||||
|
"endFrame": 17,
|
||||||
|
"loopFlag": false,
|
||||||
|
"startFrame": 0,
|
||||||
|
"timeScale": 1,
|
||||||
|
"url": "qrc:///avatar/animations/sitting_emote_clap03_all.fbx"
|
||||||
|
},
|
||||||
|
"id": "seatedReactionApplaud03Intro",
|
||||||
|
"type": "clip"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"children": [
|
||||||
|
],
|
||||||
|
"data": {
|
||||||
|
"endFrame": 111,
|
||||||
|
"loopFlag": true,
|
||||||
|
"startFrame": 17,
|
||||||
|
"timeScale": 1,
|
||||||
|
"url": "qrc:///avatar/animations/sitting_emote_clap03_all.fbx"
|
||||||
|
},
|
||||||
|
"id": "seatedReactionApplaud03Loop",
|
||||||
|
"type": "clip"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"children": [
|
||||||
|
],
|
||||||
|
"data": {
|
||||||
|
"endFrame": 136,
|
||||||
|
"loopFlag": false,
|
||||||
|
"startFrame": 111,
|
||||||
|
"timeScale": 1,
|
||||||
|
"url": "qrc:///avatar/animations/sitting_emote_clap03_all.fbx"
|
||||||
|
},
|
||||||
|
"id": "seatedReactionApplaud03Outro",
|
||||||
|
"type": "clip"
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
"data": {
|
"data": {
|
||||||
|
@ -1320,6 +1489,51 @@
|
||||||
"var": "reactionApplaudEnabled"
|
"var": "reactionApplaudEnabled"
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"easingType": "easeInOutQuad",
|
||||||
|
"id": "seatedReactionApplaud03Intro",
|
||||||
|
"interpDuration": 8,
|
||||||
|
"interpTarget": 8,
|
||||||
|
"interpType": "evaluateBoth",
|
||||||
|
"priority": 1,
|
||||||
|
"resume": false,
|
||||||
|
"transitions": [
|
||||||
|
{
|
||||||
|
"randomSwitchState": "seatedReactionApplaud03Loop",
|
||||||
|
"var": "seatedReactionApplaud03IntroOnDone"
|
||||||
|
}
|
||||||
|
]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"easingType": "easeInOutQuad",
|
||||||
|
"id": "seatedReactionApplaud03Loop",
|
||||||
|
"interpDuration": 1,
|
||||||
|
"interpTarget": 1,
|
||||||
|
"interpType": "evaluateBoth",
|
||||||
|
"priority": 0,
|
||||||
|
"resume": false,
|
||||||
|
"transitions": [
|
||||||
|
{
|
||||||
|
"randomSwitchState": "seatedReactionApplaud03Outro",
|
||||||
|
"var": "reactionApplaudDisabled"
|
||||||
|
}
|
||||||
|
]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"easingType": "easeInOutQuad",
|
||||||
|
"id": "seatedReactionApplaud03Outro",
|
||||||
|
"interpDuration": 12,
|
||||||
|
"interpTarget": 12,
|
||||||
|
"interpType": "evaluateBoth",
|
||||||
|
"priority": 0,
|
||||||
|
"resume": false,
|
||||||
|
"transitions": [
|
||||||
|
{
|
||||||
|
"randomSwitchState": "seatedReactionApplaud03Loop",
|
||||||
|
"var": "reactionApplaudEnabled"
|
||||||
|
}
|
||||||
|
]
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
"triggerRandomSwitch": ""
|
"triggerRandomSwitch": ""
|
||||||
|
@ -1333,7 +1547,7 @@
|
||||||
"children": [
|
"children": [
|
||||||
],
|
],
|
||||||
"data": {
|
"data": {
|
||||||
"endFrame": 22,
|
"endFrame": 21,
|
||||||
"loopFlag": false,
|
"loopFlag": false,
|
||||||
"startFrame": 1,
|
"startFrame": 1,
|
||||||
"timeScale": 1,
|
"timeScale": 1,
|
||||||
|
@ -1346,9 +1560,9 @@
|
||||||
"children": [
|
"children": [
|
||||||
],
|
],
|
||||||
"data": {
|
"data": {
|
||||||
"endFrame": 43,
|
"endFrame": 100,
|
||||||
"loopFlag": true,
|
"loopFlag": true,
|
||||||
"startFrame": 22,
|
"startFrame": 21,
|
||||||
"timeScale": 1,
|
"timeScale": 1,
|
||||||
"url": "qrc:///avatar/animations/sitting_emote_point_all.fbx"
|
"url": "qrc:///avatar/animations/sitting_emote_point_all.fbx"
|
||||||
},
|
},
|
||||||
|
@ -1359,9 +1573,10 @@
|
||||||
"children": [
|
"children": [
|
||||||
],
|
],
|
||||||
"data": {
|
"data": {
|
||||||
"endFrame": 71,
|
"endFrame": 134,
|
||||||
"loopFlag": false,
|
"loopFlag": false,
|
||||||
"startFrame": 43,
|
"mirrorFlag": false,
|
||||||
|
"startFrame": 100,
|
||||||
"timeScale": 1,
|
"timeScale": 1,
|
||||||
"url": "qrc:///avatar/animations/sitting_emote_point_all.fbx"
|
"url": "qrc:///avatar/animations/sitting_emote_point_all.fbx"
|
||||||
},
|
},
|
||||||
|
@ -1481,6 +1696,10 @@
|
||||||
"state": "seatedTalkOverlay",
|
"state": "seatedTalkOverlay",
|
||||||
"var": "seatedReactionPositiveCheerOnDone"
|
"var": "seatedReactionPositiveCheerOnDone"
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
"state": "seatedTalkOverlay",
|
||||||
|
"var": "seatedReactionPositiveAcknowledgeOnDone"
|
||||||
|
},
|
||||||
{
|
{
|
||||||
"state": "seatedReactionNegative",
|
"state": "seatedReactionNegative",
|
||||||
"var": "reactionNegativeTrigger"
|
"var": "reactionNegativeTrigger"
|
||||||
|
@ -1522,6 +1741,10 @@
|
||||||
"state": "seatedTalkOverlay",
|
"state": "seatedTalkOverlay",
|
||||||
"var": "seatedReactionNegativeDisagreeDisbeliefOnDone"
|
"var": "seatedReactionNegativeDisagreeDisbeliefOnDone"
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
"state": "seatedTalkOverlay",
|
||||||
|
"var": "seatedReactionNegativeDisagreeDismissOnDone"
|
||||||
|
},
|
||||||
{
|
{
|
||||||
"state": "seatedReactionRaiseHand",
|
"state": "seatedReactionRaiseHand",
|
||||||
"var": "reactionRaiseHandEnabled"
|
"var": "reactionRaiseHandEnabled"
|
||||||
|
@ -2430,7 +2653,7 @@
|
||||||
"children": [
|
"children": [
|
||||||
],
|
],
|
||||||
"data": {
|
"data": {
|
||||||
"endFrame": 58,
|
"endFrame": 64,
|
||||||
"loopFlag": false,
|
"loopFlag": false,
|
||||||
"startFrame": 1,
|
"startFrame": 1,
|
||||||
"timeScale": 1,
|
"timeScale": 1,
|
||||||
|
@ -2456,7 +2679,7 @@
|
||||||
"children": [
|
"children": [
|
||||||
],
|
],
|
||||||
"data": {
|
"data": {
|
||||||
"endFrame": 78,
|
"endFrame": 94,
|
||||||
"loopFlag": false,
|
"loopFlag": false,
|
||||||
"startFrame": 1,
|
"startFrame": 1,
|
||||||
"timeScale": 1,
|
"timeScale": 1,
|
||||||
|
@ -2469,7 +2692,7 @@
|
||||||
"children": [
|
"children": [
|
||||||
],
|
],
|
||||||
"data": {
|
"data": {
|
||||||
"endFrame": 66,
|
"endFrame": 68,
|
||||||
"loopFlag": false,
|
"loopFlag": false,
|
||||||
"startFrame": 1,
|
"startFrame": 1,
|
||||||
"timeScale": 1,
|
"timeScale": 1,
|
||||||
|
@ -2482,7 +2705,7 @@
|
||||||
"children": [
|
"children": [
|
||||||
],
|
],
|
||||||
"data": {
|
"data": {
|
||||||
"endFrame": 85,
|
"endFrame": 84,
|
||||||
"loopFlag": false,
|
"loopFlag": false,
|
||||||
"startFrame": 1,
|
"startFrame": 1,
|
||||||
"timeScale": 1,
|
"timeScale": 1,
|
||||||
|
@ -2979,7 +3202,7 @@
|
||||||
"children": [
|
"children": [
|
||||||
],
|
],
|
||||||
"data": {
|
"data": {
|
||||||
"endFrame": 18,
|
"endFrame": 17,
|
||||||
"loopFlag": false,
|
"loopFlag": false,
|
||||||
"startFrame": 1,
|
"startFrame": 1,
|
||||||
"timeScale": 1,
|
"timeScale": 1,
|
||||||
|
@ -2992,9 +3215,9 @@
|
||||||
"children": [
|
"children": [
|
||||||
],
|
],
|
||||||
"data": {
|
"data": {
|
||||||
"endFrame": 97,
|
"endFrame": 111,
|
||||||
"loopFlag": true,
|
"loopFlag": true,
|
||||||
"startFrame": 18,
|
"startFrame": 17,
|
||||||
"timeScale": 1,
|
"timeScale": 1,
|
||||||
"url": "qrc:///avatar/animations/emote_clap01_all.fbx"
|
"url": "qrc:///avatar/animations/emote_clap01_all.fbx"
|
||||||
},
|
},
|
||||||
|
@ -3005,9 +3228,9 @@
|
||||||
"children": [
|
"children": [
|
||||||
],
|
],
|
||||||
"data": {
|
"data": {
|
||||||
"endFrame": 146,
|
"endFrame": 160,
|
||||||
"loopFlag": false,
|
"loopFlag": false,
|
||||||
"startFrame": 97,
|
"startFrame": 111,
|
||||||
"timeScale": 1,
|
"timeScale": 1,
|
||||||
"url": "qrc:///avatar/animations/emote_clap01_all.fbx"
|
"url": "qrc:///avatar/animations/emote_clap01_all.fbx"
|
||||||
},
|
},
|
||||||
|
@ -3308,7 +3531,7 @@
|
||||||
"children": [
|
"children": [
|
||||||
],
|
],
|
||||||
"data": {
|
"data": {
|
||||||
"endFrame": 22,
|
"endFrame": 21,
|
||||||
"loopFlag": false,
|
"loopFlag": false,
|
||||||
"startFrame": 1,
|
"startFrame": 1,
|
||||||
"timeScale": 1,
|
"timeScale": 1,
|
||||||
|
@ -3321,9 +3544,9 @@
|
||||||
"children": [
|
"children": [
|
||||||
],
|
],
|
||||||
"data": {
|
"data": {
|
||||||
"endFrame": 40,
|
"endFrame": 100,
|
||||||
"loopFlag": true,
|
"loopFlag": true,
|
||||||
"startFrame": 22,
|
"startFrame": 21,
|
||||||
"timeScale": 1,
|
"timeScale": 1,
|
||||||
"url": "qrc:///avatar/animations/emote_point01_all.fbx"
|
"url": "qrc:///avatar/animations/emote_point01_all.fbx"
|
||||||
},
|
},
|
||||||
|
@ -3334,9 +3557,9 @@
|
||||||
"children": [
|
"children": [
|
||||||
],
|
],
|
||||||
"data": {
|
"data": {
|
||||||
"endFrame": 78,
|
"endFrame": 134,
|
||||||
"loopFlag": false,
|
"loopFlag": false,
|
||||||
"startFrame": 40,
|
"startFrame": 100,
|
||||||
"timeScale": 1,
|
"timeScale": 1,
|
||||||
"url": "qrc:///avatar/animations/emote_point01_all.fbx"
|
"url": "qrc:///avatar/animations/emote_point01_all.fbx"
|
||||||
},
|
},
|
||||||
|
@ -3405,8 +3628,8 @@
|
||||||
{
|
{
|
||||||
"easingType": "easeInOutQuad",
|
"easingType": "easeInOutQuad",
|
||||||
"id": "idleTalkOverlay",
|
"id": "idleTalkOverlay",
|
||||||
"interpDuration": 24,
|
"interpDuration": 20,
|
||||||
"interpTarget": 24,
|
"interpTarget": 20,
|
||||||
"interpType": "evaluateBoth",
|
"interpType": "evaluateBoth",
|
||||||
"transitions": [
|
"transitions": [
|
||||||
{
|
{
|
||||||
|
|
|
@ -35,10 +35,8 @@ TextField {
|
||||||
leftPadding: 0
|
leftPadding: 0
|
||||||
rightPadding: root.rightGlyph === "" ? 0 : rightGlyphItem.implicitWidth + simplifiedUI.sizes.controls.textField.rightGlyphPadding
|
rightPadding: root.rightGlyph === "" ? 0 : rightGlyphItem.implicitWidth + simplifiedUI.sizes.controls.textField.rightGlyphPadding
|
||||||
|
|
||||||
onFocusChanged: {
|
onPressed: {
|
||||||
if (focus) {
|
Tablet.playSound(TabletEnums.ButtonClick);
|
||||||
Tablet.playSound(TabletEnums.ButtonClick);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
onHoveredChanged: {
|
onHoveredChanged: {
|
||||||
|
|
|
@ -313,8 +313,8 @@ void MySkeletonModel::updateRig(float deltaTime, glm::mat4 parentTransform) {
|
||||||
if (spine2Joint >= 0) {
|
if (spine2Joint >= 0) {
|
||||||
params.spine2ShapeInfo = hfmModel.joints[spine2Joint].shapeInfo;
|
params.spine2ShapeInfo = hfmModel.joints[spine2Joint].shapeInfo;
|
||||||
}
|
}
|
||||||
|
const float TALKING_TIME_THRESHOLD = 0.75f;
|
||||||
params.isTalking = head->getTimeWithoutTalking() <= 1.5f;
|
params.isTalking = head->getTimeWithoutTalking() <= TALKING_TIME_THRESHOLD;
|
||||||
|
|
||||||
myAvatar->updateRigControllerParameters(params);
|
myAvatar->updateRigControllerParameters(params);
|
||||||
|
|
||||||
|
|
|
@ -512,13 +512,13 @@ void OtherAvatar::handleChangedAvatarEntityData() {
|
||||||
entity->setParentID(NULL_ID);
|
entity->setParentID(NULL_ID);
|
||||||
entity->setParentID(oldParentID);
|
entity->setParentID(oldParentID);
|
||||||
|
|
||||||
if (entity->stillHasMyGrabAction()) {
|
if (entity->stillHasMyGrab()) {
|
||||||
// For this case: we want to ignore transform+velocities coming from authoritative OtherAvatar
|
// For this case: we want to ignore transform+velocities coming from authoritative OtherAvatar
|
||||||
// because the MyAvatar is grabbing and we expect the local grab state
|
// because the MyAvatar is grabbing and we expect the local grab state
|
||||||
// to have enough information to prevent simulation drift.
|
// to have enough information to prevent simulation drift.
|
||||||
//
|
//
|
||||||
// Clever readers might realize this could cause problems. For example,
|
// Clever readers might realize this could cause problems. For example,
|
||||||
// if an ignored OtherAvagtar were to simultanously grab the object then there would be
|
// if an ignored OtherAvatar were to simultanously grab the object then there would be
|
||||||
// a noticeable discrepancy between participants in the distributed physics simulation,
|
// a noticeable discrepancy between participants in the distributed physics simulation,
|
||||||
// however the difference would be stable and would not drift.
|
// however the difference would be stable and would not drift.
|
||||||
properties.clearTransformOrVelocityChanges();
|
properties.clearTransformOrVelocityChanges();
|
||||||
|
|
|
@ -14,6 +14,7 @@
|
||||||
#include <QtCore/QProcess>
|
#include <QtCore/QProcess>
|
||||||
#include <QDebug>
|
#include <QDebug>
|
||||||
#include <QDir>
|
#include <QDir>
|
||||||
|
#include <QFileInfo>
|
||||||
#include <QLocalSocket>
|
#include <QLocalSocket>
|
||||||
#include <QLocalServer>
|
#include <QLocalServer>
|
||||||
#include <QSharedMemory>
|
#include <QSharedMemory>
|
||||||
|
@ -117,21 +118,27 @@ int main(int argc, const char* argv[]) {
|
||||||
}
|
}
|
||||||
|
|
||||||
QString applicationPath;
|
QString applicationPath;
|
||||||
|
// A temporary application instance is needed to get the location of the running executable
|
||||||
|
// Tests using high_resolution_clock show that this takes about 30-50 microseconds (on my machine, YMMV)
|
||||||
|
// If we wanted to avoid the QCoreApplication, we would need to write our own
|
||||||
|
// cross-platform implementation.
|
||||||
{
|
{
|
||||||
// A temporary application instance is needed to get the location of the running executable
|
|
||||||
// Tests using high_resolution_clock show that this takes about 30-50 microseconds (on my machine, YMMV)
|
|
||||||
// If we wanted to avoid the QCoreApplication, we would need to write our own
|
|
||||||
// cross-platform implementation.
|
|
||||||
QCoreApplication tempApp(argc, const_cast<char**>(argv));
|
QCoreApplication tempApp(argc, const_cast<char**>(argv));
|
||||||
|
#ifdef Q_OS_OSX
|
||||||
|
if (QFileInfo::exists(QCoreApplication::applicationDirPath() + "/../../../config.json")) {
|
||||||
|
applicationPath = QCoreApplication::applicationDirPath() + "/../../../";
|
||||||
|
} else {
|
||||||
|
applicationPath = QCoreApplication::applicationDirPath();
|
||||||
|
}
|
||||||
|
#else
|
||||||
applicationPath = QCoreApplication::applicationDirPath();
|
applicationPath = QCoreApplication::applicationDirPath();
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
static const QString APPLICATION_CONFIG_FILENAME = "config.json";
|
static const QString APPLICATION_CONFIG_FILENAME = "config.json";
|
||||||
QDir applicationDir(applicationPath);
|
QDir applicationDir(applicationPath);
|
||||||
QString configFileName = applicationDir.filePath(APPLICATION_CONFIG_FILENAME);
|
QString configFileName = applicationDir.filePath(APPLICATION_CONFIG_FILENAME);
|
||||||
QFile configFile(configFileName);
|
QFile configFile(configFileName);
|
||||||
QString launcherPath;
|
QString launcherPath;
|
||||||
|
|
||||||
if (configFile.exists()) {
|
if (configFile.exists()) {
|
||||||
if (!configFile.open(QIODevice::ReadOnly)) {
|
if (!configFile.open(QIODevice::ReadOnly)) {
|
||||||
qWarning() << "Found application config, but could not open it";
|
qWarning() << "Found application config, but could not open it";
|
||||||
|
|
|
@ -71,32 +71,44 @@ static QString getTargetDevice(bool hmd, QAudio::Mode mode) {
|
||||||
Qt::ItemFlags AudioDeviceList::_flags { Qt::ItemIsSelectable | Qt::ItemIsEnabled };
|
Qt::ItemFlags AudioDeviceList::_flags { Qt::ItemIsSelectable | Qt::ItemIsEnabled };
|
||||||
|
|
||||||
AudioDeviceList::AudioDeviceList(QAudio::Mode mode) : _mode(mode) {
|
AudioDeviceList::AudioDeviceList(QAudio::Mode mode) : _mode(mode) {
|
||||||
auto& setting1 = getSetting(true, QAudio::AudioInput);
|
if (mode == QAudio::AudioInput) {
|
||||||
if (setting1.isSet()) {
|
auto& setting1 = getSetting(true, QAudio::AudioInput);
|
||||||
qDebug() << "Device name in settings for HMD, Input" << setting1.get();
|
if (setting1.isSet()) {
|
||||||
} else {
|
qDebug() << "Device name in settings for HMD, Input" << setting1.get();
|
||||||
qDebug() << "Device name in settings for HMD, Input not set";
|
_backupSelectedHMDDeviceName = setting1.get();
|
||||||
|
} else {
|
||||||
|
qDebug() << "Device name in settings for HMD, Input not set";
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
auto& setting2 = getSetting(true, QAudio::AudioOutput);
|
if (mode == QAudio::AudioOutput) {
|
||||||
if (setting2.isSet()) {
|
auto& setting2 = getSetting(true, QAudio::AudioOutput);
|
||||||
qDebug() << "Device name in settings for HMD, Output" << setting2.get();
|
if (setting2.isSet()) {
|
||||||
} else {
|
qDebug() << "Device name in settings for HMD, Output" << setting2.get();
|
||||||
qDebug() << "Device name in settings for HMD, Output not set";
|
_backupSelectedHMDDeviceName = setting2.get();
|
||||||
|
} else {
|
||||||
|
qDebug() << "Device name in settings for HMD, Output not set";
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
auto& setting3 = getSetting(false, QAudio::AudioInput);
|
if (mode == QAudio::AudioInput) {
|
||||||
if (setting3.isSet()) {
|
auto& setting3 = getSetting(false, QAudio::AudioInput);
|
||||||
qDebug() << "Device name in settings for Desktop, Input" << setting3.get();
|
if (setting3.isSet()) {
|
||||||
} else {
|
qDebug() << "Device name in settings for Desktop, Input" << setting3.get();
|
||||||
qDebug() << "Device name in settings for Desktop, Input not set";
|
_backupSelectedDesktopDeviceName = setting3.get();
|
||||||
|
} else {
|
||||||
|
qDebug() << "Device name in settings for Desktop, Input not set";
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
auto& setting4 = getSetting(false, QAudio::AudioOutput);
|
if (mode == QAudio::AudioOutput) {
|
||||||
if (setting4.isSet()) {
|
auto& setting4 = getSetting(false, QAudio::AudioOutput);
|
||||||
qDebug() << "Device name in settings for Desktop, Output" << setting4.get();
|
if (setting4.isSet()) {
|
||||||
} else {
|
qDebug() << "Device name in settings for Desktop, Output" << setting4.get();
|
||||||
qDebug() << "Device name in settings for Desktop, Output not set";
|
_backupSelectedDesktopDeviceName = setting4.get();
|
||||||
|
} else {
|
||||||
|
qDebug() << "Device name in settings for Desktop, Output not set";
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -126,7 +126,10 @@ add_custom_command(TARGET ${PROJECT_NAME} PRE_BUILD
|
||||||
|
|
||||||
add_custom_command(TARGET ${PROJECT_NAME} POST_BUILD
|
add_custom_command(TARGET ${PROJECT_NAME} POST_BUILD
|
||||||
COMMAND updater
|
COMMAND updater
|
||||||
COMMAND ${CMAKE_COMMAND} -E copy "${CMAKE_CURRENT_BINARY_DIR}/${CMAKE_CFG_INTDIR}/updater" "${CMAKE_CURRENT_BINARY_DIR}/${CMAKE_CFG_INTDIR}/${APP_NAME}.app/Contents/Resources/")
|
COMMAND ${CMAKE_COMMAND} -E copy "${CMAKE_CURRENT_BINARY_DIR}/${CMAKE_CFG_INTDIR}/updater" "${CMAKE_CURRENT_BINARY_DIR}/${CMAKE_CFG_INTDIR}/${APP_NAME}.app/Contents/MacOS/"
|
||||||
|
# Older versions of Launcher put updater in `/Contents/Resources/updater`.
|
||||||
|
COMMAND ${CMAKE_COMMAND} -E chdir "${CMAKE_CURRENT_BINARY_DIR}/${CMAKE_CFG_INTDIR}/${APP_NAME}.app/Contents/Resources" ln -sf ../MacOS/updater updater
|
||||||
|
)
|
||||||
|
|
||||||
install(
|
install(
|
||||||
TARGETS HQLauncher
|
TARGETS HQLauncher
|
||||||
|
|
10
launchers/darwin/HQ Launcher.entitlements
Normal file
10
launchers/darwin/HQ Launcher.entitlements
Normal file
|
@ -0,0 +1,10 @@
|
||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
|
||||||
|
<plist version="1.0">
|
||||||
|
<dict>
|
||||||
|
<key>com.apple.security.application-groups</key>
|
||||||
|
<array>
|
||||||
|
<string>high-fidelity.hifi</string>
|
||||||
|
</array>
|
||||||
|
</dict>
|
||||||
|
</plist>
|
|
@ -50,6 +50,8 @@
|
||||||
repeats: YES];
|
repeats: YES];
|
||||||
NSError *error = nil;
|
NSError *error = nil;
|
||||||
NSFileManager *fileManager = [NSFileManager defaultManager];
|
NSFileManager *fileManager = [NSFileManager defaultManager];
|
||||||
|
Launcher* sharedLauncher = [Launcher sharedLauncher];
|
||||||
|
NSString* appPath = [sharedLauncher getAppPath];
|
||||||
NSString *destinationFileName = downloadTask.originalRequest.URL.lastPathComponent;
|
NSString *destinationFileName = downloadTask.originalRequest.URL.lastPathComponent;
|
||||||
NSString* finalFilePath = [[[Launcher sharedLauncher] getAppPath] stringByAppendingPathComponent:destinationFileName];
|
NSString* finalFilePath = [[[Launcher sharedLauncher] getAppPath] stringByAppendingPathComponent:destinationFileName];
|
||||||
NSURL *destinationURL = [NSURL URLWithString: [finalFilePath stringByAddingPercentEncodingWithAllowedCharacters:[NSCharacterSet URLFragmentAllowedCharacterSet]] relativeToURL: [NSURL URLWithString:@"file://"]];
|
NSURL *destinationURL = [NSURL URLWithString: [finalFilePath stringByAddingPercentEncodingWithAllowedCharacters:[NSCharacterSet URLFragmentAllowedCharacterSet]] relativeToURL: [NSURL URLWithString:@"file://"]];
|
||||||
|
@ -59,7 +61,12 @@
|
||||||
}
|
}
|
||||||
[fileManager moveItemAtURL:location toURL:destinationURL error:&error];
|
[fileManager moveItemAtURL:location toURL:destinationURL error:&error];
|
||||||
|
|
||||||
Launcher* sharedLauncher = [Launcher sharedLauncher];
|
NSURL *oldInterfaceURL = [NSURL URLWithString: [[appPath stringByAppendingString:@"interface.app"] stringByAddingPercentEncodingWithAllowedCharacters:[NSCharacterSet URLFragmentAllowedCharacterSet]] relativeToURL: [NSURL URLWithString:@"file://"]];
|
||||||
|
|
||||||
|
if([fileManager fileExistsAtPath:[oldInterfaceURL path]])
|
||||||
|
{
|
||||||
|
[fileManager removeItemAtURL:oldInterfaceURL error:nil];
|
||||||
|
}
|
||||||
|
|
||||||
if (error) {
|
if (error) {
|
||||||
NSLog(@"Download Interface: failed to move file to destination -> error: %@", error);
|
NSLog(@"Download Interface: failed to move file to destination -> error: %@", error);
|
||||||
|
@ -68,7 +75,6 @@
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
[sharedLauncher setDownloadFilename:destinationFileName];
|
[sharedLauncher setDownloadFilename:destinationFileName];
|
||||||
NSString* appPath = [sharedLauncher getAppPath];
|
|
||||||
NSString* downloadFileName = [sharedLauncher getDownloadFilename];
|
NSString* downloadFileName = [sharedLauncher getDownloadFilename];
|
||||||
|
|
||||||
NSLog(@"extract interface zip");
|
NSLog(@"extract interface zip");
|
||||||
|
|
|
@ -3,6 +3,8 @@
|
||||||
@interface DownloadLauncher : NSObject<NSURLSessionDataDelegate, NSURLSessionDelegate, NSURLSessionTaskDelegate, NSURLDownloadDelegate> {
|
@interface DownloadLauncher : NSObject<NSURLSessionDataDelegate, NSURLSessionDelegate, NSURLSessionTaskDelegate, NSURLDownloadDelegate> {
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@property (readonly) bool didBecomeDownloadTask;
|
||||||
|
|
||||||
- (void) downloadLauncher:(NSString*) launcherUrl;
|
- (void) downloadLauncher:(NSString*) launcherUrl;
|
||||||
|
|
||||||
@end
|
@end
|
||||||
|
|
|
@ -8,6 +8,13 @@ static const NSString *kIOError = @"IOError";
|
||||||
|
|
||||||
@implementation DownloadLauncher
|
@implementation DownloadLauncher
|
||||||
|
|
||||||
|
-(id)init {
|
||||||
|
if ((self = [super init]) != nil) {
|
||||||
|
_didBecomeDownloadTask = false;
|
||||||
|
}
|
||||||
|
return self;
|
||||||
|
}
|
||||||
|
|
||||||
- (void) downloadLauncher:(NSString*)launcherUrl {
|
- (void) downloadLauncher:(NSString*)launcherUrl {
|
||||||
NSMutableURLRequest* request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:launcherUrl]
|
NSMutableURLRequest* request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:launcherUrl]
|
||||||
cachePolicy:NSURLRequestUseProtocolCachePolicy
|
cachePolicy:NSURLRequestUseProtocolCachePolicy
|
||||||
|
@ -16,8 +23,8 @@ static const NSString *kIOError = @"IOError";
|
||||||
|
|
||||||
NSURLSessionConfiguration *defaultConfigObject = [NSURLSessionConfiguration defaultSessionConfiguration];
|
NSURLSessionConfiguration *defaultConfigObject = [NSURLSessionConfiguration defaultSessionConfiguration];
|
||||||
NSURLSession *defaultSession = [NSURLSession sessionWithConfiguration: defaultConfigObject delegate: self delegateQueue: [NSOperationQueue mainQueue]];
|
NSURLSession *defaultSession = [NSURLSession sessionWithConfiguration: defaultConfigObject delegate: self delegateQueue: [NSOperationQueue mainQueue]];
|
||||||
NSURLSessionDownloadTask *downloadTask = [defaultSession downloadTaskWithRequest:request];
|
NSURLSessionDataTask *task = [defaultSession dataTaskWithRequest:request];
|
||||||
[downloadTask resume];
|
[task resume];
|
||||||
}
|
}
|
||||||
|
|
||||||
-(void)URLSession:(NSURLSession *)session downloadTask:(NSURLSessionDownloadTask *)downloadTask didWriteData:(int64_t)bytesWritten totalBytesWritten:(int64_t)totalBytesWritten totalBytesExpectedToWrite:(int64_t)totalBytesExpectedToWrite {
|
-(void)URLSession:(NSURLSession *)session downloadTask:(NSURLSessionDownloadTask *)downloadTask didWriteData:(int64_t)bytesWritten totalBytesWritten:(int64_t)totalBytesWritten totalBytesExpectedToWrite:(int64_t)totalBytesExpectedToWrite {
|
||||||
|
@ -45,6 +52,25 @@ static const NSString *kIOError = @"IOError";
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
-(void)URLSession:(NSURLSession *)session dataTask:(NSURLSessionDataTask *)dataTask
|
||||||
|
didReceiveResponse:(NSURLResponse *)response
|
||||||
|
completionHandler:(void (^)(NSURLSessionResponseDisposition))completionHandler
|
||||||
|
{
|
||||||
|
NSHTTPURLResponse *httpResponse = (NSHTTPURLResponse *)response;
|
||||||
|
NSURLSessionResponseDisposition disposition = NSURLSessionResponseBecomeDownload;
|
||||||
|
if (httpResponse.statusCode != 200) {
|
||||||
|
NSLog(@"expected statusCode 200, got %ld", (long)httpResponse.statusCode);
|
||||||
|
disposition = NSURLSessionResponseCancel;
|
||||||
|
}
|
||||||
|
completionHandler(disposition);
|
||||||
|
}
|
||||||
|
|
||||||
|
- (void)URLSession:(NSURLSession *)session dataTask:(NSURLSessionDataTask *)dataTask
|
||||||
|
didBecomeDownloadTask:(NSURLSessionDownloadTask *)downloadTask
|
||||||
|
{
|
||||||
|
_didBecomeDownloadTask = true;
|
||||||
|
}
|
||||||
|
|
||||||
-(void)URLSession:(NSURLSession*)session downloadTask:(NSURLSessionDownloadTask*)downloadTask didFinishDownloadingToURL:(NSURL*)location {
|
-(void)URLSession:(NSURLSession*)session downloadTask:(NSURLSessionDownloadTask*)downloadTask didFinishDownloadingToURL:(NSURL*)location {
|
||||||
NSLog(@"Did finish downloading to url");
|
NSLog(@"Did finish downloading to url");
|
||||||
@try {
|
@try {
|
||||||
|
@ -95,9 +121,14 @@ static const NSString *kIOError = @"IOError";
|
||||||
}
|
}
|
||||||
|
|
||||||
- (void)URLSession:(NSURLSession*)session task:(NSURLSessionTask*)task didCompleteWithError:(NSError*)error {
|
- (void)URLSession:(NSURLSession*)session task:(NSURLSessionTask*)task didCompleteWithError:(NSError*)error {
|
||||||
NSLog(@"completed; error: %@", error);
|
|
||||||
if (error) {
|
if (error) {
|
||||||
|
if (_didBecomeDownloadTask && [task class] == [NSURLSessionDataTask class]) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
NSLog(@"couldn't complete download: %@", error);
|
||||||
[[Launcher sharedLauncher] displayErrorPage];
|
[[Launcher sharedLauncher] displayErrorPage];
|
||||||
|
} else {
|
||||||
|
NSLog(@"finished downloading Launcher");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@end
|
@end
|
||||||
|
|
|
@ -59,7 +59,7 @@
|
||||||
NSString* defaultBuildTag = [json valueForKey:@"default_tag"];
|
NSString* defaultBuildTag = [json valueForKey:@"default_tag"];
|
||||||
|
|
||||||
NSString* launcherVersion = [launcherValues valueForKey:@"version"];
|
NSString* launcherVersion = [launcherValues valueForKey:@"version"];
|
||||||
NSString* launcherUrl = [[[launcherValues valueForKey:@"mac"] valueForKey:@"url"] stringByRemovingPercentEncoding];
|
NSString* launcherUrl = [[launcherValues valueForKey:@"mac"] valueForKey:@"url"];
|
||||||
|
|
||||||
BOOL appDirectoryExist = [fileManager fileExistsAtPath:[[sharedLauncher getAppPath] stringByAppendingString:@"interface.app"]];
|
BOOL appDirectoryExist = [fileManager fileExistsAtPath:[[sharedLauncher getAppPath] stringByAppendingString:@"interface.app"]];
|
||||||
|
|
||||||
|
|
|
@ -383,6 +383,13 @@ static BOOL const DELETE_ZIP_FILES = TRUE;
|
||||||
|
|
||||||
[self updateLatestBuildInfo];
|
[self updateLatestBuildInfo];
|
||||||
|
|
||||||
|
NSString *kLauncherUrl = @"LAUNCHER_URL";
|
||||||
|
NSString *envLauncherUrl = [[NSProcessInfo processInfo] environment][kLauncherUrl];
|
||||||
|
if (envLauncherUrl != nil) {
|
||||||
|
NSLog(@"Using launcherUrl from environment: %@ = %@", kLauncherUrl, envLauncherUrl);
|
||||||
|
launcherUrl = envLauncherUrl;
|
||||||
|
}
|
||||||
|
|
||||||
NSDictionary* launcherArguments = [LauncherCommandlineArgs arguments];
|
NSDictionary* launcherArguments = [LauncherCommandlineArgs arguments];
|
||||||
if (newLauncherAvailable && ![launcherArguments valueForKey: @"--noUpdate"]) {
|
if (newLauncherAvailable && ![launcherArguments valueForKey: @"--noUpdate"]) {
|
||||||
[self.downloadLauncher downloadLauncher: launcherUrl];
|
[self.downloadLauncher downloadLauncher: launcherUrl];
|
||||||
|
@ -460,11 +467,36 @@ static BOOL const DELETE_ZIP_FILES = TRUE;
|
||||||
|
|
||||||
-(void)runAutoupdater
|
-(void)runAutoupdater
|
||||||
{
|
{
|
||||||
NSTask* task = [[NSTask alloc] init];
|
NSException *exception;
|
||||||
|
bool launched = false;
|
||||||
NSString* newLauncher = [[[Launcher sharedLauncher] getDownloadPathForContentAndScripts] stringByAppendingPathComponent: @"HQ Launcher.app"];
|
NSString* newLauncher = [[[Launcher sharedLauncher] getDownloadPathForContentAndScripts] stringByAppendingPathComponent: @"HQ Launcher.app"];
|
||||||
task.launchPath = [newLauncher stringByAppendingString:@"/Contents/Resources/updater"];
|
|
||||||
task.arguments = @[[[NSBundle mainBundle] bundlePath], newLauncher];
|
// Older versions of Launcher put updater in `/Contents/Resources/updater`.
|
||||||
[task launch];
|
for (NSString *bundlePath in @[@"/Contents/MacOS/updater",
|
||||||
|
@"/Contents/Resources/updater",
|
||||||
|
]) {
|
||||||
|
NSTask* task = [[NSTask alloc] init];
|
||||||
|
task.launchPath = [newLauncher stringByAppendingString: bundlePath];
|
||||||
|
task.arguments = @[[[NSBundle mainBundle] bundlePath], newLauncher];
|
||||||
|
|
||||||
|
NSLog(@"launching updater: %@ %@", task.launchPath, task.arguments);
|
||||||
|
|
||||||
|
@try {
|
||||||
|
[task launch];
|
||||||
|
}
|
||||||
|
@catch (NSException *e) {
|
||||||
|
NSLog(@"couldn't launch updater: %@, %@", e.name, e.reason);
|
||||||
|
exception = e;
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
|
launched = true;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!launched) {
|
||||||
|
@throw exception;
|
||||||
|
}
|
||||||
|
|
||||||
[NSApp terminate:self];
|
[NSApp terminate:self];
|
||||||
}
|
}
|
||||||
|
|
|
@ -14,19 +14,32 @@
|
||||||
return sharedSettings;
|
return sharedSettings;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
- (NSString*) getOldFilePath {
|
||||||
|
Launcher* sharedLauncher = [Launcher sharedLauncher];
|
||||||
|
NSString* appPath = [sharedLauncher getAppPath];
|
||||||
|
NSString* filePath = [appPath stringByAppendingString:@"interface.app/Contents/MacOS/"];
|
||||||
|
return filePath;
|
||||||
|
}
|
||||||
|
|
||||||
- (NSString*) getFilePath
|
- (NSString*) getFilePath
|
||||||
{
|
{
|
||||||
Launcher* sharedLauncher = [Launcher sharedLauncher];
|
Launcher* sharedLauncher = [Launcher sharedLauncher];
|
||||||
NSString* appPath = [sharedLauncher getAppPath];
|
NSString* appPath = [sharedLauncher getAppPath];
|
||||||
NSString* filePath = [appPath stringByAppendingString:@"interface.app/Contents/MacOS/"];
|
return appPath;
|
||||||
|
|
||||||
return filePath;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
- (void) readDataFromJsonFile
|
- (void) readDataFromJsonFile
|
||||||
{
|
{
|
||||||
|
NSString* oldPath = [self getOldFilePath];
|
||||||
|
NSString* fileAtOldPath = [oldPath stringByAppendingString:@"config.json"];
|
||||||
NSString* filePath = [self getFilePath];
|
NSString* filePath = [self getFilePath];
|
||||||
NSString* fileAtPath = [filePath stringByAppendingString:@"config.json"];
|
NSString* fileAtPath = [filePath stringByAppendingString:@"config.json"];
|
||||||
|
|
||||||
|
if ([[NSFileManager defaultManager] fileExistsAtPath:fileAtOldPath] && ![[NSFileManager defaultManager] fileExistsAtPath:fileAtPath]) {
|
||||||
|
BOOL success = [[NSFileManager defaultManager] moveItemAtPath:fileAtOldPath toPath:fileAtPath error:nil];
|
||||||
|
NSLog(@"move config to new location -> status: %@", success ? @"SUCCESS" : @"FAILED");
|
||||||
|
}
|
||||||
|
|
||||||
if ([[NSFileManager defaultManager] fileExistsAtPath:fileAtPath]) {
|
if ([[NSFileManager defaultManager] fileExistsAtPath:fileAtPath]) {
|
||||||
NSString* jsonString = [[NSString alloc] initWithData:[NSData dataWithContentsOfFile:fileAtPath] encoding:NSUTF8StringEncoding];
|
NSString* jsonString = [[NSString alloc] initWithData:[NSData dataWithContentsOfFile:fileAtPath] encoding:NSUTF8StringEncoding];
|
||||||
NSError * err;
|
NSError * err;
|
||||||
|
@ -34,7 +47,6 @@
|
||||||
NSDictionary * json;
|
NSDictionary * json;
|
||||||
if (data != nil) {
|
if (data != nil) {
|
||||||
json = (NSDictionary *)[NSJSONSerialization JSONObjectWithData:data options:NSJSONReadingMutableContainers error:&err];
|
json = (NSDictionary *)[NSJSONSerialization JSONObjectWithData:data options:NSJSONReadingMutableContainers error:&err];
|
||||||
|
|
||||||
self.loggedIn = [[json valueForKey:@"loggedIn"] boolValue];
|
self.loggedIn = [[json valueForKey:@"loggedIn"] boolValue];
|
||||||
self.build = [[json valueForKey:@"build_version"] integerValue];
|
self.build = [[json valueForKey:@"build_version"] integerValue];
|
||||||
self.launcher = [json valueForKey:@"luancherPath"];
|
self.launcher = [json valueForKey:@"luancherPath"];
|
||||||
|
@ -64,18 +76,18 @@
|
||||||
NSError * err;
|
NSError * err;
|
||||||
NSData * jsonData = [NSJSONSerialization dataWithJSONObject:json options:0 error:&err];
|
NSData * jsonData = [NSJSONSerialization dataWithJSONObject:json options:0 error:&err];
|
||||||
NSString * jsonString = [[NSString alloc] initWithData:jsonData encoding:NSUTF8StringEncoding];
|
NSString * jsonString = [[NSString alloc] initWithData:jsonData encoding:NSUTF8StringEncoding];
|
||||||
|
|
||||||
NSString* filePath = [self getFilePath];
|
NSString* filePath = [self getFilePath];
|
||||||
NSString* fileAtPath = [filePath stringByAppendingString:@"config.json"];
|
NSString* fileAtPath = [filePath stringByAppendingString:@"config.json"];
|
||||||
|
|
||||||
if (![[NSFileManager defaultManager] fileExistsAtPath:fileAtPath]) {
|
if (![[NSFileManager defaultManager] fileExistsAtPath:fileAtPath]) {
|
||||||
NSError * error = nil;
|
NSError * error = nil;
|
||||||
[[NSFileManager defaultManager] createDirectoryAtPath:filePath withIntermediateDirectories:FALSE attributes:nil error:&error];
|
[[NSFileManager defaultManager] createDirectoryAtPath:filePath withIntermediateDirectories:FALSE attributes:nil error:&error];
|
||||||
[[NSFileManager defaultManager] createFileAtPath:fileAtPath contents:nil attributes:nil];
|
[[NSFileManager defaultManager] createFileAtPath:fileAtPath contents:nil attributes:nil];
|
||||||
|
|
||||||
}
|
}
|
||||||
[[jsonString dataUsingEncoding:NSUTF8StringEncoding] writeToFile:fileAtPath atomically:NO];
|
[[jsonString dataUsingEncoding:NSUTF8StringEncoding] writeToFile:fileAtPath atomically:NO];
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
-(id)init
|
-(id)init
|
||||||
|
|
|
@ -2117,7 +2117,7 @@ void Rig::updateFromControllerParameters(const ControllerParameters& params, flo
|
||||||
_previousIsTalking = params.isTalking;
|
_previousIsTalking = params.isTalking;
|
||||||
|
|
||||||
const float TOTAL_EASE_IN_TIME = 0.75f;
|
const float TOTAL_EASE_IN_TIME = 0.75f;
|
||||||
const float TOTAL_EASE_OUT_TIME = 1.5f;
|
const float TOTAL_EASE_OUT_TIME = 0.75f;
|
||||||
if (params.isTalking) {
|
if (params.isTalking) {
|
||||||
if (_talkIdleInterpTime < 1.0f) {
|
if (_talkIdleInterpTime < 1.0f) {
|
||||||
_talkIdleInterpTime += dt / TOTAL_EASE_IN_TIME;
|
_talkIdleInterpTime += dt / TOTAL_EASE_IN_TIME;
|
||||||
|
|
|
@ -49,7 +49,7 @@ void Head::simulate(float deltaTime) {
|
||||||
|
|
||||||
// Update audio trailing average for rendering facial animations
|
// Update audio trailing average for rendering facial animations
|
||||||
const float AUDIO_AVERAGING_SECS = 0.05f;
|
const float AUDIO_AVERAGING_SECS = 0.05f;
|
||||||
const float AUDIO_LONG_TERM_AVERAGING_SECS = 30.0f;
|
const float AUDIO_LONG_TERM_AVERAGING_SECS = 15.0f;
|
||||||
_averageLoudness = glm::mix(_averageLoudness, audioLoudness, glm::min(deltaTime / AUDIO_AVERAGING_SECS, 1.0f));
|
_averageLoudness = glm::mix(_averageLoudness, audioLoudness, glm::min(deltaTime / AUDIO_AVERAGING_SECS, 1.0f));
|
||||||
|
|
||||||
if (_longTermAverageLoudness == -1.0f) {
|
if (_longTermAverageLoudness == -1.0f) {
|
||||||
|
@ -84,7 +84,7 @@ void Head::simulate(float deltaTime) {
|
||||||
if (getHasProceduralBlinkFaceMovement()) {
|
if (getHasProceduralBlinkFaceMovement()) {
|
||||||
// Detect transition from talking to not; force blink after that and a delay
|
// Detect transition from talking to not; force blink after that and a delay
|
||||||
bool forceBlink = false;
|
bool forceBlink = false;
|
||||||
const float TALKING_LOUDNESS = 100.0f;
|
const float TALKING_LOUDNESS = 150.0f;
|
||||||
const float BLINK_AFTER_TALKING = 0.25f;
|
const float BLINK_AFTER_TALKING = 0.25f;
|
||||||
_timeWithoutTalking += deltaTime;
|
_timeWithoutTalking += deltaTime;
|
||||||
if ((_averageLoudness - _longTermAverageLoudness) > TALKING_LOUDNESS) {
|
if ((_averageLoudness - _longTermAverageLoudness) > TALKING_LOUDNESS) {
|
||||||
|
@ -176,7 +176,7 @@ void Head::simulate(float deltaTime) {
|
||||||
}
|
}
|
||||||
|
|
||||||
void Head::calculateMouthShapes(float deltaTime) {
|
void Head::calculateMouthShapes(float deltaTime) {
|
||||||
const float JAW_OPEN_SCALE = 0.015f;
|
const float JAW_OPEN_SCALE = 0.35f;
|
||||||
const float JAW_OPEN_RATE = 0.9f;
|
const float JAW_OPEN_RATE = 0.9f;
|
||||||
const float JAW_CLOSE_RATE = 0.90f;
|
const float JAW_CLOSE_RATE = 0.90f;
|
||||||
const float TIMESTEP_CONSTANT = 0.0032f;
|
const float TIMESTEP_CONSTANT = 0.0032f;
|
||||||
|
@ -188,11 +188,13 @@ void Head::calculateMouthShapes(float deltaTime) {
|
||||||
const float FUNNEL_SPEED = 2.335f;
|
const float FUNNEL_SPEED = 2.335f;
|
||||||
const float STOP_GAIN = 5.0f;
|
const float STOP_GAIN = 5.0f;
|
||||||
const float NORMAL_HZ = 60.0f; // the update rate the constant values were tuned for
|
const float NORMAL_HZ = 60.0f; // the update rate the constant values were tuned for
|
||||||
|
const float MAX_DELTA_LOUDNESS = 100.0f;
|
||||||
|
|
||||||
float deltaTimeRatio = deltaTime / (1.0f / NORMAL_HZ);
|
float deltaTimeRatio = deltaTime / (1.0f / NORMAL_HZ);
|
||||||
|
|
||||||
// From the change in loudness, decide how much to open or close the jaw
|
// From the change in loudness, decide how much to open or close the jaw
|
||||||
float audioDelta = sqrtf(glm::max(_averageLoudness - _longTermAverageLoudness, 0.0f)) * JAW_OPEN_SCALE;
|
float deltaLoudness = glm::max(glm::min(_averageLoudness - _longTermAverageLoudness, MAX_DELTA_LOUDNESS), 0.0f) / MAX_DELTA_LOUDNESS;
|
||||||
|
float audioDelta = powf(deltaLoudness, 2.0f) * JAW_OPEN_SCALE;
|
||||||
if (audioDelta > _audioJawOpen) {
|
if (audioDelta > _audioJawOpen) {
|
||||||
_audioJawOpen += (audioDelta - _audioJawOpen) * JAW_OPEN_RATE * deltaTimeRatio;
|
_audioJawOpen += (audioDelta - _audioJawOpen) * JAW_OPEN_RATE * deltaTimeRatio;
|
||||||
} else {
|
} else {
|
||||||
|
|
|
@ -798,7 +798,7 @@ int EntityItem::readEntityDataFromBuffer(const unsigned char* data, int bytesLef
|
||||||
auto lastEdited = lastEditedFromBufferAdjusted;
|
auto lastEdited = lastEditedFromBufferAdjusted;
|
||||||
bool otherOverwrites = overwriteLocalData && !weOwnSimulation;
|
bool otherOverwrites = overwriteLocalData && !weOwnSimulation;
|
||||||
// calculate hasGrab once outside the lambda rather than calling it every time inside
|
// calculate hasGrab once outside the lambda rather than calling it every time inside
|
||||||
bool hasGrab = stillHasGrabAction();
|
bool hasGrab = stillHasGrab();
|
||||||
auto shouldUpdate = [lastEdited, otherOverwrites, filterRejection, hasGrab](quint64 updatedTimestamp, bool valueChanged) {
|
auto shouldUpdate = [lastEdited, otherOverwrites, filterRejection, hasGrab](quint64 updatedTimestamp, bool valueChanged) {
|
||||||
if (hasGrab) {
|
if (hasGrab) {
|
||||||
return false;
|
return false;
|
||||||
|
@ -1444,7 +1444,7 @@ void EntityItem::getTransformAndVelocityProperties(EntityItemProperties& propert
|
||||||
|
|
||||||
void EntityItem::upgradeScriptSimulationPriority(uint8_t priority) {
|
void EntityItem::upgradeScriptSimulationPriority(uint8_t priority) {
|
||||||
uint8_t newPriority = glm::max(priority, _scriptSimulationPriority);
|
uint8_t newPriority = glm::max(priority, _scriptSimulationPriority);
|
||||||
if (newPriority < SCRIPT_GRAB_SIMULATION_PRIORITY && stillHasMyGrabAction()) {
|
if (newPriority < SCRIPT_GRAB_SIMULATION_PRIORITY && stillHasMyGrab()) {
|
||||||
newPriority = SCRIPT_GRAB_SIMULATION_PRIORITY;
|
newPriority = SCRIPT_GRAB_SIMULATION_PRIORITY;
|
||||||
}
|
}
|
||||||
if (newPriority != _scriptSimulationPriority) {
|
if (newPriority != _scriptSimulationPriority) {
|
||||||
|
@ -1457,7 +1457,7 @@ void EntityItem::upgradeScriptSimulationPriority(uint8_t priority) {
|
||||||
void EntityItem::clearScriptSimulationPriority() {
|
void EntityItem::clearScriptSimulationPriority() {
|
||||||
// DO NOT markDirtyFlags(Simulation::DIRTY_SIMULATION_OWNERSHIP_PRIORITY) here, because this
|
// DO NOT markDirtyFlags(Simulation::DIRTY_SIMULATION_OWNERSHIP_PRIORITY) here, because this
|
||||||
// is only ever called from the code that actually handles the dirty flags, and it knows best.
|
// is only ever called from the code that actually handles the dirty flags, and it knows best.
|
||||||
_scriptSimulationPriority = stillHasMyGrabAction() ? SCRIPT_GRAB_SIMULATION_PRIORITY : 0;
|
_scriptSimulationPriority = stillHasMyGrab() ? SCRIPT_GRAB_SIMULATION_PRIORITY : 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
void EntityItem::setPendingOwnershipPriority(uint8_t priority) {
|
void EntityItem::setPendingOwnershipPriority(uint8_t priority) {
|
||||||
|
@ -2204,7 +2204,7 @@ void EntityItem::enableNoBootstrap() {
|
||||||
}
|
}
|
||||||
|
|
||||||
void EntityItem::disableNoBootstrap() {
|
void EntityItem::disableNoBootstrap() {
|
||||||
if (!stillHasMyGrabAction()) {
|
if (!stillHasMyGrab()) {
|
||||||
_flags &= ~Simulation::SPECIAL_FLAG_NO_BOOTSTRAPPING;
|
_flags &= ~Simulation::SPECIAL_FLAG_NO_BOOTSTRAPPING;
|
||||||
_flags |= Simulation::DIRTY_COLLISION_GROUP; // may need to not collide with own avatar
|
_flags |= Simulation::DIRTY_COLLISION_GROUP; // may need to not collide with own avatar
|
||||||
|
|
||||||
|
@ -2290,33 +2290,25 @@ bool EntityItem::removeAction(EntitySimulationPointer simulation, const QUuid& a
|
||||||
return success;
|
return success;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool EntityItem::stillHasGrabAction() const {
|
bool EntityItem::stillHasGrab() const {
|
||||||
return !_grabActions.empty();
|
return !(_grabs.empty());
|
||||||
}
|
}
|
||||||
|
|
||||||
// retutrns 'true' if there exists an action that returns 'true' for EntityActionInterface::isMine()
|
// returns 'true' if there exists an action that returns 'true' for EntityActionInterface::isMine()
|
||||||
// (e.g. the action belongs to the MyAvatar instance)
|
// (e.g. the action belongs to the MyAvatar instance)
|
||||||
bool EntityItem::stillHasMyGrabAction() const {
|
bool EntityItem::stillHasMyGrab() const {
|
||||||
QList<EntityDynamicPointer> holdActions = getActionsOfType(DYNAMIC_TYPE_HOLD);
|
bool foundGrab = false;
|
||||||
QList<EntityDynamicPointer>::const_iterator i = holdActions.begin();
|
if (!_grabs.empty()) {
|
||||||
while (i != holdActions.end()) {
|
_grabsLock.withReadLock([&] {
|
||||||
EntityDynamicPointer action = *i;
|
foreach (const GrabPointer &grab, _grabs) {
|
||||||
if (action->isMine()) {
|
if (grab->getOwnerID() == Physics::getSessionUUID()) {
|
||||||
return true;
|
foundGrab = true;
|
||||||
}
|
break;
|
||||||
i++;
|
}
|
||||||
|
}
|
||||||
|
});
|
||||||
}
|
}
|
||||||
QList<EntityDynamicPointer> farGrabActions = getActionsOfType(DYNAMIC_TYPE_FAR_GRAB);
|
return foundGrab;
|
||||||
i = farGrabActions.begin();
|
|
||||||
while (i != farGrabActions.end()) {
|
|
||||||
EntityDynamicPointer action = *i;
|
|
||||||
if (action->isMine()) {
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
i++;
|
|
||||||
}
|
|
||||||
|
|
||||||
return false;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
bool EntityItem::removeActionInternal(const QUuid& actionID, EntitySimulationPointer simulation) {
|
bool EntityItem::removeActionInternal(const QUuid& actionID, EntitySimulationPointer simulation) {
|
||||||
|
|
|
@ -569,7 +569,7 @@ public:
|
||||||
static void setPrimaryViewFrustumPositionOperator(std::function<glm::vec3()> getPrimaryViewFrustumPositionOperator) { _getPrimaryViewFrustumPositionOperator = getPrimaryViewFrustumPositionOperator; }
|
static void setPrimaryViewFrustumPositionOperator(std::function<glm::vec3()> getPrimaryViewFrustumPositionOperator) { _getPrimaryViewFrustumPositionOperator = getPrimaryViewFrustumPositionOperator; }
|
||||||
static glm::vec3 getPrimaryViewFrustumPosition() { return _getPrimaryViewFrustumPositionOperator(); }
|
static glm::vec3 getPrimaryViewFrustumPosition() { return _getPrimaryViewFrustumPositionOperator(); }
|
||||||
|
|
||||||
bool stillHasMyGrabAction() const;
|
bool stillHasMyGrab() const;
|
||||||
|
|
||||||
bool needsRenderUpdate() const { return resultWithReadLock<bool>([&] { return _needsRenderUpdate; }); }
|
bool needsRenderUpdate() const { return resultWithReadLock<bool>([&] { return _needsRenderUpdate; }); }
|
||||||
void setNeedsRenderUpdate(bool needsRenderUpdate) { withWriteLock([&] { _needsRenderUpdate = needsRenderUpdate; }); }
|
void setNeedsRenderUpdate(bool needsRenderUpdate) { withWriteLock([&] { _needsRenderUpdate = needsRenderUpdate; }); }
|
||||||
|
@ -585,7 +585,7 @@ protected:
|
||||||
void setSimulated(bool simulated) { _simulated = simulated; }
|
void setSimulated(bool simulated) { _simulated = simulated; }
|
||||||
|
|
||||||
const QByteArray getDynamicDataInternal() const;
|
const QByteArray getDynamicDataInternal() const;
|
||||||
bool stillHasGrabAction() const;
|
bool stillHasGrab() const;
|
||||||
void setDynamicDataInternal(QByteArray dynamicData);
|
void setDynamicDataInternal(QByteArray dynamicData);
|
||||||
|
|
||||||
virtual void dimensionsChanged() override;
|
virtual void dimensionsChanged() override;
|
||||||
|
|
|
@ -2246,8 +2246,8 @@ void EntityTree::preUpdate() {
|
||||||
void EntityTree::update(bool simulate) {
|
void EntityTree::update(bool simulate) {
|
||||||
PROFILE_RANGE(simulation_physics, "UpdateTree");
|
PROFILE_RANGE(simulation_physics, "UpdateTree");
|
||||||
PerformanceTimer perfTimer("updateTree");
|
PerformanceTimer perfTimer("updateTree");
|
||||||
withWriteLock([&] {
|
if (simulate && _simulation) {
|
||||||
if (simulate && _simulation) {
|
withWriteLock([&] {
|
||||||
_simulation->updateEntities();
|
_simulation->updateEntities();
|
||||||
{
|
{
|
||||||
PROFILE_RANGE(simulation_physics, "Deletes");
|
PROFILE_RANGE(simulation_physics, "Deletes");
|
||||||
|
@ -2265,8 +2265,8 @@ void EntityTree::update(bool simulate) {
|
||||||
deleteEntities(idsToDelete, true);
|
deleteEntities(idsToDelete, true);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
});
|
||||||
});
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
quint64 EntityTree::getAdjustedConsiderSince(quint64 sinceTime) {
|
quint64 EntityTree::getAdjustedConsiderSince(quint64 sinceTime) {
|
||||||
|
|
|
@ -274,6 +274,7 @@ enum class EntityVersion : PacketVersion {
|
||||||
TextUnlit,
|
TextUnlit,
|
||||||
ShadowBiasAndDistance,
|
ShadowBiasAndDistance,
|
||||||
TextEntityFonts,
|
TextEntityFonts,
|
||||||
|
ScriptServerKinematicMotion,
|
||||||
|
|
||||||
// Add new versions above here
|
// Add new versions above here
|
||||||
NUM_PACKET_TYPE,
|
NUM_PACKET_TYPE,
|
||||||
|
|
|
@ -740,7 +740,8 @@ bool EntityMotionState::shouldSendBid() const {
|
||||||
&& (_region == workload::Region::R1)
|
&& (_region == workload::Region::R1)
|
||||||
&& _ownershipState != EntityMotionState::OwnershipState::Unownable
|
&& _ownershipState != EntityMotionState::OwnershipState::Unownable
|
||||||
&& glm::max(glm::max(VOLUNTEER_SIMULATION_PRIORITY, _bumpedPriority), _entity->getScriptSimulationPriority()) >= _entity->getSimulationPriority()
|
&& glm::max(glm::max(VOLUNTEER_SIMULATION_PRIORITY, _bumpedPriority), _entity->getScriptSimulationPriority()) >= _entity->getSimulationPriority()
|
||||||
&& !_entity->getLocked();
|
&& !_entity->getLocked()
|
||||||
|
&& (!_body->isStaticOrKinematicObject() || _entity->stillHasMyGrab());
|
||||||
}
|
}
|
||||||
|
|
||||||
void EntityMotionState::setRigidBody(btRigidBody* body) {
|
void EntityMotionState::setRigidBody(btRigidBody* body) {
|
||||||
|
|
Loading…
Reference in a new issue