fix use of PI constant after merge with upstream master

This commit is contained in:
Stephen Birarda 2013-06-03 12:00:57 -07:00
parent 104fcd1289
commit 5a5b22db61
2 changed files with 195 additions and 203 deletions

View file

@ -288,7 +288,7 @@ void Application::paintGL() {
if (_myCamera.getMode() == CAMERA_MODE_MIRROR) {
_myCamera.setTightness (100.0f);
_myCamera.setTargetPosition(_myAvatar.getSpringyHeadPosition());
_myCamera.setTargetRotation(_myAvatar.getWorldAlignedOrientation() * glm::quat(glm::vec3(0.0f, PI, 0.0f)));
_myCamera.setTargetRotation(_myAvatar.getWorldAlignedOrientation() * glm::quat(glm::vec3(0.0f, PIf, 0.0f)));
} else if (OculusManager::isConnected()) {
_myCamera.setUpShift (0.0f);

View file

@ -62,32 +62,32 @@ float chatMessageScale = 0.0015;
float chatMessageHeight = 0.20;
Avatar::Avatar(Agent* owningAgent) :
AvatarData(owningAgent),
_head(this),
_TEST_bigSphereRadius(0.4f),
_TEST_bigSpherePosition(5.0f, _TEST_bigSphereRadius, 5.0f),
_mousePressed(false),
_bodyPitchDelta(0.0f),
_bodyYawDelta(0.0f),
_bodyRollDelta(0.0f),
_movedHandOffset(0.0f, 0.0f, 0.0f),
_mode(AVATAR_MODE_STANDING),
_cameraPosition(0.0f, 0.0f, 0.0f),
_handHoldingPosition(0.0f, 0.0f, 0.0f),
_velocity(0.0f, 0.0f, 0.0f),
_thrust(0.0f, 0.0f, 0.0f),
_speed(0.0f),
_maxArmLength(0.0f),
_pelvisStandingHeight(0.0f),
_pelvisFloatingHeight(0.0f),
_distanceToNearestAvatar(std::numeric_limits<float>::max()),
_gravity(0.0f, -1.0f, 0.0f),
_worldUpDirection(DEFAULT_UP_DIRECTION),
_mouseRayOrigin(0.0f, 0.0f, 0.0f),
_mouseRayDirection(0.0f, 0.0f, 0.0f),
_interactingOther(NULL),
_cumulativeMouseYaw(0.0f),
_isMouseTurningRight(false)
AvatarData(owningAgent),
_head(this),
_TEST_bigSphereRadius(0.4f),
_TEST_bigSpherePosition(5.0f, _TEST_bigSphereRadius, 5.0f),
_mousePressed(false),
_bodyPitchDelta(0.0f),
_bodyYawDelta(0.0f),
_bodyRollDelta(0.0f),
_movedHandOffset(0.0f, 0.0f, 0.0f),
_mode(AVATAR_MODE_STANDING),
_cameraPosition(0.0f, 0.0f, 0.0f),
_handHoldingPosition(0.0f, 0.0f, 0.0f),
_velocity(0.0f, 0.0f, 0.0f),
_thrust(0.0f, 0.0f, 0.0f),
_speed(0.0f),
_maxArmLength(0.0f),
_pelvisStandingHeight(0.0f),
_pelvisFloatingHeight(0.0f),
_distanceToNearestAvatar(std::numeric_limits<float>::max()),
_gravity(0.0f, -1.0f, 0.0f),
_worldUpDirection(DEFAULT_UP_DIRECTION),
_mouseRayOrigin(0.0f, 0.0f, 0.0f),
_mouseRayDirection(0.0f, 0.0f, 0.0f),
_interactingOther(NULL),
_cumulativeMouseYaw(0.0f),
_isMouseTurningRight(false)
{
// give the pointer to our head to inherited _headData variable from AvatarData
@ -857,16 +857,12 @@ void Avatar::render(bool lookingInMirror) {
}
glPushMatrix();
// extract the view direction from the modelview matrix: transform (0, 0, 1) by the
// transpose of the modelview to get its direction in world space, then use the X/Z
// components to determine the angle
float modelview[16];
glGetFloatv(GL_MODELVIEW_MATRIX, modelview);
glm::vec3 chatPosition = _bodyBall[AVATAR_JOINT_HEAD_BASE].position + getBodyUpDirection() * chatMessageHeight;
glTranslatef(chatPosition.x, chatPosition.y, chatPosition.z);
glm::quat chatRotation = Application::getInstance()->getCamera()->getRotation();
glm::vec3 chatAxis = glm::axis(chatRotation);
glRotatef(glm::angle(chatRotation), chatAxis.x, chatAxis.y, chatAxis.z);
glTranslatef(_joint[AVATAR_JOINT_HEAD_BASE].springyPosition.x,
_joint[AVATAR_JOINT_HEAD_BASE].springyPosition.y + chatMessageHeight,
_joint[AVATAR_JOINT_HEAD_BASE].springyPosition.z);
glRotatef(atan2(-modelview[2], -modelview[10]) * 180 / PIf, 0, 1, 0);
glColor3f(0, 0.8, 0);
glRotatef(180, 0, 1, 0);
@ -1183,7 +1179,3 @@ void Avatar::renderJointConnectingCone(glm::vec3 position1, glm::vec3 position2,
glEnd();
}