Browse Source

- Bugfix: When reversing you could accelearate forever

- Bugfix: Gear was not shown properly when debug drawing the constraint
- Added damping and inertia to engine to simulate its behavior when the clutch is pressed
- Added RPM meter to draw constraint
jrouwe 4 years ago
parent
commit
1072886aec

+ 18 - 8
Jolt/Physics/Vehicle/TrackedVehicleController.cpp

@@ -201,9 +201,8 @@ void TrackedVehicleController::PostCollide(float inDeltaTime, PhysicsSystem &inP
 	}
 	
 	// First calculate engine speed based on speed of all wheels
-	// TODO: Not correct, if the wheels are not connected or the clutch is pressed the RPM should go up when the user presses the gas (we're missing engine inertia in the equation too)
 	bool can_engine_apply_torque = false;
-	if (mTransmission.GetCurrentGear() != 0)
+	if (mTransmission.GetCurrentGear() != 0 && mTransmission.GetClutchFriction() > 1.0e-3f)
 	{
 		float transmission_ratio = mTransmission.GetCurrentRatio();
 		bool forward = transmission_ratio >= 0.0f;
@@ -224,9 +223,14 @@ void TrackedVehicleController::PostCollide(float inDeltaTime, PhysicsSystem &inP
 
 		// Update RPM only if the tracks are connected to the engine
 		if (fastest_wheel_speed > -FLT_MAX && fastest_wheel_speed < FLT_MAX)
-			mEngine.SetCurrentRPM(fastest_wheel_speed * mTransmission.GetCurrentRatio() * cAngularVelocityToRPM);
+			mEngine.SetCurrentRPM(fastest_wheel_speed * mTransmission.GetCurrentRatio() * VehicleEngine::cAngularVelocityToRPM);
 		mEngine.SetCurrentRPM(Clamp(mEngine.GetCurrentRPM(), mEngine.mMinRPM, mEngine.mMaxRPM));
 	}
+	else
+	{
+		// Engine not connected to tracks, update RPM based on engine inertia alone
+		mEngine.UpdateRPM(inDeltaTime, abs(mForwardInput));
+	}
 
 	// Update transmission
 	// Note: only allow switching gears up when the tracks are rolling in the same direction
@@ -234,7 +238,7 @@ void TrackedVehicleController::PostCollide(float inDeltaTime, PhysicsSystem &inP
 
 	// Calculate the amount of torque the transmission gives to the differentials
 	float transmission_ratio = mTransmission.GetCurrentRatio();
-	float transmission_torque = mTransmission.GetClutchFriction() * transmission_ratio * abs(mForwardInput) * mEngine.mMaxTorque * mEngine.mNormalizedTorque.GetValue(mEngine.GetCurrentRPM() / mEngine.mMaxRPM);
+	float transmission_torque = mTransmission.GetClutchFriction() * transmission_ratio * mEngine.GetTorque(abs(mForwardInput));
 	if (transmission_torque != 0.0f)
 	{
 		// Apply the transmission torque to the wheels
@@ -247,13 +251,13 @@ void TrackedVehicleController::PostCollide(float inDeltaTime, PhysicsSystem &inP
 
 			// Calculate the max angular velocity of the driven wheel of the track given current engine RPM
 			// Note this adds 0.1% slop to avoid numerical accuracy issues
-			float track_max_angular_velocity = abs(mEngine.GetCurrentRPM() / (transmission_ratio * t.mDifferentialRatio * ratio * cAngularVelocityToRPM)) * 1.001f;
+			float track_max_angular_velocity = mEngine.GetCurrentRPM() / (transmission_ratio * t.mDifferentialRatio * ratio * VehicleEngine::cAngularVelocityToRPM) * 1.001f;
 
 			// Calculate torque on the driven wheel
 			float differential_torque = t.mDifferentialRatio * ratio * transmission_torque;
 
 			// Apply torque to driven wheel
-			if (t.mAngularVelocity * track_max_angular_velocity < 0.0f || abs(t.mAngularVelocity) < track_max_angular_velocity)
+			if (t.mAngularVelocity * track_max_angular_velocity < 0.0f || abs(t.mAngularVelocity) < abs(track_max_angular_velocity))
 				t.mAngularVelocity += differential_torque * inDeltaTime / t.mInertia;
 		}
 	}
@@ -398,12 +402,18 @@ bool TrackedVehicleController::SolveLongitudinalAndLateralConstraints(float inDe
 
 void TrackedVehicleController::Draw(DebugRenderer *inRenderer) const 
 {
-	// Draw current vehicle state
+	// Draw RPM
 	Body *body = mConstraint.GetVehicleBody();
+	Vec3 rpm_meter_up = body->GetRotation() * mConstraint.GetLocalUp();
+	Vec3 rpm_meter_pos = body->GetPosition() + body->GetRotation() * mRPMMeterPosition;
+	Vec3 rpm_meter_fwd = body->GetRotation() * mConstraint.GetLocalForward();
+	mEngine.DrawRPM(inRenderer, rpm_meter_pos, rpm_meter_fwd, rpm_meter_up, mRPMMeterSize, mTransmission.mShiftDownRPM, mTransmission.mShiftUpRPM);
+
+	// Draw current vehicle state
 	string status = StringFormat("Forward: %.1f, LRatio: %.1f, RRatio: %.1f, Brake: %.1f\n"
 								 "Gear: %d, Clutch: %.1f, EngineRPM: %.0f, V: %.1f km/h", 
 								 (double)mForwardInput, (double)mLeftRatio, (double)mRightRatio, (double)mBrakeInput, 
-								 (double)mTransmission.GetCurrentGear(), (double)mTransmission.GetClutchFriction(), (double)mEngine.GetCurrentRPM(), (double)body->GetLinearVelocity().Length() * 3.6);
+								 mTransmission.GetCurrentGear(), (double)mTransmission.GetClutchFriction(), (double)mEngine.GetCurrentRPM(), (double)body->GetLinearVelocity().Length() * 3.6);
 	inRenderer->DrawText3D(body->GetPosition(), status, Color::sWhite, mConstraint.GetDrawConstraintSize());
 
 	for (const VehicleTrack &t : mTracks)

+ 10 - 2
Jolt/Physics/Vehicle/TrackedVehicleController.h

@@ -103,8 +103,10 @@ public:
 	/// Get the tracks this vehicle has (writable interface, allows you to make changes to the configuration which will take effect the next time step)
 	VehicleTracks &				GetTracks()									{ return mTracks; }
 
-	/// Multiply an angular velocity (rad/s) with this value to get rounds per minute (RPM)
-	static constexpr float		cAngularVelocityToRPM = 60.0f / (2.0f * JPH_PI);
+#ifdef JPH_DEBUG_RENDERER
+	/// Debug drawing of RPM meter
+	void						SetRPMMeter(Vec3Arg inPosition, float inSize) { mRPMMeterPosition = inPosition; mRPMMeterSize = inSize; }
+#endif // JPH_DEBUG_RENDERER
 
 protected:
 	/// Synchronize angular velocities of left and right tracks according to their ratios
@@ -131,6 +133,12 @@ protected:
 	VehicleEngine				mEngine;									///< Engine state of the vehicle
 	VehicleTransmission			mTransmission;								///< Transmission state of the vehicle
 	VehicleTracks				mTracks;									///< Tracks of the vehicle
+
+#ifdef JPH_DEBUG_RENDERER
+	// Debug settings
+	Vec3						mRPMMeterPosition { 0, 1, 0 };				///< Position (in local space of the body) of the RPM meter when drawing the constraint
+	float						mRPMMeterSize = 0.5f;						///< Size of the RPM meter when drawing the constraint
+#endif // JPH_DEBUG_RENDERER
 };
 
 } // JPH

+ 6 - 0
Jolt/Physics/Vehicle/VehicleConstraint.h

@@ -58,6 +58,12 @@ public:
 	/// Set the interface that tests collision between wheel and ground
 	void						SetVehicleCollisionTester(const VehicleCollisionTester *inTester) { mVehicleCollisionTester = inTester; }
 
+	/// Get the local space forward vector of the vehicle
+	Vec3						GetLocalForward() const						{ return mForward; }
+
+	/// Get the local space up vector of the vehicle
+	Vec3						GetLocalUp() const							{ return mUp; }
+
 	/// Access to the vehicle body
 	Body *						GetVehicleBody() const						{ return mBody; }
 

+ 66 - 0
Jolt/Physics/Vehicle/VehicleEngine.cpp

@@ -5,6 +5,9 @@
 
 #include <Physics/Vehicle/VehicleEngine.h>
 #include <ObjectStream/TypeDeclarations.h>
+#ifdef JPH_DEBUG_RENDERER
+	#include <Renderer/DebugRenderer.h>
+#endif // JPH_DEBUG_RENDERER
 
 namespace JPH {
 
@@ -40,6 +43,69 @@ void VehicleEngineSettings::RestoreBinaryState(StreamIn &inStream)
 	mNormalizedTorque.RestoreBinaryState(inStream);
 }
 
+void VehicleEngine::UpdateRPM(float inDeltaTime, float inAcceleration)
+{
+	// Angular damping: dw/dt = -c * w
+	// Solution: w(t) = w(0) * e^(-c * t) or w2 = w1 * e^(-c * dt)
+	// Taylor expansion of e^(-c * dt) = 1 - c * dt + ...
+	// Since dt is usually in the order of 1/60 and c is a low number too this approximation is good enough
+	mCurrentRPM *= max(0.0f, 1.0f - mAngularDamping * inDeltaTime);
+
+	// Accelerate engine using torque
+	mCurrentRPM += cAngularVelocityToRPM * GetTorque(inAcceleration) * inDeltaTime / mInertia;
+
+	// Clamp RPM
+	mCurrentRPM = Clamp(mCurrentRPM, mMinRPM, mMaxRPM);
+}
+
+#ifdef JPH_DEBUG_RENDERER
+
+void VehicleEngine::DrawRPM(DebugRenderer *inRenderer, Vec3Arg inPosition, Vec3Arg inForward, Vec3Arg inUp, float inSize, float inShiftDownRPM, float inShiftUpRPM) const
+{
+	// Function that converts RPM to an angle in radians
+	auto rpm_to_angle = [this](float inRPM) { return (-0.75f + 1.5f * (inRPM - mMinRPM) / (mMaxRPM - mMinRPM)) * JPH_PI; };
+
+	// Function to draw part of a pie
+	auto draw_pie = [rpm_to_angle, inRenderer, inSize, inPosition, inForward, inUp](float inMinRPM, float inMaxRPM, Color inColor) { 
+		inRenderer->DrawPie(inPosition, inSize, inForward, inUp, rpm_to_angle(inMinRPM), rpm_to_angle(inMaxRPM), inColor, DebugRenderer::ECastShadow::Off);
+	};
+
+	// Draw segment until inShiftDownRPM
+	if (mCurrentRPM < inShiftDownRPM)
+	{
+		draw_pie(mMinRPM, mCurrentRPM, Color::sRed);
+		draw_pie(mCurrentRPM, inShiftDownRPM, Color::sDarkRed);
+	}
+	else
+	{
+		draw_pie(mMinRPM, inShiftDownRPM, Color::sRed);
+	}
+
+	// Draw segment between inShiftDownRPM and inShiftUpRPM
+	if (mCurrentRPM > inShiftDownRPM && mCurrentRPM < inShiftUpRPM)
+	{
+		draw_pie(inShiftDownRPM, mCurrentRPM, Color::sOrange);
+		draw_pie(mCurrentRPM, inShiftUpRPM, Color::sDarkOrange);
+	}
+	else
+	{
+		draw_pie(inShiftDownRPM, inShiftUpRPM, mCurrentRPM <= inShiftDownRPM? Color::sDarkOrange : Color::sOrange);
+	}
+
+	// Draw segment above inShiftUpRPM
+	if (mCurrentRPM > inShiftUpRPM)
+	{
+		draw_pie(inShiftUpRPM, mCurrentRPM, Color::sGreen);
+		draw_pie(mCurrentRPM, mMaxRPM, Color::sDarkGreen);
+	}
+	else
+	{
+		draw_pie(inShiftUpRPM, mMaxRPM, Color::sDarkGreen);
+	}
+}
+
+#endif // JPH_DEBUG_RENDERER
+
 void VehicleEngine::SaveState(StateRecorder &inStream) const
 {
 	inStream.Write(mCurrentRPM);

+ 23 - 0
Jolt/Physics/Vehicle/VehicleEngine.h

@@ -11,6 +11,10 @@
 
 namespace JPH {
 
+#ifdef JPH_DEBUG_RENDERER
+	class DebugRenderer;
+#endif // JPH_DEBUG_RENDERER
+
 /// Generic properties for a vehicle engine
 class VehicleEngineSettings
 {
@@ -30,18 +34,37 @@ public:
 	float					mMinRPM = 1000.0f;							///< Min amount of revolutions per minute (rpm) the engine can produce without stalling
 	float					mMaxRPM = 6000.0f;							///< Max amount of revolutions per minute (rpm) the engine can generate
 	LinearCurve				mNormalizedTorque;							///< Curve that describes a ratio of the max torque the engine can produce vs the fraction of the max RPM of the engine
+	float					mInertia = 2.0f;							///< Moment of inertia (kg m^2) of the engine
+	float					mAngularDamping = 0.2f;						///< Angular damping factor of the wheel: dw/dt = -c * w
 };
 
 /// Runtime data for engine
 class VehicleEngine : public VehicleEngineSettings
 {
 public:
+	/// Multiply an angular velocity (rad/s) with this value to get rounds per minute (RPM)
+	static constexpr float	cAngularVelocityToRPM = 60.0f / (2.0f * JPH_PI);
+
 	/// Current rotation speed of engine in rounds per minute
 	float					GetCurrentRPM() const						{ return mCurrentRPM; }
 
 	/// Update rotation speed of engine in rounds per minute
 	void					SetCurrentRPM(float inRPM)					{ mCurrentRPM = inRPM; }
 
+	/// Get the amount of torque (N m) that the engine can supply
+	/// @param inAcceleration How much the gas pedal is pressed [0, 1]
+	float					GetTorque(float inAcceleration) const		{ return inAcceleration * mMaxTorque * mNormalizedTorque.GetValue(mCurrentRPM / mMaxRPM); }
+
+	/// Update the engine RPM assuming the engine is not connected to the wheels
+	/// @param inDeltaTime Delta time in seconds
+	/// @param inAcceleration How much the gas pedal is pressed [0, 1]
+	void					UpdateRPM(float inDeltaTime, float inAcceleration);
+
+#ifdef JPH_DEBUG_RENDERER
+	/// Debug draw a RPM meter
+	void					DrawRPM(DebugRenderer *inRenderer, Vec3Arg inPosition, Vec3Arg inForward, Vec3Arg inUp, float inSize, float inShiftDownRPM, float inShiftUpRPM) const;
+#endif // JPH_DEBUG_RENDERER
+
 	/// Saving state for replay
 	void					SaveState(StateRecorder &inStream) const;
 	void					RestoreState(StateRecorder &inStream);

+ 1 - 1
Jolt/Physics/Vehicle/Wheel.h

@@ -30,7 +30,7 @@ public:
 	float					mSuspensionMinLength = 0.3f;				///< How long the suspension is in max raised position relative to the attachment point (m)
 	float					mSuspensionMaxLength = 0.5f;				///< How long the suspension is in max droop position relative to the attachment point (m)
 	float					mSuspensionPreloadLength = 0.0f;			///< The natural length (m) of the suspension spring is defined as mSuspensionMaxLength + mSuspensionPreloadLength. Can be used to preload the suspension as the spring is compressed by mSuspensionPreloadLength when the suspension is in max droop position. Note that this means when the vehicle touches the ground there is a discontinuity so it will also make the vehicle more bouncy as we're updating with discrete time steps.
-	float					mSuspensionFrequency = 2.0f;				///< Natural frequency of the suspension spring (Hz)
+	float					mSuspensionFrequency = 1.5f;				///< Natural frequency of the suspension spring (Hz)
 	float					mSuspensionDamping = 0.5f;					///< Damping factor of the suspension spring (0 = no damping, 1 = critical damping)
 	float					mRadius = 0.3f;								///< Radius of the wheel (m)
 	float					mWidth = 0.1f;								///< Width of the wheel (m)

+ 19 - 9
Jolt/Physics/Vehicle/WheeledVehicleController.cpp

@@ -210,9 +210,8 @@ void WheeledVehicleController::PostCollide(float inDeltaTime, PhysicsSystem &inP
 	}
 	
 	// First calculate engine speed based on speed of all wheels
-	// TODO: Not correct, if the wheels are not connected or the clutch is pressed the RPM should go up when the user presses the gas (we're missing engine inertia in the equation too)
 	bool can_engine_apply_torque = false;
-	if (mTransmission.GetCurrentGear() != 0)
+	if (mTransmission.GetCurrentGear() != 0 && mTransmission.GetClutchFriction() > 1.0e-3f)
 	{
 		float transmission_ratio = mTransmission.GetCurrentRatio();
 		bool forward = transmission_ratio >= 0.0f;
@@ -242,21 +241,26 @@ void WheeledVehicleController::PostCollide(float inDeltaTime, PhysicsSystem &inP
 
 		// Update RPM only if the wheels are connected to the engine
 		if (slowest_wheel_speed > -FLT_MAX && slowest_wheel_speed < FLT_MAX)
-			mEngine.SetCurrentRPM(slowest_wheel_speed * transmission_ratio * cAngularVelocityToRPM);
+			mEngine.SetCurrentRPM(slowest_wheel_speed * transmission_ratio * VehicleEngine::cAngularVelocityToRPM);
 		mEngine.SetCurrentRPM(Clamp(mEngine.GetCurrentRPM(), mEngine.mMinRPM, mEngine.mMaxRPM));
 	}
+	else
+	{
+		// Engine not connected to wheels, update RPM based on engine inertia alone
+		mEngine.UpdateRPM(inDeltaTime, abs(mForwardInput));
+	}
 
 	// Update transmission
 	mTransmission.Update(inDeltaTime, mEngine.GetCurrentRPM(), mForwardInput, can_engine_apply_torque);
 
 	// Calculate the amount of torque the transmission gives to the differentials
 	float transmission_ratio = mTransmission.GetCurrentRatio();
-	float transmission_torque = mTransmission.GetClutchFriction() * transmission_ratio * abs(mForwardInput) * mEngine.mMaxTorque * mEngine.mNormalizedTorque.GetValue(mEngine.GetCurrentRPM() / mEngine.mMaxRPM);
+	float transmission_torque = mTransmission.GetClutchFriction() * transmission_ratio * mEngine.GetTorque(abs(mForwardInput));
 	if (transmission_torque != 0.0f)
 	{
 		// Calculate the max angular velocity of the differential given current engine RPM
 		// Note this adds 0.1% slop to avoid numerical accuracy issues
-		float differential_max_angular_velocity = abs(mEngine.GetCurrentRPM() / (transmission_ratio * cAngularVelocityToRPM)) * 1.001f;
+		float differential_max_angular_velocity = mEngine.GetCurrentRPM() / (transmission_ratio * VehicleEngine::cAngularVelocityToRPM) * 1.001f;
 
 		// Apply the transmission torque to the wheels
 		for (const VehicleDifferentialSettings &d : mDifferentials)
@@ -272,7 +276,7 @@ void WheeledVehicleController::PostCollide(float inDeltaTime, PhysicsSystem &inP
 				if (d.mLeftWheel != -1 && d.mLeftRightSplit < 1.0f)
 				{
 					WheelWV *w = static_cast<WheelWV *>(wheels[d.mLeftWheel]);
-					if (w->GetAngularVelocity() * wheel_max_angular_velocity < 0.0f || abs(w->GetAngularVelocity()) < wheel_max_angular_velocity)
+					if (w->GetAngularVelocity() * wheel_max_angular_velocity < 0.0f || abs(w->GetAngularVelocity()) < abs(wheel_max_angular_velocity))
 					{
 						float wheel_torque = differential_torque * (1.0f - d.mLeftRightSplit);
 						w->ApplyTorque(wheel_torque, inDeltaTime);
@@ -283,7 +287,7 @@ void WheeledVehicleController::PostCollide(float inDeltaTime, PhysicsSystem &inP
 				if (d.mRightWheel != -1 && d.mLeftRightSplit > 0.0f)
 				{
 					WheelWV *w = static_cast<WheelWV *>(wheels[d.mRightWheel]);
-					if (w->GetAngularVelocity() * wheel_max_angular_velocity < 0.0f || abs(w->GetAngularVelocity()) < wheel_max_angular_velocity)
+					if (w->GetAngularVelocity() * wheel_max_angular_velocity < 0.0f || abs(w->GetAngularVelocity()) < abs(wheel_max_angular_velocity))
 					{
 						float wheel_torque = differential_torque * d.mLeftRightSplit;
 						w->ApplyTorque(wheel_torque, inDeltaTime);
@@ -399,12 +403,18 @@ bool WheeledVehicleController::SolveLongitudinalAndLateralConstraints(float inDe
 
 void WheeledVehicleController::Draw(DebugRenderer *inRenderer) const 
 {
-	// Draw current vehicle state
+	// Draw RPM
 	Body *body = mConstraint.GetVehicleBody();
+	Vec3 rpm_meter_up = body->GetRotation() * mConstraint.GetLocalUp();
+	Vec3 rpm_meter_pos = body->GetPosition() + body->GetRotation() * mRPMMeterPosition;
+	Vec3 rpm_meter_fwd = body->GetRotation() * mConstraint.GetLocalForward();
+	mEngine.DrawRPM(inRenderer, rpm_meter_pos, rpm_meter_fwd, rpm_meter_up, mRPMMeterSize, mTransmission.mShiftDownRPM, mTransmission.mShiftUpRPM);
+
+	// Draw current vehicle state
 	string status = StringFormat("Forward: %.1f, Right: %.1f, Brake: %.1f, HandBrake: %.1f\n"
 								 "Gear: %d, Clutch: %.1f, EngineRPM: %.0f, V: %.1f km/h", 
 								 (double)mForwardInput, (double)mRightInput, (double)mBrakeInput, (double)mHandBrakeInput, 
-								 (double)mTransmission.GetCurrentGear(), (double)mTransmission.GetClutchFriction(), (double)mEngine.GetCurrentRPM(), (double)body->GetLinearVelocity().Length() * 3.6);
+								 mTransmission.GetCurrentGear(), (double)mTransmission.GetClutchFriction(), (double)mEngine.GetCurrentRPM(), (double)body->GetLinearVelocity().Length() * 3.6);
 	inRenderer->DrawText3D(body->GetPosition(), status, Color::sWhite, mConstraint.GetDrawConstraintSize());
 
 	for (const Wheel *w_base : mConstraint.GetWheels())

+ 10 - 2
Jolt/Physics/Vehicle/WheeledVehicleController.h

@@ -114,8 +114,10 @@ public:
 	/// Get the differentials this vehicle has (writable interface, allows you to make changes to the configuration which will take effect the next time step)
 	Differentials &				GetDifferentials()							{ return mDifferentials; }
 
-	/// Multiply an angular velocity (rad/s) with this value to get rounds per minute (RPM)
-	static constexpr float		cAngularVelocityToRPM = 60.0f / (2.0f * JPH_PI);
+#ifdef JPH_DEBUG_RENDERER
+	/// Debug drawing of RPM meter
+	void						SetRPMMeter(Vec3Arg inPosition, float inSize) { mRPMMeterPosition = inPosition; mRPMMeterSize = inSize; }
+#endif // JPH_DEBUG_RENDERER
 
 protected:
 	// See: VehicleController
@@ -139,6 +141,12 @@ protected:
 	VehicleEngine				mEngine;									///< Engine state of the vehicle
 	VehicleTransmission			mTransmission;								///< Transmission state of the vehicle
 	Differentials				mDifferentials;								///< Differential states of the vehicle
+
+#ifdef JPH_DEBUG_RENDERER
+	// Debug settings
+	Vec3						mRPMMeterPosition { 0, 1, 0 };				///< Position (in local space of the body) of the RPM meter when drawing the constraint
+	float						mRPMMeterSize = 0.5f;						///< Size of the RPM meter when drawing the constraint
+#endif // JPH_DEBUG_RENDERER
 };
 
 } // JPH

+ 3 - 0
Samples/Tests/Vehicle/TankTest.cpp

@@ -110,6 +110,9 @@ void TankTest::Initialize()
 
 	mVehicleConstraint = new VehicleConstraint(*mTankBody, vehicle);
 	mVehicleConstraint->SetVehicleCollisionTester(new VehicleCollisionTesterRay(Layers::MOVING));
+#ifdef JPH_DEBUG_RENDERER
+	static_cast<TrackedVehicleController *>(mVehicleConstraint->GetController())->SetRPMMeter(Vec3(0, 2, 0), 0.5f);
+#endif // JPH_DEBUG_RENDERER
 	mPhysicsSystem->AddConstraint(mVehicleConstraint);
 	mPhysicsSystem->AddStepListener(mVehicleConstraint);
 

+ 0 - 2
Samples/Tests/Vehicle/VehicleConstraintTest.cpp

@@ -35,7 +35,6 @@ void VehicleConstraintTest::Initialize()
 	const float half_vehicle_height = 0.2f;
 	const float suspension_min_length = 0.3f;
 	const float suspension_max_length = 0.5f;
-	const float suspension_frequency = 1.5f;
 	const float max_steering_angle = DegreesToRadians(30);
 
 	// Create collision testers
@@ -83,7 +82,6 @@ void VehicleConstraintTest::Initialize()
 		w->mWidth = wheel_width;
 		w->mSuspensionMinLength = suspension_min_length;
 		w->mSuspensionMaxLength = suspension_max_length;
-		w->mSuspensionFrequency = suspension_frequency;
 	}
 
 	WheeledVehicleControllerSettings *controller = new WheeledVehicleControllerSettings;