pub struct DistanceBuilder<const BODY_1: bool, const BODY_2: bool, const STIFFNESS: bool> {
priority: Option<isize>,
body1: Option<RigidBodyHandle>,
body2: Option<RigidBodyHandle>,
anchor1: Option<Translation3<f32>>,
anchor2: Option<Translation3<f32>>,
stiffness: Option<Stiffness<f32>>,
response: DistanceResponse,
rest_length: Option<f32>,
damping: Option<f32>,
}Expand description
Convenience struct for building Distance
constraints.
Fields§
§priority: Option<isize>§body1: Option<RigidBodyHandle>§body2: Option<RigidBodyHandle>§anchor1: Option<Translation3<f32>>§anchor2: Option<Translation3<f32>>§stiffness: Option<Stiffness<f32>>§response: DistanceResponse§rest_length: Option<f32>§damping: Option<f32>Implementations§
Source§impl DistanceBuilder<false, false, false>
impl DistanceBuilder<false, false, false>
Source§impl<const BODY_1: bool, const BODY_2: bool, const STIFFNESS: bool> DistanceBuilder<BODY_1, BODY_2, STIFFNESS>
impl<const BODY_1: bool, const BODY_2: bool, const STIFFNESS: bool> DistanceBuilder<BODY_1, BODY_2, STIFFNESS>
fn cast<const BBODY_1: bool, const BBODY_2: bool, const BSTIFFNESS: bool>( self, ) -> DistanceBuilder<BBODY_1, BBODY_2, BSTIFFNESS>
pub fn damping(self, damping: f32) -> Self
pub fn priority(self, priority: isize) -> Self
pub fn rest_length(self, rest_length: f32) -> Self
pub fn anchor1(self, anchor: Translation3<f32>) -> Self
pub fn anchor2(self, anchor: Translation3<f32>) -> Self
Source§impl<const BODY_2: bool, const STIFFNESS: bool> DistanceBuilder<true, BODY_2, STIFFNESS>
impl<const BODY_2: bool, const STIFFNESS: bool> DistanceBuilder<true, BODY_2, STIFFNESS>
pub fn get_body_1(&self) -> RigidBodyHandle
Source§impl<const BODY_1: bool, const STIFFNESS: bool> DistanceBuilder<BODY_1, true, STIFFNESS>
impl<const BODY_1: bool, const STIFFNESS: bool> DistanceBuilder<BODY_1, true, STIFFNESS>
pub fn get_body_2(&self) -> RigidBodyHandle
Source§impl<const BODY_1: bool, const BODY_2: bool> DistanceBuilder<BODY_1, BODY_2, false>
impl<const BODY_1: bool, const BODY_2: bool> DistanceBuilder<BODY_1, BODY_2, false>
pub fn stiffness( self, young: f32, poisson: f32, ) -> DistanceBuilder<BODY_1, BODY_2, true>
Source§impl<const BODY_2: bool, const STIFFNESS: bool> DistanceBuilder<false, BODY_2, STIFFNESS>
impl<const BODY_2: bool, const STIFFNESS: bool> DistanceBuilder<false, BODY_2, STIFFNESS>
pub fn body_1( self, body: RigidBodyHandle, ) -> DistanceBuilder<true, BODY_2, STIFFNESS>
Source§impl<const BODY_1: bool, const STIFFNESS: bool> DistanceBuilder<BODY_1, false, STIFFNESS>
impl<const BODY_1: bool, const STIFFNESS: bool> DistanceBuilder<BODY_1, false, STIFFNESS>
pub fn body_2( self, body: RigidBodyHandle, ) -> DistanceBuilder<BODY_1, true, STIFFNESS>
Trait Implementations§
Source§impl<const BODY_1: bool, const BODY_2: bool, const STIFFNESS: bool> Clone for DistanceBuilder<BODY_1, BODY_2, STIFFNESS>
impl<const BODY_1: bool, const BODY_2: bool, const STIFFNESS: bool> Clone for DistanceBuilder<BODY_1, BODY_2, STIFFNESS>
Source§fn clone(&self) -> DistanceBuilder<BODY_1, BODY_2, STIFFNESS>
fn clone(&self) -> DistanceBuilder<BODY_1, BODY_2, STIFFNESS>
Returns a copy of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl<const BODY_1: bool, const BODY_2: bool, const STIFFNESS: bool> Debug for DistanceBuilder<BODY_1, BODY_2, STIFFNESS>
impl<const BODY_1: bool, const BODY_2: bool, const STIFFNESS: bool> Debug for DistanceBuilder<BODY_1, BODY_2, STIFFNESS>
Source§impl<const BODY_1: bool, const BODY_2: bool, const STIFFNESS: bool> Default for DistanceBuilder<BODY_1, BODY_2, STIFFNESS>
impl<const BODY_1: bool, const BODY_2: bool, const STIFFNESS: bool> Default for DistanceBuilder<BODY_1, BODY_2, STIFFNESS>
Source§fn default() -> DistanceBuilder<BODY_1, BODY_2, STIFFNESS>
fn default() -> DistanceBuilder<BODY_1, BODY_2, STIFFNESS>
Returns the “default value” for a type. Read more
Source§impl<const BODY_1: bool, const BODY_2: bool, const STIFFNESS: bool> PartialEq for DistanceBuilder<BODY_1, BODY_2, STIFFNESS>
impl<const BODY_1: bool, const BODY_2: bool, const STIFFNESS: bool> PartialEq for DistanceBuilder<BODY_1, BODY_2, STIFFNESS>
Source§fn eq(&self, other: &DistanceBuilder<BODY_1, BODY_2, STIFFNESS>) -> bool
fn eq(&self, other: &DistanceBuilder<BODY_1, BODY_2, STIFFNESS>) -> bool
Tests for
self and other values to be equal, and is used by ==.impl<const BODY_1: bool, const BODY_2: bool, const STIFFNESS: bool> Copy for DistanceBuilder<BODY_1, BODY_2, STIFFNESS>
impl<const BODY_1: bool, const BODY_2: bool, const STIFFNESS: bool> StructuralPartialEq for DistanceBuilder<BODY_1, BODY_2, STIFFNESS>
Auto Trait Implementations§
impl<const BODY_1: bool, const BODY_2: bool, const STIFFNESS: bool> Freeze for DistanceBuilder<BODY_1, BODY_2, STIFFNESS>
impl<const BODY_1: bool, const BODY_2: bool, const STIFFNESS: bool> RefUnwindSafe for DistanceBuilder<BODY_1, BODY_2, STIFFNESS>
impl<const BODY_1: bool, const BODY_2: bool, const STIFFNESS: bool> Send for DistanceBuilder<BODY_1, BODY_2, STIFFNESS>
impl<const BODY_1: bool, const BODY_2: bool, const STIFFNESS: bool> Sync for DistanceBuilder<BODY_1, BODY_2, STIFFNESS>
impl<const BODY_1: bool, const BODY_2: bool, const STIFFNESS: bool> Unpin for DistanceBuilder<BODY_1, BODY_2, STIFFNESS>
impl<const BODY_1: bool, const BODY_2: bool, const STIFFNESS: bool> UnwindSafe for DistanceBuilder<BODY_1, BODY_2, STIFFNESS>
Blanket Implementations§
Source§impl<T, U> AsBindGroupShaderType<U> for T
impl<T, U> AsBindGroupShaderType<U> for T
Source§fn as_bind_group_shader_type(&self, _images: &RenderAssets<GpuImage>) -> U
fn as_bind_group_shader_type(&self, _images: &RenderAssets<GpuImage>) -> U
Return the
T ShaderType for self. When used in AsBindGroup
derives, it is safe to assume that all images in self exist.Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
Source§impl<T> CheckedAs for T
impl<T> CheckedAs for T
Source§fn checked_as<Dst>(self) -> Option<Dst>where
T: CheckedCast<Dst>,
fn checked_as<Dst>(self) -> Option<Dst>where
T: CheckedCast<Dst>,
Casts the value.
Source§impl<Src, Dst> CheckedCastFrom<Src> for Dstwhere
Src: CheckedCast<Dst>,
impl<Src, Dst> CheckedCastFrom<Src> for Dstwhere
Src: CheckedCast<Dst>,
Source§fn checked_cast_from(src: Src) -> Option<Dst>
fn checked_cast_from(src: Src) -> Option<Dst>
Casts the value.
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> Downcast for Twhere
T: Any,
impl<T> Downcast for Twhere
T: Any,
Source§fn into_any(self: Box<T>) -> Box<dyn Any>
fn into_any(self: Box<T>) -> Box<dyn Any>
Convert
Box<dyn Trait> (where Trait: Downcast) to Box<dyn Any>. Box<dyn Any> can
then be further downcast into Box<ConcreteType> where ConcreteType implements Trait.Source§fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
Convert
Rc<Trait> (where Trait: Downcast) to Rc<Any>. Rc<Any> can then be
further downcast into Rc<ConcreteType> where ConcreteType implements Trait.Source§fn as_any(&self) -> &(dyn Any + 'static)
fn as_any(&self) -> &(dyn Any + 'static)
Convert
&Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &Any’s vtable from &Trait’s.Source§fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
Convert
&mut Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &mut Any’s vtable from &mut Trait’s.Source§impl<T> DowncastSync for T
impl<T> DowncastSync for T
Source§impl<S> FromSample<S> for S
impl<S> FromSample<S> for S
fn from_sample_(s: S) -> S
Source§impl<T> FromWorld for Twhere
T: Default,
impl<T> FromWorld for Twhere
T: Default,
Source§fn from_world(_world: &mut World) -> T
fn from_world(_world: &mut World) -> T
Creates Self using default().
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§impl<Src, Dst> LosslessTryInto<Dst> for Srcwhere
Dst: LosslessTryFrom<Src>,
impl<Src, Dst> LosslessTryInto<Dst> for Srcwhere
Dst: LosslessTryFrom<Src>,
Source§fn lossless_try_into(self) -> Option<Dst>
fn lossless_try_into(self) -> Option<Dst>
Performs the conversion.
Source§impl<Src, Dst> LossyInto<Dst> for Srcwhere
Dst: LossyFrom<Src>,
impl<Src, Dst> LossyInto<Dst> for Srcwhere
Dst: LossyFrom<Src>,
Source§fn lossy_into(self) -> Dst
fn lossy_into(self) -> Dst
Performs the conversion.
Source§impl<T> OverflowingAs for T
impl<T> OverflowingAs for T
Source§fn overflowing_as<Dst>(self) -> (Dst, bool)where
T: OverflowingCast<Dst>,
fn overflowing_as<Dst>(self) -> (Dst, bool)where
T: OverflowingCast<Dst>,
Casts the value.
Source§impl<Src, Dst> OverflowingCastFrom<Src> for Dstwhere
Src: OverflowingCast<Dst>,
impl<Src, Dst> OverflowingCastFrom<Src> for Dstwhere
Src: OverflowingCast<Dst>,
Source§fn overflowing_cast_from(src: Src) -> (Dst, bool)
fn overflowing_cast_from(src: Src) -> (Dst, bool)
Casts the value.
Source§impl<T> Pointable for T
impl<T> Pointable for T
Source§impl<T> SaturatingAs for T
impl<T> SaturatingAs for T
Source§fn saturating_as<Dst>(self) -> Dstwhere
T: SaturatingCast<Dst>,
fn saturating_as<Dst>(self) -> Dstwhere
T: SaturatingCast<Dst>,
Casts the value.
Source§impl<Src, Dst> SaturatingCastFrom<Src> for Dstwhere
Src: SaturatingCast<Dst>,
impl<Src, Dst> SaturatingCastFrom<Src> for Dstwhere
Src: SaturatingCast<Dst>,
Source§fn saturating_cast_from(src: Src) -> Dst
fn saturating_cast_from(src: Src) -> Dst
Casts the value.
Source§impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
Source§fn to_subset(&self) -> Option<SS>
fn to_subset(&self) -> Option<SS>
The inverse inclusion map: attempts to construct
self from the equivalent element of its
superset. Read moreSource§fn is_in_subset(&self) -> bool
fn is_in_subset(&self) -> bool
Checks if
self is actually part of its subset T (and can be converted to it).Source§fn to_subset_unchecked(&self) -> SS
fn to_subset_unchecked(&self) -> SS
Use with care! Same as
self.to_subset but without any property checks. Always succeeds.Source§fn from_subset(element: &SS) -> SP
fn from_subset(element: &SS) -> SP
The inclusion map: converts
self to the equivalent element of its superset.Source§impl<T, U> ToSample<U> for Twhere
U: FromSample<T>,
impl<T, U> ToSample<U> for Twhere
U: FromSample<T>,
fn to_sample_(self) -> U
Source§impl<T> UnwrappedAs for T
impl<T> UnwrappedAs for T
Source§fn unwrapped_as<Dst>(self) -> Dstwhere
T: UnwrappedCast<Dst>,
fn unwrapped_as<Dst>(self) -> Dstwhere
T: UnwrappedCast<Dst>,
Casts the value.
Source§impl<Src, Dst> UnwrappedCastFrom<Src> for Dstwhere
Src: UnwrappedCast<Dst>,
impl<Src, Dst> UnwrappedCastFrom<Src> for Dstwhere
Src: UnwrappedCast<Dst>,
Source§fn unwrapped_cast_from(src: Src) -> Dst
fn unwrapped_cast_from(src: Src) -> Dst
Casts the value.
Source§impl<T> WithSubscriber for T
impl<T> WithSubscriber for T
Source§fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
Source§fn with_current_subscriber(self) -> WithDispatch<Self>
fn with_current_subscriber(self) -> WithDispatch<Self>
Source§impl<T> WrappingAs for T
impl<T> WrappingAs for T
Source§fn wrapping_as<Dst>(self) -> Dstwhere
T: WrappingCast<Dst>,
fn wrapping_as<Dst>(self) -> Dstwhere
T: WrappingCast<Dst>,
Casts the value.
Source§impl<Src, Dst> WrappingCastFrom<Src> for Dstwhere
Src: WrappingCast<Dst>,
impl<Src, Dst> WrappingCastFrom<Src> for Dstwhere
Src: WrappingCast<Dst>,
Source§fn wrapping_cast_from(src: Src) -> Dst
fn wrapping_cast_from(src: Src) -> Dst
Casts the value.