<!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.8.14"/> <meta name="viewport" content="width=device-width, initial-scale=1"/> <title>Box2D: b2RayCastCallback 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> <link href="doxygen.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 id="projectlogo"><img alt="Logo" src="icon.gif"/></td> <td id="projectalign" style="padding-left: 0.5em;"> <div id="projectname">Box2D  <span id="projectnumber">2.3.0</span> </div> <div id="projectbrief">A 2D Physics Engine for Games</div> </td> </tr> </tbody> </table> </div> <!-- end header part --> <!-- Generated by Doxygen 1.8.14 --> <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'); /* @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><!-- top --> <div class="header"> <div class="summary"> <a href="#pub-methods">Public Member Functions</a> | <a href="classb2_ray_cast_callback-members.html">List of all members</a> </div> <div class="headertitle"> <div class="title">b2RayCastCallback Class Reference<span class="mlabels"><span class="mlabel">abstract</span></span></div> </div> </div><!--header--> <div class="contents"> <p><code>#include <<a class="el" href="b2_world_callbacks_8h_source.html">b2WorldCallbacks.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:a658d5c8e89e0c73230cc8bddade4f3a4"><td class="memItemLeft" align="right" valign="top">virtual float32 </td><td class="memItemRight" valign="bottom"><a class="el" href="classb2_ray_cast_callback.html#a658d5c8e89e0c73230cc8bddade4f3a4">ReportFixture</a> (<a class="el" href="classb2_fixture.html">b2Fixture</a> *fixture, const <a class="el" href="structb2_vec2.html">b2Vec2</a> &point, const <a class="el" href="structb2_vec2.html">b2Vec2</a> &normal, float32 fraction)=0</td></tr> <tr class="separator:a658d5c8e89e0c73230cc8bddade4f3a4"><td class="memSeparator" colspan="2"> </td></tr> </table> <a name="details" id="details"></a><h2 class="groupheader">Detailed Description</h2> <div class="textblock"><p>Callback class for ray casts. See <a class="el" href="classb2_world.html#aa9955d94a254253997daaf16ce77bab6">b2World::RayCast</a> </p> </div><h2 class="groupheader">Member Function Documentation</h2> <a id="a658d5c8e89e0c73230cc8bddade4f3a4"></a> <h2 class="memtitle"><span class="permalink"><a href="#a658d5c8e89e0c73230cc8bddade4f3a4">◆ </a></span>ReportFixture()</h2> <div class="memitem"> <div class="memproto"> <table class="mlabels"> <tr> <td class="mlabels-left"> <table class="memname"> <tr> <td class="memname">virtual float32 b2RayCastCallback::ReportFixture </td> <td>(</td> <td class="paramtype"><a class="el" href="classb2_fixture.html">b2Fixture</a> * </td> <td class="paramname"><em>fixture</em>, </td> </tr> <tr> <td class="paramkey"></td> <td></td> <td class="paramtype">const <a class="el" href="structb2_vec2.html">b2Vec2</a> & </td> <td class="paramname"><em>point</em>, </td> </tr> <tr> <td class="paramkey"></td> <td></td> <td class="paramtype">const <a class="el" href="structb2_vec2.html">b2Vec2</a> & </td> <td class="paramname"><em>normal</em>, </td> </tr> <tr> <td class="paramkey"></td> <td></td> <td class="paramtype">float32 </td> <td class="paramname"><em>fraction</em> </td> </tr> <tr> <td></td> <td>)</td> <td></td><td></td> </tr> </table> </td> <td class="mlabels-right"> <span class="mlabels"><span class="mlabel">pure virtual</span></span> </td> </tr> </table> </div><div class="memdoc"> <p>Called for each fixture found in the query. You control how the ray cast proceeds by returning a float: return -1: ignore this fixture and continue return 0: terminate the ray cast return fraction: clip the ray to this point return 1: don't clip the ray and continue </p><dl class="params"><dt>Parameters</dt><dd> <table class="params"> <tr><td class="paramname">fixture</td><td>the fixture hit by the ray </td></tr> <tr><td class="paramname">point</td><td>the point of initial intersection </td></tr> <tr><td class="paramname">normal</td><td>the normal vector at the point of intersection </td></tr> </table> </dd> </dl> <dl class="section return"><dt>Returns</dt><dd>-1 to filter, 0 to terminate, fraction to clip the ray for closest hit, 1 to continue </dd></dl> </div> </div> <hr/>The documentation for this class was generated from the following file:<ul> <li><a class="el" href="b2_world_callbacks_8h_source.html">b2WorldCallbacks.h</a></li> </ul> </div><!-- contents --> <!-- start footer part --> <hr class="footer"/><address class="footer"><small> Generated on Fri Sep 21 2018 22:35:08 for Box2D by  <a href="http://www.doxygen.org/index.html"> <img class="footer" src="doxygen.png" alt="doxygen"/> </a> 1.8.14 </small></address> </body> </html>