FMUtilities Class

Summary

Utilities used throughout FlexiMotion.FlexiMotionComponent.
Assembly
FlexiMotion.dll
Namespace
FlexiMotion
Base Types
  • Object
graph BT Type-->Base0["Object"] Type["FMUtilities"] class Type type-node

Syntax

public static class FMUtilities

Methods

Name Value Summary
AddHash(int, int) void
Includes `add` in the `hash`.
static
AllocatePersistentUninitialized<T>(NativeArray<T>, int) void
Allocates an `array` using Unity.Collections.Allocator.Persistent and Unity.Collections.NativeArrayOptions.UninitializedMemory.
static
Clone<T>(T) T
Creates a new T and calls FlexiMotion.ICopyable`1.CopyFrom(`0) on it.
static
CloneReferences<T>(T[]) T[]
Returns a new array containing clones of the items in the original `array`.
static
CloneValues<T>(T[]) T[]
Returns a new array containing the same values.
static
ContentsAreEqual<T>(IList<T>, IList<T>) bool
Are both lists the same size with the same items in the same order?
static
CopyArray<T>(NativeArray<T>, NativeArray<T>) void
Resizes the `array` and copies the contents from `copyFrom`.
static
DrawSphereGizmo(Vector3, float, Color) void
Draws a sphere gizmo in the Scene View.
static
EstimateRadius(Transform) float
Tries to calculate an appropriate radius for the `transform`.
static
EstimateRadius(Transform, Transform) float
Tries to calculate an appropriate radius for the `transform`.
static
EstimateRadiusFromFamily(Transform) float
Tries to calculate an appropriate radius for the `transform` based on the distance between it and its parent and children.
static
EstimateRadiusFromMesh(Transform, SkinnedMeshRenderer) float
Tries to calculate an appropriate radius for the `transform` based on the UnityEngine.SkinnedMeshRenderer.sharedMeshs.
static
EstimateRadiusFromMeshes(Transform, Transform) float
Tries to calculate an appropriate radius for the `transform` based on any UnityEngine.SkinnedMeshRenderers under the `root`.
static
FromToRotation(float3, float3) quaternion
Returns a Unity.Mathematics.quaternion representing a rotation from `from` to `to`.
static
GuessRoot(GameObject) Transform
Tries to guess an appropriate root object at the top of the `gameObject`'s hierarchy.
static
Hash(int, int, int) int
Returns a hash value from the given parameters.
static
Hash(int, int, int, int) int
Returns a hash value from the given parameters.
static
Hash(int, int, int, int, int) int
Returns a hash value from the given parameters.
static
InsertAt<T>(T[], int, T) void
Resizes the `array` to be 1 larger and inserts the `item` at the specified `index`.
static
IsNaN(float3) bool
Is any component of the `vector` System.Single.NaN?
static
LogTemp<T>(T, Object) T
Debug.Log(message, context) with an [System.ObsoleteAttribute] warning so you remember to remove any calls.
static
Max(Vector3) float
Returns the highest value.
static
MaxLossyScale(Transform) float
Returns the highest value of UnityEngine.Transform.lossyScale.
static
Min(int, int, int) int
Returns the lowest value.
static
MoveItem<T>(T[], int, int) void
Takes the item out of the `array` at the `oldIndex` and inserts it in the `newIndex`.
static
RemoveAt<T>(T[], int) void
Removes the item at the specified `index` and resizes the `array` to be 1 smaller.
static
ResizePersistentUninitialized<T>(NativeArray<T>, int) bool
Resizes the `array` to the specified `length`.
static
SafeCount<T>(ICollection<T>) int
Returns the System.Collections.Generic.ICollection`1.Count or 0 if it's null.
static
SafeGetHashCode<T>(T) int
Uses System.Collections.Generic.EqualityComparer`1.Default to get a hash code.
static
SetLength<T>(T[], int) bool
If the `array` is null or its System.Array.Length isn't equal to the specified `length`, this method creates a new array with that `length` and returns true.
static
TryGet<T>(IList<T>, int, T) bool
If the `index` is within the `list`, this method outputs the `item` at that `index` and returns true.
static
TryGetObject<T>(IList<T>, int, T) bool
If the `index` is within the `list` and that `item` is not null, this method outputs it and returns true.
static
TryGetTransform(Object, Transform) bool
If the `obj` is a UnityEngine.Component or UnityEngine.GameObject, this method outputs its `transform` and returns true.
static