Capsule

Represents a capsule shape with two points and a radius.

Constructor

  • Capsule() Capsule
  • Capsule(p1: Vec2, p2: Vec2, radius: float) Capsule
  • Capsule(
        x1: float,
        y1: float,
        x2: float,
        y2: float,
        radius: float
    ) Capsule

Represents a capsule shape with two points and a radius.

Properties


NameDescriptionType
p1The first point.Vec2
p2The second point.Vec2
radiusThe radius.float

Methods


As Rect

as_rect() Rect

Get the axis-aligned bounding box of the capsule.

Returns

Rect : The bounding box.

Copy

copy() Capsule

Create a copy of the capsule.

Returns

Capsule : The copy.