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

A motor joint is used to control the relative motion between two bodies. A typical usage is to control the movement of a dynamic body with respect to the ground. More...

#include <MotorJoint.hpp>

Inheritance diagram for box2d::MotorJoint:
box2d::Joint

Public Member Functions

 MotorJoint (const MotorJointDef &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...
 
Force2D GetReactionForce (Frequency inv_dt) const override
 Get the reaction force on bodyB at the joint anchor in Newtons. More...
 
Torque GetReactionTorque (Frequency inv_dt) const override
 Get the reaction torque on bodyB in N*m. More...
 
void SetLinearOffset (const Length2D linearOffset)
 Set/get the target linear offset, in frame A, in meters. More...
 
const Length2D GetLinearOffset () const
 
void SetAngularOffset (Angle angularOffset)
 Set/get the target angular offset, in radians. More...
 
Angle GetAngularOffset () const
 
void SetMaxForce (Force force)
 Set the maximum friction force in N. More...
 
Force GetMaxForce () const
 Get the maximum friction force in N. More...
 
void SetMaxTorque (Torque torque)
 Set the maximum friction torque in N*m. More...
 
Torque GetMaxTorque () const
 Get the maximum friction torque in N*m. More...
 
void SetCorrectionFactor (RealNum factor)
 Set the position correction factor in the range [0,1]. More...
 
RealNum GetCorrectionFactor () const
 Get the position correction factor in the range [0,1]. 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

A motor joint is used to control the relative motion between two bodies. A typical usage is to control the movement of a dynamic body with respect to the ground.

Constructor & Destructor Documentation

◆ MotorJoint()

MotorJoint::MotorJoint ( const MotorJointDef def)

Member Function Documentation

◆ GetAnchorA()

Length2D MotorJoint::GetAnchorA ( ) const
overridevirtual

Get the anchor point on bodyA in world coordinates.

Implements box2d::Joint.

◆ GetAnchorB()

Length2D MotorJoint::GetAnchorB ( ) const
overridevirtual

Get the anchor point on bodyB in world coordinates.

Implements box2d::Joint.

◆ GetAngularOffset()

Angle MotorJoint::GetAngularOffset ( ) const

◆ GetCorrectionFactor()

RealNum MotorJoint::GetCorrectionFactor ( ) const

Get the position correction factor in the range [0,1].

◆ GetLinearOffset()

const Length2D MotorJoint::GetLinearOffset ( ) const

◆ GetMaxForce()

Force MotorJoint::GetMaxForce ( ) const

Get the maximum friction force in N.

◆ GetMaxTorque()

Torque MotorJoint::GetMaxTorque ( ) const

Get the maximum friction torque in N*m.

◆ GetReactionForce()

Force2D MotorJoint::GetReactionForce ( Frequency  inv_dt) const
overridevirtual

Get the reaction force on bodyB at the joint anchor in Newtons.

Implements box2d::Joint.

◆ GetReactionTorque()

Torque MotorJoint::GetReactionTorque ( Frequency  inv_dt) const
overridevirtual

Get the reaction torque on bodyB in N*m.

Implements box2d::Joint.

◆ SetAngularOffset()

void MotorJoint::SetAngularOffset ( Angle  angularOffset)

Set/get the target angular offset, in radians.

◆ SetCorrectionFactor()

void MotorJoint::SetCorrectionFactor ( RealNum  factor)

Set the position correction factor in the range [0,1].

◆ SetLinearOffset()

void MotorJoint::SetLinearOffset ( const Length2D  linearOffset)

Set/get the target linear offset, in frame A, in meters.

◆ SetMaxForce()

void MotorJoint::SetMaxForce ( Force  force)

Set the maximum friction force in N.

◆ SetMaxTorque()

void MotorJoint::SetMaxTorque ( Torque  torque)

Set the maximum friction torque in N*m.


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