/// <inheritdoc /> protected override void PreStep() { DrawString("Keys: (s) pause"); if (Input.GetKeyDown(KeyCode.S)) { _go = !_go; } if (_go && TestSettings.Frequency > 0.0f) { _time += 1.0f / TestSettings.Frequency; } var linearOffset = new Vector2 { X = 6.0f * (float)Math.Sin(2.0f * _time), Y = 8.0f + 4.0f * (float)Math.Sin(1.0f * _time) }; var angularOffset = 4.0f * _time; _joint.SetLinearOffset(linearOffset); _joint.SetAngularOffset(angularOffset); Drawer.DrawPoint(linearOffset, 4.0f, Color.FromArgb(230, 230, 230)); }
protected override void OnStep() { if (Input.GetKeyDown(KeyCode.S)) { _go = !_go; } if (_go && TestSettings.Dt > 0.0f) { _time += TestSettings.Dt; } _linearOffset = new Vector2 { X = 6.0f * (float)Math.Sin(2.0f * _time), Y = 8.0f + 4.0f * (float)Math.Sin(1.0f * _time) }; var angularOffset = 4.0f * _time; _joint.SetLinearOffset(_linearOffset); _joint.SetAngularOffset(angularOffset); }