Subversion Repository Public Repository

Divide-Framework

This repository has no backups
This repository's network speed is throttled to 100KB/sec

Diff Revisions 543 vs 548 for /trunk/Source Code/Core/Math/BoundingVolumes/Headers/BoundingBox.inl

Diff revisions: vs.
  @@ -34,32 +34,32 @@
34 34
35 35 namespace Divide {
36 36
37 - inline bool BoundingBox::ContainsPoint(const vec3<F32>& point) const {
37 + inline bool BoundingBox::containsPoint(const vec3<F32>& point) const {
38 38 // const ReadLock r_lock(_lock);
39 39 return (point.x >= _min.x && point.y >= _min.y && point.z >= _min.z &&
40 40 point.x <= _max.x && point.y <= _max.y && point.z <= _max.z);
41 41 }
42 42
43 - inline bool BoundingBox::Compare(const BoundingBox& bb) const {
43 + inline bool BoundingBox::compare(const BoundingBox& bb) const {
44 44 /*ReadLock r_lock(_lock);*/
45 45 return _GUID == bb._GUID;
46 46 }
47 47
48 48 inline bool BoundingBox::operator==(const BoundingBox& B) const {
49 - return Compare(B);
49 + return compare(B);
50 50 }
51 51
52 52 inline bool BoundingBox::operator!=(const BoundingBox& B) const {
53 - return !Compare(B);
53 + return !compare(B);
54 54 }
55 55
56 - inline void BoundingBox::CreateFromPoints(const vectorImpl<vec3<F32>>& points) {
56 + inline void BoundingBox::createFromPoints(const vectorImpl<vec3<F32>>& points) {
57 57 for (vec3<F32> p : points) {
58 - Add(p);
58 + add(p);
59 59 }
60 60 }
61 61
62 - inline void BoundingBox::Add(const vec3<F32>& v) {
62 + inline void BoundingBox::add(const vec3<F32>& v) {
63 63 // WriteLock w_lock(_lock);
64 64 if (v.x > _max.x) _max.x = v.x;
65 65 if (v.x < _min.x) _min.x = v.x;
  @@ -70,7 +70,7 @@
70 70 _pointsDirty = true;
71 71 };
72 72
73 - inline void BoundingBox::Add(const BoundingBox& bb) {
73 + inline void BoundingBox::add(const BoundingBox& bb) {
74 74 // WriteLock w_lock(_lock);
75 75 if (bb._max.x > _max.x) _max.x = bb._max.x;
76 76 if (bb._min.x < _min.x) _min.x = bb._min.x;
  @@ -81,21 +81,21 @@
81 81 _pointsDirty = true;
82 82 }
83 83
84 - inline void BoundingBox::Translate(const vec3<F32>& v) {
84 + inline void BoundingBox::translate(const vec3<F32>& v) {
85 85 // WriteLock w_lock(_lock);
86 86 _min += v;
87 87 _max += v;
88 88 _pointsDirty = true;
89 89 }
90 90
91 - inline void BoundingBox::Multiply(F32 factor) {
91 + inline void BoundingBox::multiply(F32 factor) {
92 92 // WriteLock w_lock(_lock);
93 93 _min *= factor;
94 94 _max *= factor;
95 95 _pointsDirty = true;
96 96 }
97 97
98 - inline void BoundingBox::Multiply(const vec3<F32>& v) {
98 + inline void BoundingBox::multiply(const vec3<F32>& v) {
99 99 // WriteLock w_lock(_lock);
100 100 _min.x *= v.x;
101 101 _min.y *= v.y;
  @@ -106,7 +106,7 @@
106 106 _pointsDirty = true;
107 107 }
108 108
109 - inline void BoundingBox::MultiplyMax(const vec3<F32>& v) {
109 + inline void BoundingBox::multiplyMax(const vec3<F32>& v) {
110 110 // WriteLock w_lock(_lock);
111 111 _max.x *= v.x;
112 112 _max.y *= v.y;
  @@ -114,7 +114,7 @@
114 114 _pointsDirty = true;
115 115 }
116 116
117 - inline void BoundingBox::MultiplyMin(const vec3<F32>& v) {
117 + inline void BoundingBox::multiplyMin(const vec3<F32>& v) {
118 118 // WriteLock w_lock(_lock);
119 119 _min.x *= v.x;
120 120 _min.y *= v.y;
  @@ -170,18 +170,32 @@
170 170 }
171 171
172 172 inline void BoundingBox::setMin(const vec3<F32>& min) {
173 - /*WriteLock w_lock(_lock);*/
174 - _min = min;
175 - _pointsDirty = true;
173 + setMin(min.x, min.y, min.z);
176 174 }
177 175
178 176 inline void BoundingBox::setMax(const vec3<F32>& max) {
179 - /*WriteLock w_lock(_lock);*/
180 - _max = max;
177 + setMax(max.x, max.y, max.z);
178 + }
179 +
180 + inline void BoundingBox::set(const BoundingBox& bb) {
181 + set(bb._min, bb._max);
182 + }
183 +
184 + inline void BoundingBox::set(F32 minX, F32 minY, F32 minZ, F32 maxX, F32 maxY, F32 maxZ) {
185 + _min.set(minX, minY, minZ);
186 + _max.set(maxX, maxY, maxZ);
181 187 _pointsDirty = true;
182 188 }
183 189
184 - inline void BoundingBox::set(const BoundingBox& bb) { set(bb._min, bb._max); }
190 + inline void BoundingBox::setMin(F32 minX, F32 minY, F32 minZ) {
191 + _min.set(minX, minY, minZ);
192 + _pointsDirty = true;
193 + }
194 +
195 + inline void BoundingBox::setMax(F32 maxX, F32 maxY, F32 maxZ) {
196 + _max.set(maxX, maxY, maxZ);
197 + _pointsDirty = true;
198 + }
185 199
186 200 inline void BoundingBox::set(const vec3<F32>& min, const vec3<F32>& max) {
187 201 /*WriteLock w_lock(_lock);*/
  @@ -192,8 +206,8 @@
192 206
193 207 inline void BoundingBox::reset() {
194 208 /*WriteLock w_lock(_lock);*/
195 - _min.set(100000.0f, 100000.0f, 100000.0f);
196 - _max.set(-100000.0f, -100000.0f, -100000.0f);
209 + _min.set(std::numeric_limits<F32>::max());
210 + _max.set(std::numeric_limits<F32>::min());
197 211 _pointsDirty = true;
198 212 }
199 213