GitPedia
ltmx

ltmx/Unity.mathx

An Extension Library for Unity.Mathematics - Extension Methods, New Syntax, Optimized Functions, and more !

13 Releases
Latest: 3w ago
1.4.12Latest
github-actions[bot]github-actions[bot]·3w ago·May 24, 2026
GitHub

**Full Changelog**: https://github.com/ltmx/Unity.mathx/compare/1.4.11...1.4.12

1.4.11
github-actions[bot]github-actions[bot]·1y ago·September 30, 2024
GitHub
1.4.10
github-actions[bot]github-actions[bot]·1y ago·September 17, 2024
GitHub
1.4.9
github-actions[bot]github-actions[bot]·2y ago·April 13, 2024
GitHub
1.4.8
github-actions[bot]github-actions[bot]·2y ago·April 10, 2024
GitHub
1.4.7
github-actions[bot]github-actions[bot]·2y ago·March 1, 2024
GitHub
1.3.11
ltmxltmx·2y ago·September 27, 2023
GitHub

**Full Changelog**: https://github.com/LTMX/Unity.mathx/compare/1.3.10...1.3.11

1.3.10
ltmxltmx·2y ago·September 22, 2023
GitHub

Various Bug Fixes, renamings, uniformisation **Full Changelog**: https://github.com/LTMX/Unity.mathx/compare/1.3.6...1.3.10

1.2.6
ltmxltmx·2y ago·September 22, 2023
GitHub

New Functions

  • ```python
  • lerpAngle()
  • repeat() // from Mathf.PingPong()
  • pingpong() // from Mathf.PingPong()
  • approx() // from Mathf.Approx()
  • asint() // new type conversions
  • rint() // round to int
  • clint() // ceil to int
  • + 26 more

New Structs

  • ```python
  • struct color; // Casts to Color, float4, float3, and acts like a float4 (swizzling and other nice features)
  • struct bounds; // Same as UnityEngine.Bounds, rewritten for Unity.Mathematics (can cast to Bounds)
  • struct ray // Same as UnityEngine.Ray, rewritten for Unity.Mathematics (can cast to Ray)
  • ```

New Shorthands

  • ```python
  • up, down, left, right, forward, back, zero, one, for every vector type
  • ```

New Syntax

  • ```python
  • anyFloat.xxxx() // enables you to convert any float, bool or int to vectors
  • anyBool.xx() // returns new bool2(anyBool, anyBool)
  • anyInt.xxx() // returns new int2(anyInt, anyInt)
  • // and other conversions
  • ```

New Type Conversions

  • ```python
  • List<float> list = anyVector.List() // Returns a list containing individual components of this vector
  • anyFloatList.toColorArray() // and other conversions
  • anyVector.Array() // converts any vector to a float array containing its components
  • ```

📋 Name Changes

  • ```python
  • normalize() => norm()
  • ```

New Constants

  • ```python
  • TwoSqrtEOverPi // 2 * sqrt(e / pi)<
  • LnPi // ln(pi)
  • LogTwoSqrtEOverPi // log(2 * sqrt(e / pi))
  • RAD
  • DEG
  • EPSILON
  • HPI
  • + 3 more

📦 WIP

  • FastNoiseLite Library implementation using Unity.Mathematics Vectors
  • Jobify (trying out Burst-Compiled Function Pointers to try simplifying job creation)
  • Moved to `Unity.Mathematics` namespace for better interoperability

📦 Not Working

  • Random Functions

🗑️ Deprecated

  • ```python
  • selfmul() // same as x.dot(x), or (x*x).sum() or x.lengthsq()
  • quint(), quart() // now pow5, pow4
  • ```
  • Full Changelog: https://github.com/LTMX/Unity.mathx/compare/1.1.2...1.2.6
1.3.6
ltmxltmx·3y ago·May 15, 2023
GitHub

📋 What's Changed

  • Added new math operations by @MartonioJunior in https://github.com/LTMX/Unity.mathx/pull/4

New Contributors

  • @MartonioJunior made their first contribution in https://github.com/LTMX/Unity.mathx/pull/4
  • Full Changelog: https://github.com/LTMX/Unity.mathx/compare/1.3.5...1.3.6
1.3.1
ltmxltmx·3y ago·March 22, 2023
GitHub

New Features

  • Matrix Truncation => `float3x2(float4x4)` // Truncates the input matrix to the desired size... can also be written as : `float4x4.f3x2()`
  • ```c#
  • /// sets the value of x to f and returns f // Useful for modifying a variable in line.
  • public static T set<T>(this T f, out T x) { x = f; return f; }
  • // example :
  • float3 x = new float3(1,1,1);
  • // here x is set before computing lengthsq()
  • var x = x.dim(4.2f).shuffle().set(out x).lengthsq() + x;
  • + 5 more

📦 Mew Methods

  • ```c#
  • anyType.dim(otherType) => anyType* otherType // to add functionality missing from internal operator overloads // named dim to not confuse with mul()
  • anyType.greater(otherType) => anyType > otherType
  • anyType.less(otherType) => anyType < otherType
  • anyType.greatereq(otherType) => anyType >= otherType
  • anyType.lesseq(otherType) => anyType <= otherType
  • anyType.eq(otherType) => anyType == otherType
  • anyType.neq(otherType) => anyType != otherType
  • + 21 more

🐛 Fixed

  • ```c#
  • rand(float)
  • rand(float float)
  • rand(float4 float)
  • randseed()
  • Burst Compiled Function Pointers
  • ```

New Structs

  • ```c#
  • struct byte1
  • ```

📦 Structs Updates

  • ```c++
  • struct byte1; // Added Conversions, constructors / implicit and explicit casts / operator overloads + (New)
  • struct byte2; // Added Conversions, constructors / implicit and explicit casts / operator overloads + Using byte1 as unit type
  • struct byte3; // Added Conversions, constructors / implicit and explicit casts / operator overloads + Using byte1 as unit type
  • struct byte4; // Added Conversions, constructors / implicit and explicit casts / operator overloads + Using byte1 as unit type
  • struct bounds; // Added methods : Corners() , FaceCenters
  • ```

📦 Renamings

  • ```c#
  • const Sqrt2Over2 => SQRT2_2
  • changed all double precision constant suffix from _D to _DBL for consistency
  • removed duplicate constants
  • ```

📦 Updates

  • Fixed Broken Documentation
  • Added Tons of Documentation

📦 WIP

  • Multidimensional Noise Function
  • Signed Distance Functions
  • SDF Processing Functions
  • Hashing Functions
  • Function Iterators
  • Generic Jobs
  • Full Changelog: https://github.com/LTMX/Unity.mathx/compare/v1.3.0...1.3.1
1.1.1f1
ltmxltmx·5y ago·April 15, 2021
GitHub

Additions --> ```python .lerp() .unlerp() .quint() (returns x * x * x * x * x) .quart() (returns x * x * x * x) .cube() (returns x * x * x) .sqr() (returns x * x) .neg() (returns - x) .onem() (returns 1 - x) .distance() .refract() .cross() ``` Multiple Mathematical & Physical Constants Polynomial Smoothing Functions Easing Functions Type conversion optimisations Default values Multiple Bug Fixes Documentation **Full Changelog**: https://github.com/LTMX/Unity.mathx/compare/1.0.0-preview.1...1.1.1f1

1.0.0-preview.1Pre-release
ltmxltmx·6y ago·June 12, 2020
GitHub

v1.0.0 feature-complete Randoms Rounding Constants Fast Math Arithmetics Shorthands Comparison Trigonometry Vector Updaters Type Conversion Vector Functions Logarithms and exponents Array and list Type Conversion Smoothing Interpolation Functions **Full Changelog**: https://github.com/LTMX/Unity.mathx/commits/1.0.0-preview.1