|
SuperDex Physics C++ API
|
Parameters for contact mechanics simulation. More...
#include <contact_params.h>
Public Member Functions | |
| ContactParams ()=default | |
| ContactParams (real penaltyCoefficient, real penaltySmoothingHalfDistance, real penaltyThresholdDefault, real penaltyThresholdExtraPadding, real collidingPenaltyThresholdPadding, bool frictionWithColliderNormal, real maxAlignmentNormals, real alignmentSmoothingFraction, real viscousFrictionCoefficient, real coulombFrictionCoefficient, bool preferElastoPlasticFriction, real frictionFalloffVel, real preslidingDisplacement, real normalViscousDampingCoefficient, real distanceErrorBound, real objScale, real collidingPenaltyLengthScale) | |
| Construct ContactParams with all parameters explicitly specified. | |
| real | GetPenaltyThresholdDist (bool addPadding) const |
| Get the total contact detection threshold. | |
| bool | operator== (ContactParams const &) const =default |
Public Attributes | |
| real | alignmentSmoothingFraction = 0.1_r |
| [Experimental] Width of the band of normal alignments, centered at maxAlignmentNormals, over which contact fades out, as a fraction of the range of alignments [-1, maxAlignmentNormals]. | |
| real | collidingPenaltyLengthScale = 1_r |
| [Experimental] Length scale [m] used to correct the penalty coefficient when the colliding body integrates contact traction over a lower-than-two-dimensional manifold, such as a rod or point mass. | |
| real | collidingPenaltyThresholdPadding = 0_r |
| [Experimental] Padding [m] added to the collider's contact detection threshold when this actor is the colliding actor. | |
| real | coulombFrictionCoefficient = 0.5_r |
| Coulomb friction coefficient (dimensionless). | |
| real | distanceErrorBound = 0_r |
| [Experimental] Padding [m] added to the collider's bounding volume for collision culling. | |
| real | frictionFalloffVel = 0.01_r |
| [Experimental] Velocity threshold for Coulomb friction smoothing [m/s]. | |
| bool | frictionWithColliderNormal = true |
| [Experimental] Use collider's normal (normalized SDF gradient) for friction direction if true, or the colliding's surface normal at the sample point if false. | |
| real | maxAlignmentNormals = 0_r |
| [Experimental] Maximum normal alignment threshold. | |
| real | normalViscousDampingCoefficient = 0_r |
| Normal viscous damping coefficient [s/m]. | |
| real | objScale = 1_r |
| [Experimental] Object scale relative to default size (dimensionless). | |
| real | penaltyCoefficient = 1e9_r |
| Stiffness of the contact penalty force [Pa/m]. | |
| real | penaltySmoothingHalfDistance = 0.005_r |
| PolyReLU smoothing half-width [m]. | |
| real | penaltyThresholdDefault = 0.001_r |
| Default contact detection threshold [m]. | |
| real | penaltyThresholdExtraPadding = 0_r |
| [Experimental] Extra padding [m] added to the default contact detection threshold if the colliding actor has ColliderType::None or ColliderType::PointCloud. | |
| bool | preferElastoPlasticFriction = true |
| [Experimental] Prefer elasto-plastic Coulomb friction to velocity-regularized Coulomb friction. | |
| real | preslidingDisplacement = 1e-4_r |
| Presliding displacement of elasto-plastic Coulomb friction [m]. | |
| real | viscousFrictionCoefficient = 0_r |
| Viscous friction coefficient [s/m]. | |
Parameters for contact mechanics simulation.
Definition at line 43 of file contact_params.h.
|
default |
|
inline |
Construct ContactParams with all parameters explicitly specified.
Definition at line 24 of file contact_params_inl.h.
|
inline |
Get the total contact detection threshold.
| addPadding | If true, includes penaltyThresholdExtraPadding. |
Definition at line 60 of file contact_params_inl.h.
|
default |
| real superdex::ContactParams::alignmentSmoothingFraction = 0.1_r |
[Experimental] Width of the band of normal alignments, centered at maxAlignmentNormals, over which contact fades out, as a fraction of the range of alignments [-1, maxAlignmentNormals].
The penalty force of a contact is scaled by a C1 smoothstep of its normal alignment, from 1 at an alignment of m - w / 2 to 0 at m + w / 2, with m = maxAlignmentNormals and w = alignmentSmoothingFraction * (m + 1). Contacts at m keep half their force. This removes the jump of the penalty force when contact is disabled. Contacts beyond the band are disabled, and friction fading (ExperimentalEvalParams::fadeFriction) ends at its top.
Definition at line 229 of file contact_params.h.
| real superdex::ContactParams::collidingPenaltyLengthScale = 1_r |
[Experimental] Length scale [m] used to correct the penalty coefficient when the colliding body integrates contact traction over a lower-than-two-dimensional manifold, such as a rod or point mass.
E.g., the penalty is scaled by this value if the colliding body lumps contact tractions on a line, or this value squared if lumping contact forces on a point.
Definition at line 387 of file contact_params.h.
| real superdex::ContactParams::collidingPenaltyThresholdPadding = 0_r |
[Experimental] Padding [m] added to the collider's contact detection threshold when this actor is the colliding actor.
Definition at line 168 of file contact_params.h.
| real superdex::ContactParams::coulombFrictionCoefficient = 0.5_r |
Coulomb friction coefficient (dimensionless).
Definition at line 252 of file contact_params.h.
| real superdex::ContactParams::distanceErrorBound = 0_r |
[Experimental] Padding [m] added to the collider's bounding volume for collision culling.
Definition at line 359 of file contact_params.h.
| real superdex::ContactParams::frictionFalloffVel = 0.01_r |
[Experimental] Velocity threshold for Coulomb friction smoothing [m/s].
The Coulomb friction force smoothly transitions from 0 to full strength as tangential velocity increases from 0 to frictionFalloffVel.
Definition at line 297 of file contact_params.h.
| bool superdex::ContactParams::frictionWithColliderNormal = true |
[Experimental] Use collider's normal (normalized SDF gradient) for friction direction if true, or the colliding's surface normal at the sample point if false.
Definition at line 182 of file contact_params.h.
| real superdex::ContactParams::maxAlignmentNormals = 0_r |
[Experimental] Maximum normal alignment threshold.
Normal alignment is defined as the dot product between colliding and collider normals. Contact is disabled for sample points whose normal alignment exceeds this threshold, abruptly or over a band centered at it (see alignmentSmoothingFraction). This prevents sample points from being trapped inside the collider when penetration is large.
Definition at line 203 of file contact_params.h.
| real superdex::ContactParams::normalViscousDampingCoefficient = 0_r |
Normal viscous damping coefficient [s/m].
Damping force in the normal direction, proportional to the elastic normal contact force and the normal velocity. Analogous to viscousFrictionCoefficient but acting in the normal direction instead of tangentially.
experimental::CalibrateNormalViscousDampingCoefficient computes the coefficient that approximates a target CoR, while experimental::EffectiveCoefficientOfRestitution recovers the CoR produced by a coefficient. Definition at line 344 of file contact_params.h.
| real superdex::ContactParams::objScale = 1_r |
[Experimental] Object scale relative to default size (dimensionless).
Used by deep flow only.
Definition at line 370 of file contact_params.h.
| real superdex::ContactParams::penaltyCoefficient = 1e9_r |
Stiffness of the contact penalty force [Pa/m].
Definition at line 107 of file contact_params.h.
| real superdex::ContactParams::penaltySmoothingHalfDistance = 0.005_r |
PolyReLU smoothing half-width [m].
The penalty force transitions from 0 to linear over the decreasing distance range (penaltyThreshold, penaltyThreshold - 2 * penaltySmoothingHalfDistance).
Definition at line 119 of file contact_params.h.
| real superdex::ContactParams::penaltyThresholdDefault = 0.001_r |
Default contact detection threshold [m].
The penalty force transitions from 0 to linear over the decreasing distance range (penaltyThreshold, penaltyThreshold - 2 * penaltySmoothingHalfDistance).
Definition at line 136 of file contact_params.h.
| real superdex::ContactParams::penaltyThresholdExtraPadding = 0_r |
[Experimental] Extra padding [m] added to the default contact detection threshold if the colliding actor has ColliderType::None or ColliderType::PointCloud.
Definition at line 151 of file contact_params.h.
| bool superdex::ContactParams::preferElastoPlasticFriction = true |
[Experimental] Prefer elasto-plastic Coulomb friction to velocity-regularized Coulomb friction.
Elasto-plastic friction measures the tangential displacement of each contact from its anchor, a point of the collider, so a contact holds a tangential load below the Coulomb limit without slip (see preslidingDisplacement). Velocity-regularized friction acts only through slip, so held objects creep (see frictionFalloffVel).
Definition at line 278 of file contact_params.h.
| real superdex::ContactParams::preslidingDisplacement = 1e-4_r |
Presliding displacement of elasto-plastic Coulomb friction [m].
With elasto-plastic friction (see preferElastoPlasticFriction), the Coulomb friction force smoothly transitions from 0 to full strength as the tangential displacement of a contact from its anchor increases from 0 to preslidingDisplacement, and beyond it the anchor follows the contact. A held contact springs back by up to preslidingDisplacement once the load is removed.
Definition at line 319 of file contact_params.h.
| real superdex::ContactParams::viscousFrictionCoefficient = 0_r |
Viscous friction coefficient [s/m].
Definition at line 241 of file contact_params.h.