mirror of
https://github.com/overte-org/overte.git
synced 2025-08-09 08:21:24 +02:00
Make the surrounding spheres glow when moving, too.
This commit is contained in:
parent
e67aee4b74
commit
3dfefefeae
1 changed files with 19 additions and 17 deletions
|
@ -486,22 +486,27 @@ void Avatar::render(bool lookingInMirror, bool renderAvatarBalls) {
|
||||||
// render a simple round on the ground projected down from the avatar's position
|
// render a simple round on the ground projected down from the avatar's position
|
||||||
renderDiskShadow(_position, glm::vec3(0.0f, 1.0f, 0.0f), _scale * 0.1f, 0.2f);
|
renderDiskShadow(_position, glm::vec3(0.0f, 1.0f, 0.0f), _scale * 0.1f, 0.2f);
|
||||||
|
|
||||||
// render body
|
{
|
||||||
renderBody(lookingInMirror, renderAvatarBalls);
|
// glow when moving
|
||||||
|
Glower glower(_moving ? 1.0f : 0.0f);
|
||||||
|
|
||||||
|
// render body
|
||||||
|
renderBody(lookingInMirror, renderAvatarBalls);
|
||||||
|
|
||||||
// render sphere when far away
|
// render sphere when far away
|
||||||
const float MAX_ANGLE = 10.f;
|
const float MAX_ANGLE = 10.f;
|
||||||
glm::vec3 toTarget = _position - Application::getInstance()->getAvatar()->getPosition();
|
glm::vec3 toTarget = _position - Application::getInstance()->getAvatar()->getPosition();
|
||||||
glm::vec3 delta = _height * (_head.getCameraOrientation() * IDENTITY_UP) / 2.f;
|
glm::vec3 delta = _height * (_head.getCameraOrientation() * IDENTITY_UP) / 2.f;
|
||||||
float angle = abs(angleBetween(toTarget + delta, toTarget - delta));
|
float angle = abs(angleBetween(toTarget + delta, toTarget - delta));
|
||||||
|
|
||||||
if (angle < MAX_ANGLE) {
|
if (angle < MAX_ANGLE) {
|
||||||
glColor4f(0.5f, 0.8f, 0.8f, 1.f - angle / MAX_ANGLE);
|
glColor4f(0.5f, 0.8f, 0.8f, 1.f - angle / MAX_ANGLE);
|
||||||
glPushMatrix();
|
glPushMatrix();
|
||||||
glTranslatef(_position.x, _position.y, _position.z);
|
glTranslatef(_position.x, _position.y, _position.z);
|
||||||
glScalef(_height / 2.f, _height / 2.f, _height / 2.f);
|
glScalef(_height / 2.f, _height / 2.f, _height / 2.f);
|
||||||
glutSolidSphere(1.2f + _head.getAverageLoudness() * .0005f, 20, 20);
|
glutSolidSphere(1.2f + _head.getAverageLoudness() * .0005f, 20, 20);
|
||||||
glPopMatrix();
|
glPopMatrix();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// Render the balls
|
// Render the balls
|
||||||
|
@ -697,9 +702,6 @@ float Avatar::getBallRenderAlpha(int ball, bool lookingInMirror) const {
|
||||||
|
|
||||||
void Avatar::renderBody(bool lookingInMirror, bool renderAvatarBalls) {
|
void Avatar::renderBody(bool lookingInMirror, bool renderAvatarBalls) {
|
||||||
|
|
||||||
// glow when moving
|
|
||||||
Glower glower(_moving ? 1.0f : 0.0f);
|
|
||||||
|
|
||||||
if (_head.getFace().isFullFrame()) {
|
if (_head.getFace().isFullFrame()) {
|
||||||
// Render the full-frame video
|
// Render the full-frame video
|
||||||
float alpha = getBallRenderAlpha(BODY_BALL_HEAD_BASE, lookingInMirror);
|
float alpha = getBallRenderAlpha(BODY_BALL_HEAD_BASE, lookingInMirror);
|
||||||
|
|
Loading…
Reference in a new issue