public static FixTrans2 MakeScale(FixVec2 scale) { return(new FixTrans2( scale.X, 0, 0, 0, scale.Y, 0 )); }
public static FixTrans2 MakeTranslation(FixVec2 delta) { return(new FixTrans2( 1, 0, delta.X, 0, 1, delta.Y )); }
public FixTrans2 Scale(FixVec2 scale) { return(new FixTrans2( _m11 * scale.X, _m12 * scale.X, _m13 * scale.X, _m21 * scale.Y, _m22 * scale.Y, _m23 * scale.Y )); }
public FixTrans2 Translate(FixVec2 delta) { return(new FixTrans2( _m11, _m12, _m13 + delta.X, _m21, _m22, _m23 + delta.Y )); }
public FixTrans2(FixVec2 position, FixVec2 scale, Fix rotation) { Fix cos = FixMath.Cos(rotation); Fix sin = FixMath.Sin(rotation); _m11 = cos * scale.X; _m12 = -sin * scale.X; _m13 = position.X; _m21 = sin * scale.Y; _m22 = cos * scale.Y; _m23 = position.Y; }
public override bool Equals(Object obj) { //Check for null and compare run-time types. if ((obj == null) || !this.GetType().Equals(obj.GetType())) { return(false); } else { FixVec2 fv = (FixVec2)obj; return(_x == fv._x.raw && _y.raw == fv._y.raw); } }
public static Fix Angle(FixVec2 from, FixVec2 to) { Fix denominator = FixMath.Sqrt(from.GetMagnitudeSquared() * to.GetMagnitudeSquared()); if (denominator < Fix.Epsilon) { return(Fix.zero); } Fix dot = FixMath.Clamp(FixVec2.Dot(from, to) / denominator, -Fix.one, Fix.one); return(FixMath.Acos(dot) * FixMath.Rad2Deg); }
public static FixVec2 Cross(FixVec2 lhs, Fix rhs) { return(new FixVec2(lhs.y * rhs, lhs.x * -rhs)); }
public static FixVec2 Cross(Fix lhs, FixVec2 rhs) { return(new FixVec2(rhs.y * -lhs, rhs.x * lhs)); }
public static Fix Cross(FixVec2 lhs, FixVec2 rhs) { return(lhs.x * rhs.y - lhs.y * rhs.x); }
public static Fix Dot(FixVec2 lhs, FixVec2 rhs) { return(lhs.x * rhs.x + lhs.y * rhs.y); }
public static FixVec2 Max(FixVec2 pointA, FixVec2 t) { return(new FixVec2(FixMath.Max(pointA.x, t.x), FixMath.Max(pointA.y, t.y))); }
public static FixVec2 Abs(FixVec2 v) { return(new FixVec2(FixMath.Abs(v.x), FixMath.Abs(v.y))); }
public FixVec2 Apply(FixVec2 vec) { return this * vec; }
public Fix Cross(FixVec2 rhs) { return(_x * rhs._y - _y * rhs._x); }
public Fix Cross(FixVec2 rhs) { return(x * rhs.y - y * rhs.x); }
public FixTrans2 Scale(FixVec2 scale) { return new FixTrans2( _m11 * scale.X, _m12 * scale.X, _m13 * scale.X, _m21 * scale.Y, _m22 * scale.Y, _m23 * scale.Y ); }
public FixTrans2 Translate(FixVec2 delta) { return new FixTrans2( _m11, _m12, _m13 + delta.X, _m21, _m22, _m23 + delta.Y ); }
public FixPolygon(IEnumerable <FixVec2> points) { Points = points.ToArray(); Edges = new FixVec2[Points.Length]; BuildEdges(); }
public static Vector2 Floating(FixVec2 val) { return(new Vector2(Floating(val.X), Floating(val.Y))); }
public Fix Dot(FixVec2 rhs) { return(x * rhs.x + y * rhs.y); }
public FixVec2 Apply(FixVec2 vec) { return(this * vec); }
public Fix Dot(FixVec2 rhs) { return(_x * rhs._x + _y * rhs._y); }
public Fix Cross(FixVec2 rhs) { return _x * rhs._y - _y * rhs._x; }
public static FixTrans2 MakeScale(FixVec2 scale) { return new FixTrans2( scale.X, 0, 0, 0, scale.Y, 0 ); }
public static FixTrans2 MakeTranslation(FixVec2 delta) { return new FixTrans2( 1, 0, delta.X, 0, 1, delta.Y ); }
public Fix Dot(FixVec2 rhs) { return _x * rhs._x + _y * rhs._y; }
internal static FixVec2 Min(FixVec2 pointA, FixVec2 t) { return(new FixVec2(FixMath.Min(pointA.x, t.x), FixMath.Min(pointA.y, t.y))); }