Struct mgf::SimpleDynamicBody
[−]
[src]
pub struct SimpleDynamicBody<S> where
S: Volumetric + Inertia + Copy, { pub restitution: f32, pub friction: f32, pub inv_mass: f32, pub inv_moment_body: Matrix3<f32>, pub inv_moment: Matrix3<f32>, pub v: Vector3<f32>, pub omega: Vector3<f32>, pub q: Quaternion<f32>, pub force: Vector3<f32>, pub torque: Vector3<f32>, pub collider: Moving<S>, }
A dynamic body based on a single component.
Fields
restitution: f32
friction: f32
inv_mass: f32
inv_moment_body: Matrix3<f32>
inv_moment: Matrix3<f32>
v: Vector3<f32>
omega: Vector3<f32>
q: Quaternion<f32>
force: Vector3<f32>
torque: Vector3<f32>
collider: Moving<S>
Methods
impl<S> SimpleDynamicBody<S> where
S: Volumetric + Inertia + Copy,
[src]
S: Volumetric + Inertia + Copy,
fn new(
restitution: f32,
friction: f32,
world_force: Vector3<f32>,
shape: S,
mass: f32
) -> Self
[src]
restitution: f32,
friction: f32,
world_force: Vector3<f32>,
shape: S,
mass: f32
) -> Self
Construct a new SimpleDynamicBody.
Trait Implementations
impl<S: Clone> Clone for SimpleDynamicBody<S> where
S: Volumetric + Inertia + Copy,
[src]
S: Volumetric + Inertia + Copy,
fn clone(&self) -> SimpleDynamicBody<S>
[src]
Returns a copy of the value. Read more
fn clone_from(&mut self, source: &Self)
1.0.0[src]
Performs copy-assignment from source
. Read more
impl<S> AddAssign<Vector3<f32>> for SimpleDynamicBody<S> where
S: Volumetric + Inertia + Copy,
[src]
S: Volumetric + Inertia + Copy,
fn add_assign(&mut self, v: Vector3<f32>)
[src]
Performs the +=
operation.
impl<S> SubAssign<Vector3<f32>> for SimpleDynamicBody<S> where
S: Volumetric + Inertia + Copy,
[src]
S: Volumetric + Inertia + Copy,
fn sub_assign(&mut self, v: Vector3<f32>)
[src]
Performs the -=
operation.
impl<S> Shape for SimpleDynamicBody<S> where
S: Volumetric + Inertia + Copy,
[src]
S: Volumetric + Inertia + Copy,
fn center(&self) -> Point3<f32>
[src]
Returns the center of mass of the geometry, assuming a regular density.
fn set_pos(&mut self, p: Point3<f32>)
[src]
Sets the center of the shape to p.
impl<S> Delta for SimpleDynamicBody<S> where
S: Volumetric + Inertia + Copy,
[src]
S: Volumetric + Inertia + Copy,
impl<S, B> BoundedBy<B> for SimpleDynamicBody<S> where
S: BoundedBy<B> + Volumetric + Inertia + Copy,
B: Bound,
[src]
S: BoundedBy<B> + Volumetric + Inertia + Copy,
B: Bound,
impl<S, RHS> Contacts<RHS> for SimpleDynamicBody<S> where
S: Volumetric + Inertia + Copy,
RHS: Contacts<Moving<S>>,
[src]
S: Volumetric + Inertia + Copy,
RHS: Contacts<Moving<S>>,
fn contacts<F: FnMut(Contact)>(&self, rhs: &RHS, callback: F) -> bool
[src]
Calls the closure for each contact found. Returns true if any contact was found. Read more
fn last_contact(&self, rhs: &RHS) -> Option<Contact>
[src]
Returns the last contact found, if one exists.
impl<S> PhysicsObject for SimpleDynamicBody<S> where
S: Volumetric + Inertia + Copy,
[src]
S: Volumetric + Inertia + Copy,
fn integrate(&mut self, dt: f32)
[src]
Integrate the object over the time step.
fn get_dx(&self) -> Velocity
[src]
Return the velocity of the object.
fn set_dx(&mut self, v: Velocity)
[src]
Set the velocity of the object.
fn pos(&self) -> Point3<f32>
[src]
Return the position of the object at the end of the time step.
fn inv_mass(&self) -> f32
[src]
Return the inverse mass of the object.
fn inv_moment(&self) -> Matrix3<f32>
[src]
Return the inverse moment of inertia tensor for the object.
fn restitution(&self) -> f32
[src]
Return the coefficient of restitution for the object.
fn friction(&self) -> f32
[src]
Return the friction coefficient for the object.