-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathTool.cs
More file actions
37 lines (31 loc) · 1.02 KB
/
Tool.cs
File metadata and controls
37 lines (31 loc) · 1.02 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
using UnityEngine;
namespace tezcat.Pseudorandom_Noise
{
public static class Tool
{
// public static float select(float v1, float v2, bool flag)
// {
// return flag ? v1 : v2;
// }
public static T select<T>(T v1, T v2, bool flag)
{
return flag ? v1 : v2;
}
public static float smooth(float value)
{
return value * value * value * (value * (value * 6f - 15f) + 10f);
}
public static Vector3Int floorToInt(this Vector3 vector)
{
return new Vector3Int(Mathf.FloorToInt(vector.x), Mathf.FloorToInt(vector.y), Mathf.FloorToInt(vector.z));
}
public static Vector3Int toInt(this Vector3 vector)
{
return new Vector3Int((int)vector.x, (int)vector.y, (int)vector.z);
}
public static Vector3Int add(this Vector3Int vector, int value)
{
return new Vector3Int(vector.x + value, vector.y + value, vector.z + value);
}
}
}