Exemple #1
0
 public PhongMaterial(Color color, UDouble ambience, UDouble diffusion, UDouble specularity, UDouble shininess)
 {
     Color        = color;
     _ambience    = ambience;
     _diffusion   = diffusion;
     _specularity = specularity;
     _shininess   = shininess;
 }
Exemple #2
0
 public UDouble Clamp(UDouble maximum, UDouble minimum = default) => value > maximum ? maximum : (value < minimum ? minimum : value);
Exemple #3
0
 public static void Main()
 {
     UDouble max = new UDouble(Double.MaxValue);
     UDouble neg = new UDouble(-3.0);
 }
Exemple #4
0
 public static float ToSingle(UDouble value)
 {
     return((float)value);
 }
Exemple #5
0
 public static Double ToDouble(UDouble value)
 {
     return((Double)value);
 }
Exemple #6
0
 /// <summary>
 /// Parses <see cref="string"/> to <see cref="UDouble"/>.
 /// </summary>
 public static UDouble ToUDouble(this string value)
 {
     UDouble.TryParse(value, out UDouble result);
     return(result);
 }
Exemple #7
0
 public static bool Within(this UDouble input, UDouble minimum, UDouble maximum) => input >= minimum && input <= maximum;
Exemple #8
0
 public static UDouble Coerce(this UDouble value, UDouble maximum, UDouble minimum) => value > maximum ? maximum : (value < minimum ? minimum : value);