Difference between revisions of "B2.createMouseJointDef"

From GiderosMobile
(Created page with "__NOTOC__ '''Available since:''' Gideros 2011.6<br/> === Description === <br /> Creates and returns a mouse joint definition table with the bodies, world target point, maxForc...")
 
Line 7: Line 7:
 
<br />
 
<br />
 
<source lang="lua">
 
<source lang="lua">
(table), = b2.createMouseJointDef(bodyAbodyBtargetxtargetymaxForcefrequencyHzdampingRatio,)
+
(table) = b2.createMouseJointDef(bodyA,bodyB,targetx,targety,maxForce,frequencyHz,dampingRatio)
 
</source>
 
</source>
'''bodyA:''' (b2.Body) the first attached body ''''''<br/>
+
'''bodyA''': (b2.Body) the first attached body ''''''<br/>
'''bodyB:''' (b2.Body) the second attached body ''''''<br/>
+
'''bodyB''': (b2.Body) the second attached body ''''''<br/>
'''targetx:''' (number) the x coordinate of the world target point ''''''<br/>
+
'''targetx''': (number) the x coordinate of the world target point ''''''<br/>
'''targety:''' (number) the y coordinate of the world target point ''''''<br/>
+
'''targety''': (number) the y coordinate of the world target point ''''''<br/>
'''maxForce:''' (number) the maximum constraint force that can be exerted to move the candidate body ''''''<br/>
+
'''maxForce''': (number) the maximum constraint force that can be exerted to move the candidate body ''''''<br/>
'''frequencyHz:''' (number, default = 5) the response speed ''''''<br/>
+
'''frequencyHz''': (number, default = 5) the response speed ''''''<br/>
'''dampingRatio:''' (number, default = 0.7) the damping ratio. 0 = no damping, 1 = critical damping ''''''<br/>
+
'''dampingRatio''': (number, default = 0.7) the damping ratio. 0 = no damping, 1 = critical damping ''''''<br/>
 
'''Returns''' (table) A new mouse joint definition table<br/>
 
'''Returns''' (table) A new mouse joint definition table<br/>

Revision as of 10:20, 23 August 2018

Available since: Gideros 2011.6

Description


Creates and returns a mouse joint definition table with the bodies, world target point, maxForce and optional frequencyHz and dampingRatio.
(Please refer to b2.World:createJoint function for more information about all the information needed to create a mouse joint).

(table) = b2.createMouseJointDef(bodyA,bodyB,targetx,targety,maxForce,frequencyHz,dampingRatio)

'bodyA: (b2.Body) the first attached body '
'bodyB: (b2.Body) the second attached body '
'targetx: (number) the x coordinate of the world target point '
'targety: (number) the y coordinate of the world target point '
'maxForce: (number) the maximum constraint force that can be exerted to move the candidate body '
'frequencyHz: (number, default = 5) the response speed '
'dampingRatio: (number, default = 0.7) the damping ratio. 0 = no damping, 1 = critical damping '
Returns (table) A new mouse joint definition table