Documentation
Introduction
Getting Started
Game Distribution
Config Files
License
Documentation Guide
Modules
love
love.audio
love.event
love.filesystem
love.graphics
love.image
love.joystick
love.keyboard
love.mouse
love.physics
love.sound
love.timer
Callbacks
love.joystickreleased
love.joystickpressed
love.load
love.update
love.draw
love.keypressed
love.keyreleased
love.mousepressed
love.mousereleased
love.run
Edit
Type
Body
Bodies are objects with velocity and position.
Create a new body with
love.physics.newBody
.
A body can call these functions:
Functions
applyForce( fx, fy, x, y )
Apply force to a Body.
applyImpulse( ix, iy, x, y )
Applies an impulse to a body.
applyTorque( torque )
Apply torque to a body.
destroy( )
Explicitly destroys the Body.
getAngle( )
Get the angle of the body.
getAngularDamping( )
Gets the Angular damping of the Body
getAngularVelocity( )
Get the angular velocity of the Body.
getInertia( )
Gets the rotational inertia of the body.
getLinearDamping( )
Gets the linear damping of the Body.
getLinearVelocity( )
Gets the linear velocity of the Body from its center of mass.
getLinearVelocityFromLocalPoint( x, y )
Get the linear velocity of a point on the body.
getLinearVelocityFromWorldPoint( x, y )
Get the linear velocity of a point on the body.
getLocalCenter( )
Get the center of mass position in local coordinates.
getLocalPoint( world_x, world_y )
Transform a point from world coordinates to local coordinates.
getLocalVector( world_x, world_y )
Transform a vector from world coordinates to local coordinates.
getMass( )
Get the mass of the body.
getPosition( )
Get the position of the body.
getWorldCenter( )
Get the center of mass position in world coordinates.
getWorldPoint( local_x, local_y )
Transform a point from local coordinates to world coordinates.
getWorldVector( local_x, local_y )
Transform a vector from local coordinates to world coordinates.
getX( )
Get the x position of the body.
getY( )
Get the y position of the body.
isBullet( )
Get the bullet status of a body.
isDynamic( )
Get the dynamic status of the body.
isFrozen( )
Get the frozen status of the body.
isSleeping( )
Get the sleeping status of a body.
isStatic( )
Get the static status of the body.
putToSleep( )
Put the body to sleep.
setAllowSleeping( permission )
Set the sleep behaviour of a body.
setAngle( angle )
Set the angle of the body.
setAngularDamping( damping )
Sets the angular damping of a Body
setAngularVelocity( w )
Sets the angular velocity of a Body.
setBullet( status )
Set the bullet status of a body.
setLinearDamping( ld )
Sets the linear damping of a Body
setLinearVelocity( x, y )
Sets a new linear velocity for the Body.
setMass( x, y, m, i )
Sets the mass properties directly.
setMassFromShapes( )
Sets mass properties from attatched shapes.
setPosition( x, y )
Set the position of the body.
setX( x )
Set the x position of the body.
setY( y )
Set the y position of the body.
wakeUp( )
Wakeup a sleeping body.
See Also
love.physics.newBody
Copyright © 2006-2010 LÖVE Development Team.
Visit Homepage
–
Ask a Question