pub struct MotorJointDef(/* private fields */);Expand description
Motor joint definition (maps to b2MotorJointDef). Drives relative motion
between two bodies using linear and angular offsets with configurable
maximum forces.
Implementations§
Source§impl MotorJointDef
impl MotorJointDef
pub fn new(base: JointBase) -> Self
Sourcepub fn linear_velocity<V: Into<Vec2>>(self, v: V) -> Self
pub fn linear_velocity<V: Into<Vec2>>(self, v: V) -> Self
Target linear velocity of body B relative to A (m/s).
Sourcepub fn max_velocity_force(self, v: f32) -> Self
pub fn max_velocity_force(self, v: f32) -> Self
Maximum force to achieve linear velocity (N).
Sourcepub fn angular_velocity(self, v: f32) -> Self
pub fn angular_velocity(self, v: f32) -> Self
Target angular velocity of body B relative to A (rad/s).
Sourcepub fn max_velocity_torque(self, v: f32) -> Self
pub fn max_velocity_torque(self, v: f32) -> Self
Maximum torque to achieve angular velocity (N·m).
Sourcepub fn linear_hertz(self, v: f32) -> Self
pub fn linear_hertz(self, v: f32) -> Self
Linear spring stiffness (Hz).
Sourcepub fn linear_damping_ratio(self, v: f32) -> Self
pub fn linear_damping_ratio(self, v: f32) -> Self
Linear damping ratio [0,1].
Sourcepub fn max_spring_force(self, v: f32) -> Self
pub fn max_spring_force(self, v: f32) -> Self
Maximum linear spring force (N).
Sourcepub fn angular_hertz(self, v: f32) -> Self
pub fn angular_hertz(self, v: f32) -> Self
Angular spring stiffness (Hz).
Sourcepub fn angular_damping_ratio(self, v: f32) -> Self
pub fn angular_damping_ratio(self, v: f32) -> Self
Angular damping ratio [0,1].
Sourcepub fn max_spring_torque(self, v: f32) -> Self
pub fn max_spring_torque(self, v: f32) -> Self
Maximum angular spring torque (N·m).
Trait Implementations§
Source§impl Clone for MotorJointDef
impl Clone for MotorJointDef
Source§fn clone(&self) -> MotorJointDef
fn clone(&self) -> MotorJointDef
Returns a duplicate of the value. Read more
1.0.0§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreAuto Trait Implementations§
impl Freeze for MotorJointDef
impl RefUnwindSafe for MotorJointDef
impl !Send for MotorJointDef
impl !Sync for MotorJointDef
impl Unpin for MotorJointDef
impl UnwindSafe for MotorJointDef
Blanket Implementations§
§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§unsafe fn clone_to_uninit(&self, dest: *mut u8)
unsafe fn clone_to_uninit(&self, dest: *mut u8)
🔬This is a nightly-only experimental API. (
clone_to_uninit)