Merge pull request #1449 from PhilipRosedale/mirror

Mirror
This commit is contained in:
Philip Rosedale 2014-01-03 15:25:28 -08:00
commit 2cf5efc4a8
2 changed files with 10 additions and 4 deletions

View file

@ -81,9 +81,9 @@ const int MIRROR_VIEW_TOP_PADDING = 5;
const int MIRROR_VIEW_LEFT_PADDING = 10;
const int MIRROR_VIEW_WIDTH = 265;
const int MIRROR_VIEW_HEIGHT = 215;
const float MIRROR_FULLSCREEN_DISTANCE = 0.2f;
const float MIRROR_REARVIEW_DISTANCE = 0.3f;
const float MIRROR_REARVIEW_BODY_DISTANCE = 1.f;
const float MIRROR_FULLSCREEN_DISTANCE = 0.35f;
const float MIRROR_REARVIEW_DISTANCE = 0.65f;
const float MIRROR_REARVIEW_BODY_DISTANCE = 2.3f;
void messageHandler(QtMsgType type, const QMessageLogContext& context, const QString &message) {

View file

@ -565,7 +565,13 @@ void MyAvatar::renderBody(bool forceRenderHead) {
} else {
// Render the body's voxels and head
_skeletonModel.render(1.0f);
_head.render(1.0f, false);
// Render head so long as the camera isn't inside it
const float RENDER_HEAD_CUTOFF_DISTANCE = 0.10f;
Camera* myCamera = Application::getInstance()->getCamera();
if (forceRenderHead || (glm::length(myCamera->getPosition() - _head.calculateAverageEyePosition()) > RENDER_HEAD_CUTOFF_DISTANCE)) {
_head.render(1.0f, false);
}
}
_hand.render(true);
}