public override void Update() { if (CurrentNode.Next == null) { return; } float elapsedSeconds = Engine.Instance.FrameTime; UpdateRearSlip(); UpdateEngineForce(); UpdateDrag(); Vector3 speedChangeVector = _force / Descriptor.Mass; if (_isOnGround && speedChangeVector.Length() > 0) { float speedApplyFactor = Vector3.Dot(Vector3.Normalize(speedChangeVector), Direction); if (speedApplyFactor > 1) { speedApplyFactor = 1; } Speed += speedChangeVector.Length() * speedApplyFactor; } UpdateWheels(); CheckForCollisions(); // Calculate pitch depending on the force float speedChange = Speed - _previousSpeed; BodyPitch.ChangePosition(speedChange * 0.6f); BodyRoll.ChangePosition(_steeringWheel * -0.05f * Math.Min(1, Math.Abs(Speed) / 30)); BodyPitch.Simulate(Engine.Instance.FrameTime * 2.5f); BodyRoll.Simulate(Engine.Instance.FrameTime * 2.5f); _audioProvider.UpdateEngine(); base.Update(); }