Capsule
pykraken.Capsule Represents a capsule shape with two points and a radius.
At a glance
6 membersReference
PYTHON APIOverloaded function.
Capsule()
Create a capsule with default values.
Capsule(p1: Vec2, p2: Vec2, radius: float)
Create a capsule from two points and a radius.
Args
- p1 (
Vec2) — The first point. - p2 (
Vec2) — The second point. - radius (
float) — The radius of the capsule.
Capsule(x1: float, y1: float, x2: float, y2: float, radius: float)
Create a capsule from coordinates and a radius.
Args
- x1 (
float) — The x coordinate of the first point. - y1 (
float) — The y coordinate of the first point. - x2 (
float) — The x coordinate of the second point. - y2 (
float) — The y coordinate of the second point. - radius (
float) — The radius of the capsule.
p1
propertyp1: Vec2The first point.
p2
propertyp2: Vec2The second point.
radius
propertyradius: floatThe radius.
as_rect
methodas_rect(self) -> RectGet the axis-aligned bounding box of the capsule.
Returns
- Rect — The bounding box.
copy
methodcopy(self) -> CapsuleCreate a copy of the capsule.
Returns
- Capsule — The copy.