mirror of
https://github.com/amyinspace/MagicSetEditor2.git
synced 2026-06-10 13:06:59 -04:00
Cleaned up the calculation of bounds of symbols, this fixes bounds calculation with symmetries.
git-svn-id: svn://svn.code.sf.net/p/magicseteditor/code/trunk@1178 0fc631ac-6414-0410-93d0-97cfa31319b6
This commit is contained in:
@@ -96,6 +96,10 @@ class Vector2D {
|
||||
inline Vector2D normalized() const {
|
||||
return *this / length();
|
||||
}
|
||||
/// Angle between this vector and the x axis
|
||||
inline double angle() const {
|
||||
return atan2(y,x);
|
||||
}
|
||||
|
||||
inline operator wxPoint() const {
|
||||
return wxPoint(to_int(x), to_int(y));
|
||||
@@ -142,7 +146,7 @@ class Matrix2D {
|
||||
public:
|
||||
Vector2D mx, my;
|
||||
|
||||
inline Matrix2D() {}
|
||||
inline Matrix2D() : mx(1,0), my(0,1) {}
|
||||
inline Matrix2D(const Vector2D& mx, const Vector2D& my) : mx(mx), my(my) {}
|
||||
inline Matrix2D(double a, double b, double c, double d) : mx(a,b), my(c,d) {}
|
||||
};
|
||||
@@ -151,6 +155,10 @@ class Matrix2D {
|
||||
inline Vector2D operator * (const Vector2D& a, const Matrix2D& m) {
|
||||
return Vector2D(dot(a,m.mx), dot(a,m.my));
|
||||
}
|
||||
/// vector-matrix product
|
||||
inline Matrix2D operator * (const Matrix2D& a, const Matrix2D& m) {
|
||||
return Matrix2D(a.mx * m, a.my * m);
|
||||
}
|
||||
|
||||
|
||||
// ----------------------------------------------------------------------------- : EOF
|
||||
|
||||
Reference in New Issue
Block a user