Table of Contents

Class Utilities

Namespace
Pinwheel.Vista
Assembly
Pinwheel.Vista.Runtime.dll

Collects small shared helpers used across Vista runtime code for value swapping, texture conversion, resampling, and coordinate mapping.

public static class Utilities
Inheritance
Utilities
Inherited Members

Methods

AddRepeated<T>(IList<T>, T, int)

Appends the same item to a list multiple times.

CreateGradient(Color, Color)

Creates a two-key gradient that interpolates from start to end.

CreateMaterial(string)

Creates a material from a shader resolved through Find(string).

Destroy(Object)

Destroys a Unity object using the operation appropriate for the current play mode.

DistancePointToLine(Vector2, Vector2, Vector2)

Computes the perpendicular distance from a point to the infinite line passing through two points.

DrainCoroutine(IEnumerator)

Synchronously runs an IEnumerator coroutine to completion on the calling thread. Nested coroutines produced by yield return someIEnumerator are drained recursively.

DrawMeshCompat(Mesh, Matrix4x4, Material, int, Camera, int, MaterialPropertyBlock, ShadowCastingMode, bool, Transform, LightProbeUsage)
EaseInOutCurve()

Creates the hardcoded four-key curve Vista uses for a simple edge falloff profile.

Fill<T>(T[], T)

Fills every element of an array with the same item.

FindAnyObjectCompat<T>(bool)
FindObjectsNoSortCompat<T>(bool)
FloatsFromTexture(Texture2D)

Extracts the red channel of an UnityEngine.TextureFormat.RFloat texture into a float array.

GenerateId(int)
GetAutoIterationPerFrame(int)

Resolution-bucketed iterations-per-frame for split simulation nodes. Keeps each frame's GPU batch small enough to stay under the driver's TDR watchdog (a flat high count crashes the editor at 4K) while amortizing per-frame overhead so large bakes stay responsive without being needlessly slow. Values are hand-tuned for safety and responsiveness and kept conservative so multiple nodes can share them; the ranges also cover non-power-of-two resolutions. 4096 is the maximum officially supported output; above that this returns 1 for safety (callers overriding to higher resolutions should disable the auto behavior and accept the TDR risk).

GetLayerIndex(TerrainData, TerrainLayer)

Finds the index of a terrain layer inside UnityEngine.TerrainData.terrainLayers.

GetObjectIdHash(Object)
InverseLerpUnclamped(float, float, float)

Computes the inverse interpolation factor without clamping the result to the 0..1 range.

MultipleOf8(int)

Rounds a value up to the next multiple of 8.

NormalizedToPoint(Rect, Vector2)

Converts normalized coordinates back into a point inside or outside a rect.

OverlapXZ(Bounds, Bounds)

Tests whether two bounds overlap on the horizontal XZ plane, ignoring their Y extents.

PointToNormalized(Rect, Vector2)

Converts a point in rect space into normalized coordinates relative to that rect.

ResampleBilinear(float[], int, int, int, int)

Resamples scalar image data by uploading it to an RFloat texture, blitting it, and reading the result back.

SetKeywordEnable(Material, string, bool)

Enables or disables a shader keyword on a material.

Swap<T>(ref T, ref T)

Swaps two values in place.

Swap<T>(ref T[], int, int)

Swaps two elements inside the same array.

TextureFromCurve(AnimationCurve, int)

Bakes an UnityEngine.AnimationCurve into a one-dimensional floating-point texture.

TextureFromFloats(float[], int, int)

Creates an UnityEngine.TextureFormat.RFloat texture from a linear array of scalar values.

TextureFromGradient(Gradient, int)

Bakes a UnityEngine.Gradient into a one-dimensional floating-point texture.

XZ(Vector3)

Drops the Y component of a 3D vector and returns its XZ coordinates.