Namespace: | Sirenix.Utilities |
Assembly: | Sirenix.Utilities |
public static class MathUtilities
public static Vector3 Abs(this Vector3 v)
UnityEngine.Vector3 | v | The vector to sign. |
UnityEngine.Vector3 |
public static float Bounce(float value)
System.Single | value | The value to bounce. |
System.Single |
public static float BounceEaseInFastOut(float t)
System.Single | t | The value to bounce. |
System.Single |
public static Vector2 Clamp(this Vector2 value, Vector2 min, Vector2 max)
UnityEngine.Vector2 | value | The vector to clamp. |
UnityEngine.Vector2 | min | The min value. |
UnityEngine.Vector2 | max | The max value. |
UnityEngine.Vector2 |
public static Vector3 Clamp(this Vector3 value, Vector3 min, Vector3 max)
UnityEngine.Vector3 | value | The vector to clamp. |
UnityEngine.Vector3 | min | The min value. |
UnityEngine.Vector3 | max | The max value. |
UnityEngine.Vector3 |
public static float ClampWrapAngle(float angle, float min, float max)
System.Single | angle | |
System.Single | min | |
System.Single | max |
System.Single |
public static int ComputeByteArrayHash(byte[] data)
System.Byte[] | data | The byte array. |
System.Int32 |
public static double DiscardLeastSignificantDecimal(double v)
System.Double | v | The value of insignificant decimals. |
System.Double | Value with significant decimals. |
public static float EaseInElastic(float value, float amplitude = 0.25F, float length = 0.6F)
System.Single | value | The value to ease in elasticly. |
System.Single | amplitude | The amplitude. |
System.Single | length | The length. |
System.Single |
public static float EaseInOut(float t)
System.Single | t | A value between 0 and 1. |
System.Single |
public static float EaseOutElastic(float value, float amplitude = 0.25F, float length = 0.6F)
System.Single | value | The value to ease out elasticly. |
System.Single | amplitude | The amplitude. |
System.Single | length | The length. |
System.Single |
public static float Fract(float value)
System.Single | value | The value to get the fractional of. |
System.Single |
public static Vector2 Fract(Vector2 value)
UnityEngine.Vector2 | value | The value to get the fractional of. |
UnityEngine.Vector2 |
public static Vector3 Fract(Vector3 value)
UnityEngine.Vector3 | value | The value to get the fractional of. |
UnityEngine.Vector3 |
public static float Hermite(float start, float end, float t)
System.Single | start | First point. |
System.Single | end | Second point. |
System.Single | t | Position between 0 and 1. |
System.Single |
public static float Hermite01(float t)
System.Single | t | Position between 0 and 1. |
System.Single |
public static Vector2 InfiniteLineIntersect(Vector2 ps1, Vector2 pe1, Vector2 ps2, Vector2 pe2)
UnityEngine.Vector2 | ps1 | |
UnityEngine.Vector2 | pe1 | |
UnityEngine.Vector2 | ps2 | |
UnityEngine.Vector2 | pe2 |
UnityEngine.Vector2 |
public static Vector3 InterpolatePoints(Vector3[] path, float t)
UnityEngine.Vector3[] | path | The collection of point. |
System.Single | t | The current position in the path. 0 is at the start of the path, 1 is at the end of the path. |
UnityEngine.Vector3 |
public static Vector2 LerpUnclamped(Vector2 from, Vector2 to, float amount)
UnityEngine.Vector2 | from | The first vector. |
UnityEngine.Vector2 | to | The second vector. |
System.Single | amount | The interpolation factor. |
UnityEngine.Vector2 |
public static Vector3 LerpUnclamped(Vector3 from, Vector3 to, float amount)
UnityEngine.Vector3 | from | The first vector. |
UnityEngine.Vector3 | to | The second vector. |
System.Single | amount | The interpolation factor. |
UnityEngine.Vector3 |
public static float LinearStep(float a, float b, float t)
System.Single | a | The first value. |
System.Single | b | The second value. |
System.Single | t | The position value. |
System.Single | Linear value between 0 and 1. |
public static float LineDistToPlane(Vector3 planeOrigin, Vector3 planeNormal, Vector3 lineOrigin, Vector3 lineDirectionNormalized)
UnityEngine.Vector3 | planeOrigin | Position of the plane. |
UnityEngine.Vector3 | planeNormal | Surface normal of the plane. |
UnityEngine.Vector3 | lineOrigin | Origin of the line. |
UnityEngine.Vector3 | lineDirectionNormalized | Line direction normal. |
System.Single |
public static bool LineIntersectsLine(Vector2 a1, Vector2 a2, Vector2 b1, Vector2 b2, out Vector2 intersection)
UnityEngine.Vector2 | a1 | Starting point of line a. |
UnityEngine.Vector2 | a2 | Ending point of line a. |
UnityEngine.Vector2 | b1 | Starting point of line b. |
UnityEngine.Vector2 | b2 | Ending point of line b. |
UnityEngine.Vector2 | intersection | The out parameter which contains the intersection point if there was any. |
System.Boolean | True if the two lines intersect, otherwise false. |
public static float PointDistanceToLine(Vector3 point, Vector3 a, Vector3 b)
UnityEngine.Vector3 | point | |
UnityEngine.Vector3 | a | |
UnityEngine.Vector3 | b |
System.Single |
public static Vector3 Pow(this Vector3 v, float p)
UnityEngine.Vector3 | v | The vector. |
System.Single | p | The power. |
UnityEngine.Vector3 |
public static float RayDistToPlane(Ray ray, Plane plane)
UnityEngine.Ray | ray | The ray. |
UnityEngine.Plane | plane | The plane. |
System.Single |
public static Vector2 RotatePoint(Vector2 point, float degrees)
UnityEngine.Vector2 | point | The point to rotate. |
System.Single | degrees | The angle to rotate. |
UnityEngine.Vector2 |
public static Vector2 RotatePoint(Vector2 point, Vector2 around, float degrees)
UnityEngine.Vector2 | point | The point to rotate. |
UnityEngine.Vector2 | around | The point to rotate around. |
System.Single | degrees | The angle to rotate. |
UnityEngine.Vector2 |
public static double RoundBasedOnMinimumDifference(double valueToRound, double minDifference)
System.Double | valueToRound | The value to round. |
System.Double | minDifference | The min difference. |
System.Double | The rounded value. |
public static Vector3 Sign(this Vector3 v)
UnityEngine.Vector3 | v | The vector to sign. |
UnityEngine.Vector3 |
public static float SmoothStep(float a, float b, float t)
System.Single | a | The first value. |
System.Single | b | The second value. |
System.Single | t | The position value. |
System.Single | A smoothed value between 0 and 1. |
public static float StackHermite(float start, float end, float t, int count)
System.Single | start | First point. |
System.Single | end | Second point. |
System.Single | t | Position between 0 and 1. |
System.Int32 | count | Number of interpolations to make. |
System.Single |
public static float StackHermite01(float t, int count)
System.Single | t | Position between 0 and 1. |
System.Int32 | count | Number of interpolations to make. |
System.Single |
public static double Wrap(double value, double min, double max)
System.Double | value | The value to wrap. |
System.Double | min | The minimum value. |
System.Double | max | The maximum value. |
System.Double |
public static int Wrap(int value, int min, int max)
System.Int32 | value | The value to wrap. |
System.Int32 | min | The minimum value. |
System.Int32 | max | The maximum value. |
System.Int32 |
public static float Wrap(float value, float min, float max)
System.Single | value | The value to wrap. |
System.Single | min | The minimum value. |
System.Single | max | The maximum value. |
System.Single |