Browse Source

Add start argument to Mesh:setVertices;

(cherry picked from commit ae496897f11c2f761164b54b54b95de7cd8281e6)
bjorn 7 years ago
parent
commit
c724bf69cd
2 changed files with 15 additions and 2 deletions
  1. 7 1
      api/init.lua
  2. 8 1
      api/lovr/graphics/Mesh/setVertices.lua

+ 7 - 1
api/init.lua

@@ -8354,7 +8354,7 @@ return {
               description = "Update multiple vertices in the Mesh.",
               key = "Mesh:setVertices",
               module = "lovr.graphics",
-              notes = "The number of vertices in the table should not exceed the maximum size of the Mesh.",
+              notes = "The start index plus the number of vertices in the table should not exceed the maximum size of the Mesh.",
               variants = {
                 {
                   arguments = {
@@ -8362,6 +8362,12 @@ return {
                       name = "vertices",
                       type = "table",
                       description = "The new set of vertices."
+                    },
+                    {
+                      name = "start",
+                      type = "number",
+                      description = "The index of the vertex to start replacing at.",
+                      default = "1"
                     }
                   },
                   returns = {}

+ 8 - 1
api/lovr/graphics/Mesh/setVertices.lua

@@ -6,10 +6,17 @@ return {
       name = 'vertices',
       type = 'table',
       description = 'The new set of vertices.'
+    },
+    {
+      name = 'start',
+      type = 'number',
+      default = '1',
+      description = 'The index of the vertex to start replacing at.'
     }
   },
   returns = {},
   notes = [[
-    The number of vertices in the table should not exceed the maximum size of the Mesh.
+    The start index plus the number of vertices in the table should not exceed the maximum size of
+    the Mesh.
   ]]
 }