Difference between revisions of "B2.FrictionJoint"

From GiderosMobile
Line 21: Line 21:
 
| style="width: 50%;"|
 
| style="width: 50%;"|
 
=== Methods ===
 
=== Methods ===
[[b2.FrictionJoint:getMaxForce]] - returns the maximum friction force in N<br/>
+
[[b2.FrictionJoint:getMaxForce]] {{<translate>returns the maximum friction force in N</translate>}}<br/>
[[b2.FrictionJoint:getMaxTorque]] - returns the maximum friction torque in N*m<br/>
+
[[b2.FrictionJoint:getMaxTorque]] {{<translate>returns the maximum friction torque in N*m</translate>}}<br/>
[[b2.FrictionJoint:setMaxForce]] - sets the maximum friction force in N<br/>
+
[[b2.FrictionJoint:setMaxForce]] {{<translate>sets the maximum friction force in N</translate>}}<br/>
[[b2.FrictionJoint:setMaxTorque]] - sets the maximum friction torque in N*m<br/>
+
[[b2.FrictionJoint:setMaxTorque]] {{<translate>sets the maximum friction torque in N*m</translate>}}<br/>
 
| style="width: 50%;"|
 
| style="width: 50%;"|
 
=== Events ===
 
=== Events ===
 
=== Constants ===
 
=== Constants ===
 
|}
 
|}

Revision as of 14:19, 23 August 2018

Supported platforms: android, ios, mac, pc
Available since: Gideros 2011.6

Description


Friction joint. This is used for top-down friction. It provides 2D translational friction and angular friction.

Examples

Friction joint

--create empty box2d body for joint
local ground = world:createBody({})
ground:setPosition(350, 480)

--create friction joint
local jointDef = b2.createFrictionJointDef(body, ground, 350, 200)
local frictionJoint = world:createJoint(jointDef)

--set maximum friction force to slow down the ball
frictionJoint:setMaxForce(100)

Methods

b2.FrictionJoint:getMaxForce Template:Returns the maximum friction force in N
b2.FrictionJoint:getMaxTorque Template:Returns the maximum friction torque in N*m
b2.FrictionJoint:setMaxForce Template:Sets the maximum friction force in N
b2.FrictionJoint:setMaxTorque Template:Sets the maximum friction torque in N*m

Events

Constants