mirror of
https://github.com/overte-org/overte.git
synced 2025-08-10 06:23:06 +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) ?
|
((mouseLocationX > 0.f) ?
|
||||||
mouseMag :
|
mouseMag :
|
||||||
-mouseMag) );
|
-mouseMag) );
|
||||||
|
printLog("yaw = %f\n", getBodyYaw());
|
||||||
}
|
}
|
||||||
|
|
||||||
return;
|
return;
|
||||||
|
|
|
@ -217,7 +217,11 @@ float AvatarData::getBodyYaw() {
|
||||||
}
|
}
|
||||||
|
|
||||||
void AvatarData::setBodyYaw(float bodyYaw) {
|
void AvatarData::setBodyYaw(float bodyYaw) {
|
||||||
|
if ((bodyYaw > 360.f) || (bodyYaw < 0.f)) {
|
||||||
|
bodyYaw -= floorf(bodyYaw / 360.f) * 360.f;
|
||||||
|
}
|
||||||
_bodyYaw = bodyYaw;
|
_bodyYaw = bodyYaw;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
float AvatarData::getBodyPitch() {
|
float AvatarData::getBodyPitch() {
|
||||||
|
|
Loading…
Reference in a new issue