# HG changeset patch # User John Tsiombikas # Date 1440294324 -10800 # Node ID 1e8d90aeae34d1b63caf143462f3b1547a72d397 # Parent 7b1fa527b51bc0aeee502d9776890885d54c26a1 added Mesh::texcoord_gen_cylinder() diff -r 7b1fa527b51b -r 1e8d90aeae34 src/mesh.cc --- a/src/mesh.cc Sun Aug 23 04:31:29 2015 +0300 +++ b/src/mesh.cc Sun Aug 23 04:45:24 2015 +0300 @@ -982,6 +982,29 @@ } } +void Mesh::texcoord_gen_cylinder() +{ + if(!nverts) return; + + if(!has_attrib(MESH_ATTR_TEXCOORD)) { + // allocate texture coordinate attribute array + set_attrib_data(MESH_ATTR_TEXCOORD, 2, nverts); + } + + for(unsigned int i=0; i