SuperDex Physics C++ API
Loading...
Searching...
No Matches
superdex::ContactPoint Struct Reference

Information about a contact point between two actors. More...

#include <mochi_structs.h>

Public Attributes

ActorHandle actorA = {}
 Handle of the colliding actor.
ActorHandle actorB = {}
 Handle of the collider actor.
real distance = 0_r
 Signed separation distance [m] between posA (on actorA) and the closest point on the surface of actorB.
int elementIndex = -1
 Element index in the mesh used for colliding samples on actorA.
Real3 force = {}
 Contact force [N] applied to actorA from actorB in world frame.
real intWeight = 0_r
 Quadrature integration weight of the sample point on the colliding manifold of actorA.
Real3 normal = {}
 Contact normal in world frame pointing away from actorB.
Real3 parametricCoords = {}
 Parametric coordinates within the surface element of actorA.
Real3 pointVelocityA = {}
 Velocity [m/s] of the contact point on actorA in world frame.
Real3 pointVelocityB = {}
 Velocity [m/s] of the contact point on actorB in world frame.
Real3 posA = {}
 Contact position [m] on actorA in world frame.
Real3 posB = {}
 Approximate contact position [m] on actorB in world frame.
int sampleIndex = 0
 Sample point index of actorA.

Detailed Description

Information about a contact point between two actors.

Describes a single contact or near-contact point between two actors. Contains geometric information (positions, normal, distance), kinematic data (velocities), and dynamic data (force). Also includes finite element discretization information for accurate force interpolation.

Note
Available via Actor::GetContactPointsWorld after registering QueryType::ContactPoints.
See also
QueryType::ContactPoints, Actor::RegisterQuery, Actor::GetContactPointsWorld

Definition at line 456 of file mochi_structs.h.

Member Data Documentation

◆ actorA

ActorHandle superdex::ContactPoint::actorA = {}

Handle of the colliding actor.

Note
When calling Actor::GetContactPointsWorld, the actor being queried may be reported as either actorA or actorB in this struct, depending on the direction of the contact test.
May be the same as actorB in the case of self-contact.

Definition at line 457 of file mochi_structs.h.

◆ actorB

ActorHandle superdex::ContactPoint::actorB = {}

Handle of the collider actor.

Note
When calling Actor::GetContactPointsWorld, the actor being queried may be reported as either actorA or actorB in this struct, depending on the direction of the contact test.
May be the same as actorA in the case of self-contact.

Definition at line 459 of file mochi_structs.h.

◆ distance

real superdex::ContactPoint::distance = 0_r

Signed separation distance [m] between posA (on actorA) and the closest point on the surface of actorB.

Negative if the point is inside (i.e. actors overlap).

Definition at line 461 of file mochi_structs.h.

◆ elementIndex

int superdex::ContactPoint::elementIndex = -1

Element index in the mesh used for colliding samples on actorA.

Note
For shell actors, this is the physics mesh returned by Actor::GetMesh unless contact-skin contact is enabled, in which case it is the compact contact skin returned by Actor::GetSurfaceMesh.
For rod actors, this field is not populated and is reported as 0. Use sampleIndex to identify the contact location.

Definition at line 479 of file mochi_structs.h.

◆ force

Real3 superdex::ContactPoint::force = {}

Contact force [N] applied to actorA from actorB in world frame.

Definition at line 469 of file mochi_structs.h.

◆ intWeight

real superdex::ContactPoint::intWeight = 0_r

Quadrature integration weight of the sample point on the colliding manifold of actorA.

Note
Units depend on the dimensionality of the colliding manifold of actorA: [m²] for surface contact (e.g., rigid, articulated, soft, shell, and rod actors using contact-skin contact), or [m] for rod actors using centerline contact.
For surface contact, represents the surface area corresponding to the sample point. For rod centerline contact, represents the arc length.
Useful for contact area/length estimation and other post-processing.
force is already weighted by this value.

Definition at line 477 of file mochi_structs.h.

◆ normal

Real3 superdex::ContactPoint::normal = {}

Contact normal in world frame pointing away from actorB.

Unit length.

Definition at line 467 of file mochi_structs.h.

◆ parametricCoords

Real3 superdex::ContactPoint::parametricCoords = {}

Parametric coordinates within the surface element of actorA.

Note
Corresponds to finite-element basis function values at the contact sample quadrature point.
For linear finite elements, these match barycentric coordinates.
Allows interpolation of functions defined on triangle vertices.
For rod actors, this field is not populated and is reported as {0, 0, 0}. Use sampleIndex to identify the contact location.

Definition at line 481 of file mochi_structs.h.

◆ pointVelocityA

Real3 superdex::ContactPoint::pointVelocityA = {}

Velocity [m/s] of the contact point on actorA in world frame.

Definition at line 471 of file mochi_structs.h.

◆ pointVelocityB

Real3 superdex::ContactPoint::pointVelocityB = {}

Velocity [m/s] of the contact point on actorB in world frame.

Definition at line 473 of file mochi_structs.h.

◆ posA

Real3 superdex::ContactPoint::posA = {}

Contact position [m] on actorA in world frame.

Definition at line 463 of file mochi_structs.h.

◆ posB

Real3 superdex::ContactPoint::posB = {}

Approximate contact position [m] on actorB in world frame.

Note
Equivalent to (posA - normal * distance).

Definition at line 465 of file mochi_structs.h.

◆ sampleIndex

int superdex::ContactPoint::sampleIndex = 0

Sample point index of actorA.

Definition at line 475 of file mochi_structs.h.


The documentation for this struct was generated from the following files: