Skip to main content

GroundSupport

Enum GroundSupport 

Source
pub enum GroundSupport {
    Material,
    WorldOffset(Vec3),
    CylinderRim {
        axis: Vec3,
        radius: f64,
        quarter_turns: u8,
        offset: Vec3,
    },
}
Expand description

How a ground support point is attached to the body that owns it.

Detection reports this per contact because the gradient of a contact depends on it: a support point that rides the body rigidly moves with Rᵀ(q), one that hangs below a curved surface does not, and one on a cylinder’s rim does neither — it moves with the axis. The convex adjoint (phyz_diff::contact_adjoint) reconstructs the support point from this, and getting it wrong is a silently wrong gradient rather than a failure.

Variants§

§

Material

The support point is a material point of the body: a box corner, a mesh vertex, or a cylinder rim point in the degenerate upright case.

§

WorldOffset(Vec3)

The support hangs a constant world vector below a material point: (0, 0, −r) for a sphere or capsule dropping onto a z-plane. Spinning the body does not move it.

§

CylinderRim

A point on a cylinder’s cap rim: cap centre + radius · dir, where dir is the barrel’s steepest-downhill direction û turned quarter_turns × 90° about the axis (see cylinder_rim_dir).

axis is the cylinder’s axis in world coordinates at detection time. It is a body-fixed direction, so an adjoint that wants to stay exact under a perturbation freezes it in the body frame and recomputes dir from the perturbed axis — û is a function of the configuration, and holding it fixed drops the whole “the wheel banked, so its contact moved around the rim” channel.

Fields

§axis: Vec3

The cylinder’s axis in world coordinates at detection time.

§radius: f64

The cylinder’s radius.

§quarter_turns: u8

Which rim direction this contact sits on, in 90° steps from û.

§offset: Vec3

radius · dir as detection resolved it — the world offset, kept so that callers who only want that do not have to recompute it, and so that an adjoint has something total to fall back on if a perturbed axis lands inside the degeneracy.

Implementations§

Source§

impl GroundSupport

Source

pub fn world_offset(&self) -> Vec3

The vector from the material point that generated the contact to the support point, in world coordinates, at the configuration it was detected in.

Trait Implementations§

Source§

impl Clone for GroundSupport

Source§

fn clone(&self) -> GroundSupport

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Copy for GroundSupport

Source§

impl Debug for GroundSupport

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl PartialEq for GroundSupport

Source§

fn eq(&self, other: &GroundSupport) -> bool

Equality operator ==. Read more
1.0.0 (const: unstable) · Source§

fn ne(&self, other: &Rhs) -> bool

Inequality operator !=. Read more
Source§

impl StructuralPartialEq for GroundSupport

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = !

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, !>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.