Merge pull request #1057 from nick-dumas/master

Fix squered typo #1057
This commit is contained in:
Christophe 2021-03-02 22:49:53 +01:00 committed by GitHub
commit 64be09e1b1
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
7 changed files with 10 additions and 10 deletions

View File

@ -111,7 +111,7 @@ Functions</h2></td></tr>
<tr class="memdesc:gad3697a9700ea379739a667ea02573488"><td class="mdescLeft">&#160;</td><td class="mdescRight">Compute the intersection of a ray and a plane. <a href="a00331.html#gad3697a9700ea379739a667ea02573488">More...</a><br /></td></tr>
<tr class="separator:gad3697a9700ea379739a667ea02573488"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:gac88f8cd84c4bcb5b947d56acbbcfa56e"><td class="memTemplParams" colspan="2">template&lt;typename genType &gt; </td></tr>
<tr class="memitem:gac88f8cd84c4bcb5b947d56acbbcfa56e"><td class="memTemplItemLeft" align="right" valign="top">GLM_FUNC_DECL bool&#160;</td><td class="memTemplItemRight" valign="bottom"><a class="el" href="a00331.html#gac88f8cd84c4bcb5b947d56acbbcfa56e">intersectRaySphere</a> (genType const &amp;rayStarting, genType const &amp;rayNormalizedDirection, genType const &amp;sphereCenter, typename genType::value_type const sphereRadiusSquered, typename genType::value_type &amp;intersectionDistance)</td></tr>
<tr class="memitem:gac88f8cd84c4bcb5b947d56acbbcfa56e"><td class="memTemplItemLeft" align="right" valign="top">GLM_FUNC_DECL bool&#160;</td><td class="memTemplItemRight" valign="bottom"><a class="el" href="a00331.html#gac88f8cd84c4bcb5b947d56acbbcfa56e">intersectRaySphere</a> (genType const &amp;rayStarting, genType const &amp;rayNormalizedDirection, genType const &amp;sphereCenter, typename genType::value_type const sphereRadiusSquared, typename genType::value_type &amp;intersectionDistance)</td></tr>
<tr class="memdesc:gac88f8cd84c4bcb5b947d56acbbcfa56e"><td class="mdescLeft">&#160;</td><td class="mdescRight">Compute the intersection distance of a ray and a sphere. <a href="a00331.html#gac88f8cd84c4bcb5b947d56acbbcfa56e">More...</a><br /></td></tr>
<tr class="separator:gac88f8cd84c4bcb5b947d56acbbcfa56e"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:gad28c00515b823b579c608aafa1100c1d"><td class="memTemplParams" colspan="2">template&lt;typename genType &gt; </td></tr>

View File

@ -131,7 +131,7 @@ var searchBox = new SearchBox("searchBox", "search",false,'Search');
<div class="line"><a name="l00066"></a><span class="lineno"> 66</span>&#160; <span class="keyword">template</span>&lt;<span class="keyword">typename</span> genType&gt;</div>
<div class="line"><a name="l00067"></a><span class="lineno"> 67</span>&#160; GLM_FUNC_DECL <span class="keywordtype">bool</span> <a class="code" href="a00331.html#gad28c00515b823b579c608aafa1100c1d">intersectRaySphere</a>(</div>
<div class="line"><a name="l00068"></a><span class="lineno"> 68</span>&#160; genType <span class="keyword">const</span>&amp; rayStarting, genType <span class="keyword">const</span>&amp; rayNormalizedDirection,</div>
<div class="line"><a name="l00069"></a><span class="lineno"> 69</span>&#160; genType <span class="keyword">const</span>&amp; sphereCenter, <span class="keyword">typename</span> genType::value_type <span class="keyword">const</span> sphereRadiusSquered,</div>
<div class="line"><a name="l00069"></a><span class="lineno"> 69</span>&#160; genType <span class="keyword">const</span>&amp; sphereCenter, <span class="keyword">typename</span> genType::value_type <span class="keyword">const</span> sphereRadiusSquared,</div>
<div class="line"><a name="l00070"></a><span class="lineno"> 70</span>&#160; <span class="keyword">typename</span> genType::value_type &amp; intersectionDistance);</div>
<div class="line"><a name="l00071"></a><span class="lineno"> 71</span>&#160;</div>
<div class="line"><a name="l00074"></a><span class="lineno"> 74</span>&#160; <span class="keyword">template</span>&lt;<span class="keyword">typename</span> genType&gt;</div>

View File

@ -100,7 +100,7 @@ Functions</h2></td></tr>
<tr class="memdesc:gad3697a9700ea379739a667ea02573488"><td class="mdescLeft">&#160;</td><td class="mdescRight">Compute the intersection of a ray and a plane. <a href="a00331.html#gad3697a9700ea379739a667ea02573488">More...</a><br /></td></tr>
<tr class="separator:gad3697a9700ea379739a667ea02573488"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:gac88f8cd84c4bcb5b947d56acbbcfa56e"><td class="memTemplParams" colspan="2">template&lt;typename genType &gt; </td></tr>
<tr class="memitem:gac88f8cd84c4bcb5b947d56acbbcfa56e"><td class="memTemplItemLeft" align="right" valign="top">GLM_FUNC_DECL bool&#160;</td><td class="memTemplItemRight" valign="bottom"><a class="el" href="a00331.html#gac88f8cd84c4bcb5b947d56acbbcfa56e">intersectRaySphere</a> (genType const &amp;rayStarting, genType const &amp;rayNormalizedDirection, genType const &amp;sphereCenter, typename genType::value_type const sphereRadiusSquered, typename genType::value_type &amp;intersectionDistance)</td></tr>
<tr class="memitem:gac88f8cd84c4bcb5b947d56acbbcfa56e"><td class="memTemplItemLeft" align="right" valign="top">GLM_FUNC_DECL bool&#160;</td><td class="memTemplItemRight" valign="bottom"><a class="el" href="a00331.html#gac88f8cd84c4bcb5b947d56acbbcfa56e">intersectRaySphere</a> (genType const &amp;rayStarting, genType const &amp;rayNormalizedDirection, genType const &amp;sphereCenter, typename genType::value_type const sphereRadiusSquared, typename genType::value_type &amp;intersectionDistance)</td></tr>
<tr class="memdesc:gac88f8cd84c4bcb5b947d56acbbcfa56e"><td class="mdescLeft">&#160;</td><td class="mdescRight">Compute the intersection distance of a ray and a sphere. <a href="a00331.html#gac88f8cd84c4bcb5b947d56acbbcfa56e">More...</a><br /></td></tr>
<tr class="separator:gac88f8cd84c4bcb5b947d56acbbcfa56e"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:gad28c00515b823b579c608aafa1100c1d"><td class="memTemplParams" colspan="2">template&lt;typename genType &gt; </td></tr>
@ -307,7 +307,7 @@ Functions</h2></td></tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">typename genType::value_type const&#160;</td>
<td class="paramname"><em>sphereRadiusSquered</em>, </td>
<td class="paramname"><em>sphereRadiusSquared</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>

View File

@ -68,7 +68,7 @@ var searchData=
['intersectlinesphere',['intersectLineSphere',['../a00331.html#ga9c68139f3d8a4f3d7fe45f9dbc0de5b7',1,'glm']]],
['intersectlinetriangle',['intersectLineTriangle',['../a00331.html#ga9d29b9b3acb504d43986502f42740df4',1,'glm']]],
['intersectrayplane',['intersectRayPlane',['../a00331.html#gad3697a9700ea379739a667ea02573488',1,'glm']]],
['intersectraysphere',['intersectRaySphere',['../a00331.html#gac88f8cd84c4bcb5b947d56acbbcfa56e',1,'glm::intersectRaySphere(genType const &amp;rayStarting, genType const &amp;rayNormalizedDirection, genType const &amp;sphereCenter, typename genType::value_type const sphereRadiusSquered, typename genType::value_type &amp;intersectionDistance)'],['../a00331.html#gad28c00515b823b579c608aafa1100c1d',1,'glm::intersectRaySphere(genType const &amp;rayStarting, genType const &amp;rayNormalizedDirection, genType const &amp;sphereCenter, const typename genType::value_type sphereRadius, genType &amp;intersectionPosition, genType &amp;intersectionNormal)']]],
['intersectraysphere',['intersectRaySphere',['../a00331.html#gac88f8cd84c4bcb5b947d56acbbcfa56e',1,'glm::intersectRaySphere(genType const &amp;rayStarting, genType const &amp;rayNormalizedDirection, genType const &amp;sphereCenter, typename genType::value_type const sphereRadiusSquared, typename genType::value_type &amp;intersectionDistance)'],['../a00331.html#gad28c00515b823b579c608aafa1100c1d',1,'glm::intersectRaySphere(genType const &amp;rayStarting, genType const &amp;rayNormalizedDirection, genType const &amp;sphereCenter, const typename genType::value_type sphereRadius, genType &amp;intersectionPosition, genType &amp;intersectionNormal)']]],
['intersectraytriangle',['intersectRayTriangle',['../a00331.html#ga65bf2c594482f04881c36bc761f9e946',1,'glm']]],
['inverse',['inverse',['../a00248.html#gab41da854ae678e23e114b598cbca4065',1,'glm::inverse(qua&lt; T, Q &gt; const &amp;q)'],['../a00317.html#ga070f521a953f6461af4ab4cf8ccbf27e',1,'glm::inverse(tdualquat&lt; T, Q &gt; const &amp;q)'],['../a00371.html#gaed509fe8129b01e4f20a6d0de5690091',1,'glm::inverse(mat&lt; C, R, T, Q &gt; const &amp;m)']]],
['inversesqrt',['inversesqrt',['../a00242.html#ga523dd6bd0ad9f75ae2d24c8e4b017b7a',1,'glm']]],

View File

@ -11,7 +11,7 @@ var searchData=
['intersectlinesphere',['intersectLineSphere',['../a00331.html#ga9c68139f3d8a4f3d7fe45f9dbc0de5b7',1,'glm']]],
['intersectlinetriangle',['intersectLineTriangle',['../a00331.html#ga9d29b9b3acb504d43986502f42740df4',1,'glm']]],
['intersectrayplane',['intersectRayPlane',['../a00331.html#gad3697a9700ea379739a667ea02573488',1,'glm']]],
['intersectraysphere',['intersectRaySphere',['../a00331.html#gac88f8cd84c4bcb5b947d56acbbcfa56e',1,'glm::intersectRaySphere(genType const &amp;rayStarting, genType const &amp;rayNormalizedDirection, genType const &amp;sphereCenter, typename genType::value_type const sphereRadiusSquered, typename genType::value_type &amp;intersectionDistance)'],['../a00331.html#gad28c00515b823b579c608aafa1100c1d',1,'glm::intersectRaySphere(genType const &amp;rayStarting, genType const &amp;rayNormalizedDirection, genType const &amp;sphereCenter, const typename genType::value_type sphereRadius, genType &amp;intersectionPosition, genType &amp;intersectionNormal)']]],
['intersectraysphere',['intersectRaySphere',['../a00331.html#gac88f8cd84c4bcb5b947d56acbbcfa56e',1,'glm::intersectRaySphere(genType const &amp;rayStarting, genType const &amp;rayNormalizedDirection, genType const &amp;sphereCenter, typename genType::value_type const sphereRadiusSquared, typename genType::value_type &amp;intersectionDistance)'],['../a00331.html#gad28c00515b823b579c608aafa1100c1d',1,'glm::intersectRaySphere(genType const &amp;rayStarting, genType const &amp;rayNormalizedDirection, genType const &amp;sphereCenter, const typename genType::value_type sphereRadius, genType &amp;intersectionPosition, genType &amp;intersectionNormal)']]],
['intersectraytriangle',['intersectRayTriangle',['../a00331.html#ga65bf2c594482f04881c36bc761f9e946',1,'glm']]],
['inverse',['inverse',['../a00248.html#gab41da854ae678e23e114b598cbca4065',1,'glm::inverse(qua&lt; T, Q &gt; const &amp;q)'],['../a00317.html#ga070f521a953f6461af4ab4cf8ccbf27e',1,'glm::inverse(tdualquat&lt; T, Q &gt; const &amp;q)'],['../a00371.html#gaed509fe8129b01e4f20a6d0de5690091',1,'glm::inverse(mat&lt; C, R, T, Q &gt; const &amp;m)']]],
['inversesqrt',['inversesqrt',['../a00242.html#ga523dd6bd0ad9f75ae2d24c8e4b017b7a',1,'glm']]],

View File

@ -66,7 +66,7 @@ namespace glm
template<typename genType>
GLM_FUNC_DECL bool intersectRaySphere(
genType const& rayStarting, genType const& rayNormalizedDirection,
genType const& sphereCenter, typename genType::value_type const sphereRadiusSquered,
genType const& sphereCenter, typename genType::value_type const sphereRadiusSquared,
typename genType::value_type & intersectionDistance);
//! Compute the intersection of a ray and a sphere.

View File

@ -135,7 +135,7 @@ namespace glm
GLM_FUNC_QUALIFIER bool intersectRaySphere
(
genType const& rayStarting, genType const& rayNormalizedDirection,
genType const& sphereCenter, const typename genType::value_type sphereRadiusSquered,
genType const& sphereCenter, const typename genType::value_type sphereRadiusSquared,
typename genType::value_type & intersectionDistance
)
{
@ -143,11 +143,11 @@ namespace glm
genType diff = sphereCenter - rayStarting;
typename genType::value_type t0 = dot(diff, rayNormalizedDirection);
typename genType::value_type dSquared = dot(diff, diff) - t0 * t0;
if( dSquared > sphereRadiusSquered )
if( dSquared > sphereRadiusSquared )
{
return false;
}
typename genType::value_type t1 = sqrt( sphereRadiusSquered - dSquared );
typename genType::value_type t1 = sqrt( sphereRadiusSquared - dSquared );
intersectionDistance = t0 > t1 + Epsilon ? t0 - t1 : t0 + t1;
return intersectionDistance > Epsilon;
}