diff options
Diffstat (limited to 'dev/MinGfx/docs/html/classmingfx_1_1_mesh.html')
-rw-r--r-- | dev/MinGfx/docs/html/classmingfx_1_1_mesh.html | 2262 |
1 files changed, 1131 insertions, 1131 deletions
diff --git a/dev/MinGfx/docs/html/classmingfx_1_1_mesh.html b/dev/MinGfx/docs/html/classmingfx_1_1_mesh.html index 785bff3..33bca85 100644 --- a/dev/MinGfx/docs/html/classmingfx_1_1_mesh.html +++ b/dev/MinGfx/docs/html/classmingfx_1_1_mesh.html @@ -1,1131 +1,1131 @@ -<!-- HTML header for doxygen 1.8.9.1--> -<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> -<html xmlns="http://www.w3.org/1999/xhtml"> -<head> -<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/> -<meta http-equiv="X-UA-Compatible" content="IE=9"/> -<meta name="generator" content="Doxygen 1.9.1"/> -<title>MinGfx Toolkit: mingfx::Mesh Class Reference</title> -<link href="tabs.css" rel="stylesheet" type="text/css"/> -<script type="text/javascript" src="jquery.js"></script> -<script type="text/javascript" src="dynsections.js"></script> -<link href="search/search.css" rel="stylesheet" type="text/css"/> -<script type="text/javascript" src="search/searchdata.js"></script> -<script type="text/javascript" src="search/search.js"></script> -<script type="text/x-mathjax-config"> - MathJax.Hub.Config({ - extensions: ["tex2jax.js"], - jax: ["input/TeX","output/HTML-CSS"], -}); -</script> -<script type="text/javascript" async="async" src="http://cdn.mathjax.org/mathjax/latest/MathJax.js"></script> -<link href="doxygen.css" rel="stylesheet" type="text/css" /> -<link href="customdoxygen.css" rel="stylesheet" type="text/css"/> -</head> -<body> -<div id="top"><!-- do not remove this div, it is closed by doxygen! --> -<div id="titlearea"> -<table cellspacing="0" cellpadding="0"> - <tbody> - <tr style="height: 56px;"> - <td style="padding-left: 0.5em;"> - <div id="projectname">MinGfx Toolkit -  <span id="projectnumber">1.0</span> - </div> - <div id="projectbrief">A minimal library for writing cross-platform (Windows, OSX, linux) graphics programs.</div> - </td> - </tr> - </tbody> -</table> -</div> -<!-- end header part --> -<!-- Generated by Doxygen 1.9.1 --> -<script type="text/javascript"> -/* @license magnet:?xt=urn:btih:cf05388f2679ee054f2beb29a391d25f4e673ac3&dn=gpl-2.0.txt GPL-v2 */ -var searchBox = new SearchBox("searchBox", "search",false,'Search','.html'); -/* @license-end */ -</script> -<script type="text/javascript" src="menudata.js"></script> -<script type="text/javascript" src="menu.js"></script> -<script type="text/javascript"> -/* @license magnet:?xt=urn:btih:cf05388f2679ee054f2beb29a391d25f4e673ac3&dn=gpl-2.0.txt GPL-v2 */ -$(function() { - initMenu('',true,false,'search.php','Search'); - $(document).ready(function() { init_search(); }); -}); -/* @license-end */</script> -<div id="main-nav"></div> -<!-- window showing the filter options --> -<div id="MSearchSelectWindow" - onmouseover="return searchBox.OnSearchSelectShow()" - onmouseout="return searchBox.OnSearchSelectHide()" - onkeydown="return searchBox.OnSearchSelectKey(event)"> -</div> - -<!-- iframe showing the search results (closed by default) --> -<div id="MSearchResultsWindow"> -<iframe src="javascript:void(0)" frameborder="0" - name="MSearchResults" id="MSearchResults"> -</iframe> -</div> - -<div id="nav-path" class="navpath"> - <ul> -<li class="navelem"><a class="el" href="namespacemingfx.html">mingfx</a></li><li class="navelem"><a class="el" href="classmingfx_1_1_mesh.html">Mesh</a></li> </ul> -</div> -</div><!-- top --> -<div class="header"> - <div class="summary"> -<a href="#pub-methods">Public Member Functions</a> | -<a href="classmingfx_1_1_mesh-members.html">List of all members</a> </div> - <div class="headertitle"> -<div class="title">mingfx::Mesh Class Reference</div> </div> -</div><!--header--> -<div class="contents"> -<a name="details" id="details"></a><h2 class="groupheader">Detailed Description</h2> -<div class="textblock"><p>A triangle mesh data structure that can be rendered with a <a class="el" href="classmingfx_1_1_shader_program.html" title="A wrapper around GLSL shader programs.">ShaderProgram</a> like <a class="el" href="classmingfx_1_1_default_shader.html" title="A simple GLSL shader for textured per-fragment Phong shading with multiple light sources.">DefaultShader</a>. </p> -<p>The mesh can be created algorithmically by adding triangles one at a time or it can be loaded from an .obj file.</p> -<p>Vertices are required – you cannot have a mesh without vertices, but other attributes (normals, colors, texture coordinates) are optional. When <a class="el" href="classmingfx_1_1_mesh.html#a75075d472938fd760477be42585aff5c" title="This sends the mesh vertices and attributes down the graphics pipe using glDrawArrays() for the non-i...">Draw()</a> is called the mesh will automatically set these other attributes if available.</p> -<p>Example of loading from a file: </p><div class="fragment"><div class="line"><span class="comment">// during initialization</span></div> -<div class="line"><a class="code" href="classmingfx_1_1_mesh.html#a69613870d54989f4226e50caf4ca9fb9">Mesh</a> m;</div> -<div class="line">m.LoadFromOBJ(<a class="code" href="classmingfx_1_1_platform.html#a2c36ca57a246efa218a49a942c8c4a3b">Platform::FindMinGfxDataFile</a>(<span class="stringliteral">"teapot.obj"</span>));</div> -<div class="line"><span class="comment">// also create a shader to draw it.</span></div> -<div class="line">DefaultShader s;</div> -<div class="line"> </div> -<div class="line"> </div> -<div class="line"><span class="comment">// later to draw</span></div> -<div class="line">Matrix4 M;</div> -<div class="line">Matrix4 V = <a class="code" href="classmingfx_1_1_matrix4.html#a4543695a6dfc996d0312b70c2eaa00de">Matrix4::LookAt</a>(Point3(0,0,3), Point3(0,0,0), Vector3(0,1,0));</div> -<div class="line">Matrix4 P = <a class="code" href="classmingfx_1_1_matrix4.html#a0e34aee86758a0397074590b87712c5e">Matrix4::Perspective</a>(60.0, aspect_ratio(), 0.1, 10.0);</div> -<div class="line">s.Draw(M, V, P, m, DefaultShader::MaterialProperties());</div> -<div class="ttc" id="aclassmingfx_1_1_matrix4_html_a0e34aee86758a0397074590b87712c5e"><div class="ttname"><a href="classmingfx_1_1_matrix4.html#a0e34aee86758a0397074590b87712c5e">mingfx::Matrix4::Perspective</a></div><div class="ttdeci">static Matrix4 Perspective(float fov_y_in_degrees, float aspect_ratio, float near_plane_dist, float far_plane_dist)</div><div class="ttdoc">Returns a perspective projection matrix equivalent to the one gluPerspective creates.</div></div> -<div class="ttc" id="aclassmingfx_1_1_matrix4_html_a4543695a6dfc996d0312b70c2eaa00de"><div class="ttname"><a href="classmingfx_1_1_matrix4.html#a4543695a6dfc996d0312b70c2eaa00de">mingfx::Matrix4::LookAt</a></div><div class="ttdeci">static Matrix4 LookAt(Point3 eye, Point3 target, Vector3 up)</div><div class="ttdoc">Returns a view matrix that centers the camera at the 'eye' position and orients it to look at the des...</div></div> -<div class="ttc" id="aclassmingfx_1_1_mesh_html_a69613870d54989f4226e50caf4ca9fb9"><div class="ttname"><a href="classmingfx_1_1_mesh.html#a69613870d54989f4226e50caf4ca9fb9">mingfx::Mesh::Mesh</a></div><div class="ttdeci">Mesh()</div><div class="ttdoc">Creates an empty mesh.</div></div> -<div class="ttc" id="aclassmingfx_1_1_platform_html_a2c36ca57a246efa218a49a942c8c4a3b"><div class="ttname"><a href="classmingfx_1_1_platform.html#a2c36ca57a246efa218a49a942c8c4a3b">mingfx::Platform::FindMinGfxDataFile</a></div><div class="ttdeci">static std::string FindMinGfxDataFile(const std::string &basename)</div><div class="ttdoc">Searches for a data file that ships with MinGfx.</div></div> -</div><!-- fragment --><p>Example of creating a mesh algorithmically: </p><div class="fragment"><div class="line"><a class="code" href="classmingfx_1_1_mesh.html#a69613870d54989f4226e50caf4ca9fb9">Mesh</a> mesh1;</div> -<div class="line"><span class="keywordtype">int</span> tri_id;</div> -<div class="line"><span class="comment">// add a first triangle</span></div> -<div class="line">tri_id = mesh1.AddTriangle(Point3(0,0,0), Point3(1,0,0), Point3(1,1,0));</div> -<div class="line"><span class="comment">// set attributes for the vertices</span></div> -<div class="line">mesh1.SetNormals(tri_id, Vector3(0,0,1), Vector3(0,0,1), Vector3(0,0,1));</div> -<div class="line">mesh1.SetTexCoords(tri_id, 0, Point2(0,1), Point2(1,1), Point2(1,0));</div> -<div class="line"> </div> -<div class="line"><span class="comment">// add a second triangle and attributes</span></div> -<div class="line">tri_id = mesh1.AddTriangle(Point3(0,0,0), Point3(1,1,0), Point3(0,1,0));</div> -<div class="line">mesh1.SetNormals(tri_id, Vector3(0,0,1), Vector3(0,0,1), Vector3(0,0,1));</div> -<div class="line">mesh1.SetTexCoords(tri_id, 0, Point2(0,1), Point2(1,0), Point2(0,0));</div> -<div class="line"> </div> -<div class="line"><span class="comment">// call this when done to save to the GPU</span></div> -<div class="line">mesh1.UpdateGPUMemory();</div> -<div class="line"> </div> -<div class="line"><span class="comment">// then you can draw the same way as in the previous example.</span></div> -</div><!-- fragment --><p> In the mode used above where you add one triangle at a time there is no way to reuse vertices in multiple triangles. If you need to do this for efficiency or other reasons, then you can use an indexed faces mode where you set the mesh data structures directly.</p> -<p>Example of creating a mesh that renders in an indexed faces mode: </p><div class="fragment"><div class="line">std::vector<unsigned int> indices;</div> -<div class="line">std::vector<Point3> vertices;</div> -<div class="line">std::vector<Vector3> normals;</div> -<div class="line">std::vector<Point2> texcoords;</div> -<div class="line"> </div> -<div class="line"><span class="comment">// four vertices, each requires 3 floats: (x,y,z)</span></div> -<div class="line">vertices.push_back(Point3(0,0,0));</div> -<div class="line">vertices.push_back(Point3(1,0,0));</div> -<div class="line">vertices.push_back(Point3(1,1,0));</div> -<div class="line">vertices.push_back(Point3(0,1,0));</div> -<div class="line"> </div> -<div class="line"><span class="comment">// four normals, each requires 3 floats: (x,y,z)</span></div> -<div class="line">normals.push_back(Vector3(0,0,1));</div> -<div class="line">normals.push_back(Vector3(0,0,1));</div> -<div class="line">normals.push_back(Vector3(0,0,1));</div> -<div class="line">normals.push_back(Vector3(0,0,1));</div> -<div class="line"> </div> -<div class="line"><span class="comment">// four texture coords, each requires 2 floats: (u,v)</span></div> -<div class="line">texcoords.push_back(Point2(0,1));</div> -<div class="line">texcoords.push_back(Point2(1,1));</div> -<div class="line">texcoords.push_back(Point2(1,0));</div> -<div class="line">texcoords.push_back(Point2(0,0));</div> -<div class="line"> </div> -<div class="line"><span class="comment">// indices into the arrays above for the first triangle</span></div> -<div class="line">indices.push_back(0); </div> -<div class="line">indices.push_back(1); </div> -<div class="line">indices.push_back(2);</div> -<div class="line"> </div> -<div class="line"><span class="comment">// indices for the second triangle, note some are reused</span></div> -<div class="line">indices.push_back(0); </div> -<div class="line">indices.push_back(2); </div> -<div class="line">indices.push_back(3);</div> -<div class="line"> </div> -<div class="line"><a class="code" href="classmingfx_1_1_mesh.html#a69613870d54989f4226e50caf4ca9fb9">Mesh</a> mesh1;</div> -<div class="line">mesh1.SetVertices(vertices);</div> -<div class="line">mesh1.SetNormals(normals);</div> -<div class="line">mesh1.SetTexCoords(0, texcoords);</div> -<div class="line">mesh1.SetIndices(indices);</div> -<div class="line">mesh1.UpdateGPUMemory();</div> -<div class="line"> </div> -<div class="line"><span class="comment">// then you can draw the same way as in the previous example.</span></div> -</div><!-- fragment --> -<p class="definition">Definition at line <a class="el" href="mesh_8h_source.html#l00127">127</a> of file <a class="el" href="mesh_8h_source.html">mesh.h</a>.</p> -</div> -<p><code>#include <<a class="el" href="mesh_8h_source.html">mesh.h</a>></code></p> -<table class="memberdecls"> -<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="pub-methods"></a> -Public Member Functions</h2></td></tr> -<tr class="memitem:a69613870d54989f4226e50caf4ca9fb9"><td class="memItemLeft" align="right" valign="top"> </td><td class="memItemRight" valign="bottom"><a class="el" href="classmingfx_1_1_mesh.html#a69613870d54989f4226e50caf4ca9fb9">Mesh</a> ()</td></tr> -<tr class="memdesc:a69613870d54989f4226e50caf4ca9fb9"><td class="mdescLeft"> </td><td class="mdescRight">Creates an empty mesh. <a href="classmingfx_1_1_mesh.html#a69613870d54989f4226e50caf4ca9fb9">More...</a><br /></td></tr> -<tr class="separator:a69613870d54989f4226e50caf4ca9fb9"><td class="memSeparator" colspan="2"> </td></tr> -<tr class="memitem:a76b4977f0a7f156aa8a0027f10dcbdc1"><td class="memItemLeft" align="right" valign="top"> </td><td class="memItemRight" valign="bottom"><a class="el" href="classmingfx_1_1_mesh.html#a76b4977f0a7f156aa8a0027f10dcbdc1">Mesh</a> (const <a class="el" href="classmingfx_1_1_mesh.html">Mesh</a> &other)</td></tr> -<tr class="memdesc:a76b4977f0a7f156aa8a0027f10dcbdc1"><td class="mdescLeft"> </td><td class="mdescRight">Copies all data and sets GPU dirty bit for the new mesh. <a href="classmingfx_1_1_mesh.html#a76b4977f0a7f156aa8a0027f10dcbdc1">More...</a><br /></td></tr> -<tr class="separator:a76b4977f0a7f156aa8a0027f10dcbdc1"><td class="memSeparator" colspan="2"> </td></tr> -<tr class="memitem:ace7b23730dbcb581c4886cf2b9998327"><td class="memItemLeft" align="right" valign="top">virtual </td><td class="memItemRight" valign="bottom"><a class="el" href="classmingfx_1_1_mesh.html#ace7b23730dbcb581c4886cf2b9998327">~Mesh</a> ()</td></tr> -<tr class="separator:ace7b23730dbcb581c4886cf2b9998327"><td class="memSeparator" colspan="2"> </td></tr> -<tr class="memitem:a8d05faf18ef8d170fc3c2a343075823f"><td class="memItemLeft" align="right" valign="top">void </td><td class="memItemRight" valign="bottom"><a class="el" href="classmingfx_1_1_mesh.html#a8d05faf18ef8d170fc3c2a343075823f">LoadFromOBJ</a> (const std::string &filename)</td></tr> -<tr class="memdesc:a8d05faf18ef8d170fc3c2a343075823f"><td class="mdescLeft"> </td><td class="mdescRight">This reads a mesh stored in the common Wavefront Obj file format. <a href="classmingfx_1_1_mesh.html#a8d05faf18ef8d170fc3c2a343075823f">More...</a><br /></td></tr> -<tr class="separator:a8d05faf18ef8d170fc3c2a343075823f"><td class="memSeparator" colspan="2"> </td></tr> -<tr class="memitem:a29eeb2e778704350789033ec4940d55a"><td class="memItemLeft" align="right" valign="top">int </td><td class="memItemRight" valign="bottom"><a class="el" href="classmingfx_1_1_mesh.html#a29eeb2e778704350789033ec4940d55a">AddTriangle</a> (<a class="el" href="classmingfx_1_1_point3.html">Point3</a> v1, <a class="el" href="classmingfx_1_1_point3.html">Point3</a> v2, <a class="el" href="classmingfx_1_1_point3.html">Point3</a> v3)</td></tr> -<tr class="memdesc:a29eeb2e778704350789033ec4940d55a"><td class="mdescLeft"> </td><td class="mdescRight">Adds a triangle to the mesh datastructure and returns a triangle ID. <a href="classmingfx_1_1_mesh.html#a29eeb2e778704350789033ec4940d55a">More...</a><br /></td></tr> -<tr class="separator:a29eeb2e778704350789033ec4940d55a"><td class="memSeparator" colspan="2"> </td></tr> -<tr class="memitem:a3e0ac86714f6b7c3f62761ef3952a044"><td class="memItemLeft" align="right" valign="top">void </td><td class="memItemRight" valign="bottom"><a class="el" href="classmingfx_1_1_mesh.html#a3e0ac86714f6b7c3f62761ef3952a044">UpdateTriangle</a> (int triangle_id, <a class="el" href="classmingfx_1_1_point3.html">Point3</a> v1, <a class="el" href="classmingfx_1_1_point3.html">Point3</a> v2, <a class="el" href="classmingfx_1_1_point3.html">Point3</a> v3)</td></tr> -<tr class="memdesc:a3e0ac86714f6b7c3f62761ef3952a044"><td class="mdescLeft"> </td><td class="mdescRight">Updates the vertex positions for a triangle that has already been added to the mesh. <a href="classmingfx_1_1_mesh.html#a3e0ac86714f6b7c3f62761ef3952a044">More...</a><br /></td></tr> -<tr class="separator:a3e0ac86714f6b7c3f62761ef3952a044"><td class="memSeparator" colspan="2"> </td></tr> -<tr class="memitem:a43d5a5cc3ef742a8c2b5e3f1b4da0903"><td class="memItemLeft" align="right" valign="top">void </td><td class="memItemRight" valign="bottom"><a class="el" href="classmingfx_1_1_mesh.html#a43d5a5cc3ef742a8c2b5e3f1b4da0903">SetNormals</a> (int triangle_id, <a class="el" href="classmingfx_1_1_vector3.html">Vector3</a> n1, <a class="el" href="classmingfx_1_1_vector3.html">Vector3</a> n2, <a class="el" href="classmingfx_1_1_vector3.html">Vector3</a> n3)</td></tr> -<tr class="memdesc:a43d5a5cc3ef742a8c2b5e3f1b4da0903"><td class="mdescLeft"> </td><td class="mdescRight">Sets the normals for the three vertices of a triangle that has already been added to the mesh. <a href="classmingfx_1_1_mesh.html#a43d5a5cc3ef742a8c2b5e3f1b4da0903">More...</a><br /></td></tr> -<tr class="separator:a43d5a5cc3ef742a8c2b5e3f1b4da0903"><td class="memSeparator" colspan="2"> </td></tr> -<tr class="memitem:a0f59e19b74f4f9dc2ad580756f8b319f"><td class="memItemLeft" align="right" valign="top">void </td><td class="memItemRight" valign="bottom"><a class="el" href="classmingfx_1_1_mesh.html#a0f59e19b74f4f9dc2ad580756f8b319f">SetColors</a> (int triangle_id, <a class="el" href="classmingfx_1_1_color.html">Color</a> c1, <a class="el" href="classmingfx_1_1_color.html">Color</a> c2, <a class="el" href="classmingfx_1_1_color.html">Color</a> c3)</td></tr> -<tr class="memdesc:a0f59e19b74f4f9dc2ad580756f8b319f"><td class="mdescLeft"> </td><td class="mdescRight">Sets per-vertex colors for the three vertices of a triangle that has already been added to the mesh. <a href="classmingfx_1_1_mesh.html#a0f59e19b74f4f9dc2ad580756f8b319f">More...</a><br /></td></tr> -<tr class="separator:a0f59e19b74f4f9dc2ad580756f8b319f"><td class="memSeparator" colspan="2"> </td></tr> -<tr class="memitem:a17cb896939007357014c74a1ece6f1f3"><td class="memItemLeft" align="right" valign="top">void </td><td class="memItemRight" valign="bottom"><a class="el" href="classmingfx_1_1_mesh.html#a17cb896939007357014c74a1ece6f1f3">SetTexCoords</a> (int triangle_id, int texture_unit, <a class="el" href="classmingfx_1_1_point2.html">Point2</a> uv1, <a class="el" href="classmingfx_1_1_point2.html">Point2</a> uv2, <a class="el" href="classmingfx_1_1_point2.html">Point2</a> uv3)</td></tr> -<tr class="memdesc:a17cb896939007357014c74a1ece6f1f3"><td class="mdescLeft"> </td><td class="mdescRight">Sets the texture coordinates for the three vertices of a triangle that has already been added to the mesh. <a href="classmingfx_1_1_mesh.html#a17cb896939007357014c74a1ece6f1f3">More...</a><br /></td></tr> -<tr class="separator:a17cb896939007357014c74a1ece6f1f3"><td class="memSeparator" colspan="2"> </td></tr> -<tr class="memitem:a1dd243b53826765ba468f505645102a6"><td class="memItemLeft" align="right" valign="top">void </td><td class="memItemRight" valign="bottom"><a class="el" href="classmingfx_1_1_mesh.html#a1dd243b53826765ba468f505645102a6">SetVertices</a> (const std::vector< <a class="el" href="classmingfx_1_1_point3.html">Point3</a> > &verts)</td></tr> -<tr class="memdesc:a1dd243b53826765ba468f505645102a6"><td class="mdescLeft"> </td><td class="mdescRight">Sets the vertex array for the mesh directly. <a href="classmingfx_1_1_mesh.html#a1dd243b53826765ba468f505645102a6">More...</a><br /></td></tr> -<tr class="separator:a1dd243b53826765ba468f505645102a6"><td class="memSeparator" colspan="2"> </td></tr> -<tr class="memitem:ad28dbd5b0ab77bec28f30f618dd9e57d"><td class="memItemLeft" align="right" valign="top">void </td><td class="memItemRight" valign="bottom"><a class="el" href="classmingfx_1_1_mesh.html#ad28dbd5b0ab77bec28f30f618dd9e57d">SetNormals</a> (const std::vector< <a class="el" href="classmingfx_1_1_vector3.html">Vector3</a> > &norms)</td></tr> -<tr class="memdesc:ad28dbd5b0ab77bec28f30f618dd9e57d"><td class="mdescLeft"> </td><td class="mdescRight">Sets the normal array for the mesh directly. <a href="classmingfx_1_1_mesh.html#ad28dbd5b0ab77bec28f30f618dd9e57d">More...</a><br /></td></tr> -<tr class="separator:ad28dbd5b0ab77bec28f30f618dd9e57d"><td class="memSeparator" colspan="2"> </td></tr> -<tr class="memitem:ab9b05a77591a9adad12032d513256dae"><td class="memItemLeft" align="right" valign="top">void </td><td class="memItemRight" valign="bottom"><a class="el" href="classmingfx_1_1_mesh.html#ab9b05a77591a9adad12032d513256dae">SetColors</a> (const std::vector< <a class="el" href="classmingfx_1_1_color.html">Color</a> > &colors)</td></tr> -<tr class="memdesc:ab9b05a77591a9adad12032d513256dae"><td class="mdescLeft"> </td><td class="mdescRight">Sets the per-vertex colors array for the mesh directly. <a href="classmingfx_1_1_mesh.html#ab9b05a77591a9adad12032d513256dae">More...</a><br /></td></tr> -<tr class="separator:ab9b05a77591a9adad12032d513256dae"><td class="memSeparator" colspan="2"> </td></tr> -<tr class="memitem:aba2dfd0ade2d8a728897d411ef3fdaf1"><td class="memItemLeft" align="right" valign="top">void </td><td class="memItemRight" valign="bottom"><a class="el" href="classmingfx_1_1_mesh.html#aba2dfd0ade2d8a728897d411ef3fdaf1">SetTexCoords</a> (int texture_unit, const std::vector< <a class="el" href="classmingfx_1_1_point2.html">Point2</a> > &tex_coords)</td></tr> -<tr class="memdesc:aba2dfd0ade2d8a728897d411ef3fdaf1"><td class="mdescLeft"> </td><td class="mdescRight">Sets a texture coordinates array for the mesh directly. <a href="classmingfx_1_1_mesh.html#aba2dfd0ade2d8a728897d411ef3fdaf1">More...</a><br /></td></tr> -<tr class="separator:aba2dfd0ade2d8a728897d411ef3fdaf1"><td class="memSeparator" colspan="2"> </td></tr> -<tr class="memitem:a1f94c9ca7867b65e04f7e02813a06581"><td class="memItemLeft" align="right" valign="top">void </td><td class="memItemRight" valign="bottom"><a class="el" href="classmingfx_1_1_mesh.html#a1f94c9ca7867b65e04f7e02813a06581">SetIndices</a> (const std::vector< unsigned int > index_array)</td></tr> -<tr class="memdesc:a1f94c9ca7867b65e04f7e02813a06581"><td class="mdescLeft"> </td><td class="mdescRight">Sets the indices into the vertex array to use to create the triangles. Each consecutive set of 3 indices forms one triangle: (v1,v2,v3), (v1,v2,v3), (v1,v2,v3), ... <a href="classmingfx_1_1_mesh.html#a1f94c9ca7867b65e04f7e02813a06581">More...</a><br /></td></tr> -<tr class="separator:a1f94c9ca7867b65e04f7e02813a06581"><td class="memSeparator" colspan="2"> </td></tr> -<tr class="memitem:a7175238f5874929e2258458b98421d87"><td class="memItemLeft" align="right" valign="top">void </td><td class="memItemRight" valign="bottom"><a class="el" href="classmingfx_1_1_mesh.html#a7175238f5874929e2258458b98421d87">SetInstanceTransforms</a> (const std::vector< <a class="el" href="classmingfx_1_1_matrix4.html">Matrix4</a> > &xforms)</td></tr> -<tr class="separator:a7175238f5874929e2258458b98421d87"><td class="memSeparator" colspan="2"> </td></tr> -<tr class="memitem:a033076b9bf1714c9b9e0eeef11ebcd49"><td class="memItemLeft" align="right" valign="top">void </td><td class="memItemRight" valign="bottom"><a class="el" href="classmingfx_1_1_mesh.html#a033076b9bf1714c9b9e0eeef11ebcd49">SetVertices</a> (float *verts_array, int num_verts)</td></tr> -<tr class="memdesc:a033076b9bf1714c9b9e0eeef11ebcd49"><td class="mdescLeft"> </td><td class="mdescRight">Sets the vertex array for the mesh directly. Vertices are stored as (x,y,z), (x,y,z), (x,y,z), ... This version of the function accepts a C-style array rather than std::vector<> <a href="classmingfx_1_1_mesh.html#a033076b9bf1714c9b9e0eeef11ebcd49">More...</a><br /></td></tr> -<tr class="separator:a033076b9bf1714c9b9e0eeef11ebcd49"><td class="memSeparator" colspan="2"> </td></tr> -<tr class="memitem:a6ab1128fab6f969564d3a1329baeade6"><td class="memItemLeft" align="right" valign="top">void </td><td class="memItemRight" valign="bottom"><a class="el" href="classmingfx_1_1_mesh.html#a6ab1128fab6f969564d3a1329baeade6">SetNormals</a> (float *norms_array, int num_norms)</td></tr> -<tr class="memdesc:a6ab1128fab6f969564d3a1329baeade6"><td class="mdescLeft"> </td><td class="mdescRight">Sets the normal array for the mesh directly. Normals are stored as (x,y,z), (x,y,z), (x,y,z), ... following the same ordering as was used for <a class="el" href="classmingfx_1_1_mesh.html#a1dd243b53826765ba468f505645102a6" title="Sets the vertex array for the mesh directly.">SetVertices()</a>. This version of the function accepts a C-style array rather than std::vector<> <a href="classmingfx_1_1_mesh.html#a6ab1128fab6f969564d3a1329baeade6">More...</a><br /></td></tr> -<tr class="separator:a6ab1128fab6f969564d3a1329baeade6"><td class="memSeparator" colspan="2"> </td></tr> -<tr class="memitem:aed172bdd77858f3b59978cb8527e19ae"><td class="memItemLeft" align="right" valign="top">void </td><td class="memItemRight" valign="bottom"><a class="el" href="classmingfx_1_1_mesh.html#aed172bdd77858f3b59978cb8527e19ae">SetColors</a> (float *colors_array, int num_colors)</td></tr> -<tr class="memdesc:aed172bdd77858f3b59978cb8527e19ae"><td class="mdescLeft"> </td><td class="mdescRight">Sets the per-vertex colors array for the mesh directly. Colors are stored as (r,g,b,a), (r,g,b,a), (r,g,b,a), ... following the same ordering as was used for <a class="el" href="classmingfx_1_1_mesh.html#a1dd243b53826765ba468f505645102a6" title="Sets the vertex array for the mesh directly.">SetVertices()</a>. This version of the function accepts a C-style array rather than std::vector<> <a href="classmingfx_1_1_mesh.html#aed172bdd77858f3b59978cb8527e19ae">More...</a><br /></td></tr> -<tr class="separator:aed172bdd77858f3b59978cb8527e19ae"><td class="memSeparator" colspan="2"> </td></tr> -<tr class="memitem:ac9cd4e8d67bb70295a48fcbc72ae32f9"><td class="memItemLeft" align="right" valign="top">void </td><td class="memItemRight" valign="bottom"><a class="el" href="classmingfx_1_1_mesh.html#ac9cd4e8d67bb70295a48fcbc72ae32f9">SetTexCoords</a> (int texture_unit, float *tex_coords_array, int num_tex_coords)</td></tr> -<tr class="memdesc:ac9cd4e8d67bb70295a48fcbc72ae32f9"><td class="mdescLeft"> </td><td class="mdescRight">Sets a texture coordinates array for the mesh directly. Tex coords are stored as (u,v), (u,v), (u,v), ... following the same ordering as was used for <a class="el" href="classmingfx_1_1_mesh.html#a1dd243b53826765ba468f505645102a6" title="Sets the vertex array for the mesh directly.">SetVertices()</a>. This version of the function accepts a C-style array rather than std::vector<> <a href="classmingfx_1_1_mesh.html#ac9cd4e8d67bb70295a48fcbc72ae32f9">More...</a><br /></td></tr> -<tr class="separator:ac9cd4e8d67bb70295a48fcbc72ae32f9"><td class="memSeparator" colspan="2"> </td></tr> -<tr class="memitem:a84711746b8d37c8d9b12ae748a4c5b8c"><td class="memItemLeft" align="right" valign="top">void </td><td class="memItemRight" valign="bottom"><a class="el" href="classmingfx_1_1_mesh.html#a84711746b8d37c8d9b12ae748a4c5b8c">SetIndices</a> (unsigned int *index_array, int num_indices)</td></tr> -<tr class="memdesc:a84711746b8d37c8d9b12ae748a4c5b8c"><td class="mdescLeft"> </td><td class="mdescRight">Sets the indices into the vertex array to use to create the triangles. Each consecutive set of 3 indices forms one triangle: (v1,v2,v3), (v1,v2,v3), (v1,v2,v3), ... This version of the function accepts a C-style array rather than std::vector<> <a href="classmingfx_1_1_mesh.html#a84711746b8d37c8d9b12ae748a4c5b8c">More...</a><br /></td></tr> -<tr class="separator:a84711746b8d37c8d9b12ae748a4c5b8c"><td class="memSeparator" colspan="2"> </td></tr> -<tr class="memitem:ac74345bf4b2994de4ee1c509bcc6840e"><td class="memItemLeft" align="right" valign="top">void </td><td class="memItemRight" valign="bottom"><a class="el" href="classmingfx_1_1_mesh.html#ac74345bf4b2994de4ee1c509bcc6840e">UpdateGPUMemory</a> ()</td></tr> -<tr class="memdesc:ac74345bf4b2994de4ee1c509bcc6840e"><td class="mdescLeft"> </td><td class="mdescRight">This copies the entire mesh data structure to a vertex array in GPU memory, which must happen before you can draw the mesh. <a href="classmingfx_1_1_mesh.html#ac74345bf4b2994de4ee1c509bcc6840e">More...</a><br /></td></tr> -<tr class="separator:ac74345bf4b2994de4ee1c509bcc6840e"><td class="memSeparator" colspan="2"> </td></tr> -<tr class="memitem:a75075d472938fd760477be42585aff5c"><td class="memItemLeft" align="right" valign="top">void </td><td class="memItemRight" valign="bottom"><a class="el" href="classmingfx_1_1_mesh.html#a75075d472938fd760477be42585aff5c">Draw</a> ()</td></tr> -<tr class="memdesc:a75075d472938fd760477be42585aff5c"><td class="mdescLeft"> </td><td class="mdescRight">This sends the mesh vertices and attributes down the graphics pipe using glDrawArrays() for the non-indexed mode and glDrawElements() for the indexed mode. <a href="classmingfx_1_1_mesh.html#a75075d472938fd760477be42585aff5c">More...</a><br /></td></tr> -<tr class="separator:a75075d472938fd760477be42585aff5c"><td class="memSeparator" colspan="2"> </td></tr> -<tr class="memitem:a1a5cea9cfdf4c672ba0c781ee54718f7"><td class="memItemLeft" align="right" valign="top">void </td><td class="memItemRight" valign="bottom"><a class="el" href="classmingfx_1_1_mesh.html#a1a5cea9cfdf4c672ba0c781ee54718f7">CalcPerFaceNormals</a> ()</td></tr> -<tr class="memdesc:a1a5cea9cfdf4c672ba0c781ee54718f7"><td class="mdescLeft"> </td><td class="mdescRight">This (re)calculates the normals for the mesh and stores them with the mesh data structure. <a href="classmingfx_1_1_mesh.html#a1a5cea9cfdf4c672ba0c781ee54718f7">More...</a><br /></td></tr> -<tr class="separator:a1a5cea9cfdf4c672ba0c781ee54718f7"><td class="memSeparator" colspan="2"> </td></tr> -<tr class="memitem:acc7df547b0a2175287cc9f509c04e93c"><td class="memItemLeft" align="right" valign="top">void </td><td class="memItemRight" valign="bottom"><a class="el" href="classmingfx_1_1_mesh.html#acc7df547b0a2175287cc9f509c04e93c">CalcPerVertexNormals</a> ()</td></tr> -<tr class="memdesc:acc7df547b0a2175287cc9f509c04e93c"><td class="mdescLeft"> </td><td class="mdescRight">This (re)calculates the normals for the mesh and stores them with the mesh data structure. <a href="classmingfx_1_1_mesh.html#acc7df547b0a2175287cc9f509c04e93c">More...</a><br /></td></tr> -<tr class="separator:acc7df547b0a2175287cc9f509c04e93c"><td class="memSeparator" colspan="2"> </td></tr> -<tr class="memitem:a8d96c1b5985cd836f2aa2b2994af64c1"><td class="memItemLeft" align="right" valign="top">void </td><td class="memItemRight" valign="bottom"><a class="el" href="classmingfx_1_1_mesh.html#a8d96c1b5985cd836f2aa2b2994af64c1">BuildBVH</a> ()</td></tr> -<tr class="memdesc:a8d96c1b5985cd836f2aa2b2994af64c1"><td class="mdescLeft"> </td><td class="mdescRight">This (re)calculates a Bounding Volume Hierarchy for the mesh, which can be used together with <a class="el" href="classmingfx_1_1_ray.html#ac90097090f0f8f49db13f6f232712afc" title="Checks to see if the ray intersects a triangle mesh.">Ray::FastIntersectMesh()</a> to do faster ray-mesh intersection testing. <a href="classmingfx_1_1_mesh.html#a8d96c1b5985cd836f2aa2b2994af64c1">More...</a><br /></td></tr> -<tr class="separator:a8d96c1b5985cd836f2aa2b2994af64c1"><td class="memSeparator" colspan="2"> </td></tr> -<tr class="memitem:a978b1341d5613d399a68e40c61c57ba4"><td class="memItemLeft" align="right" valign="top"><a class="el" href="classmingfx_1_1_b_v_h.html">BVH</a> * </td><td class="memItemRight" valign="bottom"><a class="el" href="classmingfx_1_1_mesh.html#a978b1341d5613d399a68e40c61c57ba4">bvh_ptr</a> ()</td></tr> -<tr class="memdesc:a978b1341d5613d399a68e40c61c57ba4"><td class="mdescLeft"> </td><td class="mdescRight">Returns a pointer to the underlying <a class="el" href="classmingfx_1_1_b_v_h.html" title="A Bounding Volume Hierarchy (BVH) data structure that can be used to accelerate ray-object intersecti...">BVH</a> data structure. <a href="classmingfx_1_1_mesh.html#a978b1341d5613d399a68e40c61c57ba4">More...</a><br /></td></tr> -<tr class="separator:a978b1341d5613d399a68e40c61c57ba4"><td class="memSeparator" colspan="2"> </td></tr> -<tr class="memitem:ab8f6856429466f1b4600a6ec27b84d0d"><td class="memItemLeft" align="right" valign="top">int </td><td class="memItemRight" valign="bottom"><a class="el" href="classmingfx_1_1_mesh.html#ab8f6856429466f1b4600a6ec27b84d0d">num_vertices</a> () const</td></tr> -<tr class="memdesc:ab8f6856429466f1b4600a6ec27b84d0d"><td class="mdescLeft"> </td><td class="mdescRight">The total number of vertices in the mesh. <a href="classmingfx_1_1_mesh.html#ab8f6856429466f1b4600a6ec27b84d0d">More...</a><br /></td></tr> -<tr class="separator:ab8f6856429466f1b4600a6ec27b84d0d"><td class="memSeparator" colspan="2"> </td></tr> -<tr class="memitem:ada9371e85aa0b61df79b26fc880b1863"><td class="memItemLeft" align="right" valign="top"><a class="el" href="classmingfx_1_1_point3.html">Point3</a> </td><td class="memItemRight" valign="bottom"><a class="el" href="classmingfx_1_1_mesh.html#ada9371e85aa0b61df79b26fc880b1863">read_vertex_data</a> (int vertex_id) const</td></tr> -<tr class="memdesc:ada9371e85aa0b61df79b26fc880b1863"><td class="mdescLeft"> </td><td class="mdescRight">Read only access to the vertex position data. Data are returned as a <a class="el" href="classmingfx_1_1_point3.html" title="A 3D Point with floating point coordinates, used for storing vertices and all sorts of other 3D graph...">Point3</a>. Indexed by vertex number. Also see <a class="el" href="classmingfx_1_1_mesh.html#ab8f6856429466f1b4600a6ec27b84d0d" title="The total number of vertices in the mesh.">num_vertices()</a>. Use the <a class="el" href="classmingfx_1_1_mesh.html#a1dd243b53826765ba468f505645102a6" title="Sets the vertex array for the mesh directly.">SetVertices()</a> function to set (or edit) vertex data. <a href="classmingfx_1_1_mesh.html#ada9371e85aa0b61df79b26fc880b1863">More...</a><br /></td></tr> -<tr class="separator:ada9371e85aa0b61df79b26fc880b1863"><td class="memSeparator" colspan="2"> </td></tr> -<tr class="memitem:a439361e454ca63c35f564aed5cd0de65"><td class="memItemLeft" align="right" valign="top"><a class="el" href="classmingfx_1_1_vector3.html">Vector3</a> </td><td class="memItemRight" valign="bottom"><a class="el" href="classmingfx_1_1_mesh.html#a439361e454ca63c35f564aed5cd0de65">read_normal_data</a> (int vertex_id) const</td></tr> -<tr class="memdesc:a439361e454ca63c35f564aed5cd0de65"><td class="mdescLeft"> </td><td class="mdescRight">Read only access to per-vertex normal data. Data are returned as a <a class="el" href="classmingfx_1_1_vector3.html" title="A 3D Vector with floating point coordinates, used for storing normals and all sorts of other 3D graph...">Vector3</a>. Indexed by vertex number. Also see <a class="el" href="classmingfx_1_1_mesh.html#ab8f6856429466f1b4600a6ec27b84d0d" title="The total number of vertices in the mesh.">num_vertices()</a>. Use the <a class="el" href="classmingfx_1_1_mesh.html#a43d5a5cc3ef742a8c2b5e3f1b4da0903" title="Sets the normals for the three vertices of a triangle that has already been added to the mesh.">SetNormals()</a> function to set (or edit) per-vertex normal data. <a href="classmingfx_1_1_mesh.html#a439361e454ca63c35f564aed5cd0de65">More...</a><br /></td></tr> -<tr class="separator:a439361e454ca63c35f564aed5cd0de65"><td class="memSeparator" colspan="2"> </td></tr> -<tr class="memitem:ac5fc517fd8ea4cea8459d3f4d5d6ced3"><td class="memItemLeft" align="right" valign="top"><a class="el" href="classmingfx_1_1_color.html">Color</a> </td><td class="memItemRight" valign="bottom"><a class="el" href="classmingfx_1_1_mesh.html#ac5fc517fd8ea4cea8459d3f4d5d6ced3">read_color_data</a> (int vertex_id) const</td></tr> -<tr class="memdesc:ac5fc517fd8ea4cea8459d3f4d5d6ced3"><td class="mdescLeft"> </td><td class="mdescRight">Read only access to per-vertex color data. Data are returned as a <a class="el" href="classmingfx_1_1_color.html" title="Represents a 4-component (R,G,B,A) color, stored internally in a float array to be compatable with Op...">Color</a>. Indexed by vertex number. Also see <a class="el" href="classmingfx_1_1_mesh.html#ab8f6856429466f1b4600a6ec27b84d0d" title="The total number of vertices in the mesh.">num_vertices()</a>. Use the <a class="el" href="classmingfx_1_1_mesh.html#a0f59e19b74f4f9dc2ad580756f8b319f" title="Sets per-vertex colors for the three vertices of a triangle that has already been added to the mesh.">SetColors()</a> function to set (or edit) per-vertex color data. <a href="classmingfx_1_1_mesh.html#ac5fc517fd8ea4cea8459d3f4d5d6ced3">More...</a><br /></td></tr> -<tr class="separator:ac5fc517fd8ea4cea8459d3f4d5d6ced3"><td class="memSeparator" colspan="2"> </td></tr> -<tr class="memitem:a51aaa8d6a80af46f22ea9dfecd2f0b31"><td class="memItemLeft" align="right" valign="top"><a class="el" href="classmingfx_1_1_point2.html">Point2</a> </td><td class="memItemRight" valign="bottom"><a class="el" href="classmingfx_1_1_mesh.html#a51aaa8d6a80af46f22ea9dfecd2f0b31">read_tex_coords_data</a> (int texture_unit, int vertex_id) const</td></tr> -<tr class="memdesc:a51aaa8d6a80af46f22ea9dfecd2f0b31"><td class="mdescLeft"> </td><td class="mdescRight">Read only access to per-vertex texture coordinates data. Data are returned as a <a class="el" href="classmingfx_1_1_point2.html" title="A 2D Point with floating point coordinates, used for storing 2D texture coordinates,...">Point2</a>. Indexed by vertex number. Also see <a class="el" href="classmingfx_1_1_mesh.html#ab8f6856429466f1b4600a6ec27b84d0d" title="The total number of vertices in the mesh.">num_vertices()</a>. Use the <a class="el" href="classmingfx_1_1_mesh.html#a17cb896939007357014c74a1ece6f1f3" title="Sets the texture coordinates for the three vertices of a triangle that has already been added to the ...">SetTexCoords()</a> function to set (or edit) per-vertex tex coords. <a href="classmingfx_1_1_mesh.html#a51aaa8d6a80af46f22ea9dfecd2f0b31">More...</a><br /></td></tr> -<tr class="separator:a51aaa8d6a80af46f22ea9dfecd2f0b31"><td class="memSeparator" colspan="2"> </td></tr> -<tr class="memitem:ab3f3779506e15e3888ccbb8b9b572b8f"><td class="memItemLeft" align="right" valign="top">int </td><td class="memItemRight" valign="bottom"><a class="el" href="classmingfx_1_1_mesh.html#ab3f3779506e15e3888ccbb8b9b572b8f">num_triangles</a> () const</td></tr> -<tr class="memdesc:ab3f3779506e15e3888ccbb8b9b572b8f"><td class="mdescLeft"> </td><td class="mdescRight">The total number of triangles in the mesh. <a href="classmingfx_1_1_mesh.html#ab3f3779506e15e3888ccbb8b9b572b8f">More...</a><br /></td></tr> -<tr class="separator:ab3f3779506e15e3888ccbb8b9b572b8f"><td class="memSeparator" colspan="2"> </td></tr> -<tr class="memitem:a15d79cbc48a6ef72ef1208d734cc2f8a"><td class="memItemLeft" align="right" valign="top">std::vector< unsigned int > </td><td class="memItemRight" valign="bottom"><a class="el" href="classmingfx_1_1_mesh.html#a15d79cbc48a6ef72ef1208d734cc2f8a">read_triangle_indices_data</a> (int triangle_id) const</td></tr> -<tr class="memdesc:a15d79cbc48a6ef72ef1208d734cc2f8a"><td class="mdescLeft"> </td><td class="mdescRight">Read only access to the indices that make up a particular triangle. Data are returned as a 3-element array. <a href="classmingfx_1_1_mesh.html#a15d79cbc48a6ef72ef1208d734cc2f8a">More...</a><br /></td></tr> -<tr class="separator:a15d79cbc48a6ef72ef1208d734cc2f8a"><td class="memSeparator" colspan="2"> </td></tr> -</table> -<h2 class="groupheader">Constructor & Destructor Documentation</h2> -<a id="a69613870d54989f4226e50caf4ca9fb9"></a> -<h2 class="memtitle"><span class="permalink"><a href="#a69613870d54989f4226e50caf4ca9fb9">◆ </a></span>Mesh() <span class="overload">[1/2]</span></h2> - -<div class="memitem"> -<div class="memproto"> - <table class="memname"> - <tr> - <td class="memname">mingfx::Mesh::Mesh </td> - <td>(</td> - <td class="paramname"></td><td>)</td> - <td></td> - </tr> - </table> -</div><div class="memdoc"> - -<p>Creates an empty mesh. </p> - -</div> -</div> -<a id="a76b4977f0a7f156aa8a0027f10dcbdc1"></a> -<h2 class="memtitle"><span class="permalink"><a href="#a76b4977f0a7f156aa8a0027f10dcbdc1">◆ </a></span>Mesh() <span class="overload">[2/2]</span></h2> - -<div class="memitem"> -<div class="memproto"> - <table class="memname"> - <tr> - <td class="memname">mingfx::Mesh::Mesh </td> - <td>(</td> - <td class="paramtype">const <a class="el" href="classmingfx_1_1_mesh.html">Mesh</a> & </td> - <td class="paramname"><em>other</em></td><td>)</td> - <td></td> - </tr> - </table> -</div><div class="memdoc"> - -<p>Copies all data and sets GPU dirty bit for the new mesh. </p> - -</div> -</div> -<a id="ace7b23730dbcb581c4886cf2b9998327"></a> -<h2 class="memtitle"><span class="permalink"><a href="#ace7b23730dbcb581c4886cf2b9998327">◆ </a></span>~Mesh()</h2> - -<div class="memitem"> -<div class="memproto"> -<table class="mlabels"> - <tr> - <td class="mlabels-left"> - <table class="memname"> - <tr> - <td class="memname">virtual mingfx::Mesh::~Mesh </td> - <td>(</td> - <td class="paramname"></td><td>)</td> - <td></td> - </tr> - </table> - </td> - <td class="mlabels-right"> -<span class="mlabels"><span class="mlabel">virtual</span></span> </td> - </tr> -</table> -</div><div class="memdoc"> - -</div> -</div> -<h2 class="groupheader">Member Function Documentation</h2> -<a id="a29eeb2e778704350789033ec4940d55a"></a> -<h2 class="memtitle"><span class="permalink"><a href="#a29eeb2e778704350789033ec4940d55a">◆ </a></span>AddTriangle()</h2> - -<div class="memitem"> -<div class="memproto"> - <table class="memname"> - <tr> - <td class="memname">int mingfx::Mesh::AddTriangle </td> - <td>(</td> - <td class="paramtype"><a class="el" href="classmingfx_1_1_point3.html">Point3</a> </td> - <td class="paramname"><em>v1</em>, </td> - </tr> - <tr> - <td class="paramkey"></td> - <td></td> - <td class="paramtype"><a class="el" href="classmingfx_1_1_point3.html">Point3</a> </td> - <td class="paramname"><em>v2</em>, </td> - </tr> - <tr> - <td class="paramkey"></td> - <td></td> - <td class="paramtype"><a class="el" href="classmingfx_1_1_point3.html">Point3</a> </td> - <td class="paramname"><em>v3</em> </td> - </tr> - <tr> - <td></td> - <td>)</td> - <td></td><td></td> - </tr> - </table> -</div><div class="memdoc"> - -<p>Adds a triangle to the mesh datastructure and returns a triangle ID. </p> -<p>The ID should then be used as the first argument for follow-on calls to <a class="el" href="classmingfx_1_1_mesh.html#a43d5a5cc3ef742a8c2b5e3f1b4da0903" title="Sets the normals for the three vertices of a triangle that has already been added to the mesh.">SetNormals()</a>, <a class="el" href="classmingfx_1_1_mesh.html#a0f59e19b74f4f9dc2ad580756f8b319f" title="Sets per-vertex colors for the three vertices of a triangle that has already been added to the mesh.">SetColors()</a>, and <a class="el" href="classmingfx_1_1_mesh.html#a17cb896939007357014c74a1ece6f1f3" title="Sets the texture coordinates for the three vertices of a triangle that has already been added to the ...">SetTexCoords()</a>. The vertices must be specified in counter-clockwise order so that the normal of the triangle can be determined following the right-hand rule. </p> - -</div> -</div> -<a id="a8d96c1b5985cd836f2aa2b2994af64c1"></a> -<h2 class="memtitle"><span class="permalink"><a href="#a8d96c1b5985cd836f2aa2b2994af64c1">◆ </a></span>BuildBVH()</h2> - -<div class="memitem"> -<div class="memproto"> - <table class="memname"> - <tr> - <td class="memname">void mingfx::Mesh::BuildBVH </td> - <td>(</td> - <td class="paramname"></td><td>)</td> - <td></td> - </tr> - </table> -</div><div class="memdoc"> - -<p>This (re)calculates a Bounding Volume Hierarchy for the mesh, which can be used together with <a class="el" href="classmingfx_1_1_ray.html#ac90097090f0f8f49db13f6f232712afc" title="Checks to see if the ray intersects a triangle mesh.">Ray::FastIntersectMesh()</a> to do faster ray-mesh intersection testing. </p> - -</div> -</div> -<a id="a978b1341d5613d399a68e40c61c57ba4"></a> -<h2 class="memtitle"><span class="permalink"><a href="#a978b1341d5613d399a68e40c61c57ba4">◆ </a></span>bvh_ptr()</h2> - -<div class="memitem"> -<div class="memproto"> - <table class="memname"> - <tr> - <td class="memname"><a class="el" href="classmingfx_1_1_b_v_h.html">BVH</a>* mingfx::Mesh::bvh_ptr </td> - <td>(</td> - <td class="paramname"></td><td>)</td> - <td></td> - </tr> - </table> -</div><div class="memdoc"> - -<p>Returns a pointer to the underlying <a class="el" href="classmingfx_1_1_b_v_h.html" title="A Bounding Volume Hierarchy (BVH) data structure that can be used to accelerate ray-object intersecti...">BVH</a> data structure. </p> -<p>If the data struture has not yet been build or needs to be updated due to a change in the geometry of the mesh, then the <a class="el" href="classmingfx_1_1_b_v_h.html" title="A Bounding Volume Hierarchy (BVH) data structure that can be used to accelerate ray-object intersecti...">BVH</a> is recalculated before returning the pointer. </p> - -</div> -</div> -<a id="a1a5cea9cfdf4c672ba0c781ee54718f7"></a> -<h2 class="memtitle"><span class="permalink"><a href="#a1a5cea9cfdf4c672ba0c781ee54718f7">◆ </a></span>CalcPerFaceNormals()</h2> - -<div class="memitem"> -<div class="memproto"> - <table class="memname"> - <tr> - <td class="memname">void mingfx::Mesh::CalcPerFaceNormals </td> - <td>(</td> - <td class="paramname"></td><td>)</td> - <td></td> - </tr> - </table> -</div><div class="memdoc"> - -<p>This (re)calculates the normals for the mesh and stores them with the mesh data structure. </p> -<p>It assumes a faceted mesh, like a cube, where each triangle has separate vertices. The normal is calculated for each triangle face and then the result is associated with each vertex that makes up the triangle. If you have a smooth mesh where vertices are shared between multiple faces then use <a class="el" href="classmingfx_1_1_mesh.html#acc7df547b0a2175287cc9f509c04e93c" title="This (re)calculates the normals for the mesh and stores them with the mesh data structure.">CalcPerVertexNormals()</a> instead. </p> - -</div> -</div> -<a id="acc7df547b0a2175287cc9f509c04e93c"></a> -<h2 class="memtitle"><span class="permalink"><a href="#acc7df547b0a2175287cc9f509c04e93c">◆ </a></span>CalcPerVertexNormals()</h2> - -<div class="memitem"> -<div class="memproto"> - <table class="memname"> - <tr> - <td class="memname">void mingfx::Mesh::CalcPerVertexNormals </td> - <td>(</td> - <td class="paramname"></td><td>)</td> - <td></td> - </tr> - </table> -</div><div class="memdoc"> - -<p>This (re)calculates the normals for the mesh and stores them with the mesh data structure. </p> -<p>It assumes a smooth mesh, like a sphere, where each vertex belongs to one or more triangles. Each vertex normal is calculated as a weighted sum of the face normals for adjacent faces. The weighting is based upon the relative areas of the neighboring faces (i.e., a large neighboring triangle contributes more to the vertex normal than a small one). </p> - -</div> -</div> -<a id="a75075d472938fd760477be42585aff5c"></a> -<h2 class="memtitle"><span class="permalink"><a href="#a75075d472938fd760477be42585aff5c">◆ </a></span>Draw()</h2> - -<div class="memitem"> -<div class="memproto"> - <table class="memname"> - <tr> - <td class="memname">void mingfx::Mesh::Draw </td> - <td>(</td> - <td class="paramname"></td><td>)</td> - <td></td> - </tr> - </table> -</div><div class="memdoc"> - -<p>This sends the mesh vertices and attributes down the graphics pipe using glDrawArrays() for the non-indexed mode and glDrawElements() for the indexed mode. </p> -<p>This is just the geometry – for anything to show up on the screen, you must already have a <a class="el" href="classmingfx_1_1_shader_program.html" title="A wrapper around GLSL shader programs.">ShaderProgram</a> enabled before calling this function. </p> - -</div> -</div> -<a id="a8d05faf18ef8d170fc3c2a343075823f"></a> -<h2 class="memtitle"><span class="permalink"><a href="#a8d05faf18ef8d170fc3c2a343075823f">◆ </a></span>LoadFromOBJ()</h2> - -<div class="memitem"> -<div class="memproto"> - <table class="memname"> - <tr> - <td class="memname">void mingfx::Mesh::LoadFromOBJ </td> - <td>(</td> - <td class="paramtype">const std::string & </td> - <td class="paramname"><em>filename</em></td><td>)</td> - <td></td> - </tr> - </table> -</div><div class="memdoc"> - -<p>This reads a mesh stored in the common Wavefront Obj file format. </p> -<p>The loader here is simplistic and not guaranteed to work on all valid .obj files, but it should work on many simple ones. <a class="el" href="classmingfx_1_1_mesh.html#ac74345bf4b2994de4ee1c509bcc6840e" title="This copies the entire mesh data structure to a vertex array in GPU memory, which must happen before ...">UpdateGPUMemory()</a> is called automatically after the model is loaded. </p> - -</div> -</div> -<a id="ab3f3779506e15e3888ccbb8b9b572b8f"></a> -<h2 class="memtitle"><span class="permalink"><a href="#ab3f3779506e15e3888ccbb8b9b572b8f">◆ </a></span>num_triangles()</h2> - -<div class="memitem"> -<div class="memproto"> - <table class="memname"> - <tr> - <td class="memname">int mingfx::Mesh::num_triangles </td> - <td>(</td> - <td class="paramname"></td><td>)</td> - <td> const</td> - </tr> - </table> -</div><div class="memdoc"> - -<p>The total number of triangles in the mesh. </p> - -</div> -</div> -<a id="ab8f6856429466f1b4600a6ec27b84d0d"></a> -<h2 class="memtitle"><span class="permalink"><a href="#ab8f6856429466f1b4600a6ec27b84d0d">◆ </a></span>num_vertices()</h2> - -<div class="memitem"> -<div class="memproto"> - <table class="memname"> - <tr> - <td class="memname">int mingfx::Mesh::num_vertices </td> - <td>(</td> - <td class="paramname"></td><td>)</td> - <td> const</td> - </tr> - </table> -</div><div class="memdoc"> - -<p>The total number of vertices in the mesh. </p> - -</div> -</div> -<a id="ac5fc517fd8ea4cea8459d3f4d5d6ced3"></a> -<h2 class="memtitle"><span class="permalink"><a href="#ac5fc517fd8ea4cea8459d3f4d5d6ced3">◆ </a></span>read_color_data()</h2> - -<div class="memitem"> -<div class="memproto"> - <table class="memname"> - <tr> - <td class="memname"><a class="el" href="classmingfx_1_1_color.html">Color</a> mingfx::Mesh::read_color_data </td> - <td>(</td> - <td class="paramtype">int </td> - <td class="paramname"><em>vertex_id</em></td><td>)</td> - <td> const</td> - </tr> - </table> -</div><div class="memdoc"> - -<p>Read only access to per-vertex color data. Data are returned as a <a class="el" href="classmingfx_1_1_color.html" title="Represents a 4-component (R,G,B,A) color, stored internally in a float array to be compatable with Op...">Color</a>. Indexed by vertex number. Also see <a class="el" href="classmingfx_1_1_mesh.html#ab8f6856429466f1b4600a6ec27b84d0d" title="The total number of vertices in the mesh.">num_vertices()</a>. Use the <a class="el" href="classmingfx_1_1_mesh.html#a0f59e19b74f4f9dc2ad580756f8b319f" title="Sets per-vertex colors for the three vertices of a triangle that has already been added to the mesh.">SetColors()</a> function to set (or edit) per-vertex color data. </p> - -</div> -</div> -<a id="a439361e454ca63c35f564aed5cd0de65"></a> -<h2 class="memtitle"><span class="permalink"><a href="#a439361e454ca63c35f564aed5cd0de65">◆ </a></span>read_normal_data()</h2> - -<div class="memitem"> -<div class="memproto"> - <table class="memname"> - <tr> - <td class="memname"><a class="el" href="classmingfx_1_1_vector3.html">Vector3</a> mingfx::Mesh::read_normal_data </td> - <td>(</td> - <td class="paramtype">int </td> - <td class="paramname"><em>vertex_id</em></td><td>)</td> - <td> const</td> - </tr> - </table> -</div><div class="memdoc"> - -<p>Read only access to per-vertex normal data. Data are returned as a <a class="el" href="classmingfx_1_1_vector3.html" title="A 3D Vector with floating point coordinates, used for storing normals and all sorts of other 3D graph...">Vector3</a>. Indexed by vertex number. Also see <a class="el" href="classmingfx_1_1_mesh.html#ab8f6856429466f1b4600a6ec27b84d0d" title="The total number of vertices in the mesh.">num_vertices()</a>. Use the <a class="el" href="classmingfx_1_1_mesh.html#a43d5a5cc3ef742a8c2b5e3f1b4da0903" title="Sets the normals for the three vertices of a triangle that has already been added to the mesh.">SetNormals()</a> function to set (or edit) per-vertex normal data. </p> - -</div> -</div> -<a id="a51aaa8d6a80af46f22ea9dfecd2f0b31"></a> -<h2 class="memtitle"><span class="permalink"><a href="#a51aaa8d6a80af46f22ea9dfecd2f0b31">◆ </a></span>read_tex_coords_data()</h2> - -<div class="memitem"> -<div class="memproto"> - <table class="memname"> - <tr> - <td class="memname"><a class="el" href="classmingfx_1_1_point2.html">Point2</a> mingfx::Mesh::read_tex_coords_data </td> - <td>(</td> - <td class="paramtype">int </td> - <td class="paramname"><em>texture_unit</em>, </td> - </tr> - <tr> - <td class="paramkey"></td> - <td></td> - <td class="paramtype">int </td> - <td class="paramname"><em>vertex_id</em> </td> - </tr> - <tr> - <td></td> - <td>)</td> - <td></td><td> const</td> - </tr> - </table> -</div><div class="memdoc"> - -<p>Read only access to per-vertex texture coordinates data. Data are returned as a <a class="el" href="classmingfx_1_1_point2.html" title="A 2D Point with floating point coordinates, used for storing 2D texture coordinates,...">Point2</a>. Indexed by vertex number. Also see <a class="el" href="classmingfx_1_1_mesh.html#ab8f6856429466f1b4600a6ec27b84d0d" title="The total number of vertices in the mesh.">num_vertices()</a>. Use the <a class="el" href="classmingfx_1_1_mesh.html#a17cb896939007357014c74a1ece6f1f3" title="Sets the texture coordinates for the three vertices of a triangle that has already been added to the ...">SetTexCoords()</a> function to set (or edit) per-vertex tex coords. </p> - -</div> -</div> -<a id="a15d79cbc48a6ef72ef1208d734cc2f8a"></a> -<h2 class="memtitle"><span class="permalink"><a href="#a15d79cbc48a6ef72ef1208d734cc2f8a">◆ </a></span>read_triangle_indices_data()</h2> - -<div class="memitem"> -<div class="memproto"> - <table class="memname"> - <tr> - <td class="memname">std::vector<unsigned int> mingfx::Mesh::read_triangle_indices_data </td> - <td>(</td> - <td class="paramtype">int </td> - <td class="paramname"><em>triangle_id</em></td><td>)</td> - <td> const</td> - </tr> - </table> -</div><div class="memdoc"> - -<p>Read only access to the indices that make up a particular triangle. Data are returned as a 3-element array. </p> - -</div> -</div> -<a id="ada9371e85aa0b61df79b26fc880b1863"></a> -<h2 class="memtitle"><span class="permalink"><a href="#ada9371e85aa0b61df79b26fc880b1863">◆ </a></span>read_vertex_data()</h2> - -<div class="memitem"> -<div class="memproto"> - <table class="memname"> - <tr> - <td class="memname"><a class="el" href="classmingfx_1_1_point3.html">Point3</a> mingfx::Mesh::read_vertex_data </td> - <td>(</td> - <td class="paramtype">int </td> - <td class="paramname"><em>vertex_id</em></td><td>)</td> - <td> const</td> - </tr> - </table> -</div><div class="memdoc"> - -<p>Read only access to the vertex position data. Data are returned as a <a class="el" href="classmingfx_1_1_point3.html" title="A 3D Point with floating point coordinates, used for storing vertices and all sorts of other 3D graph...">Point3</a>. Indexed by vertex number. Also see <a class="el" href="classmingfx_1_1_mesh.html#ab8f6856429466f1b4600a6ec27b84d0d" title="The total number of vertices in the mesh.">num_vertices()</a>. Use the <a class="el" href="classmingfx_1_1_mesh.html#a1dd243b53826765ba468f505645102a6" title="Sets the vertex array for the mesh directly.">SetVertices()</a> function to set (or edit) vertex data. </p> - -</div> -</div> -<a id="ab9b05a77591a9adad12032d513256dae"></a> -<h2 class="memtitle"><span class="permalink"><a href="#ab9b05a77591a9adad12032d513256dae">◆ </a></span>SetColors() <span class="overload">[1/3]</span></h2> - -<div class="memitem"> -<div class="memproto"> - <table class="memname"> - <tr> - <td class="memname">void mingfx::Mesh::SetColors </td> - <td>(</td> - <td class="paramtype">const std::vector< <a class="el" href="classmingfx_1_1_color.html">Color</a> > & </td> - <td class="paramname"><em>colors</em></td><td>)</td> - <td></td> - </tr> - </table> -</div><div class="memdoc"> - -<p>Sets the per-vertex colors array for the mesh directly. </p> - -</div> -</div> -<a id="aed172bdd77858f3b59978cb8527e19ae"></a> -<h2 class="memtitle"><span class="permalink"><a href="#aed172bdd77858f3b59978cb8527e19ae">◆ </a></span>SetColors() <span class="overload">[2/3]</span></h2> - -<div class="memitem"> -<div class="memproto"> - <table class="memname"> - <tr> - <td class="memname">void mingfx::Mesh::SetColors </td> - <td>(</td> - <td class="paramtype">float * </td> - <td class="paramname"><em>colors_array</em>, </td> - </tr> - <tr> - <td class="paramkey"></td> - <td></td> - <td class="paramtype">int </td> - <td class="paramname"><em>num_colors</em> </td> - </tr> - <tr> - <td></td> - <td>)</td> - <td></td><td></td> - </tr> - </table> -</div><div class="memdoc"> - -<p>Sets the per-vertex colors array for the mesh directly. Colors are stored as (r,g,b,a), (r,g,b,a), (r,g,b,a), ... following the same ordering as was used for <a class="el" href="classmingfx_1_1_mesh.html#a1dd243b53826765ba468f505645102a6" title="Sets the vertex array for the mesh directly.">SetVertices()</a>. This version of the function accepts a C-style array rather than std::vector<> </p> - -</div> -</div> -<a id="a0f59e19b74f4f9dc2ad580756f8b319f"></a> -<h2 class="memtitle"><span class="permalink"><a href="#a0f59e19b74f4f9dc2ad580756f8b319f">◆ </a></span>SetColors() <span class="overload">[3/3]</span></h2> - -<div class="memitem"> -<div class="memproto"> - <table class="memname"> - <tr> - <td class="memname">void mingfx::Mesh::SetColors </td> - <td>(</td> - <td class="paramtype">int </td> - <td class="paramname"><em>triangle_id</em>, </td> - </tr> - <tr> - <td class="paramkey"></td> - <td></td> - <td class="paramtype"><a class="el" href="classmingfx_1_1_color.html">Color</a> </td> - <td class="paramname"><em>c1</em>, </td> - </tr> - <tr> - <td class="paramkey"></td> - <td></td> - <td class="paramtype"><a class="el" href="classmingfx_1_1_color.html">Color</a> </td> - <td class="paramname"><em>c2</em>, </td> - </tr> - <tr> - <td class="paramkey"></td> - <td></td> - <td class="paramtype"><a class="el" href="classmingfx_1_1_color.html">Color</a> </td> - <td class="paramname"><em>c3</em> </td> - </tr> - <tr> - <td></td> - <td>)</td> - <td></td><td></td> - </tr> - </table> -</div><div class="memdoc"> - -<p>Sets per-vertex colors for the three vertices of a triangle that has already been added to the mesh. </p> - -</div> -</div> -<a id="a1f94c9ca7867b65e04f7e02813a06581"></a> -<h2 class="memtitle"><span class="permalink"><a href="#a1f94c9ca7867b65e04f7e02813a06581">◆ </a></span>SetIndices() <span class="overload">[1/2]</span></h2> - -<div class="memitem"> -<div class="memproto"> - <table class="memname"> - <tr> - <td class="memname">void mingfx::Mesh::SetIndices </td> - <td>(</td> - <td class="paramtype">const std::vector< unsigned int > </td> - <td class="paramname"><em>index_array</em></td><td>)</td> - <td></td> - </tr> - </table> -</div><div class="memdoc"> - -<p>Sets the indices into the vertex array to use to create the triangles. Each consecutive set of 3 indices forms one triangle: (v1,v2,v3), (v1,v2,v3), (v1,v2,v3), ... </p> - -</div> -</div> -<a id="a84711746b8d37c8d9b12ae748a4c5b8c"></a> -<h2 class="memtitle"><span class="permalink"><a href="#a84711746b8d37c8d9b12ae748a4c5b8c">◆ </a></span>SetIndices() <span class="overload">[2/2]</span></h2> - -<div class="memitem"> -<div class="memproto"> - <table class="memname"> - <tr> - <td class="memname">void mingfx::Mesh::SetIndices </td> - <td>(</td> - <td class="paramtype">unsigned int * </td> - <td class="paramname"><em>index_array</em>, </td> - </tr> - <tr> - <td class="paramkey"></td> - <td></td> - <td class="paramtype">int </td> - <td class="paramname"><em>num_indices</em> </td> - </tr> - <tr> - <td></td> - <td>)</td> - <td></td><td></td> - </tr> - </table> -</div><div class="memdoc"> - -<p>Sets the indices into the vertex array to use to create the triangles. Each consecutive set of 3 indices forms one triangle: (v1,v2,v3), (v1,v2,v3), (v1,v2,v3), ... This version of the function accepts a C-style array rather than std::vector<> </p> - -</div> -</div> -<a id="a7175238f5874929e2258458b98421d87"></a> -<h2 class="memtitle"><span class="permalink"><a href="#a7175238f5874929e2258458b98421d87">◆ </a></span>SetInstanceTransforms()</h2> - -<div class="memitem"> -<div class="memproto"> - <table class="memname"> - <tr> - <td class="memname">void mingfx::Mesh::SetInstanceTransforms </td> - <td>(</td> - <td class="paramtype">const std::vector< <a class="el" href="classmingfx_1_1_matrix4.html">Matrix4</a> > & </td> - <td class="paramname"><em>xforms</em></td><td>)</td> - <td></td> - </tr> - </table> -</div><div class="memdoc"> - -</div> -</div> -<a id="ad28dbd5b0ab77bec28f30f618dd9e57d"></a> -<h2 class="memtitle"><span class="permalink"><a href="#ad28dbd5b0ab77bec28f30f618dd9e57d">◆ </a></span>SetNormals() <span class="overload">[1/3]</span></h2> - -<div class="memitem"> -<div class="memproto"> - <table class="memname"> - <tr> - <td class="memname">void mingfx::Mesh::SetNormals </td> - <td>(</td> - <td class="paramtype">const std::vector< <a class="el" href="classmingfx_1_1_vector3.html">Vector3</a> > & </td> - <td class="paramname"><em>norms</em></td><td>)</td> - <td></td> - </tr> - </table> -</div><div class="memdoc"> - -<p>Sets the normal array for the mesh directly. </p> - -</div> -</div> -<a id="a6ab1128fab6f969564d3a1329baeade6"></a> -<h2 class="memtitle"><span class="permalink"><a href="#a6ab1128fab6f969564d3a1329baeade6">◆ </a></span>SetNormals() <span class="overload">[2/3]</span></h2> - -<div class="memitem"> -<div class="memproto"> - <table class="memname"> - <tr> - <td class="memname">void mingfx::Mesh::SetNormals </td> - <td>(</td> - <td class="paramtype">float * </td> - <td class="paramname"><em>norms_array</em>, </td> - </tr> - <tr> - <td class="paramkey"></td> - <td></td> - <td class="paramtype">int </td> - <td class="paramname"><em>num_norms</em> </td> - </tr> - <tr> - <td></td> - <td>)</td> - <td></td><td></td> - </tr> - </table> -</div><div class="memdoc"> - -<p>Sets the normal array for the mesh directly. Normals are stored as (x,y,z), (x,y,z), (x,y,z), ... following the same ordering as was used for <a class="el" href="classmingfx_1_1_mesh.html#a1dd243b53826765ba468f505645102a6" title="Sets the vertex array for the mesh directly.">SetVertices()</a>. This version of the function accepts a C-style array rather than std::vector<> </p> - -</div> -</div> -<a id="a43d5a5cc3ef742a8c2b5e3f1b4da0903"></a> -<h2 class="memtitle"><span class="permalink"><a href="#a43d5a5cc3ef742a8c2b5e3f1b4da0903">◆ </a></span>SetNormals() <span class="overload">[3/3]</span></h2> - -<div class="memitem"> -<div class="memproto"> - <table class="memname"> - <tr> - <td class="memname">void mingfx::Mesh::SetNormals </td> - <td>(</td> - <td class="paramtype">int </td> - <td class="paramname"><em>triangle_id</em>, </td> - </tr> - <tr> - <td class="paramkey"></td> - <td></td> - <td class="paramtype"><a class="el" href="classmingfx_1_1_vector3.html">Vector3</a> </td> - <td class="paramname"><em>n1</em>, </td> - </tr> - <tr> - <td class="paramkey"></td> - <td></td> - <td class="paramtype"><a class="el" href="classmingfx_1_1_vector3.html">Vector3</a> </td> - <td class="paramname"><em>n2</em>, </td> - </tr> - <tr> - <td class="paramkey"></td> - <td></td> - <td class="paramtype"><a class="el" href="classmingfx_1_1_vector3.html">Vector3</a> </td> - <td class="paramname"><em>n3</em> </td> - </tr> - <tr> - <td></td> - <td>)</td> - <td></td><td></td> - </tr> - </table> -</div><div class="memdoc"> - -<p>Sets the normals for the three vertices of a triangle that has already been added to the mesh. </p> - -</div> -</div> -<a id="aba2dfd0ade2d8a728897d411ef3fdaf1"></a> -<h2 class="memtitle"><span class="permalink"><a href="#aba2dfd0ade2d8a728897d411ef3fdaf1">◆ </a></span>SetTexCoords() <span class="overload">[1/3]</span></h2> - -<div class="memitem"> -<div class="memproto"> - <table class="memname"> - <tr> - <td class="memname">void mingfx::Mesh::SetTexCoords </td> - <td>(</td> - <td class="paramtype">int </td> - <td class="paramname"><em>texture_unit</em>, </td> - </tr> - <tr> - <td class="paramkey"></td> - <td></td> - <td class="paramtype">const std::vector< <a class="el" href="classmingfx_1_1_point2.html">Point2</a> > & </td> - <td class="paramname"><em>tex_coords</em> </td> - </tr> - <tr> - <td></td> - <td>)</td> - <td></td><td></td> - </tr> - </table> -</div><div class="memdoc"> - -<p>Sets a texture coordinates array for the mesh directly. </p> - -</div> -</div> -<a id="ac9cd4e8d67bb70295a48fcbc72ae32f9"></a> -<h2 class="memtitle"><span class="permalink"><a href="#ac9cd4e8d67bb70295a48fcbc72ae32f9">◆ </a></span>SetTexCoords() <span class="overload">[2/3]</span></h2> - -<div class="memitem"> -<div class="memproto"> - <table class="memname"> - <tr> - <td class="memname">void mingfx::Mesh::SetTexCoords </td> - <td>(</td> - <td class="paramtype">int </td> - <td class="paramname"><em>texture_unit</em>, </td> - </tr> - <tr> - <td class="paramkey"></td> - <td></td> - <td class="paramtype">float * </td> - <td class="paramname"><em>tex_coords_array</em>, </td> - </tr> - <tr> - <td class="paramkey"></td> - <td></td> - <td class="paramtype">int </td> - <td class="paramname"><em>num_tex_coords</em> </td> - </tr> - <tr> - <td></td> - <td>)</td> - <td></td><td></td> - </tr> - </table> -</div><div class="memdoc"> - -<p>Sets a texture coordinates array for the mesh directly. Tex coords are stored as (u,v), (u,v), (u,v), ... following the same ordering as was used for <a class="el" href="classmingfx_1_1_mesh.html#a1dd243b53826765ba468f505645102a6" title="Sets the vertex array for the mesh directly.">SetVertices()</a>. This version of the function accepts a C-style array rather than std::vector<> </p> - -</div> -</div> -<a id="a17cb896939007357014c74a1ece6f1f3"></a> -<h2 class="memtitle"><span class="permalink"><a href="#a17cb896939007357014c74a1ece6f1f3">◆ </a></span>SetTexCoords() <span class="overload">[3/3]</span></h2> - -<div class="memitem"> -<div class="memproto"> - <table class="memname"> - <tr> - <td class="memname">void mingfx::Mesh::SetTexCoords </td> - <td>(</td> - <td class="paramtype">int </td> - <td class="paramname"><em>triangle_id</em>, </td> - </tr> - <tr> - <td class="paramkey"></td> - <td></td> - <td class="paramtype">int </td> - <td class="paramname"><em>texture_unit</em>, </td> - </tr> - <tr> - <td class="paramkey"></td> - <td></td> - <td class="paramtype"><a class="el" href="classmingfx_1_1_point2.html">Point2</a> </td> - <td class="paramname"><em>uv1</em>, </td> - </tr> - <tr> - <td class="paramkey"></td> - <td></td> - <td class="paramtype"><a class="el" href="classmingfx_1_1_point2.html">Point2</a> </td> - <td class="paramname"><em>uv2</em>, </td> - </tr> - <tr> - <td class="paramkey"></td> - <td></td> - <td class="paramtype"><a class="el" href="classmingfx_1_1_point2.html">Point2</a> </td> - <td class="paramname"><em>uv3</em> </td> - </tr> - <tr> - <td></td> - <td>)</td> - <td></td><td></td> - </tr> - </table> -</div><div class="memdoc"> - -<p>Sets the texture coordinates for the three vertices of a triangle that has already been added to the mesh. </p> -<p>The first textureUnit is 0, and you should always use 0 for this parameter unless you are doing multi-texturing. </p> - -</div> -</div> -<a id="a1dd243b53826765ba468f505645102a6"></a> -<h2 class="memtitle"><span class="permalink"><a href="#a1dd243b53826765ba468f505645102a6">◆ </a></span>SetVertices() <span class="overload">[1/2]</span></h2> - -<div class="memitem"> -<div class="memproto"> - <table class="memname"> - <tr> - <td class="memname">void mingfx::Mesh::SetVertices </td> - <td>(</td> - <td class="paramtype">const std::vector< <a class="el" href="classmingfx_1_1_point3.html">Point3</a> > & </td> - <td class="paramname"><em>verts</em></td><td>)</td> - <td></td> - </tr> - </table> -</div><div class="memdoc"> - -<p>Sets the vertex array for the mesh directly. </p> - -</div> -</div> -<a id="a033076b9bf1714c9b9e0eeef11ebcd49"></a> -<h2 class="memtitle"><span class="permalink"><a href="#a033076b9bf1714c9b9e0eeef11ebcd49">◆ </a></span>SetVertices() <span class="overload">[2/2]</span></h2> - -<div class="memitem"> -<div class="memproto"> - <table class="memname"> - <tr> - <td class="memname">void mingfx::Mesh::SetVertices </td> - <td>(</td> - <td class="paramtype">float * </td> - <td class="paramname"><em>verts_array</em>, </td> - </tr> - <tr> - <td class="paramkey"></td> - <td></td> - <td class="paramtype">int </td> - <td class="paramname"><em>num_verts</em> </td> - </tr> - <tr> - <td></td> - <td>)</td> - <td></td><td></td> - </tr> - </table> -</div><div class="memdoc"> - -<p>Sets the vertex array for the mesh directly. Vertices are stored as (x,y,z), (x,y,z), (x,y,z), ... This version of the function accepts a C-style array rather than std::vector<> </p> - -</div> -</div> -<a id="ac74345bf4b2994de4ee1c509bcc6840e"></a> -<h2 class="memtitle"><span class="permalink"><a href="#ac74345bf4b2994de4ee1c509bcc6840e">◆ </a></span>UpdateGPUMemory()</h2> - -<div class="memitem"> -<div class="memproto"> - <table class="memname"> - <tr> - <td class="memname">void mingfx::Mesh::UpdateGPUMemory </td> - <td>(</td> - <td class="paramname"></td><td>)</td> - <td></td> - </tr> - </table> -</div><div class="memdoc"> - -<p>This copies the entire mesh data structure to a vertex array in GPU memory, which must happen before you can draw the mesh. </p> -<p>For large meshes, this can take some time, so you may want to call this during initialization immediately after generating the mesh. If you do not, it will be called automatically for you the first time <a class="el" href="classmingfx_1_1_mesh.html#a75075d472938fd760477be42585aff5c" title="This sends the mesh vertices and attributes down the graphics pipe using glDrawArrays() for the non-i...">Draw()</a> is called. If the mesh contains normals, per- vertex colors and/or texture coordinates these are added as attributes within the vertex array. </p> - -</div> -</div> -<a id="a3e0ac86714f6b7c3f62761ef3952a044"></a> -<h2 class="memtitle"><span class="permalink"><a href="#a3e0ac86714f6b7c3f62761ef3952a044">◆ </a></span>UpdateTriangle()</h2> - -<div class="memitem"> -<div class="memproto"> - <table class="memname"> - <tr> - <td class="memname">void mingfx::Mesh::UpdateTriangle </td> - <td>(</td> - <td class="paramtype">int </td> - <td class="paramname"><em>triangle_id</em>, </td> - </tr> - <tr> - <td class="paramkey"></td> - <td></td> - <td class="paramtype"><a class="el" href="classmingfx_1_1_point3.html">Point3</a> </td> - <td class="paramname"><em>v1</em>, </td> - </tr> - <tr> - <td class="paramkey"></td> - <td></td> - <td class="paramtype"><a class="el" href="classmingfx_1_1_point3.html">Point3</a> </td> - <td class="paramname"><em>v2</em>, </td> - </tr> - <tr> - <td class="paramkey"></td> - <td></td> - <td class="paramtype"><a class="el" href="classmingfx_1_1_point3.html">Point3</a> </td> - <td class="paramname"><em>v3</em> </td> - </tr> - <tr> - <td></td> - <td>)</td> - <td></td><td></td> - </tr> - </table> -</div><div class="memdoc"> - -<p>Updates the vertex positions for a triangle that has already been added to the mesh. </p> - -</div> -</div> -<hr/>The documentation for this class was generated from the following file:<ul> -<li>src/<a class="el" href="mesh_8h_source.html">mesh.h</a></li> -</ul> -</div><!-- contents --> -<!-- HTML footer for doxygen 1.8.9.1--> -<!-- start footer part --> -<hr class="footer"/><address class="footer"><small> -Generated by  <a href="http://www.doxygen.org/index.html"> -<img class="footer" src="doxygen.png" alt="doxygen"/> -</a> 1.9.1 -</small></address> -</body> -</html> +<!-- HTML header for doxygen 1.8.9.1-->
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml">
+<head>
+<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
+<meta http-equiv="X-UA-Compatible" content="IE=9"/>
+<meta name="generator" content="Doxygen 1.9.1"/>
+<title>MinGfx Toolkit: mingfx::Mesh Class Reference</title>
+<link href="tabs.css" rel="stylesheet" type="text/css"/>
+<script type="text/javascript" src="jquery.js"></script>
+<script type="text/javascript" src="dynsections.js"></script>
+<link href="search/search.css" rel="stylesheet" type="text/css"/>
+<script type="text/javascript" src="search/searchdata.js"></script>
+<script type="text/javascript" src="search/search.js"></script>
+<script type="text/x-mathjax-config">
+ MathJax.Hub.Config({
+ extensions: ["tex2jax.js"],
+ jax: ["input/TeX","output/HTML-CSS"],
+});
+</script>
+<script type="text/javascript" async="async" src="http://cdn.mathjax.org/mathjax/latest/MathJax.js"></script>
+<link href="doxygen.css" rel="stylesheet" type="text/css" />
+<link href="customdoxygen.css" rel="stylesheet" type="text/css"/>
+</head>
+<body>
+<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
+<div id="titlearea">
+<table cellspacing="0" cellpadding="0">
+ <tbody>
+ <tr style="height: 56px;">
+ <td style="padding-left: 0.5em;">
+ <div id="projectname">MinGfx Toolkit
+  <span id="projectnumber">1.0</span>
+ </div>
+ <div id="projectbrief">A minimal library for writing cross-platform (Windows, OSX, linux) graphics programs.</div>
+ </td>
+ </tr>
+ </tbody>
+</table>
+</div>
+<!-- end header part -->
+<!-- Generated by Doxygen 1.9.1 -->
+<script type="text/javascript">
+/* @license magnet:?xt=urn:btih:cf05388f2679ee054f2beb29a391d25f4e673ac3&dn=gpl-2.0.txt GPL-v2 */
+var searchBox = new SearchBox("searchBox", "search",false,'Search','.html');
+/* @license-end */
+</script>
+<script type="text/javascript" src="menudata.js"></script>
+<script type="text/javascript" src="menu.js"></script>
+<script type="text/javascript">
+/* @license magnet:?xt=urn:btih:cf05388f2679ee054f2beb29a391d25f4e673ac3&dn=gpl-2.0.txt GPL-v2 */
+$(function() {
+ initMenu('',true,false,'search.php','Search');
+ $(document).ready(function() { init_search(); });
+});
+/* @license-end */</script>
+<div id="main-nav"></div>
+<!-- window showing the filter options -->
+<div id="MSearchSelectWindow"
+ onmouseover="return searchBox.OnSearchSelectShow()"
+ onmouseout="return searchBox.OnSearchSelectHide()"
+ onkeydown="return searchBox.OnSearchSelectKey(event)">
+</div>
+
+<!-- iframe showing the search results (closed by default) -->
+<div id="MSearchResultsWindow">
+<iframe src="javascript:void(0)" frameborder="0"
+ name="MSearchResults" id="MSearchResults">
+</iframe>
+</div>
+
+<div id="nav-path" class="navpath">
+ <ul>
+<li class="navelem"><a class="el" href="namespacemingfx.html">mingfx</a></li><li class="navelem"><a class="el" href="classmingfx_1_1_mesh.html">Mesh</a></li> </ul>
+</div>
+</div><!-- top -->
+<div class="header">
+ <div class="summary">
+<a href="#pub-methods">Public Member Functions</a> |
+<a href="classmingfx_1_1_mesh-members.html">List of all members</a> </div>
+ <div class="headertitle">
+<div class="title">mingfx::Mesh Class Reference</div> </div>
+</div><!--header-->
+<div class="contents">
+<a name="details" id="details"></a><h2 class="groupheader">Detailed Description</h2>
+<div class="textblock"><p>A triangle mesh data structure that can be rendered with a <a class="el" href="classmingfx_1_1_shader_program.html" title="A wrapper around GLSL shader programs.">ShaderProgram</a> like <a class="el" href="classmingfx_1_1_default_shader.html" title="A simple GLSL shader for textured per-fragment Phong shading with multiple light sources.">DefaultShader</a>. </p>
+<p>The mesh can be created algorithmically by adding triangles one at a time or it can be loaded from an .obj file.</p>
+<p>Vertices are required – you cannot have a mesh without vertices, but other attributes (normals, colors, texture coordinates) are optional. When <a class="el" href="classmingfx_1_1_mesh.html#a75075d472938fd760477be42585aff5c" title="This sends the mesh vertices and attributes down the graphics pipe using glDrawArrays() for the non-i...">Draw()</a> is called the mesh will automatically set these other attributes if available.</p>
+<p>Example of loading from a file: </p><div class="fragment"><div class="line"><span class="comment">// during initialization</span></div>
+<div class="line"><a class="code" href="classmingfx_1_1_mesh.html#a69613870d54989f4226e50caf4ca9fb9">Mesh</a> m;</div>
+<div class="line">m.LoadFromOBJ(<a class="code" href="classmingfx_1_1_platform.html#a2c36ca57a246efa218a49a942c8c4a3b">Platform::FindMinGfxDataFile</a>(<span class="stringliteral">"teapot.obj"</span>));</div>
+<div class="line"><span class="comment">// also create a shader to draw it.</span></div>
+<div class="line">DefaultShader s;</div>
+<div class="line"> </div>
+<div class="line"> </div>
+<div class="line"><span class="comment">// later to draw</span></div>
+<div class="line">Matrix4 M;</div>
+<div class="line">Matrix4 V = <a class="code" href="classmingfx_1_1_matrix4.html#a4543695a6dfc996d0312b70c2eaa00de">Matrix4::LookAt</a>(Point3(0,0,3), Point3(0,0,0), Vector3(0,1,0));</div>
+<div class="line">Matrix4 P = <a class="code" href="classmingfx_1_1_matrix4.html#a0e34aee86758a0397074590b87712c5e">Matrix4::Perspective</a>(60.0, aspect_ratio(), 0.1, 10.0);</div>
+<div class="line">s.Draw(M, V, P, m, DefaultShader::MaterialProperties());</div>
+<div class="ttc" id="aclassmingfx_1_1_matrix4_html_a0e34aee86758a0397074590b87712c5e"><div class="ttname"><a href="classmingfx_1_1_matrix4.html#a0e34aee86758a0397074590b87712c5e">mingfx::Matrix4::Perspective</a></div><div class="ttdeci">static Matrix4 Perspective(float fov_y_in_degrees, float aspect_ratio, float near_plane_dist, float far_plane_dist)</div><div class="ttdoc">Returns a perspective projection matrix equivalent to the one gluPerspective creates.</div></div>
+<div class="ttc" id="aclassmingfx_1_1_matrix4_html_a4543695a6dfc996d0312b70c2eaa00de"><div class="ttname"><a href="classmingfx_1_1_matrix4.html#a4543695a6dfc996d0312b70c2eaa00de">mingfx::Matrix4::LookAt</a></div><div class="ttdeci">static Matrix4 LookAt(Point3 eye, Point3 target, Vector3 up)</div><div class="ttdoc">Returns a view matrix that centers the camera at the 'eye' position and orients it to look at the des...</div></div>
+<div class="ttc" id="aclassmingfx_1_1_mesh_html_a69613870d54989f4226e50caf4ca9fb9"><div class="ttname"><a href="classmingfx_1_1_mesh.html#a69613870d54989f4226e50caf4ca9fb9">mingfx::Mesh::Mesh</a></div><div class="ttdeci">Mesh()</div><div class="ttdoc">Creates an empty mesh.</div></div>
+<div class="ttc" id="aclassmingfx_1_1_platform_html_a2c36ca57a246efa218a49a942c8c4a3b"><div class="ttname"><a href="classmingfx_1_1_platform.html#a2c36ca57a246efa218a49a942c8c4a3b">mingfx::Platform::FindMinGfxDataFile</a></div><div class="ttdeci">static std::string FindMinGfxDataFile(const std::string &basename)</div><div class="ttdoc">Searches for a data file that ships with MinGfx.</div></div>
+</div><!-- fragment --><p>Example of creating a mesh algorithmically: </p><div class="fragment"><div class="line"><a class="code" href="classmingfx_1_1_mesh.html#a69613870d54989f4226e50caf4ca9fb9">Mesh</a> mesh1;</div>
+<div class="line"><span class="keywordtype">int</span> tri_id;</div>
+<div class="line"><span class="comment">// add a first triangle</span></div>
+<div class="line">tri_id = mesh1.AddTriangle(Point3(0,0,0), Point3(1,0,0), Point3(1,1,0));</div>
+<div class="line"><span class="comment">// set attributes for the vertices</span></div>
+<div class="line">mesh1.SetNormals(tri_id, Vector3(0,0,1), Vector3(0,0,1), Vector3(0,0,1));</div>
+<div class="line">mesh1.SetTexCoords(tri_id, 0, Point2(0,1), Point2(1,1), Point2(1,0));</div>
+<div class="line"> </div>
+<div class="line"><span class="comment">// add a second triangle and attributes</span></div>
+<div class="line">tri_id = mesh1.AddTriangle(Point3(0,0,0), Point3(1,1,0), Point3(0,1,0));</div>
+<div class="line">mesh1.SetNormals(tri_id, Vector3(0,0,1), Vector3(0,0,1), Vector3(0,0,1));</div>
+<div class="line">mesh1.SetTexCoords(tri_id, 0, Point2(0,1), Point2(1,0), Point2(0,0));</div>
+<div class="line"> </div>
+<div class="line"><span class="comment">// call this when done to save to the GPU</span></div>
+<div class="line">mesh1.UpdateGPUMemory();</div>
+<div class="line"> </div>
+<div class="line"><span class="comment">// then you can draw the same way as in the previous example.</span></div>
+</div><!-- fragment --><p> In the mode used above where you add one triangle at a time there is no way to reuse vertices in multiple triangles. If you need to do this for efficiency or other reasons, then you can use an indexed faces mode where you set the mesh data structures directly.</p>
+<p>Example of creating a mesh that renders in an indexed faces mode: </p><div class="fragment"><div class="line">std::vector<unsigned int> indices;</div>
+<div class="line">std::vector<Point3> vertices;</div>
+<div class="line">std::vector<Vector3> normals;</div>
+<div class="line">std::vector<Point2> texcoords;</div>
+<div class="line"> </div>
+<div class="line"><span class="comment">// four vertices, each requires 3 floats: (x,y,z)</span></div>
+<div class="line">vertices.push_back(Point3(0,0,0));</div>
+<div class="line">vertices.push_back(Point3(1,0,0));</div>
+<div class="line">vertices.push_back(Point3(1,1,0));</div>
+<div class="line">vertices.push_back(Point3(0,1,0));</div>
+<div class="line"> </div>
+<div class="line"><span class="comment">// four normals, each requires 3 floats: (x,y,z)</span></div>
+<div class="line">normals.push_back(Vector3(0,0,1));</div>
+<div class="line">normals.push_back(Vector3(0,0,1));</div>
+<div class="line">normals.push_back(Vector3(0,0,1));</div>
+<div class="line">normals.push_back(Vector3(0,0,1));</div>
+<div class="line"> </div>
+<div class="line"><span class="comment">// four texture coords, each requires 2 floats: (u,v)</span></div>
+<div class="line">texcoords.push_back(Point2(0,1));</div>
+<div class="line">texcoords.push_back(Point2(1,1));</div>
+<div class="line">texcoords.push_back(Point2(1,0));</div>
+<div class="line">texcoords.push_back(Point2(0,0));</div>
+<div class="line"> </div>
+<div class="line"><span class="comment">// indices into the arrays above for the first triangle</span></div>
+<div class="line">indices.push_back(0); </div>
+<div class="line">indices.push_back(1); </div>
+<div class="line">indices.push_back(2);</div>
+<div class="line"> </div>
+<div class="line"><span class="comment">// indices for the second triangle, note some are reused</span></div>
+<div class="line">indices.push_back(0); </div>
+<div class="line">indices.push_back(2); </div>
+<div class="line">indices.push_back(3);</div>
+<div class="line"> </div>
+<div class="line"><a class="code" href="classmingfx_1_1_mesh.html#a69613870d54989f4226e50caf4ca9fb9">Mesh</a> mesh1;</div>
+<div class="line">mesh1.SetVertices(vertices);</div>
+<div class="line">mesh1.SetNormals(normals);</div>
+<div class="line">mesh1.SetTexCoords(0, texcoords);</div>
+<div class="line">mesh1.SetIndices(indices);</div>
+<div class="line">mesh1.UpdateGPUMemory();</div>
+<div class="line"> </div>
+<div class="line"><span class="comment">// then you can draw the same way as in the previous example.</span></div>
+</div><!-- fragment -->
+<p class="definition">Definition at line <a class="el" href="mesh_8h_source.html#l00127">127</a> of file <a class="el" href="mesh_8h_source.html">mesh.h</a>.</p>
+</div>
+<p><code>#include <<a class="el" href="mesh_8h_source.html">mesh.h</a>></code></p>
+<table class="memberdecls">
+<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="pub-methods"></a>
+Public Member Functions</h2></td></tr>
+<tr class="memitem:a69613870d54989f4226e50caf4ca9fb9"><td class="memItemLeft" align="right" valign="top"> </td><td class="memItemRight" valign="bottom"><a class="el" href="classmingfx_1_1_mesh.html#a69613870d54989f4226e50caf4ca9fb9">Mesh</a> ()</td></tr>
+<tr class="memdesc:a69613870d54989f4226e50caf4ca9fb9"><td class="mdescLeft"> </td><td class="mdescRight">Creates an empty mesh. <a href="classmingfx_1_1_mesh.html#a69613870d54989f4226e50caf4ca9fb9">More...</a><br /></td></tr>
+<tr class="separator:a69613870d54989f4226e50caf4ca9fb9"><td class="memSeparator" colspan="2"> </td></tr>
+<tr class="memitem:a76b4977f0a7f156aa8a0027f10dcbdc1"><td class="memItemLeft" align="right" valign="top"> </td><td class="memItemRight" valign="bottom"><a class="el" href="classmingfx_1_1_mesh.html#a76b4977f0a7f156aa8a0027f10dcbdc1">Mesh</a> (const <a class="el" href="classmingfx_1_1_mesh.html">Mesh</a> &other)</td></tr>
+<tr class="memdesc:a76b4977f0a7f156aa8a0027f10dcbdc1"><td class="mdescLeft"> </td><td class="mdescRight">Copies all data and sets GPU dirty bit for the new mesh. <a href="classmingfx_1_1_mesh.html#a76b4977f0a7f156aa8a0027f10dcbdc1">More...</a><br /></td></tr>
+<tr class="separator:a76b4977f0a7f156aa8a0027f10dcbdc1"><td class="memSeparator" colspan="2"> </td></tr>
+<tr class="memitem:ace7b23730dbcb581c4886cf2b9998327"><td class="memItemLeft" align="right" valign="top">virtual </td><td class="memItemRight" valign="bottom"><a class="el" href="classmingfx_1_1_mesh.html#ace7b23730dbcb581c4886cf2b9998327">~Mesh</a> ()</td></tr>
+<tr class="separator:ace7b23730dbcb581c4886cf2b9998327"><td class="memSeparator" colspan="2"> </td></tr>
+<tr class="memitem:a8d05faf18ef8d170fc3c2a343075823f"><td class="memItemLeft" align="right" valign="top">void </td><td class="memItemRight" valign="bottom"><a class="el" href="classmingfx_1_1_mesh.html#a8d05faf18ef8d170fc3c2a343075823f">LoadFromOBJ</a> (const std::string &filename)</td></tr>
+<tr class="memdesc:a8d05faf18ef8d170fc3c2a343075823f"><td class="mdescLeft"> </td><td class="mdescRight">This reads a mesh stored in the common Wavefront Obj file format. <a href="classmingfx_1_1_mesh.html#a8d05faf18ef8d170fc3c2a343075823f">More...</a><br /></td></tr>
+<tr class="separator:a8d05faf18ef8d170fc3c2a343075823f"><td class="memSeparator" colspan="2"> </td></tr>
+<tr class="memitem:a29eeb2e778704350789033ec4940d55a"><td class="memItemLeft" align="right" valign="top">int </td><td class="memItemRight" valign="bottom"><a class="el" href="classmingfx_1_1_mesh.html#a29eeb2e778704350789033ec4940d55a">AddTriangle</a> (<a class="el" href="classmingfx_1_1_point3.html">Point3</a> v1, <a class="el" href="classmingfx_1_1_point3.html">Point3</a> v2, <a class="el" href="classmingfx_1_1_point3.html">Point3</a> v3)</td></tr>
+<tr class="memdesc:a29eeb2e778704350789033ec4940d55a"><td class="mdescLeft"> </td><td class="mdescRight">Adds a triangle to the mesh datastructure and returns a triangle ID. <a href="classmingfx_1_1_mesh.html#a29eeb2e778704350789033ec4940d55a">More...</a><br /></td></tr>
+<tr class="separator:a29eeb2e778704350789033ec4940d55a"><td class="memSeparator" colspan="2"> </td></tr>
+<tr class="memitem:a3e0ac86714f6b7c3f62761ef3952a044"><td class="memItemLeft" align="right" valign="top">void </td><td class="memItemRight" valign="bottom"><a class="el" href="classmingfx_1_1_mesh.html#a3e0ac86714f6b7c3f62761ef3952a044">UpdateTriangle</a> (int triangle_id, <a class="el" href="classmingfx_1_1_point3.html">Point3</a> v1, <a class="el" href="classmingfx_1_1_point3.html">Point3</a> v2, <a class="el" href="classmingfx_1_1_point3.html">Point3</a> v3)</td></tr>
+<tr class="memdesc:a3e0ac86714f6b7c3f62761ef3952a044"><td class="mdescLeft"> </td><td class="mdescRight">Updates the vertex positions for a triangle that has already been added to the mesh. <a href="classmingfx_1_1_mesh.html#a3e0ac86714f6b7c3f62761ef3952a044">More...</a><br /></td></tr>
+<tr class="separator:a3e0ac86714f6b7c3f62761ef3952a044"><td class="memSeparator" colspan="2"> </td></tr>
+<tr class="memitem:a43d5a5cc3ef742a8c2b5e3f1b4da0903"><td class="memItemLeft" align="right" valign="top">void </td><td class="memItemRight" valign="bottom"><a class="el" href="classmingfx_1_1_mesh.html#a43d5a5cc3ef742a8c2b5e3f1b4da0903">SetNormals</a> (int triangle_id, <a class="el" href="classmingfx_1_1_vector3.html">Vector3</a> n1, <a class="el" href="classmingfx_1_1_vector3.html">Vector3</a> n2, <a class="el" href="classmingfx_1_1_vector3.html">Vector3</a> n3)</td></tr>
+<tr class="memdesc:a43d5a5cc3ef742a8c2b5e3f1b4da0903"><td class="mdescLeft"> </td><td class="mdescRight">Sets the normals for the three vertices of a triangle that has already been added to the mesh. <a href="classmingfx_1_1_mesh.html#a43d5a5cc3ef742a8c2b5e3f1b4da0903">More...</a><br /></td></tr>
+<tr class="separator:a43d5a5cc3ef742a8c2b5e3f1b4da0903"><td class="memSeparator" colspan="2"> </td></tr>
+<tr class="memitem:a0f59e19b74f4f9dc2ad580756f8b319f"><td class="memItemLeft" align="right" valign="top">void </td><td class="memItemRight" valign="bottom"><a class="el" href="classmingfx_1_1_mesh.html#a0f59e19b74f4f9dc2ad580756f8b319f">SetColors</a> (int triangle_id, <a class="el" href="classmingfx_1_1_color.html">Color</a> c1, <a class="el" href="classmingfx_1_1_color.html">Color</a> c2, <a class="el" href="classmingfx_1_1_color.html">Color</a> c3)</td></tr>
+<tr class="memdesc:a0f59e19b74f4f9dc2ad580756f8b319f"><td class="mdescLeft"> </td><td class="mdescRight">Sets per-vertex colors for the three vertices of a triangle that has already been added to the mesh. <a href="classmingfx_1_1_mesh.html#a0f59e19b74f4f9dc2ad580756f8b319f">More...</a><br /></td></tr>
+<tr class="separator:a0f59e19b74f4f9dc2ad580756f8b319f"><td class="memSeparator" colspan="2"> </td></tr>
+<tr class="memitem:a17cb896939007357014c74a1ece6f1f3"><td class="memItemLeft" align="right" valign="top">void </td><td class="memItemRight" valign="bottom"><a class="el" href="classmingfx_1_1_mesh.html#a17cb896939007357014c74a1ece6f1f3">SetTexCoords</a> (int triangle_id, int texture_unit, <a class="el" href="classmingfx_1_1_point2.html">Point2</a> uv1, <a class="el" href="classmingfx_1_1_point2.html">Point2</a> uv2, <a class="el" href="classmingfx_1_1_point2.html">Point2</a> uv3)</td></tr>
+<tr class="memdesc:a17cb896939007357014c74a1ece6f1f3"><td class="mdescLeft"> </td><td class="mdescRight">Sets the texture coordinates for the three vertices of a triangle that has already been added to the mesh. <a href="classmingfx_1_1_mesh.html#a17cb896939007357014c74a1ece6f1f3">More...</a><br /></td></tr>
+<tr class="separator:a17cb896939007357014c74a1ece6f1f3"><td class="memSeparator" colspan="2"> </td></tr>
+<tr class="memitem:a1dd243b53826765ba468f505645102a6"><td class="memItemLeft" align="right" valign="top">void </td><td class="memItemRight" valign="bottom"><a class="el" href="classmingfx_1_1_mesh.html#a1dd243b53826765ba468f505645102a6">SetVertices</a> (const std::vector< <a class="el" href="classmingfx_1_1_point3.html">Point3</a> > &verts)</td></tr>
+<tr class="memdesc:a1dd243b53826765ba468f505645102a6"><td class="mdescLeft"> </td><td class="mdescRight">Sets the vertex array for the mesh directly. <a href="classmingfx_1_1_mesh.html#a1dd243b53826765ba468f505645102a6">More...</a><br /></td></tr>
+<tr class="separator:a1dd243b53826765ba468f505645102a6"><td class="memSeparator" colspan="2"> </td></tr>
+<tr class="memitem:ad28dbd5b0ab77bec28f30f618dd9e57d"><td class="memItemLeft" align="right" valign="top">void </td><td class="memItemRight" valign="bottom"><a class="el" href="classmingfx_1_1_mesh.html#ad28dbd5b0ab77bec28f30f618dd9e57d">SetNormals</a> (const std::vector< <a class="el" href="classmingfx_1_1_vector3.html">Vector3</a> > &norms)</td></tr>
+<tr class="memdesc:ad28dbd5b0ab77bec28f30f618dd9e57d"><td class="mdescLeft"> </td><td class="mdescRight">Sets the normal array for the mesh directly. <a href="classmingfx_1_1_mesh.html#ad28dbd5b0ab77bec28f30f618dd9e57d">More...</a><br /></td></tr>
+<tr class="separator:ad28dbd5b0ab77bec28f30f618dd9e57d"><td class="memSeparator" colspan="2"> </td></tr>
+<tr class="memitem:ab9b05a77591a9adad12032d513256dae"><td class="memItemLeft" align="right" valign="top">void </td><td class="memItemRight" valign="bottom"><a class="el" href="classmingfx_1_1_mesh.html#ab9b05a77591a9adad12032d513256dae">SetColors</a> (const std::vector< <a class="el" href="classmingfx_1_1_color.html">Color</a> > &colors)</td></tr>
+<tr class="memdesc:ab9b05a77591a9adad12032d513256dae"><td class="mdescLeft"> </td><td class="mdescRight">Sets the per-vertex colors array for the mesh directly. <a href="classmingfx_1_1_mesh.html#ab9b05a77591a9adad12032d513256dae">More...</a><br /></td></tr>
+<tr class="separator:ab9b05a77591a9adad12032d513256dae"><td class="memSeparator" colspan="2"> </td></tr>
+<tr class="memitem:aba2dfd0ade2d8a728897d411ef3fdaf1"><td class="memItemLeft" align="right" valign="top">void </td><td class="memItemRight" valign="bottom"><a class="el" href="classmingfx_1_1_mesh.html#aba2dfd0ade2d8a728897d411ef3fdaf1">SetTexCoords</a> (int texture_unit, const std::vector< <a class="el" href="classmingfx_1_1_point2.html">Point2</a> > &tex_coords)</td></tr>
+<tr class="memdesc:aba2dfd0ade2d8a728897d411ef3fdaf1"><td class="mdescLeft"> </td><td class="mdescRight">Sets a texture coordinates array for the mesh directly. <a href="classmingfx_1_1_mesh.html#aba2dfd0ade2d8a728897d411ef3fdaf1">More...</a><br /></td></tr>
+<tr class="separator:aba2dfd0ade2d8a728897d411ef3fdaf1"><td class="memSeparator" colspan="2"> </td></tr>
+<tr class="memitem:a1f94c9ca7867b65e04f7e02813a06581"><td class="memItemLeft" align="right" valign="top">void </td><td class="memItemRight" valign="bottom"><a class="el" href="classmingfx_1_1_mesh.html#a1f94c9ca7867b65e04f7e02813a06581">SetIndices</a> (const std::vector< unsigned int > index_array)</td></tr>
+<tr class="memdesc:a1f94c9ca7867b65e04f7e02813a06581"><td class="mdescLeft"> </td><td class="mdescRight">Sets the indices into the vertex array to use to create the triangles. Each consecutive set of 3 indices forms one triangle: (v1,v2,v3), (v1,v2,v3), (v1,v2,v3), ... <a href="classmingfx_1_1_mesh.html#a1f94c9ca7867b65e04f7e02813a06581">More...</a><br /></td></tr>
+<tr class="separator:a1f94c9ca7867b65e04f7e02813a06581"><td class="memSeparator" colspan="2"> </td></tr>
+<tr class="memitem:a7175238f5874929e2258458b98421d87"><td class="memItemLeft" align="right" valign="top">void </td><td class="memItemRight" valign="bottom"><a class="el" href="classmingfx_1_1_mesh.html#a7175238f5874929e2258458b98421d87">SetInstanceTransforms</a> (const std::vector< <a class="el" href="classmingfx_1_1_matrix4.html">Matrix4</a> > &xforms)</td></tr>
+<tr class="separator:a7175238f5874929e2258458b98421d87"><td class="memSeparator" colspan="2"> </td></tr>
+<tr class="memitem:a033076b9bf1714c9b9e0eeef11ebcd49"><td class="memItemLeft" align="right" valign="top">void </td><td class="memItemRight" valign="bottom"><a class="el" href="classmingfx_1_1_mesh.html#a033076b9bf1714c9b9e0eeef11ebcd49">SetVertices</a> (float *verts_array, int num_verts)</td></tr>
+<tr class="memdesc:a033076b9bf1714c9b9e0eeef11ebcd49"><td class="mdescLeft"> </td><td class="mdescRight">Sets the vertex array for the mesh directly. Vertices are stored as (x,y,z), (x,y,z), (x,y,z), ... This version of the function accepts a C-style array rather than std::vector<> <a href="classmingfx_1_1_mesh.html#a033076b9bf1714c9b9e0eeef11ebcd49">More...</a><br /></td></tr>
+<tr class="separator:a033076b9bf1714c9b9e0eeef11ebcd49"><td class="memSeparator" colspan="2"> </td></tr>
+<tr class="memitem:a6ab1128fab6f969564d3a1329baeade6"><td class="memItemLeft" align="right" valign="top">void </td><td class="memItemRight" valign="bottom"><a class="el" href="classmingfx_1_1_mesh.html#a6ab1128fab6f969564d3a1329baeade6">SetNormals</a> (float *norms_array, int num_norms)</td></tr>
+<tr class="memdesc:a6ab1128fab6f969564d3a1329baeade6"><td class="mdescLeft"> </td><td class="mdescRight">Sets the normal array for the mesh directly. Normals are stored as (x,y,z), (x,y,z), (x,y,z), ... following the same ordering as was used for <a class="el" href="classmingfx_1_1_mesh.html#a1dd243b53826765ba468f505645102a6" title="Sets the vertex array for the mesh directly.">SetVertices()</a>. This version of the function accepts a C-style array rather than std::vector<> <a href="classmingfx_1_1_mesh.html#a6ab1128fab6f969564d3a1329baeade6">More...</a><br /></td></tr>
+<tr class="separator:a6ab1128fab6f969564d3a1329baeade6"><td class="memSeparator" colspan="2"> </td></tr>
+<tr class="memitem:aed172bdd77858f3b59978cb8527e19ae"><td class="memItemLeft" align="right" valign="top">void </td><td class="memItemRight" valign="bottom"><a class="el" href="classmingfx_1_1_mesh.html#aed172bdd77858f3b59978cb8527e19ae">SetColors</a> (float *colors_array, int num_colors)</td></tr>
+<tr class="memdesc:aed172bdd77858f3b59978cb8527e19ae"><td class="mdescLeft"> </td><td class="mdescRight">Sets the per-vertex colors array for the mesh directly. Colors are stored as (r,g,b,a), (r,g,b,a), (r,g,b,a), ... following the same ordering as was used for <a class="el" href="classmingfx_1_1_mesh.html#a1dd243b53826765ba468f505645102a6" title="Sets the vertex array for the mesh directly.">SetVertices()</a>. This version of the function accepts a C-style array rather than std::vector<> <a href="classmingfx_1_1_mesh.html#aed172bdd77858f3b59978cb8527e19ae">More...</a><br /></td></tr>
+<tr class="separator:aed172bdd77858f3b59978cb8527e19ae"><td class="memSeparator" colspan="2"> </td></tr>
+<tr class="memitem:ac9cd4e8d67bb70295a48fcbc72ae32f9"><td class="memItemLeft" align="right" valign="top">void </td><td class="memItemRight" valign="bottom"><a class="el" href="classmingfx_1_1_mesh.html#ac9cd4e8d67bb70295a48fcbc72ae32f9">SetTexCoords</a> (int texture_unit, float *tex_coords_array, int num_tex_coords)</td></tr>
+<tr class="memdesc:ac9cd4e8d67bb70295a48fcbc72ae32f9"><td class="mdescLeft"> </td><td class="mdescRight">Sets a texture coordinates array for the mesh directly. Tex coords are stored as (u,v), (u,v), (u,v), ... following the same ordering as was used for <a class="el" href="classmingfx_1_1_mesh.html#a1dd243b53826765ba468f505645102a6" title="Sets the vertex array for the mesh directly.">SetVertices()</a>. This version of the function accepts a C-style array rather than std::vector<> <a href="classmingfx_1_1_mesh.html#ac9cd4e8d67bb70295a48fcbc72ae32f9">More...</a><br /></td></tr>
+<tr class="separator:ac9cd4e8d67bb70295a48fcbc72ae32f9"><td class="memSeparator" colspan="2"> </td></tr>
+<tr class="memitem:a84711746b8d37c8d9b12ae748a4c5b8c"><td class="memItemLeft" align="right" valign="top">void </td><td class="memItemRight" valign="bottom"><a class="el" href="classmingfx_1_1_mesh.html#a84711746b8d37c8d9b12ae748a4c5b8c">SetIndices</a> (unsigned int *index_array, int num_indices)</td></tr>
+<tr class="memdesc:a84711746b8d37c8d9b12ae748a4c5b8c"><td class="mdescLeft"> </td><td class="mdescRight">Sets the indices into the vertex array to use to create the triangles. Each consecutive set of 3 indices forms one triangle: (v1,v2,v3), (v1,v2,v3), (v1,v2,v3), ... This version of the function accepts a C-style array rather than std::vector<> <a href="classmingfx_1_1_mesh.html#a84711746b8d37c8d9b12ae748a4c5b8c">More...</a><br /></td></tr>
+<tr class="separator:a84711746b8d37c8d9b12ae748a4c5b8c"><td class="memSeparator" colspan="2"> </td></tr>
+<tr class="memitem:ac74345bf4b2994de4ee1c509bcc6840e"><td class="memItemLeft" align="right" valign="top">void </td><td class="memItemRight" valign="bottom"><a class="el" href="classmingfx_1_1_mesh.html#ac74345bf4b2994de4ee1c509bcc6840e">UpdateGPUMemory</a> ()</td></tr>
+<tr class="memdesc:ac74345bf4b2994de4ee1c509bcc6840e"><td class="mdescLeft"> </td><td class="mdescRight">This copies the entire mesh data structure to a vertex array in GPU memory, which must happen before you can draw the mesh. <a href="classmingfx_1_1_mesh.html#ac74345bf4b2994de4ee1c509bcc6840e">More...</a><br /></td></tr>
+<tr class="separator:ac74345bf4b2994de4ee1c509bcc6840e"><td class="memSeparator" colspan="2"> </td></tr>
+<tr class="memitem:a75075d472938fd760477be42585aff5c"><td class="memItemLeft" align="right" valign="top">void </td><td class="memItemRight" valign="bottom"><a class="el" href="classmingfx_1_1_mesh.html#a75075d472938fd760477be42585aff5c">Draw</a> ()</td></tr>
+<tr class="memdesc:a75075d472938fd760477be42585aff5c"><td class="mdescLeft"> </td><td class="mdescRight">This sends the mesh vertices and attributes down the graphics pipe using glDrawArrays() for the non-indexed mode and glDrawElements() for the indexed mode. <a href="classmingfx_1_1_mesh.html#a75075d472938fd760477be42585aff5c">More...</a><br /></td></tr>
+<tr class="separator:a75075d472938fd760477be42585aff5c"><td class="memSeparator" colspan="2"> </td></tr>
+<tr class="memitem:a1a5cea9cfdf4c672ba0c781ee54718f7"><td class="memItemLeft" align="right" valign="top">void </td><td class="memItemRight" valign="bottom"><a class="el" href="classmingfx_1_1_mesh.html#a1a5cea9cfdf4c672ba0c781ee54718f7">CalcPerFaceNormals</a> ()</td></tr>
+<tr class="memdesc:a1a5cea9cfdf4c672ba0c781ee54718f7"><td class="mdescLeft"> </td><td class="mdescRight">This (re)calculates the normals for the mesh and stores them with the mesh data structure. <a href="classmingfx_1_1_mesh.html#a1a5cea9cfdf4c672ba0c781ee54718f7">More...</a><br /></td></tr>
+<tr class="separator:a1a5cea9cfdf4c672ba0c781ee54718f7"><td class="memSeparator" colspan="2"> </td></tr>
+<tr class="memitem:acc7df547b0a2175287cc9f509c04e93c"><td class="memItemLeft" align="right" valign="top">void </td><td class="memItemRight" valign="bottom"><a class="el" href="classmingfx_1_1_mesh.html#acc7df547b0a2175287cc9f509c04e93c">CalcPerVertexNormals</a> ()</td></tr>
+<tr class="memdesc:acc7df547b0a2175287cc9f509c04e93c"><td class="mdescLeft"> </td><td class="mdescRight">This (re)calculates the normals for the mesh and stores them with the mesh data structure. <a href="classmingfx_1_1_mesh.html#acc7df547b0a2175287cc9f509c04e93c">More...</a><br /></td></tr>
+<tr class="separator:acc7df547b0a2175287cc9f509c04e93c"><td class="memSeparator" colspan="2"> </td></tr>
+<tr class="memitem:a8d96c1b5985cd836f2aa2b2994af64c1"><td class="memItemLeft" align="right" valign="top">void </td><td class="memItemRight" valign="bottom"><a class="el" href="classmingfx_1_1_mesh.html#a8d96c1b5985cd836f2aa2b2994af64c1">BuildBVH</a> ()</td></tr>
+<tr class="memdesc:a8d96c1b5985cd836f2aa2b2994af64c1"><td class="mdescLeft"> </td><td class="mdescRight">This (re)calculates a Bounding Volume Hierarchy for the mesh, which can be used together with <a class="el" href="classmingfx_1_1_ray.html#ac90097090f0f8f49db13f6f232712afc" title="Checks to see if the ray intersects a triangle mesh.">Ray::FastIntersectMesh()</a> to do faster ray-mesh intersection testing. <a href="classmingfx_1_1_mesh.html#a8d96c1b5985cd836f2aa2b2994af64c1">More...</a><br /></td></tr>
+<tr class="separator:a8d96c1b5985cd836f2aa2b2994af64c1"><td class="memSeparator" colspan="2"> </td></tr>
+<tr class="memitem:a978b1341d5613d399a68e40c61c57ba4"><td class="memItemLeft" align="right" valign="top"><a class="el" href="classmingfx_1_1_b_v_h.html">BVH</a> * </td><td class="memItemRight" valign="bottom"><a class="el" href="classmingfx_1_1_mesh.html#a978b1341d5613d399a68e40c61c57ba4">bvh_ptr</a> ()</td></tr>
+<tr class="memdesc:a978b1341d5613d399a68e40c61c57ba4"><td class="mdescLeft"> </td><td class="mdescRight">Returns a pointer to the underlying <a class="el" href="classmingfx_1_1_b_v_h.html" title="A Bounding Volume Hierarchy (BVH) data structure that can be used to accelerate ray-object intersecti...">BVH</a> data structure. <a href="classmingfx_1_1_mesh.html#a978b1341d5613d399a68e40c61c57ba4">More...</a><br /></td></tr>
+<tr class="separator:a978b1341d5613d399a68e40c61c57ba4"><td class="memSeparator" colspan="2"> </td></tr>
+<tr class="memitem:ab8f6856429466f1b4600a6ec27b84d0d"><td class="memItemLeft" align="right" valign="top">int </td><td class="memItemRight" valign="bottom"><a class="el" href="classmingfx_1_1_mesh.html#ab8f6856429466f1b4600a6ec27b84d0d">num_vertices</a> () const</td></tr>
+<tr class="memdesc:ab8f6856429466f1b4600a6ec27b84d0d"><td class="mdescLeft"> </td><td class="mdescRight">The total number of vertices in the mesh. <a href="classmingfx_1_1_mesh.html#ab8f6856429466f1b4600a6ec27b84d0d">More...</a><br /></td></tr>
+<tr class="separator:ab8f6856429466f1b4600a6ec27b84d0d"><td class="memSeparator" colspan="2"> </td></tr>
+<tr class="memitem:ada9371e85aa0b61df79b26fc880b1863"><td class="memItemLeft" align="right" valign="top"><a class="el" href="classmingfx_1_1_point3.html">Point3</a> </td><td class="memItemRight" valign="bottom"><a class="el" href="classmingfx_1_1_mesh.html#ada9371e85aa0b61df79b26fc880b1863">read_vertex_data</a> (int vertex_id) const</td></tr>
+<tr class="memdesc:ada9371e85aa0b61df79b26fc880b1863"><td class="mdescLeft"> </td><td class="mdescRight">Read only access to the vertex position data. Data are returned as a <a class="el" href="classmingfx_1_1_point3.html" title="A 3D Point with floating point coordinates, used for storing vertices and all sorts of other 3D graph...">Point3</a>. Indexed by vertex number. Also see <a class="el" href="classmingfx_1_1_mesh.html#ab8f6856429466f1b4600a6ec27b84d0d" title="The total number of vertices in the mesh.">num_vertices()</a>. Use the <a class="el" href="classmingfx_1_1_mesh.html#a1dd243b53826765ba468f505645102a6" title="Sets the vertex array for the mesh directly.">SetVertices()</a> function to set (or edit) vertex data. <a href="classmingfx_1_1_mesh.html#ada9371e85aa0b61df79b26fc880b1863">More...</a><br /></td></tr>
+<tr class="separator:ada9371e85aa0b61df79b26fc880b1863"><td class="memSeparator" colspan="2"> </td></tr>
+<tr class="memitem:a439361e454ca63c35f564aed5cd0de65"><td class="memItemLeft" align="right" valign="top"><a class="el" href="classmingfx_1_1_vector3.html">Vector3</a> </td><td class="memItemRight" valign="bottom"><a class="el" href="classmingfx_1_1_mesh.html#a439361e454ca63c35f564aed5cd0de65">read_normal_data</a> (int vertex_id) const</td></tr>
+<tr class="memdesc:a439361e454ca63c35f564aed5cd0de65"><td class="mdescLeft"> </td><td class="mdescRight">Read only access to per-vertex normal data. Data are returned as a <a class="el" href="classmingfx_1_1_vector3.html" title="A 3D Vector with floating point coordinates, used for storing normals and all sorts of other 3D graph...">Vector3</a>. Indexed by vertex number. Also see <a class="el" href="classmingfx_1_1_mesh.html#ab8f6856429466f1b4600a6ec27b84d0d" title="The total number of vertices in the mesh.">num_vertices()</a>. Use the <a class="el" href="classmingfx_1_1_mesh.html#a43d5a5cc3ef742a8c2b5e3f1b4da0903" title="Sets the normals for the three vertices of a triangle that has already been added to the mesh.">SetNormals()</a> function to set (or edit) per-vertex normal data. <a href="classmingfx_1_1_mesh.html#a439361e454ca63c35f564aed5cd0de65">More...</a><br /></td></tr>
+<tr class="separator:a439361e454ca63c35f564aed5cd0de65"><td class="memSeparator" colspan="2"> </td></tr>
+<tr class="memitem:ac5fc517fd8ea4cea8459d3f4d5d6ced3"><td class="memItemLeft" align="right" valign="top"><a class="el" href="classmingfx_1_1_color.html">Color</a> </td><td class="memItemRight" valign="bottom"><a class="el" href="classmingfx_1_1_mesh.html#ac5fc517fd8ea4cea8459d3f4d5d6ced3">read_color_data</a> (int vertex_id) const</td></tr>
+<tr class="memdesc:ac5fc517fd8ea4cea8459d3f4d5d6ced3"><td class="mdescLeft"> </td><td class="mdescRight">Read only access to per-vertex color data. Data are returned as a <a class="el" href="classmingfx_1_1_color.html" title="Represents a 4-component (R,G,B,A) color, stored internally in a float array to be compatable with Op...">Color</a>. Indexed by vertex number. Also see <a class="el" href="classmingfx_1_1_mesh.html#ab8f6856429466f1b4600a6ec27b84d0d" title="The total number of vertices in the mesh.">num_vertices()</a>. Use the <a class="el" href="classmingfx_1_1_mesh.html#a0f59e19b74f4f9dc2ad580756f8b319f" title="Sets per-vertex colors for the three vertices of a triangle that has already been added to the mesh.">SetColors()</a> function to set (or edit) per-vertex color data. <a href="classmingfx_1_1_mesh.html#ac5fc517fd8ea4cea8459d3f4d5d6ced3">More...</a><br /></td></tr>
+<tr class="separator:ac5fc517fd8ea4cea8459d3f4d5d6ced3"><td class="memSeparator" colspan="2"> </td></tr>
+<tr class="memitem:a51aaa8d6a80af46f22ea9dfecd2f0b31"><td class="memItemLeft" align="right" valign="top"><a class="el" href="classmingfx_1_1_point2.html">Point2</a> </td><td class="memItemRight" valign="bottom"><a class="el" href="classmingfx_1_1_mesh.html#a51aaa8d6a80af46f22ea9dfecd2f0b31">read_tex_coords_data</a> (int texture_unit, int vertex_id) const</td></tr>
+<tr class="memdesc:a51aaa8d6a80af46f22ea9dfecd2f0b31"><td class="mdescLeft"> </td><td class="mdescRight">Read only access to per-vertex texture coordinates data. Data are returned as a <a class="el" href="classmingfx_1_1_point2.html" title="A 2D Point with floating point coordinates, used for storing 2D texture coordinates,...">Point2</a>. Indexed by vertex number. Also see <a class="el" href="classmingfx_1_1_mesh.html#ab8f6856429466f1b4600a6ec27b84d0d" title="The total number of vertices in the mesh.">num_vertices()</a>. Use the <a class="el" href="classmingfx_1_1_mesh.html#a17cb896939007357014c74a1ece6f1f3" title="Sets the texture coordinates for the three vertices of a triangle that has already been added to the ...">SetTexCoords()</a> function to set (or edit) per-vertex tex coords. <a href="classmingfx_1_1_mesh.html#a51aaa8d6a80af46f22ea9dfecd2f0b31">More...</a><br /></td></tr>
+<tr class="separator:a51aaa8d6a80af46f22ea9dfecd2f0b31"><td class="memSeparator" colspan="2"> </td></tr>
+<tr class="memitem:ab3f3779506e15e3888ccbb8b9b572b8f"><td class="memItemLeft" align="right" valign="top">int </td><td class="memItemRight" valign="bottom"><a class="el" href="classmingfx_1_1_mesh.html#ab3f3779506e15e3888ccbb8b9b572b8f">num_triangles</a> () const</td></tr>
+<tr class="memdesc:ab3f3779506e15e3888ccbb8b9b572b8f"><td class="mdescLeft"> </td><td class="mdescRight">The total number of triangles in the mesh. <a href="classmingfx_1_1_mesh.html#ab3f3779506e15e3888ccbb8b9b572b8f">More...</a><br /></td></tr>
+<tr class="separator:ab3f3779506e15e3888ccbb8b9b572b8f"><td class="memSeparator" colspan="2"> </td></tr>
+<tr class="memitem:a15d79cbc48a6ef72ef1208d734cc2f8a"><td class="memItemLeft" align="right" valign="top">std::vector< unsigned int > </td><td class="memItemRight" valign="bottom"><a class="el" href="classmingfx_1_1_mesh.html#a15d79cbc48a6ef72ef1208d734cc2f8a">read_triangle_indices_data</a> (int triangle_id) const</td></tr>
+<tr class="memdesc:a15d79cbc48a6ef72ef1208d734cc2f8a"><td class="mdescLeft"> </td><td class="mdescRight">Read only access to the indices that make up a particular triangle. Data are returned as a 3-element array. <a href="classmingfx_1_1_mesh.html#a15d79cbc48a6ef72ef1208d734cc2f8a">More...</a><br /></td></tr>
+<tr class="separator:a15d79cbc48a6ef72ef1208d734cc2f8a"><td class="memSeparator" colspan="2"> </td></tr>
+</table>
+<h2 class="groupheader">Constructor & Destructor Documentation</h2>
+<a id="a69613870d54989f4226e50caf4ca9fb9"></a>
+<h2 class="memtitle"><span class="permalink"><a href="#a69613870d54989f4226e50caf4ca9fb9">◆ </a></span>Mesh() <span class="overload">[1/2]</span></h2>
+
+<div class="memitem">
+<div class="memproto">
+ <table class="memname">
+ <tr>
+ <td class="memname">mingfx::Mesh::Mesh </td>
+ <td>(</td>
+ <td class="paramname"></td><td>)</td>
+ <td></td>
+ </tr>
+ </table>
+</div><div class="memdoc">
+
+<p>Creates an empty mesh. </p>
+
+</div>
+</div>
+<a id="a76b4977f0a7f156aa8a0027f10dcbdc1"></a>
+<h2 class="memtitle"><span class="permalink"><a href="#a76b4977f0a7f156aa8a0027f10dcbdc1">◆ </a></span>Mesh() <span class="overload">[2/2]</span></h2>
+
+<div class="memitem">
+<div class="memproto">
+ <table class="memname">
+ <tr>
+ <td class="memname">mingfx::Mesh::Mesh </td>
+ <td>(</td>
+ <td class="paramtype">const <a class="el" href="classmingfx_1_1_mesh.html">Mesh</a> & </td>
+ <td class="paramname"><em>other</em></td><td>)</td>
+ <td></td>
+ </tr>
+ </table>
+</div><div class="memdoc">
+
+<p>Copies all data and sets GPU dirty bit for the new mesh. </p>
+
+</div>
+</div>
+<a id="ace7b23730dbcb581c4886cf2b9998327"></a>
+<h2 class="memtitle"><span class="permalink"><a href="#ace7b23730dbcb581c4886cf2b9998327">◆ </a></span>~Mesh()</h2>
+
+<div class="memitem">
+<div class="memproto">
+<table class="mlabels">
+ <tr>
+ <td class="mlabels-left">
+ <table class="memname">
+ <tr>
+ <td class="memname">virtual mingfx::Mesh::~Mesh </td>
+ <td>(</td>
+ <td class="paramname"></td><td>)</td>
+ <td></td>
+ </tr>
+ </table>
+ </td>
+ <td class="mlabels-right">
+<span class="mlabels"><span class="mlabel">virtual</span></span> </td>
+ </tr>
+</table>
+</div><div class="memdoc">
+
+</div>
+</div>
+<h2 class="groupheader">Member Function Documentation</h2>
+<a id="a29eeb2e778704350789033ec4940d55a"></a>
+<h2 class="memtitle"><span class="permalink"><a href="#a29eeb2e778704350789033ec4940d55a">◆ </a></span>AddTriangle()</h2>
+
+<div class="memitem">
+<div class="memproto">
+ <table class="memname">
+ <tr>
+ <td class="memname">int mingfx::Mesh::AddTriangle </td>
+ <td>(</td>
+ <td class="paramtype"><a class="el" href="classmingfx_1_1_point3.html">Point3</a> </td>
+ <td class="paramname"><em>v1</em>, </td>
+ </tr>
+ <tr>
+ <td class="paramkey"></td>
+ <td></td>
+ <td class="paramtype"><a class="el" href="classmingfx_1_1_point3.html">Point3</a> </td>
+ <td class="paramname"><em>v2</em>, </td>
+ </tr>
+ <tr>
+ <td class="paramkey"></td>
+ <td></td>
+ <td class="paramtype"><a class="el" href="classmingfx_1_1_point3.html">Point3</a> </td>
+ <td class="paramname"><em>v3</em> </td>
+ </tr>
+ <tr>
+ <td></td>
+ <td>)</td>
+ <td></td><td></td>
+ </tr>
+ </table>
+</div><div class="memdoc">
+
+<p>Adds a triangle to the mesh datastructure and returns a triangle ID. </p>
+<p>The ID should then be used as the first argument for follow-on calls to <a class="el" href="classmingfx_1_1_mesh.html#a43d5a5cc3ef742a8c2b5e3f1b4da0903" title="Sets the normals for the three vertices of a triangle that has already been added to the mesh.">SetNormals()</a>, <a class="el" href="classmingfx_1_1_mesh.html#a0f59e19b74f4f9dc2ad580756f8b319f" title="Sets per-vertex colors for the three vertices of a triangle that has already been added to the mesh.">SetColors()</a>, and <a class="el" href="classmingfx_1_1_mesh.html#a17cb896939007357014c74a1ece6f1f3" title="Sets the texture coordinates for the three vertices of a triangle that has already been added to the ...">SetTexCoords()</a>. The vertices must be specified in counter-clockwise order so that the normal of the triangle can be determined following the right-hand rule. </p>
+
+</div>
+</div>
+<a id="a8d96c1b5985cd836f2aa2b2994af64c1"></a>
+<h2 class="memtitle"><span class="permalink"><a href="#a8d96c1b5985cd836f2aa2b2994af64c1">◆ </a></span>BuildBVH()</h2>
+
+<div class="memitem">
+<div class="memproto">
+ <table class="memname">
+ <tr>
+ <td class="memname">void mingfx::Mesh::BuildBVH </td>
+ <td>(</td>
+ <td class="paramname"></td><td>)</td>
+ <td></td>
+ </tr>
+ </table>
+</div><div class="memdoc">
+
+<p>This (re)calculates a Bounding Volume Hierarchy for the mesh, which can be used together with <a class="el" href="classmingfx_1_1_ray.html#ac90097090f0f8f49db13f6f232712afc" title="Checks to see if the ray intersects a triangle mesh.">Ray::FastIntersectMesh()</a> to do faster ray-mesh intersection testing. </p>
+
+</div>
+</div>
+<a id="a978b1341d5613d399a68e40c61c57ba4"></a>
+<h2 class="memtitle"><span class="permalink"><a href="#a978b1341d5613d399a68e40c61c57ba4">◆ </a></span>bvh_ptr()</h2>
+
+<div class="memitem">
+<div class="memproto">
+ <table class="memname">
+ <tr>
+ <td class="memname"><a class="el" href="classmingfx_1_1_b_v_h.html">BVH</a>* mingfx::Mesh::bvh_ptr </td>
+ <td>(</td>
+ <td class="paramname"></td><td>)</td>
+ <td></td>
+ </tr>
+ </table>
+</div><div class="memdoc">
+
+<p>Returns a pointer to the underlying <a class="el" href="classmingfx_1_1_b_v_h.html" title="A Bounding Volume Hierarchy (BVH) data structure that can be used to accelerate ray-object intersecti...">BVH</a> data structure. </p>
+<p>If the data struture has not yet been build or needs to be updated due to a change in the geometry of the mesh, then the <a class="el" href="classmingfx_1_1_b_v_h.html" title="A Bounding Volume Hierarchy (BVH) data structure that can be used to accelerate ray-object intersecti...">BVH</a> is recalculated before returning the pointer. </p>
+
+</div>
+</div>
+<a id="a1a5cea9cfdf4c672ba0c781ee54718f7"></a>
+<h2 class="memtitle"><span class="permalink"><a href="#a1a5cea9cfdf4c672ba0c781ee54718f7">◆ </a></span>CalcPerFaceNormals()</h2>
+
+<div class="memitem">
+<div class="memproto">
+ <table class="memname">
+ <tr>
+ <td class="memname">void mingfx::Mesh::CalcPerFaceNormals </td>
+ <td>(</td>
+ <td class="paramname"></td><td>)</td>
+ <td></td>
+ </tr>
+ </table>
+</div><div class="memdoc">
+
+<p>This (re)calculates the normals for the mesh and stores them with the mesh data structure. </p>
+<p>It assumes a faceted mesh, like a cube, where each triangle has separate vertices. The normal is calculated for each triangle face and then the result is associated with each vertex that makes up the triangle. If you have a smooth mesh where vertices are shared between multiple faces then use <a class="el" href="classmingfx_1_1_mesh.html#acc7df547b0a2175287cc9f509c04e93c" title="This (re)calculates the normals for the mesh and stores them with the mesh data structure.">CalcPerVertexNormals()</a> instead. </p>
+
+</div>
+</div>
+<a id="acc7df547b0a2175287cc9f509c04e93c"></a>
+<h2 class="memtitle"><span class="permalink"><a href="#acc7df547b0a2175287cc9f509c04e93c">◆ </a></span>CalcPerVertexNormals()</h2>
+
+<div class="memitem">
+<div class="memproto">
+ <table class="memname">
+ <tr>
+ <td class="memname">void mingfx::Mesh::CalcPerVertexNormals </td>
+ <td>(</td>
+ <td class="paramname"></td><td>)</td>
+ <td></td>
+ </tr>
+ </table>
+</div><div class="memdoc">
+
+<p>This (re)calculates the normals for the mesh and stores them with the mesh data structure. </p>
+<p>It assumes a smooth mesh, like a sphere, where each vertex belongs to one or more triangles. Each vertex normal is calculated as a weighted sum of the face normals for adjacent faces. The weighting is based upon the relative areas of the neighboring faces (i.e., a large neighboring triangle contributes more to the vertex normal than a small one). </p>
+
+</div>
+</div>
+<a id="a75075d472938fd760477be42585aff5c"></a>
+<h2 class="memtitle"><span class="permalink"><a href="#a75075d472938fd760477be42585aff5c">◆ </a></span>Draw()</h2>
+
+<div class="memitem">
+<div class="memproto">
+ <table class="memname">
+ <tr>
+ <td class="memname">void mingfx::Mesh::Draw </td>
+ <td>(</td>
+ <td class="paramname"></td><td>)</td>
+ <td></td>
+ </tr>
+ </table>
+</div><div class="memdoc">
+
+<p>This sends the mesh vertices and attributes down the graphics pipe using glDrawArrays() for the non-indexed mode and glDrawElements() for the indexed mode. </p>
+<p>This is just the geometry – for anything to show up on the screen, you must already have a <a class="el" href="classmingfx_1_1_shader_program.html" title="A wrapper around GLSL shader programs.">ShaderProgram</a> enabled before calling this function. </p>
+
+</div>
+</div>
+<a id="a8d05faf18ef8d170fc3c2a343075823f"></a>
+<h2 class="memtitle"><span class="permalink"><a href="#a8d05faf18ef8d170fc3c2a343075823f">◆ </a></span>LoadFromOBJ()</h2>
+
+<div class="memitem">
+<div class="memproto">
+ <table class="memname">
+ <tr>
+ <td class="memname">void mingfx::Mesh::LoadFromOBJ </td>
+ <td>(</td>
+ <td class="paramtype">const std::string & </td>
+ <td class="paramname"><em>filename</em></td><td>)</td>
+ <td></td>
+ </tr>
+ </table>
+</div><div class="memdoc">
+
+<p>This reads a mesh stored in the common Wavefront Obj file format. </p>
+<p>The loader here is simplistic and not guaranteed to work on all valid .obj files, but it should work on many simple ones. <a class="el" href="classmingfx_1_1_mesh.html#ac74345bf4b2994de4ee1c509bcc6840e" title="This copies the entire mesh data structure to a vertex array in GPU memory, which must happen before ...">UpdateGPUMemory()</a> is called automatically after the model is loaded. </p>
+
+</div>
+</div>
+<a id="ab3f3779506e15e3888ccbb8b9b572b8f"></a>
+<h2 class="memtitle"><span class="permalink"><a href="#ab3f3779506e15e3888ccbb8b9b572b8f">◆ </a></span>num_triangles()</h2>
+
+<div class="memitem">
+<div class="memproto">
+ <table class="memname">
+ <tr>
+ <td class="memname">int mingfx::Mesh::num_triangles </td>
+ <td>(</td>
+ <td class="paramname"></td><td>)</td>
+ <td> const</td>
+ </tr>
+ </table>
+</div><div class="memdoc">
+
+<p>The total number of triangles in the mesh. </p>
+
+</div>
+</div>
+<a id="ab8f6856429466f1b4600a6ec27b84d0d"></a>
+<h2 class="memtitle"><span class="permalink"><a href="#ab8f6856429466f1b4600a6ec27b84d0d">◆ </a></span>num_vertices()</h2>
+
+<div class="memitem">
+<div class="memproto">
+ <table class="memname">
+ <tr>
+ <td class="memname">int mingfx::Mesh::num_vertices </td>
+ <td>(</td>
+ <td class="paramname"></td><td>)</td>
+ <td> const</td>
+ </tr>
+ </table>
+</div><div class="memdoc">
+
+<p>The total number of vertices in the mesh. </p>
+
+</div>
+</div>
+<a id="ac5fc517fd8ea4cea8459d3f4d5d6ced3"></a>
+<h2 class="memtitle"><span class="permalink"><a href="#ac5fc517fd8ea4cea8459d3f4d5d6ced3">◆ </a></span>read_color_data()</h2>
+
+<div class="memitem">
+<div class="memproto">
+ <table class="memname">
+ <tr>
+ <td class="memname"><a class="el" href="classmingfx_1_1_color.html">Color</a> mingfx::Mesh::read_color_data </td>
+ <td>(</td>
+ <td class="paramtype">int </td>
+ <td class="paramname"><em>vertex_id</em></td><td>)</td>
+ <td> const</td>
+ </tr>
+ </table>
+</div><div class="memdoc">
+
+<p>Read only access to per-vertex color data. Data are returned as a <a class="el" href="classmingfx_1_1_color.html" title="Represents a 4-component (R,G,B,A) color, stored internally in a float array to be compatable with Op...">Color</a>. Indexed by vertex number. Also see <a class="el" href="classmingfx_1_1_mesh.html#ab8f6856429466f1b4600a6ec27b84d0d" title="The total number of vertices in the mesh.">num_vertices()</a>. Use the <a class="el" href="classmingfx_1_1_mesh.html#a0f59e19b74f4f9dc2ad580756f8b319f" title="Sets per-vertex colors for the three vertices of a triangle that has already been added to the mesh.">SetColors()</a> function to set (or edit) per-vertex color data. </p>
+
+</div>
+</div>
+<a id="a439361e454ca63c35f564aed5cd0de65"></a>
+<h2 class="memtitle"><span class="permalink"><a href="#a439361e454ca63c35f564aed5cd0de65">◆ </a></span>read_normal_data()</h2>
+
+<div class="memitem">
+<div class="memproto">
+ <table class="memname">
+ <tr>
+ <td class="memname"><a class="el" href="classmingfx_1_1_vector3.html">Vector3</a> mingfx::Mesh::read_normal_data </td>
+ <td>(</td>
+ <td class="paramtype">int </td>
+ <td class="paramname"><em>vertex_id</em></td><td>)</td>
+ <td> const</td>
+ </tr>
+ </table>
+</div><div class="memdoc">
+
+<p>Read only access to per-vertex normal data. Data are returned as a <a class="el" href="classmingfx_1_1_vector3.html" title="A 3D Vector with floating point coordinates, used for storing normals and all sorts of other 3D graph...">Vector3</a>. Indexed by vertex number. Also see <a class="el" href="classmingfx_1_1_mesh.html#ab8f6856429466f1b4600a6ec27b84d0d" title="The total number of vertices in the mesh.">num_vertices()</a>. Use the <a class="el" href="classmingfx_1_1_mesh.html#a43d5a5cc3ef742a8c2b5e3f1b4da0903" title="Sets the normals for the three vertices of a triangle that has already been added to the mesh.">SetNormals()</a> function to set (or edit) per-vertex normal data. </p>
+
+</div>
+</div>
+<a id="a51aaa8d6a80af46f22ea9dfecd2f0b31"></a>
+<h2 class="memtitle"><span class="permalink"><a href="#a51aaa8d6a80af46f22ea9dfecd2f0b31">◆ </a></span>read_tex_coords_data()</h2>
+
+<div class="memitem">
+<div class="memproto">
+ <table class="memname">
+ <tr>
+ <td class="memname"><a class="el" href="classmingfx_1_1_point2.html">Point2</a> mingfx::Mesh::read_tex_coords_data </td>
+ <td>(</td>
+ <td class="paramtype">int </td>
+ <td class="paramname"><em>texture_unit</em>, </td>
+ </tr>
+ <tr>
+ <td class="paramkey"></td>
+ <td></td>
+ <td class="paramtype">int </td>
+ <td class="paramname"><em>vertex_id</em> </td>
+ </tr>
+ <tr>
+ <td></td>
+ <td>)</td>
+ <td></td><td> const</td>
+ </tr>
+ </table>
+</div><div class="memdoc">
+
+<p>Read only access to per-vertex texture coordinates data. Data are returned as a <a class="el" href="classmingfx_1_1_point2.html" title="A 2D Point with floating point coordinates, used for storing 2D texture coordinates,...">Point2</a>. Indexed by vertex number. Also see <a class="el" href="classmingfx_1_1_mesh.html#ab8f6856429466f1b4600a6ec27b84d0d" title="The total number of vertices in the mesh.">num_vertices()</a>. Use the <a class="el" href="classmingfx_1_1_mesh.html#a17cb896939007357014c74a1ece6f1f3" title="Sets the texture coordinates for the three vertices of a triangle that has already been added to the ...">SetTexCoords()</a> function to set (or edit) per-vertex tex coords. </p>
+
+</div>
+</div>
+<a id="a15d79cbc48a6ef72ef1208d734cc2f8a"></a>
+<h2 class="memtitle"><span class="permalink"><a href="#a15d79cbc48a6ef72ef1208d734cc2f8a">◆ </a></span>read_triangle_indices_data()</h2>
+
+<div class="memitem">
+<div class="memproto">
+ <table class="memname">
+ <tr>
+ <td class="memname">std::vector<unsigned int> mingfx::Mesh::read_triangle_indices_data </td>
+ <td>(</td>
+ <td class="paramtype">int </td>
+ <td class="paramname"><em>triangle_id</em></td><td>)</td>
+ <td> const</td>
+ </tr>
+ </table>
+</div><div class="memdoc">
+
+<p>Read only access to the indices that make up a particular triangle. Data are returned as a 3-element array. </p>
+
+</div>
+</div>
+<a id="ada9371e85aa0b61df79b26fc880b1863"></a>
+<h2 class="memtitle"><span class="permalink"><a href="#ada9371e85aa0b61df79b26fc880b1863">◆ </a></span>read_vertex_data()</h2>
+
+<div class="memitem">
+<div class="memproto">
+ <table class="memname">
+ <tr>
+ <td class="memname"><a class="el" href="classmingfx_1_1_point3.html">Point3</a> mingfx::Mesh::read_vertex_data </td>
+ <td>(</td>
+ <td class="paramtype">int </td>
+ <td class="paramname"><em>vertex_id</em></td><td>)</td>
+ <td> const</td>
+ </tr>
+ </table>
+</div><div class="memdoc">
+
+<p>Read only access to the vertex position data. Data are returned as a <a class="el" href="classmingfx_1_1_point3.html" title="A 3D Point with floating point coordinates, used for storing vertices and all sorts of other 3D graph...">Point3</a>. Indexed by vertex number. Also see <a class="el" href="classmingfx_1_1_mesh.html#ab8f6856429466f1b4600a6ec27b84d0d" title="The total number of vertices in the mesh.">num_vertices()</a>. Use the <a class="el" href="classmingfx_1_1_mesh.html#a1dd243b53826765ba468f505645102a6" title="Sets the vertex array for the mesh directly.">SetVertices()</a> function to set (or edit) vertex data. </p>
+
+</div>
+</div>
+<a id="ab9b05a77591a9adad12032d513256dae"></a>
+<h2 class="memtitle"><span class="permalink"><a href="#ab9b05a77591a9adad12032d513256dae">◆ </a></span>SetColors() <span class="overload">[1/3]</span></h2>
+
+<div class="memitem">
+<div class="memproto">
+ <table class="memname">
+ <tr>
+ <td class="memname">void mingfx::Mesh::SetColors </td>
+ <td>(</td>
+ <td class="paramtype">const std::vector< <a class="el" href="classmingfx_1_1_color.html">Color</a> > & </td>
+ <td class="paramname"><em>colors</em></td><td>)</td>
+ <td></td>
+ </tr>
+ </table>
+</div><div class="memdoc">
+
+<p>Sets the per-vertex colors array for the mesh directly. </p>
+
+</div>
+</div>
+<a id="aed172bdd77858f3b59978cb8527e19ae"></a>
+<h2 class="memtitle"><span class="permalink"><a href="#aed172bdd77858f3b59978cb8527e19ae">◆ </a></span>SetColors() <span class="overload">[2/3]</span></h2>
+
+<div class="memitem">
+<div class="memproto">
+ <table class="memname">
+ <tr>
+ <td class="memname">void mingfx::Mesh::SetColors </td>
+ <td>(</td>
+ <td class="paramtype">float * </td>
+ <td class="paramname"><em>colors_array</em>, </td>
+ </tr>
+ <tr>
+ <td class="paramkey"></td>
+ <td></td>
+ <td class="paramtype">int </td>
+ <td class="paramname"><em>num_colors</em> </td>
+ </tr>
+ <tr>
+ <td></td>
+ <td>)</td>
+ <td></td><td></td>
+ </tr>
+ </table>
+</div><div class="memdoc">
+
+<p>Sets the per-vertex colors array for the mesh directly. Colors are stored as (r,g,b,a), (r,g,b,a), (r,g,b,a), ... following the same ordering as was used for <a class="el" href="classmingfx_1_1_mesh.html#a1dd243b53826765ba468f505645102a6" title="Sets the vertex array for the mesh directly.">SetVertices()</a>. This version of the function accepts a C-style array rather than std::vector<> </p>
+
+</div>
+</div>
+<a id="a0f59e19b74f4f9dc2ad580756f8b319f"></a>
+<h2 class="memtitle"><span class="permalink"><a href="#a0f59e19b74f4f9dc2ad580756f8b319f">◆ </a></span>SetColors() <span class="overload">[3/3]</span></h2>
+
+<div class="memitem">
+<div class="memproto">
+ <table class="memname">
+ <tr>
+ <td class="memname">void mingfx::Mesh::SetColors </td>
+ <td>(</td>
+ <td class="paramtype">int </td>
+ <td class="paramname"><em>triangle_id</em>, </td>
+ </tr>
+ <tr>
+ <td class="paramkey"></td>
+ <td></td>
+ <td class="paramtype"><a class="el" href="classmingfx_1_1_color.html">Color</a> </td>
+ <td class="paramname"><em>c1</em>, </td>
+ </tr>
+ <tr>
+ <td class="paramkey"></td>
+ <td></td>
+ <td class="paramtype"><a class="el" href="classmingfx_1_1_color.html">Color</a> </td>
+ <td class="paramname"><em>c2</em>, </td>
+ </tr>
+ <tr>
+ <td class="paramkey"></td>
+ <td></td>
+ <td class="paramtype"><a class="el" href="classmingfx_1_1_color.html">Color</a> </td>
+ <td class="paramname"><em>c3</em> </td>
+ </tr>
+ <tr>
+ <td></td>
+ <td>)</td>
+ <td></td><td></td>
+ </tr>
+ </table>
+</div><div class="memdoc">
+
+<p>Sets per-vertex colors for the three vertices of a triangle that has already been added to the mesh. </p>
+
+</div>
+</div>
+<a id="a1f94c9ca7867b65e04f7e02813a06581"></a>
+<h2 class="memtitle"><span class="permalink"><a href="#a1f94c9ca7867b65e04f7e02813a06581">◆ </a></span>SetIndices() <span class="overload">[1/2]</span></h2>
+
+<div class="memitem">
+<div class="memproto">
+ <table class="memname">
+ <tr>
+ <td class="memname">void mingfx::Mesh::SetIndices </td>
+ <td>(</td>
+ <td class="paramtype">const std::vector< unsigned int > </td>
+ <td class="paramname"><em>index_array</em></td><td>)</td>
+ <td></td>
+ </tr>
+ </table>
+</div><div class="memdoc">
+
+<p>Sets the indices into the vertex array to use to create the triangles. Each consecutive set of 3 indices forms one triangle: (v1,v2,v3), (v1,v2,v3), (v1,v2,v3), ... </p>
+
+</div>
+</div>
+<a id="a84711746b8d37c8d9b12ae748a4c5b8c"></a>
+<h2 class="memtitle"><span class="permalink"><a href="#a84711746b8d37c8d9b12ae748a4c5b8c">◆ </a></span>SetIndices() <span class="overload">[2/2]</span></h2>
+
+<div class="memitem">
+<div class="memproto">
+ <table class="memname">
+ <tr>
+ <td class="memname">void mingfx::Mesh::SetIndices </td>
+ <td>(</td>
+ <td class="paramtype">unsigned int * </td>
+ <td class="paramname"><em>index_array</em>, </td>
+ </tr>
+ <tr>
+ <td class="paramkey"></td>
+ <td></td>
+ <td class="paramtype">int </td>
+ <td class="paramname"><em>num_indices</em> </td>
+ </tr>
+ <tr>
+ <td></td>
+ <td>)</td>
+ <td></td><td></td>
+ </tr>
+ </table>
+</div><div class="memdoc">
+
+<p>Sets the indices into the vertex array to use to create the triangles. Each consecutive set of 3 indices forms one triangle: (v1,v2,v3), (v1,v2,v3), (v1,v2,v3), ... This version of the function accepts a C-style array rather than std::vector<> </p>
+
+</div>
+</div>
+<a id="a7175238f5874929e2258458b98421d87"></a>
+<h2 class="memtitle"><span class="permalink"><a href="#a7175238f5874929e2258458b98421d87">◆ </a></span>SetInstanceTransforms()</h2>
+
+<div class="memitem">
+<div class="memproto">
+ <table class="memname">
+ <tr>
+ <td class="memname">void mingfx::Mesh::SetInstanceTransforms </td>
+ <td>(</td>
+ <td class="paramtype">const std::vector< <a class="el" href="classmingfx_1_1_matrix4.html">Matrix4</a> > & </td>
+ <td class="paramname"><em>xforms</em></td><td>)</td>
+ <td></td>
+ </tr>
+ </table>
+</div><div class="memdoc">
+
+</div>
+</div>
+<a id="ad28dbd5b0ab77bec28f30f618dd9e57d"></a>
+<h2 class="memtitle"><span class="permalink"><a href="#ad28dbd5b0ab77bec28f30f618dd9e57d">◆ </a></span>SetNormals() <span class="overload">[1/3]</span></h2>
+
+<div class="memitem">
+<div class="memproto">
+ <table class="memname">
+ <tr>
+ <td class="memname">void mingfx::Mesh::SetNormals </td>
+ <td>(</td>
+ <td class="paramtype">const std::vector< <a class="el" href="classmingfx_1_1_vector3.html">Vector3</a> > & </td>
+ <td class="paramname"><em>norms</em></td><td>)</td>
+ <td></td>
+ </tr>
+ </table>
+</div><div class="memdoc">
+
+<p>Sets the normal array for the mesh directly. </p>
+
+</div>
+</div>
+<a id="a6ab1128fab6f969564d3a1329baeade6"></a>
+<h2 class="memtitle"><span class="permalink"><a href="#a6ab1128fab6f969564d3a1329baeade6">◆ </a></span>SetNormals() <span class="overload">[2/3]</span></h2>
+
+<div class="memitem">
+<div class="memproto">
+ <table class="memname">
+ <tr>
+ <td class="memname">void mingfx::Mesh::SetNormals </td>
+ <td>(</td>
+ <td class="paramtype">float * </td>
+ <td class="paramname"><em>norms_array</em>, </td>
+ </tr>
+ <tr>
+ <td class="paramkey"></td>
+ <td></td>
+ <td class="paramtype">int </td>
+ <td class="paramname"><em>num_norms</em> </td>
+ </tr>
+ <tr>
+ <td></td>
+ <td>)</td>
+ <td></td><td></td>
+ </tr>
+ </table>
+</div><div class="memdoc">
+
+<p>Sets the normal array for the mesh directly. Normals are stored as (x,y,z), (x,y,z), (x,y,z), ... following the same ordering as was used for <a class="el" href="classmingfx_1_1_mesh.html#a1dd243b53826765ba468f505645102a6" title="Sets the vertex array for the mesh directly.">SetVertices()</a>. This version of the function accepts a C-style array rather than std::vector<> </p>
+
+</div>
+</div>
+<a id="a43d5a5cc3ef742a8c2b5e3f1b4da0903"></a>
+<h2 class="memtitle"><span class="permalink"><a href="#a43d5a5cc3ef742a8c2b5e3f1b4da0903">◆ </a></span>SetNormals() <span class="overload">[3/3]</span></h2>
+
+<div class="memitem">
+<div class="memproto">
+ <table class="memname">
+ <tr>
+ <td class="memname">void mingfx::Mesh::SetNormals </td>
+ <td>(</td>
+ <td class="paramtype">int </td>
+ <td class="paramname"><em>triangle_id</em>, </td>
+ </tr>
+ <tr>
+ <td class="paramkey"></td>
+ <td></td>
+ <td class="paramtype"><a class="el" href="classmingfx_1_1_vector3.html">Vector3</a> </td>
+ <td class="paramname"><em>n1</em>, </td>
+ </tr>
+ <tr>
+ <td class="paramkey"></td>
+ <td></td>
+ <td class="paramtype"><a class="el" href="classmingfx_1_1_vector3.html">Vector3</a> </td>
+ <td class="paramname"><em>n2</em>, </td>
+ </tr>
+ <tr>
+ <td class="paramkey"></td>
+ <td></td>
+ <td class="paramtype"><a class="el" href="classmingfx_1_1_vector3.html">Vector3</a> </td>
+ <td class="paramname"><em>n3</em> </td>
+ </tr>
+ <tr>
+ <td></td>
+ <td>)</td>
+ <td></td><td></td>
+ </tr>
+ </table>
+</div><div class="memdoc">
+
+<p>Sets the normals for the three vertices of a triangle that has already been added to the mesh. </p>
+
+</div>
+</div>
+<a id="aba2dfd0ade2d8a728897d411ef3fdaf1"></a>
+<h2 class="memtitle"><span class="permalink"><a href="#aba2dfd0ade2d8a728897d411ef3fdaf1">◆ </a></span>SetTexCoords() <span class="overload">[1/3]</span></h2>
+
+<div class="memitem">
+<div class="memproto">
+ <table class="memname">
+ <tr>
+ <td class="memname">void mingfx::Mesh::SetTexCoords </td>
+ <td>(</td>
+ <td class="paramtype">int </td>
+ <td class="paramname"><em>texture_unit</em>, </td>
+ </tr>
+ <tr>
+ <td class="paramkey"></td>
+ <td></td>
+ <td class="paramtype">const std::vector< <a class="el" href="classmingfx_1_1_point2.html">Point2</a> > & </td>
+ <td class="paramname"><em>tex_coords</em> </td>
+ </tr>
+ <tr>
+ <td></td>
+ <td>)</td>
+ <td></td><td></td>
+ </tr>
+ </table>
+</div><div class="memdoc">
+
+<p>Sets a texture coordinates array for the mesh directly. </p>
+
+</div>
+</div>
+<a id="ac9cd4e8d67bb70295a48fcbc72ae32f9"></a>
+<h2 class="memtitle"><span class="permalink"><a href="#ac9cd4e8d67bb70295a48fcbc72ae32f9">◆ </a></span>SetTexCoords() <span class="overload">[2/3]</span></h2>
+
+<div class="memitem">
+<div class="memproto">
+ <table class="memname">
+ <tr>
+ <td class="memname">void mingfx::Mesh::SetTexCoords </td>
+ <td>(</td>
+ <td class="paramtype">int </td>
+ <td class="paramname"><em>texture_unit</em>, </td>
+ </tr>
+ <tr>
+ <td class="paramkey"></td>
+ <td></td>
+ <td class="paramtype">float * </td>
+ <td class="paramname"><em>tex_coords_array</em>, </td>
+ </tr>
+ <tr>
+ <td class="paramkey"></td>
+ <td></td>
+ <td class="paramtype">int </td>
+ <td class="paramname"><em>num_tex_coords</em> </td>
+ </tr>
+ <tr>
+ <td></td>
+ <td>)</td>
+ <td></td><td></td>
+ </tr>
+ </table>
+</div><div class="memdoc">
+
+<p>Sets a texture coordinates array for the mesh directly. Tex coords are stored as (u,v), (u,v), (u,v), ... following the same ordering as was used for <a class="el" href="classmingfx_1_1_mesh.html#a1dd243b53826765ba468f505645102a6" title="Sets the vertex array for the mesh directly.">SetVertices()</a>. This version of the function accepts a C-style array rather than std::vector<> </p>
+
+</div>
+</div>
+<a id="a17cb896939007357014c74a1ece6f1f3"></a>
+<h2 class="memtitle"><span class="permalink"><a href="#a17cb896939007357014c74a1ece6f1f3">◆ </a></span>SetTexCoords() <span class="overload">[3/3]</span></h2>
+
+<div class="memitem">
+<div class="memproto">
+ <table class="memname">
+ <tr>
+ <td class="memname">void mingfx::Mesh::SetTexCoords </td>
+ <td>(</td>
+ <td class="paramtype">int </td>
+ <td class="paramname"><em>triangle_id</em>, </td>
+ </tr>
+ <tr>
+ <td class="paramkey"></td>
+ <td></td>
+ <td class="paramtype">int </td>
+ <td class="paramname"><em>texture_unit</em>, </td>
+ </tr>
+ <tr>
+ <td class="paramkey"></td>
+ <td></td>
+ <td class="paramtype"><a class="el" href="classmingfx_1_1_point2.html">Point2</a> </td>
+ <td class="paramname"><em>uv1</em>, </td>
+ </tr>
+ <tr>
+ <td class="paramkey"></td>
+ <td></td>
+ <td class="paramtype"><a class="el" href="classmingfx_1_1_point2.html">Point2</a> </td>
+ <td class="paramname"><em>uv2</em>, </td>
+ </tr>
+ <tr>
+ <td class="paramkey"></td>
+ <td></td>
+ <td class="paramtype"><a class="el" href="classmingfx_1_1_point2.html">Point2</a> </td>
+ <td class="paramname"><em>uv3</em> </td>
+ </tr>
+ <tr>
+ <td></td>
+ <td>)</td>
+ <td></td><td></td>
+ </tr>
+ </table>
+</div><div class="memdoc">
+
+<p>Sets the texture coordinates for the three vertices of a triangle that has already been added to the mesh. </p>
+<p>The first textureUnit is 0, and you should always use 0 for this parameter unless you are doing multi-texturing. </p>
+
+</div>
+</div>
+<a id="a1dd243b53826765ba468f505645102a6"></a>
+<h2 class="memtitle"><span class="permalink"><a href="#a1dd243b53826765ba468f505645102a6">◆ </a></span>SetVertices() <span class="overload">[1/2]</span></h2>
+
+<div class="memitem">
+<div class="memproto">
+ <table class="memname">
+ <tr>
+ <td class="memname">void mingfx::Mesh::SetVertices </td>
+ <td>(</td>
+ <td class="paramtype">const std::vector< <a class="el" href="classmingfx_1_1_point3.html">Point3</a> > & </td>
+ <td class="paramname"><em>verts</em></td><td>)</td>
+ <td></td>
+ </tr>
+ </table>
+</div><div class="memdoc">
+
+<p>Sets the vertex array for the mesh directly. </p>
+
+</div>
+</div>
+<a id="a033076b9bf1714c9b9e0eeef11ebcd49"></a>
+<h2 class="memtitle"><span class="permalink"><a href="#a033076b9bf1714c9b9e0eeef11ebcd49">◆ </a></span>SetVertices() <span class="overload">[2/2]</span></h2>
+
+<div class="memitem">
+<div class="memproto">
+ <table class="memname">
+ <tr>
+ <td class="memname">void mingfx::Mesh::SetVertices </td>
+ <td>(</td>
+ <td class="paramtype">float * </td>
+ <td class="paramname"><em>verts_array</em>, </td>
+ </tr>
+ <tr>
+ <td class="paramkey"></td>
+ <td></td>
+ <td class="paramtype">int </td>
+ <td class="paramname"><em>num_verts</em> </td>
+ </tr>
+ <tr>
+ <td></td>
+ <td>)</td>
+ <td></td><td></td>
+ </tr>
+ </table>
+</div><div class="memdoc">
+
+<p>Sets the vertex array for the mesh directly. Vertices are stored as (x,y,z), (x,y,z), (x,y,z), ... This version of the function accepts a C-style array rather than std::vector<> </p>
+
+</div>
+</div>
+<a id="ac74345bf4b2994de4ee1c509bcc6840e"></a>
+<h2 class="memtitle"><span class="permalink"><a href="#ac74345bf4b2994de4ee1c509bcc6840e">◆ </a></span>UpdateGPUMemory()</h2>
+
+<div class="memitem">
+<div class="memproto">
+ <table class="memname">
+ <tr>
+ <td class="memname">void mingfx::Mesh::UpdateGPUMemory </td>
+ <td>(</td>
+ <td class="paramname"></td><td>)</td>
+ <td></td>
+ </tr>
+ </table>
+</div><div class="memdoc">
+
+<p>This copies the entire mesh data structure to a vertex array in GPU memory, which must happen before you can draw the mesh. </p>
+<p>For large meshes, this can take some time, so you may want to call this during initialization immediately after generating the mesh. If you do not, it will be called automatically for you the first time <a class="el" href="classmingfx_1_1_mesh.html#a75075d472938fd760477be42585aff5c" title="This sends the mesh vertices and attributes down the graphics pipe using glDrawArrays() for the non-i...">Draw()</a> is called. If the mesh contains normals, per- vertex colors and/or texture coordinates these are added as attributes within the vertex array. </p>
+
+</div>
+</div>
+<a id="a3e0ac86714f6b7c3f62761ef3952a044"></a>
+<h2 class="memtitle"><span class="permalink"><a href="#a3e0ac86714f6b7c3f62761ef3952a044">◆ </a></span>UpdateTriangle()</h2>
+
+<div class="memitem">
+<div class="memproto">
+ <table class="memname">
+ <tr>
+ <td class="memname">void mingfx::Mesh::UpdateTriangle </td>
+ <td>(</td>
+ <td class="paramtype">int </td>
+ <td class="paramname"><em>triangle_id</em>, </td>
+ </tr>
+ <tr>
+ <td class="paramkey"></td>
+ <td></td>
+ <td class="paramtype"><a class="el" href="classmingfx_1_1_point3.html">Point3</a> </td>
+ <td class="paramname"><em>v1</em>, </td>
+ </tr>
+ <tr>
+ <td class="paramkey"></td>
+ <td></td>
+ <td class="paramtype"><a class="el" href="classmingfx_1_1_point3.html">Point3</a> </td>
+ <td class="paramname"><em>v2</em>, </td>
+ </tr>
+ <tr>
+ <td class="paramkey"></td>
+ <td></td>
+ <td class="paramtype"><a class="el" href="classmingfx_1_1_point3.html">Point3</a> </td>
+ <td class="paramname"><em>v3</em> </td>
+ </tr>
+ <tr>
+ <td></td>
+ <td>)</td>
+ <td></td><td></td>
+ </tr>
+ </table>
+</div><div class="memdoc">
+
+<p>Updates the vertex positions for a triangle that has already been added to the mesh. </p>
+
+</div>
+</div>
+<hr/>The documentation for this class was generated from the following file:<ul>
+<li>src/<a class="el" href="mesh_8h_source.html">mesh.h</a></li>
+</ul>
+</div><!-- contents -->
+<!-- HTML footer for doxygen 1.8.9.1-->
+<!-- start footer part -->
+<hr class="footer"/><address class="footer"><small>
+Generated by  <a href="http://www.doxygen.org/index.html">
+<img class="footer" src="doxygen.png" alt="doxygen"/>
+</a> 1.9.1
+</small></address>
+</body>
+</html>
|