MathUtils
AUTO-GENERATED FILE – DO NOT EDIT MANUALLY
This page documents the supported public API surface only. Private, internal, benchmark, test, and implementation-detail types are intentionally omitted.
Declaration
Summary
Pure C# math utilities to replace Godot’s Mathf class. Provides AOT-compatible math operations for iOS/Android. Shared-safe: stateless and thread-safe; safe to reuse across user scopes.
Metadata
Namespace: GridPlacement.Core.Math
Source File: cs/Core/Math/MathUtils.cs
Assembly: GridPlacement.Core
Type: class
Methods
Clamp
Clamps a value between min and max (inclusive).
Clamp
Clamps a float value between min and max (inclusive).
Clamp
Clamps a double value between min and max (inclusive).
Max
Returns the larger of two integers.
Max
Returns the larger of two floats.
Max
Returns the larger of two doubles.
Min
Returns the smaller of two integers.
Min
Returns the smaller of two floats.
Min
Returns the smaller of two doubles.
Lerp
Linear interpolation between two values.
Parameters
| Name | Description |
|---|---|
from | Start value |
to | End value |
weight | Interpolation weight (0-1) |
Lerp
Linear interpolation between two double values.
InverseLerp
Inverse linear interpolation - returns where a value falls between two points.
Parameters
| Name | Description |
|---|---|
from | Start value |
to | End value |
value | The value to find the position of |
Returns
0 if value equals from, 1 if value equals to
Abs
Returns the absolute value of an integer.
Abs
Returns the absolute value of a float.
Sign
Returns the sign of a number (-1, 0, or 1).
Sign
Returns the sign of a float (-1, 0, or 1).
RoundToInt
Rounds a float to the nearest integer.
FloorToInt
Floors a float to the nearest integer.
CeilToInt
Ceils a float to the nearest integer.
Approximately
Checks if two floats are approximately equal within epsilon.
Wrap
Wraps a value to stay within a range [0, length).
Wrap
Wraps a float value to stay within a range [0, length).
Distance
Calculates the distance between two points.
DistanceSquared
Calculates the squared distance between two points (faster than Distance).
DegToRad
Converts degrees to radians.
RadToDeg
Converts radians to degrees.
SmoothStep
Smoothly interpolates between two values using cubic Hermite interpolation.
MoveToward
Moves a value toward a target by a maximum delta.