9#if VEHICLE_DEBUGGING_ENABLED
32 if ((
D > (R1 + R2)) || (
D < (R1 - R2)))
37 float TwoD =
D * 2.0f;
38 float R1Sqr = R1 * R1;
39 float R2Sqr = R2 * R2;
80 Intersection.
Y = -Intersection.
Y;
91 return RadToDeg(FMath::Atan2(TrackWidth*0.5f, WheelBase));
101 float H =
R * FMath::Cos(
DegToRad(Beta));
102 float S = T - 2.0f *
R * FMath::Sin(
DegToRad(Beta));
124 //float Gamma = DegToRad(18.0f);
127 float t = 2.0f; // width between wheels
128 float r = 0.15f; // track length
129 float h = r * FMath::Cos(Gamma); // track depth
130 float s = t - 2.0f * r * FMath::Sin(Gamma);
132 float Beta = FMath::Atan((t - s) / (2.0f * h));
134 float dev = Input * 0.5f;
135 OutSteerA = RadToDeg(FMath::Atan((t - (s - dev)) / (2.0f * h)));
136 OutSteerB = RadToDeg(FMath::Atan((t - (s + dev)) / (2.0f * h)));
140 OutSteerA = -OutSteerA;
141 OutSteerB = -OutSteerB;
143 //for (float dev = 0.0f; dev < 0.3f; dev += 0.02f)
145 // float BetaA = FMath::Atan((t - (s - dev)) / (2.0f * h));
146 // float BetaB = FMath::Atan((t - (s + dev)) / (2.0f * h));
148 // float BetaADeg = RadToDeg(BetaA);
149 // float BetaBDeg = RadToDeg(BetaB);
151 // UE_LOG(LogChaos, Warning, TEXT("%f %f"), BetaADeg - 18.0f, BetaBDeg - 18.0f);
159#if VEHICLE_DEBUGGING_ENABLED
#define UE_ENABLE_OPTIMIZATION
Definition CoreMiscDefines.h:60
#define UE_DISABLE_OPTIMIZATION
Definition CoreMiscDefines.h:59
UE_FORCEINLINE_HINT TSharedRef< CastToType, Mode > StaticCastSharedRef(TSharedRef< CastFromType, Mode > const &InSharedRef)
Definition SharedPointer.h:127
Definition SkeletalMeshComponent.h:307
FORCEINLINE float RadToDeg(float InRad)
Definition VehicleUtility.h:282
FORCEINLINE float Sqr(float Val)
Definition VehicleUtility.h:287
FORCEINLINE float DegToRad(float InDeg)
Definition VehicleUtility.h:277
Definition SteeringUtility.h:16
static float CalculateBetaDegrees(float TrackWidth, float WheelBase)
Definition SteeringUtility.h:89
static bool IntersectTwoCircles(float R1, float R2, float D, FVector2D &OutIntersection)
Definition SteeringUtility.h:27
static void CalcJointPositions(float T, float Beta, float R, FVector2D &C1, float &R1, FVector2D &C2, float &R2)
Definition SteeringUtility.h:99
static void CalculateAkermannAngle(bool Flip, float Input, FVector2D &C2, float R1, float R2, float &OutSteerAngle, FVector2D &OutC1, FVector2D &OutPt)
Definition SteeringUtility.h:62
static void AkermannSetup(float T, float Beta, float R, float &OutH, float &OutS)
Definition SteeringUtility.h:93
void Set(T InX, T InY)
Definition Vector2D.h:1074
TVector2< T > GetRotated(T AngleDeg) const
Definition Vector2D.h:1129
T Y
Definition Vector2D.h:52