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;
 }
Example #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;
     }
 }
Example #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;
     }
 }
 public bool Compare(ref idVec2 a, float epsilon) { return (idMath.Fabs(x - a.x) <= epsilon && idMath.Fabs(y - a.y) <= epsilon); }
 public bool Compare(ref idVec2 a) { return (x == a.x && y == a.y); }
 public idVec2 opDiv(idVec2 a) { x /= a.x; y /= a.y; return this; }
 public idVec2 opSub(idVec2 a) { x -= a.x; y -= a.y; return this; }
Example #8
0
 public bool Compare(ref idVec2 a)
 {
     return(x == a.x && y == a.y);
 }
Example #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;
 }
Example #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;
 }
 public idVec5(idVec3 xyz, idVec2 st) { x = xyz.x; y = xyz.y; z = xyz.z; s = st.x; t = st.y; }
Example #12
0
 public idVec2 opSub(idVec2 a)
 {
     x -= a.x; y -= a.y; return(this);
 }
Example #13
0
 public idVec2 opAdd(idVec2 a)
 {
     x += a.x; y += a.y; return(this);
 }
Example #14
0
 public bool Compare(ref idVec2 a, float epsilon)
 {
     return(idMath.Fabs(x - a.x) <= epsilon && idMath.Fabs(y - a.y) <= epsilon);
 }
 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;
 }
Example #16
0
 public idVec5(idVec3 xyz, idVec2 st)
 {
     x = xyz.x; y = xyz.y; z = xyz.z; s = st.x; t = st.y;
 }
 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;
 }
 public idVec2 opAdd(idVec2 a) { x += a.x; y += a.y; return this; }
 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;
 }
Example #20
0
 public idVec2 opDiv(idVec2 a)
 {
     x /= a.x; y /= a.y; return(this);
 }