Skip to content

Scripting: Added more math functions#1283

Merged
ElminsterAU merged 3 commits into
TES5Edit:dev-4.1.6from
fireundubh:more_math_functions
Feb 11, 2024
Merged

Scripting: Added more math functions#1283
ElminsterAU merged 3 commits into
TES5Edit:dev-4.1.6from
fireundubh:more_math_functions

Conversation

@fireundubh

Copy link
Copy Markdown
Contributor

Summary

  • Exposed additional math functions and constants
  • Added linear interpolation functions commonly used in games
  • Changed float type in math functions from Extended to Single where possible
  • Support Integer, Single, and/or Double types in most math functions

Constants

  • Pi
  • NaN / Infinity / NegInfinity
  • NegativeValue / PositiveValue / ZeroValue
  • EqualsValue / GreaterThanValue / LessThanValue
  • Precision Modes: pmDouble / pmExtended / pmReserved / pmSingle
  • Rounding Modes: rmDown / rmNearest / rmTruncate / rmUp

Functions

All functions take a single parameter unless specified.

  • ArcCos
  • ArcCot
  • ArcCsc
  • ArcSec
  • ArcSin
  • ArcTan2(Y, X)
  • CompareValue(A, B, AEpsilon)
  • Cosecant
  • Cot
  • Cotan
  • Csc
  • DegToRad
  • EnsureRange(AValue, AMin, AMax)
  • GetPrecisionMode()
  • GetRoundMode()
  • IsInfinite
  • IsNaN
  • IsZero
  • InverseLerp(A, B, AValue)
  • Lerp(A, B, AValue)
  • LerpUnclamped(A, B, AValue)
  • Log2
  • Log10
  • LogN(ABase, AValue)
  • RadToDeg
  • Sec
  • Secant
  • SetPrecisionMode
  • SetRoundMode
  • Sign
  • SimpleRoundTo(AValue, ARoundToRange)

Scripting: Added linear interpolation functions commonly used in games
Scripting: Changed float type in math functions from Extended to Single where possible
Scripting: Support Integer, Single, and/or Double types in most math functions
@ElminsterAU ElminsterAU merged commit 979bd72 into TES5Edit:dev-4.1.6 Feb 11, 2024
@fireundubh fireundubh deleted the more_math_functions branch March 30, 2024 22:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants