b2DistanceJoint Class
A distance joint constrains two points on two bodies to remain at a fixed distance from each other. You can view this as a massless, rigid rod.
Constructor
b2DistanceJoint
    
        
            (
    
    
    
    
    
    
    
    
    
    - 
                    
                        
distanceJointDef 
Parameters:
- 
                    
                        
distanceJointDefB2DistanceJointDef 
Item Index
Methods
- getAnchorA
 - getAnchorB
 - getDampingRatio
 - getFrequency
 - getLength
 - getLocalAnchorA
 - getLocalAnchorB
 - getReactionForce
 - getReactionTorque
 - initVelocityConstraints
 - setDampingRatio
 - setFrequency
 - setLength
 - solvePositionConstraints
 - solveVelocityConstraints
 - create static
 - destroy static
 - getAnchorA
 - getAnchorB
 - getBodyA
 - getBodyB
 - getCollideConnected
 - getNext
 - getReactionForce
 - getReactionTorque
 - getType
 - getUserData
 - initVelocityConstraints
 - isActive
 - setUserData
 - shiftOrigin
 - solveVelocityConstraints
 - solveVelocityConstraints
 
Properties
- m_bias
 - m_dampingRatio
 - m_frequencyHz
 - m_gamma
 - m_impulse
 - m_indexA
 - m_indexB
 - m_invIA
 - m_invIB
 - m_invMassA
 - m_invMassB
 - m_lalcA
 - m_lalcB
 - m_length
 - m_localAnchorA
 - m_localAnchorB
 - m_localCenterA
 - m_localCenterB
 - m_mass
 - m_qA
 - m_qB
 - m_rA
 - m_rB
 - m_u
 - m_bodyA
 - m_bodyB
 - m_collideConnected
 - m_edgeA
 - m_edgeB
 - m_index
 - m_islandFlag
 - m_next
 - m_prev
 - m_type
 - m_userData
 - ParentClass
 
Methods
getAnchorA
    
        
            (
    
    
        
            B2Vec2 | Object
        
    
    
    
        public
    
    
    
    
    
    
    - 
                    
                        
[out=b2Vec2] 
Parameters:
- 
                    
                        
[out=b2Vec2]B2Vec2 | Object= optionalreusable object
 
Returns:
                
                    
                        B2Vec2 | Object:
                    
                    
        out
getAnchorB
    
        
            (
    
    
        
            B2Vec2 | Object
        
    
    
    
        public
    
    
    
    
    
    
    - 
                    
                        
[out=b2Vec2] 
Parameters:
- 
                    
                        
[out=b2Vec2]B2Vec2 | Object= optionalreusable object
 
Returns:
                
                    
                        B2Vec2 | Object:
                    
                    
        out
getDampingRatio
    
        ()
    
    
        
            Float
        
    
    
    
        public
    
    
    
    
    
    
    Get damping ratio.
Returns:
                
                    
                        Float:
                    
                
            
        getFrequency
    
        ()
    
    
        
            Float
        
    
    
    
        public
    
    
    
    
    
    
    Get frequency in Hz.
Returns:
                
                    
                        Float:
                    
                
            
        getLength
    
        ()
    
    
        
            Float
        
    
    
    
        public
    
    
    
    
    
    
    Returns:
                
                    
                        Float:
                    
                
            
        getLocalAnchorA
    
        
            (
    
    
        
            B2Vec2 | Object
        
    
    
    
        public
    
    
    
    
    
    
    - 
                    
                        
[out=b2Vec2] 
The local anchor point relative to bodyA's origin.
Parameters:
- 
                    
                        
[out=b2Vec2]B2Vec2 | Object= optionalreusable object
 
Returns:
                
                    
                        B2Vec2 | Object:
                    
                    
        out
getLocalAnchorB
    
        
            (
    
    
        
            B2Vec2 | Object
        
    
    
    
        public
    
    
    
    
    
    
    - 
                    
                        
[out=b2Vec2] 
The local anchor point relative to bodyA's origin.
Parameters:
- 
                    
                        
[out=b2Vec2]B2Vec2 | Object= optionalreusable object
 
Returns:
                
                    
                        B2Vec2 | Object:
                    
                    
        out
getReactionForce
    
        
            (
    
    
        
            B2Vec2 | Object
        
    
    
    
        public
    
    
    
    
    
    
    - 
                    
                        
invDeltaTime - 
                    
                        
[out=b2Vec2] 
Get the reaction force given the inverse time step. Unit is N.
Parameters:
- 
                    
                        
invDeltaTimeFloat - 
                    
                        
[out=b2Vec2]B2Vec2 | Object= optionalreusable object
 
Returns:
                
                    
                        B2Vec2 | Object:
                    
                    
        out
getReactionTorque
    
        
            (
    
    
        
            Float
        
    
    
    
        public
    
    
    
    
    
    
    - 
                    
                        
invDeltaTime 
Get the reaction torque given the inverse time step. Unit is N*m. This is always zero for a distance joint.
Parameters:
- 
                    
                        
invDeltaTimeFloat 
Returns:
                
                    
                        Float:
                    
                
            
        initVelocityConstraints
    
        
            (
    
    
        
            Void
        
    
    
    
        public
    
    
    
    
    
    
    - 
                    
                        
data 
Parameters:
- 
                    
                        
dataB2SolverData 
Returns:
                
                    
                        Void:
                    
                
            
        setDampingRatio
    
        ()
    
    
        
            Float
        
    
    
    
        public
    
    
    
    
    
    
    Set damping ratio.
Returns:
                
                    
                        Float:
                    
                
            
        setFrequency
    
        
            (
    
    
        
            Void
        
    
    
    
        public
    
    
    
    
    
    
    - 
                    
                        
hz 
Set frequency in Hz.
Parameters:
- 
                    
                        
hzFloat 
Returns:
                
                    
                        Void:
                    
                
            
        setLength
    
        ()
    
    
        
            Void
        
    
    
    
        public
    
    
    
    
    
    
    Returns:
                
                    
                        Void:
                    
                
            
        solvePositionConstraints
    
        
            (
    
    
        
            Void
        
    
    
    
        public
    
    
    
    
    
    
    - 
                    
                        
data 
Parameters:
- 
                    
                        
dataB2SolverData 
Returns:
                
                    
                        Void:
                    
                
            
        solveVelocityConstraints
    
        
            (
    
    
        
            Void
        
    
    
    
        public
    
    
    
    
    
    
    - 
                    
                        
data 
Parameters:
- 
                    
                        
dataB2SolverData 
Returns:
                
                    
                        Void:
                    
                
            
        Properties
m_bias
    Float
    
    
        public
    
    
    
    
    Default: 0.0
m_dampingRatio
    Float
    
    
        public
    
    
    
    
    m_frequencyHz
    Float
    
    
        public
    
    
    
    
    m_indexA
    Float
    
    
        public
    
    
    
    
    Default: 0.0
m_indexB
    Float
    
    
        public
    
    
    
    
    Default: 0.0
m_invIA
    Float
    
    
        public
    
    
    
    
    Default: 0.0
m_invIB
    Float
    
    
        public
    
    
    
    
    Default: 0.0
m_invMassA
    Float
    
    
        public
    
    
    
    
    Default: 0.0
m_invMassB
    Float
    
    
        public
    
    
    
    
    Default: 0.0
m_lalcA
    B2Vec2
    
    
        public
    
    
    
    
    m_lalcB
    B2Vec2
    
    
        public
    
    
    
    
    m_length
    Float
    
    
        public
    
    
    
    
    m_localAnchorA
    B2Vec2
    
    
        public
    
    
    
    
    m_localAnchorB
    B2Vec2
    
    
        public
    
    
    
    
    m_localCenterA
    B2Vec2
    
    
        public
    
    
    
    
    m_localCenterB
    B2Vec2
    
    
        public
    
    
    
    
    m_mass
    Float
    
    
        public
    
    
    
    
    Default: 0.0
