API reference
Every public class, method, and event in @codexo/exojs. Generated from source.
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): EllipseMethods13
clone(): thiscollidesWith(target: CollidableContract for objects that participate in collision detection. Implemented by all concrete shape classes as well as `SceneNode`.): CollisionResponseResult of a successful Collidable.collidesWith call. Contains the two participating shapes, the penetration depth, containment flags, and the minimum-translati… | nullCompute 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): booleanReturns true if the point (x, y) is inside this shape.
copy(ellipse: Ellipse): thisdestroy(): voidequals(__namedParameters: Partial<Ellipse>): booleangetBounds(out: RectangleMutable axis-aligned rectangle defined by a top-left origin `(x, y)` and dimensions `(width, height)`. Implements Collidable with full SAT collision response f…): RectangleMutable axis-aligned rectangle defined by a top-left origin `(x, y)` and dimensions `(width, height)`. Implements Collidable with full SAT collision response f…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.
project(axis: VectorConcrete mutable 2D vector with full AbstractVector arithmetic and Collidable collision support (treated as a point collider). `Vector.temp` provides a shared…, result: IntervalA closed scalar interval `[min, max]` used by the SAT collision solver to represent the projection of a shape onto a separating axis. `Interval.temp` provides…): IntervalA closed scalar interval `[min, max]` used by the SAT collision solver to represent the projection of a shape onto a separating axis. `Interval.temp` provides…Project this shape onto axis and write the scalar min/max into interval. Used internally by the SAT solver.
set(x: number, y: number, radiusX: number, radiusY: number): thissetPosition(x: number, y: number): thissetRadius(radiusX: number, radiusY: number): thisProperties7
rx: numberry: numberx: numbery: numberSource