From cc270481e3e2f74d060ce2c63551970c835b06b8 Mon Sep 17 00:00:00 2001 From: Mikko Rasa Date: Tue, 1 Mar 2022 12:52:02 +0200 Subject: [PATCH] Fix incorrect vertex array indexing in InstanceArray --- source/render/instancearray.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/source/render/instancearray.cpp b/source/render/instancearray.cpp index a838b948..a03fbf20 100644 --- a/source/render/instancearray.cpp +++ b/source/render/instancearray.cpp @@ -85,7 +85,7 @@ void InstanceArray::update_instance_matrix(unsigned index) { const Matrix &m = *instances[index]->get_matrix(); - float *d = reinterpret_cast(instance_data.modify(instances.size()-1)+matrix_offset); + float *d = reinterpret_cast(instance_data.modify(index)+matrix_offset); for(unsigned i=0; i<12; ++i) d[i] = m(i/4, i%4); } -- 2.45.2