pub struct PhysicsBody2D {}Expand description
World collider, including solids and nonblocking trigger volumes.
Fields§
§position: Vec2World-space center.
shape: Shape2DLocal collision geometry.
velocity: Vec2Intrinsic velocity, excluding moving-platform carry.
kind: BodyKindStatic, kinematic or dynamic motion authority.
filter: CollisionFilterLayer membership and symmetric acceptance mask.
is_trigger: boolNonblocking volume that generates typed trigger events.
mass: f32Positive mass; affects dynamic/dynamic push-apart and impulses.
gravity: Option<Vec2>Optional per-body acceleration, in world units per second squared.
restitution: f32Bounce coefficient in [0, 1]. Pair response uses the maximum.
friction: f32Contact friction in [0, 1]; scales the normal impulse budget.
drag: f32Nonnegative drag per second, applied as velocity / (1 + drag * dt).
max_speed: Option<f32>Optional nonnegative intrinsic speed cap, applied after forces. Collision impulses may exceed it until the next tick.
grounded: boolContact with a solid below (Y down in 2D, Y up in 3D).