Public Member Functions | Public Attributes | List of all members
b2RevoluteJointDef Struct Reference

#include <b2RevoluteJoint.h>

Inheritance diagram for b2RevoluteJointDef:
Inheritance graph
[legend]

Public Member Functions

 b2RevoluteJointDef ()
 
void Initialize (b2Body *bodyA, b2Body *bodyB, const b2Vec2 &anchor)
 
- Public Member Functions inherited from b2JointDef
 b2JointDef ()
 

Public Attributes

bool enableLimit
 A flag to enable joint limits. More...
 
bool enableMotor
 A flag to enable the joint motor. More...
 
b2Vec2 localAnchorA
 The local anchor point relative to bodyA's origin. More...
 
b2Vec2 localAnchorB
 The local anchor point relative to bodyB's origin. More...
 
float32 lowerAngle
 The lower angle for the joint limit (radians). More...
 
float32 maxMotorTorque
 
float32 motorSpeed
 The desired motor speed. Usually in radians per second. More...
 
float32 referenceAngle
 The bodyB angle minus bodyA angle in the reference state (radians). More...
 
float32 upperAngle
 The upper angle for the joint limit (radians). More...
 
- Public Attributes inherited from b2JointDef
b2BodybodyA
 The first attached body. More...
 
b2BodybodyB
 The second attached body. More...
 
bool collideConnected
 Set this flag to true if the attached bodies should collide. More...
 
b2JointType type
 The joint type is set automatically for concrete joint types. More...
 
voiduserData
 Use this to attach application specific data to your joints. More...
 

Detailed Description

Revolute joint definition. This requires defining an anchor point where the bodies are joined. The definition uses local anchor points so that the initial configuration can violate the constraint slightly. You also need to specify the initial relative angle for joint limits. This helps when saving and loading a game. The local anchor points are measured from the body's origin rather than the center of mass because:

  1. you might not know where the center of mass will be.
  2. if you add/remove shapes from a body and recompute the mass, the joints will be broken.

Definition at line 35 of file b2RevoluteJoint.h.

Constructor & Destructor Documentation

b2RevoluteJointDef::b2RevoluteJointDef ( )
inline

Definition at line 37 of file b2RevoluteJoint.h.

Member Function Documentation

void b2RevoluteJointDef::Initialize ( b2Body bodyA,
b2Body bodyB,
const b2Vec2 anchor 
)

Initialize the bodies, anchors, and reference angle using a world anchor point.

Definition at line 36 of file b2RevoluteJoint.cpp.

Member Data Documentation

bool b2RevoluteJointDef::enableLimit

A flag to enable joint limits.

Definition at line 65 of file b2RevoluteJoint.h.

bool b2RevoluteJointDef::enableMotor

A flag to enable the joint motor.

Definition at line 74 of file b2RevoluteJoint.h.

b2Vec2 b2RevoluteJointDef::localAnchorA

The local anchor point relative to bodyA's origin.

Definition at line 56 of file b2RevoluteJoint.h.

b2Vec2 b2RevoluteJointDef::localAnchorB

The local anchor point relative to bodyB's origin.

Definition at line 59 of file b2RevoluteJoint.h.

float32 b2RevoluteJointDef::lowerAngle

The lower angle for the joint limit (radians).

Definition at line 68 of file b2RevoluteJoint.h.

float32 b2RevoluteJointDef::maxMotorTorque

The maximum motor torque used to achieve the desired motor speed. Usually in N-m.

Definition at line 81 of file b2RevoluteJoint.h.

float32 b2RevoluteJointDef::motorSpeed

The desired motor speed. Usually in radians per second.

Definition at line 77 of file b2RevoluteJoint.h.

float32 b2RevoluteJointDef::referenceAngle

The bodyB angle minus bodyA angle in the reference state (radians).

Definition at line 62 of file b2RevoluteJoint.h.

float32 b2RevoluteJointDef::upperAngle

The upper angle for the joint limit (radians).

Definition at line 71 of file b2RevoluteJoint.h.


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


mvsim
Author(s):
autogenerated on Fri May 7 2021 03:05:52