main function stringlengths 8 40 | chunks stringlengths 41 8.32k | repo_name stringclasses 1
value |
|---|---|---|
love.physics.newEdgeShape | love.physics.newEdgeShape
Creates a new EdgeShape.
shape = love.physics.newEdgeShape( x1, y1, x2, y2 )
x1 number The x position of the first point.
y1 number The y position of the first point.
x2 number The x position of the second point.
y2 number The y position of the second point.
shape EdgeShape The new shape. | love2d-community.github.io/love-api |
love.physics.newFixture | love.physics.newFixture
Creates and attaches a Fixture to a body.
Note that the Shape object is copied rather than kept as a reference when the Fixture is created. To get the Shape object that the Fixture owns, use Fixture:getShape.
fixture = love.physics.newFixture( body, shape, density )
body Body The body which get... | love2d-community.github.io/love-api |
love.physics.newFrictionJoint | love.physics.newFrictionJoint
Create a friction joint between two bodies. A FrictionJoint applies friction to a body.
joint = love.physics.newFrictionJoint( body1, body2, x, y, collideConnected )
body1 Body The first body to attach to the joint.
body2 Body The second body to attach to the joint.
x number The x position... | love2d-community.github.io/love-api |
love.physics.newGearJoint | love.physics.newGearJoint
Create a GearJoint connecting two Joints.
The gear joint connects two joints that must be either prismatic or revolute joints. Using this joint requires that the joints it uses connect their respective bodies to the ground and have the ground as the first body. When destroying the bodies and ... | love2d-community.github.io/love-api |
love.physics.newMotorJoint | love.physics.newMotorJoint
Creates a joint between two bodies which controls the relative motion between them.
Position and rotation offsets can be specified once the MotorJoint has been created, as well as the maximum motor force and torque that will be be applied to reach the target offsets.
joint = love.physics.new... | love2d-community.github.io/love-api |
love.physics.newMouseJoint | love.physics.newMouseJoint
Create a joint between a body and the mouse.
This joint actually connects the body to a fixed point in the world. To make it follow the mouse, the fixed point must be updated every timestep (example below).
The advantage of using a MouseJoint instead of just changing a body position directl... | love2d-community.github.io/love-api |
love.physics.newPolygonShape | love.physics.newPolygonShape
Creates a new PolygonShape.
This shape can have 8 vertices at most, and must form a convex shape.
shape = love.physics.newPolygonShape( x1, y1, x2, y2, x3, y3, ... )
x1 number The x position of the first point.
y1 number The y position of the first point.
x2 number The x position of the se... | love2d-community.github.io/love-api |
love.physics.newPrismaticJoint | love.physics.newPrismaticJoint
Creates a PrismaticJoint between two bodies.
A prismatic joint constrains two bodies to move relatively to each other on a specified axis. It does not allow for relative rotation. Its definition and operation are similar to a revolute joint, but with translation and force substituted for... | love2d-community.github.io/love-api |
love.physics.newPulleyJoint | love.physics.newPulleyJoint
Creates a PulleyJoint to join two bodies to each other and the ground.
The pulley joint simulates a pulley with an optional block and tackle. If the ratio parameter has a value different from one, then the simulated rope extends faster on one side than the other. In a pulley joint the total... | love2d-community.github.io/love-api |
love.physics.newRectangleShape | love.physics.newRectangleShape
Shorthand for creating rectangular PolygonShapes.
By default, the local origin is located at the '''center''' of the rectangle as opposed to the top left for graphics.
shape = love.physics.newRectangleShape( width, height )
width number The width of the rectangle.
height number The heigh... | love2d-community.github.io/love-api |
love.physics.newRevoluteJoint | love.physics.newRevoluteJoint
Creates a pivot joint between two bodies.
This joint connects two bodies to a point around which they can pivot.
joint = love.physics.newRevoluteJoint( body1, body2, x, y, collideConnected )
body1 Body The first body.
body2 Body The second body.
x number The x position of the connecting p... | love2d-community.github.io/love-api |
love.physics.newRopeJoint | love.physics.newRopeJoint
Creates a joint between two bodies. Its only function is enforcing a max distance between these bodies.
joint = love.physics.newRopeJoint( body1, body2, x1, y1, x2, y2, maxLength, collideConnected )
body1 Body The first body to attach to the joint.
body2 Body The second body to attach to the j... | love2d-community.github.io/love-api |
love.physics.newWeldJoint | love.physics.newWeldJoint
Creates a constraint joint between two bodies. A WeldJoint essentially glues two bodies together. The constraint is a bit soft, however, due to Box2D's iterative solver.
joint = love.physics.newWeldJoint( body1, body2, x, y, collideConnected )
body1 Body The first body to attach to the joint.
... | love2d-community.github.io/love-api |
love.physics.newWheelJoint | love.physics.newWheelJoint
Creates a wheel joint.
joint = love.physics.newWheelJoint( body1, body2, x, y, ax, ay, collideConnected )
body1 Body The first body.
body2 Body The second body.
x number The x position of the anchor point.
y number The y position of the anchor point.
ax number The x position of the axis unit ... | love2d-community.github.io/love-api |
love.physics.newWorld | love.physics.newWorld
Creates a new World.
world = love.physics.newWorld( xg, yg, sleep )
xg (0) number The x component of gravity.
yg (0) number The y component of gravity.
sleep (true) boolean Whether the bodies in this world are allowed to sleep.
world World A brave new World. | love2d-community.github.io/love-api |
love.physics.setMeter | love.physics.setMeter
Sets the pixels to meter scale factor.
All coordinates in the physics module are divided by this number and converted to meters, and it creates a convenient way to draw the objects directly to the screen without the need for graphics transformations.
It is recommended to create shapes no larger ... | love2d-community.github.io/love-api |
Body:applyAngularImpulse | Body:applyAngularImpulse
Applies an angular impulse to a body. This makes a single, instantaneous addition to the body momentum.
A body with with a larger mass will react less. The reaction does '''not''' depend on the timestep, and is equivalent to applying a force continuously for 1 second. Impulses are best used to... | love2d-community.github.io/love-api |
Body:applyForce | Body:applyForce
Apply force to a Body.
A force pushes a body in a direction. A body with with a larger mass will react less. The reaction also depends on how long a force is applied: since the force acts continuously over the entire timestep, a short timestep will only push the body for a short time. Thus forces are b... | love2d-community.github.io/love-api |
Body:applyLinearImpulse | Body:applyLinearImpulse
Applies an impulse to a body.
This makes a single, instantaneous addition to the body momentum.
An impulse pushes a body in a direction. A body with with a larger mass will react less. The reaction does '''not''' depend on the timestep, and is equivalent to applying a force continuously for 1 ... | love2d-community.github.io/love-api |
Body:applyTorque | Body:applyTorque
Apply torque to a body.
Torque is like a force that will change the angular velocity (spin) of a body. The effect will depend on the rotational inertia a body has.
Body:applyTorque( torque )
torque number The torque to apply. | love2d-community.github.io/love-api |
Body:destroy | Body:destroy
Explicitly destroys the Body and all fixtures and joints attached to it.
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.
Body:destroy() | love2d-community.github.io/love-api |
Body:getAngle | Body:getAngle
Get the angle of the body.
The angle is measured in radians. If you need to transform it to degrees, use math.deg.
A value of 0 radians will mean 'looking to the right'. Although radians increase counter-clockwise, the y axis points down so it becomes ''clockwise'' from our point of view.
angle = Body:g... | love2d-community.github.io/love-api |
Body:getAngularDamping | Body:getAngularDamping
Gets the Angular damping of the Body
The angular damping is the ''rate of decrease of the angular velocity over time'': A spinning body with no damping and no external forces will continue spinning indefinitely. A spinning body with damping will gradually stop spinning.
Damping is not the same ... | love2d-community.github.io/love-api |
Body:getAngularVelocity | Body:getAngularVelocity
Get the angular velocity of the Body.
The angular velocity is the ''rate of change of angle over time''.
It is changed in World:update by applying torques, off centre forces/impulses, and angular damping. It can be set directly with Body:setAngularVelocity.
If you need the ''rate of change of... | love2d-community.github.io/love-api |
Body:getContacts | Body:getContacts
Gets a list of all Contacts attached to the Body.
contacts = Body:getContacts()
contacts table A list with all contacts associated with the Body. | love2d-community.github.io/love-api |
Body:getFixtures | Body:getFixtures
Returns a table with all fixtures.
fixtures = Body:getFixtures()
fixtures table A sequence with all fixtures. | love2d-community.github.io/love-api |
Body:getGravityScale | Body:getGravityScale
Returns the gravity scale factor.
scale = Body:getGravityScale()
scale number The gravity scale factor. | love2d-community.github.io/love-api |
Body:getInertia | Body:getInertia
Gets the rotational inertia of the body.
The rotational inertia is how hard is it to make the body spin.
inertia = Body:getInertia()
inertia number The rotational inertial of the body. | love2d-community.github.io/love-api |
Body:getJoints | Body:getJoints
Returns a table containing the Joints attached to this Body.
joints = Body:getJoints()
joints table A sequence with the Joints attached to the Body. | love2d-community.github.io/love-api |
Body:getLinearDamping | Body:getLinearDamping
Gets the linear damping of the Body.
The linear damping is the ''rate of decrease of the linear velocity over time''. A moving body with no damping and no external forces will continue moving indefinitely, as is the case in space. A moving body with damping will gradually stop moving.
Damping is... | love2d-community.github.io/love-api |
Body:getLinearVelocity | Body:getLinearVelocity
Gets the linear velocity of the Body from its center of mass.
The linear velocity is the ''rate of change of position over time''.
If you need the ''rate of change of angle over time'', use Body:getAngularVelocity.
If you need to get the linear velocity of a point different from the center of ... | love2d-community.github.io/love-api |
Body:getLinearVelocityFromLocalPoint | Body:getLinearVelocityFromLocalPoint
Get the linear velocity of a point on the body.
The linear velocity for a point on the body is the velocity of the body center of mass plus the velocity at that point from the body spinning.
The point on the body must given in local coordinates. Use Body:getLinearVelocityFromWorld... | love2d-community.github.io/love-api |
Body:getLinearVelocityFromWorldPoint | Body:getLinearVelocityFromWorldPoint
Get the linear velocity of a point on the body.
The linear velocity for a point on the body is the velocity of the body center of mass plus the velocity at that point from the body spinning.
The point on the body must given in world coordinates. Use Body:getLinearVelocityFromLocal... | love2d-community.github.io/love-api |
Body:getLocalCenter | Body:getLocalCenter
Get the center of mass position in local coordinates.
Use Body:getWorldCenter to get the center of mass in world coordinates.
x, y = Body:getLocalCenter()
x number The x coordinate of the center of mass.
y number The y coordinate of the center of mass. | love2d-community.github.io/love-api |
Body:getLocalPoint | Body:getLocalPoint
Transform a point from world coordinates to local coordinates.
localX, localY = Body:getLocalPoint( worldX, worldY )
worldX number The x position in world coordinates.
worldY number The y position in world coordinates.
localX number The x position in local coordinates.
localY number The y position in... | love2d-community.github.io/love-api |
Body:getLocalPoints | Body:getLocalPoints
Transforms multiple points from world coordinates to local coordinates.
x1, y1, x2, y2, ... = Body:getLocalPoints( x1, y1, x2, y2, ... )
x1 number (Argument) The x position of the first point.
y1 number (Argument) The y position of the first point.
x2 number (Argument) The x position of the second p... | love2d-community.github.io/love-api |
Body:getLocalVector | Body:getLocalVector
Transform a vector from world coordinates to local coordinates.
localX, localY = Body:getLocalVector( worldX, worldY )
worldX number The vector x component in world coordinates.
worldY number The vector y component in world coordinates.
localX number The vector x component in local coordinates.
loca... | love2d-community.github.io/love-api |
Body:getMass | Body:getMass
Get the mass of the body.
Static bodies always have a mass of 0.
mass = Body:getMass()
mass number The mass of the body (in kilograms). | love2d-community.github.io/love-api |
Body:getMassData | Body:getMassData
Returns the mass, its center, and the rotational inertia.
x, y, mass, inertia = Body: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 body.
inertia number The rotational inertia. | love2d-community.github.io/love-api |
Body:getPosition | Body:getPosition
Get the position of the body.
Note that this may not be the center of mass of the body.
x, y = Body:getPosition()
x number The x position.
y number The y position. | love2d-community.github.io/love-api |
Body:getTransform | Body:getTransform
Get the position and angle of the body.
Note that the position may not be the center of mass of the body. An angle of 0 radians will mean 'looking to the right'. Although radians increase counter-clockwise, the y axis points down so it becomes clockwise from our point of view.
x, y, angle = Body:getT... | love2d-community.github.io/love-api |
Body:getType | Body:getType
Returns the type of the body.
type = Body:getType()
type BodyType The body type. | love2d-community.github.io/love-api |
Body:getUserData | Body:getUserData
Returns the Lua value associated with this Body.
value = Body:getUserData()
value any The Lua value associated with the Body. | love2d-community.github.io/love-api |
Body:getWorld | Body:getWorld
Gets the World the body lives in.
world = Body:getWorld()
world World The world the body lives in. | love2d-community.github.io/love-api |
Body:getWorldCenter | Body:getWorldCenter
Get the center of mass position in world coordinates.
Use Body:getLocalCenter to get the center of mass in local coordinates.
x, y = Body:getWorldCenter()
x number The x coordinate of the center of mass.
y number The y coordinate of the center of mass. | love2d-community.github.io/love-api |
Body:getWorldPoint | Body:getWorldPoint
Transform a point from local coordinates to world coordinates.
worldX, worldY = Body:getWorldPoint( localX, localY )
localX number The x position in local coordinates.
localY number The y position in local coordinates.
worldX number The x position in world coordinates.
worldY number The y position in... | love2d-community.github.io/love-api |
Body:getWorldPoints | Body:getWorldPoints
Transforms multiple points from local coordinates to world coordinates.
x1, y1, x2, y2 = Body:getWorldPoints( x1, y1, x2, y2 )
x1 number The x position of the first point.
y1 number The y position of the first point.
x2 number The x position of the second point.
y2 number The y position of the secon... | love2d-community.github.io/love-api |
Body:getWorldVector | Body:getWorldVector
Transform a vector from local coordinates to world coordinates.
worldX, worldY = Body:getWorldVector( localX, localY )
localX number The vector x component in local coordinates.
localY number The vector y component in local coordinates.
worldX number The vector x component in world coordinates.
worl... | love2d-community.github.io/love-api |
Body:getX | Body:getX
Get the x position of the body in world coordinates.
x = Body:getX()
x number The x position in world coordinates. | love2d-community.github.io/love-api |
Body:getY | Body:getY
Get the y position of the body in world coordinates.
y = Body:getY()
y number The y position in world coordinates. | love2d-community.github.io/love-api |
Body:isActive | Body:isActive
Returns whether the body is actively used in the simulation.
status = Body:isActive()
status boolean True if the body is active or false if not. | love2d-community.github.io/love-api |
Body:isAwake | Body:isAwake
Returns the sleep status of the body.
status = Body:isAwake()
status boolean True if the body is awake or false if not. | love2d-community.github.io/love-api |
Body:isBullet | Body:isBullet
Get the bullet status of a body.
There are two methods to check for body collisions:
* at their location when the world is updated (default)
* using continuous collision detection (CCD)
The default method is efficient, but a body moving very quickly may sometimes jump over another body without produci... | love2d-community.github.io/love-api |
Body:isDestroyed | Body:isDestroyed
Gets whether the Body is destroyed. Destroyed bodies cannot be used.
destroyed = Body:isDestroyed()
destroyed boolean Whether the Body is destroyed. | love2d-community.github.io/love-api |
Body:isFixedRotation | Body:isFixedRotation
Returns whether the body rotation is locked.
fixed = Body:isFixedRotation()
fixed boolean True if the body's rotation is locked or false if not. | love2d-community.github.io/love-api |
Body:isSleepingAllowed | Body:isSleepingAllowed
Returns the sleeping behaviour of the body.
allowed = Body:isSleepingAllowed()
allowed boolean True if the body is allowed to sleep or false if not. | love2d-community.github.io/love-api |
Body:isTouching | Body:isTouching
Gets whether the Body is touching the given other Body.
touching = Body:isTouching( otherbody )
otherbody Body The other body to check.
touching boolean True if this body is touching the other body, false otherwise. | love2d-community.github.io/love-api |
Body:resetMassData | Body:resetMassData
Resets the mass of the body by recalculating it from the mass properties of the fixtures.
Body:resetMassData() | love2d-community.github.io/love-api |
Body:setActive | Body:setActive
Sets whether the body is active in the world.
An inactive body does not take part in the simulation. It will not move or cause any collisions.
Body:setActive( active )
active boolean If the body is active or not. | love2d-community.github.io/love-api |
Body:setAngle | Body:setAngle
Set the angle of the body.
The angle is measured in radians. If you need to transform it from degrees, use math.rad.
A value of 0 radians will mean 'looking to the right'. Although radians increase counter-clockwise, the y axis points down so it becomes ''clockwise'' from our point of view.
It is possi... | love2d-community.github.io/love-api |
Body:setAngularDamping | Body:setAngularDamping
Sets the angular damping of a Body
See Body:getAngularDamping for a definition of angular damping.
Angular damping can take any value from 0 to infinity. It is recommended to stay between 0 and 0.1, though. Other values will look unrealistic.
Body:setAngularDamping( damping )
damping number The... | love2d-community.github.io/love-api |
Body:setAngularVelocity | Body:setAngularVelocity
Sets the angular velocity of a Body.
The angular velocity is the ''rate of change of angle over time''.
This function will not accumulate anything; any impulses previously applied since the last call to World:update will be lost.
Body:setAngularVelocity( w )
w number The new angular velocity, ... | love2d-community.github.io/love-api |
Body:setAwake | Body:setAwake
Wakes the body up or puts it to sleep.
Body:setAwake( awake )
awake boolean The body sleep status. | love2d-community.github.io/love-api |
Body:setBullet | Body:setBullet
Set the bullet status of a body.
There are two methods to check for body collisions:
* at their location when the world is updated (default)
* using continuous collision detection (CCD)
The default method is efficient, but a body moving very quickly may sometimes jump over another body without produc... | love2d-community.github.io/love-api |
Body:setFixedRotation | Body:setFixedRotation
Set whether a body has fixed rotation.
Bodies with fixed rotation don't vary the speed at which they rotate. Calling this function causes the mass to be reset.
Body:setFixedRotation( isFixed )
isFixed boolean Whether the body should have fixed rotation. | love2d-community.github.io/love-api |
Body:setGravityScale | Body:setGravityScale
Sets a new gravity scale factor for the body.
Body:setGravityScale( scale )
scale number The new gravity scale factor. | love2d-community.github.io/love-api |
Body:setInertia | Body:setInertia
Set the inertia of a body.
Body:setInertia( inertia )
inertia number The new moment of inertia, in kilograms * pixel squared. | love2d-community.github.io/love-api |
Body:setLinearDamping | Body:setLinearDamping
Sets the linear damping of a Body
See Body:getLinearDamping for a definition of linear damping.
Linear damping can take any value from 0 to infinity. It is recommended to stay between 0 and 0.1, though. Other values will make the objects look 'floaty'(if gravity is enabled).
Body:setLinearDampin... | love2d-community.github.io/love-api |
Body:setLinearVelocity | Body:setLinearVelocity
Sets a new linear velocity for the Body.
This function will not accumulate anything; any impulses previously applied since the last call to World:update will be lost.
Body:setLinearVelocity( x, y )
x number The x-component of the velocity vector.
y number The y-component of the velocity vector. | love2d-community.github.io/love-api |
Body:setMass | Body:setMass
Sets a new body mass.
Body:setMass( mass )
mass number The mass, in kilograms. | love2d-community.github.io/love-api |
Body:setMassData | Body:setMassData
Overrides the calculated mass data.
Body:setMassData( x, y, mass, inertia )
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 body.
inertia number The rotational inertia. | love2d-community.github.io/love-api |
Body:setPosition | Body:setPosition
Set the position of the body.
Note that this may not be the center of mass of the body.
This function cannot wake up the body.
Body:setPosition( x, y )
x number The x position.
y number The y position. | love2d-community.github.io/love-api |
Body:setSleepingAllowed | Body:setSleepingAllowed
Sets the sleeping behaviour of the body. Should sleeping be allowed, a body at rest will automatically sleep. A sleeping body is not simulated unless it collided with an awake body. Be wary that one can end up with a situation like a floating sleeping body if the floor was removed.
Body:setSleep... | love2d-community.github.io/love-api |
Body:setTransform | Body:setTransform
Set the position and angle of the body.
Note that the position may not be the center of mass of the body. An angle of 0 radians will mean 'looking to the right'. Although radians increase counter-clockwise, the y axis points down so it becomes clockwise from our point of view.
This function cannot w... | love2d-community.github.io/love-api |
Body:setType | Body:setType
Sets a new body type.
Body:setType( type )
type BodyType The new type. | love2d-community.github.io/love-api |
Body:setUserData | Body:setUserData
Associates a Lua value with the Body.
To delete the reference, explicitly pass nil.
Body:setUserData( value )
value any The Lua value to associate with the Body. | love2d-community.github.io/love-api |
Body:setX | Body:setX
Set the x position of the body.
This function cannot wake up the body.
Body:setX( x )
x number The x position. | love2d-community.github.io/love-api |
Body:setY | Body:setY
Set the y position of the body.
This function cannot wake up the body.
Body:setY( y )
y number The y position. | love2d-community.github.io/love-api |
ChainShape:getChildEdge | ChainShape:getChildEdge
Returns a child of the shape as an EdgeShape.
shape = ChainShape:getChildEdge( index )
index number The index of the child.
shape EdgeShape The child as an EdgeShape. | love2d-community.github.io/love-api |
ChainShape:getNextVertex | ChainShape:getNextVertex
Gets the vertex that establishes a connection to the next shape.
Setting next and previous ChainShape vertices can help prevent unwanted collisions when a flat shape slides along the edge and moves over to the new shape.
x, y = ChainShape:getNextVertex()
x number The x-component of the vertex,... | love2d-community.github.io/love-api |
ChainShape:getPoint | ChainShape:getPoint
Returns a point of the shape.
x, y = ChainShape:getPoint( index )
index number The index of the point to return.
x number The x-coordinate of the point.
y number The y-coordinate of the point. | love2d-community.github.io/love-api |
ChainShape:getPoints | ChainShape:getPoints
Returns all points of the shape.
x1, y1, x2, y2 = ChainShape:getPoints()
x1 number The x-coordinate of the first point.
y1 number The y-coordinate of the first point.
x2 number The x-coordinate of the second point.
y2 number The y-coordinate of the second point. | love2d-community.github.io/love-api |
ChainShape:getPreviousVertex | ChainShape:getPreviousVertex
Gets the vertex that establishes a connection to the previous shape.
Setting next and previous ChainShape vertices can help prevent unwanted collisions when a flat shape slides along the edge and moves over to the new shape.
x, y = ChainShape:getPreviousVertex()
x number The x-component of... | love2d-community.github.io/love-api |
ChainShape:getVertexCount | ChainShape:getVertexCount
Returns the number of vertices the shape has.
count = ChainShape:getVertexCount()
count number The number of vertices. | love2d-community.github.io/love-api |
ChainShape:setNextVertex | ChainShape: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.
ChainShape:setNextVertex( x, y )
x number The x-component of the vertex.
y number The y-component of the vertex. | love2d-community.github.io/love-api |
ChainShape:setPreviousVertex | 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... | love2d-community.github.io/love-api |
CircleShape:getPoint | 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. | love2d-community.github.io/love-api |
CircleShape:getRadius | CircleShape:getRadius
Gets the radius of the circle shape.
radius = CircleShape:getRadius()
radius number The radius of the circle | love2d-community.github.io/love-api |
CircleShape:setPoint | 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. | love2d-community.github.io/love-api |
CircleShape:setRadius | CircleShape:setRadius
Sets the radius of the circle.
CircleShape:setRadius( radius )
radius number The radius of the circle | love2d-community.github.io/love-api |
Contact:getChildren | 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 ... | love2d-community.github.io/love-api |
Contact:getFixtures | 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. | love2d-community.github.io/love-api |
Contact:getFriction | Contact:getFriction
Get the friction between two shapes that are in contact.
friction = Contact:getFriction()
friction number The friction of the contact. | love2d-community.github.io/love-api |
Contact:getNormal | 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. | love2d-community.github.io/love-api |
Contact:getPositions | 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 ... | love2d-community.github.io/love-api |
Contact:getRestitution | Contact:getRestitution
Get the restitution between two shapes that are in contact.
restitution = Contact:getRestitution()
restitution number The restitution between the two shapes. | love2d-community.github.io/love-api |
Contact:isEnabled | 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. | love2d-community.github.io/love-api |
Contact:isTouching | 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. | love2d-community.github.io/love-api |
Contact:resetFriction | Contact:resetFriction
Resets the contact friction to the mixture value of both fixtures.
Contact:resetFriction() | love2d-community.github.io/love-api |
Contact:resetRestitution | Contact:resetRestitution
Resets the contact restitution to the mixture value of both fixtures.
Contact:resetRestitution() | love2d-community.github.io/love-api |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.