mirror of
https://github.com/overte-org/overte.git
synced 2025-08-09 22:28:37 +02:00
Merge remote-tracking branch 'upstream/master' into plugins
This commit is contained in:
commit
a923c044a3
11 changed files with 60 additions and 32 deletions
4
examples/html/jquery-2.1.4.min.js
vendored
Normal file
4
examples/html/jquery-2.1.4.min.js
vendored
Normal file
File diff suppressed because one or more lines are too long
|
@ -38,7 +38,7 @@ var mouseLook = (function () {
|
||||||
keyboardID = 0;
|
keyboardID = 0;
|
||||||
|
|
||||||
function onKeyPressEvent(event) {
|
function onKeyPressEvent(event) {
|
||||||
if (event.text == 'm' && event.isMeta) {
|
if (event.text == 'M') {
|
||||||
active = !active;
|
active = !active;
|
||||||
updateMapping();
|
updateMapping();
|
||||||
}
|
}
|
||||||
|
|
|
@ -633,6 +633,11 @@ Application::Application(int& argc, char** argv, QElapsedTimer &startup_time) :
|
||||||
_settingsTimer.setSingleShot(false);
|
_settingsTimer.setSingleShot(false);
|
||||||
_settingsTimer.setInterval(SAVE_SETTINGS_INTERVAL);
|
_settingsTimer.setInterval(SAVE_SETTINGS_INTERVAL);
|
||||||
_settingsThread.start();
|
_settingsThread.start();
|
||||||
|
|
||||||
|
if (Menu::getInstance()->isOptionChecked(MenuOption::IndependentMode)) {
|
||||||
|
Menu::getInstance()->setIsOptionChecked(MenuOption::ThirdPerson, true);
|
||||||
|
cameraMenuChanged();
|
||||||
|
}
|
||||||
|
|
||||||
_trayIcon->show();
|
_trayIcon->show();
|
||||||
|
|
||||||
|
|
|
@ -225,14 +225,14 @@ void KeyboardMouseDevice::assignDefaultInputMapping(UserInputMapper& mapper) {
|
||||||
mapper.addInputChannel(UserInputMapper::VERTICAL_DOWN, makeInput(Qt::Key_C), BUTTON_MOVE_SPEED);
|
mapper.addInputChannel(UserInputMapper::VERTICAL_DOWN, makeInput(Qt::Key_C), BUTTON_MOVE_SPEED);
|
||||||
mapper.addInputChannel(UserInputMapper::VERTICAL_UP, makeInput(Qt::Key_E), BUTTON_MOVE_SPEED);
|
mapper.addInputChannel(UserInputMapper::VERTICAL_UP, makeInput(Qt::Key_E), BUTTON_MOVE_SPEED);
|
||||||
|
|
||||||
mapper.addInputChannel(UserInputMapper::BOOM_IN, makeInput(Qt::Key_W), makeInput(Qt::Key_Shift), BUTTON_BOOM_SPEED);
|
mapper.addInputChannel(UserInputMapper::BOOM_IN, makeInput(Qt::Key_E), makeInput(Qt::Key_Shift), BUTTON_BOOM_SPEED);
|
||||||
mapper.addInputChannel(UserInputMapper::BOOM_OUT, makeInput(Qt::Key_S), makeInput(Qt::Key_Shift), BUTTON_BOOM_SPEED);
|
mapper.addInputChannel(UserInputMapper::BOOM_OUT, makeInput(Qt::Key_C), makeInput(Qt::Key_Shift), BUTTON_BOOM_SPEED);
|
||||||
mapper.addInputChannel(UserInputMapper::LATERAL_LEFT, makeInput(Qt::Key_A), makeInput(Qt::RightButton), BUTTON_YAW_SPEED);
|
mapper.addInputChannel(UserInputMapper::LATERAL_LEFT, makeInput(Qt::Key_A), makeInput(Qt::RightButton), BUTTON_YAW_SPEED);
|
||||||
mapper.addInputChannel(UserInputMapper::LATERAL_RIGHT, makeInput(Qt::Key_D), makeInput(Qt::RightButton), BUTTON_YAW_SPEED);
|
mapper.addInputChannel(UserInputMapper::LATERAL_RIGHT, makeInput(Qt::Key_D), makeInput(Qt::RightButton), BUTTON_YAW_SPEED);
|
||||||
mapper.addInputChannel(UserInputMapper::LATERAL_LEFT, makeInput(Qt::Key_A), makeInput(Qt::Key_Shift), BUTTON_YAW_SPEED);
|
mapper.addInputChannel(UserInputMapper::LATERAL_LEFT, makeInput(Qt::Key_A), makeInput(Qt::Key_Shift), BUTTON_YAW_SPEED);
|
||||||
mapper.addInputChannel(UserInputMapper::LATERAL_RIGHT, makeInput(Qt::Key_D), makeInput(Qt::Key_Shift), BUTTON_YAW_SPEED);
|
mapper.addInputChannel(UserInputMapper::LATERAL_RIGHT, makeInput(Qt::Key_D), makeInput(Qt::Key_Shift), BUTTON_YAW_SPEED);
|
||||||
mapper.addInputChannel(UserInputMapper::PITCH_DOWN, makeInput(Qt::Key_C), makeInput(Qt::Key_Shift), BUTTON_PITCH_SPEED);
|
mapper.addInputChannel(UserInputMapper::PITCH_DOWN, makeInput(Qt::Key_S), makeInput(Qt::Key_Shift), BUTTON_PITCH_SPEED);
|
||||||
mapper.addInputChannel(UserInputMapper::PITCH_UP, makeInput(Qt::Key_E), makeInput(Qt::Key_Shift), BUTTON_PITCH_SPEED);
|
mapper.addInputChannel(UserInputMapper::PITCH_UP, makeInput(Qt::Key_W), makeInput(Qt::Key_Shift), BUTTON_PITCH_SPEED);
|
||||||
|
|
||||||
// Arrow keys mapping
|
// Arrow keys mapping
|
||||||
mapper.addInputChannel(UserInputMapper::LONGITUDINAL_BACKWARD, makeInput(Qt::Key_Down), BUTTON_MOVE_SPEED);
|
mapper.addInputChannel(UserInputMapper::LONGITUDINAL_BACKWARD, makeInput(Qt::Key_Down), BUTTON_MOVE_SPEED);
|
||||||
|
@ -270,8 +270,8 @@ void KeyboardMouseDevice::assignDefaultInputMapping(UserInputMapper& mapper) {
|
||||||
mapper.addInputChannel(UserInputMapper::YAW_RIGHT, makeInput(TOUCH_AXIS_X_POS), TOUCH_YAW_SPEED);
|
mapper.addInputChannel(UserInputMapper::YAW_RIGHT, makeInput(TOUCH_AXIS_X_POS), TOUCH_YAW_SPEED);
|
||||||
|
|
||||||
// Wheel move
|
// Wheel move
|
||||||
mapper.addInputChannel(UserInputMapper::BOOM_IN, makeInput(MOUSE_AXIS_WHEEL_Y_NEG), BUTTON_BOOM_SPEED);
|
mapper.addInputChannel(UserInputMapper::BOOM_IN, makeInput(MOUSE_AXIS_WHEEL_Y_POS), BUTTON_BOOM_SPEED);
|
||||||
mapper.addInputChannel(UserInputMapper::BOOM_OUT, makeInput(MOUSE_AXIS_WHEEL_Y_POS), BUTTON_BOOM_SPEED);
|
mapper.addInputChannel(UserInputMapper::BOOM_OUT, makeInput(MOUSE_AXIS_WHEEL_Y_NEG), BUTTON_BOOM_SPEED);
|
||||||
mapper.addInputChannel(UserInputMapper::LATERAL_LEFT, makeInput(MOUSE_AXIS_WHEEL_X_NEG), BUTTON_YAW_SPEED);
|
mapper.addInputChannel(UserInputMapper::LATERAL_LEFT, makeInput(MOUSE_AXIS_WHEEL_X_NEG), BUTTON_YAW_SPEED);
|
||||||
mapper.addInputChannel(UserInputMapper::LATERAL_RIGHT, makeInput(MOUSE_AXIS_WHEEL_X_POS), BUTTON_YAW_SPEED);
|
mapper.addInputChannel(UserInputMapper::LATERAL_RIGHT, makeInput(MOUSE_AXIS_WHEEL_X_POS), BUTTON_YAW_SPEED);
|
||||||
|
|
||||||
|
|
|
@ -132,21 +132,22 @@ ApplicationCompositor::ApplicationCompositor() {
|
||||||
|
|
||||||
// check the format of this href string before we parse it
|
// check the format of this href string before we parse it
|
||||||
QString hrefString = properties.getHref();
|
QString hrefString = properties.getHref();
|
||||||
if (!hrefString.startsWith("hifi:")) {
|
|
||||||
hrefString.prepend("hifi://");
|
|
||||||
}
|
|
||||||
|
|
||||||
// parse out a QUrl from the hrefString
|
|
||||||
QUrl href = QUrl(hrefString);
|
|
||||||
|
|
||||||
_hoverItemTitle = href.host();
|
|
||||||
_hoverItemDescription = properties.getDescription();
|
|
||||||
|
|
||||||
auto cursor = Cursor::Manager::instance().getCursor();
|
auto cursor = Cursor::Manager::instance().getCursor();
|
||||||
|
if (!hrefString.isEmpty()) {
|
||||||
|
if (!hrefString.startsWith("hifi:")) {
|
||||||
|
hrefString.prepend("hifi://");
|
||||||
|
}
|
||||||
|
|
||||||
if (!href.isEmpty()) {
|
// parse out a QUrl from the hrefString
|
||||||
|
QUrl href = QUrl(hrefString);
|
||||||
|
|
||||||
|
_hoverItemTitle = href.host();
|
||||||
|
_hoverItemDescription = properties.getDescription();
|
||||||
cursor->setIcon(Cursor::Icon::LINK);
|
cursor->setIcon(Cursor::Icon::LINK);
|
||||||
} else {
|
} else {
|
||||||
|
_hoverItemTitle.clear();
|
||||||
|
_hoverItemDescription.clear();
|
||||||
cursor->setIcon(Cursor::Icon::DEFAULT);
|
cursor->setIcon(Cursor::Icon::DEFAULT);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -23,7 +23,7 @@
|
||||||
const xColor DEFAULT_BACKGROUND_COLOR = { 0, 0, 0 };
|
const xColor DEFAULT_BACKGROUND_COLOR = { 0, 0, 0 };
|
||||||
const float DEFAULT_BACKGROUND_ALPHA = 0.7f;
|
const float DEFAULT_BACKGROUND_ALPHA = 0.7f;
|
||||||
const int DEFAULT_MARGIN = 10;
|
const int DEFAULT_MARGIN = 10;
|
||||||
const int DEFAULT_FONTSIZE = 11;
|
const int DEFAULT_FONTSIZE = 12;
|
||||||
const int DEFAULT_FONT_WEIGHT = 50;
|
const int DEFAULT_FONT_WEIGHT = 50;
|
||||||
|
|
||||||
class TextRenderer;
|
class TextRenderer;
|
||||||
|
|
|
@ -126,7 +126,7 @@ enum EntityPropertyList {
|
||||||
PROP_SCRIPT_TIMESTAMP,
|
PROP_SCRIPT_TIMESTAMP,
|
||||||
|
|
||||||
////////////////////////////////////////////////////////////////////////////////////////////////////
|
////////////////////////////////////////////////////////////////////////////////////////////////////
|
||||||
// ATTENTION: add new properties ABOVE this line
|
// ATTENTION: add new properties to end of list just ABOVE this line
|
||||||
PROP_AFTER_LAST_ITEM,
|
PROP_AFTER_LAST_ITEM,
|
||||||
////////////////////////////////////////////////////////////////////////////////////////////////////
|
////////////////////////////////////////////////////////////////////////////////////////////////////
|
||||||
|
|
||||||
|
|
|
@ -22,14 +22,14 @@ HifiSockAddr::HifiSockAddr() :
|
||||||
_address(),
|
_address(),
|
||||||
_port(0)
|
_port(0)
|
||||||
{
|
{
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
HifiSockAddr::HifiSockAddr(const QHostAddress& address, quint16 port) :
|
HifiSockAddr::HifiSockAddr(const QHostAddress& address, quint16 port) :
|
||||||
_address(address),
|
_address(address),
|
||||||
_port(port)
|
_port(port)
|
||||||
{
|
{
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
HifiSockAddr::HifiSockAddr(const HifiSockAddr& otherSockAddr) :
|
HifiSockAddr::HifiSockAddr(const HifiSockAddr& otherSockAddr) :
|
||||||
|
@ -37,7 +37,7 @@ HifiSockAddr::HifiSockAddr(const HifiSockAddr& otherSockAddr) :
|
||||||
_address(otherSockAddr._address),
|
_address(otherSockAddr._address),
|
||||||
_port(otherSockAddr._port)
|
_port(otherSockAddr._port)
|
||||||
{
|
{
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
HifiSockAddr& HifiSockAddr::operator=(const HifiSockAddr& rhsSockAddr) {
|
HifiSockAddr& HifiSockAddr::operator=(const HifiSockAddr& rhsSockAddr) {
|
||||||
|
@ -66,7 +66,7 @@ HifiSockAddr::HifiSockAddr(const QString& hostname, quint16 hostOrderPort, bool
|
||||||
|
|
||||||
HifiSockAddr::HifiSockAddr(const sockaddr* sockaddr) {
|
HifiSockAddr::HifiSockAddr(const sockaddr* sockaddr) {
|
||||||
_address = QHostAddress(sockaddr);
|
_address = QHostAddress(sockaddr);
|
||||||
|
|
||||||
if (sockaddr->sa_family == AF_INET) {
|
if (sockaddr->sa_family == AF_INET) {
|
||||||
_port = ntohs(reinterpret_cast<const sockaddr_in*>(sockaddr)->sin_port);
|
_port = ntohs(reinterpret_cast<const sockaddr_in*>(sockaddr)->sin_port);
|
||||||
} else {
|
} else {
|
||||||
|
@ -76,7 +76,7 @@ HifiSockAddr::HifiSockAddr(const sockaddr* sockaddr) {
|
||||||
|
|
||||||
void HifiSockAddr::swap(HifiSockAddr& otherSockAddr) {
|
void HifiSockAddr::swap(HifiSockAddr& otherSockAddr) {
|
||||||
using std::swap;
|
using std::swap;
|
||||||
|
|
||||||
swap(_address, otherSockAddr._address);
|
swap(_address, otherSockAddr._address);
|
||||||
swap(_port, otherSockAddr._port);
|
swap(_port, otherSockAddr._port);
|
||||||
}
|
}
|
||||||
|
@ -90,7 +90,7 @@ void HifiSockAddr::handleLookupResult(const QHostInfo& hostInfo) {
|
||||||
qCDebug(networking) << "Lookup failed for" << hostInfo.lookupId() << ":" << hostInfo.errorString();
|
qCDebug(networking) << "Lookup failed for" << hostInfo.lookupId() << ":" << hostInfo.errorString();
|
||||||
emit lookupFailed();
|
emit lookupFailed();
|
||||||
}
|
}
|
||||||
|
|
||||||
foreach(const QHostAddress& address, hostInfo.addresses()) {
|
foreach(const QHostAddress& address, hostInfo.addresses()) {
|
||||||
// just take the first IPv4 address
|
// just take the first IPv4 address
|
||||||
if (address.protocol() == QAbstractSocket::IPv4Protocol) {
|
if (address.protocol() == QAbstractSocket::IPv4Protocol) {
|
||||||
|
@ -119,9 +119,9 @@ QDataStream& operator>>(QDataStream& dataStream, HifiSockAddr& sockAddr) {
|
||||||
}
|
}
|
||||||
|
|
||||||
QHostAddress getLocalAddress() {
|
QHostAddress getLocalAddress() {
|
||||||
|
|
||||||
QHostAddress localAddress;
|
QHostAddress localAddress;
|
||||||
|
|
||||||
foreach(const QNetworkInterface &networkInterface, QNetworkInterface::allInterfaces()) {
|
foreach(const QNetworkInterface &networkInterface, QNetworkInterface::allInterfaces()) {
|
||||||
if (networkInterface.flags() & QNetworkInterface::IsUp
|
if (networkInterface.flags() & QNetworkInterface::IsUp
|
||||||
&& networkInterface.flags() & QNetworkInterface::IsRunning
|
&& networkInterface.flags() & QNetworkInterface::IsRunning
|
||||||
|
@ -131,19 +131,19 @@ QHostAddress getLocalAddress() {
|
||||||
foreach(const QNetworkAddressEntry &entry, networkInterface.addressEntries()) {
|
foreach(const QNetworkAddressEntry &entry, networkInterface.addressEntries()) {
|
||||||
// make sure it's an IPv4 address that isn't the loopback
|
// make sure it's an IPv4 address that isn't the loopback
|
||||||
if (entry.ip().protocol() == QAbstractSocket::IPv4Protocol && !entry.ip().isLoopback()) {
|
if (entry.ip().protocol() == QAbstractSocket::IPv4Protocol && !entry.ip().isLoopback()) {
|
||||||
|
|
||||||
// set our localAddress and break out
|
// set our localAddress and break out
|
||||||
localAddress = entry.ip();
|
localAddress = entry.ip();
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!localAddress.isNull()) {
|
if (!localAddress.isNull()) {
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// return the looked up local address
|
// return the looked up local address
|
||||||
return localAddress;
|
return localAddress;
|
||||||
}
|
}
|
||||||
|
|
|
@ -743,6 +743,14 @@ void LimitedNodeList::startSTUNPublicSocketUpdate() {
|
||||||
// if we don't know the STUN IP yet we need to have ourselves be called once it is known
|
// if we don't know the STUN IP yet we need to have ourselves be called once it is known
|
||||||
if (_stunSockAddr.getAddress().isNull()) {
|
if (_stunSockAddr.getAddress().isNull()) {
|
||||||
connect(&_stunSockAddr, &HifiSockAddr::lookupCompleted, this, &LimitedNodeList::startSTUNPublicSocketUpdate);
|
connect(&_stunSockAddr, &HifiSockAddr::lookupCompleted, this, &LimitedNodeList::startSTUNPublicSocketUpdate);
|
||||||
|
|
||||||
|
// in case we just completely fail to lookup the stun socket - add a 10s timeout that will trigger the fail case
|
||||||
|
const quint64 STUN_DNS_LOOKUP_TIMEOUT_MSECS = 10 * 1000;
|
||||||
|
|
||||||
|
QTimer* stunLookupFailTimer = new QTimer(this);
|
||||||
|
connect(stunLookupFailTimer, &QTimer::timeout, this, &LimitedNodeList::possiblyTimeoutSTUNAddressLookup);
|
||||||
|
stunLookupFailTimer->start(STUN_DNS_LOOKUP_TIMEOUT_MSECS);
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
// setup our initial STUN timer here so we can quickly find out our public IP address
|
// setup our initial STUN timer here so we can quickly find out our public IP address
|
||||||
_initialSTUNTimer = new QTimer(this);
|
_initialSTUNTimer = new QTimer(this);
|
||||||
|
@ -758,6 +766,13 @@ void LimitedNodeList::startSTUNPublicSocketUpdate() {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void LimitedNodeList::possiblyTimeoutSTUNAddressLookup() {
|
||||||
|
if (_stunSockAddr.getAddress().isNull()) {
|
||||||
|
// our stun address is still NULL, but we've been waiting for long enough - time to force a fail
|
||||||
|
stopInitialSTUNUpdate(false);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
void LimitedNodeList::stopInitialSTUNUpdate(bool success) {
|
void LimitedNodeList::stopInitialSTUNUpdate(bool success) {
|
||||||
_hasCompletedInitialSTUN = true;
|
_hasCompletedInitialSTUN = true;
|
||||||
|
|
||||||
|
@ -777,8 +792,6 @@ void LimitedNodeList::stopInitialSTUNUpdate(bool success) {
|
||||||
flagTimeForConnectionStep(ConnectionStep::SetPublicSocketFromSTUN);
|
flagTimeForConnectionStep(ConnectionStep::SetPublicSocketFromSTUN);
|
||||||
}
|
}
|
||||||
|
|
||||||
assert(_initialSTUNTimer);
|
|
||||||
|
|
||||||
// stop our initial fast timer
|
// stop our initial fast timer
|
||||||
if (_initialSTUNTimer) {
|
if (_initialSTUNTimer) {
|
||||||
_initialSTUNTimer->stop();
|
_initialSTUNTimer->stop();
|
||||||
|
|
|
@ -317,6 +317,7 @@ protected:
|
||||||
}
|
}
|
||||||
private slots:
|
private slots:
|
||||||
void flagTimeForConnectionStep(ConnectionStep connectionStep, quint64 timestamp);
|
void flagTimeForConnectionStep(ConnectionStep connectionStep, quint64 timestamp);
|
||||||
|
void possiblyTimeoutSTUNAddressLookup();
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif // hifi_LimitedNodeList_h
|
#endif // hifi_LimitedNodeList_h
|
||||||
|
|
|
@ -63,6 +63,10 @@ void vec4FromScriptValue(const QScriptValue& object, glm::vec4& vec4) {
|
||||||
|
|
||||||
QScriptValue vec3toScriptValue(QScriptEngine* engine, const glm::vec3 &vec3) {
|
QScriptValue vec3toScriptValue(QScriptEngine* engine, const glm::vec3 &vec3) {
|
||||||
QScriptValue obj = engine->newObject();
|
QScriptValue obj = engine->newObject();
|
||||||
|
if (vec3.x != vec3.x || vec3.y != vec3.y || vec3.z != vec3.z) {
|
||||||
|
// if vec3 contains a NaN don't try to convert it
|
||||||
|
return obj;
|
||||||
|
}
|
||||||
obj.setProperty("x", vec3.x);
|
obj.setProperty("x", vec3.x);
|
||||||
obj.setProperty("y", vec3.y);
|
obj.setProperty("y", vec3.y);
|
||||||
obj.setProperty("z", vec3.z);
|
obj.setProperty("z", vec3.z);
|
||||||
|
|
Loading…
Reference in a new issue