samples: fix read from negative GeomVertexData row in fractal-plants

This commit is contained in:
rdb 2019-02-13 15:42:20 +01:00
parent 55ac585745
commit 2807d1d166

View File

@ -141,11 +141,14 @@ def drawBody(nodePath, vdata, pos, vecList, radius=1, keepDrawing=True, numVerti
drawReWriter.addData1f(keepDrawing)
currAngle += angleSlice
if startRow == 0:
return
drawReader = GeomVertexReader(vdata, "drawFlag")
drawReader.setRow(startRow - numVertices)
# we cant draw quads directly so we use Tristrips
if (startRow != 0) & (drawReader.getData1f() != False):
if drawReader.getData1i() != 0:
lines = GeomTristrips(Geom.UHStatic)
half = int(numVertices * 0.5)
for i in range(numVertices):