Box2D  3.0.0
A Real-Time-Oriented 2-D Physics Engine
Public Member Functions | List of all members
box2d::RevoluteJoint Class Reference

Revolute Joint. More...

#include <RevoluteJoint.hpp>

Inheritance diagram for box2d::RevoluteJoint:
box2d::Joint

Public Member Functions

 RevoluteJoint (const RevoluteJointDef &def)
 
Length2D GetAnchorA () const override
 Get the anchor point on bodyA in world coordinates. More...
 
Length2D GetAnchorB () const override
 Get the anchor point on bodyB in world coordinates. More...
 
Length2D GetLocalAnchorA () const noexcept
 The local anchor point relative to bodyA's origin. More...
 
Length2D GetLocalAnchorB () const noexcept
 The local anchor point relative to bodyB's origin. More...
 
Angle GetReferenceAngle () const noexcept
 Get the reference angle. More...
 
bool IsLimitEnabled () const noexcept
 Is the joint limit enabled? More...
 
void EnableLimit (bool flag)
 Enable/disable the joint limit. More...
 
Angle GetLowerLimit () const noexcept
 Get the lower joint limit in radians. More...
 
Angle GetUpperLimit () const noexcept
 Get the upper joint limit in radians. More...
 
void SetLimits (Angle lower, Angle upper)
 Set the joint limits in radians. More...
 
bool IsMotorEnabled () const noexcept
 Is the joint motor enabled? More...
 
void EnableMotor (bool flag)
 Enable/disable the joint motor. More...
 
void SetMotorSpeed (AngularVelocity speed)
 Set the motor speed in radians per second. More...
 
AngularVelocity GetMotorSpeed () const noexcept
 Get the motor speed in radians per second. More...
 
void SetMaxMotorTorque (Torque torque)
 Set the maximum motor torque, usually in N-m. More...
 
Torque GetMaxMotorTorque () const noexcept
 
Force2D GetReactionForce (Frequency inv_dt) const override
 Get the reaction force given the inverse time step. Unit is N. More...
 
Torque GetReactionTorque (Frequency inv_dt) const override
 Get the reaction torque due to the joint limit given the inverse time step. Unit is N*m. More...
 
Torque GetMotorTorque (Frequency inv_dt) const
 Get the current motor torque given the inverse time step. Unit is N*m. More...
 
- Public Member Functions inherited from box2d::Joint
JointType GetType () const noexcept
 Get the type of the concrete joint. More...
 
BodyGetBodyA () noexcept
 Get the first body attached to this joint. More...
 
BodyGetBodyB () noexcept
 Get the second body attached to this joint. More...
 
const BodyGetBodyA () const noexcept
 Get the first body attached to this joint. More...
 
const BodyGetBodyB () const noexcept
 Get the second body attached to this joint. More...
 
void * GetUserData () const noexcept
 Get the user data pointer. More...
 
void SetUserData (void *data) noexcept
 Set the user data pointer. More...
 
bool GetCollideConnected () const noexcept
 Get collide connected. Note: modifying the collide connect flag won't work correctly because the flag is only checked when fixture AABBs begin to overlap. More...
 
virtual void ShiftOrigin (const Length2D newOrigin)
 Shift the origin for any points stored in world coordinates. More...
 

Additional Inherited Members

- Public Types inherited from box2d::Joint
enum  LimitState { e_inactiveLimit, e_atLowerLimit, e_atUpperLimit, e_equalLimits }
 
using index_t = size_t
 
- Static Public Member Functions inherited from box2d::Joint
static bool IsOkay (const JointDef &def) noexcept
 
- Protected Member Functions inherited from box2d::Joint
 Joint (const JointDef &def)
 
virtual ~Joint () noexcept
 
void SetBodyA (Body *value) noexcept
 
void SetBodyB (Body *value) noexcept
 

Detailed Description

Revolute Joint.

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.

Note
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.

Constructor & Destructor Documentation

◆ RevoluteJoint()

RevoluteJoint::RevoluteJoint ( const RevoluteJointDef def)

Member Function Documentation

◆ EnableLimit()

void RevoluteJoint::EnableLimit ( bool  flag)

Enable/disable the joint limit.

◆ EnableMotor()

void RevoluteJoint::EnableMotor ( bool  flag)

Enable/disable the joint motor.

◆ GetAnchorA()

Length2D RevoluteJoint::GetAnchorA ( ) const
overridevirtual

Get the anchor point on bodyA in world coordinates.

Implements box2d::Joint.

◆ GetAnchorB()

Length2D RevoluteJoint::GetAnchorB ( ) const
overridevirtual

Get the anchor point on bodyB in world coordinates.

Implements box2d::Joint.

◆ GetLocalAnchorA()

Length2D box2d::RevoluteJoint::GetLocalAnchorA ( ) const
inlinenoexcept

The local anchor point relative to bodyA's origin.

◆ GetLocalAnchorB()

Length2D box2d::RevoluteJoint::GetLocalAnchorB ( ) const
inlinenoexcept

The local anchor point relative to bodyB's origin.

◆ GetLowerLimit()

Angle box2d::RevoluteJoint::GetLowerLimit ( ) const
inlinenoexcept

Get the lower joint limit in radians.

◆ GetMaxMotorTorque()

Torque box2d::RevoluteJoint::GetMaxMotorTorque ( ) const
inlinenoexcept

◆ GetMotorSpeed()

AngularVelocity box2d::RevoluteJoint::GetMotorSpeed ( ) const
inlinenoexcept

Get the motor speed in radians per second.

◆ GetMotorTorque()

Torque RevoluteJoint::GetMotorTorque ( Frequency  inv_dt) const

Get the current motor torque given the inverse time step. Unit is N*m.

◆ GetReactionForce()

Force2D RevoluteJoint::GetReactionForce ( Frequency  inv_dt) const
overridevirtual

Get the reaction force given the inverse time step. Unit is N.

Implements box2d::Joint.

◆ GetReactionTorque()

Torque RevoluteJoint::GetReactionTorque ( Frequency  inv_dt) const
overridevirtual

Get the reaction torque due to the joint limit given the inverse time step. Unit is N*m.

Implements box2d::Joint.

◆ GetReferenceAngle()

Angle box2d::RevoluteJoint::GetReferenceAngle ( ) const
inlinenoexcept

Get the reference angle.

◆ GetUpperLimit()

Angle box2d::RevoluteJoint::GetUpperLimit ( ) const
inlinenoexcept

Get the upper joint limit in radians.

◆ IsLimitEnabled()

bool box2d::RevoluteJoint::IsLimitEnabled ( ) const
inlinenoexcept

Is the joint limit enabled?

◆ IsMotorEnabled()

bool box2d::RevoluteJoint::IsMotorEnabled ( ) const
inlinenoexcept

Is the joint motor enabled?

◆ SetLimits()

void RevoluteJoint::SetLimits ( Angle  lower,
Angle  upper 
)

Set the joint limits in radians.

◆ SetMaxMotorTorque()

void RevoluteJoint::SetMaxMotorTorque ( Torque  torque)

Set the maximum motor torque, usually in N-m.

◆ SetMotorSpeed()

void RevoluteJoint::SetMotorSpeed ( AngularVelocity  speed)

Set the motor speed in radians per second.


The documentation for this class was generated from the following files: