mirror of
https://github.com/overte-org/overte.git
synced 2025-08-08 21:57:00 +02:00
Wired up the send of the display data to the servers
Added the renderDisplayName in Avatar
This commit is contained in:
parent
665971c2ab
commit
319d1f6795
6 changed files with 135 additions and 100 deletions
|
@ -858,7 +858,14 @@ void Menu::editPreferences() {
|
||||||
applicationInstance->getAvatar()->setSkeletonModelURL(skeletonModelURL);
|
applicationInstance->getAvatar()->setSkeletonModelURL(skeletonModelURL);
|
||||||
shouldDispatchIdentityPacket = true;
|
shouldDispatchIdentityPacket = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
QString displayNameStr(displayNameEdit->text());
|
||||||
|
|
||||||
|
if (displayNameStr != displayNameString) {
|
||||||
|
applicationInstance->getAvatar()->setDisplayName(displayNameStr);
|
||||||
|
shouldDispatchIdentityPacket = true;
|
||||||
|
}
|
||||||
|
|
||||||
if (shouldDispatchIdentityPacket) {
|
if (shouldDispatchIdentityPacket) {
|
||||||
applicationInstance->getAvatar()->sendIdentityPacket();
|
applicationInstance->getAvatar()->sendIdentityPacket();
|
||||||
}
|
}
|
||||||
|
|
|
@ -28,6 +28,7 @@
|
||||||
#include "devices/OculusManager.h"
|
#include "devices/OculusManager.h"
|
||||||
#include "ui/TextRenderer.h"
|
#include "ui/TextRenderer.h"
|
||||||
|
|
||||||
|
|
||||||
using namespace std;
|
using namespace std;
|
||||||
|
|
||||||
const glm::vec3 DEFAULT_UP_DIRECTION(0.0f, 1.0f, 0.0f);
|
const glm::vec3 DEFAULT_UP_DIRECTION(0.0f, 1.0f, 0.0f);
|
||||||
|
@ -74,7 +75,8 @@ Avatar::Avatar() :
|
||||||
_mouseRayDirection(0.0f, 0.0f, 0.0f),
|
_mouseRayDirection(0.0f, 0.0f, 0.0f),
|
||||||
_moving(false),
|
_moving(false),
|
||||||
_owningAvatarMixer(),
|
_owningAvatarMixer(),
|
||||||
_initialized(false)
|
_initialized(false),
|
||||||
|
_displayNameWidth(0)
|
||||||
{
|
{
|
||||||
// we may have been created in the network thread, but we live in the main thread
|
// we may have been created in the network thread, but we live in the main thread
|
||||||
moveToThread(Application::getInstance()->thread());
|
moveToThread(Application::getInstance()->thread());
|
||||||
|
@ -82,6 +84,8 @@ Avatar::Avatar() :
|
||||||
// give the pointer to our head to inherited _headData variable from AvatarData
|
// give the pointer to our head to inherited _headData variable from AvatarData
|
||||||
_headData = &_head;
|
_headData = &_head;
|
||||||
_handData = &_hand;
|
_handData = &_hand;
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
Avatar::~Avatar() {
|
Avatar::~Avatar() {
|
||||||
|
@ -145,22 +149,27 @@ void Avatar::setMouseRay(const glm::vec3 &origin, const glm::vec3 &direction) {
|
||||||
_mouseRayDirection = direction;
|
_mouseRayDirection = direction;
|
||||||
}
|
}
|
||||||
|
|
||||||
static TextRenderer* textRenderer() {
|
static TextRenderer* chatTextRenderer() {
|
||||||
static TextRenderer* renderer = new TextRenderer(SANS_FONT_FAMILY, 24, -1, false, TextRenderer::SHADOW_EFFECT);
|
static TextRenderer* renderer = new TextRenderer(SANS_FONT_FAMILY, 24, -1, false, TextRenderer::SHADOW_EFFECT);
|
||||||
return renderer;
|
return renderer;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static TextRenderer* displayNameTextRenderer() {
|
||||||
|
static TextRenderer* renderer = new TextRenderer(SANS_FONT_FAMILY, 12, -1, false, TextRenderer::SHADOW_EFFECT);
|
||||||
|
return renderer;
|
||||||
|
}
|
||||||
|
|
||||||
void Avatar::render(bool forceRenderHead) {
|
void Avatar::render(bool forceRenderHead) {
|
||||||
|
|
||||||
{
|
{
|
||||||
// glow when moving in the distance
|
// glow when moving in the distance
|
||||||
glm::vec3 toTarget = _position - Application::getInstance()->getAvatar()->getPosition();
|
glm::vec3 toTarget = _position - Application::getInstance()->getAvatar()->getPosition();
|
||||||
const float GLOW_DISTANCE = 5.0f;
|
const float GLOW_DISTANCE = 5.0f;
|
||||||
Glower glower(_moving && glm::length(toTarget) > GLOW_DISTANCE ? 1.0f : 0.0f);
|
Glower glower(_moving && glm::length(toTarget) > GLOW_DISTANCE ? 1.0f : 0.0f);
|
||||||
|
|
||||||
// render body
|
// render body
|
||||||
renderBody(forceRenderHead);
|
renderBody(forceRenderHead);
|
||||||
|
|
||||||
// render sphere when far away
|
// render sphere when far away
|
||||||
const float MAX_ANGLE = 10.f;
|
const float MAX_ANGLE = 10.f;
|
||||||
float height = getHeight();
|
float height = getHeight();
|
||||||
|
@ -176,13 +185,15 @@ void Avatar::render(bool forceRenderHead) {
|
||||||
glPopMatrix();
|
glPopMatrix();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// render display name
|
||||||
|
renderDisplayName();
|
||||||
|
|
||||||
if (!_chatMessage.empty()) {
|
if (!_chatMessage.empty()) {
|
||||||
int width = 0;
|
int width = 0;
|
||||||
int lastWidth = 0;
|
int lastWidth = 0;
|
||||||
for (string::iterator it = _chatMessage.begin(); it != _chatMessage.end(); it++) {
|
for (string::iterator it = _chatMessage.begin(); it != _chatMessage.end(); it++) {
|
||||||
width += (lastWidth = textRenderer()->computeWidth(*it));
|
width += (lastWidth = chatTextRenderer()->computeWidth(*it));
|
||||||
}
|
}
|
||||||
glPushMatrix();
|
glPushMatrix();
|
||||||
|
|
||||||
|
@ -201,7 +212,7 @@ void Avatar::render(bool forceRenderHead) {
|
||||||
glDisable(GL_LIGHTING);
|
glDisable(GL_LIGHTING);
|
||||||
glDepthMask(false);
|
glDepthMask(false);
|
||||||
if (_keyState == NO_KEY_DOWN) {
|
if (_keyState == NO_KEY_DOWN) {
|
||||||
textRenderer()->draw(-width / 2.0f, 0, _chatMessage.c_str());
|
chatTextRenderer()->draw(-width / 2.0f, 0, _chatMessage.c_str());
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
// rather than using substr and allocating a new string, just replace the last
|
// rather than using substr and allocating a new string, just replace the last
|
||||||
|
@ -209,10 +220,10 @@ void Avatar::render(bool forceRenderHead) {
|
||||||
int lastIndex = _chatMessage.size() - 1;
|
int lastIndex = _chatMessage.size() - 1;
|
||||||
char lastChar = _chatMessage[lastIndex];
|
char lastChar = _chatMessage[lastIndex];
|
||||||
_chatMessage[lastIndex] = '\0';
|
_chatMessage[lastIndex] = '\0';
|
||||||
textRenderer()->draw(-width / 2.0f, 0, _chatMessage.c_str());
|
chatTextRenderer()->draw(-width / 2.0f, 0, _chatMessage.c_str());
|
||||||
_chatMessage[lastIndex] = lastChar;
|
_chatMessage[lastIndex] = lastChar;
|
||||||
glColor3f(0, 1, 0);
|
glColor3f(0, 1, 0);
|
||||||
textRenderer()->draw(width / 2.0f - lastWidth, 0, _chatMessage.c_str() + lastIndex);
|
chatTextRenderer()->draw(width / 2.0f - lastWidth, 0, _chatMessage.c_str() + lastIndex);
|
||||||
}
|
}
|
||||||
glEnable(GL_LIGHTING);
|
glEnable(GL_LIGHTING);
|
||||||
glDepthMask(true);
|
glDepthMask(true);
|
||||||
|
@ -248,6 +259,77 @@ void Avatar::renderBody(bool forceRenderHead) {
|
||||||
_hand.render(false);
|
_hand.render(false);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void Avatar::renderDisplayName() {
|
||||||
|
|
||||||
|
if (_displayNameStr.isEmpty()) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
glm::vec3 textPosition = _head.getPosition(); //+ glm::vec3(0,50,0);
|
||||||
|
glPushMatrix();
|
||||||
|
glDepthMask(false);
|
||||||
|
|
||||||
|
glm::dmat4 modelViewMatrix2;
|
||||||
|
glGetDoublev(GL_MODELVIEW_MATRIX, (GLdouble*)&modelViewMatrix2);
|
||||||
|
glTranslatef(textPosition.x, textPosition.y, textPosition.z);
|
||||||
|
// Extract rotation matrix from the modelview matrix
|
||||||
|
glm::dmat4 modelViewMatrix;
|
||||||
|
glGetDoublev(GL_MODELVIEW_MATRIX, (GLdouble*)&modelViewMatrix);
|
||||||
|
|
||||||
|
// Delete rotation info
|
||||||
|
modelViewMatrix[0][0] = modelViewMatrix[1][1] = modelViewMatrix[2][2] = 1.0;
|
||||||
|
modelViewMatrix[0][1] = modelViewMatrix[0][2] = 0.0;
|
||||||
|
modelViewMatrix[1][0] = modelViewMatrix[1][2] = 0.0;
|
||||||
|
modelViewMatrix[2][0] = modelViewMatrix[2][1] = 0.0;
|
||||||
|
|
||||||
|
glLoadMatrixd((GLdouble*)&modelViewMatrix); // Override current matrix with our own
|
||||||
|
glScalef(1.0, -1.0, 1.0); // TextRenderer::draw paints the text upside down. This fixes that
|
||||||
|
|
||||||
|
// We need to compute the scale factor such as the text remains with fixed size respect to window coordinates
|
||||||
|
// We project y = 0 and y = 1 and check the difference in projection coordinates
|
||||||
|
GLdouble projectionMatrix[16];
|
||||||
|
GLint viewportMatrix[4];
|
||||||
|
GLdouble result0[3];
|
||||||
|
GLdouble result1[3];
|
||||||
|
|
||||||
|
glm::dvec3 upVector(modelViewMatrix2[1]);
|
||||||
|
glGetDoublev(GL_PROJECTION_MATRIX, (GLdouble*)&projectionMatrix);
|
||||||
|
glGetIntegerv(GL_VIEWPORT, viewportMatrix);
|
||||||
|
|
||||||
|
glm::dvec3 testPoint0 = glm::dvec3(textPosition);
|
||||||
|
glm::dvec3 testPoint1 = glm::dvec3(textPosition) + upVector;
|
||||||
|
|
||||||
|
bool success;
|
||||||
|
success = gluProject(testPoint0.x, testPoint0.y, testPoint0.z,
|
||||||
|
(GLdouble*)&modelViewMatrix2, projectionMatrix, viewportMatrix,
|
||||||
|
&result0[0], &result0[1], &result0[2]);
|
||||||
|
success = success &&
|
||||||
|
gluProject(testPoint1.x, testPoint1.y, testPoint1.z,
|
||||||
|
(GLdouble*)&modelViewMatrix2, projectionMatrix, viewportMatrix,
|
||||||
|
&result1[0], &result1[1], &result1[2]);
|
||||||
|
|
||||||
|
if (success) {
|
||||||
|
double textWindowHeight = abs(result1[1] - result0[1]);
|
||||||
|
float textScale = 1.0;
|
||||||
|
float scaleFactor = 1.0;
|
||||||
|
if (textWindowHeight > EPSILON) {
|
||||||
|
scaleFactor = textScale / textWindowHeight;
|
||||||
|
}
|
||||||
|
|
||||||
|
glScalef(scaleFactor, scaleFactor, 1.0);
|
||||||
|
|
||||||
|
glColor3f(0.93, 0.93, 0.93);
|
||||||
|
|
||||||
|
// TextRenderer, based on QT opengl text rendering functions
|
||||||
|
|
||||||
|
QByteArray ba = _displayNameStr.toLocal8Bit();
|
||||||
|
const char *text = ba.data();
|
||||||
|
displayNameTextRenderer()->draw(-_displayNameWidth/2.0, 0, text);
|
||||||
|
}
|
||||||
|
glDepthMask(true);
|
||||||
|
glPopMatrix();
|
||||||
|
}
|
||||||
|
|
||||||
bool Avatar::findRayIntersection(const glm::vec3& origin, const glm::vec3& direction, float& distance) const {
|
bool Avatar::findRayIntersection(const glm::vec3& origin, const glm::vec3& direction, float& distance) const {
|
||||||
float minDistance = FLT_MAX;
|
float minDistance = FLT_MAX;
|
||||||
float modelDistance;
|
float modelDistance;
|
||||||
|
@ -346,6 +428,15 @@ void Avatar::setSkeletonModelURL(const QUrl &skeletonModelURL) {
|
||||||
_skeletonModel.setURL(skeletonModelURL);
|
_skeletonModel.setURL(skeletonModelURL);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void Avatar::setDisplayName(const QString& displayName) {
|
||||||
|
AvatarData::setDisplayNameStr(displayName);
|
||||||
|
int width = 0;
|
||||||
|
for (int i = 0; i < displayName.size(); i++) {
|
||||||
|
width += (displayNameTextRenderer()->computeWidth(displayName[i].toLatin1()));
|
||||||
|
}
|
||||||
|
_displayNameWidth = width;
|
||||||
|
}
|
||||||
|
|
||||||
int Avatar::parseData(const QByteArray& packet) {
|
int Avatar::parseData(const QByteArray& packet) {
|
||||||
// change in position implies movement
|
// change in position implies movement
|
||||||
glm::vec3 oldPosition = _position;
|
glm::vec3 oldPosition = _position;
|
||||||
|
|
|
@ -21,6 +21,7 @@
|
||||||
#include "SkeletonModel.h"
|
#include "SkeletonModel.h"
|
||||||
#include "world.h"
|
#include "world.h"
|
||||||
|
|
||||||
|
|
||||||
static const float SCALING_RATIO = .05f;
|
static const float SCALING_RATIO = .05f;
|
||||||
static const float SMOOTHING_RATIO = .05f; // 0 < ratio < 1
|
static const float SMOOTHING_RATIO = .05f; // 0 < ratio < 1
|
||||||
static const float RESCALING_TOLERANCE = .02f;
|
static const float RESCALING_TOLERANCE = .02f;
|
||||||
|
@ -114,6 +115,7 @@ public:
|
||||||
|
|
||||||
virtual void setFaceModelURL(const QUrl& faceModelURL);
|
virtual void setFaceModelURL(const QUrl& faceModelURL);
|
||||||
virtual void setSkeletonModelURL(const QUrl& skeletonModelURL);
|
virtual void setSkeletonModelURL(const QUrl& skeletonModelURL);
|
||||||
|
virtual void setDisplayName(const QString& displayName);
|
||||||
|
|
||||||
int parseData(const QByteArray& packet);
|
int parseData(const QByteArray& packet);
|
||||||
|
|
||||||
|
@ -152,7 +154,13 @@ private:
|
||||||
|
|
||||||
bool _initialized;
|
bool _initialized;
|
||||||
|
|
||||||
|
int _displayNameWidth;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
void renderBody(bool forceRenderHead);
|
void renderBody(bool forceRenderHead);
|
||||||
|
|
||||||
|
void renderDisplayName();
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
|
@ -75,93 +75,7 @@ void AvatarManager::renderAvatars(bool forceRenderHead, bool selfAvatarOnly) {
|
||||||
"Application::renderAvatars()");
|
"Application::renderAvatars()");
|
||||||
bool renderLookAtVectors = Menu::getInstance()->isOptionChecked(MenuOption::LookAtVectors);
|
bool renderLookAtVectors = Menu::getInstance()->isOptionChecked(MenuOption::LookAtVectors);
|
||||||
|
|
||||||
// -------------------------------------------------------------------------------------
|
|
||||||
// Josecpujol(begin): test code, as I dont seem to get any avatar. Render some text here
|
|
||||||
// -------------------------------------------------------------------------------------
|
|
||||||
glm::dvec3 textPosition(100.0, 50.0, 100.0);
|
|
||||||
std::string text("my string");
|
|
||||||
|
|
||||||
// Draw a fake avatar
|
|
||||||
glPushMatrix();
|
|
||||||
glColor3f(1.0,0,0);
|
|
||||||
double radius = 10.0;
|
|
||||||
glTranslated(textPosition.x, textPosition.y - 2 * radius, textPosition.z);
|
|
||||||
glutSolidSphere(radius, 10, 10);
|
|
||||||
glPopMatrix();
|
|
||||||
|
|
||||||
// Draw a mark where the text should be
|
|
||||||
glPushMatrix();
|
|
||||||
glColor3f(1.0,1.0,0);
|
|
||||||
glTranslated(textPosition.x, textPosition.y, textPosition.z);
|
|
||||||
glutSolidSphere(1.0, 10, 10);
|
|
||||||
glPopMatrix();
|
|
||||||
|
|
||||||
glPushMatrix();
|
|
||||||
glm::dmat4 modelViewMatrix2;
|
|
||||||
glGetDoublev(GL_MODELVIEW_MATRIX, (GLdouble*)&modelViewMatrix2);
|
|
||||||
glTranslated(textPosition.x, textPosition.y, textPosition.z);
|
|
||||||
// Extract rotation matrix from the modelview matrix
|
|
||||||
glm::dmat4 modelViewMatrix;
|
|
||||||
glGetDoublev(GL_MODELVIEW_MATRIX, (GLdouble*)&modelViewMatrix);
|
|
||||||
|
|
||||||
// Delete rotation info
|
|
||||||
modelViewMatrix[0][0] = modelViewMatrix[1][1] = modelViewMatrix[2][2] = 1.0;
|
|
||||||
modelViewMatrix[0][1] = modelViewMatrix[0][2] = 0.0;
|
|
||||||
modelViewMatrix[1][0] = modelViewMatrix[1][2] = 0.0;
|
|
||||||
modelViewMatrix[2][0] = modelViewMatrix[2][1] = 0.0;
|
|
||||||
|
|
||||||
glLoadMatrixd((GLdouble*)&modelViewMatrix); // Override current matrix with our own
|
|
||||||
glScalef(1.0, -1.0, 1.0); // TextRenderer::draw paints the text upside down. This fixes that
|
|
||||||
|
|
||||||
// We need to compute the scale factor such as the text remains with fixed size respect to window coordinates
|
|
||||||
// We project y = 0 and y = 1 and check the difference in projection coordinates
|
|
||||||
GLdouble projectionMatrix[16];
|
|
||||||
GLint viewportMatrix[4];
|
|
||||||
GLdouble result0[3];
|
|
||||||
GLdouble result1[3];
|
|
||||||
|
|
||||||
glm::dvec3 upVector(modelViewMatrix2[1]);
|
|
||||||
glGetDoublev(GL_PROJECTION_MATRIX, (GLdouble*)&projectionMatrix);
|
|
||||||
glGetIntegerv(GL_VIEWPORT, viewportMatrix);
|
|
||||||
|
|
||||||
glm::dvec3 testPoint0 = textPosition;
|
|
||||||
glm::dvec3 testPoint1 = textPosition + upVector;
|
|
||||||
|
|
||||||
bool success;
|
|
||||||
success = gluProject(testPoint0.x, testPoint0.y, testPoint0.z,
|
|
||||||
(GLdouble*)&modelViewMatrix2, projectionMatrix, viewportMatrix,
|
|
||||||
&result0[0], &result0[1], &result0[2]);
|
|
||||||
success = success &&
|
|
||||||
gluProject(testPoint1.x, testPoint1.y, testPoint1.z,
|
|
||||||
(GLdouble*)&modelViewMatrix2, projectionMatrix, viewportMatrix,
|
|
||||||
&result1[0], &result1[1], &result1[2]);
|
|
||||||
|
|
||||||
if (success) {
|
|
||||||
double textWindowHeight = abs(result1[1] - result0[1]);
|
|
||||||
float textScale = 1.0;
|
|
||||||
float scaleFactor = textScale / textWindowHeight;
|
|
||||||
|
|
||||||
glScalef(scaleFactor, scaleFactor, 1.0);
|
|
||||||
|
|
||||||
glColor3f(0.93, 0.93, 0.93);
|
|
||||||
|
|
||||||
// TextRenderer, based on QT opengl text rendering functions
|
|
||||||
TextRenderer* textRenderer = new TextRenderer(SANS_FONT_FAMILY, 12, -1, false, TextRenderer::NO_EFFECT);
|
|
||||||
int width = 0;
|
|
||||||
for (std::string::iterator it = text.begin(); it != text.end(); it++) {
|
|
||||||
width += (textRenderer->computeWidth(*it));
|
|
||||||
}
|
|
||||||
textRenderer->draw(-width/2.0, 0, text.c_str());
|
|
||||||
delete textRenderer;
|
|
||||||
}
|
|
||||||
|
|
||||||
glPopMatrix();
|
|
||||||
|
|
||||||
// -------------------------------------------------------------------------------------
|
|
||||||
// josecpujol(end)
|
|
||||||
// -------------------------------------------------------------------------------------
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
if (!selfAvatarOnly) {
|
if (!selfAvatarOnly) {
|
||||||
foreach (const AvatarSharedPointer& avatarPointer, _avatarHash) {
|
foreach (const AvatarSharedPointer& avatarPointer, _avatarHash) {
|
||||||
|
|
|
@ -274,7 +274,8 @@ bool AvatarData::hasIdentityChangedAfterParsing(const QByteArray &packet) {
|
||||||
|
|
||||||
QUuid avatarUUID;
|
QUuid avatarUUID;
|
||||||
QUrl faceModelURL, skeletonModelURL;
|
QUrl faceModelURL, skeletonModelURL;
|
||||||
packetStream >> avatarUUID >> faceModelURL >> skeletonModelURL;
|
QString displayNameStr;
|
||||||
|
packetStream >> avatarUUID >> faceModelURL >> skeletonModelURL >> displayNameStr;
|
||||||
|
|
||||||
bool hasIdentityChanged = false;
|
bool hasIdentityChanged = false;
|
||||||
|
|
||||||
|
@ -287,7 +288,12 @@ bool AvatarData::hasIdentityChangedAfterParsing(const QByteArray &packet) {
|
||||||
setSkeletonModelURL(skeletonModelURL);
|
setSkeletonModelURL(skeletonModelURL);
|
||||||
hasIdentityChanged = true;
|
hasIdentityChanged = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (displayNameStr != _displayNameStr) {
|
||||||
|
setDisplayNameStr(displayNameStr);
|
||||||
|
hasIdentityChanged = true;
|
||||||
|
}
|
||||||
|
|
||||||
return hasIdentityChanged;
|
return hasIdentityChanged;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -295,7 +301,7 @@ QByteArray AvatarData::identityByteArray() {
|
||||||
QByteArray identityData;
|
QByteArray identityData;
|
||||||
QDataStream identityStream(&identityData, QIODevice::Append);
|
QDataStream identityStream(&identityData, QIODevice::Append);
|
||||||
|
|
||||||
identityStream << QUuid() << _faceModelURL << _skeletonModelURL;
|
identityStream << QUuid() << _faceModelURL << _skeletonModelURL << _displayNameStr;
|
||||||
|
|
||||||
return identityData;
|
return identityData;
|
||||||
}
|
}
|
||||||
|
@ -310,6 +316,12 @@ void AvatarData::setSkeletonModelURL(const QUrl& skeletonModelURL) {
|
||||||
_skeletonModelURL = skeletonModelURL;
|
_skeletonModelURL = skeletonModelURL;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void AvatarData::setDisplayNameStr(const QString& displayName) {
|
||||||
|
qDebug() << "Changing display name for avatar to" << displayName;
|
||||||
|
_displayNameStr = displayName;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
void AvatarData::setClampedTargetScale(float targetScale) {
|
void AvatarData::setClampedTargetScale(float targetScale) {
|
||||||
|
|
||||||
targetScale = glm::clamp(targetScale, MIN_AVATAR_SCALE, MAX_AVATAR_SCALE);
|
targetScale = glm::clamp(targetScale, MIN_AVATAR_SCALE, MAX_AVATAR_SCALE);
|
||||||
|
|
|
@ -149,8 +149,10 @@ public:
|
||||||
|
|
||||||
const QUrl& getFaceModelURL() const { return _faceModelURL; }
|
const QUrl& getFaceModelURL() const { return _faceModelURL; }
|
||||||
const QUrl& getSkeletonModelURL() const { return _skeletonModelURL; }
|
const QUrl& getSkeletonModelURL() const { return _skeletonModelURL; }
|
||||||
|
const QString& getDisplayNameStr() const { return _displayNameStr; }
|
||||||
virtual void setFaceModelURL(const QUrl& faceModelURL);
|
virtual void setFaceModelURL(const QUrl& faceModelURL);
|
||||||
virtual void setSkeletonModelURL(const QUrl& skeletonModelURL);
|
virtual void setSkeletonModelURL(const QUrl& skeletonModelURL);
|
||||||
|
virtual void setDisplayNameStr(const QString& displayName);
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
glm::vec3 _position;
|
glm::vec3 _position;
|
||||||
|
@ -180,6 +182,7 @@ protected:
|
||||||
|
|
||||||
QUrl _faceModelURL;
|
QUrl _faceModelURL;
|
||||||
QUrl _skeletonModelURL;
|
QUrl _skeletonModelURL;
|
||||||
|
QString _displayNameStr;
|
||||||
private:
|
private:
|
||||||
// privatize the copy constructor and assignment operator so they cannot be called
|
// privatize the copy constructor and assignment operator so they cannot be called
|
||||||
AvatarData(const AvatarData&);
|
AvatarData(const AvatarData&);
|
||||||
|
|
Loading…
Reference in a new issue