Torque2D Reference

- Main Page
- Related Pages
- Modules
- Namespaces
- Classes

- Class List
- Class Index
- Class Hierarchy
- Class Members

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

`#include <b2WheelJoint.h>`

Inheritance diagram for b2WheelJointDef:

## Public Member Functions
| b2WheelJointDef ()
void | Initialize (b2Body *bodyA, b2Body *bodyB, const b2Vec2 &anchor, const b2Vec2 &axis)
Public Member Functions inherited from b2JointDef
| b2JointDef ()

## Public Attributes
b2Vec2 | localAnchorA
| The local anchor point relative to bodyA's origin. More...
b2Vec2 | localAnchorB
| The local anchor point relative to bodyB's origin. More...
b2Vec2 | localAxisA
| The local translation axis in bodyA. More...
bool | enableMotor
| Enable/disable the joint motor. More...
float32 | maxMotorTorque
| The maximum motor torque, usually in N-m. More...
float32 | motorSpeed
| The desired motor speed in radians per second. More...
float32 | frequencyHz
| Suspension frequency, zero indicates no suspension. More...
float32 | dampingRatio
| Suspension damping ratio, one indicates critical damping. More...
Public Attributes inherited from b2JointDef
b2JointType | type
| The joint type is set automatically for concrete joint types. More...
void * | userData
| Use this to attach application specific data to your joints. More...
b2Body * | bodyA
| The first attached body. More...
b2Body * | bodyB
| The second attached body. More...
bool | collideConnected
| Set this flag to true if the attached bodies should collide. More...

## Detailed Description

Wheel joint definition. This requires defining a line of motion using an axis and an anchor point. The definition uses local anchor points and a local axis so that the initial configuration can violate the constraint slightly. The joint translation is zero when the local anchor points coincide in world space. Using local anchors and a local axis helps when saving and loading a game.

## Constructor & Destructor Documentation

b2WheelJointDef | ( |  | ) |
| inline

## Member Function Documentation

void Initialize | ( | b2Body * | bodyA,
|  | b2Body * | bodyB,
|  | const b2Vec2 & | anchor,
|  | const b2Vec2 & | axis
| ) |  |

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

## Member Data Documentation

float32 dampingRatio

Suspension damping ratio, one indicates critical damping.

bool enableMotor

Enable/disable the joint motor.

float32 frequencyHz

Suspension frequency, zero indicates no suspension.

b2Vec2 localAnchorA

The local anchor point relative to bodyA's origin.

b2Vec2 localAnchorB

The local anchor point relative to bodyB's origin.

b2Vec2 localAxisA

The local translation axis in bodyA.

float32 maxMotorTorque

The maximum motor torque, usually in N-m.

float32 motorSpeed

The desired motor speed in radians per second.

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

- Box2D/Dynamics/Joints/b2WheelJoint.h
- Box2D/Dynamics/Joints/b2WheelJoint.cpp