public static void UpdateAccelerationAndVelocity(ReactionControl rcs, Vector3 newPosition, Seconds elapsed) { var newVelocity = (newPosition - rcs.LastPosition) / elapsed; rcs.Acceleration = (newVelocity - rcs.Velocity) / elapsed; rcs.Velocity = newVelocity; rcs.LastPosition = newPosition; }
private void buttonReaction_Click(object sender, EventArgs e) { if (buttonReaction.Checked) { this.sideBarPanel.Controls.Clear(); this._contentPanel.Controls.Clear(); ReactionControl reactControl = new ReactionControl(); this.sideBarPanel.Controls.Add(reactControl); currentPanelContent = reactControl; } }
private void buttonReaction_Click(object sender, EventArgs e) { if (buttonReaction.Checked) { // removing second side bar from view, if there is one, and removing its context too if (sideBarPanel.Controls.Count > 0) { sideBarPanel.Controls.Remove(currentPanelContent); contentPanel.Controls.Clear(); } ReactionControl reactControl = new ReactionControl(); this.sideBarPanel.Controls.Add(reactControl); currentPanelContent = reactControl; } }