mirror of
https://github.com/JulianGro/overte.git
synced 2025-04-25 17:14:59 +02:00
restrict avatar body yaw to be between 0-360
This commit is contained in:
parent
5fec8bc8fe
commit
daaf86a634
2 changed files with 5 additions and 0 deletions
|
@ -303,6 +303,7 @@ void Avatar::updateFromMouse(int mouseX, int mouseY, int screenWidth, int scree
|
|||
((mouseLocationX > 0.f) ?
|
||||
mouseMag :
|
||||
-mouseMag) );
|
||||
printLog("yaw = %f\n", getBodyYaw());
|
||||
}
|
||||
|
||||
return;
|
||||
|
|
|
@ -217,7 +217,11 @@ float AvatarData::getBodyYaw() {
|
|||
}
|
||||
|
||||
void AvatarData::setBodyYaw(float bodyYaw) {
|
||||
if ((bodyYaw > 360.f) || (bodyYaw < 0.f)) {
|
||||
bodyYaw -= floorf(bodyYaw / 360.f) * 360.f;
|
||||
}
|
||||
_bodyYaw = bodyYaw;
|
||||
|
||||
}
|
||||
|
||||
float AvatarData::getBodyPitch() {
|
||||
|
|
Loading…
Reference in a new issue