# b2PrismaticJointDef Struct Reference

`#include <b2PrismaticJoint.h>`

Inheritance diagram for b2PrismaticJointDef:

List of all members.

## Public Member Functions
| b2PrismaticJointDef ()
void | Initialize (b2Body *bodyA, b2Body *bodyB, const b2Vec2 &anchor, const b2Vec2 &axis)
## Public Attributes
b2Vec2 | localAnchorA
| The local anchor point relative to body1's origin.
b2Vec2 | localAnchorB
| The local anchor point relative to body2's origin.
b2Vec2 | localAxis1
| The local translation axis in body1.
float32 | referenceAngle
| The constrained angle between the bodies: body2_angle - body1_angle.
bool | enableLimit
| Enable/disable the joint limit.
float32 | lowerTranslation
| The lower translation limit, usually in meters.
float32 | upperTranslation
| The upper translation limit, usually in meters.
bool | enableMotor
| Enable/disable the joint motor.
float32 | maxMotorForce
| The maximum motor torque, usually in N-m.
float32 | motorSpeed
| The desired motor speed in radians per second.

## Detailed Description

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

Warning:
  at least one body should by dynamic with a non-fixed rotation.

## Constructor & Destructor Documentation

b2PrismaticJointDef::b2PrismaticJointDef | ( |  | ) | `[inline]`

## Member Function Documentation

void b2PrismaticJointDef::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

bool b2PrismaticJointDef::enableLimit

Enable/disable the joint limit.

bool b2PrismaticJointDef::enableMotor

Enable/disable the joint motor.

b2Vec2 b2PrismaticJointDef::localAnchorA

The local anchor point relative to body1's origin.

b2Vec2 b2PrismaticJointDef::localAnchorB

The local anchor point relative to body2's origin.

b2Vec2 b2PrismaticJointDef::localAxis1

The local translation axis in body1.

float32 b2PrismaticJointDef::lowerTranslation

The lower translation limit, usually in meters.

float32 b2PrismaticJointDef::maxMotorForce

The maximum motor torque, usually in N-m.

float32 b2PrismaticJointDef::motorSpeed

The desired motor speed in radians per second.

float32 b2PrismaticJointDef::referenceAngle

The constrained angle between the bodies: body2_angle - body1_angle.

float32 b2PrismaticJointDef::upperTranslation

The upper translation limit, usually in meters.

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

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