#1130
- Shapes are now directly attached to Bodies when they're created (similar to love 0.7 and older).
- Fixtures are removed.
- All methods that were in Fixtures now exist in Shapes.
- All APIs that used or returned a Fixture now do the same with a Shape.
- Add new love.physics.new*Shape variants that take a Body as the first parameter.
- Deprecate the new*Shape APIs that don't take a Body.
- Deprecate love.physics.newFixture (the deprecated function now returns a Shape).
- Replace Body:getFixture and Body:getFixtures with Body:getShape and Body:getShapes (Body:getFixtures is deprecated).
- Replace World:queryFixturesInArea and World:getFixturesInArea with World:queryShapesInArea and World:getShapesInArea (queryFixturesInArea is deprecated).
- Replace Contact:getFixtures with Contact:getShapes (Contact:getFixtures is deprecated).
- Replace all love.physics callback Fixture parameters with Shape parameters.
- Deprecate ChainShape:getChildEdge.
#1130.
- Add love.physics.newCircleBody(world, bodytype, x, y, radius)
- Add love.physics.newRectangleBody(world, bodytype, x, y, w, h [, angle])
- Add love.physics.newPolygonBody(world, bodytype, coords)
- Add love.physics.newEdgeBody(world, bodytype, x1, y1, x2, y2 [, onesided])
- Add love.physics.newChainBody(world, bodytype, loop, coords)
All new functions return a Body object. The body's world position is at the center of the given coordinates, and the shape's local origin is at its center.
This allows a Mesh to be created that doesn't have its own internal vertex buffer and purely references other vertex buffers instead.
The prototype looks like this:
mesh = love.graphics.newMesh(attributelist, drawmode)
where attributelist is an array of tables each with the following fields, similar to Mesh:attachAttribute:
{
buffer = vertexbuffer,
name = "VertexPosition", -- the name this vertex attribute will use in a shader
nameinbuffer = nil, -- the name of the attribute in the vertex buffer. Defaults to the name field.
step = nil, -- vertex attribute step ("pervertex" or "perinstance"), defaults to "pervertex".
startindex = nil, -- 1-based array index within the given vertex buffer where the attribute data will start being pulled from during rendering. Defaults to 1.
}