コード例 #1
0
 public static int RoundToInt(this float value, CGMath.RoundingMode mode)
 => CGMath.RoundToInt(value: value, mode: mode);
コード例 #2
0
 public void SetValue(float newValue)
 {
     ByteValue = (byte)(CGMath.Clamp(newValue, 0f, 1f) * 255);
 }
コード例 #3
0
 public static float Round(this float value, CGMath.RoundingMode mode)
 => CGMath.Round(value: value, mode: mode);
コード例 #4
0
 public Grayscale(float newValue)
 {
     ByteValue = (byte)(CGMath.Clamp(newValue, 0f, 1f) * 255);
 }
コード例 #5
0
 public void SetValue(int newValue)
 {
     ByteValue = (byte)CGMath.Clamp(newValue, 0, 255);
 }
コード例 #6
0
 public void SetValues(int newR, int newG, int newB)
 {
     byteR = CGMath.Clamp(newR, 0, 255);
     byteG = CGMath.Clamp(newG, 0, 255);
     byteB = CGMath.Clamp(newB, 0, 255);
 }
コード例 #7
0
 public static int InverseLerp(this int from, int to, float duration)
 => CGMath.InverseLerp(from, to, duration);
コード例 #8
0
 public static Quaternion AverageQuaternion(this Quaternion q1, Quaternion q2) => CGMath.AverageQuaternion(q1, q2);
コード例 #9
0
 public static Quaternion QuaternionFromMatrix(this Matrix4x4 m) => CGMath.QuaternionFromMatrix(m: m);
コード例 #10
0
 public static Coroutine To(Vector3Int from, Vector3Int to, float duration, EaseType ease, Setter <Vector3Int> setter)
 {
     return(CreateInterpolater(duration, ease, t => setter(CGMath.Lerp(from, to, t))));
 }
コード例 #11
0
 public static Quaternion AverageQuaternion(this Quaternion[] quaternions) => CGMath.AverageQuaternion(quaternions: quaternions);
コード例 #12
0
 public static Vector3Int InverseLerp(this Vector3Int target, Vector3Int from, Vector3Int to, float duration)
 => CGMath.InverseLerp(from, to, duration);
コード例 #13
0
 public static Vector3Int LerpUnclamped(this Vector3Int target, Vector3Int from, Vector3Int to, float duration)
 => CGMath.LerpUnclamped(from, to, duration);
コード例 #14
0
ファイル: RGB.cs プロジェクト: neonbevz/cg-learning
 public byte GetOneByteColor()
 {
     return((byte)CGMath.Clamp((byteR + byteG + byteB) / 3, 0, 255));
 }
コード例 #15
0
 public static float RoundToMultipleOf(this float value, float multiple)
 => CGMath.RoundToMultipleOf(value: value, multiple: multiple);
コード例 #16
0
 public static Quaternion AverageQuaternion(this List <Quaternion> quaternions) => CGMath.AverageQuaternion(quaternions: quaternions);
コード例 #17
0
 public static int RoundToMultipleIntOf(this float value, int multiple)
 => CGMath.RoundToMultipleIntOf(value: value, multiple: multiple);
コード例 #18
0
//    public Grayscale()
//    {
//        byteValue = 0;
//    }

    public Grayscale(int newValue)
    {
        ByteValue = (byte)CGMath.Clamp(newValue, 0, 255);
    }
コード例 #19
0
 public void SetValues(float newR, float newG, float newB)
 {
     byteR = (int)CGMath.Clamp(newR, 0f, 1f) * 255;
     byteG = (int)CGMath.Clamp(newG, 0f, 1f) * 255;
     byteB = (int)CGMath.Clamp(newB, 0f, 1f) * 255;
 }
コード例 #20
0
 public static int LerpUnclamped(this int from, int to, float duration)
 => CGMath.LerpUnclamped(from, to, duration);