Example #1
0
 public static PVecFloat Lerp(PVecFloat a, PVecFloat b, PVecFloat t)
 {
     return(new PVecFloat(
                float2.Lerp(a.X, b.X, t.X),
                float2.Lerp(a.Y, b.Y, t.Y)
                ));
 }
Example #2
0
 public PVecFloat Constrain(PVecFloat min, PVecFloat max)
 {
     return(new PVecFloat(
                Constrain(X, min.X, max.X),
                Constrain(Y, min.Y, max.Y)
                ));
 }
Example #3
0
        public override bool Equals(object obj)
        {
            if (obj == null)
            {
                return(false);
            }

            PVecFloat o = (PVecFloat)obj;

            return(o == this);
        }
Example #4
0
 public static float Dot(PVecFloat a, PVecFloat b)
 {
     return(a.X * b.X + a.Y * b.Y);
 }
Example #5
0
 public static PVecFloat Min(PVecFloat a, PVecFloat b)
 {
     return(new PVecFloat(Math.Min(a.X, b.X), Math.Min(a.Y, b.Y)));
 }
Example #6
0
 public PVecFloat Constrain(PVecFloat min, PVecFloat max)
 {
     return new PVecFloat(
         Constrain(X, min.X, max.X),
         Constrain(Y, min.Y, max.Y)
     );
 }
Example #7
0
 public static PVecFloat Min(PVecFloat a, PVecFloat b)
 {
     return new PVecFloat(Math.Min(a.X, b.X), Math.Min(a.Y, b.Y));
 }
Example #8
0
 public static PVecFloat Lerp(PVecFloat a, PVecFloat b, PVecFloat t)
 {
     return new PVecFloat(
         float2.Lerp(a.X, b.X, t.X),
         float2.Lerp(a.Y, b.Y, t.Y)
     );
 }
Example #9
0
 public static float Dot(PVecFloat a, PVecFloat b)
 {
     return a.X * b.X + a.Y * b.Y;
 }
Example #10
0
 public static PSubVec ToPSubVec(this PVecFloat vec)
 {
     return(new PSubVec((int)(vec.X * PSubPos.PerPx), (int)(vec.Y * PSubPos.PerPx)));
 }