Exemplo n.º 1
0
 public PhongMaterial(Color color, UDouble ambience, UDouble diffusion, UDouble specularity, UDouble shininess)
 {
     Color        = color;
     _ambience    = ambience;
     _diffusion   = diffusion;
     _specularity = specularity;
     _shininess   = shininess;
 }
Exemplo n.º 2
0
 public UDouble Clamp(UDouble maximum, UDouble minimum = default) => value > maximum ? maximum : (value < minimum ? minimum : value);
Exemplo n.º 3
0
 public static void Main()
 {
     UDouble max = new UDouble(Double.MaxValue);
     UDouble neg = new UDouble(-3.0);
 }
Exemplo n.º 4
0
 public static float ToSingle(UDouble value)
 {
     return((float)value);
 }
Exemplo n.º 5
0
 public static Double ToDouble(UDouble value)
 {
     return((Double)value);
 }
Exemplo n.º 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);
 }
Exemplo n.º 7
0
 public static bool Within(this UDouble input, UDouble minimum, UDouble maximum) => input >= minimum && input <= maximum;
Exemplo n.º 8
0
 public static UDouble Coerce(this UDouble value, UDouble maximum, UDouble minimum) => value > maximum ? maximum : (value < minimum ? minimum : value);