aboutsummaryrefslogtreecommitdiffstats
path: root/dev/MinGfx/docs/html/classmingfx_1_1_mesh.html
blob: 33bca85a92075f5b01aff0566d82c42de26f23b6 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
1001
1002
1003
1004
1005
1006
1007
1008
1009
1010
1011
1012
1013
1014
1015
1016
1017
1018
1019
1020
1021
1022
1023
1024
1025
1026
1027
1028
1029
1030
1031
1032
1033
1034
1035
1036
1037
1038
1039
1040
1041
1042
1043
1044
1045
1046
1047
1048
1049
1050
1051
1052
1053
1054
1055
1056
1057
1058
1059
1060
1061
1062
1063
1064
1065
1066
1067
1068
1069
1070
1071
1072
1073
1074
1075
1076
1077
1078
1079
1080
1081
1082
1083
1084
1085
1086
1087
1088
1089
1090
1091
1092
1093
1094
1095
1096
1097
1098
1099
1100
1101
1102
1103
1104
1105
1106
1107
1108
1109
1110
1111
1112
1113
1114
1115
1116
1117
1118
1119
1120
1121
1122
1123
1124
1125
1126
1127
1128
1129
1130
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
   &#160;<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&amp;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&amp;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> &#124;
<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 &ndash; 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">&quot;teapot.obj&quot;</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 &amp;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&lt;unsigned int&gt; indices;</div>
<div class="line">std::vector&lt;Point3&gt; vertices;</div>
<div class="line">std::vector&lt;Vector3&gt; normals;</div>
<div class="line">std::vector&lt;Point2&gt; 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 &lt;<a class="el" href="mesh_8h_source.html">mesh.h</a>&gt;</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">&#160;</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">&#160;</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">&#160;</td></tr>
<tr class="memitem:a76b4977f0a7f156aa8a0027f10dcbdc1"><td class="memItemLeft" align="right" valign="top">&#160;</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> &amp;other)</td></tr>
<tr class="memdesc:a76b4977f0a7f156aa8a0027f10dcbdc1"><td class="mdescLeft">&#160;</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">&#160;</td></tr>
<tr class="memitem:ace7b23730dbcb581c4886cf2b9998327"><td class="memItemLeft" align="right" valign="top">virtual&#160;</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">&#160;</td></tr>
<tr class="memitem:a8d05faf18ef8d170fc3c2a343075823f"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classmingfx_1_1_mesh.html#a8d05faf18ef8d170fc3c2a343075823f">LoadFromOBJ</a> (const std::string &amp;filename)</td></tr>
<tr class="memdesc:a8d05faf18ef8d170fc3c2a343075823f"><td class="mdescLeft">&#160;</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">&#160;</td></tr>
<tr class="memitem:a29eeb2e778704350789033ec4940d55a"><td class="memItemLeft" align="right" valign="top">int&#160;</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">&#160;</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">&#160;</td></tr>
<tr class="memitem:a3e0ac86714f6b7c3f62761ef3952a044"><td class="memItemLeft" align="right" valign="top">void&#160;</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">&#160;</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">&#160;</td></tr>
<tr class="memitem:a43d5a5cc3ef742a8c2b5e3f1b4da0903"><td class="memItemLeft" align="right" valign="top">void&#160;</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">&#160;</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">&#160;</td></tr>
<tr class="memitem:a0f59e19b74f4f9dc2ad580756f8b319f"><td class="memItemLeft" align="right" valign="top">void&#160;</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">&#160;</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">&#160;</td></tr>
<tr class="memitem:a17cb896939007357014c74a1ece6f1f3"><td class="memItemLeft" align="right" valign="top">void&#160;</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">&#160;</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">&#160;</td></tr>
<tr class="memitem:a1dd243b53826765ba468f505645102a6"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classmingfx_1_1_mesh.html#a1dd243b53826765ba468f505645102a6">SetVertices</a> (const std::vector&lt; <a class="el" href="classmingfx_1_1_point3.html">Point3</a> &gt; &amp;verts)</td></tr>
<tr class="memdesc:a1dd243b53826765ba468f505645102a6"><td class="mdescLeft">&#160;</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">&#160;</td></tr>
<tr class="memitem:ad28dbd5b0ab77bec28f30f618dd9e57d"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classmingfx_1_1_mesh.html#ad28dbd5b0ab77bec28f30f618dd9e57d">SetNormals</a> (const std::vector&lt; <a class="el" href="classmingfx_1_1_vector3.html">Vector3</a> &gt; &amp;norms)</td></tr>
<tr class="memdesc:ad28dbd5b0ab77bec28f30f618dd9e57d"><td class="mdescLeft">&#160;</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">&#160;</td></tr>
<tr class="memitem:ab9b05a77591a9adad12032d513256dae"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classmingfx_1_1_mesh.html#ab9b05a77591a9adad12032d513256dae">SetColors</a> (const std::vector&lt; <a class="el" href="classmingfx_1_1_color.html">Color</a> &gt; &amp;colors)</td></tr>
<tr class="memdesc:ab9b05a77591a9adad12032d513256dae"><td class="mdescLeft">&#160;</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">&#160;</td></tr>
<tr class="memitem:aba2dfd0ade2d8a728897d411ef3fdaf1"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classmingfx_1_1_mesh.html#aba2dfd0ade2d8a728897d411ef3fdaf1">SetTexCoords</a> (int texture_unit, const std::vector&lt; <a class="el" href="classmingfx_1_1_point2.html">Point2</a> &gt; &amp;tex_coords)</td></tr>
<tr class="memdesc:aba2dfd0ade2d8a728897d411ef3fdaf1"><td class="mdescLeft">&#160;</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">&#160;</td></tr>
<tr class="memitem:a1f94c9ca7867b65e04f7e02813a06581"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classmingfx_1_1_mesh.html#a1f94c9ca7867b65e04f7e02813a06581">SetIndices</a> (const std::vector&lt; unsigned int &gt; index_array)</td></tr>
<tr class="memdesc:a1f94c9ca7867b65e04f7e02813a06581"><td class="mdescLeft">&#160;</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">&#160;</td></tr>
<tr class="memitem:a7175238f5874929e2258458b98421d87"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classmingfx_1_1_mesh.html#a7175238f5874929e2258458b98421d87">SetInstanceTransforms</a> (const std::vector&lt; <a class="el" href="classmingfx_1_1_matrix4.html">Matrix4</a> &gt; &amp;xforms)</td></tr>
<tr class="separator:a7175238f5874929e2258458b98421d87"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a033076b9bf1714c9b9e0eeef11ebcd49"><td class="memItemLeft" align="right" valign="top">void&#160;</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">&#160;</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&lt;&gt;  <a href="classmingfx_1_1_mesh.html#a033076b9bf1714c9b9e0eeef11ebcd49">More...</a><br /></td></tr>
<tr class="separator:a033076b9bf1714c9b9e0eeef11ebcd49"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a6ab1128fab6f969564d3a1329baeade6"><td class="memItemLeft" align="right" valign="top">void&#160;</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">&#160;</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&lt;&gt;  <a href="classmingfx_1_1_mesh.html#a6ab1128fab6f969564d3a1329baeade6">More...</a><br /></td></tr>
<tr class="separator:a6ab1128fab6f969564d3a1329baeade6"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:aed172bdd77858f3b59978cb8527e19ae"><td class="memItemLeft" align="right" valign="top">void&#160;</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">&#160;</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&lt;&gt;  <a href="classmingfx_1_1_mesh.html#aed172bdd77858f3b59978cb8527e19ae">More...</a><br /></td></tr>
<tr class="separator:aed172bdd77858f3b59978cb8527e19ae"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ac9cd4e8d67bb70295a48fcbc72ae32f9"><td class="memItemLeft" align="right" valign="top">void&#160;</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">&#160;</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&lt;&gt;  <a href="classmingfx_1_1_mesh.html#ac9cd4e8d67bb70295a48fcbc72ae32f9">More...</a><br /></td></tr>
<tr class="separator:ac9cd4e8d67bb70295a48fcbc72ae32f9"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a84711746b8d37c8d9b12ae748a4c5b8c"><td class="memItemLeft" align="right" valign="top">void&#160;</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">&#160;</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&lt;&gt;  <a href="classmingfx_1_1_mesh.html#a84711746b8d37c8d9b12ae748a4c5b8c">More...</a><br /></td></tr>
<tr class="separator:a84711746b8d37c8d9b12ae748a4c5b8c"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ac74345bf4b2994de4ee1c509bcc6840e"><td class="memItemLeft" align="right" valign="top">void&#160;</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">&#160;</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">&#160;</td></tr>
<tr class="memitem:a75075d472938fd760477be42585aff5c"><td class="memItemLeft" align="right" valign="top">void&#160;</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">&#160;</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">&#160;</td></tr>
<tr class="memitem:a1a5cea9cfdf4c672ba0c781ee54718f7"><td class="memItemLeft" align="right" valign="top">void&#160;</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">&#160;</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">&#160;</td></tr>
<tr class="memitem:acc7df547b0a2175287cc9f509c04e93c"><td class="memItemLeft" align="right" valign="top">void&#160;</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">&#160;</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">&#160;</td></tr>
<tr class="memitem:a8d96c1b5985cd836f2aa2b2994af64c1"><td class="memItemLeft" align="right" valign="top">void&#160;</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">&#160;</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">&#160;</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> *&#160;</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">&#160;</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">&#160;</td></tr>
<tr class="memitem:ab8f6856429466f1b4600a6ec27b84d0d"><td class="memItemLeft" align="right" valign="top">int&#160;</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">&#160;</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">&#160;</td></tr>
<tr class="memitem:ada9371e85aa0b61df79b26fc880b1863"><td class="memItemLeft" align="right" valign="top"><a class="el" href="classmingfx_1_1_point3.html">Point3</a>&#160;</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">&#160;</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">&#160;</td></tr>
<tr class="memitem:a439361e454ca63c35f564aed5cd0de65"><td class="memItemLeft" align="right" valign="top"><a class="el" href="classmingfx_1_1_vector3.html">Vector3</a>&#160;</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">&#160;</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">&#160;</td></tr>
<tr class="memitem:ac5fc517fd8ea4cea8459d3f4d5d6ced3"><td class="memItemLeft" align="right" valign="top"><a class="el" href="classmingfx_1_1_color.html">Color</a>&#160;</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">&#160;</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">&#160;</td></tr>
<tr class="memitem:a51aaa8d6a80af46f22ea9dfecd2f0b31"><td class="memItemLeft" align="right" valign="top"><a class="el" href="classmingfx_1_1_point2.html">Point2</a>&#160;</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">&#160;</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">&#160;</td></tr>
<tr class="memitem:ab3f3779506e15e3888ccbb8b9b572b8f"><td class="memItemLeft" align="right" valign="top">int&#160;</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">&#160;</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">&#160;</td></tr>
<tr class="memitem:a15d79cbc48a6ef72ef1208d734cc2f8a"><td class="memItemLeft" align="right" valign="top">std::vector&lt; unsigned int &gt;&#160;</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">&#160;</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">&#160;</td></tr>
</table>
<h2 class="groupheader">Constructor &amp; Destructor Documentation</h2>
<a id="a69613870d54989f4226e50caf4ca9fb9"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a69613870d54989f4226e50caf4ca9fb9">&#9670;&nbsp;</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">&#9670;&nbsp;</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> &amp;&#160;</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">&#9670;&nbsp;</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">&#9670;&nbsp;</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>&#160;</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>&#160;</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>&#160;</td>
          <td class="paramname"><em>v3</em>&#160;</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">&#9670;&nbsp;</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">&#9670;&nbsp;</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">&#9670;&nbsp;</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">&#9670;&nbsp;</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">&#9670;&nbsp;</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 &ndash; 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">&#9670;&nbsp;</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 &amp;&#160;</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">&#9670;&nbsp;</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">&#9670;&nbsp;</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">&#9670;&nbsp;</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&#160;</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">&#9670;&nbsp;</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&#160;</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">&#9670;&nbsp;</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&#160;</td>
          <td class="paramname"><em>texture_unit</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">int&#160;</td>
          <td class="paramname"><em>vertex_id</em>&#160;</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">&#9670;&nbsp;</a></span>read_triangle_indices_data()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">std::vector&lt;unsigned int&gt; mingfx::Mesh::read_triangle_indices_data </td>
          <td>(</td>
          <td class="paramtype">int&#160;</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">&#9670;&nbsp;</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&#160;</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">&#9670;&nbsp;</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&lt; <a class="el" href="classmingfx_1_1_color.html">Color</a> &gt; &amp;&#160;</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">&#9670;&nbsp;</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 *&#160;</td>
          <td class="paramname"><em>colors_array</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">int&#160;</td>
          <td class="paramname"><em>num_colors</em>&#160;</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&lt;&gt; </p>

</div>
</div>
<a id="a0f59e19b74f4f9dc2ad580756f8b319f"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a0f59e19b74f4f9dc2ad580756f8b319f">&#9670;&nbsp;</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&#160;</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>&#160;</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>&#160;</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>&#160;</td>
          <td class="paramname"><em>c3</em>&#160;</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">&#9670;&nbsp;</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&lt; unsigned int &gt;&#160;</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">&#9670;&nbsp;</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 *&#160;</td>
          <td class="paramname"><em>index_array</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">int&#160;</td>
          <td class="paramname"><em>num_indices</em>&#160;</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&lt;&gt; </p>

</div>
</div>
<a id="a7175238f5874929e2258458b98421d87"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a7175238f5874929e2258458b98421d87">&#9670;&nbsp;</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&lt; <a class="el" href="classmingfx_1_1_matrix4.html">Matrix4</a> &gt; &amp;&#160;</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">&#9670;&nbsp;</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&lt; <a class="el" href="classmingfx_1_1_vector3.html">Vector3</a> &gt; &amp;&#160;</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">&#9670;&nbsp;</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 *&#160;</td>
          <td class="paramname"><em>norms_array</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">int&#160;</td>
          <td class="paramname"><em>num_norms</em>&#160;</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&lt;&gt; </p>

</div>
</div>
<a id="a43d5a5cc3ef742a8c2b5e3f1b4da0903"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a43d5a5cc3ef742a8c2b5e3f1b4da0903">&#9670;&nbsp;</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&#160;</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>&#160;</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>&#160;</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>&#160;</td>
          <td class="paramname"><em>n3</em>&#160;</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">&#9670;&nbsp;</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&#160;</td>
          <td class="paramname"><em>texture_unit</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">const std::vector&lt; <a class="el" href="classmingfx_1_1_point2.html">Point2</a> &gt; &amp;&#160;</td>
          <td class="paramname"><em>tex_coords</em>&#160;</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">&#9670;&nbsp;</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&#160;</td>
          <td class="paramname"><em>texture_unit</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">float *&#160;</td>
          <td class="paramname"><em>tex_coords_array</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">int&#160;</td>
          <td class="paramname"><em>num_tex_coords</em>&#160;</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&lt;&gt; </p>

</div>
</div>
<a id="a17cb896939007357014c74a1ece6f1f3"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a17cb896939007357014c74a1ece6f1f3">&#9670;&nbsp;</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&#160;</td>
          <td class="paramname"><em>triangle_id</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">int&#160;</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>&#160;</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>&#160;</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>&#160;</td>
          <td class="paramname"><em>uv3</em>&#160;</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">&#9670;&nbsp;</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&lt; <a class="el" href="classmingfx_1_1_point3.html">Point3</a> &gt; &amp;&#160;</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">&#9670;&nbsp;</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 *&#160;</td>
          <td class="paramname"><em>verts_array</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">int&#160;</td>
          <td class="paramname"><em>num_verts</em>&#160;</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&lt;&gt; </p>

</div>
</div>
<a id="ac74345bf4b2994de4ee1c509bcc6840e"></a>
<h2 class="memtitle"><span class="permalink"><a href="#ac74345bf4b2994de4ee1c509bcc6840e">&#9670;&nbsp;</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">&#9670;&nbsp;</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&#160;</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>&#160;</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>&#160;</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>&#160;</td>
          <td class="paramname"><em>v3</em>&#160;</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 &#160;<a href="http://www.doxygen.org/index.html">
<img class="footer" src="doxygen.png" alt="doxygen"/>
</a> 1.9.1
</small></address>
</body>
</html>