Skip to main content

Contact

Struct Contact 

Source
pub struct Contact {
Show 23 fields pub set_index: i32, pub color_index: i32, pub local_index: i32, pub edges: [ContactEdge; 2], pub shape_id_a: i32, pub shape_id_b: i32, pub child_index: i32, pub island_id: i32, pub island_index: i32, pub contact_id: i32, pub body_sim_index_a: i32, pub body_sim_index_b: i32, pub flags: u32, pub manifolds: Vec<Manifold>, pub cached_rotation_a: Quat, pub cached_rotation_b: Quat, pub cached_relative_pose: Transform, pub friction: f32, pub restitution: f32, pub rolling_resistance: f32, pub tangent_velocity: Vec3, pub geometry: ContactGeometry, pub generation: u32,
}
Expand description

Persistent interaction between two shapes. (b3Contact)

Fields§

§set_index: i32

Index of simulation set stored in World. NULL_INDEX when slot is free.

§color_index: i32

Index into the constraint graph color array. NULL_INDEX for non-touching or sleeping contacts, and when the slot is free.

§local_index: i32

Contact index within set or graph color. NULL_INDEX when slot is free.

§edges: [ContactEdge; 2]§shape_id_a: i32§shape_id_b: i32§child_index: i32§island_id: i32

A contact only belongs to an island if touching, otherwise NULL_INDEX.

§island_index: i32

Index into the island’s contacts array for O(1) swap-removal. NULL_INDEX when not in an island.

§contact_id: i32

Back index into World::contacts

§body_sim_index_a: i32

Transient and cached for performance. NULL_INDEX for static bodies.

§body_sim_index_b: i32§flags: u32

contact_flags bits

§manifolds: Vec<Manifold>§cached_rotation_a: Quat

Cache for contact recycling.

§cached_rotation_b: Quat§cached_relative_pose: Transform§friction: f32

Mixed friction and restitution

§restitution: f32§rolling_resistance: f32§tangent_velocity: Vec3§geometry: ContactGeometry

Usage determined by SIM_MESH_CONTACT in flags

§generation: u32

Monotonically advanced when a contact is allocated in this slot. Used to check for invalid ContactId.

Implementations§

Source§

impl Contact

Source

pub fn manifold_count(&self) -> i32

Manifold count. (C: manifoldCount)

Trait Implementations§

Source§

impl Clone for Contact

Source§

fn clone(&self) -> Contact

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 Debug for Contact

Source§

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

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

impl Default for Contact

Source§

fn default() -> Self

Returns the “default value” for a type. Read more

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 = Infallible

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

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

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.