Difference between revisions of "B2.DistanceJoint"
From GiderosMobile
Line 1: | Line 1: | ||
__NOTOC__ | __NOTOC__ | ||
+ | <!-- GIDEROSOBJ:b2.DistanceJoint --> | ||
'''<translate>Supported platforms</translate>:''' [[File:Platform android.png]][[File:Platform ios.png]][[File:Platform mac.png]][[File:Platform pc.png]]<br/> | '''<translate>Supported platforms</translate>:''' [[File:Platform android.png]][[File:Platform ios.png]][[File:Platform mac.png]][[File:Platform pc.png]]<br/> | ||
'''<translate>Available since</translate>:''' Gideros 2011.6<br/> | '''<translate>Available since</translate>:''' Gideros 2011.6<br/> | ||
Line 19: | Line 20: | ||
| style="width: 50%; vertical-align:top;"| | | style="width: 50%; vertical-align:top;"| | ||
=== <translate>Methods</translate> === | === <translate>Methods</translate> === | ||
− | [[Special:MyLanguage/b2.DistanceJoint:getDampingRatio|b2.DistanceJoint:getDampingRatio]] ''<translate>returns the damping ratio</translate>''<br/> | + | [[Special:MyLanguage/b2.DistanceJoint:getDampingRatio|b2.DistanceJoint:getDampingRatio]] ''<translate>returns the damping ratio</translate>''<br/><!-- GIDEROSMTD:b2.DistanceJoint:getDampingRatio --> |
− | [[Special:MyLanguage/b2.DistanceJoint:getFrequency|b2.DistanceJoint:getFrequency]] ''<translate>returns the mass-spring-damper frequency in Hertz</translate>''<br/> | + | [[Special:MyLanguage/b2.DistanceJoint:getFrequency|b2.DistanceJoint:getFrequency]] ''<translate>returns the mass-spring-damper frequency in Hertz</translate>''<br/><!-- GIDEROSMTD:b2.DistanceJoint:getFrequency --> |
− | [[Special:MyLanguage/b2.DistanceJoint:getLength|b2.DistanceJoint:getLength]] ''<translate>returns the length of this distance joint in meters</translate>''<br/> | + | [[Special:MyLanguage/b2.DistanceJoint:getLength|b2.DistanceJoint:getLength]] ''<translate>returns the length of this distance joint in meters</translate>''<br/><!-- GIDEROSMTD:b2.DistanceJoint:getLength --> |
− | [[Special:MyLanguage/b2.DistanceJoint:setDampingRatio|b2.DistanceJoint:setDampingRatio]] ''<translate>sets the damping ratio (0 = no damping, 1 = critical damping)</translate>''<br/> | + | [[Special:MyLanguage/b2.DistanceJoint:setDampingRatio|b2.DistanceJoint:setDampingRatio]] ''<translate>sets the damping ratio (0 = no damping, 1 = critical damping)</translate>''<br/><!-- GIDEROSMTD:b2.DistanceJoint:setDampingRatio --> |
− | [[Special:MyLanguage/b2.DistanceJoint:setFrequency|b2.DistanceJoint:setFrequency]] ''<translate>sets the mass-spring-damper frequency in Hertz</translate>''<br/> | + | [[Special:MyLanguage/b2.DistanceJoint:setFrequency|b2.DistanceJoint:setFrequency]] ''<translate>sets the mass-spring-damper frequency in Hertz</translate>''<br/><!-- GIDEROSMTD:b2.DistanceJoint:setFrequency --> |
− | [[Special:MyLanguage/b2.DistanceJoint:setLength|b2.DistanceJoint:setLength]] ''<translate>sets the natural joint length in meters</translate>''<br/> | + | [[Special:MyLanguage/b2.DistanceJoint:setLength|b2.DistanceJoint:setLength]] ''<translate>sets the natural joint length in meters</translate>''<br/><!-- GIDEROSMTD:b2.DistanceJoint:setLength --> |
| style="width: 50%; vertical-align:top;"| | | style="width: 50%; vertical-align:top;"| | ||
=== <translate>Events</translate> === | === <translate>Events</translate> === | ||
=== <translate>Constants</translate> === | === <translate>Constants</translate> === | ||
|} | |} |
Revision as of 14:53, 31 August 2018
Supported platforms:
Available since: Gideros 2011.6
Inherits from: b2.Joint
Description
A distance joint constrains two points on two bodies to remain at a fixed distance from each other. You can view this as a massless, rigid rod.
Examples
Distance joint
local jointDef = b2.createDistanceJointDef(body1, body2, 100, 100, 200, 100)
local distanceJoint = world:createJoint(jointDef)
--by default length between two bodies is the length they have between them when joint was created
--but it is possilbe to change it using
distanceJoint:setLength(200)
distanceJoint:setDampingRatio(0.5)
distanceJoint:setFrequency(4)
Methodsb2.DistanceJoint:getDampingRatio returns the damping ratio |
EventsConstants |