Functions for interacting with native Box2D joints.
Version: alpha (1.14.0)
| TYPES | |
|---|---|
| b2Joint | Box2D joint |
| b2Joint | Box2D joint |
| ENUMS | |
|---|---|
| b2d.joint.JOINT_TYPE | Box2D joint types. |
| b2d.joint.LIMIT_STATE | Box2D joint limit states. |
| FUNCTIONS | |
|---|---|
| b2d.joint.create_distance() | Create a distance joint. |
| b2d.joint.create_distance() | Create a distance joint. |
| b2d.joint.create_filter() | Create a filter joint. |
| b2d.joint.create_friction() | Create a friction joint. |
| b2d.joint.create_gear() | Create a gear joint. |
| b2d.joint.create_motor() | Create a motor joint. |
| b2d.joint.create_mouse() | Create a mouse joint. |
| b2d.joint.create_mouse() | Create a mouse joint. |
| b2d.joint.create_prismatic() | Create a prismatic joint. |
| b2d.joint.create_prismatic() | Create a prismatic joint. |
| b2d.joint.create_pulley() | Create a pulley joint. |
| b2d.joint.create_revolute() | Create a revolute joint. |
| b2d.joint.create_revolute() | Create a revolute joint. |
| b2d.joint.create_rope() | Create a rope joint. |
| b2d.joint.create_weld() | Create a weld joint. |
| b2d.joint.create_weld() | Create a weld joint. |
| b2d.joint.create_wheel() | Create a wheel joint. |
| b2d.joint.create_wheel() | Create a wheel joint. |
| b2d.joint.destroy() | Destroy a joint created by b2d.joint. |
| b2d.joint.destroy() | Destroy a joint created by b2d.joint. |
| b2d.joint.enable_limit() | Enable or disable joint limits. |
| b2d.joint.enable_limit() | Enable or disable joint limits. |
| b2d.joint.enable_motor() | Enable or disable the joint motor. |
| b2d.joint.enable_motor() | Enable or disable the joint motor. |
| b2d.joint.enable_spring() | Enable or disable joint spring behavior. |
| b2d.joint.get_anchor_a() | Get the world anchor on body A. |
| b2d.joint.get_anchor_a() | Get the world anchor on body A. |
| b2d.joint.get_anchor_b() | Get the world anchor on body B. |
| b2d.joint.get_anchor_b() | Get the world anchor on body B. |
| b2d.joint.get_angular_damping_ratio() | Get weld joint angular damping ratio. |
| b2d.joint.get_angular_hertz() | Get weld joint angular frequency. |
| b2d.joint.get_angular_offset() | Get motor joint angular offset. |
| b2d.joint.get_body_a() | Get the first body connected to a joint. |
| b2d.joint.get_body_a() | Get the first body connected to a joint. |
| b2d.joint.get_body_b() | Get the second body connected to a joint. |
| b2d.joint.get_body_b() | Get the second body connected to a joint. |
| b2d.joint.get_collide_connected() | Get whether connected bodies can collide. |
| b2d.joint.get_collide_connected() | Get whether connected bodies can collide. |
| b2d.joint.get_correction_factor() | Get motor joint correction factor. |
| b2d.joint.get_current_length() | Get the current distance joint length. |
| b2d.joint.get_damping_ratio() | Get spring damping ratio. |
| b2d.joint.get_damping_ratio() | Alias for b2d.joint.get_spring_damping_ratio. |
| b2d.joint.get_frequency() | Get spring frequency. |
| b2d.joint.get_frequency() | Alias for b2d.joint.get_spring_hertz. |
| b2d.joint.get_ground_anchor_a() | Get pulley ground anchor A. |
| b2d.joint.get_ground_anchor_b() | Get pulley ground anchor B. |
| b2d.joint.get_hertz() | Alias for b2d.joint.get_frequency. |
| b2d.joint.get_hertz() | Alias for b2d.joint.get_spring_hertz. |
| b2d.joint.get_joint1() | Get the first joint connected to a gear joint. |
| b2d.joint.get_joint2() | Get the second joint connected to a gear joint. |
| b2d.joint.get_joint_angle() | Get revolute joint angle. |
| b2d.joint.get_joint_angle() | Get revolute joint angle. |
| b2d.joint.get_joint_speed() | Get joint speed. |
| b2d.joint.get_joint_speed() | Get joint speed. |
| b2d.joint.get_joint_translation() | Get joint translation. |
| b2d.joint.get_joint_translation() | Get joint translation. |
| b2d.joint.get_length() | Get the distance joint length. |
| b2d.joint.get_length() | Get the distance joint length. |
| b2d.joint.get_length_a() | Get pulley segment length A. |
| b2d.joint.get_length_b() | Get pulley segment length B. |
| b2d.joint.get_limit_state() | Get rope limit state. |
| b2d.joint.get_linear_damping_ratio() | Get weld joint linear damping ratio. |
| b2d.joint.get_linear_hertz() | Get weld joint linear frequency. |
| b2d.joint.get_linear_offset() | Get motor joint linear offset. |
| b2d.joint.get_local_anchor_a() | Get the local anchor on body A. |
| b2d.joint.get_local_anchor_a() | Get the local anchor on body A. |
| b2d.joint.get_local_anchor_b() | Get the local anchor on body B. |
| b2d.joint.get_local_anchor_b() | Get the local anchor on body B. |
| b2d.joint.get_local_axis_a() | Get the local axis on body A. |
| b2d.joint.get_lower_limit() | Get the lower joint limit. |
| b2d.joint.get_lower_limit() | Get the lower joint limit. |
| b2d.joint.get_max_force() | Get maximum force. |
| b2d.joint.get_max_force() | Get maximum force. |
| b2d.joint.get_max_length() | Get rope maximum length. |
| b2d.joint.get_max_length() | Get the distance joint maximum length. |
| b2d.joint.get_max_motor_force() | Get maximum motor force. |
| b2d.joint.get_max_motor_force() | Get maximum motor force. |
| b2d.joint.get_max_motor_torque() | Get maximum motor torque. |
| b2d.joint.get_max_motor_torque() | Get maximum motor torque. |
| b2d.joint.get_max_torque() | Get maximum torque. |
| b2d.joint.get_max_torque() | Get maximum torque. |
| b2d.joint.get_min_length() | Get the distance joint minimum length. |
| b2d.joint.get_motor_force() | Get current motor force. |
| b2d.joint.get_motor_force() | Get current motor force. |
| b2d.joint.get_motor_speed() | Get motor speed. |
| b2d.joint.get_motor_speed() | Get motor speed. |
| b2d.joint.get_motor_torque() | Get current motor torque. |
| b2d.joint.get_motor_torque() | Get current motor torque. |
| b2d.joint.get_mouse_target() | Get the target for a mouse joint. |
| b2d.joint.get_mouse_target() | Get the target for a mouse joint. |
| b2d.joint.get_ratio() | Get joint ratio. |
| b2d.joint.get_reaction_force() | Get reaction force. |
| b2d.joint.get_reaction_force() | Get reaction force. |
| b2d.joint.get_reaction_torque() | Get reaction torque. |
| b2d.joint.get_reaction_torque() | Get reaction torque. |
| b2d.joint.get_reference_angle() | Get the reference angle. |
| b2d.joint.get_reference_angle() | Get weld joint reference angle. |
| b2d.joint.get_spring_damping_ratio() | Alias for b2d.joint.get_damping_ratio. |
| b2d.joint.get_spring_damping_ratio() | Get spring damping ratio. |
| b2d.joint.get_spring_hertz() | Get spring frequency. |
| b2d.joint.get_type() | Get the joint type. |
| b2d.joint.get_type() | Get the joint type. |
| b2d.joint.get_upper_limit() | Get the upper joint limit. |
| b2d.joint.get_upper_limit() | Get the upper joint limit. |
| b2d.joint.get_world() | Get the world owning a joint. |
| b2d.joint.is_active() | Get whether the joint is active. |
| b2d.joint.is_limit_enabled() | Get whether joint limits are enabled. |
| b2d.joint.is_limit_enabled() | Get whether joint limits are enabled. |
| b2d.joint.is_motor_enabled() | Get whether the joint motor is enabled. |
| b2d.joint.is_motor_enabled() | Get whether the joint motor is enabled. |
| b2d.joint.is_spring_enabled() | Get whether joint spring behavior is enabled. |
| b2d.joint.is_valid() | Validate a joint handle. |
| b2d.joint.set_angular_damping_ratio() | Set weld joint angular damping ratio. |
| b2d.joint.set_angular_hertz() | Set weld joint angular frequency. |
| b2d.joint.set_angular_offset() | Set motor joint angular offset. |
| b2d.joint.set_collide_connected() | Set whether connected bodies can collide. |
| b2d.joint.set_correction_factor() | Set motor joint correction factor. |
| b2d.joint.set_damping_ratio() | Set spring damping ratio. |
| b2d.joint.set_damping_ratio() | Alias for b2d.joint.set_spring_damping_ratio. |
| b2d.joint.set_frequency() | Set spring frequency. |
| b2d.joint.set_frequency() | Alias for b2d.joint.set_spring_hertz. |
| b2d.joint.set_hertz() | Alias for b2d.joint.set_frequency. |
| b2d.joint.set_hertz() | Alias for b2d.joint.set_spring_hertz. |
| b2d.joint.set_length() | Set the distance joint length. |
| b2d.joint.set_length() | Set the distance joint length. |
| b2d.joint.set_length_range() | Set the distance joint length range. |
| b2d.joint.set_limits() | Set joint limits. |
| b2d.joint.set_limits() | Set joint limits. |
| b2d.joint.set_linear_damping_ratio() | Set weld joint linear damping ratio. |
| b2d.joint.set_linear_hertz() | Set weld joint linear frequency. |
| b2d.joint.set_linear_offset() | Set motor joint linear offset. |
| b2d.joint.set_max_force() | Set maximum force. |
| b2d.joint.set_max_force() | Set maximum force. |
| b2d.joint.set_max_length() | Set rope maximum length. |
| b2d.joint.set_max_length() | Set the distance joint maximum length. |
| b2d.joint.set_max_motor_force() | Set maximum motor force. |
| b2d.joint.set_max_motor_force() | Set maximum motor force. |
| b2d.joint.set_max_motor_torque() | Set maximum motor torque. |
| b2d.joint.set_max_motor_torque() | Set maximum motor torque. |
| b2d.joint.set_max_torque() | Set maximum torque. |
| b2d.joint.set_max_torque() | Set maximum torque. |
| b2d.joint.set_min_length() | Set the distance joint minimum length. |
| b2d.joint.set_motor_speed() | Set motor speed. |
| b2d.joint.set_motor_speed() | Set motor speed. |
| b2d.joint.set_mouse_target() | Set the target for a mouse joint. |
| b2d.joint.set_mouse_target() | Set the target for a mouse joint. |
| b2d.joint.set_ratio() | Set gear joint ratio. |
| b2d.joint.set_reference_angle() | Set weld joint reference angle. |
| b2d.joint.set_spring_damping_ratio() | Alias for b2d.joint.set_damping_ratio. |
| b2d.joint.set_spring_damping_ratio() | Set spring damping ratio. |
| b2d.joint.set_spring_hertz() | Set spring frequency. |
| b2d.joint.wake_bodies() | Wake the bodies connected to a joint. |
b2Joint = userdata
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.
EXAMPLES
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))
b2Joint = userdata
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.
EXAMPLES
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
b2d.joint.JOINT_TYPE: integer
Box2D joint types.
VALUES
b2d.joint.LIMIT_STATE: integer
Box2D joint limit states.
VALUES
b2d.joint.create_distance(body_a:b2Body, body_b:b2Body, [definition:b2d.joint.distance_definition])→joint:b2Joint
Create a distance joint.
PARAMETERS
body_a |
b2Body |
first body |
body_b |
b2Body |
second body |
[definition] |
b2d.joint.distance_definition |
optional joint definition |
RETURNS
joint |
b2Joint |
created joint |
b2d.joint.create_distance(body_a:b2Body, body_b:b2Body, [definition:b2d.joint.distance_definition])→joint:b2Joint
Create a distance joint.
PARAMETERS
body_a |
b2Body |
first body |
body_b |
b2Body |
second body |
[definition] |
b2d.joint.distance_definition |
optional joint definition |
RETURNS
joint |
b2Joint |
created joint |
b2d.joint.create_filter(body_a:b2Body, body_b:b2Body, [definition:b2d.joint.filter_definition])→joint:b2Joint
Create a filter joint.
PARAMETERS
body_a |
b2Body |
first body |
body_b |
b2Body |
second body |
[definition] |
b2d.joint.filter_definition |
optional definition table |
RETURNS
joint |
b2Joint |
created joint |
b2d.joint.create_friction(body_a:b2Body, body_b:b2Body, [definition:b2d.joint.friction_definition])→joint:b2Joint
Create a friction joint.
PARAMETERS
body_a |
b2Body |
first body |
body_b |
b2Body |
second body |
[definition] |
b2d.joint.friction_definition |
optional joint definition |
RETURNS
joint |
b2Joint |
created joint |
b2d.joint.create_gear(joint1:b2Joint, joint2:b2Joint, [definition:b2d.joint.gear_definition])→joint:b2Joint
Create a gear joint.
PARAMETERS
joint1 |
b2Joint |
first revolute or prismatic joint |
joint2 |
b2Joint |
second revolute or prismatic joint |
[definition] |
b2d.joint.gear_definition |
optional joint definition |
RETURNS
joint |
b2Joint |
created joint |
b2d.joint.create_motor(body_a:b2Body, body_b:b2Body, [definition:b2d.joint.motor_definition])→joint:b2Joint
Create a motor joint.
PARAMETERS
body_a |
b2Body |
first body |
body_b |
b2Body |
second body |
[definition] |
b2d.joint.motor_definition |
optional joint definition |
RETURNS
joint |
b2Joint |
created joint |
b2d.joint.create_mouse(body_a:b2Body, body_b:b2Body, [definition:b2d.joint.mouse_definition])→joint:b2Joint
Create a mouse joint.
PARAMETERS
body_a |
b2Body |
first body |
body_b |
b2Body |
second body |
[definition] |
b2d.joint.mouse_definition |
optional joint definition |
RETURNS
joint |
b2Joint |
created joint |
b2d.joint.create_mouse(body_a:b2Body, body_b:b2Body, [definition:b2d.joint.mouse_definition])→joint:b2Joint
Create a mouse joint.
PARAMETERS
body_a |
b2Body |
first body |
body_b |
b2Body |
second body |
[definition] |
b2d.joint.mouse_definition |
optional joint definition |
RETURNS
joint |
b2Joint |
created joint |
b2d.joint.create_prismatic(body_a:b2Body, body_b:b2Body, [definition:b2d.joint.prismatic_definition])→joint:b2Joint
Create a prismatic joint.
PARAMETERS
body_a |
b2Body |
first body |
body_b |
b2Body |
second body |
[definition] |
b2d.joint.prismatic_definition |
optional joint definition |
RETURNS
joint |
b2Joint |
created joint |
b2d.joint.create_prismatic(body_a:b2Body, body_b:b2Body, [definition:b2d.joint.prismatic_definition])→joint:b2Joint
Create a prismatic joint.
PARAMETERS
body_a |
b2Body |
first body |
body_b |
b2Body |
second body |
[definition] |
b2d.joint.prismatic_definition |
optional joint definition |
RETURNS
joint |
b2Joint |
created joint |
b2d.joint.create_pulley(body_a:b2Body, body_b:b2Body, [definition:b2d.joint.pulley_definition])→joint:b2Joint
Create a pulley joint.
PARAMETERS
body_a |
b2Body |
first body |
body_b |
b2Body |
second body |
[definition] |
b2d.joint.pulley_definition |
optional joint definition |
RETURNS
joint |
b2Joint |
created joint |
b2d.joint.create_revolute(body_a:b2Body, body_b:b2Body, [definition:b2d.joint.revolute_definition])→joint:b2Joint
Create a revolute joint.
PARAMETERS
body_a |
b2Body |
first body |
body_b |
b2Body |
second body |
[definition] |
b2d.joint.revolute_definition |
optional joint definition |
RETURNS
joint |
b2Joint |
created joint |
b2d.joint.create_revolute(body_a:b2Body, body_b:b2Body, [definition:b2d.joint.revolute_definition])→joint:b2Joint
Create a revolute joint.
PARAMETERS
body_a |
b2Body |
first body |
body_b |
b2Body |
second body |
[definition] |
b2d.joint.revolute_definition |
optional joint definition |
RETURNS
joint |
b2Joint |
created joint |
b2d.joint.create_rope(body_a:b2Body, body_b:b2Body, [definition:b2d.joint.rope_definition])→joint:b2Joint
Create a rope joint.
PARAMETERS
body_a |
b2Body |
first body |
body_b |
b2Body |
second body |
[definition] |
b2d.joint.rope_definition |
optional joint definition |
RETURNS
joint |
b2Joint |
created joint |
b2d.joint.create_weld(body_a:b2Body, body_b:b2Body, [definition:b2d.joint.weld_definition])→joint:b2Joint
Create a weld joint.
PARAMETERS
body_a |
b2Body |
first body |
body_b |
b2Body |
second body |
[definition] |
b2d.joint.weld_definition |
optional joint definition |
RETURNS
joint |
b2Joint |
created joint |
b2d.joint.create_weld(body_a:b2Body, body_b:b2Body, [definition:b2d.joint.weld_definition])→joint:b2Joint
Create a weld joint.
PARAMETERS
body_a |
b2Body |
first body |
body_b |
b2Body |
second body |
[definition] |
b2d.joint.weld_definition |
optional joint definition |
RETURNS
joint |
b2Joint |
created joint |
b2d.joint.create_wheel(body_a:b2Body, body_b:b2Body, [definition:b2d.joint.wheel_definition])→joint:b2Joint
Create a wheel joint.
PARAMETERS
body_a |
b2Body |
first body |
body_b |
b2Body |
second body |
[definition] |
b2d.joint.wheel_definition |
optional joint definition |
RETURNS
joint |
b2Joint |
created joint |
b2d.joint.create_wheel(body_a:b2Body, body_b:b2Body, [definition:b2d.joint.wheel_definition])→joint:b2Joint
Create a wheel joint.
PARAMETERS
body_a |
b2Body |
first body |
body_b |
b2Body |
second body |
[definition] |
b2d.joint.wheel_definition |
optional joint definition |
RETURNS
joint |
b2Joint |
created joint |
b2d.joint.destroy(joint:b2Joint)
Destroy a joint created by b2d.joint.
PARAMETERS
joint |
b2Joint |
joint |
b2d.joint.destroy(joint:b2Joint)
Destroy a joint created by b2d.joint.
PARAMETERS
joint |
b2Joint |
joint |
b2d.joint.enable_limit(joint:b2Joint, enable:boolean)
Enable or disable joint limits.
PARAMETERS
joint |
b2Joint |
prismatic or revolute joint |
enable |
boolean |
true to enable limits |
b2d.joint.enable_limit(joint:b2Joint, enable:boolean)
Enable or disable joint limits.
PARAMETERS
joint |
b2Joint |
distance, prismatic, revolute, or wheel joint |
enable |
boolean |
true to enable limits |
b2d.joint.enable_motor(joint:b2Joint, enable:boolean)
Enable or disable the joint motor.
PARAMETERS
joint |
b2Joint |
prismatic, revolute, or wheel joint |
enable |
boolean |
true to enable the motor |
b2d.joint.enable_motor(joint:b2Joint, enable:boolean)
Enable or disable the joint motor.
PARAMETERS
joint |
b2Joint |
distance, prismatic, revolute, or wheel joint |
enable |
boolean |
true to enable the motor |
b2d.joint.enable_spring(joint:b2Joint, enable:boolean)
Enable or disable joint spring behavior.
PARAMETERS
joint |
b2Joint |
distance, prismatic, revolute, or wheel joint |
enable |
boolean |
true to enable the spring |
b2d.joint.get_anchor_a(joint:b2Joint)→anchor:vector3
Get the world anchor on body A.
PARAMETERS
joint |
b2Joint |
joint |
RETURNS
anchor |
vector3 |
world anchor |
b2d.joint.get_anchor_a(joint:b2Joint)→anchor:vector3
Get the world anchor on body A.
PARAMETERS
joint |
b2Joint |
joint |
RETURNS
anchor |
vector3 |
world anchor |
b2d.joint.get_anchor_b(joint:b2Joint)→anchor:vector3
Get the world anchor on body B.
PARAMETERS
joint |
b2Joint |
joint |
RETURNS
anchor |
vector3 |
world anchor |
b2d.joint.get_anchor_b(joint:b2Joint)→anchor:vector3
Get the world anchor on body B.
PARAMETERS
joint |
b2Joint |
joint |
RETURNS
anchor |
vector3 |
world anchor |
b2d.joint.get_angular_damping_ratio(joint:b2Joint)→ratio:number
Get weld joint angular damping ratio.
PARAMETERS
joint |
b2Joint |
weld joint |
RETURNS
ratio |
number |
damping ratio |
b2d.joint.get_angular_hertz(joint:b2Joint)→hertz:number
Get weld joint angular frequency.
PARAMETERS
joint |
b2Joint |
weld joint |
RETURNS
hertz |
number |
frequency in hertz |
b2d.joint.get_angular_offset(joint:b2Joint)→offset:number
Get motor joint angular offset.
PARAMETERS
joint |
b2Joint |
motor joint |
RETURNS
offset |
number |
angular offset in radians |
b2d.joint.get_body_a(joint:b2Joint)→body:b2Body
Get the first body connected to a joint.
PARAMETERS
joint |
b2Joint |
joint |
RETURNS
body |
b2Body |
body A |
b2d.joint.get_body_a(joint:b2Joint)→body:b2Body
Get the first body connected to a joint.
PARAMETERS
joint |
b2Joint |
joint |
RETURNS
body |
b2Body |
body A |
b2d.joint.get_body_b(joint:b2Joint)→body:b2Body
Get the second body connected to a joint.
PARAMETERS
joint |
b2Joint |
joint |
RETURNS
body |
b2Body |
body B |
b2d.joint.get_body_b(joint:b2Joint)→body:b2Body
Get the second body connected to a joint.
PARAMETERS
joint |
b2Joint |
joint |
RETURNS
body |
b2Body |
body B |
b2d.joint.get_collide_connected(joint:b2Joint)→collide:boolean
Get whether connected bodies can collide.
PARAMETERS
joint |
b2Joint |
joint |
RETURNS
collide |
boolean |
true if connected bodies can collide |
b2d.joint.get_collide_connected(joint:b2Joint)→collide:boolean
Get whether connected bodies can collide.
PARAMETERS
joint |
b2Joint |
joint |
RETURNS
collide |
boolean |
true if connected bodies can collide |
b2d.joint.get_correction_factor(joint:b2Joint)→factor:number
Get motor joint correction factor.
PARAMETERS
joint |
b2Joint |
motor joint |
RETURNS
factor |
number |
correction factor |
b2d.joint.get_current_length(joint:b2Joint)→length:number
Get the current distance joint length.
PARAMETERS
joint |
b2Joint |
distance joint |
RETURNS
length |
number |
current length in project units |
b2d.joint.get_damping_ratio(joint:b2Joint)→ratio:number
Get spring damping ratio.
PARAMETERS
joint |
b2Joint |
distance, mouse, weld, or wheel joint |
RETURNS
ratio |
number |
damping ratio |
b2d.joint.get_damping_ratio(joint:b2Joint)→ratio:number
Alias for b2d.joint.get_spring_damping_ratio.
PARAMETERS
joint |
b2Joint |
distance, mouse, prismatic, revolute, or wheel joint |
RETURNS
ratio |
number |
damping ratio |
b2d.joint.get_frequency(joint:b2Joint)→frequency:number
Get spring frequency.
PARAMETERS
joint |
b2Joint |
distance, mouse, weld, or wheel joint |
RETURNS
frequency |
number |
frequency in hertz |
b2d.joint.get_frequency(joint:b2Joint)→frequency:number
Alias for b2d.joint.get_spring_hertz.
PARAMETERS
joint |
b2Joint |
distance, mouse, prismatic, revolute, or wheel joint |
RETURNS
frequency |
number |
frequency in hertz |
b2d.joint.get_ground_anchor_a(joint:b2Joint)→anchor:vector3
Get pulley ground anchor A.
PARAMETERS
joint |
b2Joint |
pulley joint |
RETURNS
anchor |
vector3 |
world anchor |
b2d.joint.get_ground_anchor_b(joint:b2Joint)→anchor:vector3
Get pulley ground anchor B.
PARAMETERS
joint |
b2Joint |
pulley joint |
RETURNS
anchor |
vector3 |
world anchor |
b2d.joint.get_hertz(joint:b2Joint)→hertz:number
Alias for b2d.joint.get_frequency.
PARAMETERS
joint |
b2Joint |
distance, mouse, weld, or wheel joint |
RETURNS
hertz |
number |
frequency in hertz |
b2d.joint.get_hertz(joint:b2Joint)→hertz:number
Alias for b2d.joint.get_spring_hertz.
PARAMETERS
joint |
b2Joint |
distance, mouse, prismatic, revolute, or wheel joint |
RETURNS
hertz |
number |
frequency in hertz |
b2d.joint.get_joint1(joint:b2Joint)→joint1:b2Joint
Get the first joint connected to a gear joint.
PARAMETERS
joint |
b2Joint |
gear joint |
RETURNS
joint1 |
b2Joint |
first connected joint |
b2d.joint.get_joint2(joint:b2Joint)→joint2:b2Joint
Get the second joint connected to a gear joint.
PARAMETERS
joint |
b2Joint |
gear joint |
RETURNS
joint2 |
b2Joint |
second connected joint |
b2d.joint.get_joint_angle(joint:b2Joint)→angle:number
Get revolute joint angle.
PARAMETERS
joint |
b2Joint |
revolute joint |
RETURNS
angle |
number |
angle in radians |
b2d.joint.get_joint_angle(joint:b2Joint)→angle:number
Get revolute joint angle.
PARAMETERS
joint |
b2Joint |
revolute joint |
RETURNS
angle |
number |
angle in radians |
b2d.joint.get_joint_speed(joint:b2Joint)→speed:number
Get joint speed.
PARAMETERS
joint |
b2Joint |
prismatic, revolute, or wheel joint |
RETURNS
speed |
number |
joint speed |
b2d.joint.get_joint_speed(joint:b2Joint)→speed:number
Get joint speed.
PARAMETERS
joint |
b2Joint |
prismatic joint |
RETURNS
speed |
number |
joint speed |
b2d.joint.get_joint_translation(joint:b2Joint)→translation:number
Get joint translation.
PARAMETERS
joint |
b2Joint |
prismatic or wheel joint |
RETURNS
translation |
number |
translation in project units |
b2d.joint.get_joint_translation(joint:b2Joint)→translation:number
Get joint translation.
PARAMETERS
joint |
b2Joint |
prismatic joint |
RETURNS
translation |
number |
translation in project units |
b2d.joint.get_length(joint:b2Joint)→length:number
Get the distance joint length.
PARAMETERS
joint |
b2Joint |
distance joint |
RETURNS
length |
number |
length in project units |
b2d.joint.get_length(joint:b2Joint)→length:number
Get the distance joint length.
PARAMETERS
joint |
b2Joint |
distance joint |
RETURNS
length |
number |
length in project units |
b2d.joint.get_length_a(joint:b2Joint)→length:number
Get pulley segment length A.
PARAMETERS
joint |
b2Joint |
pulley joint |
RETURNS
length |
number |
length in project units |
b2d.joint.get_length_b(joint:b2Joint)→length:number
Get pulley segment length B.
PARAMETERS
joint |
b2Joint |
pulley joint |
RETURNS
length |
number |
length in project units |
b2d.joint.get_limit_state(joint:b2Joint)→state:b2d.joint.LIMIT_STATE
Get rope limit state.
PARAMETERS
joint |
b2Joint |
rope joint |
RETURNS
state |
b2d.joint.LIMIT_STATE |
one of the LIMIT_STATE_* constants
|
b2d.joint.get_linear_damping_ratio(joint:b2Joint)→ratio:number
Get weld joint linear damping ratio.
PARAMETERS
joint |
b2Joint |
weld joint |
RETURNS
ratio |
number |
damping ratio |
b2d.joint.get_linear_hertz(joint:b2Joint)→hertz:number
Get weld joint linear frequency.
PARAMETERS
joint |
b2Joint |
weld joint |
RETURNS
hertz |
number |
frequency in hertz |
b2d.joint.get_linear_offset(joint:b2Joint)→offset:vector3
Get motor joint linear offset.
PARAMETERS
joint |
b2Joint |
motor joint |
RETURNS
offset |
vector3 |
linear offset in project units |
b2d.joint.get_local_anchor_a(joint:b2Joint)→anchor:vector3
Get the local anchor on body A.
PARAMETERS
joint |
b2Joint |
joint |
RETURNS
anchor |
vector3 |
local anchor |
b2d.joint.get_local_anchor_a(joint:b2Joint)→anchor:vector3
Get the local anchor on body A.
PARAMETERS
joint |
b2Joint |
joint |
RETURNS
anchor |
vector3 |
local anchor |
b2d.joint.get_local_anchor_b(joint:b2Joint)→anchor:vector3
Get the local anchor on body B.
PARAMETERS
joint |
b2Joint |
joint |
RETURNS
anchor |
vector3 |
local anchor |
b2d.joint.get_local_anchor_b(joint:b2Joint)→anchor:vector3
Get the local anchor on body B.
PARAMETERS
joint |
b2Joint |
joint |
RETURNS
anchor |
vector3 |
local anchor |
b2d.joint.get_local_axis_a(joint:b2Joint)→axis:vector3
Get the local axis on body A.
PARAMETERS
joint |
b2Joint |
prismatic or wheel joint |
RETURNS
axis |
vector3 |
local axis |
b2d.joint.get_lower_limit(joint:b2Joint)→lower:number
Get the lower joint limit.
PARAMETERS
joint |
b2Joint |
prismatic or revolute joint |
RETURNS
lower |
number |
lower limit |
b2d.joint.get_lower_limit(joint:b2Joint)→lower:number
Get the lower joint limit.
PARAMETERS
joint |
b2Joint |
prismatic, revolute, or wheel joint |
RETURNS
lower |
number |
lower limit |
b2d.joint.get_max_force(joint:b2Joint)→force:number
Get maximum force.
PARAMETERS
joint |
b2Joint |
mouse or friction joint |
RETURNS
force |
number |
maximum force |
b2d.joint.get_max_force(joint:b2Joint)→force:number
Get maximum force.
PARAMETERS
joint |
b2Joint |
mouse or motor joint |
RETURNS
force |
number |
maximum force |
b2d.joint.get_max_length(joint:b2Joint)→length:number
Get rope maximum length.
PARAMETERS
joint |
b2Joint |
rope joint |
RETURNS
length |
number |
maximum length in project units |
b2d.joint.get_max_length(joint:b2Joint)→length:number
Get the distance joint maximum length.
PARAMETERS
joint |
b2Joint |
distance joint |
RETURNS
length |
number |
maximum length in project units |
b2d.joint.get_max_motor_force(joint:b2Joint)→force:number
Get maximum motor force.
PARAMETERS
joint |
b2Joint |
prismatic joint |
RETURNS
force |
number |
maximum motor force |
b2d.joint.get_max_motor_force(joint:b2Joint)→force:number
Get maximum motor force.
PARAMETERS
joint |
b2Joint |
distance or prismatic joint |
RETURNS
force |
number |
maximum motor force |
b2d.joint.get_max_motor_torque(joint:b2Joint)→torque:number
Get maximum motor torque.
PARAMETERS
joint |
b2Joint |
revolute or wheel joint |
RETURNS
torque |
number |
maximum motor torque |
b2d.joint.get_max_motor_torque(joint:b2Joint)→torque:number
Get maximum motor torque.
PARAMETERS
joint |
b2Joint |
revolute or wheel joint |
RETURNS
torque |
number |
maximum motor torque |
b2d.joint.get_max_torque(joint:b2Joint)→torque:number
Get maximum torque.
PARAMETERS
joint |
b2Joint |
friction joint |
RETURNS
torque |
number |
maximum torque |
b2d.joint.get_max_torque(joint:b2Joint)→torque:number
Get maximum torque.
PARAMETERS
joint |
b2Joint |
motor joint |
RETURNS
torque |
number |
maximum torque |
b2d.joint.get_min_length(joint:b2Joint)→length:number
Get the distance joint minimum length.
PARAMETERS
joint |
b2Joint |
distance joint |
RETURNS
length |
number |
minimum length in project units |
b2d.joint.get_motor_force(joint:b2Joint, inv_dt:number)→force:number
Get current motor force.
PARAMETERS
joint |
b2Joint |
prismatic joint |
inv_dt |
number |
inverse time step |
RETURNS
force |
number |
motor force |
b2d.joint.get_motor_force(joint:b2Joint)→force:number
Get current motor force.
PARAMETERS
joint |
b2Joint |
distance or prismatic joint |
RETURNS
force |
number |
motor force |
b2d.joint.get_motor_speed(joint:b2Joint)→speed:number
Get motor speed.
PARAMETERS
joint |
b2Joint |
prismatic, revolute, or wheel joint |
RETURNS
speed |
number |
motor speed |
b2d.joint.get_motor_speed(joint:b2Joint)→speed:number
Get motor speed.
PARAMETERS
joint |
b2Joint |
distance, prismatic, revolute, or wheel joint |
RETURNS
speed |
number |
motor speed |
b2d.joint.get_motor_torque(joint:b2Joint, inv_dt:number)→torque:number
Get current motor torque.
PARAMETERS
joint |
b2Joint |
revolute or wheel joint |
inv_dt |
number |
inverse time step |
RETURNS
torque |
number |
motor torque |
b2d.joint.get_motor_torque(joint:b2Joint)→torque:number
Get current motor torque.
PARAMETERS
joint |
b2Joint |
revolute or wheel joint |
RETURNS
torque |
number |
motor torque |
b2d.joint.get_mouse_target(joint:b2Joint)→target:vector3
Get the target for a mouse joint.
PARAMETERS
joint |
b2Joint |
mouse joint |
RETURNS
target |
vector3 |
world target |
b2d.joint.get_mouse_target(joint:b2Joint)→target:vector3
Get the target for a mouse joint.
PARAMETERS
joint |
b2Joint |
mouse joint |
RETURNS
target |
vector3 |
world target |
b2d.joint.get_ratio(joint:b2Joint)→ratio:number
Get joint ratio.
PARAMETERS
joint |
b2Joint |
pulley or gear joint |
RETURNS
ratio |
number |
joint ratio |
b2d.joint.get_reaction_force(joint:b2Joint, inv_dt:number)→force:vector3
Get reaction force.
PARAMETERS
joint |
b2Joint |
joint |
inv_dt |
number |
inverse time step |
RETURNS
force |
vector3 |
reaction force |
b2d.joint.get_reaction_force(joint:b2Joint)→force:vector3
Get reaction force.
PARAMETERS
joint |
b2Joint |
joint |
RETURNS
force |
vector3 |
reaction force |
b2d.joint.get_reaction_torque(joint:b2Joint, inv_dt:number)→torque:number
Get reaction torque.
PARAMETERS
joint |
b2Joint |
joint |
inv_dt |
number |
inverse time step |
RETURNS
torque |
number |
reaction torque |
b2d.joint.get_reaction_torque(joint:b2Joint)→torque:number
Get reaction torque.
PARAMETERS
joint |
b2Joint |
joint |
RETURNS
torque |
number |
reaction torque |
b2d.joint.get_reference_angle(joint:b2Joint)→angle:number
Get the reference angle.
PARAMETERS
joint |
b2Joint |
prismatic, revolute, or weld joint |
RETURNS
angle |
number |
reference angle in radians |
b2d.joint.get_reference_angle(joint:b2Joint)→angle:number
Get weld joint reference angle.
PARAMETERS
joint |
b2Joint |
weld joint |
RETURNS
angle |
number |
reference angle in radians |
b2d.joint.get_spring_damping_ratio(joint:b2Joint)→ratio:number
Alias for b2d.joint.get_damping_ratio.
PARAMETERS
joint |
b2Joint |
distance, mouse, weld, or wheel joint |
RETURNS
ratio |
number |
damping ratio |
b2d.joint.get_spring_damping_ratio(joint:b2Joint)→ratio:number
Get spring damping ratio.
PARAMETERS
joint |
b2Joint |
distance, mouse, prismatic, revolute, or wheel joint |
RETURNS
ratio |
number |
damping ratio |
b2d.joint.get_spring_hertz(joint:b2Joint)→hertz:number
Get spring frequency.
PARAMETERS
joint |
b2Joint |
distance, mouse, prismatic, revolute, or wheel joint |
RETURNS
hertz |
number |
frequency in hertz |
b2d.joint.get_type(joint:b2Joint)→type:b2d.joint.JOINT_TYPE
Get the joint type.
PARAMETERS
joint |
b2Joint |
joint |
RETURNS
type |
b2d.joint.JOINT_TYPE |
one of the JOINT_TYPE_* constants
|
b2d.joint.get_type(joint:b2Joint)→type:b2d.joint.JOINT_TYPE
Get the joint type.
PARAMETERS
joint |
b2Joint |
joint |
RETURNS
type |
b2d.joint.JOINT_TYPE |
one of the JOINT_TYPE_* constants
|
b2d.joint.get_upper_limit(joint:b2Joint)→upper:number
Get the upper joint limit.
PARAMETERS
joint |
b2Joint |
prismatic or revolute joint |
RETURNS
upper |
number |
upper limit |
b2d.joint.get_upper_limit(joint:b2Joint)→upper:number
Get the upper joint limit.
PARAMETERS
joint |
b2Joint |
prismatic, revolute, or wheel joint |
RETURNS
upper |
number |
upper limit |
b2d.joint.get_world(joint:b2Joint)→world:b2World
Get the world owning a joint.
PARAMETERS
joint |
b2Joint |
joint |
RETURNS
world |
b2World |
owning world |
b2d.joint.is_active(joint:b2Joint)→active:boolean
Get whether the joint is active.
PARAMETERS
joint |
b2Joint |
joint |
RETURNS
active |
boolean |
true if the joint is active |
b2d.joint.is_limit_enabled(joint:b2Joint)→enabled:boolean
Get whether joint limits are enabled.
PARAMETERS
joint |
b2Joint |
prismatic or revolute joint |
RETURNS
enabled |
boolean |
true if limits are enabled |
b2d.joint.is_limit_enabled(joint:b2Joint)→enabled:boolean
Get whether joint limits are enabled.
PARAMETERS
joint |
b2Joint |
distance, prismatic, revolute, or wheel joint |
RETURNS
enabled |
boolean |
true if limits are enabled |
b2d.joint.is_motor_enabled(joint:b2Joint)→enabled:boolean
Get whether the joint motor is enabled.
PARAMETERS
joint |
b2Joint |
prismatic, revolute, or wheel joint |
RETURNS
enabled |
boolean |
true if the motor is enabled |
b2d.joint.is_motor_enabled(joint:b2Joint)→enabled:boolean
Get whether the joint motor is enabled.
PARAMETERS
joint |
b2Joint |
distance, prismatic, revolute, or wheel joint |
RETURNS
enabled |
boolean |
true if the motor is enabled |
b2d.joint.is_spring_enabled(joint:b2Joint)→enabled:boolean
Get whether joint spring behavior is enabled.
PARAMETERS
joint |
b2Joint |
distance, prismatic, revolute, or wheel joint |
RETURNS
enabled |
boolean |
true if the spring is enabled |
b2d.joint.is_valid(joint:b2Joint)→valid:boolean
Validate a joint handle.
PARAMETERS
joint |
b2Joint |
joint |
RETURNS
valid |
boolean |
true if the joint handle still refers to a live Box2D joint |
b2d.joint.set_angular_damping_ratio(joint:b2Joint, ratio:number)
Set weld joint angular damping ratio.
PARAMETERS
joint |
b2Joint |
weld joint |
ratio |
number |
damping ratio |
b2d.joint.set_angular_hertz(joint:b2Joint, hertz:number)
Set weld joint angular frequency.
PARAMETERS
joint |
b2Joint |
weld joint |
hertz |
number |
frequency in hertz |
b2d.joint.set_angular_offset(joint:b2Joint, offset:number)
Set motor joint angular offset.
PARAMETERS
joint |
b2Joint |
motor joint |
offset |
number |
angular offset in radians |
b2d.joint.set_collide_connected(joint:b2Joint, collide:boolean)
Set whether connected bodies can collide.
PARAMETERS
joint |
b2Joint |
joint |
collide |
boolean |
true if connected bodies can collide |
b2d.joint.set_correction_factor(joint:b2Joint, factor:number)
Set motor joint correction factor.
PARAMETERS
joint |
b2Joint |
motor joint |
factor |
number |
correction factor |
b2d.joint.set_damping_ratio(joint:b2Joint, ratio:number)
Set spring damping ratio.
PARAMETERS
joint |
b2Joint |
distance, mouse, weld, or wheel joint |
ratio |
number |
damping ratio |
b2d.joint.set_damping_ratio(joint:b2Joint, ratio:number)
Alias for b2d.joint.set_spring_damping_ratio.
PARAMETERS
joint |
b2Joint |
distance, mouse, prismatic, revolute, or wheel joint |
ratio |
number |
damping ratio |
b2d.joint.set_frequency(joint:b2Joint, frequency:number)
Set spring frequency.
PARAMETERS
joint |
b2Joint |
distance, mouse, weld, or wheel joint |
frequency |
number |
frequency in hertz |
b2d.joint.set_frequency(joint:b2Joint, frequency:number)
Alias for b2d.joint.set_spring_hertz.
PARAMETERS
joint |
b2Joint |
distance, mouse, prismatic, revolute, or wheel joint |
frequency |
number |
frequency in hertz |
b2d.joint.set_hertz(joint:b2Joint, hertz:number)
Alias for b2d.joint.set_frequency.
PARAMETERS
joint |
b2Joint |
distance, mouse, weld, or wheel joint |
hertz |
number |
frequency in hertz |
b2d.joint.set_hertz(joint:b2Joint, hertz:number)
Alias for b2d.joint.set_spring_hertz.
PARAMETERS
joint |
b2Joint |
distance, mouse, prismatic, revolute, or wheel joint |
hertz |
number |
frequency in hertz |
b2d.joint.set_length(joint:b2Joint, length:number)
Set the distance joint length.
PARAMETERS
joint |
b2Joint |
distance joint |
length |
number |
length in project units |
b2d.joint.set_length(joint:b2Joint, length:number)
Set the distance joint length.
PARAMETERS
joint |
b2Joint |
distance joint |
length |
number |
length in project units |
b2d.joint.set_length_range(joint:b2Joint, min_length:number, max_length:number)
Set the distance joint length range.
PARAMETERS
joint |
b2Joint |
distance joint |
min_length |
number |
minimum length in project units |
max_length |
number |
maximum length in project units |
b2d.joint.set_limits(joint:b2Joint, lower:number, upper:number)
Set joint limits.
PARAMETERS
joint |
b2Joint |
prismatic or revolute joint |
lower |
number |
lower limit |
upper |
number |
upper limit |
b2d.joint.set_limits(joint:b2Joint, lower:number, upper:number)
Set joint limits.
PARAMETERS
joint |
b2Joint |
prismatic, revolute, or wheel joint |
lower |
number |
lower limit |
upper |
number |
upper limit |
b2d.joint.set_linear_damping_ratio(joint:b2Joint, ratio:number)
Set weld joint linear damping ratio.
PARAMETERS
joint |
b2Joint |
weld joint |
ratio |
number |
damping ratio |
b2d.joint.set_linear_hertz(joint:b2Joint, hertz:number)
Set weld joint linear frequency.
PARAMETERS
joint |
b2Joint |
weld joint |
hertz |
number |
frequency in hertz |
b2d.joint.set_linear_offset(joint:b2Joint, offset:vector3)
Set motor joint linear offset.
PARAMETERS
joint |
b2Joint |
motor joint |
offset |
vector3 |
linear offset in project units |
b2d.joint.set_max_force(joint:b2Joint, force:number)
Set maximum force.
PARAMETERS
joint |
b2Joint |
mouse or friction joint |
force |
number |
maximum force |
b2d.joint.set_max_force(joint:b2Joint, force:number)
Set maximum force.
PARAMETERS
joint |
b2Joint |
mouse or motor joint |
force |
number |
maximum force |
b2d.joint.set_max_length(joint:b2Joint, length:number)
Set rope maximum length.
PARAMETERS
joint |
b2Joint |
rope joint |
length |
number |
maximum length in project units |
b2d.joint.set_max_length(joint:b2Joint, length:number)
Set the distance joint maximum length.
PARAMETERS
joint |
b2Joint |
distance joint |
length |
number |
maximum length in project units |
b2d.joint.set_max_motor_force(joint:b2Joint, force:number)
Set maximum motor force.
PARAMETERS
joint |
b2Joint |
prismatic joint |
force |
number |
maximum motor force |
b2d.joint.set_max_motor_force(joint:b2Joint, force:number)
Set maximum motor force.
PARAMETERS
joint |
b2Joint |
distance or prismatic joint |
force |
number |
maximum motor force |
b2d.joint.set_max_motor_torque(joint:b2Joint, torque:number)
Set maximum motor torque.
PARAMETERS
joint |
b2Joint |
revolute or wheel joint |
torque |
number |
maximum motor torque |
b2d.joint.set_max_motor_torque(joint:b2Joint, torque:number)
Set maximum motor torque.
PARAMETERS
joint |
b2Joint |
revolute or wheel joint |
torque |
number |
maximum motor torque |
b2d.joint.set_max_torque(joint:b2Joint, torque:number)
Set maximum torque.
PARAMETERS
joint |
b2Joint |
friction joint |
torque |
number |
maximum torque |
b2d.joint.set_max_torque(joint:b2Joint, torque:number)
Set maximum torque.
PARAMETERS
joint |
b2Joint |
motor joint |
torque |
number |
maximum torque |
b2d.joint.set_min_length(joint:b2Joint, length:number)
Set the distance joint minimum length.
PARAMETERS
joint |
b2Joint |
distance joint |
length |
number |
minimum length in project units |
b2d.joint.set_motor_speed(joint:b2Joint, speed:number)
Set motor speed.
PARAMETERS
joint |
b2Joint |
prismatic, revolute, or wheel joint |
speed |
number |
motor speed |
b2d.joint.set_motor_speed(joint:b2Joint, speed:number)
Set motor speed.
PARAMETERS
joint |
b2Joint |
distance, prismatic, revolute, or wheel joint |
speed |
number |
motor speed |
b2d.joint.set_mouse_target(joint:b2Joint, target:vector3)
Set the target for a mouse joint.
PARAMETERS
joint |
b2Joint |
mouse joint |
target |
vector3 |
world target |
b2d.joint.set_mouse_target(joint:b2Joint, target:vector3)
Set the target for a mouse joint.
PARAMETERS
joint |
b2Joint |
mouse joint |
target |
vector3 |
world target |
b2d.joint.set_ratio(joint:b2Joint, ratio:number)
Set gear joint ratio.
PARAMETERS
joint |
b2Joint |
gear joint |
ratio |
number |
gear ratio |
b2d.joint.set_reference_angle(joint:b2Joint, angle:number)
Set weld joint reference angle.
PARAMETERS
joint |
b2Joint |
weld joint |
angle |
number |
reference angle in radians |
b2d.joint.set_spring_damping_ratio(joint:b2Joint, ratio:number)
Alias for b2d.joint.set_damping_ratio.
PARAMETERS
joint |
b2Joint |
distance, mouse, weld, or wheel joint |
ratio |
number |
damping ratio |
b2d.joint.set_spring_damping_ratio(joint:b2Joint, ratio:number)
Set spring damping ratio.
PARAMETERS
joint |
b2Joint |
distance, mouse, prismatic, revolute, or wheel joint |
ratio |
number |
damping ratio |
b2d.joint.set_spring_hertz(joint:b2Joint, hertz:number)
Set spring frequency.
PARAMETERS
joint |
b2Joint |
distance, mouse, prismatic, revolute, or wheel joint |
hertz |
number |
frequency in hertz |
b2d.joint.wake_bodies(joint:b2Joint)
Wake the bodies connected to a joint.
PARAMETERS
joint |
b2Joint |
joint |