Skip to main content

Module contact

Module contact 

Source

Modules§

contact_flags

Structs§

Contact
Cold contact data. Used as a persistent handle and for persistent island connectivity. (b2Contact)
ContactEdge
A contact edge is used to connect bodies and contacts together in a contact graph where each body is a node and each contact is an edge. A contact edge belongs to a doubly linked list maintained in each attached body. Each contact has two contact edges, one for each attached body. (b2ContactEdge)
ContactSim
Manages contact between two shapes. A contact exists for each overlapping AABB in the broad-phase (except if filtered), so a contact object may exist that has no contact points. (b2ContactSim)
ContactUpdateContext
The world data update_contact needs, copied out so the caller can hold &mut ContactSim and &Shape borrows at the same time (the C version reads these through b2World*).

Functions§

can_collide
(b2CanCollide)
contact_get_data
Get the data for a contact. The manifold may have no points if the contact is not touching. (b2Contact_GetData)
contact_is_valid
Contact identifier validation. Provides validation for up to 2^32 allocations. (b2Contact_IsValid — the world-registry check collapses to the index/generation check in the registry-less port)
create_contact
WARNING: this should never fail to create a contact because the pair already exists in the pairSet. (b2CreateContact — C takes shape pointers; the Rust port takes shape ids.)
destroy_contact
A contact is destroyed when:
get_contact_full_id
Validate a ContactId and return the raw contact index. (b2GetContactFullId — C returns a pointer; Rust returns the index into world.contacts)
get_contact_sim
Borrow a contact’s sim data mutably: constraint graph color for awake touching contacts, otherwise the owning solver set. (b2GetContactSim)
get_contact_sim_ref
Shared-reference variant of get_contact_sim for read-only accessors. (The C b2GetContactSim is used for both; Rust needs the split.)
update_contact
Update the contact manifold and touching status. Note: do not assume the shape AABBs are overlapping or are valid. (b2UpdateContact)