Browse Source

IntVector2 constructor from float array

Rokas Kupstys 8 years ago
parent
commit
7fd9c4d9f6
1 changed files with 8 additions and 1 deletions
  1. 8 1
      Source/Atomic/Math/Vector2.h

+ 8 - 1
Source/Atomic/Math/Vector2.h

@@ -52,7 +52,14 @@ public:
         y_(data[1])
         y_(data[1])
     {
     {
     }
     }
-
+    // ATOMIC BEGIN
+    /// Construct from an int array.
+    IntVector2(const float* data) :
+        x_((int)data[0]),
+        y_((int)data[1])
+    {
+    }
+    // ATOMIC END
     /// Copy-construct from another vector.
     /// Copy-construct from another vector.
     IntVector2(const IntVector2& rhs) :
     IntVector2(const IntVector2& rhs) :
         x_(rhs.x_),
         x_(rhs.x_),