Example #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;
            }
        }
Example #2
0
        /// <inheritdoc />
        protected override void OnStep()
        {
            if (Input.GetKeyDown(KeyCode.L))
            {
                m_joint.EnableLimit(!m_joint.IsLimitEnabled());
            }

            if (Input.GetKeyDown(KeyCode.M))
            {
                m_joint.EnableMotor(!m_joint.IsMotorEnabled());
            }
        }
Example #3
0
        /// <inheritdoc />
        /// <inheritdoc />
        public override void OnKeyDown(KeyInputEventArgs keyInput)
        {
            if (keyInput.Key == KeyCodes.L)
            {
                m_joint.EnableLimit(!m_joint.IsLimitEnabled());
            }

            if (keyInput.Key == KeyCodes.M)
            {
                m_joint.EnableMotor(!m_joint.IsMotorEnabled());
            }
        }
Example #4
0
        /// <inheritdoc />
        /// <inheritdoc />
        public override void OnKeyDown(KeyboardKeyEventArgs key)
        {
            if (key.Key == Key.L)
            {
                m_joint.EnableLimit(!m_joint.IsLimitEnabled());
            }

            if (key.Key == Key.M)
            {
                m_joint.EnableMotor(!m_joint.IsMotorEnabled());
            }
        }
Example #5
0
        protected override void OnKeyDown(KeyEventArgs e)
        {
            if (e.KeyCode == Keys.L)
            {
                _joint.EnableLimit(_joint.IsLimitEnabled());
            }

            if (e.KeyCode == Keys.S)
            {
                _joint.EnableMotor(false);
            }
        }
Example #6
0
        /// <inheritdoc />
        protected override void PreStep()
        {
            DrawString("Keys: (l) limits, (m) motor");
            if (Input.GetKeyDown(KeyCode.L))
            {
                m_joint.EnableLimit(!m_joint.IsLimitEnabled());
            }

            if (Input.GetKeyDown(KeyCode.M))
            {
                m_joint.EnableMotor(!m_joint.IsMotorEnabled());
            }
        }
Example #7
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.S:
                _joint.EnableMotor(!_joint.IsMotorEnabled);
                break;

            default:
                return;
            }
        }