Esempio n. 1
0
 private static bool toVec2(JArray a, out Nums.vec2 v)
 {
     if (a.Count == 2)
     {
         v = new Nums.vec2(a[0] as JNumber, a[1] as JNumber);
         return(true);
     }
     v = vec2.zero;
     return(false);
 }
Esempio n. 2
0
 private static vec2 rand2(vec2 v)
 {
     v = new vec2(v.dot(new vec2(127.1f, 311.7f)),
                  v.dot(new vec2(268.5f, 183.3f)));
     return(fract(sin(v) * 43758.5453123f) * 2f - 1f);
 }