Skip to content

Commit 1156d79

Browse files
committed
Merge branch 'master' of https://github.com/ltmx/Unity.mathx
2 parents 86b4e18 + 1478b2f commit 1156d79

File tree

1 file changed

+62
-79
lines changed

1 file changed

+62
-79
lines changed

README.md

Lines changed: 62 additions & 79 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,9 @@
2828
-->
2929

3030
### Package name
31+
32+
> [!NOTE]\
33+
>
3134
> ```ruby
3235
> com.ltmx.mathematics.mathx
3336
> ```
@@ -52,7 +55,7 @@ using static Unity.Mathematics.mathx;
5255
5356
## ♾ Linq-Style Syntax
5457
```cs
55-
return anyVector.length().clamp(0, 10).cos().sq().cube().sum().cmul().rotate(anyQuaternion).clint().div(3.2f).rcp();
58+
return anyVector.length().clamp(0, 10).cos().sq().cube().rotate(anyQuaternion).clint().div(3.2f).rcp().mul(3.2f).sum();
5659
```
5760

5861
<br>
@@ -71,7 +74,7 @@ x = x.div(4.2f).shuffle();
7174
x = x.lengthsq() + x;
7275

7376
bool4.any(); // returns true if any component is true // or-gate
74-
bool4.all(); // returns trye if all components are true // and-gate
77+
bool4.all(); // returns true if all components are true // and-gate
7578
```
7679

7780
<br>
@@ -91,9 +94,8 @@ bool4.all(); // returns trye if all components are true // and-gate
9194
- [x] Data Construction (`append`, `float2.xyzw()`, matrix construction, etc)
9295
- [x] Data Conversion (`anyColortArray.tofloat4Array()`, and others)
9396
- [ ] Noise Functions `WIP` (`Simplex`, `Perlin`, `Whorley`, `Layered`, `Voronoi`)
94-
- [ ] Documentation `80% Complete`
9597
- [ ] Job Helpers `WIP`
96-
- [ ] Burst Compiled Function Pointers `WIP 50%`
98+
- [ ] Burst Compiled Function Pointers `WIP 80%`
9799
- [ ] Function Iterators (prevents nested loops) `WIP 50%`
98100
- [ ] Hashing Functions `WIP 80%`
99101
- [ ] Vector Function Builders `WIP 50%`
@@ -115,25 +117,29 @@ bool4.all(); // returns trye if all components are true // and-gate
115117

116118
<br>
117119

118-
## Method List 1.3.6
119-
```python
120+
## Method List
121+
```ruby
120122
// most methods have at least a dozen overloads
123+
121124
fcos() veryFastCos() ultraFastCos() CosLoop() SinLoop() sfcos() fsqrt()
122125
fdistance() flength() log2int() fastmodinv() fexp() sfastsine() sfastcosine()
123126
fastsine() fastcosine() anglerad() angledeg() fastangle() straightsignedangle()
124-
preciseangle() signedangle() fastatan2() sign() abs() mod() frac() csum() cmul()
125-
inv() neg() rcp() pow() sq() cube() pow4() pow5() sqrt() cbrt() rcbrt() rsqrt()
126-
m2n1() add() sub() div() cycle() saturate() snap() bitwave() bitwave2()
127-
triwave() set() Array() toColorArray() tocolorArray() tofloat4List()
128-
tofloat3List() tofloat4Array() tofloat3Array() toVectorArray() tofloatArray()
129-
CopyFrom() asint() asbool() asfloat() asdouble() asuint() ascolor() asColor()
130-
asfloat4() asfloat3() cast() List() toVectorList() tofloatList() toColorList()
131-
tocolorList() toVectorIE() tofloatIE() xx() xxx() xxxx() dim() exp() nexp()
132-
exp2() exp10() ln() log2() log10() f4() f3() f2() append() y() z() yz() w() zw()
133-
yzw() xyzw() xyz() xy() x() smootherstep() smoothstepcos() eerp() uneerp()
134-
smoothstep() unlerp() lerp() lerpAngle() remap() step() arc() arch2() linstep()
135-
sine01() smin() smax() smax_exp() smax_exp2() smax_expOP() smin_exp() smin_pow()
136-
smin_root() smin_polynomial() smin_quadratic() smin_cubic() smin_factor()
127+
preciseangle() signedangle() signedanglethis() fastatan2() sign() abs() mod()
128+
frac() csum() cmul() inv() neg() rcp() pow() sq() cube() pow4() pow5() sqrt()
129+
cbrt() rcbrt() rsqrt() m2n1() add() sub() div() cycle() swapx() swapy() swapz()
130+
swapw() chgsign() saturate() snap() bitwave() bitwave2() triwave() set()
131+
quaternion() conjugate() inverse() dot() length() lengthsq() norm() normsafe()
132+
unitexp() exp() unitlog() log() mul() nlerp() slerp() hash() hashwide()
133+
forward() toColorArray() tocolorArray() tofloat4List() tofloat3List()
134+
tofloat4Array() tofloat3Array() toVectorArray() tofloatArray() CopyFrom()
135+
asint() asbool() asfloat() asdouble() asuint() ascolor() asColor() asfloat4()
136+
asfloat3() cast() f() i() List() toVectorList() tofloatList() toColorList()
137+
tocolorList() toVectorIE() tofloatIE() xx() xxx() xxxx() nexp() exp2() exp10()
138+
ln() log2() log10() f4() f3() f2() append() y() z() yz() w() zw() yzw() xyzw()
139+
xyz() xy() x() smootherstep() smoothstepcos() eerp() uneerp() smoothstep()
140+
unlerp() lerp() lerpAngle() remap() step() arc() arch2() linstep() sine01()
141+
smin() smax() smax_exp() smax_exp2() smin_exp() smin_pow() smin_root()
142+
smin_polynomial() smin_quadratic() smin_cubic() smin_factor()
137143
smin_cubic_factor() smin_N_factor() mix() smoothstart() smoothstop() xfade()
138144
easeInSine() easeOutSine() easeInOutSine() easeInQuad() easeOutQuad()
139145
easeInOutQuad() easeInCubic() easeOutCubic() easeInOutCubic() easeInQuart()
@@ -143,39 +149,51 @@ easeInOutCirc() easeInBack() easeOutBack() easeInOutBack() easeInElastic()
143149
easeOutElastic() easeInOutElastic() easeInBounce() easeOutBounce()
144150
easeInOutBounce() smooth() smoothstepD() smooth5() smooth5D() smooth7()
145151
smooth7D() smooth9() smooth9D() smooth11() smooth11D() smoothD() smoother7D()
146-
any() all() select() approx() odd() even() isnan() anynan() isinf() isfinite()
147-
greater() less() lesseq() greatereq() eq() neq() isgreatest() isshortest() get()
148-
pingpong() SampleParabola() movetowards() repeat() smoothdamp() b4x4() b4x3()
149-
b4x2() b3x4() b3x3() b3x2() b2x4() b2x3() b2x2() d4x4() d4x3() d4x2() d3x4()
150-
d3x3() d3x2() d2x4() d2x3() d2x2() mul() dot() lengthsq() mult() transpose()
151-
f4x4() f4x3() f4x2() f3x4() f3x3() f3x2() f2x4() f2x3() f2x2() i4x4() i4x3()
152-
i4x2() i3x4() i3x3() i3x2() i2x4() i2x3() i2x2() u4x4() u4x3() u4x2() u3x4()
153-
u3x3() u3x2() u2x4() u2x3() u2x2() init() randf() randf2() randf3() randf4()
154-
seedrand() seedrand2() seedrand3() seedrand4() randmax() setseed() hash()
155-
hashwide() varyrand() addrand() rand() randomint() randomInSphere()
152+
i4() i3() i2() any() all() select() approx() odd() even() greater() less()
153+
lesseq() greatereq() eq() neq() anygreater() anygreatereq() anyless()
154+
anylesseq() anyeq() anyneq() isgreatest() isshortest() ispow2() isnan() anynan()
155+
isinf() isfinite() get() pingpong() SampleParabola() movetowards() repeat()
156+
smoothdamp() b4x4() b4x3() b4x2() b3x4() b3x3() b3x2() b2x4() b2x3() b2x2()
157+
d4x4() d4x3() d4x2() d3x4() d3x3() d3x2() d2x4() d2x3() d2x2() mult()
158+
transpose() diag() f4x4() f4x3() f4x2() f3x4() f3x3() f3x2() f2x4() f2x3()
159+
f2x2() i4x4() i4x3() i4x2() i3x4() i3x3() i3x2() i2x4() i2x3() i2x2() u4x4()
160+
u4x3() u4x2() u3x4() u3x3() u3x2() u2x4() u2x3() u2x2() init() randf() randf2()
161+
randf3() randf4() seedrand() seedrand2() seedrand3() seedrand4() randmax()
162+
setseed() varyrand() addrand() rand() randomint() randomInSphere()
156163
randomInCircle() randomDir3D() randomDir2D() randomrotation() rotate()
157-
rotateAxisAngle() rotateRad() rotateDeg() quaternion() rotateAround() round()
158-
rint() clamp() min() max() ceil() clint() floor() flint() sat() npsat() limp()
159-
limn() under1() cmax() cmin() acmax() acmin() sin() cos() tan() sec() cot()
160-
csc() asin() acos() atan() atan2() acot() asec() acsc() sin2() cos2() tan2()
161-
sec2() deg() rad() cossin() sincos() mod360() mod2PI() sinh() cosh() tanh()
162-
sech() coth() csch() acosh() asinh() atanh() acoth() asech() acsch() norm()
163-
normsafe() distance() distancesq() length() reflect() refract() project()
164-
projectsafe() manhattan() minkowski() chebyshev() cross() perp() exterior()
165-
orthonorm() cdistance() cdistancesq() ccross() cdot() hashnp01() Hash()
166-
GradientNoise() GenerateGradient() randdir() unity_gradientNoise() hashx()
164+
rotateAxisAngle() rotateRad() rotateDeg() rotateAround() clamp() min() max()
165+
round() rint() ceil() clint() floor() flint() sat() limp() limn() under1()
166+
clampsigned() maxsigned() minsigned() satsigned() cmax() cmin() acmax() acmin()
167+
matrix() float3x4() rotationMatrix() translationMatrix() transform() rotation()
168+
up() right() scale() sin() cos() tan() sec() cot() csc() asin() acos() atan()
169+
atan2() acot() asec() acsc() sin2() cos2() tan2() sec2() deg() rad() cossin()
170+
sincos() mod360() mod2PI() sinh() cosh() tanh() sech() coth() csch() acosh()
171+
asinh() atanh() acoth() asech() acsch() distance() distancesq() reflect()
172+
refract() project() projectsafe() manhattan() minkowski() chebyshev() cross()
173+
perp() exterior() orthonorm() cdistance() cdistancesq() ccross() cdot()
167174
openSimplex2_ImproveXY() openSimplex2SDerivatives_ImproveXY() sdSphere() sdBox()
168175
sdRoundBox() sdBoxFrame() sdTorus() sdCappedTorus() sdLink() sdCylinder()
169176
sdCone() sdConeBound() sdPlane() sdHexPrism() sdTriPrism() sdCapsule()
170177
sdVerticalCapsule() sdCappedCylinder() sdRoundedCylinder() sdCappedCone()
171178
sdSolidAngle() sdCutSphere() sdCutHollowSphere() sdDeathStar() sdRoundCone()
172179
sdEllipsoid() sdbEllipsoid_2() sdaEllipsoid_3() sdRhombus() sdOctahedron()
173-
sdOctahedronBound() sdPyramid() udTriangle() udQuad() _length2() _length6()
174-
_length8() byte1() byte2() byte3() byte4() color() gammatolinear()
180+
sdOctahedronBound() sdPyramid() udTriangle() udQuad() length2() length6()
181+
length8() byte1() byte2() byte3() byte4() color() gammatolinear()
175182
lineartogama() Erf() Erfc() ErfInv() ErfcInv() GammaLn() Gamma() DiGamma()
176-
DiGammaInv() conjugate() inverse() unitexp() unitlog() log() nlerp() slerp()
177-
forward() matrix() float3x4() rotation() translation() transform() up() right()
178-
scale() projectplane() apply() GetFunctionPointerDelegate()
183+
DiGammaInv() projectplane() apply() smin() smax()
184+
smax_exp() smin_exp()
185+
```
186+
187+
## Constant & Static fields
188+
```ruby
189+
RAD DEG RAD_DBL DEG_DBL EPSILON EPSILON_DBL FourPI FourPI_DBL TAU TAU_DBL TwoPI
190+
TwoPI_DBL PI PI_DBL HalfPI HPI HalfPI_DBL HPId PHI_DBL PHI PINF NINF PINF_DBL
191+
NINF_DBL E_DBL E TwoSqrtEOverPI LnPI LogTwoSqrtEOverPI HalfSQRT2 HSQRT SQRT3
192+
HalfSQRT3 HSQRT3 InvSQRT2 RSQRT2 INLINE IL NEVER upd2 downd2 rightd2 leftd2 upd3
193+
rightd3 forwardd3 downd3 leftd3 backd3 oned2 zerod2 oned3 zerod3 oned4 zerod4
194+
upf2 downf2 rightf2 leftf2 upf3 rightf3 forwardf3 downf3 leftf3 backf3 onef2
195+
zerof2 onef3 zerof3 onef4 zerof4 upi2 downi2 righti2 lefti2 upi3 righti3
196+
forwardi3 downi3 lefti3 backi3 onei2 zeroi2 onei3 zeroi3 onei4 zeroi4
179197
```
180198

181199

@@ -196,41 +214,6 @@ scale() projectplane() apply() GetFunctionPointerDelegate()
196214
- Unification is key : if some functions are already available in math or Unity.Mathematics.math (sometimes under another name), use them !
197215
- Documentation should be inherited from Unity.Mathematics.math methods for direct extension method translations
198216

199-
<!--
200-
201-
## 🎇 New Methods in 1.3.0
202-
```python
203-
anyType.dim(otherType) => anyType* otherType // to add functionality missing from internal operator overloads // named dim to not confuse with mul()
204-
anyType.greater(otherType) => anyType > otherType
205-
anyType.less(otherType) => anyType < otherType
206-
anyType.greatereq(otherType) => anyType >= otherType
207-
anyType.lesseq(otherType) => anyType <= otherType
208-
anyType.eq(otherType) => anyType == otherType
209-
anyType.neq(otherType) => anyType != otherType
210-
randseed(seed) => random float generated from a seed // internally : Random.Init(seed).Nextfloat()
211-
randseed2(seed) => random float2 generated from a seed // internally : Random.Init(seed).Nextfloat()
212-
randseed3(seed) => random float3 generated from a seed // internally : Random.Init(seed).Nextfloat()
213-
randseed4(seed) => random float4 generated from a seed // internally : Random.Init(seed).Nextfloat()
214-
anyType.append()
215-
anyType.m2n1() => anyType* 2 - 1 // remaps anything from [0, 1] to [-1, 1]
216-
quaternion generation functions
217-
matrix generation functions
218-
transformation functions
219-
dot() // for int types
220-
value.lerp(MatrixA, MatrixB) // functionality to interpolate any matrix
221-
anyType.dim(otherType) => anyType * otherType // to add functionality for missing from operator overloads // 'dim' to not confuse with mul()
222-
anyType.div(otherType) => anyType / otherType
223-
anyType.add(otherType) => anyType + otherType
224-
anyType.sub(otherType) => anyType - otherType
225-
anyType.shuffle() // only for float2, float3 and float4
226-
anyType.hash() // math.hash(anyType)
227-
type generation methods float4(), float2(), float4x4(), etc
228-
asuint() // new overloads
229-
asbool() // new overloads
230-
```
231-
232-
-->
233-
234217
<br>
235218

236219
## 📜 LICENSING

0 commit comments

Comments
 (0)