Updated to 2020 LTS, removed some TODOs in CarLogic as they were not

applicable or I can't remember why I wrote them
This commit is contained in:
2023-04-01 22:33:01 -07:00
parent c13ecbb7c0
commit 2373aec5c4
7 changed files with 849 additions and 51 deletions
-16
View File
@@ -65,23 +65,7 @@ public class CarLogic : MonoBehaviour
var steeringValue = steeringAction.ReadValue<float>();
var accelerationValue = accelerationAction.ReadValue<float>();
var brakeValue = brakeAction.ReadValue<float>();
// TODO: The way that I changed this too I like a lot better, however I do want to eventually figure out what was wrong with this verbose approach.
// Vector2 velocityDir = _transform.up;
// var currentAngleRad = Mathf.Acos(Vector3.Dot(velocityDir, Vector3.up));
// var deltaAngleRad = steeringValue * steeringAnglePerSecond * Time.deltaTime * Mathf.Deg2Rad;
// var angleRad = deltaAngleRad + currentAngleRad;
//
// var angleCos = Mathf.Cos(angleRad);
// var angleSin = Mathf.Sin(angleRad);
// Vector2 nextVelocityDir;
// nextVelocityDir.x = angleCos * velocityDir.x -
// angleSin * velocityDir.y;
// nextVelocityDir.y = angleSin * velocityDir.x +
// angleCos * velocityDir.y;
//
// nextVelocityDir *= accelerationAmount * accelerationValue * Time.deltaTime;
// TODO: probably not correct... ODE or some other formula.
if (accelerationValue <= 0)
{
_currentAcceleration -= _rigidbody.drag * Time.deltaTime;