mirror of
https://github.com/overte-org/overte.git
synced 2025-08-07 04:14:38 +02:00
Merge branch 'master' of https://github.com/highfidelity/hifi into hdr
This commit is contained in:
commit
320c799379
13 changed files with 116 additions and 49 deletions
|
@ -28,6 +28,6 @@
|
||||||
};
|
};
|
||||||
|
|
||||||
if (!isScriptRunning(SCRIPT_NAME)) {
|
if (!isScriptRunning(SCRIPT_NAME)) {
|
||||||
Script.load(SCRIPT_NAME);
|
ScriptDiscoveryService.loadOneScript(SCRIPT_NAME);
|
||||||
}
|
}
|
||||||
})
|
})
|
|
@ -33,7 +33,7 @@ var toggleStreamPlayButton = Overlays.addOverlay("text", {
|
||||||
visible: false,
|
visible: false,
|
||||||
text: " Play"
|
text: " Play"
|
||||||
});
|
});
|
||||||
|
|
||||||
// Set up toggleStreamStopButton overlay.
|
// Set up toggleStreamStopButton overlay.
|
||||||
var toggleStreamStopButton = Overlays.addOverlay("text", {
|
var toggleStreamStopButton = Overlays.addOverlay("text", {
|
||||||
x: 166,
|
x: 166,
|
||||||
|
@ -47,7 +47,7 @@ var toggleStreamStopButton = Overlays.addOverlay("text", {
|
||||||
visible: false,
|
visible: false,
|
||||||
text: " Stop"
|
text: " Stop"
|
||||||
});
|
});
|
||||||
|
|
||||||
// Set up increaseVolumeButton overlay.
|
// Set up increaseVolumeButton overlay.
|
||||||
var toggleIncreaseVolumeButton = Overlays.addOverlay("text", {
|
var toggleIncreaseVolumeButton = Overlays.addOverlay("text", {
|
||||||
x: 211,
|
x: 211,
|
||||||
|
@ -61,7 +61,7 @@ var toggleIncreaseVolumeButton = Overlays.addOverlay("text", {
|
||||||
visible: false,
|
visible: false,
|
||||||
text: " +"
|
text: " +"
|
||||||
});
|
});
|
||||||
|
|
||||||
// Set up decreaseVolumeButton overlay.
|
// Set up decreaseVolumeButton overlay.
|
||||||
var toggleDecreaseVolumeButton = Overlays.addOverlay("text", {
|
var toggleDecreaseVolumeButton = Overlays.addOverlay("text", {
|
||||||
x: 234,
|
x: 234,
|
||||||
|
@ -93,7 +93,7 @@ function changeVolume(volume) {
|
||||||
}
|
}
|
||||||
streamWindow.eventBridge.emitScriptEvent(JSON.stringify(volumeJSON));
|
streamWindow.eventBridge.emitScriptEvent(JSON.stringify(volumeJSON));
|
||||||
}
|
}
|
||||||
|
|
||||||
// Function that adds mousePressEvent functionality to connect UI to enter stream URL, play and stop stream.
|
// Function that adds mousePressEvent functionality to connect UI to enter stream URL, play and stop stream.
|
||||||
function mousePressEvent(event) {
|
function mousePressEvent(event) {
|
||||||
if (Overlays.getOverlayAtPoint({x: event.x, y: event.y}) == toggleStreamPlayButton) {
|
if (Overlays.getOverlayAtPoint({x: event.x, y: event.y}) == toggleStreamPlayButton) {
|
||||||
|
@ -116,7 +116,7 @@ function mousePressEvent(event) {
|
||||||
|
|
||||||
// Function checking bool if in proper zone.
|
// Function checking bool if in proper zone.
|
||||||
function isOurZone(properties) {
|
function isOurZone(properties) {
|
||||||
return stream != "" && properties.type == "Zone";
|
return stream != "" && stream != undefined && properties.type == "Zone";
|
||||||
}
|
}
|
||||||
|
|
||||||
// Function to toggle visibile the overlay.
|
// Function to toggle visibile the overlay.
|
||||||
|
@ -129,7 +129,21 @@ function toggleVisible(newVisibility) {
|
||||||
Overlays.editOverlay(toggleDecreaseVolumeButton, {visible: visible});
|
Overlays.editOverlay(toggleDecreaseVolumeButton, {visible: visible});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Procedure to check to see if you within a zone with a given stream.
|
||||||
|
var entities = Entities.findEntities(MyAvatar.position, 0.1);
|
||||||
|
for (var i in entities) {
|
||||||
|
var properties = Entities.getEntityProperties(entities[i]);
|
||||||
|
if (properties.type == "Zone") {
|
||||||
|
print("Entered zone: " + JSON.stringify(entities[i]));
|
||||||
|
stream = JSON.parse(properties.userData).stream;
|
||||||
|
if (isOurZone(properties)) {
|
||||||
|
print("Entered zone " + JSON.stringify(entities[i]) + " with stream: " + stream);
|
||||||
|
lastZone = properties.name;
|
||||||
|
toggleVisible(true);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
// Function to check if avatar is in proper domain.
|
// Function to check if avatar is in proper domain.
|
||||||
Window.domainChanged.connect(function() {
|
Window.domainChanged.connect(function() {
|
||||||
Script.stop();
|
Script.stop();
|
||||||
|
@ -139,7 +153,7 @@ Window.domainChanged.connect(function() {
|
||||||
Entities.enterEntity.connect(function(entityID) {
|
Entities.enterEntity.connect(function(entityID) {
|
||||||
print("Entered..." + JSON.stringify(entityID));
|
print("Entered..." + JSON.stringify(entityID));
|
||||||
var properties = Entities.getEntityProperties(entityID);
|
var properties = Entities.getEntityProperties(entityID);
|
||||||
stream = properties.userData;
|
stream = JSON.parse(properties.userData).stream;
|
||||||
if(isOurZone(properties))
|
if(isOurZone(properties))
|
||||||
{
|
{
|
||||||
lastZone = properties.name;
|
lastZone = properties.name;
|
||||||
|
@ -173,4 +187,4 @@ Controller.mousePressEvent.connect(mousePressEvent);
|
||||||
streamWindow.setVisible(false);
|
streamWindow.setVisible(false);
|
||||||
|
|
||||||
// Call function upon ending script.
|
// Call function upon ending script.
|
||||||
Script.scriptEnding.connect(onScriptEnding);
|
Script.scriptEnding.connect(onScriptEnding);
|
||||||
|
|
|
@ -111,8 +111,7 @@ Window {
|
||||||
Button { text: "Stop all"; onClicked: stopAll() }
|
Button { text: "Stop all"; onClicked: stopAll() }
|
||||||
}
|
}
|
||||||
|
|
||||||
ListView {
|
ScrollView {
|
||||||
clip: true
|
|
||||||
anchors {
|
anchors {
|
||||||
top: allButtons.bottom;
|
top: allButtons.bottom;
|
||||||
left: parent.left;
|
left: parent.left;
|
||||||
|
@ -122,45 +121,49 @@ Window {
|
||||||
bottomMargin: 8
|
bottomMargin: 8
|
||||||
}
|
}
|
||||||
|
|
||||||
model: runningScriptsModel
|
ListView {
|
||||||
|
clip: true
|
||||||
|
anchors { fill: parent; margins: 0 }
|
||||||
|
|
||||||
delegate: Rectangle {
|
model: runningScriptsModel
|
||||||
radius: 3
|
|
||||||
anchors { left: parent.left; right: parent.right }
|
|
||||||
|
|
||||||
height: scriptName.height + 12
|
delegate: Rectangle {
|
||||||
color: index % 2 ? "#ddd" : "#eee"
|
radius: 3
|
||||||
|
anchors { left: parent.left; right: parent.right }
|
||||||
|
|
||||||
Text {
|
height: scriptName.height + 12
|
||||||
anchors { left: parent.left; leftMargin: 4; verticalCenter: parent.verticalCenter }
|
color: index % 2 ? "#ddd" : "#eee"
|
||||||
id: scriptName
|
|
||||||
text: name
|
|
||||||
}
|
|
||||||
|
|
||||||
Row {
|
Text {
|
||||||
anchors.verticalCenter: parent.verticalCenter
|
anchors { left: parent.left; leftMargin: 4; verticalCenter: parent.verticalCenter }
|
||||||
anchors.right: parent.right
|
id: scriptName
|
||||||
anchors.rightMargin: 4
|
text: name
|
||||||
spacing: 4
|
|
||||||
HifiControls.FontAwesome {
|
|
||||||
text: "\uf021"; size: scriptName.height;
|
|
||||||
MouseArea {
|
|
||||||
anchors { fill: parent; margins: -2; }
|
|
||||||
onClicked: reloadScript(model.url)
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
HifiControls.FontAwesome {
|
|
||||||
size: scriptName.height; text: "\uf00d"
|
Row {
|
||||||
MouseArea {
|
anchors.verticalCenter: parent.verticalCenter
|
||||||
anchors { fill: parent; margins: -2; }
|
anchors.right: parent.right
|
||||||
onClicked: stopScript(model.url)
|
anchors.rightMargin: 4
|
||||||
|
spacing: 4
|
||||||
|
HifiControls.FontAwesome {
|
||||||
|
text: "\uf021"; size: scriptName.height;
|
||||||
|
MouseArea {
|
||||||
|
anchors { fill: parent; margins: -2; }
|
||||||
|
onClicked: reloadScript(model.url)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
HifiControls.FontAwesome {
|
||||||
|
size: scriptName.height; text: "\uf00d"
|
||||||
|
MouseArea {
|
||||||
|
anchors { fill: parent; margins: -2; }
|
||||||
|
onClicked: stopScript(model.url)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
Text {
|
Text {
|
||||||
id: loadLabel
|
id: loadLabel
|
||||||
text: "Load Scripts"
|
text: "Load Scripts"
|
||||||
|
|
|
@ -2653,6 +2653,8 @@ void Application::loadSettings() {
|
||||||
|
|
||||||
Menu::getInstance()->loadSettings();
|
Menu::getInstance()->loadSettings();
|
||||||
getMyAvatar()->loadData();
|
getMyAvatar()->loadData();
|
||||||
|
|
||||||
|
_settingsLoaded = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
void Application::saveSettings() {
|
void Application::saveSettings() {
|
||||||
|
@ -3276,6 +3278,10 @@ int Application::sendNackPackets() {
|
||||||
|
|
||||||
void Application::queryOctree(NodeType_t serverType, PacketType packetType, NodeToJurisdictionMap& jurisdictions) {
|
void Application::queryOctree(NodeType_t serverType, PacketType packetType, NodeToJurisdictionMap& jurisdictions) {
|
||||||
|
|
||||||
|
if (!_settingsLoaded) {
|
||||||
|
return; // bail early if settings are not loaded
|
||||||
|
}
|
||||||
|
|
||||||
//qCDebug(interfaceapp) << ">>> inside... queryOctree()... _viewFrustum.getFieldOfView()=" << _viewFrustum.getFieldOfView();
|
//qCDebug(interfaceapp) << ">>> inside... queryOctree()... _viewFrustum.getFieldOfView()=" << _viewFrustum.getFieldOfView();
|
||||||
bool wantExtraDebugging = getLogger()->extraDebugging();
|
bool wantExtraDebugging = getLogger()->extraDebugging();
|
||||||
|
|
||||||
|
|
|
@ -510,6 +510,8 @@ private:
|
||||||
bool _reticleClickPressed { false };
|
bool _reticleClickPressed { false };
|
||||||
|
|
||||||
int _avatarAttachmentRequest = 0;
|
int _avatarAttachmentRequest = 0;
|
||||||
|
|
||||||
|
bool _settingsLoaded { false };
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif // hifi_Application_h
|
#endif // hifi_Application_h
|
||||||
|
|
|
@ -51,10 +51,10 @@ void UpdateDialog::closeDialog() {
|
||||||
}
|
}
|
||||||
|
|
||||||
void UpdateDialog::hide() {
|
void UpdateDialog::hide() {
|
||||||
((QQuickItem*)parent())->setEnabled(false);
|
((QQuickItem*)parent())->setVisible(false);
|
||||||
}
|
}
|
||||||
|
|
||||||
void UpdateDialog::triggerUpgrade() {
|
void UpdateDialog::triggerUpgrade() {
|
||||||
auto applicationUpdater = DependencyManager::get<AutoUpdater>();
|
auto applicationUpdater = DependencyManager::get<AutoUpdater>();
|
||||||
applicationUpdater.data()->performAutoUpdate(applicationUpdater.data()->getBuildData().lastKey());
|
applicationUpdater.data()->performAutoUpdate(applicationUpdater.data()->getBuildData().lastKey());
|
||||||
}
|
}
|
||||||
|
|
|
@ -772,8 +772,14 @@ int RenderableModelEntityItem::getJointIndex(const QString& name) const {
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
QStringList RenderableModelEntityItem::getJointNames() const {
|
||||||
// TODO -- expose a way to list joint names
|
QStringList result;
|
||||||
// RenderableModelEntityItem::QStringList getJointNames() const {
|
if (_model && _model->isActive()) {
|
||||||
// rig->nameOfJoint(i);
|
RigPointer rig = _model->getRig();
|
||||||
// }
|
int jointCount = rig->getJointStateCount();
|
||||||
|
for (int jointIndex = 0; jointIndex < jointCount; jointIndex++) {
|
||||||
|
result << rig->nameOfJoint(jointIndex);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return result;
|
||||||
|
}
|
||||||
|
|
|
@ -80,6 +80,7 @@ public:
|
||||||
virtual void resizeJointArrays(int newSize = -1) override;
|
virtual void resizeJointArrays(int newSize = -1) override;
|
||||||
|
|
||||||
virtual int getJointIndex(const QString& name) const override;
|
virtual int getJointIndex(const QString& name) const override;
|
||||||
|
virtual QStringList getJointNames() const override;
|
||||||
|
|
||||||
private:
|
private:
|
||||||
QVariantMap parseTexturesToMap(QString textures);
|
QVariantMap parseTexturesToMap(QString textures);
|
||||||
|
|
|
@ -396,6 +396,7 @@ public:
|
||||||
virtual bool setAbsoluteJointTranslationInObjectFrame(int index, const glm::vec3& translation) override { return false; }
|
virtual bool setAbsoluteJointTranslationInObjectFrame(int index, const glm::vec3& translation) override { return false; }
|
||||||
|
|
||||||
virtual int getJointIndex(const QString& name) const { return -1; }
|
virtual int getJointIndex(const QString& name) const { return -1; }
|
||||||
|
virtual QStringList getJointNames() const { return QStringList(); }
|
||||||
|
|
||||||
virtual void loader() {} // called indirectly when urls for geometry are updated
|
virtual void loader() {} // called indirectly when urls for geometry are updated
|
||||||
|
|
||||||
|
|
|
@ -977,6 +977,18 @@ int EntityScriptingInterface::getJointIndex(const QUuid& entityID, const QString
|
||||||
if (!_entityTree) {
|
if (!_entityTree) {
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
EntityItemPointer entity = _entityTree->findEntityByEntityItemID(entityID);
|
int result;
|
||||||
return entity->getJointIndex(name);
|
QMetaObject::invokeMethod(_entityTree.get(), "getJointIndex", Qt::BlockingQueuedConnection,
|
||||||
|
Q_RETURN_ARG(int, result), Q_ARG(QUuid, entityID), Q_ARG(QString, name));
|
||||||
|
return result;
|
||||||
|
}
|
||||||
|
|
||||||
|
QStringList EntityScriptingInterface::getJointNames(const QUuid& entityID) {
|
||||||
|
if (!_entityTree) {
|
||||||
|
return QStringList();
|
||||||
|
}
|
||||||
|
QStringList result;
|
||||||
|
QMetaObject::invokeMethod(_entityTree.get(), "getJointNames", Qt::BlockingQueuedConnection,
|
||||||
|
Q_RETURN_ARG(QStringList, result), Q_ARG(QUuid, entityID));
|
||||||
|
return result;
|
||||||
}
|
}
|
||||||
|
|
|
@ -162,6 +162,7 @@ public slots:
|
||||||
const QVector<glm::vec3>& translations);
|
const QVector<glm::vec3>& translations);
|
||||||
|
|
||||||
Q_INVOKABLE int getJointIndex(const QUuid& entityID, const QString& name);
|
Q_INVOKABLE int getJointIndex(const QUuid& entityID, const QString& name);
|
||||||
|
Q_INVOKABLE QStringList getJointNames(const QUuid& entityID);
|
||||||
|
|
||||||
signals:
|
signals:
|
||||||
void collisionWithEntity(const EntityItemID& idA, const EntityItemID& idB, const Collision& collision);
|
void collisionWithEntity(const EntityItemID& idA, const EntityItemID& idB, const Collision& collision);
|
||||||
|
|
|
@ -1358,7 +1358,6 @@ void EntityTree::trackIncomingEntityLastEdited(quint64 lastEditedTime, int bytes
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
void EntityTree::callLoader(EntityItemID entityID) {
|
void EntityTree::callLoader(EntityItemID entityID) {
|
||||||
// this is used to bounce from the networking thread to the main thread
|
// this is used to bounce from the networking thread to the main thread
|
||||||
EntityItemPointer entity = findEntityByEntityItemID(entityID);
|
EntityItemPointer entity = findEntityByEntityItemID(entityID);
|
||||||
|
@ -1366,3 +1365,21 @@ void EntityTree::callLoader(EntityItemID entityID) {
|
||||||
entity->loader();
|
entity->loader();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
int EntityTree::getJointIndex(const QUuid& entityID, const QString& name) const {
|
||||||
|
EntityTree* nonConstThis = const_cast<EntityTree*>(this);
|
||||||
|
EntityItemPointer entity = nonConstThis->findEntityByEntityItemID(entityID);
|
||||||
|
if (!entity) {
|
||||||
|
return -1;
|
||||||
|
}
|
||||||
|
return entity->getJointIndex(name);
|
||||||
|
}
|
||||||
|
|
||||||
|
QStringList EntityTree::getJointNames(const QUuid& entityID) const {
|
||||||
|
EntityTree* nonConstThis = const_cast<EntityTree*>(this);
|
||||||
|
EntityItemPointer entity = nonConstThis->findEntityByEntityItemID(entityID);
|
||||||
|
if (!entity) {
|
||||||
|
return QStringList();
|
||||||
|
}
|
||||||
|
return entity->getJointNames();
|
||||||
|
}
|
||||||
|
|
|
@ -236,6 +236,10 @@ public:
|
||||||
return _deletedEntityItemIDs.contains(id);
|
return _deletedEntityItemIDs.contains(id);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// these are used to call through to EntityItems
|
||||||
|
Q_INVOKABLE int getJointIndex(const QUuid& entityID, const QString& name) const;
|
||||||
|
Q_INVOKABLE QStringList getJointNames(const QUuid& entityID) const;
|
||||||
|
|
||||||
public slots:
|
public slots:
|
||||||
void callLoader(EntityItemID entityID);
|
void callLoader(EntityItemID entityID);
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue