Commits

Michael Ludwig  committed e3fb4be

Fix bug in constructors computing bounds from arrays and buffers.

  • Participants
  • Parent commits 6c21756

Comments (0)

Files changed (1)

File ferox-math/src/main/java/com/ferox/math/AxisAlignedBox.java

         min.set(Float.POSITIVE_INFINITY, Float.POSITIVE_INFINITY, Float.POSITIVE_INFINITY);
 
         int realStride = 3 + stride;
-        for (int i = offset; i < numVertices; i += realStride)
+        for (int i = offset; i < numVertices * realStride; i += realStride)
             enclosePoint(vertices[i], vertices[i + 1], vertices[i + 2]); 
     }
 
         min.set(Float.POSITIVE_INFINITY, Float.POSITIVE_INFINITY, Float.POSITIVE_INFINITY);
         
         int realStride = 3 + stride;
-        for (int i = offset; i < numVertices; i += realStride)
+        for (int i = offset; i < numVertices * realStride; i += realStride)
             enclosePoint(vertices.get(i), vertices.get(i + 1), vertices.get(i + 2)); 
     }