Tweak air lif/drag coeffs to properly simulate wind on cloth
This commit is contained in:
@@ -62,12 +62,12 @@ API_CLASS(Attributes="ActorContextMenu(\"New/Physics/Cloth\"), ActorToolbox(\"Ph
|
||||
/// <summary>
|
||||
/// Defines how much drag air applies to the cloth particles. Set to 0 to disable wind.
|
||||
/// </summary>
|
||||
API_FIELD(Attributes="Limit(0, 1)") float AirDragCoefficient = 0.0f;
|
||||
API_FIELD(Attributes="Limit(0, 1)") float AirDragCoefficient = 0.02f;
|
||||
|
||||
/// <summary>
|
||||
/// Defines how much lift air applies to the cloth particles. Set to 0 to disable wind.
|
||||
/// </summary>
|
||||
API_FIELD(Attributes="Limit(0, 1)") float AirLiftCoefficient = 0.0f;
|
||||
API_FIELD(Attributes="Limit(0, 1)") float AirLiftCoefficient = 0.02f;
|
||||
|
||||
/// <summary>
|
||||
/// Defines fluid density of air used for drag and lift calculations.
|
||||
|
||||
@@ -3450,8 +3450,8 @@ void PhysicsBackend::SetClothForceSettings(void* cloth, const void* settingsPtr)
|
||||
clothPhysX->setLinearInertia(PxVec3(settings.LinearInertia));
|
||||
clothPhysX->setAngularInertia(PxVec3(settings.AngularInertia));
|
||||
clothPhysX->setCentrifugalInertia(PxVec3(settings.CentrifugalInertia));
|
||||
clothPhysX->setDragCoefficient(Math::Saturate(settings.AirDragCoefficient));
|
||||
clothPhysX->setLiftCoefficient(Math::Saturate(settings.AirLiftCoefficient));
|
||||
clothPhysX->setDragCoefficient(Math::Saturate(settings.AirDragCoefficient) * 0.01f);
|
||||
clothPhysX->setLiftCoefficient(Math::Saturate(settings.AirLiftCoefficient) * 0.01f);
|
||||
clothPhysX->setFluidDensity(Math::Max(settings.AirDensity, ZeroTolerance));
|
||||
auto& clothSettings = Cloths[clothPhysX];
|
||||
clothSettings.GravityScale = settings.GravityScale;
|
||||
|
||||
Reference in New Issue
Block a user