[−][src]Struct oxygengine_physics_2d::prelude::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
).
Implementations
impl<'a, N> RigidBodyDesc<N> where
N: RealField,
[src]
N: RealField,
pub fn new() -> RigidBodyDesc<N>
[src]
A default rigid body builder.
pub fn user_data(self, data: impl UserData) -> RigidBodyDesc<N>
[src]
Sets a user-data to be attached to the object being built.
pub fn set_user_data(
&mut self,
data: Option<impl UserData>
) -> &mut RigidBodyDesc<N>
[src]
&mut self,
data: Option<impl UserData>
) -> &mut RigidBodyDesc<N>
Sets the user-data to be attached to the object being built.
pub fn get_user_data(&self) -> Option<&(dyn Any + 'static + Sync + Send)>
[src]
Reference to the user-data to be attached to the object being built.
pub fn rotation(self, angle: N) -> RigidBodyDesc<N>
[src]
pub fn set_rotation(&mut self, angle: N) -> &mut RigidBodyDesc<N>
[src]
pub fn kinematic_rotations(self, is_kinematic: bool) -> RigidBodyDesc<N>
[src]
pub fn set_rotations_kinematic(
&mut self,
is_kinematic: bool
) -> &mut RigidBodyDesc<N>
[src]
&mut self,
is_kinematic: bool
) -> &mut RigidBodyDesc<N>
pub fn angular_inertia(self, angular_inertia: N) -> RigidBodyDesc<N>
[src]
pub fn set_angular_inertia(
&mut self,
angular_inertia: N
) -> &mut RigidBodyDesc<N>
[src]
&mut self,
angular_inertia: N
) -> &mut RigidBodyDesc<N>
pub fn translation(
self,
vector: Matrix<N, U2, U1, <DefaultAllocator as Allocator<N, U2, U1>>::Buffer>
) -> RigidBodyDesc<N>
[src]
self,
vector: Matrix<N, U2, U1, <DefaultAllocator as Allocator<N, U2, U1>>::Buffer>
) -> RigidBodyDesc<N>
pub fn set_translation(
&mut self,
vector: Matrix<N, U2, U1, <DefaultAllocator as Allocator<N, U2, U1>>::Buffer>
) -> &mut RigidBodyDesc<N>
[src]
&mut self,
vector: Matrix<N, U2, U1, <DefaultAllocator as Allocator<N, U2, U1>>::Buffer>
) -> &mut RigidBodyDesc<N>
pub fn mass(self, mass: N) -> RigidBodyDesc<N>
[src]
pub fn set_mass(&mut self, mass: N) -> &mut RigidBodyDesc<N>
[src]
pub fn gravity_enabled(self, gravity_enabled: bool) -> RigidBodyDesc<N>
[src]
pub fn enable_gravity(&mut self, gravity_enabled: bool) -> &mut RigidBodyDesc<N>
[src]
pub fn linear_motion_interpolation_enabled(
self,
linear_motion_interpolation_enabled: bool
) -> RigidBodyDesc<N>
[src]
self,
linear_motion_interpolation_enabled: bool
) -> RigidBodyDesc<N>
pub fn enable_linear_motion_interpolation(
&mut self,
linear_motion_interpolation_enabled: bool
) -> &mut RigidBodyDesc<N>
[src]
&mut self,
linear_motion_interpolation_enabled: bool
) -> &mut RigidBodyDesc<N>
pub fn status(self, status: BodyStatus) -> RigidBodyDesc<N>
[src]
pub fn set_status(&mut self, status: BodyStatus) -> &mut RigidBodyDesc<N>
[src]
pub fn position(
self,
position: Isometry<N, U2, Unit<Complex<N>>>
) -> RigidBodyDesc<N>
[src]
self,
position: Isometry<N, U2, Unit<Complex<N>>>
) -> RigidBodyDesc<N>
pub fn set_position(
&mut self,
position: Isometry<N, U2, Unit<Complex<N>>>
) -> &mut RigidBodyDesc<N>
[src]
&mut self,
position: Isometry<N, U2, Unit<Complex<N>>>
) -> &mut RigidBodyDesc<N>
pub fn velocity(self, velocity: Velocity2<N>) -> RigidBodyDesc<N>
[src]
pub fn set_velocity(&mut self, velocity: Velocity2<N>) -> &mut RigidBodyDesc<N>
[src]
pub fn linear_damping(self, linear_damping: N) -> RigidBodyDesc<N>
[src]
pub fn set_linear_damping(&mut self, linear_damping: N) -> &mut RigidBodyDesc<N>
[src]
pub fn angular_damping(self, angular_damping: N) -> RigidBodyDesc<N>
[src]
pub fn set_angular_damping(
&mut self,
angular_damping: N
) -> &mut RigidBodyDesc<N>
[src]
&mut self,
angular_damping: N
) -> &mut RigidBodyDesc<N>
pub fn max_linear_velocity(self, max_linear_velocity: N) -> RigidBodyDesc<N>
[src]
pub fn set_max_linear_velocity(
&mut self,
max_linear_velocity: N
) -> &mut RigidBodyDesc<N>
[src]
&mut self,
max_linear_velocity: N
) -> &mut RigidBodyDesc<N>
pub fn max_angular_velocity(self, max_angular_velocity: N) -> RigidBodyDesc<N>
[src]
pub fn set_max_angular_velocity(
&mut self,
max_angular_velocity: N
) -> &mut RigidBodyDesc<N>
[src]
&mut self,
max_angular_velocity: N
) -> &mut RigidBodyDesc<N>
pub fn local_inertia(self, local_inertia: Inertia2<N>) -> RigidBodyDesc<N>
[src]
pub fn set_local_inertia(
&mut self,
local_inertia: Inertia2<N>
) -> &mut RigidBodyDesc<N>
[src]
&mut self,
local_inertia: Inertia2<N>
) -> &mut RigidBodyDesc<N>
pub fn local_center_of_mass(
self,
local_center_of_mass: Point<N, U2>
) -> RigidBodyDesc<N>
[src]
self,
local_center_of_mass: Point<N, U2>
) -> RigidBodyDesc<N>
pub fn set_local_center_of_mass(
&mut self,
local_center_of_mass: Point<N, U2>
) -> &mut RigidBodyDesc<N>
[src]
&mut self,
local_center_of_mass: Point<N, U2>
) -> &mut RigidBodyDesc<N>
pub fn sleep_threshold(self, sleep_threshold: Option<N>) -> RigidBodyDesc<N>
[src]
pub fn set_sleep_threshold(
&mut self,
sleep_threshold: Option<N>
) -> &mut RigidBodyDesc<N>
[src]
&mut self,
sleep_threshold: Option<N>
) -> &mut RigidBodyDesc<N>
pub fn kinematic_translations(
self,
kinematic_translations: Matrix<bool, U2, U1, <DefaultAllocator as Allocator<bool, U2, U1>>::Buffer>
) -> RigidBodyDesc<N>
[src]
self,
kinematic_translations: Matrix<bool, U2, U1, <DefaultAllocator as Allocator<bool, U2, U1>>::Buffer>
) -> RigidBodyDesc<N>
pub fn set_translations_kinematic(
&mut self,
kinematic_translations: Matrix<bool, U2, U1, <DefaultAllocator as Allocator<bool, U2, U1>>::Buffer>
) -> &mut RigidBodyDesc<N>
[src]
&mut self,
kinematic_translations: Matrix<bool, U2, U1, <DefaultAllocator as Allocator<bool, U2, U1>>::Buffer>
) -> &mut RigidBodyDesc<N>
pub fn get_rotation(&self) -> N
[src]
pub fn get_kinematic_rotations(&self) -> bool
[src]
pub fn get_angular_inertia(&self) -> N
[src]
pub fn get_translation(
&self
) -> &Matrix<N, U2, U1, <DefaultAllocator as Allocator<N, U2, U1>>::Buffer>
[src]
&self
) -> &Matrix<N, U2, U1, <DefaultAllocator as Allocator<N, U2, U1>>::Buffer>
pub fn get_mass(&self) -> N
[src]
pub fn is_gravity_enabled(&self) -> bool
[src]
pub fn is_linear_motion_interpolation_enabled(&self) -> bool
[src]
pub fn get_status(&self) -> BodyStatus
[src]
pub fn get_sleep_threshold(&self) -> Option<N>
[src]
pub fn get_linear_damping(&self) -> N
[src]
pub fn get_angular_damping(&self) -> N
[src]
pub fn get_max_linear_velocity(&self) -> N
[src]
pub fn get_max_angular_velocity(&self) -> N
[src]
pub fn get_position(&self) -> &Isometry<N, U2, Unit<Complex<N>>>
[src]
pub fn get_velocity(&self) -> &Velocity2<N>
[src]
pub fn get_local_inertia(&self) -> &Inertia2<N>
[src]
pub fn get_local_center_of_mass(&self) -> &Point<N, U2>
[src]
pub fn build(&self) -> RigidBody<N>
[src]
Builds a rigid body from this description.
Trait Implementations
impl<N> Clone for RigidBodyDesc<N> where
N: Clone + RealField,
[src]
N: Clone + RealField,
fn clone(&self) -> RigidBodyDesc<N>
[src]
fn clone_from(&mut self, source: &Self)
1.0.0[src]
Auto Trait Implementations
impl<N> !RefUnwindSafe for RigidBodyDesc<N>
impl<N> Send for RigidBodyDesc<N> where
N: Scalar,
N: Scalar,
impl<N> Sync for RigidBodyDesc<N> where
N: Scalar,
N: Scalar,
impl<N> Unpin for RigidBodyDesc<N> where
N: Scalar + Unpin,
N: Scalar + Unpin,
impl<N> !UnwindSafe for RigidBodyDesc<N>
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Any for T where
T: Any,
T: Any,
fn get_type_id(&self) -> TypeId
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> Downcast for T where
T: Any,
T: Any,
fn into_any(self: Box<T>) -> Box<dyn Any + 'static>
fn into_any_rc(self: Rc<T>) -> Rc<dyn Any + 'static>
fn as_any(&self) -> &(dyn Any + 'static)
fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
impl<T> DowncastSync for T where
T: Send + Sync + Any,
T: Send + Sync + Any,
impl<T> Event for T where
T: Send + Sync + 'static,
T: Send + Sync + 'static,
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T> Resource for T where
T: Any,
T: Any,
impl<T> Same<T> for T
type Output = T
Should always be Self
impl<SS, SP> SupersetOf<SS> for SP where
SS: SubsetOf<SP>,
SS: SubsetOf<SP>,
fn to_subset(&self) -> Option<SS>
fn is_in_subset(&self) -> bool
fn to_subset_unchecked(&self) -> SS
fn from_subset(element: &SS) -> SP
impl<T> ToOwned for T where
T: Clone,
[src]
T: Clone,
type Owned = T
The resulting type after obtaining ownership.
fn to_owned(&self) -> T
[src]
fn clone_into(&self, target: &mut T)
[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.
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.
fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>
[src]
impl<T> UserData for T where
T: Clone + Send + Sync + Any,
[src]
T: Clone + Send + Sync + Any,
fn clone_boxed(&self) -> Box<dyn UserData + 'static>
[src]
fn to_any(&self) -> Box<dyn Any + 'static + Sync + Send>
[src]
fn as_any(&self) -> &(dyn Any + 'static + Sync + Send)
[src]
impl<V, T> VZip<V> for T where
V: MultiLane<T>,
V: MultiLane<T>,