diff options
Diffstat (limited to 'linden/indra/llmath/v2math.h')
-rw-r--r-- | linden/indra/llmath/v2math.h | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/linden/indra/llmath/v2math.h b/linden/indra/llmath/v2math.h index 1832403..c978fc0 100644 --- a/linden/indra/llmath/v2math.h +++ b/linden/indra/llmath/v2math.h | |||
@@ -317,6 +317,21 @@ inline LLVector2 operator-(const LLVector2 &a) | |||
317 | return LLVector2( -a.mV[0], -a.mV[1] ); | 317 | return LLVector2( -a.mV[0], -a.mV[1] ); |
318 | } | 318 | } |
319 | 319 | ||
320 | inline void update_min_max(LLVector2& min, LLVector2& max, const LLVector2& pos) | ||
321 | { | ||
322 | for (U32 i = 0; i < 2; i++) | ||
323 | { | ||
324 | if (min.mV[i] > pos.mV[i]) | ||
325 | { | ||
326 | min.mV[i] = pos.mV[i]; | ||
327 | } | ||
328 | if (max.mV[i] < pos.mV[i]) | ||
329 | { | ||
330 | max.mV[i] = pos.mV[i]; | ||
331 | } | ||
332 | } | ||
333 | } | ||
334 | |||
320 | inline std::ostream& operator<<(std::ostream& s, const LLVector2 &a) | 335 | inline std::ostream& operator<<(std::ostream& s, const LLVector2 &a) |
321 | { | 336 | { |
322 | s << "{ " << a.mV[VX] << ", " << a.mV[VY] << " }"; | 337 | s << "{ " << a.mV[VX] << ", " << a.mV[VY] << " }"; |