# b2LineJoint Class Reference

`#include <b2LineJoint.h>`

Inheritance diagram for b2LineJoint:

List of all members.

## Public Member Functions
b2Vec2 | GetAnchorA () const
| Get the anchor point on bodyA in world coordinates.
b2Vec2 | GetAnchorB () const
| Get the anchor point on bodyB in world coordinates.
b2Vec2 | GetReactionForce (float32 inv_dt) const
| Get the reaction force on body2 at the joint anchor in Newtons.
float32 | GetReactionTorque (float32 inv_dt) const
| Get the reaction torque on body2 in N*m.
float32 | GetJointTranslation () const
| Get the current joint translation, usually in meters.
float32 | GetJointSpeed () const
| Get the current joint translation speed, usually in meters per second.
bool | IsLimitEnabled () const
| Is the joint limit enabled?
void | EnableLimit (bool flag)
| Enable/disable the joint limit.
float32 | GetLowerLimit () const
| Get the lower joint limit, usually in meters.
float32 | GetUpperLimit () const
| Get the upper joint limit, usually in meters.
void | SetLimits (float32 lower, float32 upper)
| Set the joint limits, usually in meters.
bool | IsMotorEnabled () const
| Is the joint motor enabled?
void | EnableMotor (bool flag)
| Enable/disable the joint motor.
void | SetMotorSpeed (float32 speed)
| Set the motor speed, usually in meters per second.
float32 | GetMotorSpeed () const
| Get the motor speed, usually in meters per second.
void | SetMaxMotorForce (float32 force)
| Set/Get the maximum motor force, usually in N.
float32 | GetMaxMotorForce () const
float32 | GetMotorForce () const
| Get the current motor force, usually in N.
## Protected Member Functions
| b2LineJoint (const b2LineJointDef *def)
void | InitVelocityConstraints (const b2TimeStep &step)
void | SolveVelocityConstraints (const b2TimeStep &step)
bool | SolvePositionConstraints (float32 baumgarte)
## Protected Attributes
b2Vec2 | m_localAnchor1
b2Vec2 | m_localAnchor2
b2Vec2 | m_localXAxis1
b2Vec2 | m_localYAxis1
b2Vec2 | m_axis
b2Vec2 | m_perp
float32 | m_s1
float32 | m_s2
float32 | m_a1
float32 | m_a2
b2Mat22 | m_K
b2Vec2 | m_impulse
float32 | m_motorMass
float32 | m_motorImpulse
float32 | m_lowerTranslation
float32 | m_upperTranslation
float32 | m_maxMotorForce
float32 | m_motorSpeed
bool | m_enableLimit
bool | m_enableMotor
b2LimitState | m_limitState
## Friends
class | b2Joint

## Detailed Description

A line joint. This joint provides two degrees of freedom: translation along an axis fixed in body1 and rotation in the plane. You can use a joint limit to restrict the range of motion and a joint motor to drive the motion or to model joint friction.

## Constructor & Destructor Documentation

b2LineJoint::b2LineJoint | ( | const b2LineJointDef * | def | ) | `[protected]`

## Member Function Documentation

void b2LineJoint::EnableLimit | ( | bool | flag | ) |

Enable/disable the joint limit.

void b2LineJoint::EnableMotor | ( | bool | flag | ) |

Enable/disable the joint motor.

b2Vec2 b2LineJoint::GetAnchorA | ( |  | ) | const`[virtual]`

Get the anchor point on bodyA in world coordinates.

Implements b2Joint.

b2Vec2 b2LineJoint::GetAnchorB | ( |  | ) | const`[virtual]`

Get the anchor point on bodyB in world coordinates.

Implements b2Joint.

float32 b2LineJoint::GetJointSpeed | ( |  | ) | const

Get the current joint translation speed, usually in meters per second.

float32 b2LineJoint::GetJointTranslation | ( |  | ) | const

Get the current joint translation, usually in meters.

float32 b2LineJoint::GetLowerLimit | ( |  | ) | const

Get the lower joint limit, usually in meters.

float32 b2LineJoint::GetMaxMotorForce | ( |  | ) | const

float32 b2LineJoint::GetMotorForce | ( |  | ) | const

Get the current motor force, usually in N.

float32 b2LineJoint::GetMotorSpeed | ( |  | ) | const`[inline]`

Get the motor speed, usually in meters per second.

b2Vec2 b2LineJoint::GetReactionForce | ( | float32 | inv_dt | ) | const`[virtual]`

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

Implements b2Joint.

float32 b2LineJoint::GetReactionTorque | ( | float32 | inv_dt | ) | const`[virtual]`

Get the reaction torque on body2 in N*m.

Implements b2Joint.

float32 b2LineJoint::GetUpperLimit | ( |  | ) | const

Get the upper joint limit, usually in meters.

void b2LineJoint::InitVelocityConstraints | ( | const b2TimeStep & | step | ) | `[protected, virtual]`

Implements b2Joint.

bool b2LineJoint::IsLimitEnabled | ( |  | ) | const

Is the joint limit enabled?

bool b2LineJoint::IsMotorEnabled | ( |  | ) | const

Is the joint motor enabled?

void b2LineJoint::SetLimits | ( | float32 | lower,
|  | float32 | upper |
| ) |  |  |

Set the joint limits, usually in meters.

void b2LineJoint::SetMaxMotorForce | ( | float32 | force | ) |

Set/Get the maximum motor force, usually in N.

void b2LineJoint::SetMotorSpeed | ( | float32 | speed | ) |

Set the motor speed, usually in meters per second.

bool b2LineJoint::SolvePositionConstraints | ( | float32 | baumgarte | ) | `[protected, virtual]`

Implements b2Joint.

void b2LineJoint::SolveVelocityConstraints | ( | const b2TimeStep & | step | ) | `[protected, virtual]`

Implements b2Joint.

## Friends And Related Function Documentation

friend class b2Joint`[friend]`

## Member Data Documentation

float32 b2LineJoint::m_a1`[protected]`

float32 b2LineJoint::m_a2`[protected]`

b2Vec2 b2LineJoint::m_axis`[protected]`

bool b2LineJoint::m_enableLimit`[protected]`

bool b2LineJoint::m_enableMotor`[protected]`

b2Vec2 b2LineJoint::m_impulse`[protected]`

b2Mat22 b2LineJoint::m_K`[protected]`

b2LimitState b2LineJoint::m_limitState`[protected]`

b2Vec2 b2LineJoint::m_localAnchor1`[protected]`

b2Vec2 b2LineJoint::m_localAnchor2`[protected]`

b2Vec2 b2LineJoint::m_localXAxis1`[protected]`

b2Vec2 b2LineJoint::m_localYAxis1`[protected]`

float32 b2LineJoint::m_lowerTranslation`[protected]`

float32 b2LineJoint::m_maxMotorForce`[protected]`

float32 b2LineJoint::m_motorImpulse`[protected]`

float32 b2LineJoint::m_motorMass`[protected]`

float32 b2LineJoint::m_motorSpeed`[protected]`

b2Vec2 b2LineJoint::m_perp`[protected]`

float32 b2LineJoint::m_s1`[protected]`

float32 b2LineJoint::m_s2`[protected]`

float32 b2LineJoint::m_upperTranslation`[protected]`

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

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