mirror of
https://github.com/overte-org/overte.git
synced 2025-04-20 12:04:18 +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),
|
||||
_moving(false),
|
||||
_collisionGroups(0),
|
||||
_numLocalLights(0),
|
||||
_initialized(false),
|
||||
_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:
|
||||
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:
|
||||
void collisionWithAvatar(const QUuid& myUUID, const QUuid& theirUUID, const CollisionInfo& collision);
|
||||
|
||||
|
@ -189,11 +182,6 @@ protected:
|
|||
bool _moving; ///< set when position is changing
|
||||
|
||||
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...
|
||||
glm::vec3 getBodyRightDirection() const { return getOrientation() * IDENTITY_RIGHT; }
|
||||
|
|
|
@ -828,19 +828,19 @@ void Stats::display(
|
|||
}
|
||||
|
||||
// draw local light stats
|
||||
int numLocalLights = myAvatar->getNumLocalLights();
|
||||
QVector<Model::LocalLight> localLights = Application::getInstance()->getAvatarManager().getLocalLights();
|
||||
verticalOffset = 400;
|
||||
horizontalOffset = 20;
|
||||
|
||||
char buffer[128];
|
||||
for (int i = 0; i < numLocalLights; i++) {
|
||||
glm::vec3 lightDirection = myAvatar->getLocalLightDirection(i);
|
||||
for (int i = 0; i < localLights.size(); 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);
|
||||
drawText(horizontalOffset, verticalOffset, scale, rotation, font, buffer, color);
|
||||
|
||||
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);
|
||||
drawText(horizontalOffset, verticalOffset, scale, rotation, font, buffer, color);
|
||||
|
||||
|
|
Loading…
Reference in a new issue