raisim::contact::Single3DContactProblem
class · #include <raisim/contact/BisectionContactSolver.hpp>
One constraint row (contact, joint limit, wire or pin) of the contact problem that the World solves each step; World::getContactProblem() exposes the list. For contact rows, imp_i is expressed in the contact frame of the corresponding Contact and acts on obA (obB receives the negated impulse).
64-byte aligned so that the hot region below always occupies the same cache lines of every element (with the natural 8-byte alignment, the 16-byte drift of the 848-byte stride made the hot region straddle a different set of lines for each contact)
Constructors & destructor
Single3DContactProblem
Single3DContactProblem(
const MaterialPairProperties &mat,
double x,
double y,
double z,
double depth_in)Parameters
| Parameter | Description |
|---|---|
mat (in) | Material-pair properties (friction, restitution, static/rolling/spinning friction). |
x (in) | Contact position x in the world frame. |
y (in) | Contact position y in the world frame. |
z (in) | Contact position z in the world frame. |
depth_in (in) | Signed separation (negative when penetrating), see Contact::getDepth(). |
Single3DContactProblem() = defaultKeep it defaulted: value-initialization (emplace_back()) then zero-fills every member without a default member initializer and makes Mapp_i the active union member. The world refills the same row storage every step, and joint-limit and joint-friction rows set only the fields they use, so a user-provided constructor would hand them the fields of the row stored there before.
Public member functions
checkRank
void checkRank()Lower rank of a rank-3 contact or pin row whose apparent inverse inertia is degenerate (see contact::rank).
hasAngularFriction
bool hasAngularFriction() constReturns true if rolling or spinning friction is enabled for this contact.
Public attributes
obA
Object *obAmembers are ordered hot-to-cold for the Gauss-Seidel sweep. the fields from obA through normVecRatio are exactly 320 bytes (5 cache lines): everything a rank-3 single-body contact touches per sweep visit, including the slipping branch. basisMat and the 2x2 matrices (rank 2) and the sparse pointers (articulated systems) follow
obB
Object *obBrank
int rankConstraint kind, one of the contact::rank values.
imp_i
raisim::Vec<3> imp_iimp_i: the solved impulse (contact frame for contact rows), acting on obA.
velInit
raisim::Vec<3> velInitMappInv_i
raisim::Mat<3, 3> MappInv_iInverse apparent inertia (Delassus matrix) of the row: sum of both objects' contributions.
Mapp_i
raisim::Mat<3, 3> Mapp_iterrainState
TerrainContactSolveState terrainState(anonymous union)
An anonymous union: its members are listed with the other attributes and share storage.
Soil rows do not need a sticking inverse. Reuse its storage for their per-solve constants and pressure evaluations without widening any contact row.
mu
double mumu: Coulomb friction coefficient of the material pair, after static-friction blending (muinv = 1 / mu).
n2_mu
double n2_mumuinv
double muinvbouceVel
double bouceVeltempE
double tempEJA
const Mat<3, 6> *JAdirect pointers to the body data of single-body objects. they let the solver skip the virtual dispatch of the velocity updates in the iteration loop. null for other objects
JB
const Mat<3, 6> *JBMinvJTA
const Mat<6, 3> *MinvJTAMinvJTB
const Mat<6, 3> *MinvJTBgenVelA
Vec<6> *genVelAgenVelB
Vec<6> *genVelBnormVecRatio
raisim::Vec<2> normVecRatioMappInv_i(k,2)/MappInv_i(2,2) for k=0,1. the slipping branch rebuilds the reduced apparent-inverse-mass matrix (MappInv_i's first two columns with their normal component projected out) from these two ratios instead of reading a stored 3x2 matrix Terrain rows instead cache a depth and its exact Bekker yield pressure here.
pointIdA
size_t pointIdAjointId
size_t jointId(anonymous union)
An anonymous union: its members are listed with the other attributes and share storage.
pointIdB
size_t pointIdBbasisMat
Mat<3, 2> basisMatMapp_iInv22
raisim::Mat<2, 2> Mapp_iInv22Terrain rows cache Wtt^-1 in Mapp_iInv22 for sticking updates during this solve. Mapp_i22 holds a shear-mobilization anchor in its first column and the tangential determinant and mobility bound in its second column.
Mapp_i22
raisim::Mat<2, 2> Mapp_i22Mapp_iInv11
double Mapp_iInv11sJA
const SparseJacobian *sJAsparse direct-access counterparts for articulated systems (null for other objects). kept out of the single-body hot region above: they are touched only for articulated contacts, whose local solves span extra cache lines anyway
sJB
const SparseJacobian *sJBsMinvJTA
const MatDyn *sMinvJTAsMinvJTB
const MatDyn *sMinvJTBsGenVelA
VecDyn *sGenVelAsGenVelB
VecDyn *sGenVelBrollingSpinMappInv_i
raisim::Mat<3, 3> rollingSpinMappInv_ifields below are only touched during problem setup or for angular friction
rollingSpinMapp_i
raisim::Mat<3, 3> rollingSpinMapp_iaxis
Vec<3> axisrollingSpinImp_i
raisim::Vec<3> rollingSpinImp_iangularVelInit
raisim::Vec<3> angularVelInitThe angular velocity of a kinematic partner in the contact frame, signed as velInit (obA's minus obB's): rolling and spinning friction hold a body to it, as velInit holds it to the partner's surface. It sits in the row's tail padding (the row stays 896 bytes).
approachAllowance
double approachAllowanceA speculative (swept-CCD) contact, not touching yet: the normal approach speed it lets the bodies close at this step (approachAllowance, its gap over the time step). It takes the surface's restitution only if the approach closes its gap. In the tail padding too.
speculative
bool speculativecoeffRes
double coeffRescoeffRes: restitution coefficient; bounceThres: restitution threshold velocity; depth: signed separation (negative when penetrating).
bounceThres
double bounceThresimpact_vel
double impact_veldepth
double depthposition_W
raisim::Vec<3> position_WContact position used by the solver, world frame.
mu_static
double mu_staticmu_static: static friction coefficient. Below the tangential speed mu_static_vel_thresh, mu is blended linearly toward it.
mu_static_vel_thresh
double mu_static_vel_threshmu_static_vel_thresh_inv
double mu_static_vel_thresh_invrolling_friction
double rolling_frictionrolling_friction / spinning_friction: angular friction coefficients of the material pair.
spinning_friction
double spinning_frictionrolling_radius
double rolling_radiusapproachVel
double approachVelnormal relative velocity before any contact impulse is applied. used to detect impacts
angular_friction_ready
bool angular_friction_readyparticleContact
bool particleContactset by the solver at setup: one of the objects is deformable or granular, so the contact point is a particle or mesh vertex. such contacts are skipped exactly and never warm started
pinError_W
Vec<3> pinError_WPin rows use a fixed world basis. The error and cached impulse have that basis.
pinWarmStart
Vec<3> *pinWarmStartterrainLaw
const TerrainContactLaw *terrainLawNon-null for an area quadrature contact with a deformable soil surface.