Skip to main content

FixedJoint

A fixed joint keeps 2 objects together, and tries to prevent relative movement or rotation between them. Since it just does this with forces, there will still be movement between the two objects, and their connection will be wobbly. This is intentional; if you want 0 movement, you should instead use the Bolt joint.

Fields


.id

Identifier for the fixed joint. Is a number.

Functions

note

Make sure to use :function() and not .function(), or you'll get an error


:destroy()

Destroys the fixed joint.


:is_destroyed()

Returns whether or not the fixed joint still exists.


:get_local_anchor_a()

Gets the anchor of the fixed joint on the first object as a Vec2.


:get_local_anchor_b()

Gets the anchor of the fixed joint on the second object as a Vec2.


:set_local_anchor_a()

Moves the anchor of the fixed joint on the first object to a Vec2. Note that this currently only works if the object_a is nil.


:set_local_anchor_b()

Moves the anchor of the fixed joint on the second object to a Vec2. Note that this currently only works if the object_a is nil.


:get_world_anchor_a()

Gets where the first anchor of the fixed joint is in the world as a Vec2.


:get_world_anchor_b()

Gets where the second anchor of the fixed joint is in the world as a Vec2.


:get_object_a()

Gets the first object the fixed joint is attached to. Can be nil if the fixed joint is connected to the world on that end.


:get_object_b()

Gets the second object the fixed joint is attached to. Can be nil if the fixed joint is connected to the world on that end.


:get_collide_connected()

Gets whether or not the object A will collide with object B


:get_angular_damping()

Get the angular damping


:get_linear_damping()

Get the linear damping


:get_angular_frequency()

Get the angular hertz


:get_linear_frequency()

Get the linear hertz


:get_force()

Get the force


:get_attachment()

Returns the attachment of the fixed joint as a Attachment. Can be nil.


:get_type()

Returns "fixed_joint". Mainly used after object:get_joints() to determine what type of joint it is.