Namespace: b2d.joint
Language: Lua
Type: Defold Lua
File: script_box2d_joint_v2.cpp
Source: engine/gamesys/src/gamesys/scripts/box2d/v2/script_box2d_joint_v2.cpp
Functions for interacting with native Box2D joints.
Type: FUNCTION Create a distance joint.
Parameters
body_a (b2Body) - first bodybody_b (b2Body) - second bodydefinition (b2d.joint.distance_definition) (optional) - optional joint definitionReturns
joint (b2Joint) - created jointType: FUNCTION Create a distance joint.
Parameters
body_a (b2Body) - first bodybody_b (b2Body) - second bodydefinition (b2d.joint.distance_definition) (optional) - optional joint definitionReturns
joint (b2Joint) - created jointType: FUNCTION Create a filter joint.
Parameters
body_a (b2Body) - first bodybody_b (b2Body) - second bodydefinition (b2d.joint.filter_definition) (optional) - optional definition tableReturns
joint (b2Joint) - created jointType: FUNCTION Create a friction joint.
Parameters
body_a (b2Body) - first bodybody_b (b2Body) - second bodydefinition (b2d.joint.friction_definition) (optional) - optional joint definitionReturns
joint (b2Joint) - created jointType: FUNCTION Create a gear joint.
Parameters
joint1 (b2Joint) - first revolute or prismatic jointjoint2 (b2Joint) - second revolute or prismatic jointdefinition (b2d.joint.gear_definition) (optional) - optional joint definitionReturns
joint (b2Joint) - created jointType: FUNCTION Create a motor joint.
Parameters
body_a (b2Body) - first bodybody_b (b2Body) - second bodydefinition (b2d.joint.motor_definition) (optional) - optional joint definitionReturns
joint (b2Joint) - created jointType: FUNCTION Create a mouse joint.
Parameters
body_a (b2Body) - first bodybody_b (b2Body) - second bodydefinition (b2d.joint.mouse_definition) (optional) - optional joint definitionReturns
joint (b2Joint) - created jointType: FUNCTION Create a mouse joint.
Parameters
body_a (b2Body) - first bodybody_b (b2Body) - second bodydefinition (b2d.joint.mouse_definition) (optional) - optional joint definitionReturns
joint (b2Joint) - created jointType: FUNCTION Create a prismatic joint.
Parameters
body_a (b2Body) - first bodybody_b (b2Body) - second bodydefinition (b2d.joint.prismatic_definition) (optional) - optional joint definitionReturns
joint (b2Joint) - created jointType: FUNCTION Create a prismatic joint.
Parameters
body_a (b2Body) - first bodybody_b (b2Body) - second bodydefinition (b2d.joint.prismatic_definition) (optional) - optional joint definitionReturns
joint (b2Joint) - created jointType: FUNCTION Create a pulley joint.
Parameters
body_a (b2Body) - first bodybody_b (b2Body) - second bodydefinition (b2d.joint.pulley_definition) (optional) - optional joint definitionReturns
joint (b2Joint) - created jointType: FUNCTION Create a revolute joint.
Parameters
body_a (b2Body) - first bodybody_b (b2Body) - second bodydefinition (b2d.joint.revolute_definition) (optional) - optional joint definitionReturns
joint (b2Joint) - created jointType: FUNCTION Create a revolute joint.
Parameters
body_a (b2Body) - first bodybody_b (b2Body) - second bodydefinition (b2d.joint.revolute_definition) (optional) - optional joint definitionReturns
joint (b2Joint) - created jointType: FUNCTION Create a rope joint.
Parameters
body_a (b2Body) - first bodybody_b (b2Body) - second bodydefinition (b2d.joint.rope_definition) (optional) - optional joint definitionReturns
joint (b2Joint) - created jointType: FUNCTION Create a weld joint.
Parameters
body_a (b2Body) - first bodybody_b (b2Body) - second bodydefinition (b2d.joint.weld_definition) (optional) - optional joint definitionReturns
joint (b2Joint) - created jointType: FUNCTION Create a weld joint.
Parameters
body_a (b2Body) - first bodybody_b (b2Body) - second bodydefinition (b2d.joint.weld_definition) (optional) - optional joint definitionReturns
joint (b2Joint) - created jointType: FUNCTION Create a wheel joint.
Parameters
body_a (b2Body) - first bodybody_b (b2Body) - second bodydefinition (b2d.joint.wheel_definition) (optional) - optional joint definitionReturns
joint (b2Joint) - created jointType: FUNCTION Create a wheel joint.
Parameters
body_a (b2Body) - first bodybody_b (b2Body) - second bodydefinition (b2d.joint.wheel_definition) (optional) - optional joint definitionReturns
joint (b2Joint) - created jointType: FUNCTION Destroy a joint created by b2d.joint.
Parameters
joint (b2Joint) - jointType: FUNCTION Destroy a joint created by b2d.joint.
Parameters
joint (b2Joint) - jointType: FUNCTION Enable or disable joint limits.
Parameters
joint (b2Joint) - prismatic or revolute jointenable (boolean) - true to enable limitsType: FUNCTION Enable or disable joint limits.
Parameters
joint (b2Joint) - distance, prismatic, revolute, or wheel jointenable (boolean) - true to enable limitsType: FUNCTION Enable or disable the joint motor.
Parameters
joint (b2Joint) - prismatic, revolute, or wheel jointenable (boolean) - true to enable the motorType: FUNCTION Enable or disable the joint motor.
Parameters
joint (b2Joint) - distance, prismatic, revolute, or wheel jointenable (boolean) - true to enable the motorType: FUNCTION Enable or disable joint spring behavior.
Parameters
joint (b2Joint) - distance, prismatic, revolute, or wheel jointenable (boolean) - true to enable the springType: FUNCTION Get the world anchor on body A.
Parameters
joint (b2Joint) - jointReturns
anchor (vector3) - world anchorType: FUNCTION Get the world anchor on body A.
Parameters
joint (b2Joint) - jointReturns
anchor (vector3) - world anchorType: FUNCTION Get the world anchor on body B.
Parameters
joint (b2Joint) - jointReturns
anchor (vector3) - world anchorType: FUNCTION Get the world anchor on body B.
Parameters
joint (b2Joint) - jointReturns
anchor (vector3) - world anchorType: FUNCTION Get weld joint angular damping ratio.
Parameters
joint (b2Joint) - weld jointReturns
ratio (number) - damping ratioType: FUNCTION Get weld joint angular frequency.
Parameters
joint (b2Joint) - weld jointReturns
hertz (number) - frequency in hertzType: FUNCTION Get motor joint angular offset.
Parameters
joint (b2Joint) - motor jointReturns
offset (number) - angular offset in radiansType: FUNCTION Get the first body connected to a joint.
Parameters
joint (b2Joint) - jointReturns
body (b2Body) - body AType: FUNCTION Get the first body connected to a joint.
Parameters
joint (b2Joint) - jointReturns
body (b2Body) - body AType: FUNCTION Get the second body connected to a joint.
Parameters
joint (b2Joint) - jointReturns
body (b2Body) - body BType: FUNCTION Get the second body connected to a joint.
Parameters
joint (b2Joint) - jointReturns
body (b2Body) - body BType: FUNCTION Get whether connected bodies can collide.
Parameters
joint (b2Joint) - jointReturns
collide (boolean) - true if connected bodies can collideType: FUNCTION Get whether connected bodies can collide.
Parameters
joint (b2Joint) - jointReturns
collide (boolean) - true if connected bodies can collideType: FUNCTION Get motor joint correction factor.
Parameters
joint (b2Joint) - motor jointReturns
factor (number) - correction factorType: FUNCTION Get the current distance joint length.
Parameters
joint (b2Joint) - distance jointReturns
length (number) - current length in project unitsType: FUNCTION Get spring damping ratio.
Parameters
joint (b2Joint) - distance, mouse, weld, or wheel jointReturns
ratio (number) - damping ratioType: FUNCTION Alias for b2d.joint.get_spring_damping_ratio.
Parameters
joint (b2Joint) - distance, mouse, prismatic, revolute, or wheel jointReturns
ratio (number) - damping ratioType: FUNCTION Get spring frequency.
Parameters
joint (b2Joint) - distance, mouse, weld, or wheel jointReturns
frequency (number) - frequency in hertzType: FUNCTION Alias for b2d.joint.get_spring_hertz.
Parameters
joint (b2Joint) - distance, mouse, prismatic, revolute, or wheel jointReturns
frequency (number) - frequency in hertzType: FUNCTION Get pulley ground anchor A.
Parameters
joint (b2Joint) - pulley jointReturns
anchor (vector3) - world anchorType: FUNCTION Get pulley ground anchor B.
Parameters
joint (b2Joint) - pulley jointReturns
anchor (vector3) - world anchorType: FUNCTION Alias for b2d.joint.get_frequency.
Parameters
joint (b2Joint) - distance, mouse, weld, or wheel jointReturns
hertz (number) - frequency in hertzType: FUNCTION Alias for b2d.joint.get_spring_hertz.
Parameters
joint (b2Joint) - distance, mouse, prismatic, revolute, or wheel jointReturns
hertz (number) - frequency in hertzType: FUNCTION Get the first joint connected to a gear joint.
Parameters
joint (b2Joint) - gear jointReturns
joint1 (b2Joint) - first connected jointType: FUNCTION Get the second joint connected to a gear joint.
Parameters
joint (b2Joint) - gear jointReturns
joint2 (b2Joint) - second connected jointType: FUNCTION Get revolute joint angle.
Parameters
joint (b2Joint) - revolute jointReturns
angle (number) - angle in radiansType: FUNCTION Get revolute joint angle.
Parameters
joint (b2Joint) - revolute jointReturns
angle (number) - angle in radiansType: FUNCTION Get joint speed.
Parameters
joint (b2Joint) - prismatic, revolute, or wheel jointReturns
speed (number) - joint speedType: FUNCTION Get joint speed.
Parameters
joint (b2Joint) - prismatic jointReturns
speed (number) - joint speedType: FUNCTION Get joint translation.
Parameters
joint (b2Joint) - prismatic or wheel jointReturns
translation (number) - translation in project unitsType: FUNCTION Get joint translation.
Parameters
joint (b2Joint) - prismatic jointReturns
translation (number) - translation in project unitsType: FUNCTION Get the distance joint length.
Parameters
joint (b2Joint) - distance jointReturns
length (number) - length in project unitsType: FUNCTION Get the distance joint length.
Parameters
joint (b2Joint) - distance jointReturns
length (number) - length in project unitsType: FUNCTION Get pulley segment length A.
Parameters
joint (b2Joint) - pulley jointReturns
length (number) - length in project unitsType: FUNCTION Get pulley segment length B.
Parameters
joint (b2Joint) - pulley jointReturns
length (number) - length in project unitsType: FUNCTION Get rope limit state.
Parameters
joint (b2Joint) - rope jointReturns
state (b2d.joint.LIMIT_STATE) - one of the LIMIT_STATE_* constantsType: FUNCTION Get weld joint linear damping ratio.
Parameters
joint (b2Joint) - weld jointReturns
ratio (number) - damping ratioType: FUNCTION Get weld joint linear frequency.
Parameters
joint (b2Joint) - weld jointReturns
hertz (number) - frequency in hertzType: FUNCTION Get motor joint linear offset.
Parameters
joint (b2Joint) - motor jointReturns
offset (vector3) - linear offset in project unitsType: FUNCTION Get the local anchor on body A.
Parameters
joint (b2Joint) - jointReturns
anchor (vector3) - local anchorType: FUNCTION Get the local anchor on body A.
Parameters
joint (b2Joint) - jointReturns
anchor (vector3) - local anchorType: FUNCTION Get the local anchor on body B.
Parameters
joint (b2Joint) - jointReturns
anchor (vector3) - local anchorType: FUNCTION Get the local anchor on body B.
Parameters
joint (b2Joint) - jointReturns
anchor (vector3) - local anchorType: FUNCTION Get the local axis on body A.
Parameters
joint (b2Joint) - prismatic or wheel jointReturns
axis (vector3) - local axisType: FUNCTION Get the lower joint limit.
Parameters
joint (b2Joint) - prismatic or revolute jointReturns
lower (number) - lower limitType: FUNCTION Get the lower joint limit.
Parameters
joint (b2Joint) - prismatic, revolute, or wheel jointReturns
lower (number) - lower limitType: FUNCTION Get maximum force.
Parameters
joint (b2Joint) - mouse or friction jointReturns
force (number) - maximum forceType: FUNCTION Get maximum force.
Parameters
joint (b2Joint) - mouse or motor jointReturns
force (number) - maximum forceType: FUNCTION Get rope maximum length.
Parameters
joint (b2Joint) - rope jointReturns
length (number) - maximum length in project unitsType: FUNCTION Get the distance joint maximum length.
Parameters
joint (b2Joint) - distance jointReturns
length (number) - maximum length in project unitsType: FUNCTION Get maximum motor force.
Parameters
joint (b2Joint) - prismatic jointReturns
force (number) - maximum motor forceType: FUNCTION Get maximum motor force.
Parameters
joint (b2Joint) - distance or prismatic jointReturns
force (number) - maximum motor forceType: FUNCTION Get maximum motor torque.
Parameters
joint (b2Joint) - revolute or wheel jointReturns
torque (number) - maximum motor torqueType: FUNCTION Get maximum motor torque.
Parameters
joint (b2Joint) - revolute or wheel jointReturns
torque (number) - maximum motor torqueType: FUNCTION Get maximum torque.
Parameters
joint (b2Joint) - friction jointReturns
torque (number) - maximum torqueType: FUNCTION Get maximum torque.
Parameters
joint (b2Joint) - motor jointReturns
torque (number) - maximum torqueType: FUNCTION Get the distance joint minimum length.
Parameters
joint (b2Joint) - distance jointReturns
length (number) - minimum length in project unitsType: FUNCTION Get current motor force.
Parameters
joint (b2Joint) - prismatic jointinv_dt (number) - inverse time stepReturns
force (number) - motor forceType: FUNCTION Get current motor force.
Parameters
joint (b2Joint) - distance or prismatic jointReturns
force (number) - motor forceType: FUNCTION Get motor speed.
Parameters
joint (b2Joint) - prismatic, revolute, or wheel jointReturns
speed (number) - motor speedType: FUNCTION Get motor speed.
Parameters
joint (b2Joint) - distance, prismatic, revolute, or wheel jointReturns
speed (number) - motor speedType: FUNCTION Get current motor torque.
Parameters
joint (b2Joint) - revolute or wheel jointinv_dt (number) - inverse time stepReturns
torque (number) - motor torqueType: FUNCTION Get current motor torque.
Parameters
joint (b2Joint) - revolute or wheel jointReturns
torque (number) - motor torqueType: FUNCTION Get the target for a mouse joint.
Parameters
joint (b2Joint) - mouse jointReturns
target (vector3) - world targetType: FUNCTION Get the target for a mouse joint.
Parameters
joint (b2Joint) - mouse jointReturns
target (vector3) - world targetType: FUNCTION Get joint ratio.
Parameters
joint (b2Joint) - pulley or gear jointReturns
ratio (number) - joint ratioType: FUNCTION Get reaction force.
Parameters
joint (b2Joint) - jointinv_dt (number) - inverse time stepReturns
force (vector3) - reaction forceType: FUNCTION Get reaction force.
Parameters
joint (b2Joint) - jointReturns
force (vector3) - reaction forceType: FUNCTION Get reaction torque.
Parameters
joint (b2Joint) - jointinv_dt (number) - inverse time stepReturns
torque (number) - reaction torqueType: FUNCTION Get reaction torque.
Parameters
joint (b2Joint) - jointReturns
torque (number) - reaction torqueType: FUNCTION Get the reference angle.
Parameters
joint (b2Joint) - prismatic, revolute, or weld jointReturns
angle (number) - reference angle in radiansType: FUNCTION Get weld joint reference angle.
Parameters
joint (b2Joint) - weld jointReturns
angle (number) - reference angle in radiansType: FUNCTION Alias for b2d.joint.get_damping_ratio.
Parameters
joint (b2Joint) - distance, mouse, weld, or wheel jointReturns
ratio (number) - damping ratioType: FUNCTION Get spring damping ratio.
Parameters
joint (b2Joint) - distance, mouse, prismatic, revolute, or wheel jointReturns
ratio (number) - damping ratioType: FUNCTION Get spring frequency.
Parameters
joint (b2Joint) - distance, mouse, prismatic, revolute, or wheel jointReturns
hertz (number) - frequency in hertzType: FUNCTION Get the joint type.
Parameters
joint (b2Joint) - jointReturns
type (b2d.joint.JOINT_TYPE) - one of the JOINT_TYPE_* constantsType: FUNCTION Get the joint type.
Parameters
joint (b2Joint) - jointReturns
type (b2d.joint.JOINT_TYPE) - one of the JOINT_TYPE_* constantsType: FUNCTION Get the upper joint limit.
Parameters
joint (b2Joint) - prismatic or revolute jointReturns
upper (number) - upper limitType: FUNCTION Get the upper joint limit.
Parameters
joint (b2Joint) - prismatic, revolute, or wheel jointReturns
upper (number) - upper limitType: FUNCTION Get the world owning a joint.
Parameters
joint (b2Joint) - jointReturns
world (b2World) - owning worldType: FUNCTION Get whether the joint is active.
Parameters
joint (b2Joint) - jointReturns
active (boolean) - true if the joint is activeType: FUNCTION Get whether joint limits are enabled.
Parameters
joint (b2Joint) - prismatic or revolute jointReturns
enabled (boolean) - true if limits are enabledType: FUNCTION Get whether joint limits are enabled.
Parameters
joint (b2Joint) - distance, prismatic, revolute, or wheel jointReturns
enabled (boolean) - true if limits are enabledType: FUNCTION Get whether the joint motor is enabled.
Parameters
joint (b2Joint) - prismatic, revolute, or wheel jointReturns
enabled (boolean) - true if the motor is enabledType: FUNCTION Get whether the joint motor is enabled.
Parameters
joint (b2Joint) - distance, prismatic, revolute, or wheel jointReturns
enabled (boolean) - true if the motor is enabledType: FUNCTION Get whether joint spring behavior is enabled.
Parameters
joint (b2Joint) - distance, prismatic, revolute, or wheel jointReturns
enabled (boolean) - true if the spring is enabledType: FUNCTION Validate a joint handle.
Parameters
joint (b2Joint) - jointReturns
valid (boolean) - true if the joint handle still refers to a live Box2D jointType: ENUM Box2D joint types.
Members
b2d.joint.JOINT_TYPE_DISTANCE - Distance joint type.b2d.joint.JOINT_TYPE_FILTER - Filter joint type.b2d.joint.JOINT_TYPE_FRICTION - Friction joint type.b2d.joint.JOINT_TYPE_GEAR - Gear joint type.b2d.joint.JOINT_TYPE_MOTOR - Motor joint type.b2d.joint.JOINT_TYPE_MOUSE - Mouse joint type.b2d.joint.JOINT_TYPE_PRISMATIC - Prismatic joint type.b2d.joint.JOINT_TYPE_PULLEY - Pulley joint type.b2d.joint.JOINT_TYPE_REVOLUTE - Revolute joint type.b2d.joint.JOINT_TYPE_ROPE - Rope joint type.b2d.joint.JOINT_TYPE_UNKNOWN - Unknown joint type.b2d.joint.JOINT_TYPE_WELD - Weld joint type.b2d.joint.JOINT_TYPE_WHEEL - Wheel joint type.Type: ENUM Box2D joint limit states.
Members
b2d.joint.LIMIT_STATE_AT_LOWER - At lower limit state.b2d.joint.LIMIT_STATE_AT_UPPER - At upper limit state.b2d.joint.LIMIT_STATE_EQUAL - Equal limits state.b2d.joint.LIMIT_STATE_INACTIVE - Inactive limit state.Type: FUNCTION Set weld joint angular damping ratio.
Parameters
joint (b2Joint) - weld jointratio (number) - damping ratioType: FUNCTION Set weld joint angular frequency.
Parameters
joint (b2Joint) - weld jointhertz (number) - frequency in hertzType: FUNCTION Set motor joint angular offset.
Parameters
joint (b2Joint) - motor jointoffset (number) - angular offset in radiansType: FUNCTION Set whether connected bodies can collide.
Parameters
joint (b2Joint) - jointcollide (boolean) - true if connected bodies can collideType: FUNCTION Set motor joint correction factor.
Parameters
joint (b2Joint) - motor jointfactor (number) - correction factorType: FUNCTION Set spring damping ratio.
Parameters
joint (b2Joint) - distance, mouse, weld, or wheel jointratio (number) - damping ratioType: FUNCTION Alias for b2d.joint.set_spring_damping_ratio.
Parameters
joint (b2Joint) - distance, mouse, prismatic, revolute, or wheel jointratio (number) - damping ratioType: FUNCTION Set spring frequency.
Parameters
joint (b2Joint) - distance, mouse, weld, or wheel jointfrequency (number) - frequency in hertzType: FUNCTION Alias for b2d.joint.set_spring_hertz.
Parameters
joint (b2Joint) - distance, mouse, prismatic, revolute, or wheel jointfrequency (number) - frequency in hertzType: FUNCTION Alias for b2d.joint.set_frequency.
Parameters
joint (b2Joint) - distance, mouse, weld, or wheel jointhertz (number) - frequency in hertzType: FUNCTION Alias for b2d.joint.set_spring_hertz.
Parameters
joint (b2Joint) - distance, mouse, prismatic, revolute, or wheel jointhertz (number) - frequency in hertzType: FUNCTION Set the distance joint length.
Parameters
joint (b2Joint) - distance jointlength (number) - length in project unitsType: FUNCTION Set the distance joint length.
Parameters
joint (b2Joint) - distance jointlength (number) - length in project unitsType: FUNCTION Set the distance joint length range.
Parameters
joint (b2Joint) - distance jointmin_length (number) - minimum length in project unitsmax_length (number) - maximum length in project unitsType: FUNCTION Set joint limits.
Parameters
joint (b2Joint) - prismatic or revolute jointlower (number) - lower limitupper (number) - upper limitType: FUNCTION Set joint limits.
Parameters
joint (b2Joint) - prismatic, revolute, or wheel jointlower (number) - lower limitupper (number) - upper limitType: FUNCTION Set weld joint linear damping ratio.
Parameters
joint (b2Joint) - weld jointratio (number) - damping ratioType: FUNCTION Set weld joint linear frequency.
Parameters
joint (b2Joint) - weld jointhertz (number) - frequency in hertzType: FUNCTION Set motor joint linear offset.
Parameters
joint (b2Joint) - motor jointoffset (vector3) - linear offset in project unitsType: FUNCTION Set maximum force.
Parameters
joint (b2Joint) - mouse or friction jointforce (number) - maximum forceType: FUNCTION Set maximum force.
Parameters
joint (b2Joint) - mouse or motor jointforce (number) - maximum forceType: FUNCTION Set rope maximum length.
Parameters
joint (b2Joint) - rope jointlength (number) - maximum length in project unitsType: FUNCTION Set the distance joint maximum length.
Parameters
joint (b2Joint) - distance jointlength (number) - maximum length in project unitsType: FUNCTION Set maximum motor force.
Parameters
joint (b2Joint) - prismatic jointforce (number) - maximum motor forceType: FUNCTION Set maximum motor force.
Parameters
joint (b2Joint) - distance or prismatic jointforce (number) - maximum motor forceType: FUNCTION Set maximum motor torque.
Parameters
joint (b2Joint) - revolute or wheel jointtorque (number) - maximum motor torqueType: FUNCTION Set maximum motor torque.
Parameters
joint (b2Joint) - revolute or wheel jointtorque (number) - maximum motor torqueType: FUNCTION Set maximum torque.
Parameters
joint (b2Joint) - friction jointtorque (number) - maximum torqueType: FUNCTION Set maximum torque.
Parameters
joint (b2Joint) - motor jointtorque (number) - maximum torqueType: FUNCTION Set the distance joint minimum length.
Parameters
joint (b2Joint) - distance jointlength (number) - minimum length in project unitsType: FUNCTION Set motor speed.
Parameters
joint (b2Joint) - prismatic, revolute, or wheel jointspeed (number) - motor speedType: FUNCTION Set motor speed.
Parameters
joint (b2Joint) - distance, prismatic, revolute, or wheel jointspeed (number) - motor speedType: FUNCTION Set the target for a mouse joint.
Parameters
joint (b2Joint) - mouse jointtarget (vector3) - world targetType: FUNCTION Set the target for a mouse joint.
Parameters
joint (b2Joint) - mouse jointtarget (vector3) - world targetType: FUNCTION Set gear joint ratio.
Parameters
joint (b2Joint) - gear jointratio (number) - gear ratioType: FUNCTION Set weld joint reference angle.
Parameters
joint (b2Joint) - weld jointangle (number) - reference angle in radiansType: FUNCTION Alias for b2d.joint.set_damping_ratio.
Parameters
joint (b2Joint) - distance, mouse, weld, or wheel jointratio (number) - damping ratioType: FUNCTION Set spring damping ratio.
Parameters
joint (b2Joint) - distance, mouse, prismatic, revolute, or wheel jointratio (number) - damping ratioType: FUNCTION Set spring frequency.
Parameters
joint (b2Joint) - distance, mouse, prismatic, revolute, or wheel jointhertz (number) - frequency in hertzType: FUNCTION Wake the bodies connected to a joint.
Parameters
joint (b2Joint) - jointType: TYPEDEF An opaque handle connecting two b2Body values. Create one with a function such as b2d.joint.create_distance, use the functions in b2d.joint to inspect or configure it, and release it with b2d.joint.destroy. Joints are also destroyed when either connected body or its physics world is destroyed.
Parameters
value (userdata) - Box2D joint handleExamples
local body_a = b2d.get_body("#collisionobject_a")
local body_b = b2d.get_body("#collisionobject_b")
local joint = b2d.joint.create_distance(body_a, body_b)
print(b2d.joint.get_type(joint))
Type: TYPEDEF An opaque handle connecting two b2Body values. Create one with a function such as b2d.joint.create_distance, use the functions in b2d.joint to inspect or configure it, and release it with b2d.joint.destroy. Use b2d.joint.is_valid before retaining a handle across body or world destruction.
Parameters
value (userdata) - Box2D joint handleExamples
local body_a = b2d.get_body("#collisionobject_a")
local body_b = b2d.get_body("#collisionobject_b")
local joint = b2d.joint.create_distance(body_a, body_b)
if b2d.joint.is_valid(joint) then
print(b2d.joint.get_type(joint))
end