namespace uiVehicleComp
{
//Convert double, float to a string with given number of decimals.
template T>
eastl::string toStrDec(T const& val, const int decimals)
{
MallocScope ms;
std::ostringstream ostr;
ostr << std::fixed << std::setprecision(decimals) << val;
return ostr.str().c_str();
}
}
void UIVehicleComp::updateVehicleYawRotations(const GameInfo& gameInfo)
{
using namespace uiVehicleComp;
if (gameInfo.vehicle && gameInfo.hudData && gameInfo.hudData->getUseWeaponOrientations())
{
eastl::string currentYaw = toStrDec(gameInfo.vehicleYawAngle, 1);
if(0 != currentYaw.compare(m_yawAngle))
{
IUISystem::getInstance()->setData(UI_UIVEHICLECOMP_YAWANGLE, (double)atof(currentYaw.c_str()));
m_yawAngle = currentYaw;
}
}
}