Random Functions
This commit is contained in:
@@ -14,6 +14,22 @@ public static class FunctionLibrary
|
||||
return functions[(int)name];
|
||||
}
|
||||
|
||||
public static FunctionName GetNextFunctionName(FunctionName name)
|
||||
{
|
||||
return (int)name < functions.Length - 1 ? name + 1 : 0;
|
||||
}
|
||||
|
||||
public static FunctionName GetRandomFunctionName()
|
||||
{
|
||||
return (FunctionName)Random.Range(0, functions.Length);
|
||||
}
|
||||
|
||||
public static FunctionName GetRandomFunctionNameOtherThan(FunctionName name)
|
||||
{
|
||||
var choice = (FunctionName)Random.Range(1, functions.Length);
|
||||
return choice == name ? 0 : choice;
|
||||
}
|
||||
|
||||
public static Vector3 Wave(float u, float v, float t)
|
||||
{
|
||||
Vector3 p;
|
||||
|
||||
Reference in New Issue
Block a user