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

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).

DistancePointToLine(Vector2, Vector2, Vector2)

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

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.

FloatsFromTexture(Texture2D)

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

GetLayerIndex(TerrainData, TerrainLayer)

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

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.

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.