mirror of
https://github.com/overte-org/overte.git
synced 2025-04-20 14:03:55 +02:00
Draw local light stats.
This commit is contained in:
parent
90d56bc108
commit
317a08fc60
3 changed files with 32 additions and 0 deletions
|
@ -950,3 +950,12 @@ int Avatar::getNumLocalLights() {
|
|||
return _numLocalLights;
|
||||
}
|
||||
|
||||
glm::vec3 Avatar::getLocalLightDirection(int lightIndex) {
|
||||
return _localLightDirections[lightIndex];
|
||||
}
|
||||
|
||||
glm::vec3 Avatar::getLocalLightColor(int lightIndex) {
|
||||
return _localLightColors[lightIndex];
|
||||
}
|
||||
|
||||
|
||||
|
|
|
@ -164,6 +164,8 @@ public slots:
|
|||
void addLocalLight();
|
||||
void removeLocalLight();
|
||||
int getNumLocalLights();
|
||||
glm::vec3 getLocalLightDirection(int lightIndex);
|
||||
glm::vec3 getLocalLightColor(int lightIndex);
|
||||
|
||||
signals:
|
||||
void collisionWithAvatar(const QUuid& myUUID, const QUuid& theirUUID, const CollisionInfo& collision);
|
||||
|
|
|
@ -812,5 +812,26 @@ void Stats::display(
|
|||
drawText(horizontalOffset, verticalOffset, 0.10f, 0.f, 2.f, reflectionsStatus, color);
|
||||
|
||||
}
|
||||
|
||||
// draw local light stats
|
||||
int numLocalLights = myAvatar->getNumLocalLights();
|
||||
verticalOffset = 400;
|
||||
horizontalOffset = 20;
|
||||
|
||||
char buffer[128];
|
||||
for (int i = 0; i < numLocalLights; i++) {
|
||||
glm::vec3 lightDirection = myAvatar->getLocalLightDirection(i);
|
||||
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);
|
||||
|
||||
verticalOffset += STATS_PELS_PER_LINE;
|
||||
|
||||
glm::vec3 lightColor = myAvatar->getLocalLightColor(i);
|
||||
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);
|
||||
|
||||
verticalOffset += STATS_PELS_PER_LINE;
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue