コード例 #1
0
ファイル: Quat.cpp プロジェクト: riemervdzee/TrafficSimulator
	void Quat::ToAxisAngle(Vec3& vec, float& angleDeg)
	{
		angleDeg = static_cast<float>( 2 * acos( w ) * RAD2DEG );

		float m = Length();

		if( IsCloseEnough(m, 0.0f) )
			vec = this->vec;
		else
			vec = this->vec * (1.0f / m);
	}
コード例 #2
0
void CountryInfoGetter::GetRegionsCountryId(m2::PointD const & pt, TCountriesVec & closestCoutryIds)
{
  double const kLookupRadiusM = 30 /* km */ * 1000;

  closestCoutryIds.clear();

  m2::RectD const lookupRect = MercatorBounds::RectByCenterXYAndSizeInMeters(pt, kLookupRadiusM);

  for (size_t id = 0; id < m_countries.size(); ++id)
  {
    if (m_countries[id].m_rect.IsIntersect(lookupRect) && IsCloseEnough(id, pt, kLookupRadiusM))
      closestCoutryIds.emplace_back(m_countries[id].m_countryId);
  }
}