diff options
Diffstat (limited to '')
-rw-r--r-- | dev/MinGfx/docs/html/classmingfx_1_1_b_v_h.html | 232 |
1 files changed, 232 insertions, 0 deletions
diff --git a/dev/MinGfx/docs/html/classmingfx_1_1_b_v_h.html b/dev/MinGfx/docs/html/classmingfx_1_1_b_v_h.html new file mode 100644 index 0000000..032d128 --- /dev/null +++ b/dev/MinGfx/docs/html/classmingfx_1_1_b_v_h.html @@ -0,0 +1,232 @@ +<!-- 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::BVH 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_b_v_h.html">BVH</a></li> </ul> +</div> +</div><!-- top --> +<div class="header"> + <div class="summary"> +<a href="#nested-classes">Classes</a> | +<a href="#pub-methods">Public Member Functions</a> | +<a href="classmingfx_1_1_b_v_h-members.html">List of all members</a> </div> + <div class="headertitle"> +<div class="title">mingfx::BVH 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 Bounding Volume Hierarchy (<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 that can be used to accelerate ray-object intersection tests by carving up space into a hierarchy of partitions represented in a tree. </p> +<p>Each node of the tree is represented as an <a class="el" href="classmingfx_1_1_a_a_b_b.html" title="A 3D axis-aligned bounding box defined by two corners (min and max).">AABB</a> (Axis-Aligned Bounding Box) that contains all of the nodes under it. Different objects can be stored inside each bounding box. For example, when a <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 created for a mesh, each leaf node can contain a <a class="el" href="classmingfx_1_1_a_a_b_b.html" title="A 3D axis-aligned bounding box defined by two corners (min and max).">AABB</a> that contains just a single triangle. Or, when a <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 created for an entire scene, you could have each leaf node contain an entire mesh or other object within the scene. In each case, use <a class="el" href="classmingfx_1_1_a_a_b_b.html" title="A 3D axis-aligned bounding box defined by two corners (min and max).">AABB</a>'s set_user_data() and user_data() methods to store a handle for whetever you want to store inside the nodes. </p> + +<p class="definition">Definition at line <a class="el" href="bvh_8h_source.html#l00040">40</a> of file <a class="el" href="bvh_8h_source.html">bvh.h</a>.</p> +</div> +<p><code>#include <<a class="el" href="bvh_8h_source.html">bvh.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:af812656193d247be31dd038a8e2fff75"><td class="memItemLeft" align="right" valign="top"> </td><td class="memItemRight" valign="bottom"><a class="el" href="classmingfx_1_1_b_v_h.html#af812656193d247be31dd038a8e2fff75">BVH</a> ()</td></tr> +<tr class="memdesc:af812656193d247be31dd038a8e2fff75"><td class="mdescLeft"> </td><td class="mdescRight">Initializes the class with an empty hierarchy. <a href="classmingfx_1_1_b_v_h.html#af812656193d247be31dd038a8e2fff75">More...</a><br /></td></tr> +<tr class="separator:af812656193d247be31dd038a8e2fff75"><td class="memSeparator" colspan="2"> </td></tr> +<tr class="memitem:af81906830adcf4648cc8cf4e214b4269"><td class="memItemLeft" align="right" valign="top">virtual </td><td class="memItemRight" valign="bottom"><a class="el" href="classmingfx_1_1_b_v_h.html#af81906830adcf4648cc8cf4e214b4269">~BVH</a> ()</td></tr> +<tr class="separator:af81906830adcf4648cc8cf4e214b4269"><td class="memSeparator" colspan="2"> </td></tr> +<tr class="memitem:a8ed3e91ecd2a0585a0dbac605d6f2c71"><td class="memItemLeft" align="right" valign="top">void </td><td class="memItemRight" valign="bottom"><a class="el" href="classmingfx_1_1_b_v_h.html#a8ed3e91ecd2a0585a0dbac605d6f2c71">CreateFromMesh</a> (const <a class="el" href="classmingfx_1_1_mesh.html">Mesh</a> &mesh)</td></tr> +<tr class="memdesc:a8ed3e91ecd2a0585a0dbac605d6f2c71"><td class="mdescLeft"> </td><td class="mdescRight">Creates a bounding volume hierarchy where each leaf node contains a single triangle from the mesh. <a href="classmingfx_1_1_b_v_h.html#a8ed3e91ecd2a0585a0dbac605d6f2c71">More...</a><br /></td></tr> +<tr class="separator:a8ed3e91ecd2a0585a0dbac605d6f2c71"><td class="memSeparator" colspan="2"> </td></tr> +<tr class="memitem:a964420ca931fa93c420f0820e1b95942"><td class="memItemLeft" align="right" valign="top">void </td><td class="memItemRight" valign="bottom"><a class="el" href="classmingfx_1_1_b_v_h.html#a964420ca931fa93c420f0820e1b95942">CreateFromListOfBoxes</a> (const std::vector< <a class="el" href="classmingfx_1_1_a_a_b_b.html">AABB</a> > &boxes)</td></tr> +<tr class="memdesc:a964420ca931fa93c420f0820e1b95942"><td class="mdescLeft"> </td><td class="mdescRight">Creates a <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> where each leaf node contains one of the boxes passed in to the function. <a href="classmingfx_1_1_b_v_h.html#a964420ca931fa93c420f0820e1b95942">More...</a><br /></td></tr> +<tr class="separator:a964420ca931fa93c420f0820e1b95942"><td class="memSeparator" colspan="2"> </td></tr> +<tr class="memitem:afad54f50a29e8b3aace6cdec5c792c56"><td class="memItemLeft" align="right" valign="top">std::vector< int > </td><td class="memItemRight" valign="bottom"><a class="el" href="classmingfx_1_1_b_v_h.html#afad54f50a29e8b3aace6cdec5c792c56">IntersectAndReturnUserData</a> (const <a class="el" href="classmingfx_1_1_ray.html">Ray</a> &r) const</td></tr> +<tr class="memdesc:afad54f50a29e8b3aace6cdec5c792c56"><td class="mdescLeft"> </td><td class="mdescRight">Traverse 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> to find leaf nodes whose AABBs are intersected by the ray. <a href="classmingfx_1_1_b_v_h.html#afad54f50a29e8b3aace6cdec5c792c56">More...</a><br /></td></tr> +<tr class="separator:afad54f50a29e8b3aace6cdec5c792c56"><td class="memSeparator" colspan="2"> </td></tr> +</table> +<h2 class="groupheader">Constructor & Destructor Documentation</h2> +<a id="af812656193d247be31dd038a8e2fff75"></a> +<h2 class="memtitle"><span class="permalink"><a href="#af812656193d247be31dd038a8e2fff75">◆ </a></span>BVH()</h2> + +<div class="memitem"> +<div class="memproto"> + <table class="memname"> + <tr> + <td class="memname">mingfx::BVH::BVH </td> + <td>(</td> + <td class="paramname"></td><td>)</td> + <td></td> + </tr> + </table> +</div><div class="memdoc"> + +<p>Initializes the class with an empty hierarchy. </p> + +</div> +</div> +<a id="af81906830adcf4648cc8cf4e214b4269"></a> +<h2 class="memtitle"><span class="permalink"><a href="#af81906830adcf4648cc8cf4e214b4269">◆ </a></span>~BVH()</h2> + +<div class="memitem"> +<div class="memproto"> +<table class="mlabels"> + <tr> + <td class="mlabels-left"> + <table class="memname"> + <tr> + <td class="memname">virtual mingfx::BVH::~BVH </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="a964420ca931fa93c420f0820e1b95942"></a> +<h2 class="memtitle"><span class="permalink"><a href="#a964420ca931fa93c420f0820e1b95942">◆ </a></span>CreateFromListOfBoxes()</h2> + +<div class="memitem"> +<div class="memproto"> + <table class="memname"> + <tr> + <td class="memname">void mingfx::BVH::CreateFromListOfBoxes </td> + <td>(</td> + <td class="paramtype">const std::vector< <a class="el" href="classmingfx_1_1_a_a_b_b.html">AABB</a> > & </td> + <td class="paramname"><em>boxes</em></td><td>)</td> + <td></td> + </tr> + </table> +</div><div class="memdoc"> + +<p>Creates a <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> where each leaf node contains one of the boxes passed in to the function. </p> + +</div> +</div> +<a id="a8ed3e91ecd2a0585a0dbac605d6f2c71"></a> +<h2 class="memtitle"><span class="permalink"><a href="#a8ed3e91ecd2a0585a0dbac605d6f2c71">◆ </a></span>CreateFromMesh()</h2> + +<div class="memitem"> +<div class="memproto"> + <table class="memname"> + <tr> + <td class="memname">void mingfx::BVH::CreateFromMesh </td> + <td>(</td> + <td class="paramtype">const <a class="el" href="classmingfx_1_1_mesh.html">Mesh</a> & </td> + <td class="paramname"><em>mesh</em></td><td>)</td> + <td></td> + </tr> + </table> +</div><div class="memdoc"> + +<p>Creates a bounding volume hierarchy where each leaf node contains a single triangle from the mesh. </p> +<p>For leaf nodes, the triangle index can be retrieved with: </p><div class="fragment"><div class="line"><span class="keywordtype">int</span> tri_id = leafnode->box.user_data();</div> +</div><!-- fragment --><p> The user_data will be -1 for non-leaf nodes. Once the structure has been created, it can be used to perform fast ray-mesh intersection tests. See <a class="el" href="classmingfx_1_1_ray.html#ac90097090f0f8f49db13f6f232712afc" title="Checks to see if the ray intersects a triangle mesh.">Ray::FastIntersectMesh()</a>. </p> + +</div> +</div> +<a id="afad54f50a29e8b3aace6cdec5c792c56"></a> +<h2 class="memtitle"><span class="permalink"><a href="#afad54f50a29e8b3aace6cdec5c792c56">◆ </a></span>IntersectAndReturnUserData()</h2> + +<div class="memitem"> +<div class="memproto"> + <table class="memname"> + <tr> + <td class="memname">std::vector<int> mingfx::BVH::IntersectAndReturnUserData </td> + <td>(</td> + <td class="paramtype">const <a class="el" href="classmingfx_1_1_ray.html">Ray</a> & </td> + <td class="paramname"><em>r</em></td><td>)</td> + <td> const</td> + </tr> + </table> +</div><div class="memdoc"> + +<p>Traverse 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> to find leaf nodes whose AABBs are intersected by the ray. </p> +<p>These are candidates to test more thoroughly using whatever ray-object intersection test is appropriate for the objects stored inside the <a class="el" href="classmingfx_1_1_a_a_b_b.html" title="A 3D axis-aligned bounding box defined by two corners (min and max).">AABB</a>. This routine returns the user_data for each <a class="el" href="classmingfx_1_1_a_a_b_b.html" title="A 3D axis-aligned bounding box defined by two corners (min and max).">AABB</a> leaf node. In the case of a <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> created using CreateFromMesh, this means it stores the indices to the mesh triangles that should be tested for ray-triangle intersection. </p> + +</div> +</div> +<hr/>The documentation for this class was generated from the following file:<ul> +<li>src/<a class="el" href="bvh_8h_source.html">bvh.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> |