Ejemplo n.º 1
0
        public override void Keyboard(System.Windows.Forms.Keys key)
        {
            switch (key)
            {
            case System.Windows.Forms.Keys.L:
                _joint2.EnableLimit(!_joint2.IsLimitEnabled);
                _joint3.EnableLimit(!_joint3.IsLimitEnabled);
                _joint2.GetBody1().WakeUp();
                _joint3.GetBody2().WakeUp();
                break;

            case System.Windows.Forms.Keys.M:
                _joint1.EnableMotor(!_joint1.IsMotorEnabled);
                _joint2.EnableMotor(!_joint2.IsMotorEnabled);
                _joint3.EnableMotor(!_joint3.IsMotorEnabled);
                _joint2.GetBody1().WakeUp();
                _joint3.GetBody2().WakeUp();
                break;

            case System.Windows.Forms.Keys.P:
                _joint3.GetBody2().WakeUp();
                _joint3.MotorSpeed = (-_joint3.MotorSpeed);
                break;
            }
        }
        /// <inheritdoc />
        public override void OnKeyDown(KeyboardKeyEventArgs key)
        {
            if (key.Key == Key.L)
            {
                _joint.EnableLimit(!_joint.IsLimitEnabled());
            }

            if (key.Key == Key.L)
            {
                _joint.EnableMotor(!_joint.IsMotorEnabled());
            }

            if (key.Key == Key.L)
            {
                _joint.SetMotorSpeed(-_joint.GetMotorSpeed());
            }
        }
Ejemplo n.º 3
0
 protected override void OnKeyDown(KeyEventArgs e)
 {
     if (e.KeyCode == Keys.L)
     {
         _joint.EnableLimit(!_joint.IsLimitEnabled());
     }
     if (e.KeyCode == Keys.M)
     {
         _joint.EnableMotor(!_joint.IsMotorEnabled());
     }
     if (e.KeyCode == Keys.P)
     {
         _joint.SetMotorSpeed(-_joint.GetMotorSpeed());
     }
 }
        /// <inheritdoc />
        public override void OnKeyDown(KeyInputEventArgs keyInput)
        {
            if (keyInput.Key == KeyCodes.L)
            {
                Joint.EnableLimit(!Joint.IsLimitEnabled());
            }

            if (keyInput.Key == KeyCodes.L)
            {
                Joint.EnableMotor(!Joint.IsMotorEnabled());
            }

            if (keyInput.Key == KeyCodes.L)
            {
                Joint.SetMotorSpeed(-Joint.GetMotorSpeed());
            }
        }
Ejemplo n.º 5
0
        public override void Keyboard(System.Windows.Forms.Keys key)
        {
            switch (key)
            {
            case System.Windows.Forms.Keys.L:
                _joint.EnableLimit(!_joint.IsLimitEnabled);
                break;

            case System.Windows.Forms.Keys.M:
                _joint.EnableMotor(!_joint.IsMotorEnabled);
                break;

            case System.Windows.Forms.Keys.P:
                _joint.MotorSpeed = (-_joint.MotorSpeed);
                break;

            default:
                return;
            }
        }
Ejemplo n.º 6
0
        /// <inheritdoc />
        public override void OnRender()
        {
            DrawString("Keys: (l) limits, (m) motors, (s) speed");

            var force = _joint.GetMotorForce(1 / TestSettings.Dt);

            DrawString($"Motor Force = {force}");

            if (Input.GetKeyDown(KeyCode.L))
            {
                _joint.EnableLimit(!_joint.IsLimitEnabled());
            }

            if (Input.GetKeyDown(KeyCode.L))
            {
                _joint.EnableMotor(!_joint.IsMotorEnabled());
            }

            if (Input.GetKeyDown(KeyCode.L))
            {
                _joint.SetMotorSpeed(-_joint.GetMotorSpeed());
            }
        }
Ejemplo n.º 7
0
        /// <inheritdoc />
        protected override void PreStep()
        {
            DrawString("Keys: (l) limits, (m) motors, (s) speed");

            var force = _joint.GetMotorForce(TestSettings.Frequency);

            DrawString($"Motor Force = {force}");

            if (Input.GetKeyDown(KeyCode.L))
            {
                _joint.EnableLimit(!_joint.IsLimitEnabled());
            }

            if (Input.GetKeyDown(KeyCode.L))
            {
                _joint.EnableMotor(!_joint.IsMotorEnabled());
            }

            if (Input.GetKeyDown(KeyCode.L))
            {
                _joint.SetMotorSpeed(-_joint.GetMotorSpeed());
            }
        }