1
#ifndef ANIMATION_POINT_H
2
#define ANIMATION_POINT_H
8
Point () : mX (0), mY (0) {}
9
Point (float x, float y) : mX (x), mY (y) {}
11
inline float x () const { return mX; }
12
inline float y () const { return mY; }
14
inline void setX (float x) { mX = x; }
15
inline void setY (float y) { mY = y; }
17
void set (float x, float y) { mX = x; mY = y; }
19
inline void add (const Point &p) { mX += p.x (); mY += p.y (); }
21
Point &operator= (const Point &p);
22
bool operator== (const Point &p) const;
23
bool operator!= (const Point &p) const;
34
Point3d () : mX (0), mY (0), mZ (0) {}
35
Point3d (float x, float y, float z) : mX (x), mY (y), mZ (z) {}
37
inline float x () const { return mX; }
38
inline float y () const { return mY; }
39
inline float z () const { return mZ; }
41
inline void setX (float x) { mX = x; }
42
inline void setY (float y) { mY = y; }
43
inline void setZ (float z) { mZ = z; }
45
inline void set (float x, float y, float z) { mX = x; mY = y; mZ = z; }
47
inline void add (const Point3d &p)
48
{ mX += p.x (); mY += p.y (); mZ += p.z (); }
49
inline void add (float x, float y, float z)
50
{ mX += x; mY += y; mZ += z; }
52
Point3d &operator= (const Point3d &p);
53
bool operator== (const Point3d &p) const;
54
bool operator!= (const Point3d &p) const;
60
typedef Point3d Vector3d;
62
/* XXX: change this to CompRect */
69
Point::operator= (const Point &p)
71
mX = p.x (); mY = p.y ();
76
Point::operator== (const Point &p) const
78
return (mX == p.x () && mY == p.y ());
82
Point::operator!= (const Point &p) const
88
Point3d::operator= (const Point3d &p)
90
mX = p.x (); mY = p.y (); mZ = p.z ();
95
Point3d::operator== (const Point3d &p) const
97
return (mX == p.x () && mY == p.y () && mZ == p.z ());
101
Point3d::operator!= (const Point3d &p) const
103
return !(*this == p);