Added: Class Vec2i

~g2k
This commit is contained in:
2005-07-02 01:46:50 -04:00
parent de0c0682d2
commit 17565c41c1
2 changed files with 112 additions and 0 deletions

View File

@@ -54,4 +54,30 @@ public:
typedef Vec3d Vec3f;
class Vec2i
{
public:
int x,y;
Vec2i(); //Default Constructor
Vec2i(const Vec2i&); //Copy Constructor
Vec2i(int); // from an angle
Vec2i(int,int); //from values
int lengthsquared() const;
int length() const;
void normalize();
Vec2i normalized() const;
Vec2i cross(const Vec2i&) const;
Vec2i operator=(const Vec2i&);
Vec2i operator*(const Vec2i&) const;
Vec2i operator+(const Vec2i&) const;
Vec2i operator-(const Vec2i&) const;
//Vec2i operator/(const Vec2i&) const; //Is this right?
Vec2i operator*(int) const;
Vec2i operator/(int) const;
bool operator==(const Vec2i&) const;
bool operator!=(const Vec2i&) const;
};
#endif