Struct ContactPatchRequest

Struct Documentation

struct ContactPatchRequest

Request for a contact patch computation.

Public Functions

inline explicit ContactPatchRequest(size_t max_num_patch = 1, size_t num_samples_curved_shapes = ContactPatch::default_preallocated_size, CoalScalar patch_tolerance = 1e-3)

Default constructor.

Parameters:
  • max_num_patch – maximum number of contact patches per collision pair.

  • max_sub_patch_size – maximum size of each sub contact patch. Each contact patch contains an internal representation for an inscribed sub contact patch. This allows physics simulation to always work with a predetermined maximum size for each contact patch. A sub contact patch is simply a subset of the vertices of a contact patch.

  • num_samples_curved_shapes – for shapes like cones and cylinders, which have smooth basis (circles in this case), we need to sample a certain amount of point of this basis.

  • patch_tolerance – the tolerance below which a point of a shape is considered to belong to the support set of this shape in the direction of the normal. Said otherwise, patch_tolerance determines the “thickness” of the separating plane between shapes of a collision pair.

inline explicit ContactPatchRequest(const CollisionRequest &collision_request, size_t num_samples_curved_shapes = ContactPatch::default_preallocated_size, CoalScalar patch_tolerance = 1e-3)

Construct a contact patch request from a collision request.

inline void setNumSamplesCurvedShapes(const size_t num_samples_curved_shapes)

Maximum samples to compute the support sets of curved shapes, i.e. when the normal is perpendicular to the base of a cylinder. For now, only relevant for Cone and Cylinder. In the future this might be extended to Sphere and Ellipsoid.

inline size_t getNumSamplesCurvedShapes() const

Maximum samples to compute the support sets of curved shapes, i.e. when the normal is perpendicular to the base of a cylinder. For now, only relevant for Cone and Cylinder. In the future this might be extended to Sphere and Ellipsoid.

inline void setPatchTolerance(const CoalScalar patch_tolerance)

Tolerance below which points are added to a contact patch. In details, given two shapes S1 and S2, a contact patch is the triple intersection between the separating plane (P) (passing by Contact::pos and supported by Contact::normal), S1 and S2; i.e. a contact patch is P & S1 & S2 if we denote & the set intersection operator. If a point p1 of S1 is at a distance below patch_tolerance from the separating plane, it is taken into account in the computation of the contact patch. Otherwise, it is not used for the computation.

Note

Needs to be positive.

inline CoalScalar getPatchTolerance() const

Tolerance below which points are added to a contact patch. In details, given two shapes S1 and S2, a contact patch is the triple intersection between the separating plane (P) (passing by Contact::pos and supported by Contact::normal), S1 and S2; i.e. a contact patch is P & S1 & S2 if we denote & the set intersection operator. If a point p1 of S1 is at a distance below patch_tolerance from the separating plane, it is taken into account in the computation of the contact patch. Otherwise, it is not used for the computation.

Note

Needs to be positive.

inline bool operator==(const ContactPatchRequest &other) const

Whether two ContactPatchRequest are identical or not.

Public Members

size_t max_num_patch

Maximum number of contact patches that will be computed.

Protected Attributes

size_t m_num_samples_curved_shapes

Maximum samples to compute the support sets of curved shapes, i.e. when the normal is perpendicular to the base of a cylinder. For now, only relevant for Cone and Cylinder. In the future this might be extended to Sphere and Ellipsoid.

CoalScalar m_patch_tolerance

Tolerance below which points are added to a contact patch. In details, given two shapes S1 and S2, a contact patch is the triple intersection between the separating plane (P) (passing by Contact::pos and supported by Contact::normal), S1 and S2; i.e. a contact patch is P & S1 & S2 if we denote & the set intersection operator. If a point p1 of S1 is at a distance below patch_tolerance from the separating plane, it is taken into account in the computation of the contact patch. Otherwise, it is not used for the computation.

Note

Needs to be positive.