What problem does it solve?
Geometry and math utilities for Phaser 4 simplify creating and manipulating shapes, performing geometric tests, and performing common math tasks in games and visualizations, saving time and reducing boilerplate.
Core Features & Use Cases
- Geometry classes such as Circle, Ellipse, Line, Polygon, Rectangle, and Triangle for data-only shapes with fast type checks and common methods for containment, perimeter points, random points, and positioning.
- Comprehensive math utilities (Distance, Angle, Interpolation, Random, Vector2/Vector3, Matrix4) to support game logic, physics, and rendering calculations.
- Intersection tests and helpers for fast collision checks and geometry-based logic (e.g., rectangle-circle overlap, line intersections, point containment).
Quick Start
Create a Rectangle and a Circle using Phaser.Geom and verify containment and basic intersection tests in a quick example.