Public Member Functions | Public Attributes | List of all members
b2DistanceJointDef Struct Reference

#include <b2_distance_joint.h>

Inheritance diagram for b2DistanceJointDef:
Inheritance graph
[legend]

Public Member Functions

 b2DistanceJointDef ()
 
void Initialize (b2Body *bodyA, b2Body *bodyB, const b2Vec2 &anchorA, const b2Vec2 &anchorB)
 
- Public Member Functions inherited from b2JointDef
 b2JointDef ()
 

Public Attributes

float damping
 The linear damping in N*s/m. More...
 
float length
 The rest length of this joint. Clamped to a stable minimum value. More...
 
b2Vec2 localAnchorA
 The local anchor point relative to bodyA's origin. More...
 
b2Vec2 localAnchorB
 The local anchor point relative to bodyB's origin. More...
 
float maxLength
 Maximum length. Must be greater than or equal to the minimum length. More...
 
float minLength
 Minimum length. Clamped to a stable minimum value. More...
 
float stiffness
 The linear stiffness in N/m. More...
 
- Public Attributes inherited from b2JointDef
b2BodybodyA
 The first attached body. More...
 
b2BodybodyB
 The second attached body. More...
 
bool collideConnected
 Set this flag to true if the attached bodies should collide. More...
 
b2JointType type
 The joint type is set automatically for concrete joint types. More...
 
b2JointUserData userData
 Use this to attach application specific data to your joints. More...
 

Detailed Description

Distance joint definition. This requires defining an anchor point on both bodies and the non-zero distance of the distance joint. The definition uses local anchor points so that the initial configuration can violate the constraint slightly. This helps when saving and loading a game.

Definition at line 33 of file b2_distance_joint.h.

Constructor & Destructor Documentation

◆ b2DistanceJointDef()

b2DistanceJointDef::b2DistanceJointDef ( )
inline

Definition at line 35 of file b2_distance_joint.h.

Member Function Documentation

◆ Initialize()

void b2DistanceJointDef::Initialize ( b2Body bodyA,
b2Body bodyB,
const b2Vec2 anchorA,
const b2Vec2 anchorB 
)

Initialize the bodies, anchors, and rest length using world space anchors. The minimum and maximum lengths are set to the rest length.

Definition at line 44 of file b2_distance_joint.cpp.

Member Data Documentation

◆ damping

float b2DistanceJointDef::damping

The linear damping in N*s/m.

Definition at line 71 of file b2_distance_joint.h.

◆ length

float b2DistanceJointDef::length

The rest length of this joint. Clamped to a stable minimum value.

Definition at line 59 of file b2_distance_joint.h.

◆ localAnchorA

b2Vec2 b2DistanceJointDef::localAnchorA

The local anchor point relative to bodyA's origin.

Definition at line 53 of file b2_distance_joint.h.

◆ localAnchorB

b2Vec2 b2DistanceJointDef::localAnchorB

The local anchor point relative to bodyB's origin.

Definition at line 56 of file b2_distance_joint.h.

◆ maxLength

float b2DistanceJointDef::maxLength

Maximum length. Must be greater than or equal to the minimum length.

Definition at line 65 of file b2_distance_joint.h.

◆ minLength

float b2DistanceJointDef::minLength

Minimum length. Clamped to a stable minimum value.

Definition at line 62 of file b2_distance_joint.h.

◆ stiffness

float b2DistanceJointDef::stiffness

The linear stiffness in N/m.

Definition at line 68 of file b2_distance_joint.h.


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


mvsim
Author(s):
autogenerated on Tue Jul 4 2023 03:08:22