API reference

Every public class, method, and event in @codexo/exojs. Generated from source.

C

classCircle

@codexo/exojs / math / stable

Mutable circle shape defined by a centre position and radius. Implements ShapeLike for use in the collision pipeline. For SAT-based collision the circle is approximated as a regular polygon with Circle.collisionSegments sides; normals and vertices are cached and regenerated lazily when the shape mutates. `Circle.temp` is a shared scratch instance for intermediate calculations.

6
props
13
methods
0
events
Import
import { Circle } from '@codexo/exojs'

Mutable circle shape defined by a centre position and radius. Implements ShapeLike for use in the collision pipeline.

For SAT-based collision the circle is approximated as a regular polygon with Circle.collisionSegments sides; normals and vertices are cached and regenerated lazily when the shape mutates.

`Circle.temp` is a shared scratch instance for intermediate calculations.

Constructors 1
new(x: number, y: number, radius: number): Circle
Methods 13
clone(): this
collidesWith(target: Collidable): CollisionResponse | null
contains(x: number, y: number): boolean
copy(circle: Circle): this
destroy(): void
equals(__namedParameters: Partial<Circle>): boolean
getBounds(): Rectangle
getNormals(): Vector[]
intersectsWith(target: Collidable): boolean
project(axis: Vector, result: Interval): Interval
set(x: number, y: number, radius: number): this
setPosition(x: number, y: number): this
setRadius(radius: number): this
Properties 6
collisionType: CollisionType
collisionSegments: number
position: Vector
radius: number
x: number
y: number
Source