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

Motor joint definition. More...

#include <MotorJoint.hpp>

Inheritance diagram for box2d::MotorJointDef:
box2d::JointDef

Public Member Functions

constexpr MotorJointDef () noexcept
 
void Initialize (Body *bodyA, Body *bodyB)
 Initialize the bodies and offsets using the current transforms. More...
 
- Public Member Functions inherited from box2d::JointDef
 JointDef ()=delete
 Deleted default constructor for abstract base class. More...
 
constexpr JointDef (JointType t) noexcept
 
constexpr JointDef (JointType t, Body *bA, Body *bB, bool cc=false, void *u=nullptr) noexcept
 

Public Attributes

Length2D linearOffset = Vec2_zero * Meter
 Position of bodyB minus the position of bodyA, in bodyA's frame, in meters. More...
 
Angle angularOffset = Angle{0}
 The bodyB angle minus bodyA angle in radians. More...
 
Force maxForce = RealNum{1} * Newton
 The maximum motor force in N. More...
 
Torque maxTorque = RealNum{1} * NewtonMeter
 The maximum motor torque in N-m. More...
 
RealNum correctionFactor = RealNum(0.3)
 Position correction factor in the range [0,1]. More...
 
- Public Attributes inherited from box2d::JointDef
const JointType type
 The joint type is set automatically for concrete joint types. More...
 
BodybodyA = nullptr
 The first attached body. More...
 
BodybodyB = nullptr
 The second attached body. More...
 
bool collideConnected = false
 Set this flag to true if the attached bodies should collide. More...
 
void * userData = nullptr
 Use this to attach application specific data to your joints. More...
 

Detailed Description

Motor joint definition.

Constructor & Destructor Documentation

◆ MotorJointDef()

constexpr box2d::MotorJointDef::MotorJointDef ( )
inlinenoexcept

Member Function Documentation

◆ Initialize()

void MotorJointDef::Initialize ( Body bodyA,
Body bodyB 
)

Initialize the bodies and offsets using the current transforms.

Member Data Documentation

◆ angularOffset

Angle box2d::MotorJointDef::angularOffset = Angle{0}

The bodyB angle minus bodyA angle in radians.

◆ correctionFactor

RealNum box2d::MotorJointDef::correctionFactor = RealNum(0.3)

Position correction factor in the range [0,1].

◆ linearOffset

Length2D box2d::MotorJointDef::linearOffset = Vec2_zero * Meter

Position of bodyB minus the position of bodyA, in bodyA's frame, in meters.

◆ maxForce

Force box2d::MotorJointDef::maxForce = RealNum{1} * Newton

The maximum motor force in N.

◆ maxTorque

Torque box2d::MotorJointDef::maxTorque = RealNum{1} * NewtonMeter

The maximum motor torque in N-m.


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