pub struct WheelJointDef(/* private fields */);Expand description
Wheel (suspension) joint definition (maps to b2WheelJointDef).
Constrains motion along an axis with suspension (spring + damping) and
optional motor around the wheel axis. Use with World::create_wheel_joint(_id)
or World::wheel(...).build().
Implementations§
Source§impl WheelJointDef
impl WheelJointDef
pub fn new(base: JointBase) -> Self
pub fn from_raw(raw: b2WheelJointDef) -> Self
pub fn base(&self) -> JointBase
pub fn spring_enabled(&self) -> bool
pub fn spring_hertz(&self) -> f32
pub fn spring_damping_ratio(&self) -> f32
pub fn limit_enabled(&self) -> bool
pub fn minimum_translation(&self) -> f32
pub fn maximum_translation(&self) -> f32
pub fn motor_enabled(&self) -> bool
pub fn maximum_motor_torque(&self) -> f32
pub fn target_motor_speed(&self) -> f32
pub fn into_raw(self) -> b2WheelJointDef
pub fn validate(&self) -> ApiResult<()>
Sourcepub fn enable_spring(self, flag: bool) -> Self
pub fn enable_spring(self, flag: bool) -> Self
Enable/disable suspension spring.
Sourcepub fn damping_ratio(self, v: f32) -> Self
pub fn damping_ratio(self, v: f32) -> Self
Spring damping ratio [0,1].
Sourcepub fn enable_limit(self, flag: bool) -> Self
pub fn enable_limit(self, flag: bool) -> Self
Enable/disable translation limits.
Sourcepub fn lower_translation(self, v: f32) -> Self
pub fn lower_translation(self, v: f32) -> Self
Lower translation limit (meters).
Sourcepub fn upper_translation(self, v: f32) -> Self
pub fn upper_translation(self, v: f32) -> Self
Upper translation limit (meters).
Sourcepub fn enable_motor(self, flag: bool) -> Self
pub fn enable_motor(self, flag: bool) -> Self
Enable/disable wheel motor.
Sourcepub fn max_motor_torque(self, v: f32) -> Self
pub fn max_motor_torque(self, v: f32) -> Self
Maximum motor torque (N·m).
Sourcepub fn motor_speed(self, v: f32) -> Self
pub fn motor_speed(self, v: f32) -> Self
Motor speed (rad/s).
Sourcepub fn motor_speed_deg(self, speed_deg_per_s: f32) -> Self
pub fn motor_speed_deg(self, speed_deg_per_s: f32) -> Self
Convenience: motor speed in degrees/sec.
Trait Implementations§
Source§impl Clone for WheelJointDef
impl Clone for WheelJointDef
Source§fn clone(&self) -> WheelJointDef
fn clone(&self) -> WheelJointDef
Returns a duplicate 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 moreAuto Trait Implementations§
impl Freeze for WheelJointDef
impl RefUnwindSafe for WheelJointDef
impl !Send for WheelJointDef
impl !Sync for WheelJointDef
impl Unpin for WheelJointDef
impl UnsafeUnpin for WheelJointDef
impl UnwindSafe for WheelJointDef
Blanket Implementations§
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