Esempio n. 1
0
        public TestWindow()
        {
            InitializeComponent();

            timer          = new Timer();
            timer.Interval = (int)(STEP_TIME * 1000);
            timer.Tick    += Timer_Tick;
            timer.Start();

            scene    = new Scene();
            contacts = new ContactList();

            Body groundBody = Utilities.AddBody(scene);

            groundBody.Position             = new Vector2(400, 25);
            groundBody.StaticFriction       = 0.5F;
            groundBody.DynamicFriction      = 0.2F;
            groundBody.Restitution          = 0.2F;
            groundBody.Orientation.Rotation = 60 * Math.DegreesToRadians;
            groundBody.Shape = Utilities.CreateSquareShape(new Vector2(700, 30), new Vector2(0, 0));

            Body obstacleBody = Utilities.AddBody(scene);

            obstacleBody.Position        = new Vector2(400, 300);
            obstacleBody.StaticFriction  = 0.5F;
            obstacleBody.DynamicFriction = 0.2F;
            obstacleBody.Restitution     = 0.2F;
            obstacleBody.Shape           = Utilities.CreateCircleShape(50);

            config          = new Simulation.Config();
            config.StepTime = STEP_TIME;

            raycastInfo = new Raycaster.Info();

            editorCanvas1.LookAt(new PointF(400, 200));
        }
Esempio n. 2
0
 public static void Draw(IDevice Device, Raycaster.Info Info)
 {
     DrawVector(Device, Pens.Blue, Info.Origin, Info.Direction * Info.Distance);
 }