Skip to content

Releases: ltmx/Unity.mathx

1.4.10

17 Sep 12:15
Compare
Choose a tag to compare

1.4.9

13 Apr 15:42
Compare
Choose a tag to compare

1.4.8

10 Apr 10:41
Compare
Choose a tag to compare

1.4.7

01 Mar 15:48
Compare
Choose a tag to compare

1.3.11

27 Sep 12:41
Compare
Choose a tag to compare

Full Changelog: 1.3.10...1.3.11

1.3.10

22 Sep 05:56
96e3617
Compare
Choose a tag to compare

Various Bug Fixes, renamings, uniformisation

Full Changelog: 1.3.6...1.3.10

1.2.6

22 Sep 06:24
cf8feb2
Compare
Choose a tag to compare

Updated package to the latest Unity.Mathematics version (1.2.6)

New Functions

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
flint() // floor to int
project() // Vector3.Project()
projectsafe() // Vector3.ProjectSafe()
cosh(), sinh(), sech(), tanh(), acosh(), asinh() // and pretty much every other trigonometry function available
isAlwaysTrue() // checks if all components of a bool vector are true
odd() // checks if an int vector is odd (returns a corresponding bool vector)
any() // checks if any component of a bool vector is true
all() // checks if all components of a bool vector are true
anyfloat3.rotateDeg() // rotates a float3 using eulerangles in degrees
anyfloat3.rotateDeg() // rotates a float3 using eulerangles in radians
anyflota3.rotateQuaternion() // rotates a float3 using a quaternion
max0() // clamps negative values to 0
min1() // clamps negative values to 0
remap()
anynan() // checks if any component of a vector is NAN

anyMultidimensionalArray.get() // added Data-accessing functions to select elements of a multidimensional array using int vectors

//Fast functions and approximations
fcos() // fast cosine
sfcos() // another fast cosine implementation using polynomials
veryfastcos()
ultraFastCos() // cosine function polynomial approximation
fmod() // fast mod
modFaster() another fast mod
frcp() // fast reciprocal
fsqrt() // fast square root

New Structs

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

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

New Syntax

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

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

normalize() => norm()

New Constants

TwoSqrtEOverPi // 2 * sqrt(e / pi)<
LnPi // ln(pi)
LogTwoSqrtEOverPi // log(2 * sqrt(e / pi))
RAD
DEG
EPSILON
HPI
PINF
NINF

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

selfmul() // same as x.dot(x), or (x*x).sum() or x.lengthsq()
quint(), quart() // now pow5, pow4

Full Changelog: 1.1.2...1.2.6

1.3.6

15 May 07:03
Compare
Choose a tag to compare

What's Changed

New Contributors

Full Changelog: 1.3.5...1.3.6

1.3.1

22 Mar 09:39
Compare
Choose a tag to compare

v1.3.1

New Features

  • Matrix Truncation => float3x2(float4x4) // Truncates the input matrix to the desired size... can also be written as : float4x4.f3x2()
/// 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; 

// we would have to write two lines instead
x = x.dim(4.2f).shuffle();
x = x.lengthsq() + x;

Burst Compiled Function Pointers

Mew Methods

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
randseed(seed) => random float generated from a seed // internally : Random.Init(seed).Nextfloat()
randseed2(seed) => random float2 generated from a seed // internally : Random.Init(seed).Nextfloat()
randseed3(seed) => random float3 generated from a seed // internally : Random.Init(seed).Nextfloat()
randseed4(seed) => random float4 generated from a seed // internally : Random.Init(seed).Nextfloat()
anyType.append()
anyType.m2n1() => anyType* 2 - 1 // remaps anything from [0, 1] to [-1, 1]
quaternion generation functions
matrix generation functions
transformation functions
dot() // for int types
value.lerp(MatrixA, MatrixB) // functionality to interpolate any matrix
anyType.dim(otherType) => anyType * otherType // to add functionality for missing from operator overloads // 'dim' to not confuse with mul()
anyType.div(otherType) => anyType / otherType
anyType.add(otherType) => anyType + otherType
anyType.sub(otherType) => anyType - otherType
anyType.shuffle() // only for float2, float3 and float4
anyType.hash() // math.hash(anyType)
type generation methods float4(), float2(), float4x4(), etc
asuint() // new overloads
asbool() // new overloads

Fixed

rand(float)
rand(float float)
rand(float4 float)
randseed()
Burst Compiled Function Pointers

New Structs

struct byte1

Structs Updates

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

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: v1.3.0...1.3.1

1.1.1f1

15 Apr 21:06
Compare
Choose a tag to compare

Additions -->

.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: 1.0.0-preview.1...1.1.1f1