public ThreeDTester1()
        {
            InitializeComponent();

            // Trackball
            _trackball = new Game.HelperClassesWPF.TrackBallRoam(_camera);
            _trackball.EventSource = grid1;
            _trackball.AllowZoomOnMouseWheel = true;
            _trackball.Mappings.AddRange(Game.HelperClassesWPF.TrackBallMapping.GetPrebuilt(Game.HelperClassesWPF.TrackBallMapping.PrebuiltMapping.MouseComplete));

            // Setup the map
            _map.CollisionHandler = new CollisionHandler();
            _map.CollisionHandler.PenetrationThresholdPercent = PENETRATIONTHRESHOLDPERCENT;
            _map.TimerPullApartType = PullApartType.Force;
            _map.CollisionHandler.PullApartSpringVelocity = MAXVELOCITY / 10d;

            _multiBallTimer.Interval = TimeSpan.FromMilliseconds(10);
            _multiBallTimer.Tick += new EventHandler(MultiBallTimer_Tick); //new EventHandler(dt_Tick);

            grid1.MouseWheel += new MouseWheelEventHandler(viewport3D1_MouseWheel);
            grid1.MouseDown += new MouseButtonEventHandler(viewport3D1_MouseDown);
            grid1.MouseUp += new MouseButtonEventHandler(viewport3D1_MouseUp);
            grid1.MouseLeave += new MouseEventHandler(viewport3D1_MouseLeave);
            grid1.MouseMove += new MouseEventHandler(viewport3D1_MouseMove);
        }
Пример #2
0
        public ThreeDTester1()
        {
            InitializeComponent();

            // Trackball
            _trackball                       = new Game.HelperClassesWPF.TrackBallRoam(_camera);
            _trackball.EventSource           = grid1;
            _trackball.AllowZoomOnMouseWheel = true;
            _trackball.Mappings.AddRange(Game.HelperClassesWPF.TrackBallMapping.GetPrebuilt(Game.HelperClassesWPF.TrackBallMapping.PrebuiltMapping.MouseComplete));

            // Setup the map
            _map.CollisionHandler = new CollisionHandler();
            _map.CollisionHandler.PenetrationThresholdPercent = PENETRATIONTHRESHOLDPERCENT;
            _map.TimerPullApartType = PullApartType.Force;
            _map.CollisionHandler.PullApartSpringVelocity = MAXVELOCITY / 10d;

            _multiBallTimer.Interval = TimeSpan.FromMilliseconds(10);
            _multiBallTimer.Tick    += new EventHandler(MultiBallTimer_Tick); //new EventHandler(dt_Tick);

            grid1.MouseWheel += new MouseWheelEventHandler(viewport3D1_MouseWheel);
            grid1.MouseDown  += new MouseButtonEventHandler(viewport3D1_MouseDown);
            grid1.MouseUp    += new MouseButtonEventHandler(viewport3D1_MouseUp);
            grid1.MouseLeave += new MouseEventHandler(viewport3D1_MouseLeave);
            grid1.MouseMove  += new MouseEventHandler(viewport3D1_MouseMove);
        }