Exemple #1
0
        private void Init()
        {
            _ropeSimulation = new RopeSimulation(
                40,               // 40 Particles (Masses)
                1f,               // Each Particle Has A Weight Of 1 Gram
                10000.0f,         // springConstant In The Rope
                0.0f,             // Normal Length Of Springs In The Rope
                0.0002f,          // Spring Inner Friction Constant
                new Vector(0, 0), // Gravitational Acceleration
                5,
                new Vector(BeginPoint.Point.X, BeginPoint.Point.Y));

            _timer = new DispatcherTimer(TimeSpan.FromMilliseconds(1), DispatcherPriority.Render, AnimationCallback, Dispatcher.CurrentDispatcher);
            _timer.Start();
            _sw = Stopwatch.StartNew();
        }
Exemple #2
0
        private void Init()
        {
            _ropeSimulation = new RopeSimulation(
                40, // 40 Particles (Masses)
                1f, // Each Particle Has A Weight Of 1 Gram
                10000.0f, // springConstant In The Rope
                0.0f, // Normal Length Of Springs In The Rope
                0.0002f, // Spring Inner Friction Constant
                new Vector(0, 0), // Gravitational Acceleration
                5,
                new Vector(BeginPoint.Point.X, BeginPoint.Point.Y));

            _timer = new DispatcherTimer(TimeSpan.FromMilliseconds(1), DispatcherPriority.Render, AnimationCallback, Dispatcher.CurrentDispatcher);
            _timer.Start();
            _sw = Stopwatch.StartNew();
        }