math::vec2 Triangle::get_texture_coords_interpolated( Mesh const& mesh, math::vec3 const& position) const { math::vec2 tex_coords(0, 0); tex_coords = math::interpolate(position, std::make_pair(mesh_vertex(mesh,face_id_,0), mesh_texcoord(mesh,face_id_,0)), std::make_pair(mesh_vertex(mesh,face_id_,1), mesh_texcoord(mesh,face_id_,1)), std::make_pair(mesh_vertex(mesh,face_id_,2), mesh_texcoord(mesh,face_id_,2)) ); return tex_coords; }
inline void append_texcoords(const vec2 *theVerts, size_t numVerts) { tex_coords().insert(m_tex_coords.end(), theVerts, theVerts + numVerts); }
inline void append_tex_coords(const std::vector<vec2> &theVerts) { tex_coords().insert(m_tex_coords.end(), theVerts.begin(), theVerts.end()); }
inline void append_tex_coord(const vec2 &theUV) { tex_coords().push_back(theUV); };
inline void append_tex_coord(float theU, float theV) { tex_coords().push_back(vec2(theU, theV)); };