API reference

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

C

classEllipse

@codexo/exojs / math / stable

Mutable axis-aligned ellipse shape defined by a centre position and separate horizontal (`rx`) and vertical (`ry`) half-radii. Implements ShapeLike for use in the intersection pipeline. `collidesWith` supports: SceneNode (AABB), Rectangle, Circle, Polygon, and Ellipse. Ellipse-vs-Line always returns `null` — use `intersectsWith`.

7
props
13
methods
0
events
Import
import { Ellipse } from '@codexo/exojs'

Mutable axis-aligned ellipse shape defined by a centre position and separate horizontal (`rx`) and vertical (`ry`) half-radii. Implements ShapeLike for use in the intersection pipeline.

`collidesWith` supports: SceneNode (AABB), Rectangle, Circle, Polygon, and Ellipse. Ellipse-vs-Line always returns `null` — use `intersectsWith`.

Constructors 1
new(x: number, y: number, halfWidth: number, halfHeight: number): Ellipse
Methods 13
clone(): this
collidesWith(target: Collidable): CollisionResponse | null
contains(x: number, y: number): boolean
copy(ellipse: Ellipse): this
destroy(): void
equals(__namedParameters: Partial<Ellipse>): boolean
getBounds(): Rectangle
getNormals(): Vector[]
intersectsWith(target: Collidable): boolean
project(axis: Vector, result: Interval): Interval
set(x: number, y: number, radiusX: number, radiusY: number): this
setPosition(x: number, y: number): this
setRadius(radiusX: number, radiusY: number): this
Properties 7
collisionType: CollisionType
position: Vector
radius: Vector
rx: number
ry: number
x: number
y: number
Source