b2MouseJoint Class
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
Parameters:
-
mouseJointDefB2MouseJointDef
Item Index
Methods
- getAnchorB
- getAnchorB
- getDampingRatio
- getFrequency
- getMaxForce
- getReactionForce
- getReactionTorque
- getTarget
- initVelocityConstraints
- setDampingRatio
- setFrequency
- setMaxForce
- setTarget
- shiftOrigin
- solvePositionConstraints
- solveVelocityConstraints
- create static
- destroy static
- getAnchorA
- getAnchorB
- getBodyA
- getBodyB
- getCollideConnected
- getNext
- getReactionForce
- getReactionTorque
- getType
- getUserData
- initVelocityConstraints
- isActive
- setUserData
- shiftOrigin
- solveVelocityConstraints
- solveVelocityConstraints
Properties
Methods
getAnchorB
-
[out=b2Vec2]
Parameters:
-
[out=b2Vec2]B2Vec2 | Object= optionalreusable object
Returns:
out
getAnchorB
-
[out=b2Vec2]
Parameters:
-
[out=b2Vec2]B2Vec2 | Object= optionalreusable object
Returns:
out
getDampingRatio
()
Float
public
Get the target angular offset, in radians.
Returns:
getFrequency
()
Float
public
Returns:
getMaxForce
()
Float
public
Get the maximum friction force in N.
Returns:
getReactionForce
-
invDeltaTime -
[out=b2Vec2]
Get the reaction force given the inverse time step. Unit is N.
Parameters:
-
invDeltaTimeFloat -
[out=b2Vec2]B2Vec2 | Object= optionalreusable object
Returns:
out
getReactionTorque
-
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:
getTarget
-
[out=b2Vec2]
Parameters:
-
[out=b2Vec2]B2Vec2 | Object= optionalreusable object
Returns:
out
initVelocityConstraints
-
data
Parameters:
-
dataB2SolverData
Returns:
setDampingRatio
-
ratio
Set the target angular offset, in radians.
Parameters:
-
ratioFloat
Returns:
setFrequency
-
hz
Parameters:
-
hzFloat
Returns:
setMaxForce
-
maxForce
Parameters:
-
maxForceFloat
Returns:
setTarget
-
target
Parameters:
-
targetFloat
Returns:
shiftOrigin
-
newOrigin
Parameters:
-
newOriginFloat
Returns:
solvePositionConstraints
-
data
Parameters:
-
dataB2SolverData
Returns:
solveVelocityConstraints
-
data
Parameters:
-
dataB2SolverData
Returns:
Properties
m_beta
Float
public
Default: 0.0
m_C
B2Vec2
public
m_dampingRatio
Float
public
m_frequencyHz
Float
public
m_gamma
Float
public
Default: 0.0
m_impulse
B2Vec2
public
m_indexA
Int
public
Default: 0
m_indexB
Int
public
Default: 0
m_invIB
Float
public
Default: 0.0
m_invMassB
Float
public
Default: 0.0
