Skip to content

Getting started

mathx

Install **Unity.mathx** in a few minutes. Requires Unity.Mathematics and Burst for job helpers.

Requirements

Install

  1. Copy: https://github.com/LTMX/Unity.mathx.git
  2. Unity: Window → Package Manager → + → Add package from git URL

OpenUPM

openupm add com.ltmx.mathematics.mathx

Local disk

Download a release zip, then Add package from disk and select package.json.

Usage

Add one import at the top of your file:

using static Unity.Mathematics.mathx;

All extension methods chain off float, float2, float3, float4, matrices, and the custom structs.

using Unity.Mathematics;
using static Unity.Mathematics.mathx;

public float Example(float3 position, quaternion rotation)
{
    return position.rotate(rotation).lengthsq().sqrt().saturate();
}

Burst & jobs

Many APIs are Burst-friendly. For parallel workloads, see Jobify & jobs.

Test in your project

Package tests require "testables": ["com.ltmx.mathematics.mathx"] in your project Packages/manifest.json. See Quality.

Next steps