[−][src]Struct nphysics3d::object::RigidBodyDesc
The description of a rigid body, used to build a new RigidBody
.
This is the structure to use in order to create and add a rigid body
(as well as some attached colliders) to the World
. It follows
the builder pattern and defines three kinds of methods:
- Methods with the
.with_
prefix: sets a property ofself
and returnsSelf
itself. - Methods with the
.set_
prefix: sets a property of&mut self
and retuns the&mut self
pointer. - The
build
method: actually build the rigid body into the givenWorld
and returns a mutable reference to the newly created rigid body. Thebuild
methods takesself
by-ref so the sameRigidBodyDesc
can be re-used (possibly modified) to build other rigid bodies.
The .with_
methods as well as the .set_
method are designed to support chaining.
Because the .with_
methods takes self
by-move, it is useful to use when initializing the
RigidBodyDesc
for the first time. The .set_
methods are useful when modifying it after
this initialization (including after calls to .build
).
Methods
impl<'a, N: Real> RigidBodyDesc<'a, N>
[src]
pub fn new() -> RigidBodyDesc<'a, N>
[src]
A default rigid body builder.
pub fn user_data(
self,
data: impl UserData
) -> Self
[src]
self,
data: impl UserData
) -> Self
Sets a user-data to be attached to the object being built.
pub fn set_user_data(
&mut self,
data: Option<impl UserData>
) -> &mut Self
[src]
&mut self,
data: Option<impl UserData>
) -> &mut Self
Sets the user-data to be attached to the object being built.
pub fn get_user_data(&self) -> Option<&(dyn Any + Send + Sync)>
[src]
Reference to the user-data to be attached to the object being built.
pub fn rotation(self, axisangle: Vector<N>) -> Self
[src]
pub fn set_rotation(&mut self, axisangle: Vector<N>) -> &mut Self
[src]
pub fn kinematic_rotations(self, kinematic_rotations: Vector<bool>) -> Self
[src]
pub fn set_rotations_kinematic(
&mut self,
kinematic_rotations: Vector<bool>
) -> &mut Self
[src]
&mut self,
kinematic_rotations: Vector<bool>
) -> &mut Self
pub fn angular_inertia(self, angular_inertia: Matrix3<N>) -> Self
[src]
pub fn set_angular_inertia(&mut self, angular_inertia: Matrix3<N>) -> &mut Self
[src]
pub fn translation(self, vector: Vector<N>) -> Self
[src]
pub fn set_translation(&mut self, vector: Vector<N>) -> &mut Self
[src]
pub fn mass(self, mass: N) -> Self
[src]
pub fn set_mass(&mut self, mass: N) -> &mut Self
[src]
pub fn collider(self, collider: &'a ColliderDesc<N>) -> Self
[src]
pub fn add_collider(&mut self, collider: &'a ColliderDesc<N>) -> &mut Self
[src]
pub fn gravity_enabled(self, gravity_enabled: bool) -> Self
[src]
pub fn enable_gravity(&mut self, gravity_enabled: bool) -> &mut Self
[src]
pub fn status(self, status: BodyStatus) -> Self
[src]
pub fn set_status(&mut self, status: BodyStatus) -> &mut Self
[src]
pub fn name(self, name: String) -> Self
[src]
pub fn set_name(&mut self, name: String) -> &mut Self
[src]
pub fn position(self, position: Isometry<N>) -> Self
[src]
pub fn set_position(&mut self, position: Isometry<N>) -> &mut Self
[src]
pub fn velocity(self, velocity: Velocity<N>) -> Self
[src]
pub fn set_velocity(&mut self, velocity: Velocity<N>) -> &mut Self
[src]
pub fn local_inertia(self, local_inertia: Inertia<N>) -> Self
[src]
pub fn set_local_inertia(&mut self, local_inertia: Inertia<N>) -> &mut Self
[src]
pub fn local_center_of_mass(self, local_center_of_mass: Point<N>) -> Self
[src]
pub fn set_local_center_of_mass(
&mut self,
local_center_of_mass: Point<N>
) -> &mut Self
[src]
&mut self,
local_center_of_mass: Point<N>
) -> &mut Self
pub fn sleep_threshold(self, sleep_threshold: Option<N>) -> Self
[src]
pub fn set_sleep_threshold(&mut self, sleep_threshold: Option<N>) -> &mut Self
[src]
pub fn kinematic_translations(
self,
kinematic_translations: Vector<bool>
) -> Self
[src]
self,
kinematic_translations: Vector<bool>
) -> Self
pub fn set_translations_kinematic(
&mut self,
kinematic_translations: Vector<bool>
) -> &mut Self
[src]
&mut self,
kinematic_translations: Vector<bool>
) -> &mut Self
pub fn get_rotation(&self) -> Vector<N>
[src]
pub fn get_kinematic_rotations(&self) -> Vector<bool>
[src]
pub fn get_angular_inertia(&self) -> &Matrix3<N>
[src]
pub fn get_translation(&self) -> &Vector<N>
[src]
pub fn get_mass(&self) -> N
[src]
pub fn get_name(&self) -> &str
[src]
pub fn get_colliders(&self) -> &[&'a ColliderDesc<N>]
[src]
pub fn is_gravity_enabled(&self) -> bool
[src]
pub fn get_status(&self) -> BodyStatus
[src]
pub fn get_sleep_threshold(&self) -> Option<N>
[src]
pub fn get_position(&self) -> &Isometry<N>
[src]
pub fn get_velocity(&self) -> &Velocity<N>
[src]
pub fn get_local_inertia(&self) -> &Inertia<N>
[src]
pub fn get_local_center_of_mass(&self) -> &Point<N>
[src]
pub fn build<'w>(&mut self, world: &'w mut World<N>) -> &'w mut RigidBody<N>
[src]
Builds a rigid body and all its attached colliders.
Trait Implementations
impl<'a, N: Real> BodyDesc<N> for RigidBodyDesc<'a, N>
[src]
type Body = RigidBody<N>
The type of body being generated.
fn build_with_handle(
&self,
cworld: &mut ColliderWorld<N>,
handle: BodyHandle
) -> RigidBody<N>
[src]
&self,
cworld: &mut ColliderWorld<N>,
handle: BodyHandle
) -> RigidBody<N>
impl<'a, N: Clone + Real> Clone for RigidBodyDesc<'a, N>
[src]
fn clone(&self) -> RigidBodyDesc<'a, N>
[src]
fn clone_from(&mut self, source: &Self)
1.0.0[src]
Performs copy-assignment from source
. Read more
Auto Trait Implementations
impl<'a, N> Send for RigidBodyDesc<'a, N> where
N: Scalar,
N: Scalar,
impl<'a, N> Sync for RigidBodyDesc<'a, N> where
N: Scalar,
N: Scalar,
Blanket Implementations
impl<T> From for T
[src]
impl<T, U> Into for T where
U: From<T>,
[src]
U: From<T>,
impl<T> ToOwned for T where
T: Clone,
[src]
T: Clone,
impl<T, U> TryFrom for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = !
try_from
)The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T> Borrow for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> BorrowMut for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T, U> TryInto for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,
type Error = <U as TryFrom<T>>::Error
try_from
)The type returned in the event of a conversion error.
fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>
[src]
impl<T> Downcast for T where
T: Any,
[src]
T: Any,
fn into_any(self: Box<T>) -> Box<dyn Any + 'static>
[src]
fn as_any(&self) -> &(dyn Any + 'static)
[src]
fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
[src]
impl<SS, SP> SupersetOf for SP where
SS: SubsetOf<SP>,
[src]
SS: SubsetOf<SP>,
fn to_subset(&self) -> Option<SS>
[src]
fn is_in_subset(&self) -> bool
[src]
unsafe fn to_subset_unchecked(&self) -> SS
[src]
fn from_subset(element: &SS) -> SP
[src]
impl<T> Same for T
type Output = T
Should always be Self