Nocare3/love2dapi_chunks huggingface dataset:
ChainShape:setPreviousVertex
Sets a vertex that establishes a connection to the previous shape.

This can help prevent unwanted collisions when a flat shape slides along the edge and moves over to the new shape.
ChainShape:setPreviousVertex( x, y )
x number The x-component of the vertex.
y number The y-component of the vertex.
CircleShape:getPoint
Gets the center point of the circle shape.
x, y = CircleShape:getPoint()
x number The x-component of the center point of the circle.
y number The y-component of the center point of the circle.
CircleShape:getRadius
Gets the radius of the circle shape.
radius = CircleShape:getRadius()
radius number The radius of the circle
CircleShape:setPoint
Sets the location of the center of the circle shape.
CircleShape:setPoint( x, y )
x number The x-component of the new center point of the circle.
y number The y-component of the new center point of the circle.
CircleShape:setRadius
Sets the radius of the circle.
CircleShape:setRadius( radius )
radius number The radius of the circle
Contact:getChildren
Gets the child indices of the shapes of the two colliding fixtures. For ChainShapes, an index of 1 is the first edge in the chain. Used together with Fixture:rayCast or ChainShape:getChildEdge.
indexA, indexB = Contact:getChildren()
indexA number The child index of the first fixture's shape.
indexB number The child index of the second fixture's shape.
Contact:getFixtures
Gets the two Fixtures that hold the shapes that are in contact.
fixtureA, fixtureB = Contact:getFixtures()
fixtureA Fixture The first Fixture.
fixtureB Fixture The second Fixture.
Contact:getFriction
Get the friction between two shapes that are in contact.
friction = Contact:getFriction()
friction number The friction of the contact.
Contact:getNormal
Get the normal vector between two shapes that are in contact.

This function returns the coordinates of a unit vector that points from the first shape to the second.
nx, ny = Contact:getNormal()
nx number The x component of the normal vector.
ny number The y component of the normal vector.
Contact:getPositions
Returns the contact points of the two colliding fixtures. There can be one or two points.
x1, y1, x2, y2 = Contact:getPositions()
x1 number The x coordinate of the first contact point.
y1 number The y coordinate of the first contact point.
x2 number The x coordinate of the second contact point.
y2 number The y coordinate of the second contact point.
Contact:getRestitution
Get the restitution between two shapes that are in contact.
restitution = Contact:getRestitution()
restitution number The restitution between the two shapes.
Contact:isEnabled
Returns whether the contact is enabled. The collision will be ignored if a contact gets disabled in the preSolve callback.
enabled = Contact:isEnabled()
enabled boolean True if enabled, false otherwise.
Contact:isTouching
Returns whether the two colliding fixtures are touching each other.
touching = Contact:isTouching()
touching boolean True if they touch or false if not.
Contact:resetFriction
Resets the contact friction to the mixture value of both fixtures.
Contact:resetFriction()
Contact:resetRestitution
Resets the contact restitution to the mixture value of both fixtures.
Contact:resetRestitution()
Contact:setEnabled
Enables or disables the contact.
Contact:setEnabled( enabled )
enabled boolean True to enable or false to disable.
Contact:setFriction
Sets the contact friction.
Contact:setFriction( friction )
friction number The contact friction.
Contact:setRestitution
Sets the contact restitution.
Contact:setRestitution( restitution )
restitution number The contact restitution.
DistanceJoint:getDampingRatio
Gets the damping ratio.
ratio = DistanceJoint:getDampingRatio()
ratio number The damping ratio.
DistanceJoint:getFrequency
Gets the response speed.
Hz = DistanceJoint:getFrequency()
Hz number The response speed.
DistanceJoint:getLength
Gets the equilibrium distance between the two Bodies.
l = DistanceJoint:getLength()
l number The length between the two Bodies.
DistanceJoint:setDampingRatio
Sets the damping ratio.
DistanceJoint:setDampingRatio( ratio )
ratio number The damping ratio.
DistanceJoint:setFrequency
Sets the response speed.
DistanceJoint:setFrequency( Hz )
Hz number The response speed.
DistanceJoint:setLength
Sets the equilibrium distance between the two Bodies.
DistanceJoint:setLength( l )
l number The length between the two Bodies.
EdgeShape:getNextVertex
Gets the vertex that establishes a connection to the next shape.

Setting next and previous EdgeShape vertices can help prevent unwanted collisions when a flat shape slides along the edge and moves over to the new shape.
x, y = EdgeShape:getNextVertex()
x number The x-component of the vertex, or nil if EdgeShape:setNextVertex hasn't been called.
y number The y-component of the vertex, or nil if EdgeShape:setNextVertex hasn't been called.
EdgeShape:getPoints
Returns the local coordinates of the edge points.
x1, y1, x2, y2 = EdgeShape:getPoints()
x1 number The x-component of the first vertex.
y1 number The y-component of the first vertex.
x2 number The x-component of the second vertex.
y2 number The y-component of the second vertex.
EdgeShape:getPreviousVertex
Gets the vertex that establishes a connection to the previous shape.

Setting next and previous EdgeShape vertices can help prevent unwanted collisions when a flat shape slides along the edge and moves over to the new shape.
x, y = EdgeShape:getPreviousVertex()
x number The x-component of the vertex, or nil if EdgeShape:setPreviousVertex hasn't been called.
y number The y-component of the vertex, or nil if EdgeShape:setPreviousVertex hasn't been called.
EdgeShape:setNextVertex
Sets a vertex that establishes a connection to the next shape.

This can help prevent unwanted collisions when a flat shape slides along the edge and moves over to the new shape.
EdgeShape:setNextVertex( x, y )
x number The x-component of the vertex.
y number The y-component of the vertex.
EdgeShape:setPreviousVertex
Sets a vertex that establishes a connection to the previous shape.

This can help prevent unwanted collisions when a flat shape slides along the edge and moves over to the new shape.
EdgeShape:setPreviousVertex( x, y )
x number The x-component of the vertex.
y number The y-component of the vertex.
Fixture:getBody
Returns the body to which the fixture is attached.
body = Fixture:getBody()
body Body The parent body.
Fixture:getBoundingBox
Returns the points of the fixture bounding box. In case the fixture has multiple children a 1-based index can be specified. For example, a fixture will have multiple children with a chain shape.
topLeftX, topLeftY, bottomRightX, bottomRightY = Fixture:getBoundingBox( index )
index (1) number A bounding box of the fixture.
topLeftX number The x position of the top-left point.
topLeftY number The y position of the top-left point.
bottomRightX number The x position of the bottom-right point.
bottomRightY number The y position of the bottom-right point.
Fixture:getCategory
Returns the categories the fixture belongs to.
... = Fixture:getCategory()
... number The categories.
Fixture:getDensity
Returns the density of the fixture.
density = Fixture:getDensity()
density number The fixture density in kilograms per square meter.
Fixture:getFilterData
Returns the filter data of the fixture.

Categories and masks are encoded as the bits of a 16-bit integer.
categories, mask, group = Fixture:getFilterData()
categories number The categories as an integer from 0 to 65535.
mask number The mask as an integer from 0 to 65535.
group number The group as an integer from -32768 to 32767.
Fixture:getFriction
Returns the friction of the fixture.
friction = Fixture:getFriction()
friction number The fixture friction.
Fixture:getGroupIndex
Returns the group the fixture belongs to. Fixtures with the same group will always collide if the group is positive or never collide if it's negative. The group zero means no group.

The groups range from -32768 to 32767.
group = Fixture:getGroupIndex()
group number The group of the fixture.
Fixture:getMask
Returns which categories this fixture should '''NOT''' collide with.
... = Fixture:getMask()
... number The masks.
Fixture:getMassData
Returns the mass, its center and the rotational inertia.
x, y, mass, inertia = Fixture:getMassData()
x number The x position of the center of mass.
y number The y position of the center of mass.
mass number The mass of the fixture.
inertia number The rotational inertia.
Fixture:getRestitution
Returns the restitution of the fixture.
restitution = Fixture:getRestitution()
restitution number The fixture restitution.
Fixture:getShape
Returns the shape of the fixture. This shape is a reference to the actual data used in the simulation. It's possible to change its values between timesteps.
shape = Fixture:getShape()
shape Shape The fixture's shape.
Fixture:getUserData
Returns the Lua value associated with this fixture.
value = Fixture:getUserData()
value any The Lua value associated with the fixture.
Fixture:isDestroyed
Gets whether the Fixture is destroyed. Destroyed fixtures cannot be used.
destroyed = Fixture:isDestroyed()
destroyed boolean Whether the Fixture is destroyed.
Fixture:isSensor
Returns whether the fixture is a sensor.
sensor = Fixture:isSensor()
sensor boolean If the fixture is a sensor.
Fixture:rayCast
Casts a ray against the shape of the fixture and returns the surface normal vector and the line position where the ray hit. If the ray missed the shape, nil will be returned.

The ray starts on the first point of the input line and goes towards the second point of the line. The fifth argument is the maximum distance the ray is going to travel as a scale factor of the input line length.

The childIndex parameter is used to specify which child of a parent shape, such as a ChainShape, will be ray casted. For ChainShapes, the index of 1 is the first edge on the chain. Ray casting a parent shape will only test the child specified so if you want to test every shape of the parent, you must loop through all of its children.

The world position of the impact can be calculated by multiplying the line vector with the third return value and adding it to the line starting point.

hitx, hity = x1 + (x2 - x1) * fraction, y1 + (y2 - y1) * fraction
xn, yn, fraction = Fixture:rayCast( x1, y1, x2, y2, maxFraction, childIndex )
x1 number The x position of the input line starting point.
y1 number The y position of the input line starting point.
x2 number The x position of the input line end point.
y2 number The y position of the input line end point.
maxFraction number Ray length parameter.
childIndex (1) number The index of the child the ray gets cast against.
xn number The x component of the normal vector of the edge where the ray hit the shape.
yn number The y component of the normal vector of the edge where the ray hit the shape.
fraction number The position on the input line where the intersection happened as a factor of the line length.
Fixture:setCategory
Sets the categories the fixture belongs to. There can be up to 16 categories represented as a number from 1 to 16.

All fixture's default category is 1.
Fixture:setCategory( ... )
... number The categories.
Fixture:setDensity
Sets the density of the fixture. Call Body:resetMassData if this needs to take effect immediately.
Fixture:setDensity( density )
density number The fixture density in kilograms per square meter.
Fixture:setFilterData
Sets the filter data of the fixture.

Groups, categories, and mask can be used to define the collision behaviour of the fixture.

If two fixtures are in the same group they either always collide if the group is positive, or never collide if it's negative. If the group is zero or they do not match, then the contact filter checks if the fixtures select a category of the other fixture with their masks. The fixtures do not collide if that's not the case. If they do have each other's categories selected, the return value of the custom contact filter will be used. They always collide if none was set.

There can be up to 16 categories. Categories and masks are encoded as the bits of a 16-bit integer.

When created, prior to calling this function, all fixtures have category set to 1, mask set to 65535 (all categories) and group set to 0.

This function allows setting all filter data for a fixture at once. To set only the categories, the mask or the group, you can use Fixture:setCategory, Fixture:setMask or Fixture:setGroupIndex respectively.
Fixture:setFilterData( categories, mask, group )
categories number The categories as an integer from 0 to 65535.
mask number The mask as an integer from 0 to 65535.
group number The group as an integer from -32768 to 32767.
Fixture:setFriction
Sets the friction of the fixture.

Friction determines how shapes react when they 'slide' along other shapes. Low friction indicates a slippery surface, like ice, while high friction indicates a rough surface, like concrete. Range: 0.0 - 1.0.
Fixture:setFriction( friction )
friction number The fixture friction.
Fixture:setGroupIndex
Sets the group the fixture belongs to. Fixtures with the same group will always collide if the group is positive or never collide if it's negative. The group zero means no group.

The groups range from -32768 to 32767.
Fixture:setGroupIndex( group )
group number The group as an integer from -32768 to 32767.
Fixture:setMask
Sets the category mask of the fixture. There can be up to 16 categories represented as a number from 1 to 16.

This fixture will '''NOT''' collide with the fixtures that are in the selected categories if the other fixture also has a category of this fixture selected.
Fixture:setMask( ... )
... number The masks.
Fixture:setRestitution
Sets the restitution of the fixture.
Fixture:setRestitution( restitution )
restitution number The fixture restitution.
Fixture:setSensor
Sets whether the fixture should act as a sensor.

Sensors do not cause collision responses, but the begin-contact and end-contact World callbacks will still be called for this fixture.
Fixture:setSensor( sensor )
sensor boolean The sensor status.
Fixture:setUserData
Associates a Lua value with the fixture.

To delete the reference, explicitly pass nil.
Fixture:setUserData( value )
value any The Lua value to associate with the fixture.
Fixture:testPoint
Checks if a point is inside the shape of the fixture.
isInside = Fixture:testPoint( x, y )
x number The x position of the point.
y number The y position of the point.
isInside boolean True if the point is inside or false if it is outside.
FrictionJoint:getMaxForce
Gets the maximum friction force in Newtons.
force = FrictionJoint:getMaxForce()
force number Maximum force in Newtons.
FrictionJoint:getMaxTorque
Gets the maximum friction torque in Newton-meters.
torque = FrictionJoint:getMaxTorque()
torque number Maximum torque in Newton-meters.
FrictionJoint:setMaxForce
Sets the maximum friction force in Newtons.
FrictionJoint:setMaxForce( maxForce )
maxForce number Max force in Newtons.
FrictionJoint:setMaxTorque
Sets the maximum friction torque in Newton-meters.
FrictionJoint:setMaxTorque( torque )
torque number Maximum torque in Newton-meters.
GearJoint:getJoints
Get the Joints connected by this GearJoint.
joint1, joint2 = GearJoint:getJoints()
joint1 Joint The first connected Joint.
joint2 Joint The second connected Joint.
GearJoint:getRatio
Get the ratio of a gear joint.
ratio = GearJoint:getRatio()
ratio number The ratio of the joint.
GearJoint:setRatio
Set the ratio of a gear joint.
GearJoint:setRatio( ratio )
ratio number The new ratio of the joint.
Joint:destroy
Explicitly destroys the Joint. An error will occur if you attempt to use the object after calling this function.

In 0.7.2, when you don't have time to wait for garbage collection, this function

may be used to free the object immediately.
Joint:destroy()
Joint:getAnchors
Get the anchor points of the joint.
x1, y1, x2, y2 = Joint:getAnchors()
x1 number The x-component of the anchor on Body 1.
y1 number The y-component of the anchor on Body 1.
x2 number The x-component of the anchor on Body 2.
y2 number The y-component of the anchor on Body 2.
Joint:getBodies
Gets the bodies that the Joint is attached to.
bodyA, bodyB = Joint:getBodies()
bodyA Body The first Body.
bodyB Body The second Body.
Joint:getCollideConnected
Gets whether the connected Bodies collide.
c = Joint:getCollideConnected()
c boolean True if they collide, false otherwise.
Joint:getReactionForce
Returns the reaction force in newtons on the second body
x, y = Joint:getReactionForce( x )
x number How long the force applies. Usually the inverse time step or 1/dt.
x number The x-component of the force.
y number The y-component of the force.
Joint:getReactionTorque
Returns the reaction torque on the second body.
torque = Joint:getReactionTorque( invdt )
invdt number How long the force applies. Usually the inverse time step or 1/dt.
torque number The reaction torque on the second body.
Joint:getType
Gets a string representing the type.
type = Joint:getType()
type JointType A string with the name of the Joint type.
Joint:getUserData
Returns the Lua value associated with this Joint.
value = Joint:getUserData()
value any The Lua value associated with the Joint.
Joint:isDestroyed
Gets whether the Joint is destroyed. Destroyed joints cannot be used.
destroyed = Joint:isDestroyed()
destroyed boolean Whether the Joint is destroyed.
Joint:setUserData
Associates a Lua value with the Joint.

To delete the reference, explicitly pass nil.
Joint:setUserData( value )
value any The Lua value to associate with the Joint.
MotorJoint:getAngularOffset
Gets the target angular offset between the two Bodies the Joint is attached to.
angleoffset = MotorJoint:getAngularOffset()
angleoffset number The target angular offset in radians: the second body's angle minus the first body's angle.
MotorJoint:getLinearOffset
Gets the target linear offset between the two Bodies the Joint is attached to.
x, y = MotorJoint:getLinearOffset()
x number The x component of the target linear offset, relative to the first Body.
y number The y component of the target linear offset, relative to the first Body.
MotorJoint:setAngularOffset
Sets the target angluar offset between the two Bodies the Joint is attached to.
MotorJoint:setAngularOffset( angleoffset )
angleoffset number The target angular offset in radians: the second body's angle minus the first body's angle.
MotorJoint:setLinearOffset
Sets the target linear offset between the two Bodies the Joint is attached to.
MotorJoint:setLinearOffset( x, y )
x number The x component of the target linear offset, relative to the first Body.
y number The y component of the target linear offset, relative to the first Body.
MouseJoint:getDampingRatio
Returns the damping ratio.
ratio = MouseJoint:getDampingRatio()
ratio number The new damping ratio.
MouseJoint:getFrequency
Returns the frequency.
freq = MouseJoint:getFrequency()
freq number The frequency in hertz.
MouseJoint:getMaxForce
Gets the highest allowed force.
f = MouseJoint:getMaxForce()
f number The max allowed force.
MouseJoint:getTarget
Gets the target point.
x, y = MouseJoint:getTarget()
x number The x-component of the target.
y number The x-component of the target.
MouseJoint:setDampingRatio
Sets a new damping ratio.
MouseJoint:setDampingRatio( ratio )
ratio number The new damping ratio.
MouseJoint:setFrequency
Sets a new frequency.
MouseJoint:setFrequency( freq )
freq number The new frequency in hertz.
MouseJoint:setMaxForce
Sets the highest allowed force.
MouseJoint:setMaxForce( f )
f number The max allowed force.
MouseJoint:setTarget
Sets the target point.
MouseJoint:setTarget( x, y )
x number The x-component of the target.
y number The y-component of the target.
PolygonShape:getPoints
Get the local coordinates of the polygon's vertices.

This function has a variable number of return values. It can be used in a nested fashion with love.graphics.polygon.
x1, y1, x2, y2 = PolygonShape:getPoints()
x1 number The x-component of the first vertex.
y1 number The y-component of the first vertex.
x2 number The x-component of the second vertex.
y2 number The y-component of the second vertex.
PrismaticJoint:areLimitsEnabled
Checks whether the limits are enabled.
enabled = PrismaticJoint:areLimitsEnabled()
enabled boolean True if enabled, false otherwise.
PrismaticJoint:getAxis
Gets the world-space axis vector of the Prismatic Joint.
x, y = PrismaticJoint:getAxis()
x number The x-axis coordinate of the world-space axis vector.
y number The y-axis coordinate of the world-space axis vector.
PrismaticJoint:getJointSpeed
Get the current joint angle speed.
s = PrismaticJoint:getJointSpeed()
s number Joint angle speed in meters/second.
PrismaticJoint:getJointTranslation
Get the current joint translation.
t = PrismaticJoint:getJointTranslation()
t number Joint translation, usually in meters..
PrismaticJoint:getLimits
Gets the joint limits.
lower, upper = PrismaticJoint:getLimits()
lower number The lower limit, usually in meters.
upper number The upper limit, usually in meters.
PrismaticJoint:getLowerLimit
Gets the lower limit.
lower = PrismaticJoint:getLowerLimit()
lower number The lower limit, usually in meters.
PrismaticJoint:getMaxMotorForce
Gets the maximum motor force.
f = PrismaticJoint:getMaxMotorForce()
f number The maximum motor force, usually in N.
PrismaticJoint:getMotorForce
Returns the current motor force.
force = PrismaticJoint:getMotorForce( invdt )
invdt number How long the force applies. Usually the inverse time step or 1/dt.
force number The force on the motor in newtons.
PrismaticJoint:getMotorSpeed
Gets the motor speed.
s = PrismaticJoint:getMotorSpeed()
s number The motor speed, usually in meters per second.
PrismaticJoint:getReferenceAngle
Gets the reference angle.
angle = PrismaticJoint:getReferenceAngle()
angle number The reference angle in radians.
PrismaticJoint:getUpperLimit
Gets the upper limit.
upper = PrismaticJoint:getUpperLimit()
upper number The upper limit, usually in meters.
PrismaticJoint:isMotorEnabled
Checks whether the motor is enabled.
enabled = PrismaticJoint:isMotorEnabled()
enabled boolean True if enabled, false if disabled.
PrismaticJoint:setLimits
Sets the limits.
PrismaticJoint:setLimits( lower, upper )
lower number The lower limit, usually in meters.
upper number The upper limit, usually in meters.
PrismaticJoint:setLimitsEnabled
Enables/disables the joint limit.
enable = PrismaticJoint:setLimitsEnabled()
enable boolean True if enabled, false if disabled.
PrismaticJoint:setLowerLimit
Sets the lower limit.
PrismaticJoint:setLowerLimit( lower )
lower number The lower limit, usually in meters.
PrismaticJoint:setMaxMotorForce
Set the maximum motor force.
PrismaticJoint:setMaxMotorForce( f )
f number The maximum motor force, usually in N.
PrismaticJoint:setMotorEnabled
Enables/disables the joint motor.
PrismaticJoint:setMotorEnabled( enable )
enable boolean True to enable, false to disable.
PrismaticJoint:setMotorSpeed
Sets the motor speed.
PrismaticJoint:setMotorSpeed( s )
s number The motor speed, usually in meters per second.
PrismaticJoint:setUpperLimit
Sets the upper limit.
PrismaticJoint:setUpperLimit( upper )
upper number The upper limit, usually in meters.
PulleyJoint:getConstant
Get the total length of the rope.
length = PulleyJoint:getConstant()
length number The length of the rope in the joint.
PulleyJoint:getGroundAnchors
Get the ground anchor positions in world coordinates.
a1x, a1y, a2x, a2y = PulleyJoint:getGroundAnchors()
a1x number The x coordinate of the first anchor.
a1y number The y coordinate of the first anchor.
a2x number The x coordinate of the second anchor.
a2y number The y coordinate of the second anchor.
PulleyJoint:getLengthA
Get the current length of the rope segment attached to the first body.
length = PulleyJoint:getLengthA()
length number The length of the rope segment.
PulleyJoint:getLengthB
Get the current length of the rope segment attached to the second body.
length = PulleyJoint:getLengthB()
length number The length of the rope segment.
PulleyJoint:getMaxLengths
Get the maximum lengths of the rope segments.
len1, len2 = PulleyJoint:getMaxLengths()
len1 number The maximum length of the first rope segment.
len2 number The maximum length of the second rope segment.
PulleyJoint:getRatio
Get the pulley ratio.
ratio = PulleyJoint:getRatio()
ratio number The pulley ratio of the joint.