Skip to main content

Getting Started

Welcome to UniqueMath, a robust and evolving math library for GameMaker, inspired by the intuitive design of three.js. UniqueMath brings you powerful mathematical structures—like vectors, matrices, and quaternions—optimized for both performance and readability.


🎯 Functional API

UniqueMath uses arrays and functions for maximum speed and fewer memory allocations:

var a = vec2_create(1, 2);
var b = vec2_create(3, 4);

vec2_add(a, b); // a = [4, 6]
vec2_normalize(a); // a = unit vector

var dot = vec2_dot(a, b);

🔧 Requirements

  • GameMaker Studio 2 (latest LTS or IDE version recommended)

📦 Installation

  1. Download or copy the UniqueMath files.

  2. Import the uem.yymps file by dragging it into your GameMaker project.

  3. You're ready to use advanced math in your project!


🚀 Quick Examples

// 2D Vector operations
var pos = vec2_create(100, 200);
var vel = vec2_create(5, 3);

vec2_add(pos, vel); // Update position
var speed = vec2_length(vel); // Get speed
vec2_normalize(vel); // Get direction

// Rotate around a point
var center = vec2_create(0, 0);
vec2_rotate_around(pos, center, 45); // Rotate 45 degrees

📖 What's Available

ModuleDescription
Vec22D vector functions
Vec33D vector functions
Vec44D vector functions
EulerEuler angles functions
SphericalSpherical coordinate functions
CylindricalCylindrical coordinate functions
QuaternionQuaternion functions
Matrix22x2 matrix functions
Matrix33x3 matrix functions
Matrix44x4 matrix functions
Box22D bounding box functions
Box33D bounding box functions
OBBOriented Bounding Box functions
SphereBounding sphere functions
Plane3D plane functions
RayRaycasting functions
Line33D line functions
Triangle3D triangle functions
FrustumView frustum functions
SphericalHarmonics33rd-order Spherical Harmonics functions
OctreeSpatial partitioning tree functions

Explore the documentation sidebar for detailed information on each module!