Adde default value to _HeadPitch. Change bounds

main/atys-pre-live
Nuno 3 years ago
parent aa34e88101
commit 35a7a6628b

@ -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<CCDBNodeLeaf *>(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)

Loading…
Cancel
Save