mirror of
https://github.com/JulianGro/overte.git
synced 2025-08-27 17:45:32 +02:00
leverage existing URL update rate for interim face model update solution
This commit is contained in:
parent
10f29dfe90
commit
233c1599bd
4 changed files with 9 additions and 20 deletions
|
@ -1253,13 +1253,14 @@ void Application::processAvatarURLsMessage(unsigned char* packetData, size_t dat
|
|||
return;
|
||||
}
|
||||
QDataStream in(QByteArray((char*)packetData, dataBytes));
|
||||
QUrl voxelURL, faceURL;
|
||||
QUrl voxelURL;
|
||||
in >> voxelURL;
|
||||
in >> faceURL;
|
||||
|
||||
// invoke the set URL functions on the simulate/render thread
|
||||
QMetaObject::invokeMethod(avatar->getVoxels(), "setVoxelURL", Q_ARG(QUrl, voxelURL));
|
||||
QMetaObject::invokeMethod(&avatar->getHead().getBlendFace(), "setModelURL", Q_ARG(QUrl, faceURL));
|
||||
|
||||
// use this timing to as the data-server for an updated mesh for this avatar (if we have UUID)
|
||||
DataServerClient::getValueForKeyAndUUID(DataServerKey::FaceMeshURL, avatar->getUUID());
|
||||
}
|
||||
|
||||
void Application::processAvatarFaceVideoMessage(unsigned char* packetData, size_t dataBytes) {
|
||||
|
@ -1600,7 +1601,7 @@ void Application::init() {
|
|||
_voxels.init();
|
||||
|
||||
|
||||
Avatar::sendAvatarURLsMessage(_myAvatar.getVoxels()->getVoxelURL(), _myAvatar.getHead().getBlendFace().getModelURL());
|
||||
Avatar::sendAvatarURLsMessage(_myAvatar.getVoxels()->getVoxelURL());
|
||||
|
||||
_palette.init(_glWidget->width(), _glWidget->height());
|
||||
_palette.addAction(Menu::getInstance()->getActionForOption(MenuOption::VoxelAddMode), 0, 0);
|
||||
|
@ -2175,8 +2176,7 @@ void Application::updateAvatar(float deltaTime) {
|
|||
// once in a while, send my urls
|
||||
const float AVATAR_URLS_SEND_INTERVAL = 1.0f; // seconds
|
||||
if (shouldDo(AVATAR_URLS_SEND_INTERVAL, deltaTime)) {
|
||||
Avatar::sendAvatarURLsMessage(_myAvatar.getVoxels()->getVoxelURL(),
|
||||
_myAvatar.getHead().getBlendFace().getModelURL());
|
||||
Avatar::sendAvatarURLsMessage(_myAvatar.getVoxels()->getVoxelURL());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -837,7 +837,7 @@ void Menu::editPreferences() {
|
|||
QUrl avatarVoxelURL(avatarURL->text());
|
||||
applicationInstance->getAvatar()->getVoxels()->setVoxelURL(avatarVoxelURL);
|
||||
|
||||
Avatar::sendAvatarURLsMessage(avatarVoxelURL, faceModelURL);
|
||||
Avatar::sendAvatarURLsMessage(avatarVoxelURL);
|
||||
|
||||
applicationInstance->getAvatar()->getHead().setPupilDilation(pupilDilation->value() / (float)pupilDilation->maximum());
|
||||
|
||||
|
|
|
@ -60,7 +60,7 @@ const int NUM_BODY_CONE_SIDES = 9;
|
|||
const float chatMessageScale = 0.0015;
|
||||
const float chatMessageHeight = 0.20;
|
||||
|
||||
void Avatar::sendAvatarURLsMessage(const QUrl& voxelURL, const QUrl& faceURL) {
|
||||
void Avatar::sendAvatarURLsMessage(const QUrl& voxelURL) {
|
||||
uint16_t ownerID = NodeList::getInstance()->getOwnerID();
|
||||
|
||||
if (ownerID == UNKNOWN_NODE_ID) {
|
||||
|
@ -77,7 +77,6 @@ void Avatar::sendAvatarURLsMessage(const QUrl& voxelURL, const QUrl& faceURL) {
|
|||
|
||||
QDataStream out(&message, QIODevice::WriteOnly | QIODevice::Append);
|
||||
out << voxelURL;
|
||||
out << faceURL;
|
||||
|
||||
Application::controlledBroadcastToNodes((unsigned char*)message.data(), message.size(), &NODE_TYPE_AVATAR_MIXER, 1);
|
||||
}
|
||||
|
@ -426,16 +425,6 @@ void Avatar::setMouseRay(const glm::vec3 &origin, const glm::vec3 &direction) {
|
|||
_mouseRayDirection = direction;
|
||||
}
|
||||
|
||||
void Avatar::setUUID(const QUuid& uuid) {
|
||||
if (uuid != _uuid) {
|
||||
// UUID has changed
|
||||
// ask for the face mesh URL for this avatar, request won't be made if UUID is null
|
||||
DataServerClient::getValueForKeyAndUUID(DataServerKey::FaceMeshURL, _uuid);
|
||||
}
|
||||
|
||||
_uuid = uuid;
|
||||
}
|
||||
|
||||
void Avatar::updateHandMovementAndTouching(float deltaTime, bool enableHandMovement) {
|
||||
|
||||
glm::quat orientation = getOrientation();
|
||||
|
|
|
@ -129,7 +129,7 @@ class Avatar : public AvatarData {
|
|||
Q_OBJECT
|
||||
|
||||
public:
|
||||
static void sendAvatarURLsMessage(const QUrl& voxelURL, const QUrl& faceURL);
|
||||
static void sendAvatarURLsMessage(const QUrl& voxelURL);
|
||||
|
||||
Avatar(Node* owningNode = NULL);
|
||||
~Avatar();
|
||||
|
|
Loading…
Reference in a new issue