b2GearJoint Class Reference

#include <b2GearJoint.h>

Inheritance diagram for b2GearJoint:
b2Joint

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.
void SetRatio (float32 ratio)
 Set/Get the gear ratio.
float32 GetRatio () const

Protected Member Functions

 b2GearJoint (const b2GearJointDef *data)
void InitVelocityConstraints (const b2TimeStep &step)
void SolveVelocityConstraints (const b2TimeStep &step)
bool SolvePositionConstraints (float32 baumgarte)

Protected Attributes

b2Bodym_ground1
b2Bodym_ground2
b2RevoluteJointm_revolute1
b2PrismaticJointm_prismatic1
b2RevoluteJointm_revolute2
b2PrismaticJointm_prismatic2
b2Vec2 m_groundAnchor1
b2Vec2 m_groundAnchor2
b2Vec2 m_localAnchor1
b2Vec2 m_localAnchor2
b2Jacobian m_J
float32 m_constant
float32 m_ratio
float32 m_mass
float32 m_impulse

Friends

class b2Joint

Detailed Description

A gear joint is used to connect two joints together. Either joint can be a revolute or prismatic joint. You specify a gear ratio to bind the motions together: coordinate1 + ratio * coordinate2 = constant The ratio can be negative or positive. If one joint is a revolute joint and the other joint is a prismatic joint, then the ratio will have units of length or units of 1/length.

Warning:
The revolute and prismatic joints must be attached to fixed bodies (which must be body1 on those joints).

Constructor & Destructor Documentation

b2GearJoint::b2GearJoint ( const b2GearJointDef data  )  [protected]

Member Function Documentation

b2Vec2 b2GearJoint::GetAnchorA (  )  const [virtual]

Get the anchor point on bodyA in world coordinates.

Implements b2Joint.

b2Vec2 b2GearJoint::GetAnchorB (  )  const [virtual]

Get the anchor point on bodyB in world coordinates.

Implements b2Joint.

float32 b2GearJoint::GetRatio (  )  const
b2Vec2 b2GearJoint::GetReactionForce ( float32  inv_dt  )  const [virtual]

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

Implements b2Joint.

float32 b2GearJoint::GetReactionTorque ( float32  inv_dt  )  const [virtual]

Get the reaction torque on body2 in N*m.

Implements b2Joint.

void b2GearJoint::InitVelocityConstraints ( const b2TimeStep step  )  [protected, virtual]

Implements b2Joint.

void b2GearJoint::SetRatio ( float32  ratio  ) 

Set/Get the gear ratio.

bool b2GearJoint::SolvePositionConstraints ( float32  baumgarte  )  [protected, virtual]

Implements b2Joint.

void b2GearJoint::SolveVelocityConstraints ( const b2TimeStep step  )  [protected, virtual]

Implements b2Joint.


Friends And Related Function Documentation

friend class b2Joint [friend]

Member Data Documentation


The documentation for this class was generated from the following files:
Generated on Sat Apr 3 18:18:09 2010 for Box2D by  doxygen 1.6.3