ltmx/Unity.mathx
An Extension Library for Unity.Mathematics - Extension Methods, New Syntax, Optimized Functions, and more !
**Full Changelog**: https://github.com/ltmx/Unity.mathx/compare/1.4.11...1.4.12
**Full Changelog**: https://github.com/LTMX/Unity.mathx/compare/1.3.10...1.3.11
Various Bug Fixes, renamings, uniformisation **Full Changelog**: https://github.com/LTMX/Unity.mathx/compare/1.3.6...1.3.10
✨ 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
📋 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
✨ 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
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
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
