Capsule

Represents a capsule shape with two points and a radius.

Constructor

  • Capsule() Capsule
  • Capsule(p1: Vec2, p2: Vec2, radius: SupportsFloat) Capsule
  • Capsule(
        x1: SupportsFloat,
        y1: SupportsFloat,
        x2: SupportsFloat,
        y2: SupportsFloat,
        radius: SupportsFloat
    ) 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.