diff options
Diffstat (limited to 'src/math/vector2f.h')
| -rw-r--r-- | src/math/vector2f.h | 36 | 
1 files changed, 22 insertions, 14 deletions
diff --git a/src/math/vector2f.h b/src/math/vector2f.h index 6258d85..ba60aa1 100644 --- a/src/math/vector2f.h +++ b/src/math/vector2f.h @@ -78,6 +78,28 @@ public:  		return coord[index];  	} +	/// x coordinate +	inline float width() const { +		return coord[0]; +	} +	 +	/// y coordinate +	inline float height() const { +		return coord[1]; +	} + +	/// x coordinate +	inline float x() const { return coord[0]; } +	 +	/// y coordinate +	inline float y() const { return coord[1]; } + +	/// mutable reference to the x coordinate +	inline float & get_x() { return coord[0]; } + +	/// mutable reference to the y coordinate +	inline float & get_y() { return coord[1]; } +	  	/// a pointer to the internal data  	inline float *ptr() const {  		return (float *) coord; @@ -91,20 +113,6 @@ public:  		return ((x >= 0) && (y >= 0) && (x <= coord[0]) && (y <= coord[1]));  	} -	inline float width() const { -		return coord[0]; -	} -	 -	inline float height() const { -		return coord[1]; -	} - -	/// x coordinate -	float &x; -	 -	/// y coordinate -	float &y; -	  private:  	float coord[2];  };  | 
