pub struct ManifoldPoint {
pub anchor_a: Vec2,
pub anchor_b: Vec2,
pub separation: f32,
pub base_separation: f32,
pub normal_impulse: f32,
pub tangent_impulse: f32,
pub total_normal_impulse: f32,
pub normal_velocity: f32,
pub id: u16,
pub persisted: bool,
}Expand description
A solver contact point inside a runtime world manifold.
The anchors are f32 offsets from each body’s center of mass, not absolute world
positions. Reconstruct an absolute contact position by offsetting the corresponding
body’s world center Position.
Fields§
§anchor_a: Vec2Contact point relative to body A’s center of mass in world axes.
anchor_b: Vec2Contact point relative to body B’s center of mass in world axes.
separation: f32Signed separation; negative values indicate penetration.
base_separation: f32Cached separation used by Box2D when recycling contacts.
normal_impulse: f32Impulse along the manifold normal.
tangent_impulse: f32Friction impulse along the tangent.
total_normal_impulse: f32Total normal impulse accumulated across substeps and restitution.
normal_velocity: f32Relative normal velocity before solving; negative values are approaching.
id: u16Stable feature-pair identifier supplied by Box2D.
persisted: boolWhether this point existed during the previous step.
Implementations§
Source§impl ManifoldPoint
impl ManifoldPoint
Sourcepub fn world_point_a(self, body_a_world_center: Position) -> Position
pub fn world_point_a(self, body_a_world_center: Position) -> Position
Reconstructs this contact point from body A’s absolute world center.
Sourcepub fn world_point_b(self, body_b_world_center: Position) -> Position
pub fn world_point_b(self, body_b_world_center: Position) -> Position
Reconstructs this contact point from body B’s absolute world center.
pub fn from_raw(raw: b2ManifoldPoint) -> Result<Self>
pub fn validate(&self) -> Result<()>
pub fn into_raw(self) -> b2ManifoldPoint
Trait Implementations§
Source§impl Clone for ManifoldPoint
impl Clone for ManifoldPoint
Source§fn clone(&self) -> ManifoldPoint
fn clone(&self) -> ManifoldPoint
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more