Description

When a small external force is applied to the rigid body, the VSmooth value is reset in the ResetVSmoothFromForces function.

Since this function ignores the current velocity, a very small velocity is calculated and the rigid body goes to sleep.
The following workaround can solve this problem.

	void ResetVSmoothFromForces(int32 Index)
	{
		// Reset VSmooth to something roughly in the same direction as what V will be after integration.
		// This is temp fix, if this is only re-computed after solve, island will get incorrectly put back to sleep even if it was just impulsed.
		FReal FakeDT = (FReal)1. / (FReal)30.;
		if (this->LinearImpulseVelocity(Index).IsNearlyZero() == false || this->Acceleration(Index).IsNearlyZero() == false)
		{
//			this->VSmooth(Index) = this->Acceleration(Index) * FakeDT + this->LinearImpulseVelocity(Index);
			this->VSmooth(Index) += this->Acceleration(Index) * FakeDT + this->LinearImpulseVelocity(Index);
		}
		if (this->AngularImpulseVelocity(Index).IsNearlyZero() == false || this->AngularAcceleration(Index).IsNearlyZero() == false)
		{
//			this->WSmooth(Index) = this->AngularAcceleration(Index) * FakeDT + this->AngularImpulseVelocity(Index);
			this->WSmooth(Index) += this->AngularAcceleration(Index) * FakeDT + this->AngularImpulseVelocity(Index);
		}
	}

 

 

Steps to Reproduce

1.Open attached project [Link Removed] on ue5.0.1
2. Start PIE and see falling cubes

Result:

The Left cube falls more slowly than right one
Note : The left one is applied small force by AddForce.
[^AddForce Preview [NetMode_ Standalone] (64-bit_SM5) 2022-05-26 04-00-52.mp4]

 

Have Comments or More Details?

There's no existing public thread on this issue, so head over to Questions & Answers just mention UE-154118 in the post.

4
Login to Vote

Fixed
ComponentUE - Simulation - Physics - Solver
Affects Versions5.0.1
Target Fix5.1
Fix Commit19380083
CreatedMay 25, 2022
ResolvedOct 3, 2022
UpdatedOct 19, 2022