mirror of
https://github.com/overte-org/overte.git
synced 2025-08-07 13:30:33 +02:00
fix use of PI constant after merge with upstream master
This commit is contained in:
parent
104fcd1289
commit
5a5b22db61
2 changed files with 195 additions and 203 deletions
|
@ -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);
|
||||
|
|
|
@ -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();
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
|
Loading…
Reference in a new issue