pub struct SpringJointBehaviour { /* private fields */ }Expand description
A joint behaviour that will move the anchored body into a position and angle relative to the anchor over time.
Implementations§
Source§impl SpringJointBehaviour
impl SpringJointBehaviour
Sourcepub fn new(rigidness: f32) -> Option<SpringJointBehaviour>
pub fn new(rigidness: f32) -> Option<SpringJointBehaviour>
Create a new SpringJointBehaviour with an exact rigidness value.
Rigidness describes how “snappy” the spring joint is. When it’s at 0.0, the anchored body will “jump” into position softly over one second. When it’s at 1.0, the anchored body will “jump” into position almost instantaenously.
pub fn new_lossy(rigidness: f32) -> SpringJointBehaviour
Trait Implementations§
Source§impl Clone for SpringJointBehaviour
impl Clone for SpringJointBehaviour
Source§fn clone(&self) -> SpringJointBehaviour
fn clone(&self) -> SpringJointBehaviour
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreimpl Copy for SpringJointBehaviour
Source§impl Debug for SpringJointBehaviour
impl Debug for SpringJointBehaviour
Source§impl Default for SpringJointBehaviour
impl Default for SpringJointBehaviour
Source§fn default() -> SpringJointBehaviour
fn default() -> SpringJointBehaviour
Returns the “default value” for a type. Read more
Source§impl JointBehaviour for SpringJointBehaviour
impl JointBehaviour for SpringJointBehaviour
const STAGE: &'static str = stage::COLLIDING_JOINT
Source§fn linear_velocity(
&mut self,
_offset: Vec2,
_anchor: &RigidBody,
_target: &RigidBody,
) -> Option<Vec2>
fn linear_velocity( &mut self, _offset: Vec2, _anchor: &RigidBody, _target: &RigidBody, ) -> Option<Vec2>
Returns a new linear velocity for target based on
self and anchor.Source§fn angular_velocity(
&mut self,
_angle: f32,
_anchor: &RigidBody,
_target: &RigidBody,
) -> Option<f32>
fn angular_velocity( &mut self, _angle: f32, _anchor: &RigidBody, _target: &RigidBody, ) -> Option<f32>
Returns a new angular velocity for target based on
self and anchor.Source§fn linear_impulse(
&mut self,
offset: Vec2,
anchor: &RigidBody,
target: &RigidBody,
) -> Option<Vec2>
fn linear_impulse( &mut self, offset: Vec2, anchor: &RigidBody, target: &RigidBody, ) -> Option<Vec2>
Returns a linear impulse to apply to target based on
self and anchor.Source§fn angular_impulse(
&mut self,
angle: f32,
anchor: &RigidBody,
target: &RigidBody,
) -> Option<f32>
fn angular_impulse( &mut self, angle: f32, anchor: &RigidBody, target: &RigidBody, ) -> Option<f32>
Returns an angular impulse to apply to target based on
self and anchor.Source§impl PartialEq for SpringJointBehaviour
impl PartialEq for SpringJointBehaviour
Source§fn eq(&self, other: &SpringJointBehaviour) -> bool
fn eq(&self, other: &SpringJointBehaviour) -> bool
Tests for
self and other values to be equal, and is used by ==.impl StructuralPartialEq for SpringJointBehaviour
Auto Trait Implementations§
impl Freeze for SpringJointBehaviour
impl RefUnwindSafe for SpringJointBehaviour
impl Send for SpringJointBehaviour
impl Sync for SpringJointBehaviour
impl Unpin for SpringJointBehaviour
impl UnsafeUnpin for SpringJointBehaviour
impl UnwindSafe for SpringJointBehaviour
Blanket Implementations§
impl<T> Any for Twhere
T: Any,
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
impl<T> CloneAny for T
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> Component for T
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<T> FromResources for Twhere
T: Default,
impl<T> FromResources for Twhere
T: Default,
Source§fn from_resources(_resources: &Resources) -> T
fn from_resources(_resources: &Resources) -> T
Creates
Self using data from the Resources collection