コード例 #1
0
void ControlCityThemeExample::FindThemeByPointInPolygon()
{
	Eegeo::Space::LatLong osaka = Eegeo::Space::LatLong::FromDegrees(34.700131,135.478884);
	Eegeo::v2 osakav2(static_cast<float>(osaka.GetLatitudeInDegrees()), static_cast<float>(osaka.GetLongitudeInDegrees()));

	// enumerate all of the themes in the theme repository
	int numberOfThemes = m_themeRepository.GetNumberOfThemes();
	for (int i=0; i<numberOfThemes; ++i)
	{
		const Eegeo::Resources::CityThemes::CityThemeData& themeData = m_themeRepository.GetCityThemeAt(i);
		if (themeData.PolygonBounds.size() > 0) // there are points in the bounding polygon
		{
			std::vector<Eegeo::v2> polygon;
			VectorLatLonToV2(themeData.PolygonBounds, polygon);
			if (PointInPolygon(polygon, osakav2))
			{
				EXAMPLE_LOG("This theme contains the Osaka point: %s\n", themeData.Name.c_str());
				return;
			}
		}
	}
	EXAMPLE_LOG("No theme found that contains the Osaka point\n");
}
コード例 #2
0
    void MobileExampleApp::Update(float dt)
    {
        Eegeo::EegeoWorld& eegeoWorld(World());
        
        Eegeo::Modules::Map::Layers::InteriorsPresentationModule& interiorsModule = eegeoWorld.GetMapModule().GetInteriorsPresentationModule();
        Eegeo::Resources::Interiors::Camera::InteriorsCameraController& interiorsCameraController = interiorsModule.GetCameraController();
        
        m_pCurrentTouchController = interiorsModule.GetCameraController().IsEnabled()
            ? &interiorsModule.GetTouchController()
            : m_pCameraTouchController;

        eegeoWorld.EarlyUpdate(dt);

        m_pGlobeCameraController->Update(dt);
        m_pCameraTransitionController->Update(dt);
        
        if(interiorsCameraController.IsEnabled())
        {
            interiorsCameraController.Update(dt);
        }

        Eegeo::Camera::CameraState cameraState(interiorsCameraController.IsEnabled()
                                               ? interiorsCameraController.GetCameraState()
                                               : m_pGlobeCameraController->GetCameraState());
        
        Eegeo::Camera::RenderCamera renderCamera(interiorsCameraController.IsEnabled()
                                                 ? interiorsCameraController.GetRenderCamera()
                                                 : m_pGlobeCameraController->GetRenderCamera());
        
        Eegeo::dv3 ecefInterestPoint(cameraState.InterestPointEcef());

        m_pPoiRingModule->GetPoiRingController().Update(dt, renderCamera, ecefInterestPoint);

        Eegeo::EegeoUpdateParameters updateParameters(dt,
                cameraState.LocationEcef(),
                cameraState.InterestPointEcef(),
                cameraState.ViewMatrix(),
                cameraState.ProjectionMatrix(),
                GetUpdatedStreamingVolume(cameraState, renderCamera),
                m_screenProperties);

        eegeoWorld.Update(updateParameters);

        m_pSearchModule->GetSearchRefreshService().TryRefreshSearch(dt, ecefInterestPoint);

        m_pPinsModule->GetController().Update(dt, renderCamera);

        if(!eegeoWorld.Initialising())
        {
            WorldPinsModule().GetWorldPinsScaleController().Update(dt, renderCamera);
            CompassModule().GetCompassUpdateController().Update(dt);
            CompassModule().GetCompassUpdateController().Update(dt);
            m_pGpsMarkerModule->GetGpsMarkerController().Update(dt, renderCamera);
            
            if (m_interiorsEnabled)
            {
                Eegeo_ASSERT(m_pInteriorsEntitiesPinsModule != NULL);
                
                m_pInteriorsEntitiesPinsModule->GetPinsModule().Update(dt, renderCamera);
                m_pInteriorsEntitiesPinsModule->GetInteriorsEntitiesPinsController().Update(dt);
            }
            
            InitialExperience::SdkModel::IInitialExperienceModel& initialExperienceModel = m_initialExperienceModule.GetInitialExperienceModel();
            if(!initialExperienceModel.HasCompletedInitialExperience() && IsLoadingScreenComplete())
            {
                InitialExperience::SdkModel::IInitialExperienceController& initialExperienceController = m_initialExperienceModule.GetInitialExperienceController();
                initialExperienceController.Update(dt);
            }
  
            if (!m_setMetricsLocation)
            {
                Eegeo::dv3 gpsLocation;
                if(m_pNavigationService->TryGetGpsLocationOnTerrain(gpsLocation))
                {
                    Eegeo::Space::LatLong ll = Eegeo::Space::LatLong::FromECEF(gpsLocation);
                    m_metricsService.SetPosition(ll.GetLatitudeInDegrees(), ll.GetLongitudeInDegrees(), 0.f, 0.f);
                    m_setMetricsLocation = true;
                }
            }
        }

        m_pNavigationService->Update(dt);

        UpdateLoadingScreen(dt);
    }