public class BoxShape extends PolygonShape
Fixture
.Constructor and Description |
---|
BoxShape(float halfWidth,
float halfHeight)
Initialise an axis-aligned rectangle centred on the origin.
|
BoxShape(float halfWidth,
float halfHeight,
Vec2 centre)
Initialise an axis-aligned rectangle with a specified centre.
|
BoxShape(float halfWidth,
float halfHeight,
Vec2 centre,
float angle)
Initialise a rotated rectangle with a specified centre.
|
public BoxShape(float halfWidth, float halfHeight)
halfWidth
- half the width of the rectangle (in metres)halfHeight
- half the height of the rectangle (in metres)public BoxShape(float halfWidth, float halfHeight, Vec2 centre)
halfWidth
- half the width of the rectangle (in metres)halfHeight
- half the height of the rectangle (in metres)centre
- the centre of the rectanglepublic BoxShape(float halfWidth, float halfHeight, Vec2 centre, float angle)
halfWidth
- half the width of the rectangle (in metres)halfHeight
- half the height of the rectangle (in metres)centre
- the centre of the rectangleangle
- the angle by which the rectangle is rotated (counterclockwise, in radians)