mirror of
https://github.com/overte-org/overte.git
synced 2025-08-09 11:28:03 +02:00
Missed the local light stats.
This commit is contained in:
parent
aa145c8d20
commit
d4904f976a
3 changed files with 5 additions and 51 deletions
|
@ -60,7 +60,6 @@ Avatar::Avatar() :
|
||||||
_mouseRayDirection(0.0f, 0.0f, 0.0f),
|
_mouseRayDirection(0.0f, 0.0f, 0.0f),
|
||||||
_moving(false),
|
_moving(false),
|
||||||
_collisionGroups(0),
|
_collisionGroups(0),
|
||||||
_numLocalLights(0),
|
|
||||||
_initialized(false),
|
_initialized(false),
|
||||||
_shouldRenderBillboard(true)
|
_shouldRenderBillboard(true)
|
||||||
{
|
{
|
||||||
|
@ -916,36 +915,3 @@ void Avatar::setShowDisplayName(bool showDisplayName) {
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void Avatar::setLocalLightDirection(const glm::vec3& direction, int lightIndex) {
|
|
||||||
_localLightDirections[lightIndex] = direction;
|
|
||||||
}
|
|
||||||
|
|
||||||
void Avatar::setLocalLightColor(const glm::vec3& color, int lightIndex) {
|
|
||||||
_localLightColors[lightIndex] = color;
|
|
||||||
}
|
|
||||||
|
|
||||||
void Avatar::addLocalLight() {
|
|
||||||
if (_numLocalLights + 1 <= MAX_LOCAL_LIGHTS) {
|
|
||||||
++_numLocalLights;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
void Avatar::removeLocalLight() {
|
|
||||||
if (_numLocalLights - 1 >= 0) {
|
|
||||||
--_numLocalLights;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
int Avatar::getNumLocalLights() {
|
|
||||||
return _numLocalLights;
|
|
||||||
}
|
|
||||||
|
|
||||||
glm::vec3 Avatar::getLocalLightDirection(int lightIndex) {
|
|
||||||
return _localLightDirections[lightIndex];
|
|
||||||
}
|
|
||||||
|
|
||||||
glm::vec3 Avatar::getLocalLightColor(int lightIndex) {
|
|
||||||
return _localLightColors[lightIndex];
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -159,14 +159,7 @@ public:
|
||||||
|
|
||||||
public slots:
|
public slots:
|
||||||
void updateCollisionGroups();
|
void updateCollisionGroups();
|
||||||
void setLocalLightDirection(const glm::vec3& direction, int lightIndex);
|
|
||||||
void setLocalLightColor(const glm::vec3& color, int lightIndex);
|
|
||||||
void addLocalLight();
|
|
||||||
void removeLocalLight();
|
|
||||||
int getNumLocalLights();
|
|
||||||
glm::vec3 getLocalLightDirection(int lightIndex);
|
|
||||||
glm::vec3 getLocalLightColor(int lightIndex);
|
|
||||||
|
|
||||||
signals:
|
signals:
|
||||||
void collisionWithAvatar(const QUuid& myUUID, const QUuid& theirUUID, const CollisionInfo& collision);
|
void collisionWithAvatar(const QUuid& myUUID, const QUuid& theirUUID, const CollisionInfo& collision);
|
||||||
|
|
||||||
|
@ -189,11 +182,6 @@ protected:
|
||||||
bool _moving; ///< set when position is changing
|
bool _moving; ///< set when position is changing
|
||||||
|
|
||||||
quint32 _collisionGroups;
|
quint32 _collisionGroups;
|
||||||
|
|
||||||
// always-present local lighting for the avatar
|
|
||||||
glm::vec3 _localLightDirections[MAX_LOCAL_LIGHTS];
|
|
||||||
glm::vec3 _localLightColors[MAX_LOCAL_LIGHTS];
|
|
||||||
int _numLocalLights;
|
|
||||||
|
|
||||||
// protected methods...
|
// protected methods...
|
||||||
glm::vec3 getBodyRightDirection() const { return getOrientation() * IDENTITY_RIGHT; }
|
glm::vec3 getBodyRightDirection() const { return getOrientation() * IDENTITY_RIGHT; }
|
||||||
|
|
|
@ -828,19 +828,19 @@ void Stats::display(
|
||||||
}
|
}
|
||||||
|
|
||||||
// draw local light stats
|
// draw local light stats
|
||||||
int numLocalLights = myAvatar->getNumLocalLights();
|
QVector<Model::LocalLight> localLights = Application::getInstance()->getAvatarManager().getLocalLights();
|
||||||
verticalOffset = 400;
|
verticalOffset = 400;
|
||||||
horizontalOffset = 20;
|
horizontalOffset = 20;
|
||||||
|
|
||||||
char buffer[128];
|
char buffer[128];
|
||||||
for (int i = 0; i < numLocalLights; i++) {
|
for (int i = 0; i < localLights.size(); i++) {
|
||||||
glm::vec3 lightDirection = myAvatar->getLocalLightDirection(i);
|
glm::vec3 lightDirection = localLights.at(i).direction;
|
||||||
snprintf(buffer, sizeof(buffer), "Light %d direction (%.2f, %.2f, %.2f)", i, lightDirection.x, lightDirection.y, lightDirection.z);
|
snprintf(buffer, sizeof(buffer), "Light %d direction (%.2f, %.2f, %.2f)", i, lightDirection.x, lightDirection.y, lightDirection.z);
|
||||||
drawText(horizontalOffset, verticalOffset, scale, rotation, font, buffer, color);
|
drawText(horizontalOffset, verticalOffset, scale, rotation, font, buffer, color);
|
||||||
|
|
||||||
verticalOffset += STATS_PELS_PER_LINE;
|
verticalOffset += STATS_PELS_PER_LINE;
|
||||||
|
|
||||||
glm::vec3 lightColor = myAvatar->getLocalLightColor(i);
|
glm::vec3 lightColor = localLights.at(i).color;
|
||||||
snprintf(buffer, sizeof(buffer), "Light %d color (%.2f, %.2f, %.2f)", i, lightColor.x, lightColor.y, lightColor.z);
|
snprintf(buffer, sizeof(buffer), "Light %d color (%.2f, %.2f, %.2f)", i, lightColor.x, lightColor.y, lightColor.z);
|
||||||
drawText(horizontalOffset, verticalOffset, scale, rotation, font, buffer, color);
|
drawText(horizontalOffset, verticalOffset, scale, rotation, font, buffer, color);
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue