pub struct b2RevoluteJoint { /* private fields */ }Expand description
A revolute joint constrains two bodies to share a common point while they are free to rotate about the point. The relative rotation about the shared point is the joint angle. You can limit the relative rotation with a joint limit that specifies a lower and upper angle. You can use a motor to drive the relative rotation about the shared point. A maximum motor torque is provided so that infinite forces are not generated.
Implementations§
Source§impl b2RevoluteJoint
impl b2RevoluteJoint
Sourcepub fn GetLocalAnchorA(self: &b2RevoluteJoint) -> &b2Vec2
pub fn GetLocalAnchorA(self: &b2RevoluteJoint) -> &b2Vec2
The local anchor point relative to bodyA’s origin.
Sourcepub fn GetLocalAnchorB(self: &b2RevoluteJoint) -> &b2Vec2
pub fn GetLocalAnchorB(self: &b2RevoluteJoint) -> &b2Vec2
The local anchor point relative to bodyB’s origin.
Sourcepub fn GetReferenceAngle(self: &b2RevoluteJoint) -> f32
pub fn GetReferenceAngle(self: &b2RevoluteJoint) -> f32
Get the reference angle.
Sourcepub fn GetJointSpeed(self: &b2RevoluteJoint) -> f32
pub fn GetJointSpeed(self: &b2RevoluteJoint) -> f32
Get the current joint angle speed in radians per second.
Sourcepub fn IsLimitEnabled(self: &b2RevoluteJoint) -> bool
pub fn IsLimitEnabled(self: &b2RevoluteJoint) -> bool
Is the joint limit enabled?
Sourcepub fn EnableLimit(self: Pin<&mut b2RevoluteJoint>, flag: bool)
pub fn EnableLimit(self: Pin<&mut b2RevoluteJoint>, flag: bool)
Enable/disable the joint limit.
Sourcepub fn GetLowerLimit(self: &b2RevoluteJoint) -> f32
pub fn GetLowerLimit(self: &b2RevoluteJoint) -> f32
Get the lower joint limit in radians.
Sourcepub fn GetUpperLimit(self: &b2RevoluteJoint) -> f32
pub fn GetUpperLimit(self: &b2RevoluteJoint) -> f32
Get the upper joint limit in radians.
Sourcepub fn SetLimits(self: Pin<&mut b2RevoluteJoint>, lower: f32, upper: f32)
pub fn SetLimits(self: Pin<&mut b2RevoluteJoint>, lower: f32, upper: f32)
Set the joint limits in radians.
Sourcepub fn IsMotorEnabled(self: &b2RevoluteJoint) -> bool
pub fn IsMotorEnabled(self: &b2RevoluteJoint) -> bool
Is the joint motor enabled?
Sourcepub fn EnableMotor(self: Pin<&mut b2RevoluteJoint>, flag: bool)
pub fn EnableMotor(self: Pin<&mut b2RevoluteJoint>, flag: bool)
Enable/disable the joint motor.
Sourcepub fn SetMotorSpeed(self: Pin<&mut b2RevoluteJoint>, speed: f32)
pub fn SetMotorSpeed(self: Pin<&mut b2RevoluteJoint>, speed: f32)
Set the motor speed in radians per second.
Sourcepub fn GetMotorSpeed(self: &b2RevoluteJoint) -> f32
pub fn GetMotorSpeed(self: &b2RevoluteJoint) -> f32
Get the motor speed in radians per second.
pub fn GetAnchorA(self: &b2RevoluteJoint) -> b2Vec2
pub fn GetAnchorB(self: &b2RevoluteJoint) -> b2Vec2
Sourcepub fn GetReactionForce(self: &b2RevoluteJoint, inv_dt: f32) -> b2Vec2
pub fn GetReactionForce(self: &b2RevoluteJoint, inv_dt: f32) -> b2Vec2
Get the reaction force given the inverse time step. Unit is N.
Sourcepub fn GetReactionTorque(self: &b2RevoluteJoint, inv_dt: f32) -> f32
pub fn GetReactionTorque(self: &b2RevoluteJoint, inv_dt: f32) -> f32
Get the reaction torque due to the joint limit given the inverse time step. Unit is N*m.
Sourcepub fn Dump(self: Pin<&mut b2RevoluteJoint>)
pub fn Dump(self: Pin<&mut b2RevoluteJoint>)
Dump to b2Log.
pub unsafe fn Draw(self: &b2RevoluteJoint, draw: *mut b2Draw)
Source§impl b2RevoluteJoint
impl b2RevoluteJoint
Sourcepub fn GetJointAngle(&self) -> f32
pub fn GetJointAngle(&self) -> f32
Get the current joint angle in radians.
Sourcepub fn SetMaxMotorTorque(self: Pin<&mut Self>, torque: f32)
pub fn SetMaxMotorTorque(self: Pin<&mut Self>, torque: f32)
Set the maximum motor torque, usually in N-m.
pub fn GetMaxMotorTorque(&self) -> f32
Sourcepub fn GetMotorTorque(&self, inv_dt: f32) -> f32
pub fn GetMotorTorque(&self, inv_dt: f32) -> f32
Get the current motor torque given the inverse time step. Unit is N*m.
Trait Implementations§
Source§impl AsRef<b2Joint> for b2RevoluteJoint
impl AsRef<b2Joint> for b2RevoluteJoint
Source§fn as_ref(self: &b2RevoluteJoint) -> &b2Joint
fn as_ref(self: &b2RevoluteJoint) -> &b2Joint
Source§impl CopyNew for b2RevoluteJoint
impl CopyNew for b2RevoluteJoint
Source§unsafe fn copy_new(
other: &b2RevoluteJoint,
this: Pin<&mut MaybeUninit<b2RevoluteJoint>>,
)
unsafe fn copy_new( other: &b2RevoluteJoint, this: Pin<&mut MaybeUninit<b2RevoluteJoint>>, )
Synthesized copy constructor.
Source§impl Drop for b2RevoluteJoint
impl Drop for b2RevoluteJoint
Source§fn drop(self: &mut b2RevoluteJoint)
fn drop(self: &mut b2RevoluteJoint)
Synthesized destructor.