Skip to content

1.2.6

Compare
Choose a tag to compare
@ltmx ltmx released this 22 Sep 06:24
· 278 commits to master since this release
cf8feb2

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