Trait PhysicsSpace
Source pub trait PhysicsSpace:
Space
+ IsometryGroup
+ Send
+ Sync {
type AngVel: Bivector + Send + Sync;
type Inertia: Copy + Send + Sync;
Show 13 methods
// Required methods
fn broadphase_bound(&self) -> BroadphaseBound;
fn supports_collider(&self, kind: ColliderKind) -> bool;
fn valid_vector(&self, vector: Self::Vector) -> bool;
fn valid_inertia(&self, inertia: Self::Inertia) -> bool;
fn valid_orientation(&self, orientation: Self::Iso) -> bool;
fn valid_angular_velocity(&self, angular_velocity: Self::AngVel) -> bool;
fn integrate_orientation(
&self,
iso: Self::Iso,
omega: Self::AngVel,
dt: f32,
) -> Self::Iso;
fn apply_inv_inertia(
&self,
inertia: Self::Inertia,
torque: Self::AngVel,
) -> Self::AngVel;
fn wedge(&self, a: Self::Vector, b: Self::Vector) -> Self::AngVel;
fn velocity_at_point(
&self,
body: &RigidBody<Self>,
p: Self::Point,
) -> Self::Vector
where Self: Sized;
fn effective_mass_inv(
&self,
a: &RigidBody<Self>,
b: &RigidBody<Self>,
contact_point: Self::Point,
direction: Self::Vector,
) -> f32
where Self: Sized;
fn apply_contact_impulse(
&self,
a: &mut RigidBody<Self>,
b: &mut RigidBody<Self>,
contact_point: Self::Point,
direction: Self::Vector,
magnitude: f32,
)
where Self: Sized;
// Provided method
fn valid_initial_state(
&self,
position: Self::Point,
velocity: Self::Vector,
inertia: Self::Inertia,
) -> bool { ... }
}
Sleeping and static bodies contribute zero.
Subtracts from A, adds to B.