mirror of
https://github.com/overte-org/overte.git
synced 2025-08-06 18:50:00 +02:00
Merge pull request #3504 from ey6es/master
Don't bother using a callback to render the eye vectors; just rely on th...
This commit is contained in:
commit
c4be35fa8a
4 changed files with 31 additions and 38 deletions
|
@ -520,20 +520,18 @@ void Avatar::renderBody(RenderMode renderMode, bool postLighting, float glowLeve
|
||||||
renderAttachments(renderMode);
|
renderAttachments(renderMode);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (!postLighting) {
|
getHead()->render(1.0f, modelRenderMode, postLighting);
|
||||||
getHead()->render(1.0f, modelRenderMode);
|
|
||||||
|
|
||||||
if (Menu::getInstance()->isOptionChecked(MenuOption::StringHair)) {
|
if (!postLighting && Menu::getInstance()->isOptionChecked(MenuOption::StringHair)) {
|
||||||
// Render Hair
|
// Render Hair
|
||||||
glPushMatrix();
|
glPushMatrix();
|
||||||
glm::vec3 headPosition = getHead()->getPosition();
|
glm::vec3 headPosition = getHead()->getPosition();
|
||||||
glTranslatef(headPosition.x, headPosition.y, headPosition.z);
|
glTranslatef(headPosition.x, headPosition.y, headPosition.z);
|
||||||
const glm::quat& rotation = getHead()->getFinalOrientationInWorldFrame();
|
const glm::quat& rotation = getHead()->getFinalOrientationInWorldFrame();
|
||||||
glm::vec3 axis = glm::axis(rotation);
|
glm::vec3 axis = glm::axis(rotation);
|
||||||
glRotatef(glm::degrees(glm::angle(rotation)), axis.x, axis.y, axis.z);
|
glRotatef(glm::degrees(glm::angle(rotation)), axis.x, axis.y, axis.z);
|
||||||
_hair.render();
|
_hair.render();
|
||||||
glPopMatrix();
|
glPopMatrix();
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -211,17 +211,16 @@ void Head::relaxLean(float deltaTime) {
|
||||||
_deltaLeanForward *= relaxationFactor;
|
_deltaLeanForward *= relaxationFactor;
|
||||||
}
|
}
|
||||||
|
|
||||||
void Head::render(float alpha, Model::RenderMode mode) {
|
void Head::render(float alpha, Model::RenderMode mode, bool postLighting) {
|
||||||
_faceModel.render(alpha, mode);
|
if (postLighting) {
|
||||||
if (_renderLookatVectors && mode != Model::SHADOW_RENDER_MODE) {
|
if (_renderLookatVectors) {
|
||||||
Application::getInstance()->getDeferredLightingEffect()->addPostLightingRenderable(this);
|
renderLookatVectors(_leftEyePosition, _rightEyePosition, getCorrectedLookAtPosition());
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
_faceModel.render(alpha, mode);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void Head::renderPostLighting() {
|
|
||||||
renderLookatVectors(_leftEyePosition, _rightEyePosition, getCorrectedLookAtPosition());
|
|
||||||
}
|
|
||||||
|
|
||||||
void Head::setScale (float scale) {
|
void Head::setScale (float scale) {
|
||||||
if (_scale == scale) {
|
if (_scale == scale) {
|
||||||
return;
|
return;
|
||||||
|
|
|
@ -23,7 +23,6 @@
|
||||||
#include "FaceModel.h"
|
#include "FaceModel.h"
|
||||||
#include "InterfaceConfig.h"
|
#include "InterfaceConfig.h"
|
||||||
#include "world.h"
|
#include "world.h"
|
||||||
#include "renderer/DeferredLightingEffect.h"
|
|
||||||
|
|
||||||
enum eyeContactTargets {
|
enum eyeContactTargets {
|
||||||
LEFT_EYE,
|
LEFT_EYE,
|
||||||
|
@ -36,15 +35,14 @@ const float EYE_EAR_GAP = 0.08f;
|
||||||
class Avatar;
|
class Avatar;
|
||||||
class ProgramObject;
|
class ProgramObject;
|
||||||
|
|
||||||
class Head : public HeadData, public PostLightingRenderable {
|
class Head : public HeadData {
|
||||||
public:
|
public:
|
||||||
Head(Avatar* owningAvatar);
|
Head(Avatar* owningAvatar);
|
||||||
|
|
||||||
void init();
|
void init();
|
||||||
void reset();
|
void reset();
|
||||||
void simulate(float deltaTime, bool isMine, bool billboard = false);
|
void simulate(float deltaTime, bool isMine, bool billboard = false);
|
||||||
void render(float alpha, Model::RenderMode mode);
|
void render(float alpha, Model::RenderMode mode, bool postLighting);
|
||||||
virtual void renderPostLighting();
|
|
||||||
void setScale(float scale);
|
void setScale(float scale);
|
||||||
void setPosition(glm::vec3 position) { _position = position; }
|
void setPosition(glm::vec3 position) { _position = position; }
|
||||||
void setAverageLoudness(float averageLoudness) { _averageLoudness = averageLoudness; }
|
void setAverageLoudness(float averageLoudness) { _averageLoudness = averageLoudness; }
|
||||||
|
|
|
@ -1147,20 +1147,18 @@ void MyAvatar::renderBody(RenderMode renderMode, bool postLighting, float glowLe
|
||||||
const Camera *camera = Application::getInstance()->getCamera();
|
const Camera *camera = Application::getInstance()->getCamera();
|
||||||
const glm::vec3 cameraPos = camera->getPosition() + (camera->getRotation() * glm::vec3(0.0f, 0.0f, 1.0f)) * camera->getDistance();
|
const glm::vec3 cameraPos = camera->getPosition() + (camera->getRotation() * glm::vec3(0.0f, 0.0f, 1.0f)) * camera->getDistance();
|
||||||
if (shouldRenderHead(cameraPos, renderMode)) {
|
if (shouldRenderHead(cameraPos, renderMode)) {
|
||||||
if (!postLighting) {
|
getHead()->render(1.0f, modelRenderMode, postLighting);
|
||||||
getHead()->render(1.0f, modelRenderMode);
|
|
||||||
|
|
||||||
if (Menu::getInstance()->isOptionChecked(MenuOption::StringHair)) {
|
if (!postLighting && Menu::getInstance()->isOptionChecked(MenuOption::StringHair)) {
|
||||||
// Render Hair
|
// Render Hair
|
||||||
glPushMatrix();
|
glPushMatrix();
|
||||||
glm::vec3 headPosition = getHead()->getPosition();
|
glm::vec3 headPosition = getHead()->getPosition();
|
||||||
glTranslatef(headPosition.x, headPosition.y, headPosition.z);
|
glTranslatef(headPosition.x, headPosition.y, headPosition.z);
|
||||||
const glm::quat& rotation = getHead()->getFinalOrientationInWorldFrame();
|
const glm::quat& rotation = getHead()->getFinalOrientationInWorldFrame();
|
||||||
glm::vec3 axis = glm::axis(rotation);
|
glm::vec3 axis = glm::axis(rotation);
|
||||||
glRotatef(glm::degrees(glm::angle(rotation)), axis.x, axis.y, axis.z);
|
glRotatef(glm::degrees(glm::angle(rotation)), axis.x, axis.y, axis.z);
|
||||||
_hair.render();
|
_hair.render();
|
||||||
glPopMatrix();
|
glPopMatrix();
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (postLighting) {
|
if (postLighting) {
|
||||||
|
|
Loading…
Reference in a new issue