public static class
Utility extension methods for Unity Vector and Quaternion Mathematics.
|Extension| Vector3
Summary:
Fast normalisation of a Vector3.
Params:
V:
The Vector3 to normalise.
Returns:
Normalised Vector3.
|Extension| Vector2
Summary:
Fast normalisation of a Vector2.
Params:
V:
The Vector2 to normalise.
Returns:
Normalised Vector2.
|Extension| float
Summary:
Fast magnitude of a Vector3.
Params:
V:
The Vector3 to get the magnitude of.
Returns:
The magnitude of V.
|Extension| float
Summary:
Fast magnitude of a Vector2.
Params:
V:
The Vector2 to get the magnitude of.
Returns:
The magnitude of V.
|Extension| float
Summary:
Fast distance between two Vector3s.
Params:
V:
The Vector3 to measure the distance from.
R:
The Vector3 to measure the distance to.
Returns:
The distance between V and R.
|Extension| MRotator
Summary:
Converts a Quaternion to an MRotator.
Params:
Q:
The Quaternion to extract Pitch, Yaw and Roll.
Returns:
An MRotator rotated according to a Quaternion.
|Extension| Vector3
Summary:
Converts an MVector to a Vector3.
Params:
M:
The MVector to convert.
|Extension| MVector
Summary:
Converts a Vector3 to an MVector.
Params:
V:
The Vector3 to convert.
public static class
Utility extension methods for integers and floats.
|Extension| int
Summary:
Gets the floating-point bits of a float as an int.
Params:
F:
The float to get the bits of.
Returns:
The 1:1 bit conversion of F to an int.
|Extension| void
Summary:
Set the bits of a float to the bits of an int.
Params:
F:
The float to set the bits of.
I:
The bits to pass into F.
|Extension| bool
Summary:
Gets the bit at BitIndex of float F.
Remarks:
This gets the bits as they are in the floating-point format defined by IEEE-754.
Params:
F:
The float to get the bit of.
BitIndex:
The index of the bit. Range 0 to 32.
Returns:
True if the bit of F at BitIndex is 1.
|Extension| bool
Summary:
Gets the bit at BitIndex of int I.
Params:
I:
The int to get the bit of.
BitIndex:
The index of the bit. Range 0 to 32.
Returns:
True if the bit of I at BitIndex is 1.
|Extension| float
Summary:
Flips the bit at BitIndex of float F.
Remarks:
This flips the bits as they are in the floating-point format defined by IEEE-754.
Params:
F:
The float to flip the bit of.
BitIndex:
The index of the bit. Range 0 to 32.
Returns:
The resulting float.
|Extension| int
Summary:
Flips the bit at BitIndex of int I.
Params:
I:
The int to flip the bit of.
BitIndex:
The index of the bit. Range 0 to 32.
Returns:
The resulting int.
public static bool
Summary:
Whether or not a float is considered to be zero.
Params:
F:
The float to check.
Tolerance:
The threshold for F to be considered zero.
Returns:
True if F is +- Tolerance of zero.
|Extension| bool
Summary:
Checks if a float cannot be used for arithmetic.
Params:
F:
The float to check.
Flags:
The flags to check against and consider a float as inoperable.
Returns:
True if F returns a positive result against Flags.
public eunm : byte
Flags used to check if a float cannot be used for arithmetic.
NaN
PositiveInfinity
NegativeInfinity
public static class
Utility extension methods for C# objects.
|Extension| bool
Summary:
Is an object derived from T?
Params:
O:
The object to check if it derives from T.
Returns:
True if O inherits I.
|Extension| T
Summary:
Cast an object to a Type.
Params:
O:
The object to cast.
Returns:
O of type T if O is T, otherwise null.
public static T
Summary:
Cast a GameObject to T if it is attached, implemented, or derived.
Params:
O:
The object to check if it is T is attached, implemented, or derived.
Returns:
O as T or default.
|Extension| bool
Summary:
Check if O implements interface I.
Params:
O:
The object to convert.
Returns:
True if O implements I.
|Extension| bool
Summary:
Check if O implements interface I.
Remarks:
This is identical to O.Cast() != null.
Params:
O:
The object to convert.
Interface:
O's implementation of I.
Returns:
True if O implements I.
|Extension| int
Summary:
The index of the last character in String. If String is null or empty, then -1.
Returns:
The last index.
|Extension| char
Summary:
The last character of this String. If String is null or empty, then \0.
Returns:
The last character.
|Extension| string
Summary:
Make String begin at Start. If String is null or empty, then string.Empty.
Remarks:
Assumes Start < the Length of String.
Start:
The number of characters to skip from the beginning.
Returns:
A substring ignoring the first Start characters.
|Extension| string
Summary:
Make String terminate at End. If String is null or empty, then string.Empty.
End:
The number of characters to skip from GetLastIndex().
Returns:
A substring ignoring the last End characters.
|Extension| void
Summary:
Gets the position and Rotation
|Extension| T
Summary:
Gets or Adds T Component to a GameObject.
Params:
G:
The GameObject to Get or Add T.
Returns:
The T Component attached to G.
|Extension| T
Summary:
Gets or Adds T Component to a Transform.
Params:
R:
The Transform to Get or Add T.
Returns:
The T Component attached to R.
|Extension| bool
Summary:
Is a MonoBehaviour derived from T?
Params:
B:
The MonoBehaviour to check if it derives from T.
Returns:
True if B inherits T.
|Extension| bool
Summary:
Is a MonoBehaviour derived from T? If so, cast it to T.
Params:
B:
The MonoBehaviour to check if it derives from T.
Behaviour:
Out B as T, if B derives from T.
Returns:
True if B inherits T.
|Extension| bool
Summary:
Does G have an attached T component?
Params:
G:
The GameObject to check if it has an attached T component.
Returns:
True if G has an attached T component.
|Extension| bool
Summary:
Does G have an attached T component?
Params:
G:
The GameObject to check if it has or is T.
Component:
Out the attached Component, otherwise null.
Returns:
True if G has an attached T component.
public static class
Utility extension methods for Unity Rigidbody and Rigidbody 2D Physics.
|Extension| float
Summary:
Fast magnitude of a Rigidbody's velocity.
Params:
R:
The Rigidbody to get the magnitude of.
Returns:
The magnitude of R's velocity.
|Extension| float
Summary:
Fast magnitude of a Rigidbody2D's velocity.
Params:
R:
The Rigidbody2D to get the magnitude of.
Returns:
The magnitude of R's velocity.
|Extension| float
Summary:
Fast direction of a Rigidbody's velocity.
Params:
R:
The Rigidbody to get the direction of.
Returns:
The direction of R's velocity.
|Extension| float
Summary:
Fast direction of a Rigidbody2D's velocity.
Params:
R:
The Rigidbody2D to get the direction of.
Returns:
The direction of R's velocity.
|Extension| bool
Summary:
Launches this Rigidbody towards Target at LaunchSpeed in an arc.
Params:
R:
The Rigidbody to launch.
Target:
The position to hit.
LaunchSpeed:
The speed to launch at.
bUseHighArc:
True to use a high arc trajectory, false otherwise.
bDebug:
True to debug the trajectory of the launch.
Returns:
True if R can be launched at LaunchSpeed to Target.
|Extension| void
Summary:
Launches this Rigidbody towards Target by reaching a Peak Height, then arcing downwards.
Params:
R:
The Rigidbody to launch.
Target:
The position to hit.
PeakHeight:
The maximum altitude the Rigidbody should reach before arcing downwards towards Target.
Time:
The time for R to reach Target.
bLaunchRegardless:
True if R should launch and hit Target, regardless of Peak Height.
|Extension| bool
Summary:
Launches this Rigidbody towards Target at LaunchSpeed in an arc.
Params:
R:
The Rigidbody to launch.
Target:
The position to hit.
LaunchSpeed:
The speed to launch at.
bUseHighArc:
True to use a high arc trajectory, false otherwise.
bDebug:
True to debug the trajectory of the launch.
Returns:
True if R can be launched at LaunchSpeed to Target.
|Extension| void
Summary:
Launches this Rigidbody towards Target by reaching a Peak Height, then arcing downwards.
Params:
R:
The Rigidbody to launch.
Target:
The position to hit.
PeakHeight:
The maximum altitude the Rigidbody should reach before arcing downwards towards Target.
Time:
The time for R to reach Target.
bLaunchRegardless:
True if R should launch and hit Target, regardless of Peak Height.