Merge branch '29-fix-camera-vertical-rotation-prevent-see-under-the-char' into main/yubo-dev

main/yubo-dev
Nuno 3 years ago
commit ba7123b519

@ -153,7 +153,7 @@ CUserEntity::CUserEntity()
_LateralVelocity = 0.0f; _LateralVelocity = 0.0f;
_SpeedServerAdjust = 1.0f; _SpeedServerAdjust = 1.0f;
// \todo GUIGUI : do it more generic. // \todo GUIGUI : do it more generic.
_First_Pos = false; _First_Pos = false;
@ -186,7 +186,7 @@ CUserEntity::CUserEntity()
_MoveToAction= CUserEntity::None; _MoveToAction= CUserEntity::None;
_MoveToDist= 0.0; _MoveToDist= 0.0;
_MoveToColStartTime= 0; _MoveToColStartTime= 0;
_HeadPitch = Pi/2;
_FollowForceHeadPitch= false; _FollowForceHeadPitch= false;
_ForceLookSlot= CLFECOMMON::INVALID_SLOT; _ForceLookSlot= CLFECOMMON::INVALID_SLOT;
@ -209,7 +209,7 @@ CUserEntity::~CUserEntity()
_MountSpeeds.release(); _MountSpeeds.release();
CInterfaceManager *pIM = CInterfaceManager::getInstance(); CInterfaceManager *pIM = CInterfaceManager::getInstance();
{ {
CCDBNodeLeaf *node = NLGUI::CDBManager::getInstance()->getDbProp("SERVER:USER:IS_INVISIBLE", false); CCDBNodeLeaf *node = NLGUI::CDBManager::getInstance()->getDbProp("SERVER:USER:IS_INVISIBLE", false);
if (node) if (node)
@ -1220,7 +1220,7 @@ void CUserEntity::applyMotion(CEntityCL *target)
speed = getVelocity()*_SpeedFactor.getValue(); speed = getVelocity()*_SpeedFactor.getValue();
_SpeedFactor.addFactorValue(0.005f); _SpeedFactor.addFactorValue(0.005f);
} }
// SPEED VECTOR NULL -> NO MOVE // SPEED VECTOR NULL -> NO MOVE
if(speed == CVectorD::Null) if(speed == CVectorD::Null)
return; return;
@ -1674,11 +1674,11 @@ void CUserEntity::moveToAction(CEntityCL *ent)
case CUserEntity::Outpost: case CUserEntity::Outpost:
CLuaManager::getInstance().executeLuaScript("game:outpostBCOpenStateWindow()", 0); CLuaManager::getInstance().executeLuaScript("game:outpostBCOpenStateWindow()", 0);
break; break;
// BuildTotem // BuildTotem
case CUserEntity::BuildTotem: case CUserEntity::BuildTotem:
buildTotem(); buildTotem();
break; break;
// openArkUrl // openArkUrl
case CUserEntity::OpenArkUrl: case CUserEntity::OpenArkUrl:
CLuaManager::getInstance().executeLuaScript("getUI('ui:interface:web_transactions'):find('html'):browse(ArkTargetUrl)", 0); CLuaManager::getInstance().executeLuaScript("getUI('ui:interface:web_transactions'):find('html'):browse(ArkTargetUrl)", 0);
break; break;
@ -2552,9 +2552,9 @@ void CUserEntity::rotHeadVertically(float ang)
//----------------------------------------------- //-----------------------------------------------
void CUserEntity::setHeadPitch(double hp) void CUserEntity::setHeadPitch(double hp)
{ {
_HeadPitch= hp; _HeadPitch = hp;
const double bound= Pi/2 - 0.01; // epsilon to avoid gimbal lock // epsilon to avoid gimbal lock
clamp(_HeadPitch, -bound, bound); 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); CCDBNodeLeaf *leaf = safe_cast<CCDBNodeLeaf *>(node);
_Value = ((float)leaf->getValue64())/100.0f; _Value = ((float)leaf->getValue64())/100.0f;
//nlinfo("SpeedFactor changed to %f / %" NL_I64 "u", _Value, leaf->getValue64()); //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) // 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 // commented because ring editor speed is in fact faster
//if(_Value > 2.0f) //if(_Value > 2.0f)

Loading…
Cancel
Save