Changeset 2484
 Timestamp:
 Feb 25, 2013, 12:03:12 AM (6 years ago)
 Location:
 trunk
 Files:

 2 edited
Legend:
 Unmodified
 Added
 Removed

trunk/src/lol/math/geometry.h
r2469 r2484 41 41 {} 42 42 43 Box2D operator +(vec2 v) 44 { 45 return Box2D(A + v, B + v); 46 } 47 48 Box2D &operator +=(vec2 v) 49 { 50 A += v; 51 B += v; 52 return *this; 53 } 54 55 Box2D operator (vec2 v) 56 { 57 return Box2D(A  v, B  v); 58 } 59 60 Box2D &operator =(vec2 v) 61 { 62 A = v; 63 B = v; 64 return *this; 65 } 66 43 67 vec2 A, B; 44 68 }; … … 55 79 B(b) 56 80 {} 81 82 Box3D operator +(vec3 v) 83 { 84 return Box3D(A + v, B + v); 85 } 86 87 Box3D &operator +=(vec3 v) 88 { 89 A += v; 90 B += v; 91 return *this; 92 } 93 94 Box3D operator (vec3 v) 95 { 96 return Box3D(A  v, B  v); 97 } 98 99 Box3D &operator =(vec3 v) 100 { 101 A = v; 102 B = v; 103 return *this; 104 } 57 105 58 106 vec3 A, B; 
trunk/test/unit/box.cpp
r2469 r2484 39 39 LOLUNIT_ASSERT_EQUAL(false, BoxIsectBox(b4, b5)); 40 40 } 41 42 LOLUNIT_TEST(Box2DMove) 43 { 44 Box2D b1(vec2(0.f, 0.f), vec2(1.f, 1.f)); 45 Box2D b2(vec2(2.f, 2.f), vec2(3.f, 3.f)); 46 47 b1 += vec2(0.6f, 0.6f); 48 LOLUNIT_ASSERT_EQUAL(false, BoxIsectBox(b1, b2)); 49 50 b1 += vec2(0.6f, 0.6f); 51 LOLUNIT_ASSERT_EQUAL(true, BoxIsectBox(b1, b2)); 52 53 b1 = vec2(0.0f, 0.6f); 54 LOLUNIT_ASSERT_EQUAL(false, BoxIsectBox(b1, b2)); 55 } 41 56 }; 42 57
Note: See TracChangeset
for help on using the changeset viewer.