Skip to content

[Mono] Improvements for Mathf

Chaosus requested to merge github/fork/Chaosus/mathf into master

Changes:

  • Added Tau, Inf, NaN - constants from GDscript,
  • Added Rt2 - Square root of 2
  • Added E constant(for compatibility with System.Math class)
  • Added InverseLerp, IsInf, IsNaN
  • Changed "val" to "value" in parameter names, yes value is keyword but its fine and no problem to use it(same as "from" which also a keyword and already existed in some functions)
  • Added int versions of Abs, Clamp and Sign
  • Clamp looks much simpler now(single line of code)
  • Added CeilToInt, FloorToInt
  • Renamed PI to Pi for compatibility with PascalCase
  • Changed Wrap for float to more compact version(thanks @aaronfranke)
  • Maked Mathf a partial class and placed all extensions and new constants to new MathfEx.cs

Merge request reports

Loading