use clamp instead of min, max

This commit is contained in:
PhilipRosedale 2013-10-02 10:50:41 -07:00
parent 8f1ff46fa7
commit 26618f45f8

View file

@ -2114,11 +2114,8 @@ void Application::updateAvatar(float deltaTime) {
}
// Constrain head-driven mouse to edges of screen
_headMouseX = max(_headMouseX, 0);
_headMouseX = min(_headMouseX, _glWidget->width());
_headMouseY = max(_headMouseY, 0);
_headMouseY = min(_headMouseY, _glWidget->height());
_headMouseX = glm::clamp(_headMouseX, 0, _glWidget->width());
_headMouseY = glm::clamp(_headMouseY, 0, _glWidget->height());
if (OculusManager::isConnected()) {
float yaw, pitch, roll;