pub struct b2WheelJoint { /* private fields */ }Expand description
A wheel joint. This joint provides two degrees of freedom: translation along an axis fixed in bodyA and rotation in the plane. In other words, it is a point to line constraint with a rotational motor and a linear spring/damper. The spring/damper is initialized upon creation. This joint is designed for vehicle suspensions.
Implementations§
Source§impl b2WheelJoint
impl b2WheelJoint
Sourcepub fn GetLocalAnchorA(self: &b2WheelJoint) -> &b2Vec2
pub fn GetLocalAnchorA(self: &b2WheelJoint) -> &b2Vec2
The local anchor point relative to bodyA’s origin.
Sourcepub fn GetLocalAnchorB(self: &b2WheelJoint) -> &b2Vec2
pub fn GetLocalAnchorB(self: &b2WheelJoint) -> &b2Vec2
The local anchor point relative to bodyB’s origin.
Sourcepub fn GetLocalAxisA(self: &b2WheelJoint) -> &b2Vec2
pub fn GetLocalAxisA(self: &b2WheelJoint) -> &b2Vec2
The local joint axis relative to bodyA.
Sourcepub fn GetJointTranslation(self: &b2WheelJoint) -> f32
pub fn GetJointTranslation(self: &b2WheelJoint) -> f32
Get the current joint translation, usually in meters.
Sourcepub fn GetJointAngle(self: &b2WheelJoint) -> f32
pub fn GetJointAngle(self: &b2WheelJoint) -> f32
Get the current joint angle in radians.
Sourcepub fn IsLimitEnabled(self: &b2WheelJoint) -> bool
pub fn IsLimitEnabled(self: &b2WheelJoint) -> bool
Is the joint limit enabled?
Sourcepub fn EnableLimit(self: Pin<&mut b2WheelJoint>, flag: bool)
pub fn EnableLimit(self: Pin<&mut b2WheelJoint>, flag: bool)
Enable/disable the joint translation limit.
Sourcepub fn GetLowerLimit(self: &b2WheelJoint) -> f32
pub fn GetLowerLimit(self: &b2WheelJoint) -> f32
Get the lower joint translation limit, usually in meters.
Sourcepub fn GetUpperLimit(self: &b2WheelJoint) -> f32
pub fn GetUpperLimit(self: &b2WheelJoint) -> f32
Get the upper joint translation limit, usually in meters.
Sourcepub fn SetLimits(self: Pin<&mut b2WheelJoint>, lower: f32, upper: f32)
pub fn SetLimits(self: Pin<&mut b2WheelJoint>, lower: f32, upper: f32)
Set the joint translation limits, usually in meters.
Sourcepub fn IsMotorEnabled(self: &b2WheelJoint) -> bool
pub fn IsMotorEnabled(self: &b2WheelJoint) -> bool
Is the joint motor enabled?
Sourcepub fn EnableMotor(self: Pin<&mut b2WheelJoint>, flag: bool)
pub fn EnableMotor(self: Pin<&mut b2WheelJoint>, flag: bool)
Enable/disable the joint motor.
Sourcepub fn SetMotorSpeed(self: Pin<&mut b2WheelJoint>, speed: f32)
pub fn SetMotorSpeed(self: Pin<&mut b2WheelJoint>, speed: f32)
Set the motor speed, usually in radians per second.
Sourcepub fn GetMotorSpeed(self: &b2WheelJoint) -> f32
pub fn GetMotorSpeed(self: &b2WheelJoint) -> f32
Get the motor speed, usually in radians per second.
Sourcepub fn SetMaxMotorTorque(self: Pin<&mut b2WheelJoint>, torque: f32)
pub fn SetMaxMotorTorque(self: Pin<&mut b2WheelJoint>, torque: f32)
Set/Get the maximum motor force, usually in N-m.
pub fn GetMaxMotorTorque(self: &b2WheelJoint) -> f32
Sourcepub fn GetMotorTorque(self: &b2WheelJoint, inv_dt: f32) -> f32
pub fn GetMotorTorque(self: &b2WheelJoint, inv_dt: f32) -> f32
Get the current motor torque given the inverse time step, usually in N-m.
Sourcepub fn SetStiffness(self: Pin<&mut b2WheelJoint>, stiffness: f32)
pub fn SetStiffness(self: Pin<&mut b2WheelJoint>, stiffness: f32)
Access spring stiffness
pub fn GetStiffness(self: &b2WheelJoint) -> f32
Sourcepub fn SetDamping(self: Pin<&mut b2WheelJoint>, damping: f32)
pub fn SetDamping(self: Pin<&mut b2WheelJoint>, damping: f32)
Access damping
pub fn GetDamping(self: &b2WheelJoint) -> f32
pub fn GetAnchorA(self: &b2WheelJoint) -> b2Vec2
pub fn GetAnchorB(self: &b2WheelJoint) -> b2Vec2
pub fn GetReactionForce(self: &b2WheelJoint, inv_dt: f32) -> b2Vec2
pub fn GetReactionTorque(self: &b2WheelJoint, inv_dt: f32) -> f32
Sourcepub fn Dump(self: Pin<&mut b2WheelJoint>)
pub fn Dump(self: Pin<&mut b2WheelJoint>)
Dump to b2Log
pub unsafe fn Draw(self: &b2WheelJoint, draw: *mut b2Draw)
Source§impl b2WheelJoint
impl b2WheelJoint
Sourcepub fn GetJointLinearSpeed(&self) -> f32
pub fn GetJointLinearSpeed(&self) -> f32
Get the current joint linear speed, usually in meters per second.
Sourcepub fn GetJointAngularSpeed(&self) -> f32
pub fn GetJointAngularSpeed(&self) -> f32
Get the current joint angular speed in radians per second.
Trait Implementations§
Source§impl AsRef<b2Joint> for b2WheelJoint
impl AsRef<b2Joint> for b2WheelJoint
Source§fn as_ref(self: &b2WheelJoint) -> &b2Joint
fn as_ref(self: &b2WheelJoint) -> &b2Joint
Source§impl CopyNew for b2WheelJoint
impl CopyNew for b2WheelJoint
Source§unsafe fn copy_new(
other: &b2WheelJoint,
this: Pin<&mut MaybeUninit<b2WheelJoint>>,
)
unsafe fn copy_new( other: &b2WheelJoint, this: Pin<&mut MaybeUninit<b2WheelJoint>>, )
Synthesized copy constructor.
Source§impl Drop for b2WheelJoint
impl Drop for b2WheelJoint
Source§fn drop(self: &mut b2WheelJoint)
fn drop(self: &mut b2WheelJoint)
Synthesized destructor.