From 5c56c87d09ef6b44d497c3fe706ca5aaaa4422b1 Mon Sep 17 00:00:00 2001 From: Nuno Date: Tue, 14 Dec 2021 20:23:43 +0100 Subject: [PATCH] Adde default value to _HeadPitch. Change bounds --- ryzom/client/src/user_entity.cpp | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/ryzom/client/src/user_entity.cpp b/ryzom/client/src/user_entity.cpp index 90d4b28b6..aed5ca413 100644 --- a/ryzom/client/src/user_entity.cpp +++ b/ryzom/client/src/user_entity.cpp @@ -153,7 +153,7 @@ CUserEntity::CUserEntity() _LateralVelocity = 0.0f; _SpeedServerAdjust = 1.0f; - + // \todo GUIGUI : do it more generic. _First_Pos = false; @@ -186,7 +186,7 @@ CUserEntity::CUserEntity() _MoveToAction= CUserEntity::None; _MoveToDist= 0.0; _MoveToColStartTime= 0; - + _HeadPitch = Pi/2; _FollowForceHeadPitch= false; _ForceLookSlot= CLFECOMMON::INVALID_SLOT; @@ -209,7 +209,7 @@ CUserEntity::~CUserEntity() _MountSpeeds.release(); CInterfaceManager *pIM = CInterfaceManager::getInstance(); - + { CCDBNodeLeaf *node = NLGUI::CDBManager::getInstance()->getDbProp("SERVER:USER:IS_INVISIBLE", false); if (node) @@ -1220,7 +1220,7 @@ void CUserEntity::applyMotion(CEntityCL *target) speed = getVelocity()*_SpeedFactor.getValue(); _SpeedFactor.addFactorValue(0.005f); } - + // SPEED VECTOR NULL -> NO MOVE if(speed == CVectorD::Null) return; @@ -1674,11 +1674,11 @@ void CUserEntity::moveToAction(CEntityCL *ent) case CUserEntity::Outpost: CLuaManager::getInstance().executeLuaScript("game:outpostBCOpenStateWindow()", 0); break; - // BuildTotem + // BuildTotem case CUserEntity::BuildTotem: buildTotem(); break; - // openArkUrl + // openArkUrl case CUserEntity::OpenArkUrl: CLuaManager::getInstance().executeLuaScript("getUI('ui:interface:web_transactions'):find('html'):browse(ArkTargetUrl)", 0); break; @@ -2552,9 +2552,9 @@ void CUserEntity::rotHeadVertically(float ang) //----------------------------------------------- void CUserEntity::setHeadPitch(double hp) { - _HeadPitch= hp; - const double bound= Pi/2 - 0.01; // epsilon to avoid gimbal lock - clamp(_HeadPitch, -bound, bound); + _HeadPitch = hp; + // epsilon to avoid gimbal lock + clamp(_HeadPitch, -Pi/2 + 0.01, Pi/2 - 0.5); } //--------------------------------------------------- @@ -3616,7 +3616,7 @@ void CUserEntity::CSpeedFactor::update(ICDBNode *node) // virtual CCDBNodeLeaf *leaf = safe_cast(node); _Value = ((float)leaf->getValue64())/100.0f; //nlinfo("SpeedFactor changed to %f / %" NL_I64 "u", _Value, leaf->getValue64()); - + // clamp the value (2.0 is the egg item or the level 6 speed up power up, nothing should be faster) // commented because ring editor speed is in fact faster //if(_Value > 2.0f)