PackageBox2D.Dynamics.Joints
Classpublic class b2MouseJoint
Inheritanceb2MouseJoint Inheritance b2Joint
Sourceb2MouseJoint.as

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 fully documented as it is intended primarily for the testbed. See that for more instructions.

See also

b2MouseJointDef


Public Methods
 MethodDefined by
  
Get the anchor point on bodyA in world coordinates.
b2MouseJoint
  
Get the anchor point on bodyB in world coordinates.
b2MouseJoint
 Inherited
Get the first body attached to this joint.
b2Joint
 Inherited
Get the second body attached to this joint.
b2Joint
  
GetDampingRatio():Number
b2MouseJoint
  
GetFrequency():Number
b2MouseJoint
  
GetMaxForce():Number
b2MouseJoint
 Inherited
Get the next joint the world joint list.
b2Joint
  
GetReactionForce(inv_dt:Number):b2Vec2
Get the reaction force on body2 at the joint anchor in Newtons.
b2MouseJoint
  
GetReactionTorque(inv_dt:Number):Number
Get the reaction torque on body2 in N.
b2MouseJoint
  
b2MouseJoint
 Inherited
GetType():int
Get the type of the concrete joint.
b2Joint
 Inherited
Get the user data pointer.
b2Joint
 Inherited
IsActive():Boolean
Short-cut function to determine if either body is inactive.
b2Joint
  
SetDampingRatio(ratio:Number):void
b2MouseJoint
  
SetFrequency(hz:Number):void
b2MouseJoint
  
SetMaxForce(maxForce:Number):void
b2MouseJoint
  
SetTarget(target:b2Vec2):void
Use this to update the target point.
b2MouseJoint
 Inherited
SetUserData(data:*):void
Set the user data pointer.
b2Joint
Method detail
GetAnchorA()method
public override function GetAnchorA():b2Vec2

Get the anchor point on bodyA in world coordinates.

Returns
b2Vec2
GetAnchorB()method 
public override function GetAnchorB():b2Vec2

Get the anchor point on bodyB in world coordinates.

Returns
b2Vec2
GetDampingRatio()method 
public function GetDampingRatio():Number

Returns
Number
GetFrequency()method 
public function GetFrequency():Number

Returns
Number
GetMaxForce()method 
public function GetMaxForce():Number

Returns
Number
GetReactionForce()method 
public override function GetReactionForce(inv_dt:Number):b2Vec2

Get the reaction force on body2 at the joint anchor in Newtons.

Parameters
inv_dt:Number

Returns
b2Vec2
GetReactionTorque()method 
public override function GetReactionTorque(inv_dt:Number):Number

Get the reaction torque on body2 in N.

Parameters
inv_dt:Number

Returns
Number
GetTarget()method 
public function GetTarget():b2Vec2

Returns
b2Vec2
SetDampingRatio()method 
public function SetDampingRatio(ratio:Number):voidParameters
ratio:Number
SetFrequency()method 
public function SetFrequency(hz:Number):voidParameters
hz:Number
SetMaxForce()method 
public function SetMaxForce(maxForce:Number):voidParameters
maxForce:Number
SetTarget()method 
public function SetTarget(target:b2Vec2):void

Use this to update the target point.

Parameters
target:b2Vec2