Beispiel #1
0
 public CentralUnit()
 {
     patientMarkers = new List<MarkerNode>();
     //equipmentMarkers = new List<MarkerNode>();
     equipmentMarkers = new Hashtable();
     markerM = new MarkerModule();
     patient = new PatientModule();
 }
        /// <summary>
        /// Allows the game to perform any initialization it needs to before starting to run.
        /// This is where it can query for any required services and load any non-graphic
        /// related content.  Calling base.Initialize will enumerate through any components
        /// and initialize them as well.
        /// </summary>
        protected override void Initialize()
        {
            // TODO: Add your initialization logic here
            // Initialize the GoblinXNA framework
            State.InitGoblin(graphics, Content, "");

            MM = new MarkerModule();
            central = new CentralUnit();
            // Initialize the scene graph
            scene = new Scene(this);

            // Use the newton physics engine to perform collision detection
            scene.PhysicsEngine = new NewtonPhysics();

            // Set up optical marker tracking
            // Note that we don't create our own camera when we use optical marker
            // tracking. It'll be created automatically
            SetupMarkerTracking();

            // Set up the lights used in the scene
            CreateLights();

            //adds markers to the scene to be detected and IDed by goggles
            patients = central.getAllPatientMarkers(scene);
            equipment = central.getAllEquipmentMarkers(scene);
            AddMarkersToScene();
            // Create 3D objects

            // Use per pixel lighting for better quality (If you using non NVidia graphics card,
            // setting this to true may reduce the performance significantly)
            scene.PreferPerPixelLighting = true;

            // Enable shadow mapping
            // NOTE: In order to use shadow mapping, you will need to add 'PostScreenShadowBlur.fx'
            // and 'ShadowMap.fx' shader files as well as 'ShadowDistanceFadeoutMap.dds' texture file
            // to your 'Content' directory
            scene.EnableShadowMapping = false;

            // Show Frames-Per-Second on the screen for debugging
            State.ShowFPS = false;

            base.Initialize();
        }