From: Mikko Rasa Date: Tue, 1 Mar 2022 10:52:02 +0000 (+0200) Subject: Fix incorrect vertex array indexing in InstanceArray X-Git-Url: http://git.tdb.fi/?a=commitdiff_plain;h=cc270481e3e2f74d060ce2c63551970c835b06b8;p=libs%2Fgl.git Fix incorrect vertex array indexing in InstanceArray --- 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); }