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 Collidable 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 Collidable for use in the intersection pipeline.

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

Constructors1
new(x: number, y: number, halfWidth: number, halfHeight: number): Ellipse
Methods13
clone(): this
Compute a full CollisionResponse between this shape and target. Returns null in two cases: - the shapes do not overlap, **or** - the specific shape-pair combination does not support response generation (e.g. Line against any shape, Ellipse against Ellipse or Polygon). Use intersectsWith for a universal boolean overlap check that works across all supported shape pairs.
contains(x: number, y: number): boolean
Returns true if the point (x, y) is inside this shape.
copy(ellipse: Ellipse): this
destroy(): void
equals(__namedParameters: Partial<Ellipse>): boolean
The axis-aligned bounding box of this object. Pass out to write into a rectangle you own - every implementer honours it, so this form is always safe to retain and never allocates. Without out, the math shape values (Rectangle, Circle, Polygon, ...) return a **fresh** rectangle, while a node or view that maintains a cached box (see SceneNode.getBounds) returns that cached instance, which the next invalidation overwrites.
Return the outward-facing edge normals used by the SAT solver. The array should be cached and reused across calls.
Test whether this shape overlaps target using a fast boolean algorithm (no penetration depth or normal computed). Prefer this over collidesWith when only the yes/no result is needed.
set(x: number, y: number, radiusX: number, radiusY: number): this
setPosition(x: number, y: number): this
setRadius(radiusX: number, radiusY: number): this
Properties7
rx: number
ry: number
x: number
y: number
Source