Content/Ambulance.uasset
Content/Ambulance.uasset
This is a binary file and will not be displayed.
Content/PickupZone.uasset
Content/PickupZone.uasset
This is a binary file and will not be displayed.
+4
Source/CrazyAmbulance/Private/VehicleNew.cpp
+4
Source/CrazyAmbulance/Private/VehicleNew.cpp
···
56
56
57
57
bool bTouchingGround = false;
58
58
bool bBothFrontWheelsTouchingGround = true;
59
+
CurrentSpeed = 0.0;
59
60
for (int i = 0; i < 4; ++i)
60
61
{
61
62
bool FrontWheel = i / 2 == 0;
···
123
124
DrawDebugCircle(GetWorld(), TireCenter, TireRadius, 20, FColor::Green, false, -1, 0, 0, TireForward);
124
125
125
126
FVector TireVelocity = Body->GetPhysicsLinearVelocityAtPoint(TireCenter);
127
+
CurrentSpeed += TireVelocity.Size();
126
128
127
129
// Suspension
128
130
double Offset = SuspensionRestDist - (Result.Distance - TireRadius);
···
180
182
}
181
183
}
182
184
}
185
+
186
+
CurrentSpeed /= 4.0;
183
187
184
188
if (!bTouchingGround)
185
189
{