Go to the documentation of this file.
41 float frequencyHertz,
float dampingRatio,
47 if (massA > 0.0
f && massB > 0.0
f)
49 mass = massA * massB / (massA + massB);
51 else if (massA > 0.0
f)
60 float omega = 2.0f *
b2_pi * frequencyHertz;
61 stiffness = mass * omega * omega;
62 damping = 2.0f * mass * dampingRatio * omega;
66 float frequencyHertz,
float dampingRatio,
72 if (IA > 0.0
f && IB > 0.0
f)
74 I = IA * IB / (IA + IB);
85 float omega = 2.0f *
b2_pi * frequencyHertz;
86 stiffness = I * omega * omega;
87 damping = 2.0f * I * dampingRatio * omega;
void Free(void *p, int32 size)
Free memory. This will use b2Free if the size is larger than b2_maxBlockSize.
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.
Friction joint definition.
void * Allocate(int32 size)
Allocate memory. This will use b2Alloc if the size is larger than b2_maxBlockSize.
b2Body * other
provides quick access to the other body attached.
static void Destroy(b2Joint *joint, b2BlockAllocator *allocator)
virtual void DrawSegment(const b2Vec2 &p1, const b2Vec2 &p2, const b2Color &color)=0
Draw a line segment.
A rigid body. These are created via b2World::CreateBody.
virtual void Draw(b2Draw *draw) const
Debug draw this joint.
bool IsEnabled() const
Get the active state of the body.
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.
virtual void DrawPoint(const b2Vec2 &p, float size, const b2Color &color)=0
Draw a point.
virtual b2Vec2 GetAnchorA() const =0
Get the anchor point on bodyA in world coordinates.
Joint definitions are used to construct joints.
b2Joint(const b2JointDef *def)
bool collideConnected
Set this flag to true if the attached bodies should collide.
Color for debug drawing. Each value has the range [0,1].
b2Vec2 GetGroundAnchorB() const
Get the second ground anchor.
b2JointUserData userData
Use this to attach application specific data to your joints.
b2JointEdge * prev
the previous joint edge in the body's joint list
b2JointEdge * next
the next joint edge in the body's joint list
b2JointUserData m_userData
b2JointType type
The joint type is set automatically for concrete joint types.
b2Vec2 GetGroundAnchorA() const
Get the first ground anchor.
virtual b2Vec2 GetAnchorB() const =0
Get the anchor point on bodyB in world coordinates.
const b2Transform & GetTransform() const
static b2Joint * Create(const b2JointDef *def, b2BlockAllocator *allocator)
bool IsEnabled() const
Short-cut function to determine if either body is enabled.
b2Body * bodyA
The first attached body.
void Set(float rIn, float gIn, float bIn, float aIn=1.0f)
b2Body * bodyB
The second attached body.
mvsim
Author(s):
autogenerated on Wed May 28 2025 02:13:07