mirror of
https://github.com/overte-org/overte.git
synced 2025-08-09 12:49:34 +02:00
Merge branch 'master' of https://github.com/highfidelity/hifi into hand-controller-pointer
This commit is contained in:
commit
5bffa14436
54 changed files with 899 additions and 299 deletions
|
@ -15,7 +15,7 @@
|
||||||
viewBox="0 0 1440 200"
|
viewBox="0 0 1440 200"
|
||||||
id="svg4136"
|
id="svg4136"
|
||||||
inkscape:version="0.91 r13725"
|
inkscape:version="0.91 r13725"
|
||||||
sodipodi:docname="address-bar.002.svg">
|
sodipodi:docname="address-bar.svg">
|
||||||
<metadata
|
<metadata
|
||||||
id="metadata4144">
|
id="metadata4144">
|
||||||
<rdf:RDF>
|
<rdf:RDF>
|
||||||
|
@ -39,16 +39,16 @@
|
||||||
guidetolerance="10"
|
guidetolerance="10"
|
||||||
inkscape:pageopacity="0"
|
inkscape:pageopacity="0"
|
||||||
inkscape:pageshadow="2"
|
inkscape:pageshadow="2"
|
||||||
inkscape:window-width="1835"
|
inkscape:window-width="1536"
|
||||||
inkscape:window-height="1057"
|
inkscape:window-height="687"
|
||||||
id="namedview4140"
|
id="namedview4140"
|
||||||
showgrid="false"
|
showgrid="false"
|
||||||
inkscape:zoom="0.61319416"
|
inkscape:zoom="0.61319416"
|
||||||
inkscape:cx="132.58366"
|
inkscape:cx="670.06567"
|
||||||
inkscape:cy="52.468468"
|
inkscape:cy="52.468468"
|
||||||
inkscape:window-x="77"
|
inkscape:window-x="105"
|
||||||
inkscape:window-y="-8"
|
inkscape:window-y="0"
|
||||||
inkscape:window-maximized="1"
|
inkscape:window-maximized="0"
|
||||||
inkscape:current-layer="svg4136" />
|
inkscape:current-layer="svg4136" />
|
||||||
<rect
|
<rect
|
||||||
style="fill:#ededed;fill-opacity:1;stroke:none;stroke-linejoin:round;stroke-opacity:1"
|
style="fill:#ededed;fill-opacity:1;stroke:none;stroke-linejoin:round;stroke-opacity:1"
|
||||||
|
@ -60,14 +60,14 @@
|
||||||
rx="16.025024"
|
rx="16.025024"
|
||||||
ry="17.019567" />
|
ry="17.019567" />
|
||||||
<rect
|
<rect
|
||||||
style="fill:#dadada;fill-opacity:1;stroke:#cbcbcb;stroke-width:0.33821851;stroke-linecap:square;stroke-linejoin:miter;stroke-miterlimit:10;stroke-dasharray:none;stroke-opacity:1"
|
style="fill:#dadada;fill-opacity:1;stroke:#cbcbcb;stroke-width:0.35830048;stroke-linecap:square;stroke-linejoin:miter;stroke-miterlimit:10;stroke-dasharray:none;stroke-opacity:1"
|
||||||
id="rect4135"
|
id="rect4135"
|
||||||
width="292.86267"
|
width="328.72031"
|
||||||
height="139.66179"
|
height="139.64169"
|
||||||
x="150.32542"
|
x="150.33546"
|
||||||
y="30.169102"
|
y="30.179144"
|
||||||
rx="16.817432"
|
rx="18.876532"
|
||||||
ry="20.612938" />
|
ry="20.609974" />
|
||||||
<circle
|
<circle
|
||||||
style="fill:#b8b8b8;fill-opacity:1;stroke:none;stroke-opacity:1"
|
style="fill:#b8b8b8;fill-opacity:1;stroke:none;stroke-opacity:1"
|
||||||
id="path4146"
|
id="path4146"
|
||||||
|
@ -78,11 +78,4 @@
|
||||||
d="m 100,36.000005 c -22.1,0 -40,17.9 -40,39.999995 0,30 40,88 40,88 0,0 40,-58 40,-88 0,-22.099995 -17.9,-39.999995 -40,-39.999995 z m 0,22 c 9.9,0 18,8.099995 18,17.999995 0,9.9 -8.1,18 -18,18 -9.9,0 -18,-8.1 -18,-18 0,-9.9 8.1,-17.999995 18,-17.999995 z"
|
d="m 100,36.000005 c -22.1,0 -40,17.9 -40,39.999995 0,30 40,88 40,88 0,0 40,-58 40,-88 0,-22.099995 -17.9,-39.999995 -40,-39.999995 z m 0,22 c 9.9,0 18,8.099995 18,17.999995 0,9.9 -8.1,18 -18,18 -9.9,0 -18,-8.1 -18,-18 0,-9.9 8.1,-17.999995 18,-17.999995 z"
|
||||||
id="path4138"
|
id="path4138"
|
||||||
inkscape:connector-curvature="0" />
|
inkscape:connector-curvature="0" />
|
||||||
<rect
|
|
||||||
style="fill:#bdbdbd;fill-opacity:1;stroke:none;stroke-width:0.30000001;stroke-linecap:square;stroke-linejoin:miter;stroke-miterlimit:10;stroke-dasharray:none;stroke-opacity:1"
|
|
||||||
id="rect4136"
|
|
||||||
width="4"
|
|
||||||
height="100"
|
|
||||||
x="310.12924"
|
|
||||||
y="50" />
|
|
||||||
</svg>
|
</svg>
|
||||||
|
|
Before Width: | Height: | Size: 2.8 KiB After Width: | Height: | Size: 2.5 KiB |
48
interface/resources/images/home-button.svg
Normal file
48
interface/resources/images/home-button.svg
Normal file
|
@ -0,0 +1,48 @@
|
||||||
|
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
|
||||||
|
<!-- Generator: Adobe Illustrator 19.2.0, SVG Export Plug-In . SVG Version: 6.00 Build 0) -->
|
||||||
|
|
||||||
|
<svg
|
||||||
|
xmlns:dc="http://purl.org/dc/elements/1.1/"
|
||||||
|
xmlns:cc="http://creativecommons.org/ns#"
|
||||||
|
xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
|
||||||
|
xmlns:svg="http://www.w3.org/2000/svg"
|
||||||
|
xmlns="http://www.w3.org/2000/svg"
|
||||||
|
xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
|
||||||
|
xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
|
||||||
|
version="1.1"
|
||||||
|
id="Layer_1"
|
||||||
|
x="0px"
|
||||||
|
y="0px"
|
||||||
|
viewBox="0 0 320 280"
|
||||||
|
xml:space="preserve"
|
||||||
|
inkscape:version="0.91 r13725"
|
||||||
|
sodipodi:docname="home-button.svg"
|
||||||
|
width="320"
|
||||||
|
height="280"><metadata
|
||||||
|
id="metadata4143"><rdf:RDF><cc:Work
|
||||||
|
rdf:about=""><dc:format>image/svg+xml</dc:format><dc:type
|
||||||
|
rdf:resource="http://purl.org/dc/dcmitype/StillImage" /><dc:title></dc:title></cc:Work></rdf:RDF></metadata><defs
|
||||||
|
id="defs4141" /><sodipodi:namedview
|
||||||
|
pagecolor="#ffffff"
|
||||||
|
bordercolor="#666666"
|
||||||
|
borderopacity="1"
|
||||||
|
objecttolerance="10"
|
||||||
|
gridtolerance="10"
|
||||||
|
guidetolerance="10"
|
||||||
|
inkscape:pageopacity="0"
|
||||||
|
inkscape:pageshadow="2"
|
||||||
|
inkscape:window-width="1827"
|
||||||
|
inkscape:window-height="1057"
|
||||||
|
id="namedview4139"
|
||||||
|
showgrid="false"
|
||||||
|
inkscape:zoom="1.2263883"
|
||||||
|
inkscape:cx="135.72814"
|
||||||
|
inkscape:cy="175.61874"
|
||||||
|
inkscape:window-x="85"
|
||||||
|
inkscape:window-y="-8"
|
||||||
|
inkscape:window-maximized="1"
|
||||||
|
inkscape:current-layer="Layer_1" /><polyline
|
||||||
|
points="261,116.2 420.4,261.1 361.7,261.1 361.7,394.5 160.4,394.5 160.4,261.1 101.8,261.1 261,116.2 "
|
||||||
|
id="polyline4137"
|
||||||
|
transform="translate(-101.1,-115.35)"
|
||||||
|
style="fill:#535353;fill-opacity:1" /></svg>
|
After Width: | Height: | Size: 1.7 KiB |
|
@ -55,15 +55,35 @@ Window {
|
||||||
property int inputAreaHeight: 56.0 * root.scale // Height of the background's input area
|
property int inputAreaHeight: 56.0 * root.scale // Height of the background's input area
|
||||||
property int inputAreaStep: (height - inputAreaHeight) / 2
|
property int inputAreaStep: (height - inputAreaHeight) / 2
|
||||||
|
|
||||||
|
Image {
|
||||||
|
id: homeButton
|
||||||
|
source: "../images/home-button.svg"
|
||||||
|
width: 29
|
||||||
|
height: 26
|
||||||
|
anchors {
|
||||||
|
left: parent.left
|
||||||
|
leftMargin: parent.height + 2 * hifi.layout.spacing
|
||||||
|
verticalCenter: parent.verticalCenter
|
||||||
|
}
|
||||||
|
|
||||||
|
MouseArea {
|
||||||
|
anchors.fill: parent
|
||||||
|
acceptedButtons: Qt.LeftButton
|
||||||
|
onClicked: {
|
||||||
|
addressBarDialog.loadHome()
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
Image {
|
Image {
|
||||||
id: backArrow
|
id: backArrow
|
||||||
source: addressBarDialog.backEnabled ? "../images/left-arrow.svg" : "../images/left-arrow-disabled.svg"
|
source: addressBarDialog.backEnabled ? "../images/left-arrow.svg" : "../images/left-arrow-disabled.svg"
|
||||||
|
width: 22
|
||||||
|
height: 26
|
||||||
anchors {
|
anchors {
|
||||||
fill: parent
|
left: homeButton.right
|
||||||
leftMargin: parent.height + hifi.layout.spacing + 6
|
leftMargin: 2 * hifi.layout.spacing
|
||||||
rightMargin: parent.height + hifi.layout.spacing * 60
|
verticalCenter: parent.verticalCenter
|
||||||
topMargin: parent.inputAreaStep + parent.inputAreaStep + hifi.layout.spacing
|
|
||||||
bottomMargin: parent.inputAreaStep + parent.inputAreaStep + hifi.layout.spacing
|
|
||||||
}
|
}
|
||||||
|
|
||||||
MouseArea {
|
MouseArea {
|
||||||
|
@ -78,12 +98,12 @@ Window {
|
||||||
Image {
|
Image {
|
||||||
id: forwardArrow
|
id: forwardArrow
|
||||||
source: addressBarDialog.forwardEnabled ? "../images/right-arrow.svg" : "../images/right-arrow-disabled.svg"
|
source: addressBarDialog.forwardEnabled ? "../images/right-arrow.svg" : "../images/right-arrow-disabled.svg"
|
||||||
|
width: 22
|
||||||
|
height: 26
|
||||||
anchors {
|
anchors {
|
||||||
fill: parent
|
left: backArrow.right
|
||||||
leftMargin: parent.height + hifi.layout.spacing * 9
|
leftMargin: 2 * hifi.layout.spacing
|
||||||
rightMargin: parent.height + hifi.layout.spacing * 53
|
verticalCenter: parent.verticalCenter
|
||||||
topMargin: parent.inputAreaStep + parent.inputAreaStep + hifi.layout.spacing
|
|
||||||
bottomMargin: parent.inputAreaStep + parent.inputAreaStep + hifi.layout.spacing
|
|
||||||
}
|
}
|
||||||
|
|
||||||
MouseArea {
|
MouseArea {
|
||||||
|
@ -101,7 +121,7 @@ Window {
|
||||||
focus: true
|
focus: true
|
||||||
anchors {
|
anchors {
|
||||||
fill: parent
|
fill: parent
|
||||||
leftMargin: parent.height + parent.height + hifi.layout.spacing * 5
|
leftMargin: parent.height + parent.height + hifi.layout.spacing * 7
|
||||||
rightMargin: hifi.layout.spacing * 2
|
rightMargin: hifi.layout.spacing * 2
|
||||||
topMargin: parent.inputAreaStep + hifi.layout.spacing
|
topMargin: parent.inputAreaStep + hifi.layout.spacing
|
||||||
bottomMargin: parent.inputAreaStep + hifi.layout.spacing
|
bottomMargin: parent.inputAreaStep + hifi.layout.spacing
|
||||||
|
|
|
@ -1,8 +1,18 @@
|
||||||
|
//
|
||||||
|
// InfoView.qml
|
||||||
|
//
|
||||||
|
// Created by Bradley Austin Davis on 27 Apr 2015
|
||||||
|
// 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
|
||||||
|
//
|
||||||
|
|
||||||
import QtQuick 2.5
|
import QtQuick 2.5
|
||||||
import Hifi 1.0 as Hifi
|
import Hifi 1.0 as Hifi
|
||||||
|
|
||||||
import "controls"
|
import "controls-uit"
|
||||||
import "windows" as Windows
|
import "windows-uit" as Windows
|
||||||
|
|
||||||
Windows.Window {
|
Windows.Window {
|
||||||
id: root
|
id: root
|
||||||
|
@ -12,8 +22,8 @@ Windows.Window {
|
||||||
|
|
||||||
Hifi.InfoView {
|
Hifi.InfoView {
|
||||||
id: infoView
|
id: infoView
|
||||||
// Fill the client area
|
width: pane.contentWidth
|
||||||
anchors.fill: parent
|
implicitHeight: pane.scrollHeight
|
||||||
|
|
||||||
WebView {
|
WebView {
|
||||||
id: webview
|
id: webview
|
||||||
|
|
|
@ -1,11 +1,21 @@
|
||||||
import QtQuick 2.3
|
//
|
||||||
import QtQuick.Controls 1.2
|
// QmlWebWindow.qml
|
||||||
|
//
|
||||||
|
// Created by Bradley Austin Davis on 17 Dec 2015
|
||||||
|
// 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
|
||||||
|
//
|
||||||
|
|
||||||
|
import QtQuick 2.5
|
||||||
|
import QtQuick.Controls 1.4
|
||||||
import QtWebEngine 1.1
|
import QtWebEngine 1.1
|
||||||
import QtWebChannel 1.0
|
import QtWebChannel 1.0
|
||||||
|
|
||||||
import "windows" as Windows
|
import "windows-uit" as Windows
|
||||||
import "controls" as Controls
|
import "controls-uit" as Controls
|
||||||
import "styles"
|
import "styles-uit"
|
||||||
|
|
||||||
Windows.Window {
|
Windows.Window {
|
||||||
id: root
|
id: root
|
||||||
|
@ -29,6 +39,10 @@ Windows.Window {
|
||||||
// missing signal
|
// missing signal
|
||||||
signal sendToScript(var message);
|
signal sendToScript(var message);
|
||||||
|
|
||||||
|
Item {
|
||||||
|
width: pane.contentWidth
|
||||||
|
implicitHeight: pane.scrollHeight
|
||||||
|
|
||||||
Controls.WebView {
|
Controls.WebView {
|
||||||
id: webview
|
id: webview
|
||||||
url: "about:blank"
|
url: "about:blank"
|
||||||
|
@ -36,4 +50,5 @@ Windows.Window {
|
||||||
focus: true
|
focus: true
|
||||||
webChannel.registeredObjects: [eventBridgeWrapper]
|
webChannel.registeredObjects: [eventBridgeWrapper]
|
||||||
}
|
}
|
||||||
} // dialog
|
}
|
||||||
|
}
|
||||||
|
|
|
@ -15,6 +15,8 @@ WebEngineView {
|
||||||
id: root
|
id: root
|
||||||
property var newUrl;
|
property var newUrl;
|
||||||
|
|
||||||
|
profile.httpUserAgent: "Mozilla/5.0 Chrome (HighFidelityInterface)"
|
||||||
|
|
||||||
Component.onCompleted: {
|
Component.onCompleted: {
|
||||||
console.log("Connecting JS messaging to Hifi Logging")
|
console.log("Connecting JS messaging to Hifi Logging")
|
||||||
// Ensure the JS from the web-engine makes it to our logging
|
// Ensure the JS from the web-engine makes it to our logging
|
||||||
|
|
|
@ -1,10 +1,20 @@
|
||||||
|
//
|
||||||
|
// AvatarBrowser.qml
|
||||||
|
//
|
||||||
|
// Created by Bradley Austin Davis on 30 Aug 2015
|
||||||
|
// 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
|
||||||
|
//
|
||||||
|
|
||||||
import QtQuick 2.5
|
import QtQuick 2.5
|
||||||
import QtQuick.Controls 1.4
|
import QtQuick.Controls 1.4
|
||||||
import QtWebEngine 1.1
|
import QtWebEngine 1.1
|
||||||
|
|
||||||
import "../../windows" as Windows
|
import "../../windows-uit" as Windows
|
||||||
import "../../controls" as Controls
|
import "../../controls-uit" as Controls
|
||||||
import "../../styles"
|
import "../../styles-uit"
|
||||||
|
|
||||||
Windows.Window {
|
Windows.Window {
|
||||||
id: root
|
id: root
|
||||||
|
@ -14,20 +24,14 @@ Windows.Window {
|
||||||
modality: Qt.ApplicationModal
|
modality: Qt.ApplicationModal
|
||||||
|
|
||||||
Item {
|
Item {
|
||||||
anchors.fill: parent
|
width: pane.contentWidth
|
||||||
|
implicitHeight: pane.scrollHeight
|
||||||
|
|
||||||
Controls.WebView {
|
Controls.WebView {
|
||||||
id: webview
|
id: webview
|
||||||
anchors { top: parent.top; left: parent.left; right: parent.right; bottom: closeButton.top; margins: 8 }
|
anchors.fill: parent
|
||||||
url: "https://metaverse.highfidelity.com/marketplace?category=avatars"
|
url: "https://metaverse.highfidelity.com/marketplace?category=avatars"
|
||||||
focus: true
|
focus: true
|
||||||
}
|
}
|
||||||
|
|
||||||
Button {
|
|
||||||
id: closeButton
|
|
||||||
anchors { bottom: parent.bottom; right: parent.right; margins: 8 }
|
|
||||||
text: "Close"
|
|
||||||
onClicked: root.destroy();
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -29,6 +29,10 @@
|
||||||
#include "Bookmarks.h"
|
#include "Bookmarks.h"
|
||||||
#include <QtQuick/QQuickWindow>
|
#include <QtQuick/QQuickWindow>
|
||||||
|
|
||||||
|
|
||||||
|
const QString Bookmarks::HOME_BOOKMARK = "Home";
|
||||||
|
|
||||||
|
|
||||||
Bookmarks::Bookmarks() {
|
Bookmarks::Bookmarks() {
|
||||||
_bookmarksFilename = QStandardPaths::writableLocation(QStandardPaths::DataLocation) + "/" + BOOKMARKS_FILENAME;
|
_bookmarksFilename = QStandardPaths::writableLocation(QStandardPaths::DataLocation) + "/" + BOOKMARKS_FILENAME;
|
||||||
readFromFile();
|
readFromFile();
|
||||||
|
@ -60,6 +64,10 @@ bool Bookmarks::contains(const QString& name) const {
|
||||||
return _bookmarks.contains(name);
|
return _bookmarks.contains(name);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
QString Bookmarks::addressForBookmark(const QString& name) const {
|
||||||
|
return _bookmarks.value(name).toString();
|
||||||
|
}
|
||||||
|
|
||||||
void Bookmarks::readFromFile() {
|
void Bookmarks::readFromFile() {
|
||||||
QFile loadFile(_bookmarksFilename);
|
QFile loadFile(_bookmarksFilename);
|
||||||
|
|
||||||
|
@ -95,6 +103,8 @@ void Bookmarks::setupMenus(Menu* menubar, MenuWrapper* menu) {
|
||||||
// Add menus/actions
|
// Add menus/actions
|
||||||
auto bookmarkAction = menubar->addActionToQMenuAndActionHash(menu, MenuOption::BookmarkLocation);
|
auto bookmarkAction = menubar->addActionToQMenuAndActionHash(menu, MenuOption::BookmarkLocation);
|
||||||
QObject::connect(bookmarkAction, SIGNAL(triggered()), this, SLOT(bookmarkLocation()), Qt::QueuedConnection);
|
QObject::connect(bookmarkAction, SIGNAL(triggered()), this, SLOT(bookmarkLocation()), Qt::QueuedConnection);
|
||||||
|
auto setHomeAction = menubar->addActionToQMenuAndActionHash(menu, MenuOption::SetHomeLocation);
|
||||||
|
QObject::connect(setHomeAction, SIGNAL(triggered()), this, SLOT(setHomeLocation()), Qt::QueuedConnection);
|
||||||
_bookmarksMenu = menu->addMenu(MenuOption::Bookmarks);
|
_bookmarksMenu = menu->addMenu(MenuOption::Bookmarks);
|
||||||
_deleteBookmarksAction = menubar->addActionToQMenuAndActionHash(menu, MenuOption::DeleteBookmark);
|
_deleteBookmarksAction = menubar->addActionToQMenuAndActionHash(menu, MenuOption::DeleteBookmark);
|
||||||
QObject::connect(_deleteBookmarksAction, SIGNAL(triggered()), this, SLOT(deleteBookmark()), Qt::QueuedConnection);
|
QObject::connect(_deleteBookmarksAction, SIGNAL(triggered()), this, SLOT(deleteBookmark()), Qt::QueuedConnection);
|
||||||
|
@ -146,6 +156,18 @@ void Bookmarks::bookmarkLocation() {
|
||||||
enableMenuItems(true);
|
enableMenuItems(true);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void Bookmarks::setHomeLocation() {
|
||||||
|
Menu* menubar = Menu::getInstance();
|
||||||
|
QString bookmarkName = HOME_BOOKMARK;
|
||||||
|
auto addressManager = DependencyManager::get<AddressManager>();
|
||||||
|
QString bookmarkAddress = addressManager->currentAddress().toString();
|
||||||
|
|
||||||
|
addLocationToMenu(menubar, bookmarkName, bookmarkAddress);
|
||||||
|
insert(bookmarkName, bookmarkAddress); // Overwrites any item with the same bookmarkName.
|
||||||
|
|
||||||
|
enableMenuItems(true);
|
||||||
|
}
|
||||||
|
|
||||||
void Bookmarks::teleportToBookmark() {
|
void Bookmarks::teleportToBookmark() {
|
||||||
QAction* action = qobject_cast<QAction*>(sender());
|
QAction* action = qobject_cast<QAction*>(sender());
|
||||||
QString address = action->data().toString();
|
QString address = action->data().toString();
|
||||||
|
|
|
@ -29,8 +29,13 @@ public:
|
||||||
|
|
||||||
void setupMenus(Menu* menubar, MenuWrapper* menu);
|
void setupMenus(Menu* menubar, MenuWrapper* menu);
|
||||||
|
|
||||||
|
QString addressForBookmark(const QString& name) const;
|
||||||
|
|
||||||
|
static const QString HOME_BOOKMARK;
|
||||||
|
|
||||||
private slots:
|
private slots:
|
||||||
void bookmarkLocation();
|
void bookmarkLocation();
|
||||||
|
void setHomeLocation();
|
||||||
void teleportToBookmark();
|
void teleportToBookmark();
|
||||||
void deleteBookmark();
|
void deleteBookmark();
|
||||||
|
|
||||||
|
|
|
@ -170,6 +170,7 @@ namespace MenuOption {
|
||||||
const QString RunTimingTests = "Run Timing Tests";
|
const QString RunTimingTests = "Run Timing Tests";
|
||||||
const QString ScriptEditor = "Script Editor...";
|
const QString ScriptEditor = "Script Editor...";
|
||||||
const QString ScriptedMotorControl = "Enable Scripted Motor Control";
|
const QString ScriptedMotorControl = "Enable Scripted Motor Control";
|
||||||
|
const QString SetHomeLocation = "Set Home Location";
|
||||||
const QString ShowDSConnectTable = "Show Domain Connection Timing";
|
const QString ShowDSConnectTable = "Show Domain Connection Timing";
|
||||||
const QString ShowBordersEntityNodes = "Show Entity Nodes";
|
const QString ShowBordersEntityNodes = "Show Entity Nodes";
|
||||||
const QString ShowRealtimeEntityStats = "Show Realtime Entity Stats";
|
const QString ShowRealtimeEntityStats = "Show Realtime Entity Stats";
|
||||||
|
|
|
@ -78,11 +78,11 @@ private:
|
||||||
void simulateAvatarFades(float deltaTime);
|
void simulateAvatarFades(float deltaTime);
|
||||||
|
|
||||||
// virtual overrides
|
// virtual overrides
|
||||||
virtual AvatarSharedPointer newSharedAvatar();
|
virtual AvatarSharedPointer newSharedAvatar() override;
|
||||||
virtual AvatarSharedPointer addAvatar(const QUuid& sessionUUID, const QWeakPointer<Node>& mixerWeakPointer);
|
virtual AvatarSharedPointer addAvatar(const QUuid& sessionUUID, const QWeakPointer<Node>& mixerWeakPointer) override;
|
||||||
|
|
||||||
virtual void removeAvatar(const QUuid& sessionUUID);
|
virtual void removeAvatar(const QUuid& sessionUUID) override;
|
||||||
virtual void handleRemovedAvatar(const AvatarSharedPointer& removedAvatar);
|
virtual void handleRemovedAvatar(const AvatarSharedPointer& removedAvatar) override;
|
||||||
|
|
||||||
QVector<AvatarSharedPointer> _avatarFades;
|
QVector<AvatarSharedPointer> _avatarFades;
|
||||||
std::shared_ptr<MyAvatar> _myAvatar;
|
std::shared_ptr<MyAvatar> _myAvatar;
|
||||||
|
|
|
@ -85,12 +85,23 @@ Rig::CharacterControllerState convertCharacterControllerState(CharacterControlle
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
// Called within Model::simulate call, below.
|
// Called within Model::simulate call, below.
|
||||||
void SkeletonModel::updateRig(float deltaTime, glm::mat4 parentTransform) {
|
void SkeletonModel::updateRig(float deltaTime, glm::mat4 parentTransform) {
|
||||||
const FBXGeometry& geometry = getFBXGeometry();
|
const FBXGeometry& geometry = getFBXGeometry();
|
||||||
|
|
||||||
Head* head = _owningAvatar->getHead();
|
Head* head = _owningAvatar->getHead();
|
||||||
|
|
||||||
|
|
||||||
|
// make sure lookAt is not too close to face (avoid crosseyes)
|
||||||
|
glm::vec3 lookAt = _owningAvatar->isMyAvatar() ? head->getLookAtPosition() : head->getCorrectedLookAtPosition();
|
||||||
|
glm::vec3 focusOffset = lookAt - _owningAvatar->getHead()->getEyePosition();
|
||||||
|
float focusDistance = glm::length(focusOffset);
|
||||||
|
const float MIN_LOOK_AT_FOCUS_DISTANCE = 1.0f;
|
||||||
|
if (focusDistance < MIN_LOOK_AT_FOCUS_DISTANCE && focusDistance > EPSILON) {
|
||||||
|
lookAt = _owningAvatar->getHead()->getEyePosition() + (MIN_LOOK_AT_FOCUS_DISTANCE / focusDistance) * focusOffset;
|
||||||
|
}
|
||||||
|
|
||||||
if (_owningAvatar->isMyAvatar()) {
|
if (_owningAvatar->isMyAvatar()) {
|
||||||
MyAvatar* myAvatar = static_cast<MyAvatar*>(_owningAvatar);
|
MyAvatar* myAvatar = static_cast<MyAvatar*>(_owningAvatar);
|
||||||
|
|
||||||
|
@ -164,7 +175,7 @@ void SkeletonModel::updateRig(float deltaTime, glm::mat4 parentTransform) {
|
||||||
|
|
||||||
Rig::EyeParameters eyeParams;
|
Rig::EyeParameters eyeParams;
|
||||||
eyeParams.worldHeadOrientation = headParams.worldHeadOrientation;
|
eyeParams.worldHeadOrientation = headParams.worldHeadOrientation;
|
||||||
eyeParams.eyeLookAt = head->getLookAtPosition();
|
eyeParams.eyeLookAt = lookAt;
|
||||||
eyeParams.eyeSaccade = head->getSaccade();
|
eyeParams.eyeSaccade = head->getSaccade();
|
||||||
eyeParams.modelRotation = getRotation();
|
eyeParams.modelRotation = getRotation();
|
||||||
eyeParams.modelTranslation = getTranslation();
|
eyeParams.modelTranslation = getTranslation();
|
||||||
|
@ -196,8 +207,8 @@ void SkeletonModel::updateRig(float deltaTime, glm::mat4 parentTransform) {
|
||||||
|
|
||||||
Rig::EyeParameters eyeParams;
|
Rig::EyeParameters eyeParams;
|
||||||
eyeParams.worldHeadOrientation = head->getFinalOrientationInWorldFrame();
|
eyeParams.worldHeadOrientation = head->getFinalOrientationInWorldFrame();
|
||||||
eyeParams.eyeLookAt = head->getCorrectedLookAtPosition();
|
eyeParams.eyeLookAt = lookAt;
|
||||||
eyeParams.eyeSaccade = glm::vec3();
|
eyeParams.eyeSaccade = glm::vec3(0.0f);
|
||||||
eyeParams.modelRotation = getRotation();
|
eyeParams.modelRotation = getRotation();
|
||||||
eyeParams.modelTranslation = getTranslation();
|
eyeParams.modelTranslation = getTranslation();
|
||||||
eyeParams.leftEyeJointIndex = geometry.leftEyeJointIndex;
|
eyeParams.leftEyeJointIndex = geometry.leftEyeJointIndex;
|
||||||
|
|
|
@ -10,6 +10,7 @@
|
||||||
//
|
//
|
||||||
|
|
||||||
#include "AddressBarDialog.h"
|
#include "AddressBarDialog.h"
|
||||||
|
#include "Application.h"
|
||||||
|
|
||||||
#include <QMessageBox>
|
#include <QMessageBox>
|
||||||
|
|
||||||
|
@ -50,6 +51,16 @@ void AddressBarDialog::loadAddress(const QString& address) {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void AddressBarDialog::loadHome() {
|
||||||
|
qDebug() << "Called LoadHome";
|
||||||
|
QString homeLocation = qApp->getBookmarks()->addressForBookmark(Bookmarks::HOME_BOOKMARK);
|
||||||
|
const QString DEFAULT_HOME_LOCATION = "localhost";
|
||||||
|
if (homeLocation == "") {
|
||||||
|
homeLocation = DEFAULT_HOME_LOCATION;
|
||||||
|
}
|
||||||
|
DependencyManager::get<AddressManager>()->handleLookupString(homeLocation);
|
||||||
|
}
|
||||||
|
|
||||||
void AddressBarDialog::loadBack() {
|
void AddressBarDialog::loadBack() {
|
||||||
qDebug() << "Called LoadBack";
|
qDebug() << "Called LoadBack";
|
||||||
DependencyManager::get<AddressManager>()->goBack();
|
DependencyManager::get<AddressManager>()->goBack();
|
||||||
|
|
|
@ -36,6 +36,7 @@ protected:
|
||||||
void hide();
|
void hide();
|
||||||
|
|
||||||
Q_INVOKABLE void loadAddress(const QString& address);
|
Q_INVOKABLE void loadAddress(const QString& address);
|
||||||
|
Q_INVOKABLE void loadHome();
|
||||||
Q_INVOKABLE void loadBack();
|
Q_INVOKABLE void loadBack();
|
||||||
Q_INVOKABLE void loadForward();
|
Q_INVOKABLE void loadForward();
|
||||||
|
|
||||||
|
|
|
@ -23,7 +23,7 @@ public:
|
||||||
Base3DOverlay(const Base3DOverlay* base3DOverlay);
|
Base3DOverlay(const Base3DOverlay* base3DOverlay);
|
||||||
|
|
||||||
// getters
|
// getters
|
||||||
virtual bool is3D() const { return true; }
|
virtual bool is3D() const override { return true; }
|
||||||
const glm::vec3& getPosition() const { return _transform.getTranslation(); }
|
const glm::vec3& getPosition() const { return _transform.getTranslation(); }
|
||||||
const glm::quat& getRotation() const { return _transform.getRotation(); }
|
const glm::quat& getRotation() const { return _transform.getRotation(); }
|
||||||
const glm::vec3& getScale() const { return _transform.getScale(); }
|
const glm::vec3& getScale() const { return _transform.getScale(); }
|
||||||
|
@ -50,7 +50,7 @@ public:
|
||||||
void setIgnoreRayIntersection(bool value) { _ignoreRayIntersection = value; }
|
void setIgnoreRayIntersection(bool value) { _ignoreRayIntersection = value; }
|
||||||
void setDrawInFront(bool value) { _drawInFront = value; }
|
void setDrawInFront(bool value) { _drawInFront = value; }
|
||||||
|
|
||||||
virtual AABox getBounds() const = 0;
|
virtual AABox getBounds() const override = 0;
|
||||||
|
|
||||||
void setProperties(const QVariantMap& properties) override;
|
void setProperties(const QVariantMap& properties) override;
|
||||||
QVariant getProperty(const QString& property) override;
|
QVariant getProperty(const QString& property) override;
|
||||||
|
|
|
@ -27,7 +27,7 @@ public:
|
||||||
QVariant getProperty(const QString& property) override;
|
QVariant getProperty(const QString& property) override;
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
virtual void applyTransformTo(Transform& transform, bool force = false);
|
virtual void applyTransformTo(Transform& transform, bool force = false) override;
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif // hifi_Billboard3DOverlay_h
|
#endif // hifi_Billboard3DOverlay_h
|
||||||
|
|
|
@ -19,12 +19,12 @@ class Circle3DOverlay : public Planar3DOverlay {
|
||||||
|
|
||||||
public:
|
public:
|
||||||
static QString const TYPE;
|
static QString const TYPE;
|
||||||
virtual QString getType() const { return TYPE; }
|
virtual QString getType() const override { return TYPE; }
|
||||||
|
|
||||||
Circle3DOverlay();
|
Circle3DOverlay();
|
||||||
Circle3DOverlay(const Circle3DOverlay* circle3DOverlay);
|
Circle3DOverlay(const Circle3DOverlay* circle3DOverlay);
|
||||||
|
|
||||||
virtual void render(RenderArgs* args);
|
virtual void render(RenderArgs* args) override;
|
||||||
virtual const render::ShapeKey getShapeKey() override;
|
virtual const render::ShapeKey getShapeKey() override;
|
||||||
void setProperties(const QVariantMap& properties) override;
|
void setProperties(const QVariantMap& properties) override;
|
||||||
QVariant getProperty(const QString& property) override;
|
QVariant getProperty(const QString& property) override;
|
||||||
|
@ -54,9 +54,9 @@ public:
|
||||||
void setMinorTickMarksColor(const xColor& value) { _minorTickMarksColor = value; }
|
void setMinorTickMarksColor(const xColor& value) { _minorTickMarksColor = value; }
|
||||||
|
|
||||||
virtual bool findRayIntersection(const glm::vec3& origin, const glm::vec3& direction, float& distance,
|
virtual bool findRayIntersection(const glm::vec3& origin, const glm::vec3& direction, float& distance,
|
||||||
BoxFace& face, glm::vec3& surfaceNormal);
|
BoxFace& face, glm::vec3& surfaceNormal) override;
|
||||||
|
|
||||||
virtual Circle3DOverlay* createClone() const;
|
virtual Circle3DOverlay* createClone() const override;
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
float _startAt;
|
float _startAt;
|
||||||
|
|
|
@ -18,15 +18,15 @@ class Cube3DOverlay : public Volume3DOverlay {
|
||||||
|
|
||||||
public:
|
public:
|
||||||
static QString const TYPE;
|
static QString const TYPE;
|
||||||
virtual QString getType() const { return TYPE; }
|
virtual QString getType() const override { return TYPE; }
|
||||||
|
|
||||||
Cube3DOverlay() {}
|
Cube3DOverlay() {}
|
||||||
Cube3DOverlay(const Cube3DOverlay* cube3DOverlay);
|
Cube3DOverlay(const Cube3DOverlay* cube3DOverlay);
|
||||||
|
|
||||||
virtual void render(RenderArgs* args);
|
virtual void render(RenderArgs* args) override;
|
||||||
virtual const render::ShapeKey getShapeKey() override;
|
virtual const render::ShapeKey getShapeKey() override;
|
||||||
|
|
||||||
virtual Cube3DOverlay* createClone() const;
|
virtual Cube3DOverlay* createClone() const override;
|
||||||
|
|
||||||
float getBorderSize() const { return _borderSize; }
|
float getBorderSize() const { return _borderSize; }
|
||||||
|
|
||||||
|
|
|
@ -19,22 +19,22 @@ class Grid3DOverlay : public Planar3DOverlay {
|
||||||
|
|
||||||
public:
|
public:
|
||||||
static QString const TYPE;
|
static QString const TYPE;
|
||||||
virtual QString getType() const { return TYPE; }
|
virtual QString getType() const override { return TYPE; }
|
||||||
|
|
||||||
Grid3DOverlay();
|
Grid3DOverlay();
|
||||||
Grid3DOverlay(const Grid3DOverlay* grid3DOverlay);
|
Grid3DOverlay(const Grid3DOverlay* grid3DOverlay);
|
||||||
|
|
||||||
virtual AABox getBounds() const;
|
virtual AABox getBounds() const override;
|
||||||
|
|
||||||
virtual void render(RenderArgs* args);
|
virtual void render(RenderArgs* args) override;
|
||||||
virtual const render::ShapeKey getShapeKey() override;
|
virtual const render::ShapeKey getShapeKey() override;
|
||||||
void setProperties(const QVariantMap& properties) override;
|
void setProperties(const QVariantMap& properties) override;
|
||||||
QVariant getProperty(const QString& property) override;
|
QVariant getProperty(const QString& property) override;
|
||||||
|
|
||||||
virtual Grid3DOverlay* createClone() const;
|
virtual Grid3DOverlay* createClone() const override;
|
||||||
|
|
||||||
// Grids are UI tools, and may not be intersected (pickable)
|
// Grids are UI tools, and may not be intersected (pickable)
|
||||||
virtual bool findRayIntersection(const glm::vec3&, const glm::vec3&, float&, BoxFace&, glm::vec3&) { return false; }
|
virtual bool findRayIntersection(const glm::vec3&, const glm::vec3&, float&, BoxFace&, glm::vec3&) override { return false; }
|
||||||
|
|
||||||
private:
|
private:
|
||||||
void updateGrid();
|
void updateGrid();
|
||||||
|
|
|
@ -22,14 +22,14 @@ class Image3DOverlay : public Billboard3DOverlay {
|
||||||
|
|
||||||
public:
|
public:
|
||||||
static QString const TYPE;
|
static QString const TYPE;
|
||||||
virtual QString getType() const { return TYPE; }
|
virtual QString getType() const override { return TYPE; }
|
||||||
|
|
||||||
Image3DOverlay();
|
Image3DOverlay();
|
||||||
Image3DOverlay(const Image3DOverlay* image3DOverlay);
|
Image3DOverlay(const Image3DOverlay* image3DOverlay);
|
||||||
|
|
||||||
virtual void render(RenderArgs* args);
|
virtual void render(RenderArgs* args) override;
|
||||||
|
|
||||||
virtual void update(float deltatime);
|
virtual void update(float deltatime) override;
|
||||||
|
|
||||||
virtual const render::ShapeKey getShapeKey() override;
|
virtual const render::ShapeKey getShapeKey() override;
|
||||||
|
|
||||||
|
@ -41,9 +41,9 @@ public:
|
||||||
QVariant getProperty(const QString& property) override;
|
QVariant getProperty(const QString& property) override;
|
||||||
|
|
||||||
virtual bool findRayIntersection(const glm::vec3& origin, const glm::vec3& direction, float& distance,
|
virtual bool findRayIntersection(const glm::vec3& origin, const glm::vec3& direction, float& distance,
|
||||||
BoxFace& face, glm::vec3& surfaceNormal);
|
BoxFace& face, glm::vec3& surfaceNormal) override;
|
||||||
|
|
||||||
virtual Image3DOverlay* createClone() const;
|
virtual Image3DOverlay* createClone() const override;
|
||||||
|
|
||||||
private:
|
private:
|
||||||
QString _url;
|
QString _url;
|
||||||
|
|
|
@ -18,14 +18,14 @@ class Line3DOverlay : public Base3DOverlay {
|
||||||
|
|
||||||
public:
|
public:
|
||||||
static QString const TYPE;
|
static QString const TYPE;
|
||||||
virtual QString getType() const { return TYPE; }
|
virtual QString getType() const override { return TYPE; }
|
||||||
|
|
||||||
Line3DOverlay();
|
Line3DOverlay();
|
||||||
Line3DOverlay(const Line3DOverlay* line3DOverlay);
|
Line3DOverlay(const Line3DOverlay* line3DOverlay);
|
||||||
~Line3DOverlay();
|
~Line3DOverlay();
|
||||||
virtual void render(RenderArgs* args);
|
virtual void render(RenderArgs* args) override;
|
||||||
virtual const render::ShapeKey getShapeKey() override;
|
virtual const render::ShapeKey getShapeKey() override;
|
||||||
virtual AABox getBounds() const;
|
virtual AABox getBounds() const override;
|
||||||
|
|
||||||
// getters
|
// getters
|
||||||
const glm::vec3& getStart() const { return _start; }
|
const glm::vec3& getStart() const { return _start; }
|
||||||
|
@ -38,7 +38,7 @@ public:
|
||||||
void setProperties(const QVariantMap& properties) override;
|
void setProperties(const QVariantMap& properties) override;
|
||||||
QVariant getProperty(const QString& property) override;
|
QVariant getProperty(const QString& property) override;
|
||||||
|
|
||||||
virtual Line3DOverlay* createClone() const;
|
virtual Line3DOverlay* createClone() const override;
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
glm::vec3 _start;
|
glm::vec3 _start;
|
||||||
|
|
|
@ -20,24 +20,24 @@ class ModelOverlay : public Volume3DOverlay {
|
||||||
Q_OBJECT
|
Q_OBJECT
|
||||||
public:
|
public:
|
||||||
static QString const TYPE;
|
static QString const TYPE;
|
||||||
virtual QString getType() const { return TYPE; }
|
virtual QString getType() const override { return TYPE; }
|
||||||
|
|
||||||
ModelOverlay();
|
ModelOverlay();
|
||||||
ModelOverlay(const ModelOverlay* modelOverlay);
|
ModelOverlay(const ModelOverlay* modelOverlay);
|
||||||
|
|
||||||
virtual void update(float deltatime);
|
virtual void update(float deltatime) override;
|
||||||
virtual void render(RenderArgs* args);
|
virtual void render(RenderArgs* args) override;
|
||||||
void setProperties(const QVariantMap& properties) override;
|
void setProperties(const QVariantMap& properties) override;
|
||||||
QVariant getProperty(const QString& property) override;
|
QVariant getProperty(const QString& property) override;
|
||||||
virtual bool findRayIntersection(const glm::vec3& origin, const glm::vec3& direction, float& distance,
|
virtual bool findRayIntersection(const glm::vec3& origin, const glm::vec3& direction, float& distance,
|
||||||
BoxFace& face, glm::vec3& surfaceNormal);
|
BoxFace& face, glm::vec3& surfaceNormal) override;
|
||||||
virtual bool findRayIntersectionExtraInfo(const glm::vec3& origin, const glm::vec3& direction,
|
virtual bool findRayIntersectionExtraInfo(const glm::vec3& origin, const glm::vec3& direction,
|
||||||
float& distance, BoxFace& face, glm::vec3& surfaceNormal, QString& extraInfo);
|
float& distance, BoxFace& face, glm::vec3& surfaceNormal, QString& extraInfo) override;
|
||||||
|
|
||||||
virtual ModelOverlay* createClone() const;
|
virtual ModelOverlay* createClone() const override;
|
||||||
|
|
||||||
virtual bool addToScene(Overlay::Pointer overlay, std::shared_ptr<render::Scene> scene, render::PendingChanges& pendingChanges);
|
virtual bool addToScene(Overlay::Pointer overlay, std::shared_ptr<render::Scene> scene, render::PendingChanges& pendingChanges) override;
|
||||||
virtual void removeFromScene(Overlay::Pointer overlay, std::shared_ptr<render::Scene> scene, render::PendingChanges& pendingChanges);
|
virtual void removeFromScene(Overlay::Pointer overlay, std::shared_ptr<render::Scene> scene, render::PendingChanges& pendingChanges) override;
|
||||||
|
|
||||||
private:
|
private:
|
||||||
|
|
||||||
|
|
|
@ -22,9 +22,9 @@ public:
|
||||||
Overlay2D() {}
|
Overlay2D() {}
|
||||||
Overlay2D(const Overlay2D* overlay2D);
|
Overlay2D(const Overlay2D* overlay2D);
|
||||||
|
|
||||||
virtual AABox getBounds() const;
|
virtual AABox getBounds() const override;
|
||||||
|
|
||||||
virtual bool is3D() const { return false; }
|
virtual bool is3D() const override { return false; }
|
||||||
|
|
||||||
// getters
|
// getters
|
||||||
int getX() const { return _bounds.x(); }
|
int getX() const { return _bounds.x(); }
|
||||||
|
|
|
@ -20,7 +20,7 @@ public:
|
||||||
Planar3DOverlay();
|
Planar3DOverlay();
|
||||||
Planar3DOverlay(const Planar3DOverlay* planar3DOverlay);
|
Planar3DOverlay(const Planar3DOverlay* planar3DOverlay);
|
||||||
|
|
||||||
virtual AABox getBounds() const;
|
virtual AABox getBounds() const override;
|
||||||
|
|
||||||
glm::vec2 getDimensions() const { return _dimensions; }
|
glm::vec2 getDimensions() const { return _dimensions; }
|
||||||
void setDimensions(float value) { _dimensions = glm::vec2(value); }
|
void setDimensions(float value) { _dimensions = glm::vec2(value); }
|
||||||
|
@ -30,7 +30,7 @@ public:
|
||||||
QVariant getProperty(const QString& property) override;
|
QVariant getProperty(const QString& property) override;
|
||||||
|
|
||||||
virtual bool findRayIntersection(const glm::vec3& origin, const glm::vec3& direction, float& distance,
|
virtual bool findRayIntersection(const glm::vec3& origin, const glm::vec3& direction, float& distance,
|
||||||
BoxFace& face, glm::vec3& surfaceNormal);
|
BoxFace& face, glm::vec3& surfaceNormal) override;
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
glm::vec2 _dimensions;
|
glm::vec2 _dimensions;
|
||||||
|
|
|
@ -18,16 +18,16 @@ class Rectangle3DOverlay : public Planar3DOverlay {
|
||||||
|
|
||||||
public:
|
public:
|
||||||
static QString const TYPE;
|
static QString const TYPE;
|
||||||
virtual QString getType() const { return TYPE; }
|
virtual QString getType() const override { return TYPE; }
|
||||||
|
|
||||||
Rectangle3DOverlay();
|
Rectangle3DOverlay();
|
||||||
Rectangle3DOverlay(const Rectangle3DOverlay* rectangle3DOverlay);
|
Rectangle3DOverlay(const Rectangle3DOverlay* rectangle3DOverlay);
|
||||||
~Rectangle3DOverlay();
|
~Rectangle3DOverlay();
|
||||||
virtual void render(RenderArgs* args);
|
virtual void render(RenderArgs* args) override;
|
||||||
virtual const render::ShapeKey getShapeKey() override;
|
virtual const render::ShapeKey getShapeKey() override;
|
||||||
void setProperties(const QVariantMap& properties) override;
|
void setProperties(const QVariantMap& properties) override;
|
||||||
|
|
||||||
virtual Rectangle3DOverlay* createClone() const;
|
virtual Rectangle3DOverlay* createClone() const override;
|
||||||
private:
|
private:
|
||||||
int _geometryCacheID;
|
int _geometryCacheID;
|
||||||
glm::vec2 _previousHalfDimensions;
|
glm::vec2 _previousHalfDimensions;
|
||||||
|
|
|
@ -18,15 +18,15 @@ class Sphere3DOverlay : public Volume3DOverlay {
|
||||||
|
|
||||||
public:
|
public:
|
||||||
static QString const TYPE;
|
static QString const TYPE;
|
||||||
virtual QString getType() const { return TYPE; }
|
virtual QString getType() const override { return TYPE; }
|
||||||
|
|
||||||
Sphere3DOverlay() {}
|
Sphere3DOverlay() {}
|
||||||
Sphere3DOverlay(const Sphere3DOverlay* Sphere3DOverlay);
|
Sphere3DOverlay(const Sphere3DOverlay* Sphere3DOverlay);
|
||||||
|
|
||||||
virtual void render(RenderArgs* args);
|
virtual void render(RenderArgs* args) override;
|
||||||
virtual const render::ShapeKey getShapeKey() override;
|
virtual const render::ShapeKey getShapeKey() override;
|
||||||
|
|
||||||
virtual Sphere3DOverlay* createClone() const;
|
virtual Sphere3DOverlay* createClone() const override;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -22,14 +22,14 @@ class Text3DOverlay : public Billboard3DOverlay {
|
||||||
|
|
||||||
public:
|
public:
|
||||||
static QString const TYPE;
|
static QString const TYPE;
|
||||||
virtual QString getType() const { return TYPE; }
|
virtual QString getType() const override { return TYPE; }
|
||||||
|
|
||||||
Text3DOverlay();
|
Text3DOverlay();
|
||||||
Text3DOverlay(const Text3DOverlay* text3DOverlay);
|
Text3DOverlay(const Text3DOverlay* text3DOverlay);
|
||||||
~Text3DOverlay();
|
~Text3DOverlay();
|
||||||
virtual void render(RenderArgs* args);
|
virtual void render(RenderArgs* args) override;
|
||||||
|
|
||||||
virtual void update(float deltatime);
|
virtual void update(float deltatime) override;
|
||||||
|
|
||||||
virtual const render::ShapeKey getShapeKey() override;
|
virtual const render::ShapeKey getShapeKey() override;
|
||||||
|
|
||||||
|
@ -59,9 +59,9 @@ public:
|
||||||
QSizeF textSize(const QString& test) const; // Meters
|
QSizeF textSize(const QString& test) const; // Meters
|
||||||
|
|
||||||
virtual bool findRayIntersection(const glm::vec3& origin, const glm::vec3& direction, float& distance,
|
virtual bool findRayIntersection(const glm::vec3& origin, const glm::vec3& direction, float& distance,
|
||||||
BoxFace& face, glm::vec3& surfaceNormal);
|
BoxFace& face, glm::vec3& surfaceNormal) override;
|
||||||
|
|
||||||
virtual Text3DOverlay* createClone() const;
|
virtual Text3DOverlay* createClone() const override;
|
||||||
|
|
||||||
private:
|
private:
|
||||||
TextRenderer3D* _textRenderer = nullptr;
|
TextRenderer3D* _textRenderer = nullptr;
|
||||||
|
|
|
@ -20,7 +20,7 @@ public:
|
||||||
Volume3DOverlay() {}
|
Volume3DOverlay() {}
|
||||||
Volume3DOverlay(const Volume3DOverlay* volume3DOverlay);
|
Volume3DOverlay(const Volume3DOverlay* volume3DOverlay);
|
||||||
|
|
||||||
virtual AABox getBounds() const;
|
virtual AABox getBounds() const override;
|
||||||
|
|
||||||
const glm::vec3& getDimensions() const { return _localBoundingBox.getDimensions(); }
|
const glm::vec3& getDimensions() const { return _localBoundingBox.getDimensions(); }
|
||||||
void setDimensions(float value) { _localBoundingBox.setBox(glm::vec3(-value / 2.0f), value); }
|
void setDimensions(float value) { _localBoundingBox.setBox(glm::vec3(-value / 2.0f), value); }
|
||||||
|
@ -30,7 +30,7 @@ public:
|
||||||
QVariant getProperty(const QString& property) override;
|
QVariant getProperty(const QString& property) override;
|
||||||
|
|
||||||
virtual bool findRayIntersection(const glm::vec3& origin, const glm::vec3& direction, float& distance,
|
virtual bool findRayIntersection(const glm::vec3& origin, const glm::vec3& direction, float& distance,
|
||||||
BoxFace& face, glm::vec3& surfaceNormal);
|
BoxFace& face, glm::vec3& surfaceNormal) override;
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
// Centered local bounding box
|
// Centered local bounding box
|
||||||
|
|
|
@ -18,16 +18,16 @@ class Web3DOverlay : public Billboard3DOverlay {
|
||||||
|
|
||||||
public:
|
public:
|
||||||
static QString const TYPE;
|
static QString const TYPE;
|
||||||
virtual QString getType() const { return TYPE; }
|
virtual QString getType() const override { return TYPE; }
|
||||||
|
|
||||||
Web3DOverlay();
|
Web3DOverlay();
|
||||||
Web3DOverlay(const Web3DOverlay* Web3DOverlay);
|
Web3DOverlay(const Web3DOverlay* Web3DOverlay);
|
||||||
virtual ~Web3DOverlay();
|
virtual ~Web3DOverlay();
|
||||||
|
|
||||||
virtual void render(RenderArgs* args);
|
virtual void render(RenderArgs* args) override;
|
||||||
virtual const render::ShapeKey getShapeKey() override;
|
virtual const render::ShapeKey getShapeKey() override;
|
||||||
|
|
||||||
virtual void update(float deltatime);
|
virtual void update(float deltatime) override;
|
||||||
|
|
||||||
// setters
|
// setters
|
||||||
void setURL(const QString& url);
|
void setURL(const QString& url);
|
||||||
|
@ -36,9 +36,9 @@ public:
|
||||||
QVariant getProperty(const QString& property) override;
|
QVariant getProperty(const QString& property) override;
|
||||||
|
|
||||||
virtual bool findRayIntersection(const glm::vec3& origin, const glm::vec3& direction, float& distance,
|
virtual bool findRayIntersection(const glm::vec3& origin, const glm::vec3& direction, float& distance,
|
||||||
BoxFace& face, glm::vec3& surfaceNormal);
|
BoxFace& face, glm::vec3& surfaceNormal) override;
|
||||||
|
|
||||||
virtual Web3DOverlay* createClone() const;
|
virtual Web3DOverlay* createClone() const override;
|
||||||
|
|
||||||
private:
|
private:
|
||||||
OffscreenQmlSurface* _webSurface{ nullptr };
|
OffscreenQmlSurface* _webSurface{ nullptr };
|
||||||
|
|
|
@ -203,8 +203,6 @@ public:
|
||||||
// rig space
|
// rig space
|
||||||
bool getModelRegistrationPoint(glm::vec3& modelRegistrationPointOut) const;
|
bool getModelRegistrationPoint(glm::vec3& modelRegistrationPointOut) const;
|
||||||
|
|
||||||
const glm::vec3& getEyesInRootFrame() const { return _eyesInRootFrame; }
|
|
||||||
|
|
||||||
// rig space
|
// rig space
|
||||||
AnimPose getAbsoluteDefaultPose(int index) const;
|
AnimPose getAbsoluteDefaultPose(int index) const;
|
||||||
|
|
||||||
|
@ -275,7 +273,6 @@ protected:
|
||||||
glm::vec3 _lastFront;
|
glm::vec3 _lastFront;
|
||||||
glm::vec3 _lastPosition;
|
glm::vec3 _lastPosition;
|
||||||
glm::vec3 _lastVelocity;
|
glm::vec3 _lastVelocity;
|
||||||
glm::vec3 _eyesInRootFrame { Vectors::ZERO };
|
|
||||||
|
|
||||||
QUrl _animGraphURL;
|
QUrl _animGraphURL;
|
||||||
std::shared_ptr<AnimNode> _animNode;
|
std::shared_ptr<AnimNode> _animNode;
|
||||||
|
|
|
@ -33,7 +33,7 @@ public:
|
||||||
QObject* getEventHandler();
|
QObject* getEventHandler();
|
||||||
|
|
||||||
void update(const quint64& now) override;
|
void update(const quint64& now) override;
|
||||||
bool needsToCallUpdate() const { return _webSurface != nullptr; }
|
bool needsToCallUpdate() const override { return _webSurface != nullptr; }
|
||||||
|
|
||||||
SIMPLE_RENDERABLE();
|
SIMPLE_RENDERABLE();
|
||||||
|
|
||||||
|
|
|
@ -27,19 +27,19 @@ public:
|
||||||
_needsInitialSimulation(true)
|
_needsInitialSimulation(true)
|
||||||
{ }
|
{ }
|
||||||
|
|
||||||
virtual bool setProperties(const EntityItemProperties& properties);
|
virtual bool setProperties(const EntityItemProperties& properties) override;
|
||||||
virtual void somethingChangedNotification() override;
|
virtual void somethingChangedNotification() override;
|
||||||
|
|
||||||
virtual int readEntitySubclassDataFromBuffer(const unsigned char* data, int bytesLeftToRead,
|
virtual int readEntitySubclassDataFromBuffer(const unsigned char* data, int bytesLeftToRead,
|
||||||
ReadBitstreamToTreeParams& args,
|
ReadBitstreamToTreeParams& args,
|
||||||
EntityPropertyFlags& propertyFlags, bool overwriteLocalData,
|
EntityPropertyFlags& propertyFlags, bool overwriteLocalData,
|
||||||
bool& somethingChanged);
|
bool& somethingChanged) override;
|
||||||
|
|
||||||
virtual void render(RenderArgs* args);
|
virtual void render(RenderArgs* args) override;
|
||||||
virtual bool contains(const glm::vec3& point) const;
|
virtual bool contains(const glm::vec3& point) const override;
|
||||||
|
|
||||||
virtual bool addToScene(EntityItemPointer self, std::shared_ptr<render::Scene> scene, render::PendingChanges& pendingChanges);
|
virtual bool addToScene(EntityItemPointer self, std::shared_ptr<render::Scene> scene, render::PendingChanges& pendingChanges) override;
|
||||||
virtual void removeFromScene(EntityItemPointer self, std::shared_ptr<render::Scene> scene, render::PendingChanges& pendingChanges);
|
virtual void removeFromScene(EntityItemPointer self, std::shared_ptr<render::Scene> scene, render::PendingChanges& pendingChanges) override;
|
||||||
|
|
||||||
private:
|
private:
|
||||||
virtual void locationChanged(bool tellPhysics = true) override { EntityItem::locationChanged(tellPhysics); notifyBoundChanged(); }
|
virtual void locationChanged(bool tellPhysics = true) override { EntityItem::locationChanged(tellPhysics); notifyBoundChanged(); }
|
||||||
|
|
|
@ -361,7 +361,7 @@ public:
|
||||||
void setPhysicsInfo(void* data) { _physicsInfo = data; }
|
void setPhysicsInfo(void* data) { _physicsInfo = data; }
|
||||||
EntityTreeElementPointer getElement() const { return _element; }
|
EntityTreeElementPointer getElement() const { return _element; }
|
||||||
EntityTreePointer getTree() const;
|
EntityTreePointer getTree() const;
|
||||||
virtual SpatialParentTree* getParentTree() const;
|
virtual SpatialParentTree* getParentTree() const override;
|
||||||
bool wantTerseEditLogging() const;
|
bool wantTerseEditLogging() const;
|
||||||
|
|
||||||
glm::mat4 getEntityToWorldMatrix() const;
|
glm::mat4 getEntityToWorldMatrix() const;
|
||||||
|
|
|
@ -127,7 +127,7 @@ public:
|
||||||
EntityItemPointer findClosestEntity(glm::vec3 position, float targetRadius);
|
EntityItemPointer findClosestEntity(glm::vec3 position, float targetRadius);
|
||||||
EntityItemPointer findEntityByID(const QUuid& id);
|
EntityItemPointer findEntityByID(const QUuid& id);
|
||||||
EntityItemPointer findEntityByEntityItemID(const EntityItemID& entityID);
|
EntityItemPointer findEntityByEntityItemID(const EntityItemID& entityID);
|
||||||
virtual SpatiallyNestablePointer findByID(const QUuid& id) { return findEntityByID(id); }
|
virtual SpatiallyNestablePointer findByID(const QUuid& id) override { return findEntityByID(id); }
|
||||||
|
|
||||||
EntityItemID assignEntityID(const EntityItemID& entityItemID); /// Assigns a known ID for a creator token ID
|
EntityItemID assignEntityID(const EntityItemID& entityItemID); /// Assigns a known ID for a creator token ID
|
||||||
|
|
||||||
|
|
|
@ -98,7 +98,7 @@ public:
|
||||||
GeometryResource(const QUrl& url, const QUrl& textureBaseUrl = QUrl()) :
|
GeometryResource(const QUrl& url, const QUrl& textureBaseUrl = QUrl()) :
|
||||||
Resource(url), _textureBaseUrl(textureBaseUrl) {}
|
Resource(url), _textureBaseUrl(textureBaseUrl) {}
|
||||||
|
|
||||||
virtual bool areTexturesLoaded() const { return isLoaded() && Geometry::areTexturesLoaded(); }
|
virtual bool areTexturesLoaded() const override { return isLoaded() && Geometry::areTexturesLoaded(); }
|
||||||
|
|
||||||
virtual void deleter() override;
|
virtual void deleter() override;
|
||||||
|
|
||||||
|
|
|
@ -26,7 +26,7 @@ public:
|
||||||
|
|
||||||
virtual void clear() override;
|
virtual void clear() override;
|
||||||
|
|
||||||
virtual void render(gpu::Batch& batch, const ViewFrustum& frustum) const;
|
virtual void render(gpu::Batch& batch, const ViewFrustum& frustum) const override;
|
||||||
static void render(gpu::Batch& batch, const ViewFrustum& frustum, const ProceduralSkybox& skybox);
|
static void render(gpu::Batch& batch, const ViewFrustum& frustum, const ProceduralSkybox& skybox);
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
|
|
|
@ -105,6 +105,9 @@ void render::renderStateSortShapes(const SceneContextPointer& sceneContext, cons
|
||||||
for (auto& pipelineKey : sortedPipelines) {
|
for (auto& pipelineKey : sortedPipelines) {
|
||||||
auto& bucket = sortedShapes[pipelineKey];
|
auto& bucket = sortedShapes[pipelineKey];
|
||||||
args->_pipeline = shapeContext->pickPipeline(args, pipelineKey);
|
args->_pipeline = shapeContext->pickPipeline(args, pipelineKey);
|
||||||
|
if (!args->_pipeline) {
|
||||||
|
continue;
|
||||||
|
}
|
||||||
for (auto& item : bucket) {
|
for (auto& item : bucket) {
|
||||||
item.render(args);
|
item.render(args);
|
||||||
}
|
}
|
||||||
|
|
|
@ -17,7 +17,7 @@ var toolIconUrl = Script.resolvePath("assets/images/tools/");
|
||||||
|
|
||||||
var DIRECTORY_WINDOW_URL = "https://metaverse.highfidelity.com/directory";
|
var DIRECTORY_WINDOW_URL = "https://metaverse.highfidelity.com/directory";
|
||||||
var directoryWindow = new OverlayWebWindow({
|
var directoryWindow = new OverlayWebWindow({
|
||||||
title: 'directory',
|
title: 'Directory',
|
||||||
source: "about:blank",
|
source: "about:blank",
|
||||||
width: 900,
|
width: 900,
|
||||||
height: 700,
|
height: 700,
|
||||||
|
|
|
@ -6,7 +6,7 @@
|
||||||
//
|
//
|
||||||
|
|
||||||
|
|
||||||
var spriteURL = "https://hifi-content.s3.amazonaws.com/DomainContent/CellScience/Sprites/nucleosomes_sprite.fbx";
|
var spriteURL = "https://hifi-production.s3.amazonaws.com/DomainContent/CellScience/Sprites/nucleosomes_sprite.fbx";
|
||||||
var spriteDimensions = {
|
var spriteDimensions = {
|
||||||
x: 10,
|
x: 10,
|
||||||
y: 10,
|
y: 10,
|
||||||
|
|
|
@ -13,7 +13,7 @@
|
||||||
z: -1
|
z: -1
|
||||||
}
|
}
|
||||||
|
|
||||||
var baseURL = "https://hifi-content.s3.amazonaws.com/DomainContent/CellScience/";
|
var baseURL = "https://hifi-production.s3.amazonaws.com/DomainContent/CellScience/";
|
||||||
|
|
||||||
var self = this;
|
var self = this;
|
||||||
|
|
||||||
|
|
|
@ -0,0 +1,109 @@
|
||||||
|
// Copyright 2016 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
|
||||||
|
//
|
||||||
|
|
||||||
|
(function() {
|
||||||
|
|
||||||
|
var version = 12;
|
||||||
|
|
||||||
|
var baseURL = "https://hifi-production.s3.amazonaws.com/DomainContent/CellScience/";
|
||||||
|
var button;
|
||||||
|
var _this;
|
||||||
|
|
||||||
|
function NavButton() {
|
||||||
|
_this = this;
|
||||||
|
}
|
||||||
|
|
||||||
|
NavButton.prototype = {
|
||||||
|
button: null,
|
||||||
|
buttonImageURL: baseURL + "GUI/GUI_Cells.png?" + version,
|
||||||
|
hasButton: false,
|
||||||
|
entryPoint: {
|
||||||
|
x: 13500,
|
||||||
|
y: 13500,
|
||||||
|
z: 13500
|
||||||
|
},
|
||||||
|
target: {
|
||||||
|
x: 13501,
|
||||||
|
y: 13501,
|
||||||
|
z: 13501
|
||||||
|
},
|
||||||
|
preload: function(entityId) {
|
||||||
|
print('CELL PRELOAD CeLLS 1 ')
|
||||||
|
this.entityId = entityId;
|
||||||
|
this.addButton();
|
||||||
|
Controller.mousePressEvent.connect(this.onClick);
|
||||||
|
print('CELL PRELOAD CeLLS 2 ')
|
||||||
|
},
|
||||||
|
addButton: function() {
|
||||||
|
if (this.hasButton === false) {
|
||||||
|
print('CELL ADDBuTTON CeLLS 1 ')
|
||||||
|
var windowDimensions = Controller.getViewportDimensions();
|
||||||
|
var buttonWidth = 150;
|
||||||
|
var buttonHeight = 50;
|
||||||
|
var buttonPadding = 10;
|
||||||
|
var offset = 0;
|
||||||
|
var buttonPositionX = (offset + 1) * (buttonWidth + buttonPadding) + (windowDimensions.x / 2) - (buttonWidth * 3 + buttonPadding * 2.5);
|
||||||
|
var buttonPositionY = (windowDimensions.y - buttonHeight) - 50;
|
||||||
|
button = Overlays.addOverlay("image", {
|
||||||
|
x: buttonPositionX,
|
||||||
|
y: buttonPositionY,
|
||||||
|
width: buttonWidth,
|
||||||
|
height: buttonHeight,
|
||||||
|
imageURL: this.buttonImageURL,
|
||||||
|
visible: true,
|
||||||
|
alpha: 1.0
|
||||||
|
});
|
||||||
|
this.hasButton = true;
|
||||||
|
print('CELL ADDBuTTON CeLLS 2 button id is : ' +button)
|
||||||
|
} else {
|
||||||
|
print('CELL ADDBUTTON CeLLS FAIL - hasButton is' + this.hasButton)
|
||||||
|
}
|
||||||
|
},
|
||||||
|
onClick: function(event) {
|
||||||
|
//call to an internal function to get our scope back;
|
||||||
|
_this.handleClick(event);
|
||||||
|
},
|
||||||
|
handleClick: function(event) {
|
||||||
|
var clickedOverlay = Overlays.getOverlayAtPoint({
|
||||||
|
x: event.x,
|
||||||
|
y: event.y
|
||||||
|
});
|
||||||
|
|
||||||
|
if (clickedOverlay === button) {
|
||||||
|
this.lookAtTarget();
|
||||||
|
}
|
||||||
|
},
|
||||||
|
lookAtTarget: function() {
|
||||||
|
var direction = Vec3.normalize(Vec3.subtract(this.target, this.entryPoint));
|
||||||
|
var pitch = Quat.angleAxis(Math.asin(-direction.y) * 180.0 / Math.PI, {
|
||||||
|
x: 1,
|
||||||
|
y: 0,
|
||||||
|
z: 0
|
||||||
|
});
|
||||||
|
var yaw = Quat.angleAxis(Math.atan2(direction.x, direction.z) * 180.0 / Math.PI, {
|
||||||
|
x: 0,
|
||||||
|
y: 1,
|
||||||
|
z: 0
|
||||||
|
});
|
||||||
|
|
||||||
|
MyAvatar.goToLocation(this.target, true, yaw);
|
||||||
|
|
||||||
|
MyAvatar.headYaw = 0;
|
||||||
|
},
|
||||||
|
unload: function() {
|
||||||
|
this.hasButton = false;
|
||||||
|
Overlays.deleteOverlay(button);
|
||||||
|
Controller.mousePressEvent.disconnect(this.onClick);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
return new NavButton();
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
});
|
|
@ -0,0 +1,115 @@
|
||||||
|
// Copyright 2016 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
|
||||||
|
//
|
||||||
|
// Copyright 2016 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
|
||||||
|
//
|
||||||
|
|
||||||
|
(function() {
|
||||||
|
|
||||||
|
var version = 12;
|
||||||
|
|
||||||
|
var baseURL = "https://hifi-production.s3.amazonaws.com/DomainContent/CellScience/";
|
||||||
|
var button;
|
||||||
|
var _this;
|
||||||
|
|
||||||
|
function NavButton() {
|
||||||
|
_this = this;
|
||||||
|
}
|
||||||
|
|
||||||
|
NavButton.prototype = {
|
||||||
|
button: null,
|
||||||
|
buttonImageURL: baseURL + "GUI/GUI_Hexokinase.png?" + version,
|
||||||
|
hasButton: false,
|
||||||
|
entryPoint: {
|
||||||
|
x: 3000,
|
||||||
|
y: 3000,
|
||||||
|
z: 13500
|
||||||
|
},
|
||||||
|
target: {
|
||||||
|
x: 2755,
|
||||||
|
y: 3121,
|
||||||
|
z: 13501
|
||||||
|
},
|
||||||
|
preload: function(entityId) {
|
||||||
|
print('CELL PRELOAD HEXOKINASE 1')
|
||||||
|
this.entityId = entityId;
|
||||||
|
this.addButton();
|
||||||
|
Controller.mousePressEvent.connect(this.onClick);
|
||||||
|
print('CELL PRELOAD HEXOKINASE 2')
|
||||||
|
},
|
||||||
|
addButton: function() {
|
||||||
|
if (this.hasButton === false) {
|
||||||
|
print('CELL ADDBUTTON HEXOKINASE 1')
|
||||||
|
var windowDimensions = Controller.getViewportDimensions();
|
||||||
|
var buttonWidth = 150;
|
||||||
|
var buttonHeight = 50;
|
||||||
|
var buttonPadding = 10;
|
||||||
|
var offset = 3;
|
||||||
|
var buttonPositionX = (offset + 1) * (buttonWidth + buttonPadding) + (windowDimensions.x / 2) - (buttonWidth * 3 + buttonPadding * 2.5);
|
||||||
|
var buttonPositionY = (windowDimensions.y - buttonHeight) - 50;
|
||||||
|
button = Overlays.addOverlay("image", {
|
||||||
|
x: buttonPositionX,
|
||||||
|
y: buttonPositionY,
|
||||||
|
width: buttonWidth,
|
||||||
|
height: buttonHeight,
|
||||||
|
imageURL: this.buttonImageURL,
|
||||||
|
visible: true,
|
||||||
|
alpha: 1.0
|
||||||
|
});
|
||||||
|
this.hasButton = true;
|
||||||
|
print('CELL ADDBUTTON HEXOKINASE 2 button id is : ' +button)
|
||||||
|
} else {
|
||||||
|
print('CELL ADDBUTTON HEXOKINASE FAIL hasButton is' + this.hasButton)
|
||||||
|
}
|
||||||
|
},
|
||||||
|
onClick: function(event) {
|
||||||
|
//call to an internal function to get our scope back;
|
||||||
|
_this.handleClick(event);
|
||||||
|
},
|
||||||
|
handleClick: function(event) {
|
||||||
|
var clickedOverlay = Overlays.getOverlayAtPoint({
|
||||||
|
x: event.x,
|
||||||
|
y: event.y
|
||||||
|
});
|
||||||
|
|
||||||
|
if (clickedOverlay === button) {
|
||||||
|
this.lookAtTarget();
|
||||||
|
}
|
||||||
|
},
|
||||||
|
lookAtTarget: function() {
|
||||||
|
var direction = Vec3.normalize(Vec3.subtract(this.target, this.entryPoint));
|
||||||
|
var pitch = Quat.angleAxis(Math.asin(-direction.y) * 180.0 / Math.PI, {
|
||||||
|
x: 1,
|
||||||
|
y: 0,
|
||||||
|
z: 0
|
||||||
|
});
|
||||||
|
var yaw = Quat.angleAxis(Math.atan2(direction.x, direction.z) * 180.0 / Math.PI, {
|
||||||
|
x: 0,
|
||||||
|
y: 1,
|
||||||
|
z: 0
|
||||||
|
});
|
||||||
|
|
||||||
|
MyAvatar.goToLocation(this.target, true, yaw);
|
||||||
|
|
||||||
|
MyAvatar.headYaw = 0;
|
||||||
|
},
|
||||||
|
unload: function() {
|
||||||
|
this.hasButton = false;
|
||||||
|
Overlays.deleteOverlay(button);
|
||||||
|
Controller.mousePressEvent.disconnect(this.onClick);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
return new NavButton();
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
});
|
|
@ -0,0 +1,109 @@
|
||||||
|
// Copyright 2016 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
|
||||||
|
//
|
||||||
|
|
||||||
|
(function() {
|
||||||
|
|
||||||
|
var version = 12;
|
||||||
|
|
||||||
|
var baseURL = "https://hifi-production.s3.amazonaws.com/DomainContent/CellScience/";
|
||||||
|
var button;
|
||||||
|
var _this;
|
||||||
|
|
||||||
|
function NavButton() {
|
||||||
|
_this = this;
|
||||||
|
}
|
||||||
|
|
||||||
|
NavButton.prototype = {
|
||||||
|
button: null,
|
||||||
|
buttonImageURL: baseURL + "GUI/GUI_CellLayout.png?" + version,
|
||||||
|
hasButton: false,
|
||||||
|
entryPoint: {
|
||||||
|
x: 3000,
|
||||||
|
y: 13500,
|
||||||
|
z: 3000
|
||||||
|
},
|
||||||
|
target: {
|
||||||
|
x: 3276.6,
|
||||||
|
y: 13703.3,
|
||||||
|
z: 4405.6
|
||||||
|
},
|
||||||
|
preload: function(entityId) {
|
||||||
|
print('CeLL PRELOAD INSIDECELL 1')
|
||||||
|
this.entityId = entityId;
|
||||||
|
this.addButton();
|
||||||
|
Controller.mousePressEvent.connect(this.onClick);
|
||||||
|
print('CeLL PRELOAD INSIDECELL 2')
|
||||||
|
},
|
||||||
|
addButton: function() {
|
||||||
|
if (this.hasButton === false) {
|
||||||
|
print('CELL ADDBUTTON INSIDECELL 1')
|
||||||
|
var windowDimensions = Controller.getViewportDimensions();
|
||||||
|
var buttonWidth = 150;
|
||||||
|
var buttonHeight = 50;
|
||||||
|
var buttonPadding = 10;
|
||||||
|
var offset = 1;
|
||||||
|
var buttonPositionX = (offset + 1) * (buttonWidth + buttonPadding) + (windowDimensions.x / 2) - (buttonWidth * 3 + buttonPadding * 2.5);
|
||||||
|
var buttonPositionY = (windowDimensions.y - buttonHeight) - 50;
|
||||||
|
button = Overlays.addOverlay("image", {
|
||||||
|
x: buttonPositionX,
|
||||||
|
y: buttonPositionY,
|
||||||
|
width: buttonWidth,
|
||||||
|
height: buttonHeight,
|
||||||
|
imageURL: this.buttonImageURL,
|
||||||
|
visible: true,
|
||||||
|
alpha: 1.0
|
||||||
|
});
|
||||||
|
this.hasButton = true;
|
||||||
|
print('CELL ADDBUTTON INSIDECELL 2 button id is : ' +button)
|
||||||
|
} else {
|
||||||
|
print('CELL ADDBUTTON INSIDECELL FAIL - hasButton is' + this.hasButton)
|
||||||
|
}
|
||||||
|
},
|
||||||
|
onClick: function(event) {
|
||||||
|
//call to an internal function to get our scope back;
|
||||||
|
_this.handleClick(event);
|
||||||
|
},
|
||||||
|
handleClick: function(event) {
|
||||||
|
var clickedOverlay = Overlays.getOverlayAtPoint({
|
||||||
|
x: event.x,
|
||||||
|
y: event.y
|
||||||
|
});
|
||||||
|
|
||||||
|
if (clickedOverlay === button) {
|
||||||
|
this.lookAtTarget();
|
||||||
|
}
|
||||||
|
},
|
||||||
|
lookAtTarget: function() {
|
||||||
|
var direction = Vec3.normalize(Vec3.subtract(this.target, this.entryPoint));
|
||||||
|
var pitch = Quat.angleAxis(Math.asin(-direction.y) * 180.0 / Math.PI, {
|
||||||
|
x: 1,
|
||||||
|
y: 0,
|
||||||
|
z: 0
|
||||||
|
});
|
||||||
|
var yaw = Quat.angleAxis(Math.atan2(direction.x, direction.z) * 180.0 / Math.PI, {
|
||||||
|
x: 0,
|
||||||
|
y: 1,
|
||||||
|
z: 0
|
||||||
|
});
|
||||||
|
|
||||||
|
MyAvatar.goToLocation(this.target, true, yaw);
|
||||||
|
|
||||||
|
MyAvatar.headYaw = 0;
|
||||||
|
},
|
||||||
|
unload: function() {
|
||||||
|
this.hasButton = false;
|
||||||
|
Overlays.deleteOverlay(button);
|
||||||
|
Controller.mousePressEvent.disconnect(this.onClick);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
return new NavButton();
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
});
|
|
@ -0,0 +1,108 @@
|
||||||
|
// Copyright 2016 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
|
||||||
|
//
|
||||||
|
(function() {
|
||||||
|
|
||||||
|
var version = 12;
|
||||||
|
|
||||||
|
var baseURL = "https://hifi-production.s3.amazonaws.com/DomainContent/CellScience/";
|
||||||
|
var button;
|
||||||
|
var _this;
|
||||||
|
|
||||||
|
function NavButton() {
|
||||||
|
_this = this;
|
||||||
|
}
|
||||||
|
|
||||||
|
NavButton.prototype = {
|
||||||
|
button: null,
|
||||||
|
buttonImageURL: baseURL + "GUI/GUI_Ribosome.png?" + version,
|
||||||
|
hasButton: false,
|
||||||
|
entryPoint: {
|
||||||
|
x: 13500,
|
||||||
|
y: 3000,
|
||||||
|
z: 3000
|
||||||
|
},
|
||||||
|
target: {
|
||||||
|
x: 3276.6,
|
||||||
|
y: 13703.3,
|
||||||
|
z: 4405.6
|
||||||
|
},
|
||||||
|
preload: function(entityId) {
|
||||||
|
print('CELL PRELOAD RIBOSOME 1')
|
||||||
|
this.entityId = entityId;
|
||||||
|
this.addButton();
|
||||||
|
Controller.mousePressEvent.connect(this.onClick);
|
||||||
|
print('CELL PRELOAD RIBOSOME 2')
|
||||||
|
},
|
||||||
|
addButton: function() {
|
||||||
|
if (this.hasButton === false) {
|
||||||
|
print('CELL ADBUTTON RIBOSOME 1')
|
||||||
|
var windowDimensions = Controller.getViewportDimensions();
|
||||||
|
var buttonWidth = 150;
|
||||||
|
var buttonHeight = 50;
|
||||||
|
var buttonPadding = 10;
|
||||||
|
var offset = 2;
|
||||||
|
var buttonPositionX = (offset + 1) * (buttonWidth + buttonPadding) + (windowDimensions.x / 2) - (buttonWidth * 3 + buttonPadding * 2.5);
|
||||||
|
var buttonPositionY = (windowDimensions.y - buttonHeight) - 50;
|
||||||
|
button = Overlays.addOverlay("image", {
|
||||||
|
x: buttonPositionX,
|
||||||
|
y: buttonPositionY,
|
||||||
|
width: buttonWidth,
|
||||||
|
height: buttonHeight,
|
||||||
|
imageURL: this.buttonImageURL,
|
||||||
|
visible: true,
|
||||||
|
alpha: 1.0
|
||||||
|
});
|
||||||
|
this.hasButton = true;
|
||||||
|
print('CELL ADDBUTTON RIBOSOME 2 button id is : ' +button)
|
||||||
|
} else {
|
||||||
|
print('CELL ADDBUTTON RIBOSOME FAIL - hasButton is' + this.hasButton)
|
||||||
|
}
|
||||||
|
},
|
||||||
|
onClick: function(event) {
|
||||||
|
//call to an internal function to get our scope back;
|
||||||
|
_this.handleClick(event);
|
||||||
|
},
|
||||||
|
handleClick: function(event) {
|
||||||
|
var clickedOverlay = Overlays.getOverlayAtPoint({
|
||||||
|
x: event.x,
|
||||||
|
y: event.y
|
||||||
|
});
|
||||||
|
|
||||||
|
if (clickedOverlay === button) {
|
||||||
|
this.lookAtTarget();
|
||||||
|
}
|
||||||
|
},
|
||||||
|
lookAtTarget: function() {
|
||||||
|
var direction = Vec3.normalize(Vec3.subtract(this.target, this.entryPoint));
|
||||||
|
var pitch = Quat.angleAxis(Math.asin(-direction.y) * 180.0 / Math.PI, {
|
||||||
|
x: 1,
|
||||||
|
y: 0,
|
||||||
|
z: 0
|
||||||
|
});
|
||||||
|
var yaw = Quat.angleAxis(Math.atan2(direction.x, direction.z) * 180.0 / Math.PI, {
|
||||||
|
x: 0,
|
||||||
|
y: 1,
|
||||||
|
z: 0
|
||||||
|
});
|
||||||
|
|
||||||
|
MyAvatar.goToLocation(this.target, true, yaw);
|
||||||
|
|
||||||
|
MyAvatar.headYaw = 0;
|
||||||
|
},
|
||||||
|
unload: function() {
|
||||||
|
this.hasButton = false;
|
||||||
|
Overlays.deleteOverlay(button);
|
||||||
|
Controller.mousePressEvent.disconnect(this.onClick);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
return new NavButton();
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
});
|
|
@ -14,7 +14,7 @@
|
||||||
Script.include(utilsScript);
|
Script.include(utilsScript);
|
||||||
|
|
||||||
var self = this;
|
var self = this;
|
||||||
var baseURL = "https://hifi-content.s3.amazonaws.com/DomainContent/CellScience/";
|
var baseURL = "https://hifi-production.s3.amazonaws.com/DomainContent/CellScience/";
|
||||||
|
|
||||||
this.preload = function(entityId) {
|
this.preload = function(entityId) {
|
||||||
this.entityId = entityId;
|
this.entityId = entityId;
|
||||||
|
|
|
@ -6,7 +6,7 @@
|
||||||
//
|
//
|
||||||
|
|
||||||
(function() {
|
(function() {
|
||||||
var baseURL = "https://hifi-content.s3.amazonaws.com/hifi-content/DomainContent/CellScience/";
|
var baseURL = "https://hifi-production.s3.amazonaws.com/hifi-production/DomainContent/CellScience/";
|
||||||
var self = this;
|
var self = this;
|
||||||
this.buttonImageURL = baseURL + "GUI/play_audio.svg?2";
|
this.buttonImageURL = baseURL + "GUI/play_audio.svg?2";
|
||||||
|
|
||||||
|
@ -50,6 +50,7 @@
|
||||||
self.sound = SoundCache.getSound(this.soundURL);
|
self.sound = SoundCache.getSound(this.soundURL);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
this.addButton = function() {
|
this.addButton = function() {
|
||||||
this.windowDimensions = Controller.getViewportDimensions();
|
this.windowDimensions = Controller.getViewportDimensions();
|
||||||
|
@ -115,4 +116,4 @@
|
||||||
Controller.mousePressEvent.connect(this.onClick);
|
Controller.mousePressEvent.connect(this.onClick);
|
||||||
Script.update.connect(this.update);
|
Script.update.connect(this.update);
|
||||||
|
|
||||||
});
|
});
|
|
@ -8,7 +8,7 @@
|
||||||
(function() {
|
(function() {
|
||||||
|
|
||||||
var self = this;
|
var self = this;
|
||||||
var baseURL = "https://hifi-content.s3.amazonaws.com/DomainContent/CellScience/";
|
var baseURL = "https://hifi-production.s3.amazonaws.com/DomainContent/CellScience/";
|
||||||
|
|
||||||
var version = 3;
|
var version = 3;
|
||||||
this.preload = function(entityId) {
|
this.preload = function(entityId) {
|
||||||
|
|
|
@ -22,7 +22,12 @@
|
||||||
this.initialize = function(entityID) {
|
this.initialize = function(entityID) {
|
||||||
// print(' should initialize')
|
// print(' should initialize')
|
||||||
var properties = Entities.getEntityProperties(entityID);
|
var properties = Entities.getEntityProperties(entityID);
|
||||||
if (properties.userData.length === 0 || properties.hasOwnProperty('userData') === false) {
|
if (properties.hasOwnProperty('userData') === false) {
|
||||||
|
self.initTimeout = Script.setTimeout(function() {
|
||||||
|
// print(' no user data yet, try again in one second')
|
||||||
|
self.initialize(entityID);
|
||||||
|
}, 1000)
|
||||||
|
} else if (properties.userData.length === 0) {
|
||||||
self.initTimeout = Script.setTimeout(function() {
|
self.initTimeout = Script.setTimeout(function() {
|
||||||
// print(' no user data yet, try again in one second')
|
// print(' no user data yet, try again in one second')
|
||||||
self.initialize(entityID);
|
self.initialize(entityID);
|
||||||
|
@ -39,7 +44,7 @@
|
||||||
volume: 0.5
|
volume: 0.5
|
||||||
};
|
};
|
||||||
|
|
||||||
self.teleportSound = SoundCache.getSound("https://hifi-content.s3.amazonaws.com/DomainContent/CellScience/Audio/whoosh.wav");
|
self.teleportSound = SoundCache.getSound("https://hifi-production.s3.amazonaws.com/DomainContent/CellScience/Audio/whoosh.wav");
|
||||||
// print(" portal destination is " + self.portalDestination);
|
// print(" portal destination is " + self.portalDestination);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -57,7 +62,7 @@
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
this.lookAtTarget = function(entryPoint,target) {
|
this.lookAtTarget = function(entryPoint, target) {
|
||||||
//print('SHOULD LOOK AT TARGET')
|
//print('SHOULD LOOK AT TARGET')
|
||||||
var direction = Vec3.normalize(Vec3.subtract(entryPoint, target));
|
var direction = Vec3.normalize(Vec3.subtract(entryPoint, target));
|
||||||
var pitch = Quat.angleAxis(Math.asin(-direction.y) * 180.0 / Math.PI, {
|
var pitch = Quat.angleAxis(Math.asin(-direction.y) * 180.0 / Math.PI, {
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
var soundMap = [{
|
var soundMap = [{
|
||||||
name: 'Cells',
|
name: 'Cells',
|
||||||
url: "http://hifi-content.s3.amazonaws.com/DomainContent/CellScience/Audio/Cells.wav",
|
url: "http://hifi-production.s3.amazonaws.com/DomainContent/CellScience/Audio/Cells.wav",
|
||||||
audioOptions: {
|
audioOptions: {
|
||||||
position: {
|
position: {
|
||||||
x: 15850,
|
x: 15850,
|
||||||
|
@ -12,7 +12,7 @@ var soundMap = [{
|
||||||
}
|
}
|
||||||
}, {
|
}, {
|
||||||
name: 'Cell Layout',
|
name: 'Cell Layout',
|
||||||
url: "http://hifi-content.s3.amazonaws.com/DomainContent/CellScience/Audio/CellLayout.wav",
|
url: "http://hifi-production.s3.amazonaws.com/DomainContent/CellScience/Audio/CellLayout.wav",
|
||||||
audioOptions: {
|
audioOptions: {
|
||||||
position: {
|
position: {
|
||||||
x: 15950,
|
x: 15950,
|
||||||
|
@ -24,7 +24,7 @@ var soundMap = [{
|
||||||
}
|
}
|
||||||
}, {
|
}, {
|
||||||
name: 'Ribsome',
|
name: 'Ribsome',
|
||||||
url: "http://hifi-content.s3.amazonaws.com/DomainContent/CellScience/Audio/Ribosome.wav",
|
url: "http://hifi-production.s3.amazonaws.com/DomainContent/CellScience/Audio/Ribosome.wav",
|
||||||
audioOptions: {
|
audioOptions: {
|
||||||
position: {
|
position: {
|
||||||
x: 15650,
|
x: 15650,
|
||||||
|
@ -36,7 +36,7 @@ var soundMap = [{
|
||||||
}
|
}
|
||||||
}, {
|
}, {
|
||||||
name: 'Hexokinase',
|
name: 'Hexokinase',
|
||||||
url: "http://hifi-content.s3.amazonaws.com/DomainContent/CellScience/Audio/Hexokinase.wav",
|
url: "http://hifi-production.s3.amazonaws.com/DomainContent/CellScience/Audio/Hexokinase.wav",
|
||||||
audioOptions: {
|
audioOptions: {
|
||||||
position: {
|
position: {
|
||||||
x: 15750,
|
x: 15750,
|
||||||
|
|
File diff suppressed because one or more lines are too long
|
@ -9,12 +9,8 @@ var numDynein = 2;
|
||||||
var numKinesin = 2;
|
var numKinesin = 2;
|
||||||
var percentOnMainMT = 100;
|
var percentOnMainMT = 100;
|
||||||
|
|
||||||
var baseLocation;
|
|
||||||
if (USE_LOCAL_HOST === true) {
|
baseLocation = "https://hifi-production.s3.amazonaws.com/DomainContent/CellScience/"
|
||||||
baseLocation = "http://localhost:8080/";
|
|
||||||
} else {
|
|
||||||
baseLocation = "https://hifi-content.s3.amazonaws.com/DomainContent/CellScience/"
|
|
||||||
}
|
|
||||||
|
|
||||||
var WORLD_OFFSET = {
|
var WORLD_OFFSET = {
|
||||||
x: 0,
|
x: 0,
|
||||||
|
|
|
@ -18,7 +18,6 @@ function offsetVectorToWorld(vector) {
|
||||||
|
|
||||||
newVector = Vec3.sum(vector, WORLD_OFFSET);
|
newVector = Vec3.sum(vector, WORLD_OFFSET);
|
||||||
|
|
||||||
print('JBP NEW VECTOR IS:: ' + JSON.stringify(newVector))
|
|
||||||
return newVector
|
return newVector
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -17,7 +17,6 @@ function offsetVectorToWorld(vector) {
|
||||||
|
|
||||||
newVector = Vec3.sum(vector, WORLD_OFFSET);
|
newVector = Vec3.sum(vector, WORLD_OFFSET);
|
||||||
|
|
||||||
print('JBP NEW VECTOR IS:: ' + JSON.stringify(newVector))
|
|
||||||
return newVector
|
return newVector
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue