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()); } }
/// <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()); } }
/// <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()); } }
/// <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()); } }