Box2D
2.2.1
Box2D API Reference for Kobold2D developers
|
#include <b2WheelJoint.h>
Public Member Functions | |
void | Initialize (b2Body *bodyA, b2Body *bodyB, const b2Vec2 &anchor, const b2Vec2 &axis) |
Public Attributes | |
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. | |
bool | enableMotor |
Enable/disable the joint motor. | |
float32 | maxMotorTorque |
The maximum motor torque, usually in N-m. | |
float32 | motorSpeed |
The desired motor speed in radians per second. | |
float32 | frequencyHz |
Suspension frequency, zero indicates no suspension. | |
float32 | dampingRatio |
Suspension damping ratio, one indicates critical damping. |
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.
void b2WheelJointDef::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.
float32 b2WheelJointDef::dampingRatio |
Suspension damping ratio, one indicates critical damping.
Enable/disable the joint motor.
float32 b2WheelJointDef::frequencyHz |
Suspension frequency, zero indicates no suspension.
The local anchor point relative to bodyA's origin.
The local anchor point relative to bodyB's origin.
The local translation axis in bodyA.
float32 b2WheelJointDef::maxMotorTorque |
The maximum motor torque, usually in N-m.
float32 b2WheelJointDef::motorSpeed |
The desired motor speed in radians per second.