|
| static float | ToRadians (this float f) |
| | Converts the degree value to radian value.
|
| |
| static float | ToDegrees (this float f) |
| | Converts the radian value to degree value.
|
| |
| static bool | ApproximatelyEqualsTo (this float f, float comparedValue, float epsilon=MBMath.Epsilon) |
| |
| static bool | ApproximatelyEquals (float first, float second, float epsilon=MBMath.Epsilon) |
| |
| static bool | IsValidValue (float f) |
| | Checks the value.
|
| |
| static int | ClampIndex (int value, int minValue, int maxValue) |
| | Clamps the input value, max exclusive.
|
| |
| static int | ClampInt (int value, int minValue, int maxValue) |
| | Clamps the input value.
|
| |
| static float | ClampFloat (float value, float minValue, float maxValue) |
| | Clamps the input value.
|
| |
| static void | ClampUnit (ref float value) |
| | Clamps the input value between 0.0f and 1.0f.
|
| |
| static int | GetNumberOfBitsToRepresentNumber (uint value) |
| |
| static IEnumerable< ValueTuple< T, int > > | DistributeShares< T > (int totalAward, IEnumerable< T > stakeHolders, Func< T, int > shareFunction) |
| |
| static int | GetNumberOfBitsToRepresentNumber (ulong value) |
| |
| static float | Lerp (float valueFrom, float valueTo, float amount, float minimumDifference=Epsilon) |
| | Linear interpolation between two floating values.
|
| |
| static float | LinearExtrapolation (float valueFrom, float valueTo, float amount) |
| | Linear extrapolation with respect to two floating values.
|
| |
| static Vec3 | Lerp (Vec3 vecFrom, Vec3 vecTo, float amount, float minimumDifference) |
| | Linear interpolation between two Vec3.
|
| |
| static Vec2 | Lerp (Vec2 vecFrom, Vec2 vecTo, float amount, float minimumDifference) |
| |
| static float | Map (float input, float inputMinimum, float inputMaximum, float outputMinimum, float outputMaximum) |
| | Re-maps a number from one range to another.
|
| |
| static Mat3 | Lerp (ref Mat3 matFrom, ref Mat3 matTo, float amount, float minimumDifference) |
| | Linear interpolation between two Matrices.
|
| |
| static float | LerpRadians (float valueFrom, float valueTo, float amount, float minChange, float maxChange) |
| | Linear interpolation between two radian values.
|
| |
| static float | SplitLerp (float value1, float value2, float value3, float cutOff, float amount, float minimumDifference) |
| | Linear interpolation between three floating values with a split value.
|
| |
| static float | InverseLerp (float valueFrom, float valueTo, float value) |
| | Inverse Linear interpolation between two floating values.
|
| |
| static float | SmoothStep (float edge0, float edge1, float value) |
| | SmoothStep performs smooth Hermite interpolation between 0 and 1 when edge0 < x < edge1. 0 when x <= edge0 and 1 when x >= edge1.
|
| |
| static float | BilinearLerp (float topLeft, float topRight, float botLeft, float botRight, float x, float y) |
| | Bilinear interpolation between four floating values on a uniform grid.
|
| |
| static float | GetSmallestDifferenceBetweenTwoAngles (float fromAngle, float toAngle) |
| | Calculates the (smallest) difference angle between two angles.
|
| |
| static float | ClampAngle (float angle, float restrictionCenter, float restrictionRange) |
| | Restricts an angle to a specified portion of a disk, a circular sector.
|
| |
| static float | WrapAngle (float angle) |
| | Reduces a given angle to a value between π and -π.
|
| |
| static float | WrapAngleSafe (float angle) |
| |
| static bool | IsBetween (float numberToCheck, float bottom, float top) |
| |
| static bool | IsBetween (int value, int minValue, int maxValue) |
| |
| static bool | IsBetweenInclusive (float numberToCheck, float bottom, float top) |
| |
| static uint | ColorFromRGBA (float red, float green, float blue, float alpha) |
| |
| static Color | HSBtoRGB (float hue, float saturation, float brightness, float outputAlpha) |
| |
| static Vec3 | RGBtoHSB (Color rgb) |
| |
| static Vec3 | GammaCorrectRGB (float gamma, Vec3 rgb) |
| |
| static float | GetSignedDistanceOfPointToLineSegment (in Vec2 lineSegmentBegin, in Vec2 lineSegmentEnd, in Vec2 point) |
| | Computes the signed distance from the specified line segment to the given point.
|
| |
| static float | GetDistanceSquareOfPointToLineSegment (in Vec2 lineSegmentBegin, in Vec2 lineSegmentEnd, Vec2 point) |
| | Computes the squared distance from a line segment to a specified point.
|
| |
| static Vec2 | ProjectPointOntoLine (Vec2 point, Vec2 lineStart, Vec2 lineEnd) |
| |
| static Vec2 | ClampToAxisAlignedRectangle (Vec2 point, Vec2 lineStart, Vec2 lineEnd) |
| |
| static bool | GetRayPlaneIntersectionPoint (in Vec3 planeNormal, in Vec3 planeCenter, in Vec3 rayOrigin, in Vec3 rayDirection, out float t) |
| |
| static bool | PointLiesAheadOfPlane (in Vec3 planeNormal, in Vec3 planeCenter, in Vec3 point) |
| |
| static Vec2 | GetClosestPointOnLineSegmentToPoint (in Vec2 lineSegmentBegin, in Vec2 lineSegmentEnd, in Vec2 point) |
| | Returns closest 2D point on the given 2D line segment to a target 2D point.
|
| |
| static Vec3 | GetClosestPointOnLineSegmentToPoint (in Vec3 lineSegmentBegin, in Vec3 lineSegmentEnd, in Vec3 point) |
| | Returns closest 3D point on the given 3D line segment to a target 3D point.
|
| |
| static bool | CheckLineToLineSegmentIntersection (Vec2 lineOrigin, Vec2 lineDirection, Vec2 segmentA, Vec2 segmentB, out float t, out Vec2 intersect) |
| | Computes intersection of a line (specified by a point on line and direction) with a line segment (specified by two segment points A and B)
|
| |
| static bool | IntersectLineSegmentWithTriangle (in Vec3 segStart, in Vec3 segEnd, in Vec3 triA, in Vec3 triB, in Vec3 triC) |
| |
| static bool | IntersectLineSegmentWithBoundingBox (in Vec3 start, in Vec3 end, in Vec3 min, in Vec3 max) |
| |
| static bool | CheckLineSegmentToLineSegmentIntersection (Vec2 segment1Start, Vec2 segment1End, Vec2 segment2Start, Vec2 segment2End) |
| | Checks whether two line segments intersect (segment1Start-segment1End), (segment2Start-segment2End)
|
| |
| static bool | CheckPointInsidePolygon (in Vec2 v0, in Vec2 v1, in Vec2 v2, in Vec2 v3, in Vec2 point) |
| | Using ray casting algorithm, this function checks if the given point is inside the polygon. Polygon vertices are in cw or ccw order.
|
| |
| static bool | CheckPolygonIntersection (Vec2[] polygon1, Vec2[] polygon2) |
| | Takes two polygons and decides whether they intersect or not. Polygon vertices are in ccw order.
|
| |
| static bool | CheckPolygonLineSegmentIntersection (MBList< Vec2 > polygon, Vec2 segmentStart, Vec2 segmentEnd) |
| | Takes a polygon and a line segment and decides whether they intersect or not. Polygon vertices are in ccw order.
|
| |
| static bool | IntersectRayWithPolygon (Vec2 rayOrigin, Vec2 rayDir, MBList< Vec2 > polygon, out Vec2 intersectionPoint) |
| | Intersects a ray with the given polygon (with consecutive vertices) and returns true (if intersection exists)
|
| |
| static string | ToOrdinal (int number) |
| | Coverts a cardinal number to ordinal.
|
| |
| static int | IndexOfMax< T > (MBReadOnlyList< T > array, Func< T, int > func) |
| |
| static T | MaxElement< T > (IEnumerable< T > collection, Func< T, float > func) |
| | Return the element that has the top return value for the supplied function.
|
| |
| static ValueTuple< T, T > | MaxElements2< T > (IEnumerable< T > collection, Func< T, float > func) |
| |
| static ValueTuple< T, T, T > | MaxElements3< T > (IEnumerable< T > collection, Func< T, float > func) |
| | Return the three elements that have the top return values for the supplied function.
|
| |
| static ValueTuple< T, T, T, T > | MaxElements4< T > (IEnumerable< T > collection, Func< T, float > func) |
| | Return the four elements that have the top return values for the supplied function.
|
| |
| static ValueTuple< T, T, T, T, T > | MaxElements5< T > (IEnumerable< T > collection, Func< T, float > func) |
| | Return the five elements that have the top return values for the supplied function.
|
| |
| static IList< T > | TopologySort< T > (IEnumerable< T > source, Func< T, IEnumerable< T > > getDependencies) |
| | Topology sort a list of items. getDependencies func needs to return the same instance of items for comparing.
|
| |
| static Vec3 | FindPlaneLineIntersectionPointWithNormal (Vec3 planeP1, Vec3 planeNormal, Vec3 mouseP1, Vec3 mouseP2, out bool exceptionZero) |
| |