API Documentation for:
Show:

b2MouseJoint Class

Extends b2Joint
Defined in: b2MouseJoint:17
Module: Joints

A mouse joint is used to make a point on a body track a specified world point. This a soft constraint with a maximum force. This allows the constraint to stretch and without applying huge forces.

NOTE: this joint is not documented in the manual because it was developed to be used in the testbed. If you want to learn how to use the mouse joint, look at the testbed.

Constructor

b2MouseJoint

(
  • mouseJointDef
)

Defined in b2MouseJoint:17

Parameters:

  • mouseJointDef B2MouseJointDef

Methods

getAnchorB

(
  • [out=b2Vec2]
)
B2Vec2 | Object public

Defined in getAnchorB:266

Parameters:

  • [out=b2Vec2] B2Vec2 | Object= optional

    reusable object

Returns:

B2Vec2 | Object:

out

getAnchorB

(
  • [out=b2Vec2]
)
B2Vec2 | Object public

Defined in getAnchorB:277

Parameters:

  • [out=b2Vec2] B2Vec2 | Object= optional

    reusable object

Returns:

B2Vec2 | Object:

out

getDampingRatio

() Float public

Defined in getDampingRatio:352

Get the target angular offset, in radians.

Returns:

Float:

getFrequency

() Float public

Defined in getFrequency:394

Returns:

Float:

getMaxForce

() Float public

Defined in getMaxForce:373

Get the maximum friction force in N.

Returns:

Float:

getReactionForce

(
  • invDeltaTime
  • [out=b2Vec2]
)
B2Vec2 | Object public

Get the reaction force given the inverse time step. Unit is N.

Parameters:

  • invDeltaTime Float
  • [out=b2Vec2] B2Vec2 | Object= optional

    reusable object

Returns:

B2Vec2 | Object:

out

getReactionTorque

(
  • invDeltaTime
)
Float public

Get the reaction torque given the inverse time step. Unit is N*m. This is always zero for a distance joint.

Parameters:

  • invDeltaTime Float

Returns:

Float:

getTarget

(
  • [out=b2Vec2]
)
B2Vec2 | Object public

Defined in getTarget:329

Parameters:

  • [out=b2Vec2] B2Vec2 | Object= optional

    reusable object

Returns:

B2Vec2 | Object:

out

initVelocityConstraints

(
  • data
)
Void public

Parameters:

  • data B2SolverData

Returns:

Void:

setDampingRatio

(
  • ratio
)
Float public

Defined in setDampingRatio:340

Set the target angular offset, in radians.

Parameters:

  • ratio Float

Returns:

Float:

setFrequency

(
  • hz
)
Float public

Defined in setFrequency:384

Parameters:

  • hz Float

Returns:

Float:

setMaxForce

(
  • maxForce
)
Float public

Defined in setMaxForce:363

Parameters:

  • maxForce Float

Returns:

Float:

setTarget

(
  • target
)
Float public

Defined in setTarget:316

Parameters:

  • target Float

Returns:

Float:

shiftOrigin

(
  • newOrigin
)
Float public

Defined in shiftOrigin:403

Parameters:

  • newOrigin Float

Returns:

Float:

solvePositionConstraints

(
  • data
)
Void public

Parameters:

  • data B2SolverData

Returns:

Void:

solveVelocityConstraints

(
  • data
)
Void public

Parameters:

  • data B2SolverData

Returns:

Void:

Properties

m_beta

Float public

Defined in m_beta:173

Default: 0.0

m_C

B2Vec2 public

Defined in m_C:112

m_dampingRatio

Float public

Defined in m_dampingRatio:165

m_frequencyHz

Float public

Defined in m_frequencyHz:157

m_gamma

Float public

Defined in m_gamma:182

Default: 0.0

m_impulse

B2Vec2 public

Defined in m_impulse:88

m_indexA

Int public

Defined in m_indexA:191

Default: 0

m_indexB

Int public

Defined in m_indexB:200

Default: 0

m_invIB

Float public

Defined in m_invIB:218

Default: 0.0

m_invMassB

Float public

Defined in m_invMassB:209

Default: 0.0

m_K

B2Mat22 public

Defined in m_K:56

m_lalcB

B2Vec2 public

Defined in m_lalcB:128

m_localAnchorB

B2Vec2 public

Defined in m_localAnchorB:72

m_localCenterB

B2Vec2 public

Defined in m_localCenterB:104

m_mass

B2Mat22 public

Defined in m_mass:64

m_maxForce

Float public

Defined in m_maxForce:149

m_qB

B2Rot public

Defined in m_qB:120

m_rB

B2Vec2 public

Defined in m_rB:96

m_targetA

B2Vec2 public

Defined in m_targetA:80