Merge remote-tracking branch 'upstream/master' into synthesis

This commit is contained in:
Stephen Birarda 2013-06-05 18:26:12 -07:00
commit 30d6c7f68a
5 changed files with 17 additions and 9 deletions

View file

@ -1386,7 +1386,7 @@ void Application::initMenu() {
optionsMenu->addAction("Noise", this, SLOT(setNoise(bool)), Qt::Key_N)->setCheckable(true);
(_gyroLook = optionsMenu->addAction("Gyro Look"))->setCheckable(true);
_gyroLook->setChecked(true);
_gyroLook->setChecked(false);
(_mouseLook = optionsMenu->addAction("Mouse Look"))->setCheckable(true);
_mouseLook->setChecked(false);
(_showHeadMouse = optionsMenu->addAction("Head Mouse"))->setCheckable(true);
@ -1409,6 +1409,8 @@ void Application::initMenu() {
_renderAtmosphereOn->setShortcut(Qt::SHIFT | Qt::Key_A);
(_renderAvatarsOn = renderMenu->addAction("Avatars"))->setCheckable(true);
_renderAvatarsOn->setChecked(true);
(_renderAvatarBalls = renderMenu->addAction("Avatar as Balls"))->setCheckable(true);
_renderAvatarBalls->setChecked(false);
(_renderFrameTimerOn = renderMenu->addAction("Show Timer"))->setCheckable(true);
_renderFrameTimerOn->setChecked(false);
(_renderLookatOn = renderMenu->addAction("Lookat Vectors"))->setCheckable(true);
@ -1965,13 +1967,13 @@ void Application::displaySide(Camera& whichCamera) {
if (!avatar->isInitialized()) {
avatar->init();
}
avatar->render(false);
avatar->render(false, _renderAvatarBalls->isChecked());
}
}
agentList->unlock();
// Render my own Avatar
_myAvatar.render(_lookingInMirror->isChecked());
_myAvatar.render(_lookingInMirror->isChecked(), _renderAvatarBalls->isChecked());
_myAvatar.setDisplayingLookatVectors(_renderLookatOn->isChecked());
}

View file

@ -172,6 +172,7 @@ private:
QAction* _lookingInMirror; // Are we currently rendering one's own head as if in mirror?
QAction* _echoAudioMode; // Are we asking the mixer to echo back our audio?
QAction* _gyroLook; // Whether to allow the gyro data from head to move your view
QAction* _renderAvatarBalls; // Switch between voxels and joints/balls for avatar render
QAction* _mouseLook; // Whether the have the mouse near edge of screen move your view
QAction* _showHeadMouse; // Whether the have the mouse near edge of screen move your view
QAction* _transmitterDrives; // Whether to have Transmitter data move/steer the Avatar

View file

@ -927,7 +927,7 @@ void Avatar::setGravity(glm::vec3 gravity) {
}
}
void Avatar::render(bool lookingInMirror) {
void Avatar::render(bool lookingInMirror, bool renderAvatarBalls) {
_cameraPosition = Application::getInstance()->getCamera()->getPosition();
@ -945,7 +945,7 @@ void Avatar::render(bool lookingInMirror) {
renderDiskShadow(_position, glm::vec3(0.0f, 1.0f, 0.0f), 0.1f, 0.2f);
// render body
renderBody(lookingInMirror);
renderBody(lookingInMirror, renderAvatarBalls);
// if this is my avatar, then render my interactions with the other avatar
if (!_owningAgent) {
@ -1141,7 +1141,7 @@ glm::quat Avatar::computeRotationFromBodyToWorldUp(float proportion) const {
return glm::angleAxis(angle * proportion, axis);
}
void Avatar::renderBody(bool lookingInMirror) {
void Avatar::renderBody(bool lookingInMirror, bool renderAvatarBalls) {
const float RENDER_OPAQUE_BEYOND = 1.0f; // Meters beyond which body is shown opaque
const float RENDER_TRANSLUCENT_BEYOND = 0.5f;
@ -1217,6 +1217,9 @@ void Avatar::renderBody(bool lookingInMirror) {
}
}
}
} else {
// Render the body's voxels
_voxels.render(false);
}
}

View file

@ -88,7 +88,7 @@ public:
void updateHeadFromGyros(float frametime, SerialInterface * serialInterface);
void updateFromMouse(int mouseX, int mouseY, int screenWidth, int screenHeight);
void addBodyYaw(float y) {_bodyYaw += y;};
void render(bool lookingInMirror);
void render(bool lookingInMirror, bool renderAvatarBalls);
//setters
void setMousePressed (bool mousePressed ) { _mousePressed = mousePressed;}
@ -202,7 +202,7 @@ private:
// private methods...
glm::vec3 caclulateAverageEyePosition() { return _head.caclulateAverageEyePosition(); } // get the position smack-dab between the eyes (for lookat)
glm::quat computeRotationFromBodyToWorldUp(float proportion = 1.0f) const;
void renderBody(bool lookingInMirror);
void renderBody(bool lookingInMirror, bool renderAvatarBalls);
void initializeBodyBalls();
void resetBodyBalls();
void updateBodyBalls( float deltaTime );
@ -216,7 +216,6 @@ private:
void updateCollisionWithVoxels();
void applyCollisionWithScene(const glm::vec3& penetration);
void applyCollisionWithOtherAvatar( Avatar * other, float deltaTime );
void setHeadFromGyros(glm::vec3 * eulerAngles, glm::vec3 * angularVelocity, float deltaTime, float smoothingTime);
void checkForMouseRayTouching();
void renderJointConnectingCone(glm::vec3 position1, glm::vec3 position2, float radius1, float radius2);
};

View file

@ -104,6 +104,7 @@ void Head::simulate(float deltaTime, bool isMine) {
const float HEAD_MOTION_DECAY = 0.00;
/*
// Decay head back to center if turned on
if (isMine && _returnHeadToCenter) {
@ -121,6 +122,7 @@ void Head::simulate(float deltaTime, bool isMine) {
if (fabs(_yaw ) < RETURN_RANGE) { _yaw *= (1.0f - RETURN_STRENGTH * deltaTime); }
if (fabs(_roll ) < RETURN_RANGE) { _roll *= (1.0f - RETURN_STRENGTH * deltaTime); }
}
*/
// decay lean
_leanForward *= (1.f - HEAD_MOTION_DECAY * 30 * deltaTime);
@ -151,6 +153,7 @@ void Head::simulate(float deltaTime, bool isMine) {
if (USING_PHYSICAL_MOHAWK) {
updateHairPhysics(deltaTime);
}
}
void Head::determineIfLookingAtSomething() {