79 collideConnected =
false;
100 float frequencyHertz,
float dampingRatio,
105 float frequencyHertz,
float dampingRatio,
124 virtual b2Vec2 GetAnchorA()
const = 0;
127 virtual b2Vec2 GetAnchorB()
const = 0;
130 virtual b2Vec2 GetReactionForce(
float inv_dt)
const = 0;
133 virtual float GetReactionTorque(
float inv_dt)
const = 0;
137 const b2Joint* GetNext()
const;
143 bool IsEnabled()
const;
148 bool GetCollideConnected()
const;
151 virtual void Dump() {
b2Dump(
"// Dump is not supported for this joint type.\n"); }
157 virtual void Draw(
b2Draw* draw)
const;
This is an internal class.
static void Destroy(b2Joint *joint, b2BlockAllocator *allocator)
Joint definitions are used to construct joints.
b2Body * GetBodyA()
Get the first body attached to this joint.
bool GetCollideConnected() const
b2JointType GetType() const
Get the type of the concrete joint.
b2JointEdge * prev
the previous joint edge in the body's joint list
b2Joint * GetNext()
Get the next joint the world joint list.
You can define this to inject whatever data you want in b2Joint.
void SolveVelocityConstraints(const b2SolverData &data) override
b2Body * other
provides quick access to the other body attached.
b2Body * GetBodyB()
Get the second body attached to this joint.
A rigid body. These are created via b2World::CreateBody.
bool SolvePositionConstraints(const b2SolverData &data) override
b2JointUserData & GetUserData()
Get the user data pointer.
bool collideConnected
Set this flag to true if the attached bodies should collide.
b2JointUserData userData
Use this to attach application specific data to your joints.
B2_API void b2LinearStiffness(float &stiffness, float &damping, float frequencyHertz, float dampingRatio, const b2Body *bodyA, const b2Body *bodyB)
Utility to compute linear stiffness values from frequency and damping ratio.
virtual void Dump()
Dump this joint to the log file.
b2JointType type
The joint type is set automatically for concrete joint types.
void b2Dump(const char *string,...)
virtual void ShiftOrigin(const b2Vec2 &newOrigin)
Shift the origin for any points stored in world coordinates.
b2JointUserData m_userData
void InitVelocityConstraints(const b2SolverData &data) override
b2Body * bodyA
The first attached body.
static b2Joint * Create(const b2JointDef *def, b2BlockAllocator *allocator)
B2_API void b2AngularStiffness(float &stiffness, float &damping, float frequencyHertz, float dampingRatio, const b2Body *bodyA, const b2Body *bodyB)
Utility to compute rotational stiffness values frequency and damping ratio.
b2Body * bodyB
The second attached body.
b2JointEdge * next
the next joint edge in the body's joint list