Utility functions for working with numbers and strings.
- See Also
- Polygon
-
VectorMath
|
static float | Abs (float a) |
|
static int | Abs (int a) |
|
static float | Clamp (float a, float b, float c) |
|
static int | Clamp (int a, int b, int c) |
|
static float | Clamp01 (float a) |
|
static int | Clamp01 (int a) |
|
static int | ComputeVertexHash (int x, int y, int z) |
|
static Vector3 | CubicBezier (Vector3 p0, Vector3 p1, Vector3 p2, Vector3 p3, float t) |
| Returns a point on a cubic bezier curve.
|
|
static float | DistancePointSegment (int x, int z, int px, int pz, int qx, int qz) |
| Returns the approximate shortest squared distance between x,z and the line p-q.
|
|
static float | DistancePointSegment (Int3 a, Int3 b, Int3 p) |
| Returns the approximate shortest squared distance between x,z and the line p-q.
|
|
static float | DistancePointSegment2 (int x, int z, int px, int pz, int qx, int qz) |
|
static float | DistancePointSegment2 (Vector3 a, Vector3 b, Vector3 p) |
|
static float | DistancePointSegmentStrict (Vector3 a, Vector3 b, Vector3 p) |
| Returns the squared distance between c and the line a-b.
|
|
static string | FormatBytes (int bytes) |
|
static string | FormatBytesBinary (int bytes) |
| Returns a nicely formatted string for the number of bytes (KiB, MiB, GiB etc).
|
|
static float | Hermite (float start, float end, float value) |
|
static Color | IntToColor (int i, float a) |
| Returns a nice color from int i with alpha a.
|
|
static float | Lerp (float a, float b, float t) |
|
static float | MagnitudeXZ (Vector3 a, Vector3 b) |
|
static float | MapTo (float startMin, float startMax, float value) |
| Maps a value between startMin and startMax to be between 0 and 1.
|
|
static float | MapTo (float startMin, float startMax, float targetMin, float targetMax, float value) |
| Maps a value between startMin and startMax to be between targetMin and targetMax.
|
|
static float | MapToRange (float targetMin, float targetMax, float value) |
|
static float | Max (float a, float b) |
|
static int | Max (int a, int b) |
|
static uint | Max (uint a, uint b) |
|
static ushort | Max (ushort a, ushort b) |
|
static float | Min (float a, float b) |
|
static int | Min (int a, int b) |
|
static uint | Min (uint a, uint b) |
|
static Vector3 | NearestPoint (Vector3 lineStart, Vector3 lineEnd, Vector3 point) |
| Returns the closest point on the line.
|
|
static float | NearestPointFactor (Vector3 lineStart, Vector3 lineEnd, Vector3 point) |
|
static float | NearestPointFactor (Int3 lineStart, Int3 lineEnd, Int3 point) |
| Factor of the nearest point on the segment.
|
|
static float | NearestPointFactor (Int2 lineStart, Int2 lineEnd, Int2 point) |
| Factor of the nearest point on the segment.
|
|
static Vector3 | NearestPointStrict (Vector3 lineStart, Vector3 lineEnd, Vector3 point) |
| Returns the closest point on the line segment.
|
|
static Vector3 | NearestPointStrictXZ (Vector3 lineStart, Vector3 lineEnd, Vector3 point) |
| Returns the closest point on the line segment on the XZ plane.
|
|
static int | Repeat (int i, int n) |
|
static int | RoundToInt (float v) |
|
static int | RoundToInt (double v) |
|
static float | Sign (float a) |
|
static int | Sign (int a) |
|
static float | SqrMagnitudeXZ (Vector3 a, Vector3 b) |
| Squared distance between two points on the XZ plane.
|
|