Esempio n. 1
0
 public void Clamp(idVec2 min, idVec2 max)
 {
     if (x < min.x) x = min.x;
     else if (x > max.x) x = max.x;
     if (y < min.y) y = min.y;
     else if (y > max.y) y = max.y;
 }
Esempio n. 2
0
 public static void Lerp(out idVec2 t, idVec2 v1, idVec2 v2, float l)
 {
     if (l <= 0.0f)
     {
         t = v1;
     }
     else if (l >= 1.0f)
     {
         t = v2;
     }
     else
     {
         t = v1 + (v2 - v1) * l;
     }
 }
Esempio n. 3
0
 public void Clamp(idVec2 min, idVec2 max)
 {
     if (x < min.x)
     {
         x = min.x;
     }
     else if (x > max.x)
     {
         x = max.x;
     }
     if (y < min.y)
     {
         y = min.y;
     }
     else if (y > max.y)
     {
         y = max.y;
     }
 }
Esempio n. 4
0
 public bool Compare(ref idVec2 a, float epsilon) { return (idMath.Fabs(x - a.x) <= epsilon && idMath.Fabs(y - a.y) <= epsilon); }
Esempio n. 5
0
 public bool Compare(ref idVec2 a) { return (x == a.x && y == a.y); }
Esempio n. 6
0
 public idVec2 opDiv(idVec2 a) { x /= a.x; y /= a.y; return this; }
Esempio n. 7
0
 public idVec2 opSub(idVec2 a) { x -= a.x; y -= a.y; return this; }
Esempio n. 8
0
 public bool Compare(ref idVec2 a)
 {
     return(x == a.x && y == a.y);
 }
Esempio n. 9
0
 public idMat2(ref idVec2 x, ref idVec2 y)
 {
     mat[0].x = x.x; mat[0].y = x.y;
     mat[1].x = y.x; mat[1].y = y.y;
 }
Esempio n. 10
0
 public idMat3(ref idVec2 x, ref idVec2 y, ref idVec2 z)
 {
     mat[0].x = x.x; mat[0].y = x.y; mat[0].z = x.z;
     mat[1].x = y.x; mat[1].y = y.y; mat[1].z = y.z;
     mat[2].x = z.x; mat[2].y = z.y; mat[2].z = z.z;
 }
Esempio n. 11
0
 public idVec5(idVec3 xyz, idVec2 st) { x = xyz.x; y = xyz.y; z = xyz.z; s = st.x; t = st.y; }
Esempio n. 12
0
 public idVec2 opSub(idVec2 a)
 {
     x -= a.x; y -= a.y; return(this);
 }
Esempio n. 13
0
 public idVec2 opAdd(idVec2 a)
 {
     x += a.x; y += a.y; return(this);
 }
Esempio n. 14
0
 public bool Compare(ref idVec2 a, float epsilon)
 {
     return(idMath.Fabs(x - a.x) <= epsilon && idMath.Fabs(y - a.y) <= epsilon);
 }
Esempio n. 15
0
 public idMat2(ref idVec2 x, ref idVec2 y)
 {
     mat[0].x = x.x; mat[0].y = x.y;
     mat[1].x = y.x; mat[1].y = y.y;
 }
Esempio n. 16
0
 public idVec5(idVec3 xyz, idVec2 st)
 {
     x = xyz.x; y = xyz.y; z = xyz.z; s = st.x; t = st.y;
 }
Esempio n. 17
0
 public static void Lerp(out idVec2 t, idVec2 v1, idVec2 v2, float l)
 {
     if (l <= 0.0f) t = v1;
     else if (l >= 1.0f) t = v2;
     else t = v1 + (v2 - v1) * l;
 }
Esempio n. 18
0
 public idVec2 opAdd(idVec2 a) { x += a.x; y += a.y; return this; }
Esempio n. 19
0
 public idMat3(ref idVec2 x, ref idVec2 y, ref idVec2 z)
 {
     mat[0].x = x.x; mat[0].y = x.y; mat[0].z = x.z;
     mat[1].x = y.x; mat[1].y = y.y; mat[1].z = y.z;
     mat[2].x = z.x; mat[2].y = z.y; mat[2].z = z.z;
 }
Esempio n. 20
0
 public idVec2 opDiv(idVec2 a)
 {
     x /= a.x; y /= a.y; return(this);
 }