Difference between revisions of "B2.WeldJoint"

From GiderosMobile
m (Text replacement - "<source" to "<syntaxhighlight")
Line 11: Line 11:
 
=== <translate>Examples</translate> ===
 
=== <translate>Examples</translate> ===
 
'''Weld joint'''
 
'''Weld joint'''
<source lang="lua">
+
<syntaxhighlight lang="lua">
 
local jointDef = b2.createWeldJointDef(body1, body2, 100, 100, 130, 100)
 
local jointDef = b2.createWeldJointDef(body1, body2, 100, 100, 130, 100)
 
local weldJoint = world:createJoint(jointDef)
 
local weldJoint = world:createJoint(jointDef)

Revision as of 14:26, 13 July 2023


Supported platforms: Platform android.pngPlatform ios.pngPlatform mac.pngPlatform pc.pngPlatform html5.pngPlatform winrt.pngPlatform win32.png
Available since: Gideros 2011.6
Inherits from: b2.Joint

Description

A weld joint essentially glues two bodies together. A weld joint may distort somewhat because the island constraint solver is approximate.

Examples

Weld joint <syntaxhighlight lang="lua"> local jointDef = b2.createWeldJointDef(body1, body2, 100, 100, 130, 100) local weldJoint = world:createJoint(jointDef) </source>

Methods

b2.WeldJoint:getDampingRatio returns damping ratio
b2.WeldJoint:getFrequency returns frequency in Hz
b2.WeldJoint:setDampingRatio sets damping ratio
b2.WeldJoint:setFrequency sets frequency in Hz

Events

Constants