Skip to main content

MotorJointDef

Struct MotorJointDef 

Source
pub struct MotorJointDef { /* private fields */ }
Expand description

Definition for a motor joint.

Implementations§

Source§

impl MotorJointDef

Source

pub const fn new(body_a: BodyId, body_b: BodyId) -> Self

Creates a definition for two bodies.

Source

pub fn linear_velocity(self, velocity: impl Into<Vec3>) -> Self

Sets the target linear velocity in world length units per second.

Source

pub fn angular_velocity(self, velocity: impl Into<Vec3>) -> Self

Sets the target angular velocity in radians per second around each axis.

Source

pub fn max_velocity_force(self, force: f32) -> Self

Sets the maximum velocity-control force, typically in newtons.

Source

pub fn max_velocity_torque(self, torque: f32) -> Self

Sets the maximum velocity-control torque, typically in newton-meters.

Source

pub fn linear_spring( self, hertz: f32, damping_ratio: f32, max_force: f32, ) -> Self

Sets linear spring frequency in hertz, dimensionless damping, and maximum force, typically in newtons.

Source

pub fn angular_spring( self, hertz: f32, damping_ratio: f32, max_torque: f32, ) -> Self

Sets angular spring frequency in hertz, dimensionless damping, and maximum torque, typically in newton-meters.

Source§

impl MotorJointDef

Source

pub fn body_ids(self, body_a: BodyId, body_b: BodyId) -> Self

Replaces the two bodies connected by the joint.

Source

pub fn local_frame_a(self, frame: Transform) -> Self

Sets the local constraint frame on body A.

Source

pub fn local_frame_b(self, frame: Transform) -> Self

Sets the local constraint frame on body B.

Source

pub fn collide_connected(self, enabled: bool) -> Self

Controls whether the connected bodies may collide.

Source

pub fn force_threshold(self, threshold: f32) -> Self

Sets the force threshold used to emit joint events, typically in newtons.

Source

pub fn torque_threshold(self, threshold: f32) -> Self

Sets the torque threshold used to emit joint events, typically in newton-meters.

Source

pub fn constraint_tuning(self, tuning: JointTuning) -> Self

Sets common constraint frequency in hertz and its dimensionless damping ratio.

Source

pub fn draw_scale(self, draw_scale: f32) -> Self

Overrides the length-unit-derived native debug draw scale.

Trait Implementations§

Source§

impl Clone for MotorJointDef

Source§

fn clone(&self) -> MotorJointDef

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Copy for MotorJointDef

Source§

impl Debug for MotorJointDef

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.