public static Vector[] DrawLine(Vector from, Vector to, int numPoints) { Vector[] points = new Vector[numPoints]; for (int i = 0; i < points.Length; i++) { float perc = i / (points.Length - 1f); points[i] = CMath.Lerp(perc, from, to); } return(points); }
public void SetTone(int Hertz) { bufferLen = Math.Min(CMath.NearestOf(audio.GetSampleRate() * 8 / Hertz, 4), sampleBuffer.Length); }
public Vector Clamp(float min, float max) { return(new Vector(CMath.Clamp(this.X, min, max), CMath.Clamp(this.Y, min, max))); }
public Vector Wrap(float mod) { return(new Vector(CMath.Mod(this.X, mod), CMath.Mod(this.Y, mod))); }