Changeset 121 for trunk/nv/position.hh
- Timestamp:
- 06/15/13 17:47:57 (12 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/nv/position.hh
r120 r121 14 14 #define NV_POSITION_HH 15 15 16 #include <glm/glm.hpp>17 16 #include <nv/common.hh> 17 #include <nv/math.hh> 18 18 #include <utility> 19 19 20 20 namespace nv 21 21 { 22 typedef glm::ivec2 position;23 typedef glm::ivec2 dimension;22 typedef ivec2 position; 23 typedef ivec2 dimension; 24 24 25 25 struct rectangle … … 46 46 *Creates a new rectangle given an upper-left and lower-right position. 47 47 * 48 *@param ul The position of the upper-left corner of the rectangle.49 *@param lr The position of the lower-right corner of the rectangle.50 */ 51 rectangle( position ul, position lr ) : ul(ul), lr(lr) {}48 *@param aul The position of the upper-left corner of the rectangle. 49 *@param alr The position of the lower-right corner of the rectangle. 50 */ 51 rectangle( position aul, position alr ) : ul(aul), lr(alr) {} 52 52 53 53 /** 54 54 *Creates a new rectangle given an upper-left position, width, and height. 55 55 * 56 *@param ul The position of the upper-left corner of the rectangle.56 *@param aul The position of the upper-left corner of the rectangle. 57 57 *@param width The width of the rectangle. 58 58 *@param height The height of the rectangle. 59 59 */ 60 rectangle( position ul, value_type width, value_type height ) : ul(ul), lr(ul + position(width,height)) {}60 rectangle( position aul, value_type width, value_type height ) : ul(aul), lr(aul + position(width,height)) {} 61 61 62 62 /** … … 269 269 { 270 270 if (r.contains(*this)) return false; 271 ul = glm::max( ul, r.ul );272 lr = glm::min( lr, r.lr );273 ul = glm::min( ul, lr );271 ul = nv::max( ul, r.ul ); 272 lr = nv::min( lr, r.lr ); 273 ul = nv::min( ul, lr ); 274 274 return true; 275 275 } … … 284 284 { 285 285 if ( r.get_width() < get_width() || r.get_height() < get_height() ) return false; 286 (*this) += glm::min( r.ul - ul, position() );287 (*this) -= glm::min( lr - r.lr, position() );286 (*this) += nv::min( r.ul - ul, position() ); 287 (*this) -= nv::min( lr - r.lr, position() ); 288 288 return true; 289 289 } … … 305 305 void include_point( position p ) 306 306 { 307 lr = glm::max( lr, p );308 ul = glm::min( ul, p );307 lr = nv::max( lr, p ); 308 ul = nv::min( ul, p ); 309 309 } 310 310
Note: See TracChangeset
for help on using the changeset viewer.