[−][src]Struct nphysics2d::object::RigidBody
A rigid body.
Implementations
impl<N: RealField> RigidBody<N>
[src]
pub fn user_data(&self) -> Option<&(dyn Any + Send + Sync)>
[src]
Retrieves a reference to the user-defined user-data attached to this object.
pub fn user_data_mut(&mut self) -> Option<&mut (dyn Any + Send + Sync)>
[src]
Retrieves a mutable reference to the user-defined user-data attached to this object.
pub fn set_user_data(
&mut self,
data: Option<Box<dyn Any + Send + Sync>>
) -> Option<Box<dyn Any + Send + Sync>>
[src]
&mut self,
data: Option<Box<dyn Any + Send + Sync>>
) -> Option<Box<dyn Any + Send + Sync>>
Sets the user-defined data attached to this object.
pub fn take_user_data(&mut self) -> Option<Box<dyn Any + Send + Sync>>
[src]
Replace by None
the user-defined data attached to this object and returns the old value.
pub fn linear_motion_interpolation_enabled(&self) -> bool
[src]
Check if linear motion interpolation is enabled for CCD.
If this is disabled, non-linear interpolation will be used.
pub fn enable_linear_motion_interpolation(&mut self, enabled: bool)
[src]
Enable linear motion interpolation for CCD.
If this is disabled, non-linear interpolation will be used.
pub fn set_translations_kinematic(&mut self, is_kinematic: Vector<bool>)
[src]
Mark some translational degrees of freedom as kinematic.
pub fn set_rotations_kinematic(&mut self, is_kinematic: bool)
[src]
Mark rotations as kinematic.
pub fn kinematic_translations(&self) -> Vector<bool>
[src]
Flags indicating which translational degrees of freedoms are kinematic.
pub fn kinematic_rotations(&self) -> bool
[src]
Flags indicating if rotations are kinematic.
pub fn disable_all_rotations(&mut self)
[src]
Disable all rotations of this rigid body.
This is the same as setting all the rotations of this rigid body as kinematic and setting its angular velocity to zero. The rotations will still be controllable at the velocity level by the user afterwards.
pub fn enable_all_rotations(&mut self)
[src]
Enable all rotations for this rigid body.
This is the same as setting all the rotations of this rigid body as non-kinematic.
pub fn disable_all_translations(&mut self)
[src]
Disable all translations of this rigid body.
This is the same as setting all the translations of this rigid body as kinematic and setting its linear velocity to zero. The translations will still be controllable at the velocity level by the user afterwards.
pub fn enable_all_translations(&mut self)
[src]
Enable all translations for this rigid body.
This is the same as setting all the translations of this rigid body as non-kinematic.
pub fn set_linear_damping(&mut self, damping: N)
[src]
Sets the linear damping coefficient of this rigid body.
Linear damping will make the rigid body loose linear velocity automatically velocity at each timestep. There is no damping by default.
pub fn linear_damping(&self) -> N
[src]
The linear damping coefficient of this rigid body.
pub fn set_angular_damping(&mut self, damping: N)
[src]
Sets the angular damping coefficient of this rigid body.
Angular damping will make the rigid body loose angular velocity automatically velocity at each timestep. There is no damping by default.
pub fn angular_damping(&self) -> N
[src]
The angular damping coefficient of this rigid body.
pub fn set_max_linear_velocity(&mut self, max_vel: N)
[src]
Caps the linear velocity of this rigid body to the given maximum.
This will prevent a rigid body from having a linear velocity with magnitude greater than max_vel
.
pub fn max_linear_velocity(&self) -> N
[src]
The maximum allowed linear velocity of this rigid body.
pub fn set_max_angular_velocity(&mut self, max_vel: N)
[src]
Caps the angular velocity of this rigid body to the given maximum.
This will prevent a rigid body from having a angular velocity with magnitude greater than max_vel
.
pub fn max_angular_velocity(&self) -> N
[src]
The maximum allowed angular velocity of this rigid body.
pub fn activation_status_mut(&mut self) -> &mut ActivationStatus<N>
[src]
Mutable information regarding activation and deactivation (sleeping) of this rigid body.
pub fn set_local_center_of_mass(&mut self, local_com: Point<N>)
[src]
Set the center of mass of this rigid body, expressed in its local space.
pub fn set_local_inertia(&mut self, local_inertia: Inertia<N>)
[src]
Set the local inertia of this rigid body, expressed in its local space.
pub fn set_mass(&mut self, mass: N)
[src]
Set the mass of this rigid body.
pub fn set_angular_inertia(&mut self, angular_inertia: N)
[src]
Set the angular inertia of this rigid body, expressed in its local space.
pub fn set_position(&mut self, pos: Isometry<N>)
[src]
Sets the position of this rigid body.
pub fn set_velocity(&mut self, vel: Velocity<N>)
[src]
Set the velocity of this rigid body.
pub fn set_linear_velocity(&mut self, vel: Vector<N>)
[src]
Set the linear velocity of this rigid body.
pub fn set_angular_velocity(&mut self, vel: N)
[src]
Set the angular velocity of this rigid body.
pub fn augmented_mass(&self) -> &Inertia<N>
[src]
The augmented mass (inluding gyroscropic terms) in world-space of this rigid body.
pub fn inv_augmented_mass(&self) -> &Inertia<N>
[src]
The inverse augmented mass (inluding gyroscropic terms) in world-space of this rigid body.
pub fn position(&self) -> &Isometry<N>
[src]
The position of this rigid body.
pub fn velocity(&self) -> &Velocity<N>
[src]
The velocity of this rigid body.
Trait Implementations
impl<N: RealField> Body<N> for RigidBody<N>
[src]
pub fn activation_status(&self) -> &ActivationStatus<N>
[src]
pub fn activate_with_energy(&mut self, energy: N)
[src]
pub fn deactivate(&mut self)
[src]
pub fn set_deactivation_threshold(&mut self, threshold: Option<N>)
[src]
pub fn update_status(&self) -> BodyUpdateStatus
[src]
pub fn status(&self) -> BodyStatus
[src]
pub fn set_status(&mut self, status: BodyStatus)
[src]
pub fn deformed_positions(&self) -> Option<(DeformationsType, &[N])>
[src]
pub fn deformed_positions_mut(&mut self) -> Option<(DeformationsType, &mut [N])>
[src]
pub fn companion_id(&self) -> usize
[src]
pub fn set_companion_id(&mut self, id: usize)
[src]
pub fn ndofs(&self) -> usize
[src]
pub fn generalized_velocity(&self) -> DVectorSlice<'_, N>
[src]
pub fn generalized_velocity_mut(&mut self) -> DVectorSliceMut<'_, N>
[src]
pub fn generalized_acceleration(&self) -> DVectorSlice<'_, N>
[src]
pub fn integrate(&mut self, parameters: &IntegrationParameters<N>)
[src]
pub fn clear_forces(&mut self)
[src]
pub fn clear_update_flags(&mut self)
[src]
pub fn update_kinematics(&mut self)
[src]
pub fn step_started(&mut self)
[src]
pub fn advance(&mut self, time_ratio: N)
[src]
pub fn validate_advancement(&mut self)
[src]
pub fn clamp_advancement(&mut self)
[src]
pub fn part_motion(&self, _: usize, time_origin: N) -> Option<BodyPartMotion<N>>
[src]
pub fn update_dynamics(&mut self, dt: N)
[src]
pub fn update_acceleration(
&mut self,
gravity: &Vector<N>,
_: &IntegrationParameters<N>
)
[src]
&mut self,
gravity: &Vector<N>,
_: &IntegrationParameters<N>
)
pub fn num_parts(&self) -> usize
[src]
pub fn part(&self, i: usize) -> Option<&dyn BodyPart<N>>
[src]
pub fn apply_displacement(&mut self, displacement: &[N])
[src]
pub fn world_point_at_material_point(
&self,
_: &dyn BodyPart<N>,
point: &Point<N>
) -> Point<N>
[src]
&self,
_: &dyn BodyPart<N>,
point: &Point<N>
) -> Point<N>
pub fn position_at_material_point(
&self,
_: &dyn BodyPart<N>,
point: &Point<N>
) -> Isometry<N>
[src]
&self,
_: &dyn BodyPart<N>,
point: &Point<N>
) -> Isometry<N>
pub fn material_point_at_world_point(
&self,
_: &dyn BodyPart<N>,
point: &Point<N>
) -> Point<N>
[src]
&self,
_: &dyn BodyPart<N>,
point: &Point<N>
) -> Point<N>
pub fn gravity_enabled(&self) -> bool
[src]
pub fn enable_gravity(&mut self, enabled: bool)
[src]
pub fn velocity_at_point(&self, _: usize, point: &Point<N>) -> Velocity<N>
[src]
pub fn fill_constraint_geometry(
&self,
_: &dyn BodyPart<N>,
_: usize,
point: &Point<N>,
force_dir: &ForceDirection<N>,
j_id: usize,
wj_id: usize,
jacobians: &mut [N],
inv_r: &mut N,
ext_vels: Option<&DVectorSlice<'_, N>>,
out_vel: Option<&mut N>
)
[src]
&self,
_: &dyn BodyPart<N>,
_: usize,
point: &Point<N>,
force_dir: &ForceDirection<N>,
j_id: usize,
wj_id: usize,
jacobians: &mut [N],
inv_r: &mut N,
ext_vels: Option<&DVectorSlice<'_, N>>,
out_vel: Option<&mut N>
)
pub fn has_active_internal_constraints(&mut self) -> bool
[src]
pub fn setup_internal_velocity_constraints(
&mut self,
_: &DVectorSlice<'_, N>,
_: &IntegrationParameters<N>
)
[src]
&mut self,
_: &DVectorSlice<'_, N>,
_: &IntegrationParameters<N>
)
pub fn warmstart_internal_velocity_constraints(
&mut self,
_: &mut DVectorSliceMut<'_, N>
)
[src]
&mut self,
_: &mut DVectorSliceMut<'_, N>
)
pub fn step_solve_internal_velocity_constraints(
&mut self,
_: &mut DVectorSliceMut<'_, N>
)
[src]
&mut self,
_: &mut DVectorSliceMut<'_, N>
)
pub fn step_solve_internal_position_constraints(
&mut self,
_: &IntegrationParameters<N>
)
[src]
&mut self,
_: &IntegrationParameters<N>
)
pub fn add_local_inertia_and_com(
&mut self,
_: usize,
com: Point<N>,
inertia: Inertia<N>
)
[src]
&mut self,
_: usize,
com: Point<N>,
inertia: Inertia<N>
)
pub fn apply_force(
&mut self,
_: usize,
force: &Force<N>,
force_type: ForceType,
auto_wake_up: bool
)
[src]
&mut self,
_: usize,
force: &Force<N>,
force_type: ForceType,
auto_wake_up: bool
)
pub fn apply_local_force(
&mut self,
_: usize,
force: &Force<N>,
force_type: ForceType,
auto_wake_up: bool
)
[src]
&mut self,
_: usize,
force: &Force<N>,
force_type: ForceType,
auto_wake_up: bool
)
pub fn apply_force_at_point(
&mut self,
_: usize,
force: &Vector<N>,
point: &Point<N>,
force_type: ForceType,
auto_wake_up: bool
)
[src]
&mut self,
_: usize,
force: &Vector<N>,
point: &Point<N>,
force_type: ForceType,
auto_wake_up: bool
)
pub fn apply_local_force_at_point(
&mut self,
_: usize,
force: &Vector<N>,
point: &Point<N>,
force_type: ForceType,
auto_wake_up: bool
)
[src]
&mut self,
_: usize,
force: &Vector<N>,
point: &Point<N>,
force_type: ForceType,
auto_wake_up: bool
)
pub fn apply_force_at_local_point(
&mut self,
_: usize,
force: &Vector<N>,
point: &Point<N>,
force_type: ForceType,
auto_wake_up: bool
)
[src]
&mut self,
_: usize,
force: &Vector<N>,
point: &Point<N>,
force_type: ForceType,
auto_wake_up: bool
)
pub fn apply_local_force_at_local_point(
&mut self,
_: usize,
force: &Vector<N>,
point: &Point<N>,
force_type: ForceType,
auto_wake_up: bool
)
[src]
&mut self,
_: usize,
force: &Vector<N>,
point: &Point<N>,
force_type: ForceType,
auto_wake_up: bool
)
pub fn is_ground(&self) -> bool
[src]
pub fn update_activation_status(&mut self)
[src]
pub fn status_dependent_ndofs(&self) -> usize
[src]
pub fn status_dependent_body_part_velocity(
&self,
part: &dyn BodyPart<N>
) -> Velocity<N>
[src]
&self,
part: &dyn BodyPart<N>
) -> Velocity<N>
pub fn is_active(&self) -> bool
[src]
pub fn is_dynamic(&self) -> bool
[src]
pub fn is_kinematic(&self) -> bool
[src]
pub fn is_static(&self) -> bool
[src]
pub fn activate(&mut self)
[src]
impl<N: RealField> BodyPart<N> for RigidBody<N>
[src]
pub fn is_ground(&self) -> bool
[src]
pub fn velocity(&self) -> Velocity<N>
[src]
pub fn position(&self) -> Isometry<N>
[src]
pub fn safe_position(&self) -> Isometry<N>
[src]
pub fn local_inertia(&self) -> Inertia<N>
[src]
pub fn inertia(&self) -> Inertia<N>
[src]
pub fn center_of_mass(&self) -> Point<N>
[src]
pub fn local_center_of_mass(&self) -> Point<N>
[src]
impl<N: Debug + RealField> Debug for RigidBody<N>
[src]
Auto Trait Implementations
impl<N> !RefUnwindSafe for RigidBody<N>
[src]
impl<N> Send for RigidBody<N> where
N: Scalar,
[src]
N: Scalar,
impl<N> Sync for RigidBody<N> where
N: Scalar,
[src]
N: Scalar,
impl<N> Unpin for RigidBody<N> where
N: Scalar + Unpin,
[src]
N: Scalar + Unpin,
impl<N> !UnwindSafe for RigidBody<N>
[src]
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
pub fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> Downcast for T where
T: Any,
[src]
T: Any,
pub fn into_any(self: Box<T, Global>) -> Box<dyn Any + 'static, Global>
[src]
pub fn into_any_rc(self: Rc<T>) -> Rc<dyn Any + 'static>
[src]
pub fn as_any(&self) -> &(dyn Any + 'static)
[src]
pub fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
[src]
impl<T> DowncastSync for T where
T: Send + Sync + Any,
[src]
T: Send + Sync + Any,
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T> Same<T> for T
type Output = T
Should always be Self
impl<SS, SP> SupersetOf<SS> for SP where
SS: SubsetOf<SP>,
[src]
SS: SubsetOf<SP>,
pub fn to_subset(&self) -> Option<SS>
[src]
pub fn is_in_subset(&self) -> bool
[src]
pub fn to_subset_unchecked(&self) -> SS
[src]
pub fn from_subset(element: &SS) -> SP
[src]
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
pub fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,
type Error = <U as TryFrom<T>>::Error
The type returned in the event of a conversion error.
pub fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>
[src]
impl<V, T> VZip<V> for T where
V: MultiLane<T>,
V: MultiLane<T>,