add getter for steering

This commit is contained in:
xxSeys1
2025-04-02 17:24:13 +02:00
parent 368ef9185b
commit 2e48be97b6
2 changed files with 11 additions and 0 deletions

View File

@@ -200,6 +200,11 @@ void WheeledVehicle::SetSteering(float value)
_steering = Math::Clamp(value, -1.0f, 1.0f);
}
float WheeledVehicle::GetSteering()
{
return _steering;
}
void WheeledVehicle::SetBrake(float value)
{
value = Math::Saturate(value);

View File

@@ -553,6 +553,12 @@ public:
/// <param name="value">The value (-1,1 range).</param>
API_FUNCTION() void SetSteering(float value);
/// <summary>
/// Gets the vehicle steering. Steer is the analog steer value in range (-1,1) where -1 represents the steering wheel at left lock and +1 represents the steering wheel at right lock.
/// </summary>
/// <returns>The vehicle steering.</returns>
API_FUNCTION() float GetSteering();
/// <summary>
/// Sets the input for vehicle brakes. Brake is the analog brake pedal value in range (0,1) where 1 represents the pedal fully pressed and 0 represents the pedal in its rest state.
/// </summary>