Bladeren bron

minor fixes

dm 7 jaren geleden
bovenliggende
commit
b02c5c6fa8
3 gewijzigde bestanden met toevoegingen van 3 en 1 verwijderingen
  1. 1 1
      oxygine/src/oxygine/math/Matrix.h
  2. 1 0
      oxygine/src/oxygine/math/Rect.h
  3. 1 0
      oxygine/src/oxygine/math/Vector3.h

+ 1 - 1
oxygine/src/oxygine/math/Matrix.h

@@ -459,7 +459,7 @@ namespace oxygine
 
         T det = mat.m11 * t1 - mat.m12 * t2 + mat.m13 * t3 - mat.m14 * t4;
 
-        if (scalar::abs(det) < T(0.0001))
+        if (scalar::abs(det) < T(0.00000001))
         {
             out.identity();
             return out;

+ 1 - 0
oxygine/src/oxygine/math/Rect.h

@@ -140,6 +140,7 @@ namespace oxygine
         void moveBottom(T v) {size.y = v - pos.y;}
 
         void expand(const point2& v1, const point2& v2) {pos -= v1; size += v1 + v2;}
+        void expand2(const point2& v) { expand(v,v); }
 
         template<class R>
         RectT operator * (const VectorT2<R>& v) const

+ 1 - 0
oxygine/src/oxygine/math/Vector3.h

@@ -45,6 +45,7 @@ namespace oxygine
 
         void clamp(const VectorT3& min, const VectorT3& max);
         T length() const;
+        T sqlength() const { return dot(*this); }
         T dot(const VectorT3& p)  const;
 
         inline T& operator[](int i) {return m[i];}