mirror of
https://github.com/HifiExperiments/overte.git
synced 2025-04-10 10:34:56 +02:00
Merge branch 'stable' of github.com:highfidelity/hifi into merge-back-stable-66
This commit is contained in:
commit
95c172f418
12 changed files with 140 additions and 28 deletions
|
@ -3146,6 +3146,10 @@ void Application::loadServerlessDomain(QUrl domainURL) {
|
|||
tmpTree->sendEntities(&_entityEditSender, getEntities()->getTree(), 0, 0, 0);
|
||||
}
|
||||
|
||||
std::map<QString, QString> namedPaths = tmpTree->getNamedPaths();
|
||||
nodeList->getDomainHandler().connectedToServerless(namedPaths);
|
||||
|
||||
|
||||
_fullSceneReceivedCounter++;
|
||||
}
|
||||
|
||||
|
@ -5903,6 +5907,9 @@ void Application::nodeActivated(SharedNodePointer node) {
|
|||
}
|
||||
getMyAvatar()->markIdentityDataChanged();
|
||||
getMyAvatar()->resetLastSent();
|
||||
|
||||
// transmit a "sendAll" packet to the AvatarMixer we just connected to.
|
||||
getMyAvatar()->sendAvatarDataPacket(true);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -58,6 +58,13 @@ void SkeletonModel::initJointStates() {
|
|||
glm::mat4 modelOffset = glm::scale(_scale) * glm::translate(_offset);
|
||||
_rig.initJointStates(geometry, modelOffset);
|
||||
|
||||
{
|
||||
// initialize _jointData with proper values for default joints
|
||||
QVector<JointData> defaultJointData;
|
||||
_rig.copyJointsIntoJointData(defaultJointData);
|
||||
_owningAvatar->setRawJointData(defaultJointData);
|
||||
}
|
||||
|
||||
// Determine the default eye position for avatar scale = 1.0
|
||||
int headJointIndex = geometry.headJointIndex;
|
||||
if (0 > headJointIndex || headJointIndex >= _rig.getJointStateCount()) {
|
||||
|
|
|
@ -559,7 +559,8 @@ QByteArray AvatarData::toByteArray(AvatarDataDetail dataDetail, quint64 lastSent
|
|||
const JointData& last = lastSentJointData[i];
|
||||
|
||||
if (!data.rotationIsDefaultPose) {
|
||||
if (sendAll || last.rotationIsDefaultPose || last.rotation != data.rotation) {
|
||||
bool mustSend = sendAll || last.rotationIsDefaultPose;
|
||||
if (mustSend || last.rotation != data.rotation) {
|
||||
|
||||
bool largeEnoughRotation = true;
|
||||
if (cullSmallChanges) {
|
||||
|
@ -568,7 +569,7 @@ QByteArray AvatarData::toByteArray(AvatarDataDetail dataDetail, quint64 lastSent
|
|||
largeEnoughRotation = fabsf(glm::dot(last.rotation, data.rotation)) < minRotationDOT;
|
||||
}
|
||||
|
||||
if (sendAll || !cullSmallChanges || largeEnoughRotation) {
|
||||
if (mustSend || !cullSmallChanges || largeEnoughRotation) {
|
||||
validity |= (1 << validityBit);
|
||||
#ifdef WANT_DEBUG
|
||||
rotationSentCount++;
|
||||
|
@ -608,10 +609,12 @@ QByteArray AvatarData::toByteArray(AvatarDataDetail dataDetail, quint64 lastSent
|
|||
float maxTranslationDimension = 0.0;
|
||||
for (int i = 0; i < _jointData.size(); i++) {
|
||||
const JointData& data = _jointData[i];
|
||||
const JointData& last = lastSentJointData[i];
|
||||
|
||||
if (!data.translationIsDefaultPose) {
|
||||
if (sendAll || lastSentJointData[i].translation != data.translation) {
|
||||
if (sendAll || !cullSmallChanges || glm::distance(data.translation, lastSentJointData[i].translation) > minTranslation) {
|
||||
bool mustSend = sendAll || last.translationIsDefaultPose;
|
||||
if (mustSend || last.translation != data.translation) {
|
||||
if (mustSend || !cullSmallChanges || glm::distance(data.translation, lastSentJointData[i].translation) > minTranslation) {
|
||||
validity |= (1 << validityBit);
|
||||
#ifdef WANT_DEBUG
|
||||
translationSentCount++;
|
||||
|
@ -669,6 +672,19 @@ QByteArray AvatarData::toByteArray(AvatarDataDetail dataDetail, quint64 lastSent
|
|||
}
|
||||
|
||||
if (sentJointDataOut) {
|
||||
|
||||
// Mark default poses in lastSentJointData, so when they become non-default we send them.
|
||||
for (int i = 0; i < _jointData.size(); i++) {
|
||||
const JointData& data = _jointData[i];
|
||||
JointData& local = localSentJointDataOut[i];
|
||||
if (data.rotationIsDefaultPose) {
|
||||
local.rotationIsDefaultPose = true;
|
||||
}
|
||||
if (data.translationIsDefaultPose) {
|
||||
local.translationIsDefaultPose = true;
|
||||
}
|
||||
}
|
||||
|
||||
// Push new sent joint data to sentJointDataOut
|
||||
sentJointDataOut->swap(localSentJointDataOut);
|
||||
}
|
||||
|
@ -1816,13 +1832,13 @@ void AvatarData::setJointMappingsFromNetworkReply() {
|
|||
networkReply->deleteLater();
|
||||
}
|
||||
|
||||
void AvatarData::sendAvatarDataPacket() {
|
||||
void AvatarData::sendAvatarDataPacket(bool sendAll) {
|
||||
auto nodeList = DependencyManager::get<NodeList>();
|
||||
|
||||
// about 2% of the time, we send a full update (meaning, we transmit all the joint data), even if nothing has changed.
|
||||
// this is to guard against a joint moving once, the packet getting lost, and the joint never moving again.
|
||||
|
||||
bool cullSmallData = (randFloat() < AVATAR_SEND_FULL_UPDATE_RATIO);
|
||||
bool cullSmallData = !sendAll && (randFloat() < AVATAR_SEND_FULL_UPDATE_RATIO);
|
||||
auto dataDetail = cullSmallData ? SendAllData : CullSmallData;
|
||||
QByteArray avatarByteArray = toByteArrayStateful(dataDetail);
|
||||
|
||||
|
|
|
@ -256,6 +256,11 @@ namespace AvatarDataPacket {
|
|||
SixByteQuat rotation[numValidRotations]; // encodeded and compressed by packOrientationQuatToSixBytes()
|
||||
uint8_t translationValidityBits[ceil(numJoints / 8)]; // one bit per joint, if true then a compressed translation follows.
|
||||
SixByteTrans translation[numValidTranslations]; // encodeded and compressed by packFloatVec3ToSignedTwoByteFixed()
|
||||
|
||||
SixByteQuat leftHandControllerRotation;
|
||||
SixByteTrans leftHandControllerTranslation;
|
||||
SixByteQuat rightHandControllerRotation;
|
||||
SixByteTrans rightHandControllerTranslation;
|
||||
};
|
||||
*/
|
||||
size_t maxJointDataSize(size_t numJoints);
|
||||
|
@ -707,11 +712,11 @@ signals:
|
|||
void sessionUUIDChanged();
|
||||
|
||||
public slots:
|
||||
void sendAvatarDataPacket();
|
||||
void sendAvatarDataPacket(bool sendAll = false);
|
||||
void sendIdentityPacket();
|
||||
|
||||
void setJointMappingsFromNetworkReply();
|
||||
void setSessionUUID(const QUuid& sessionUUID) {
|
||||
virtual void setSessionUUID(const QUuid& sessionUUID) {
|
||||
if (sessionUUID != getID()) {
|
||||
if (sessionUUID == QUuid()) {
|
||||
setID(AVATAR_SELF_ID);
|
||||
|
|
|
@ -2320,6 +2320,16 @@ bool EntityTree::readFromMap(QVariantMap& map) {
|
|||
_persistDataVersion = map["DataVersion"].toInt();
|
||||
}
|
||||
|
||||
_namedPaths.clear();
|
||||
if (map.contains("Paths")) {
|
||||
QVariantMap namedPathsMap = map["Paths"].toMap();
|
||||
for(QVariantMap::const_iterator iter = namedPathsMap.begin(); iter != namedPathsMap.end(); ++iter) {
|
||||
QString namedPathName = iter.key();
|
||||
QString namedPathViewPoint = iter.value().toString();
|
||||
_namedPaths[namedPathName] = namedPathViewPoint;
|
||||
}
|
||||
}
|
||||
|
||||
// map will have a top-level list keyed as "Entities". This will be extracted
|
||||
// and iterated over. Each member of this list is converted to a QVariantMap, then
|
||||
// to a QScriptValue, and then to EntityItemProperties. These properties are used
|
||||
|
|
|
@ -301,6 +301,8 @@ public:
|
|||
static bool addMaterialToOverlay(const QUuid& overlayID, graphics::MaterialLayer material, const std::string& parentMaterialName);
|
||||
static bool removeMaterialFromOverlay(const QUuid& overlayID, graphics::MaterialPointer material, const std::string& parentMaterialName);
|
||||
|
||||
std::map<QString, QString> getNamedPaths() const { return _namedPaths; }
|
||||
|
||||
signals:
|
||||
void deletingEntity(const EntityItemID& entityID);
|
||||
void deletingEntityPointer(EntityItem* entityID);
|
||||
|
@ -417,6 +419,8 @@ private:
|
|||
static std::function<bool(const QUuid&, graphics::MaterialPointer, const std::string&)> _removeMaterialFromOverlayOperator;
|
||||
|
||||
bool _serverlessDomain { false };
|
||||
|
||||
std::map<QString, QString> _namedPaths;
|
||||
};
|
||||
|
||||
#endif // hifi_EntityTree_h
|
||||
|
|
|
@ -316,7 +316,17 @@ bool AddressManager::handleUrl(const QUrl& lookupUrl, LookupTrigger trigger) {
|
|||
_shareablePlaceName.clear();
|
||||
setDomainInfo(lookupUrl, trigger);
|
||||
emit lookupResultsFinished();
|
||||
handlePath(DOMAIN_SPAWNING_POINT, LookupTrigger::Internal, false);
|
||||
|
||||
QString path = DOMAIN_SPAWNING_POINT;
|
||||
QUrlQuery queryArgs(lookupUrl);
|
||||
const QString LOCATION_QUERY_KEY = "location";
|
||||
if (queryArgs.hasQueryItem(LOCATION_QUERY_KEY)) {
|
||||
path = queryArgs.queryItemValue(LOCATION_QUERY_KEY);
|
||||
} else {
|
||||
path = DEFAULT_NAMED_PATH;
|
||||
}
|
||||
|
||||
handlePath(path, LookupTrigger::Internal, false);
|
||||
return true;
|
||||
}
|
||||
|
||||
|
@ -433,7 +443,9 @@ void AddressManager::goToAddressFromObject(const QVariantMap& dataObject, const
|
|||
QUrl domainURL;
|
||||
domainURL.setScheme(URL_SCHEME_HIFI);
|
||||
domainURL.setHost(domainHostname);
|
||||
domainURL.setPort(domainPort);
|
||||
if (domainPort > 0) {
|
||||
domainURL.setPort(domainPort);
|
||||
}
|
||||
emit possibleDomainChangeRequired(domainURL, domainID);
|
||||
} else {
|
||||
QString iceServerAddress = domainObject[DOMAIN_ICE_SERVER_ADDRESS_KEY].toString();
|
||||
|
@ -604,7 +616,9 @@ bool AddressManager::handleNetworkAddress(const QString& lookupString, LookupTri
|
|||
QUrl domainURL;
|
||||
domainURL.setScheme(URL_SCHEME_HIFI);
|
||||
domainURL.setHost(domainIPString);
|
||||
domainURL.setPort(domainPort);
|
||||
if (domainPort > 0) {
|
||||
domainURL.setPort(domainPort);
|
||||
}
|
||||
hostChanged = setDomainInfo(domainURL, trigger);
|
||||
|
||||
return true;
|
||||
|
@ -625,7 +639,9 @@ bool AddressManager::handleNetworkAddress(const QString& lookupString, LookupTri
|
|||
QUrl domainURL;
|
||||
domainURL.setScheme(URL_SCHEME_HIFI);
|
||||
domainURL.setHost(domainHostname);
|
||||
domainURL.setPort(domainPort);
|
||||
if (domainPort > 0) {
|
||||
domainURL.setPort(domainPort);
|
||||
}
|
||||
hostChanged = setDomainInfo(domainURL, trigger);
|
||||
|
||||
return true;
|
||||
|
@ -757,7 +773,9 @@ bool AddressManager::setHost(const QString& host, LookupTrigger trigger, quint16
|
|||
_domainURL = QUrl();
|
||||
_domainURL.setScheme(URL_SCHEME_HIFI);
|
||||
_domainURL.setHost(host);
|
||||
_domainURL.setPort(port);
|
||||
if (port > 0) {
|
||||
_domainURL.setPort(port);
|
||||
}
|
||||
|
||||
// any host change should clear the shareable place name
|
||||
_shareablePlaceName.clear();
|
||||
|
|
|
@ -173,15 +173,15 @@ void DomainHandler::setURLAndID(QUrl domainURL, QUuid domainID) {
|
|||
QString previousHost = _domainURL.host();
|
||||
_domainURL = domainURL;
|
||||
|
||||
if (domainURL.scheme() != URL_SCHEME_HIFI) {
|
||||
setIsConnected(true);
|
||||
} else if (previousHost != domainURL.host()) {
|
||||
if (previousHost != domainURL.host()) {
|
||||
qCDebug(networking) << "Updated domain hostname to" << domainURL.host();
|
||||
|
||||
if (!domainURL.host().isEmpty()) {
|
||||
// re-set the sock addr to null and fire off a lookup of the IP address for this domain-server's hostname
|
||||
qCDebug(networking, "Looking up DS hostname %s.", domainURL.host().toLocal8Bit().constData());
|
||||
QHostInfo::lookupHost(domainURL.host(), this, SLOT(completedHostnameLookup(const QHostInfo&)));
|
||||
if (domainURL.scheme() == URL_SCHEME_HIFI) {
|
||||
// re-set the sock addr to null and fire off a lookup of the IP address for this domain-server's hostname
|
||||
qCDebug(networking, "Looking up DS hostname %s.", domainURL.host().toLocal8Bit().constData());
|
||||
QHostInfo::lookupHost(domainURL.host(), this, SLOT(completedHostnameLookup(const QHostInfo&)));
|
||||
}
|
||||
|
||||
DependencyManager::get<NodeList>()->flagTimeForConnectionStep(
|
||||
LimitedNodeList::ConnectionStep::SetDomainHostname);
|
||||
|
@ -250,6 +250,17 @@ void DomainHandler::activateICEPublicSocket() {
|
|||
emit completedSocketDiscovery();
|
||||
}
|
||||
|
||||
QString DomainHandler::getViewPointFromNamedPath(QString namedPath) {
|
||||
auto lookup = _namedPaths.find(namedPath);
|
||||
if (lookup != _namedPaths.end()) {
|
||||
return lookup->second;
|
||||
}
|
||||
if (namedPath == DEFAULT_NAMED_PATH) {
|
||||
return DOMAIN_SPAWNING_POINT;
|
||||
}
|
||||
return "";
|
||||
}
|
||||
|
||||
void DomainHandler::completedHostnameLookup(const QHostInfo& hostInfo) {
|
||||
for (int i = 0; i < hostInfo.addresses().size(); i++) {
|
||||
if (hostInfo.addresses()[i].protocol() == QAbstractSocket::IPv4Protocol) {
|
||||
|
@ -297,6 +308,11 @@ void DomainHandler::setIsConnected(bool isConnected) {
|
|||
}
|
||||
}
|
||||
|
||||
void DomainHandler::connectedToServerless(std::map<QString, QString> namedPaths) {
|
||||
_namedPaths = namedPaths;
|
||||
setIsConnected(true);
|
||||
}
|
||||
|
||||
void DomainHandler::requestDomainSettings() {
|
||||
qCDebug(networking) << "Requesting settings from domain server";
|
||||
|
||||
|
|
|
@ -76,6 +76,10 @@ public:
|
|||
void setIsConnected(bool isConnected);
|
||||
bool isServerless() const { return _domainURL.scheme() != URL_SCHEME_HIFI; }
|
||||
|
||||
void connectedToServerless(std::map<QString, QString> namedPaths);
|
||||
|
||||
QString getViewPointFromNamedPath(QString namedPath);
|
||||
|
||||
bool hasSettings() const { return !_settingsObject.isEmpty(); }
|
||||
void requestDomainSettings();
|
||||
const QJsonObject& getSettingsObject() const { return _settingsObject; }
|
||||
|
@ -200,9 +204,11 @@ private:
|
|||
int _checkInPacketsSinceLastReply { 0 };
|
||||
|
||||
QTimer _apiRefreshTimer;
|
||||
|
||||
std::map<QString, QString> _namedPaths;
|
||||
};
|
||||
|
||||
const QString DOMAIN_SPAWNING_POINT { "/0, -10, 0" };
|
||||
|
||||
const QString DEFAULT_NAMED_PATH { "/" };
|
||||
|
||||
#endif // hifi_DomainHandler_h
|
||||
|
|
|
@ -413,7 +413,16 @@ void NodeList::sendDomainServerCheckIn() {
|
|||
}
|
||||
|
||||
void NodeList::handleDSPathQuery(const QString& newPath) {
|
||||
if (_domainHandler.isSocketKnown()) {
|
||||
if (_domainHandler.isServerless()) {
|
||||
if (_domainHandler.isConnected()) {
|
||||
auto viewpoint = _domainHandler.getViewPointFromNamedPath(newPath);
|
||||
if (!newPath.isEmpty()) {
|
||||
DependencyManager::get<AddressManager>()->goToViewpointForPath(viewpoint, newPath);
|
||||
}
|
||||
} else {
|
||||
_domainHandler.setPendingPath(newPath);
|
||||
}
|
||||
} else if (_domainHandler.isSocketKnown()) {
|
||||
// if we have a DS socket we assume it will get this packet and send if off right away
|
||||
sendDSPathQuery(newPath);
|
||||
} else {
|
||||
|
@ -427,10 +436,17 @@ void NodeList::sendPendingDSPathQuery() {
|
|||
QString pendingPath = _domainHandler.getPendingPath();
|
||||
|
||||
if (!pendingPath.isEmpty()) {
|
||||
qCDebug(networking) << "Attempting to send pending query to DS for path" << pendingPath;
|
||||
|
||||
// this is a slot triggered if we just established a network link with a DS and want to send a path query
|
||||
sendDSPathQuery(_domainHandler.getPendingPath());
|
||||
if (_domainHandler.isServerless()) {
|
||||
auto viewpoint = _domainHandler.getViewPointFromNamedPath(pendingPath);
|
||||
if (!pendingPath.isEmpty()) {
|
||||
DependencyManager::get<AddressManager>()->goToViewpointForPath(viewpoint, pendingPath);
|
||||
}
|
||||
} else {
|
||||
qCDebug(networking) << "Attempting to send pending query to DS for path" << pendingPath;
|
||||
// this is a slot triggered if we just established a network link with a DS and want to send a path query
|
||||
sendDSPathQuery(_domainHandler.getPendingPath());
|
||||
}
|
||||
|
||||
// clear whatever the pending path was
|
||||
_domainHandler.clearPendingPath();
|
||||
|
@ -498,7 +514,7 @@ void NodeList::processDomainServerPathResponse(QSharedPointer<ReceivedMessage> m
|
|||
QString viewpoint = QString::fromUtf8(message->getRawMessage() + message->getPosition(), numViewpointBytes);
|
||||
|
||||
// Hand it off to the AddressManager so it can handle it as a relative viewpoint
|
||||
if (DependencyManager::get<AddressManager>()->goToViewpointForPath(viewpoint, pathQuery)) {
|
||||
if (!pathQuery.isEmpty() && DependencyManager::get<AddressManager>()->goToViewpointForPath(viewpoint, pathQuery)) {
|
||||
qCDebug(networking) << "Going to viewpoint" << viewpoint << "which was the lookup result for path" << pathQuery;
|
||||
} else {
|
||||
qCDebug(networking) << "Could not go to viewpoint" << viewpoint
|
||||
|
|
|
@ -26,7 +26,11 @@ class JitterSampleConfig : public render::Job::Config {
|
|||
Q_PROPERTY(bool stop MEMBER stop NOTIFY dirty)
|
||||
Q_PROPERTY(int index READ getIndex NOTIFY dirty)
|
||||
public:
|
||||
JitterSampleConfig() : render::Job::Config(true) {}
|
||||
JitterSampleConfig() : render::Job::Config(true) {
|
||||
// FIXME: For RC66 disable Taa by default
|
||||
// Disable jitter by default for now by default:
|
||||
none();
|
||||
}
|
||||
|
||||
float scale{ 0.5f };
|
||||
bool stop{ false };
|
||||
|
@ -113,7 +117,10 @@ public:
|
|||
bool feedbackColor{ false };
|
||||
|
||||
float debugX{ 0.0f };
|
||||
float debugFXAAX{ 1.0f };
|
||||
// FIXME: For RC66 disable Taa by default
|
||||
// Fall back to FXAA :(
|
||||
// float debugFXAAX{ 1.0f };
|
||||
float debugFXAAX{ 0.0f };
|
||||
float debugShowVelocityThreshold{ 1.0f };
|
||||
glm::vec2 debugCursorTexcoord{ 0.5f, 0.5f };
|
||||
float debugOrbZoom{ 2.0f };
|
||||
|
|
|
@ -36,7 +36,7 @@ Rectangle {
|
|||
Row {
|
||||
spacing: 10
|
||||
id: fxaaOnOff
|
||||
property bool debugFXAA: false
|
||||
property bool debugFXAA: true
|
||||
HifiControls.Button {
|
||||
text: {
|
||||
if (fxaaOnOff.debugFXAA) {
|
||||
|
|
Loading…
Reference in a new issue