Difference between revisions of "Shape"

(added enums section, for ShapeType)
m
Line 27: Line 27:
 
{{#set:Description=Shapes are objects used to control mass and collisions.
 
{{#set:Description=Shapes are objects used to control mass and collisions.
 
}}
 
}}
 +
== Other Languages ==
 +
{{i18n|Shape}}

Revision as of 11:26, 21 December 2010

Shapes are objects used to control mass and collisions.

Every shape is either a circle or a polygon, and is attached to a Body.


Create a new shape with love.physics.newCircleShape, love.physics.newPolygonShape or love.physics.newRectangleShape.

Functions

Shape:computeAABBReturns the points of the bounding box for the transformed shape.
Shape:computeMassComputes the mass properties for the shape.
Shape:destroyExplicitly destroys the Shape.
Shape:getBodyGet the body the shape is attached to.
Shape:getBoundingBoxGets the bounding box of the shape.
Shape:getCategoryGets the categories this shape is a member of.
Shape:getCategoryBitsGets the categories as a 16-bit integer.
Shape:getChildCountReturns the number of children the shape has.
Shape:getDataGet the data set with setData.
Shape:getDensityGets the density of the Shape.
Shape:getFilterDataGets the filter data of the Shape.
Shape:getFrictionGets the friction of this shape.
Shape:getMaskGets which categories this shape should NOT collide with.
Shape:getMaskBitsReturns a 16-bit integer representing the masked categories.
Shape:getRadiusGets the radius of the shape.
Shape:getRestitutionGets the restitution of this shape.
Shape:getTypeGets a string representing the Shape.
Shape:isSensorChecks whether a Shape is a sensor or not.
Shape:rayCastCasts a ray against the shape.
Shape:setCategorySets the categories this shape is a member of.
Shape:setDataSet data to be passed to the collision callback.
Shape:setDensitySets the density of a Shape.
Shape:setFilterDataSets the filter data for a Shape.
Shape:setFrictionSets the friction of the shape.
Shape:setMaskSets which categories this shape should NOT collide with.
Shape:setRestitutionSets the restitution of the shape.
Shape:setSensorSets whether this shape should act as a sensor.
Shape:testPointChecks whether a point lies inside the shape.
Shape:testSegmentChecks whether a line segment intersects a shape.

Enums

ShapeTypeThe different types of Shapes, as returned by Shape:getType.

Subtypes

CircleShape PolygonShape

See Also

Other Languages