Exemplo 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;
            }
        }