pub struct b2PrismaticJoint { /* private fields */ }Expand description
A prismatic joint. This joint provides one degree of freedom: translation along an axis fixed in bodyA. Relative rotation is prevented. You can use a joint limit to restrict the range of motion and a joint motor to drive the motion or to model joint friction.
Implementations§
Source§impl b2PrismaticJoint
impl b2PrismaticJoint
Sourcepub fn GetLocalAnchorA(self: &b2PrismaticJoint) -> &b2Vec2
pub fn GetLocalAnchorA(self: &b2PrismaticJoint) -> &b2Vec2
The local anchor point relative to bodyA’s origin.
Sourcepub fn GetLocalAnchorB(self: &b2PrismaticJoint) -> &b2Vec2
pub fn GetLocalAnchorB(self: &b2PrismaticJoint) -> &b2Vec2
The local anchor point relative to bodyB’s origin.
pub fn GetAnchorA(self: &b2PrismaticJoint) -> b2Vec2
pub fn GetAnchorB(self: &b2PrismaticJoint) -> b2Vec2
pub fn GetReactionForce(self: &b2PrismaticJoint, inv_dt: f32) -> b2Vec2
pub fn GetReactionTorque(self: &b2PrismaticJoint, inv_dt: f32) -> f32
Sourcepub fn Dump(self: Pin<&mut b2PrismaticJoint>)
pub fn Dump(self: Pin<&mut b2PrismaticJoint>)
Dump to b2Log
pub unsafe fn Draw(self: &b2PrismaticJoint, draw: *mut b2Draw)
Source§impl b2PrismaticJoint
impl b2PrismaticJoint
Sourcepub fn GetLocalAxisA<'a>(&'a self) -> &'a b2Vec2
pub fn GetLocalAxisA<'a>(&'a self) -> &'a b2Vec2
The local joint axis relative to bodyA.
Sourcepub fn GetReferenceAngle(&self) -> f32
pub fn GetReferenceAngle(&self) -> f32
Get the reference angle.
Sourcepub fn GetJointTranslation(&self) -> f32
pub fn GetJointTranslation(&self) -> f32
Get the current joint translation, usually in meters.
Sourcepub fn GetJointSpeed(&self) -> f32
pub fn GetJointSpeed(&self) -> f32
Get the current joint translation speed, usually in meters per second.
Sourcepub fn IsLimitEnabled(&self) -> bool
pub fn IsLimitEnabled(&self) -> bool
Is the joint limit enabled?
Sourcepub fn EnableLimit(self: Pin<&mut Self>, flag: bool)
pub fn EnableLimit(self: Pin<&mut Self>, flag: bool)
Enable/disable the joint limit.
Sourcepub fn GetLowerLimit(&self) -> f32
pub fn GetLowerLimit(&self) -> f32
Get the lower joint limit, usually in meters.
Sourcepub fn GetUpperLimit(&self) -> f32
pub fn GetUpperLimit(&self) -> f32
Get the upper joint limit, usually in meters.
Sourcepub fn SetLimits(self: Pin<&mut Self>, lower: f32, upper: f32)
pub fn SetLimits(self: Pin<&mut Self>, lower: f32, upper: f32)
Set the joint limits, usually in meters.
Sourcepub fn IsMotorEnabled(&self) -> bool
pub fn IsMotorEnabled(&self) -> bool
Is the joint motor enabled?
Sourcepub fn EnableMotor(self: Pin<&mut Self>, flag: bool)
pub fn EnableMotor(self: Pin<&mut Self>, flag: bool)
Enable/disable the joint motor.
Sourcepub fn SetMotorSpeed(self: Pin<&mut Self>, speed: f32)
pub fn SetMotorSpeed(self: Pin<&mut Self>, speed: f32)
Set the motor speed, usually in meters per second.
Sourcepub fn GetMotorSpeed(&self) -> f32
pub fn GetMotorSpeed(&self) -> f32
Get the motor speed, usually in meters per second.
Sourcepub fn SetMaxMotorForce(self: Pin<&mut Self>, force: f32)
pub fn SetMaxMotorForce(self: Pin<&mut Self>, force: f32)
Set the maximum motor force, usually in N.
pub fn GetMaxMotorForce(&self) -> f32
Sourcepub fn GetMotorForce(&self, inv_dt: f32) -> f32
pub fn GetMotorForce(&self, inv_dt: f32) -> f32
Get the current motor force given the inverse time step, usually in N.
Trait Implementations§
Source§impl AsRef<b2Joint> for b2PrismaticJoint
impl AsRef<b2Joint> for b2PrismaticJoint
Source§fn as_ref(self: &b2PrismaticJoint) -> &b2Joint
fn as_ref(self: &b2PrismaticJoint) -> &b2Joint
Source§impl CopyNew for b2PrismaticJoint
impl CopyNew for b2PrismaticJoint
Source§unsafe fn copy_new(
other: &b2PrismaticJoint,
this: Pin<&mut MaybeUninit<b2PrismaticJoint>>,
)
unsafe fn copy_new( other: &b2PrismaticJoint, this: Pin<&mut MaybeUninit<b2PrismaticJoint>>, )
Synthesized copy constructor.
Source§impl Drop for b2PrismaticJoint
impl Drop for b2PrismaticJoint
Source§fn drop(self: &mut b2PrismaticJoint)
fn drop(self: &mut b2PrismaticJoint)
Synthesized destructor.