class_rotation_quat_constraint_part.html 28 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517
  1. <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "https://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
  2. <html xmlns="http://www.w3.org/1999/xhtml" lang="en-US">
  3. <head>
  4. <meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
  5. <meta http-equiv="X-UA-Compatible" content="IE=11"/>
  6. <meta name="generator" content="Doxygen 1.12.0"/>
  7. <meta name="viewport" content="width=device-width, initial-scale=1"/>
  8. <title>Jolt Physics: RotationQuatConstraintPart Class Reference</title>
  9. <link href="tabs.css" rel="stylesheet" type="text/css"/>
  10. <script type="text/javascript" src="jquery.js"></script>
  11. <script type="text/javascript" src="dynsections.js"></script>
  12. <script type="text/javascript" src="clipboard.js"></script>
  13. <link href="navtree.css" rel="stylesheet" type="text/css"/>
  14. <script type="text/javascript" src="navtreedata.js"></script>
  15. <script type="text/javascript" src="navtree.js"></script>
  16. <script type="text/javascript" src="resize.js"></script>
  17. <script type="text/javascript" src="cookie.js"></script>
  18. <link href="search/search.css" rel="stylesheet" type="text/css"/>
  19. <script type="text/javascript" src="search/searchdata.js"></script>
  20. <script type="text/javascript" src="search/search.js"></script>
  21. <script type="text/x-mathjax-config">
  22. MathJax.Hub.Config({
  23. extensions: ["tex2jax.js"],
  24. jax: ["input/TeX","output/HTML-CSS"],
  25. });
  26. </script>
  27. <script type="text/javascript" async="async" src="https://cdnjs.cloudflare.com/ajax/libs/mathjax/2.7.5/MathJax.js"></script>
  28. <link href="doxygen.css" rel="stylesheet" type="text/css" />
  29. </head>
  30. <body>
  31. <div id="top"><!-- do not remove this div, it is closed by doxygen! -->
  32. <div id="titlearea">
  33. <table cellspacing="0" cellpadding="0">
  34. <tbody>
  35. <tr id="projectrow">
  36. <td id="projectlogo"><img alt="Logo" src="LogoSmall.png"/></td>
  37. <td id="projectalign">
  38. <div id="projectname">Jolt Physics
  39. </div>
  40. <div id="projectbrief">A multi core friendly Game Physics Engine</div>
  41. </td>
  42. </tr>
  43. </tbody>
  44. </table>
  45. </div>
  46. <!-- end header part -->
  47. <!-- Generated by Doxygen 1.12.0 -->
  48. <script type="text/javascript">
  49. /* @license magnet:?xt=urn:btih:d3d9a9a6595521f9666a5e94cc830dab83b65699&amp;dn=expat.txt MIT */
  50. var searchBox = new SearchBox("searchBox", "search/",'.html');
  51. /* @license-end */
  52. </script>
  53. <script type="text/javascript">
  54. /* @license magnet:?xt=urn:btih:d3d9a9a6595521f9666a5e94cc830dab83b65699&amp;dn=expat.txt MIT */
  55. $(function() { codefold.init(0); });
  56. /* @license-end */
  57. </script>
  58. <script type="text/javascript" src="menudata.js"></script>
  59. <script type="text/javascript" src="menu.js"></script>
  60. <script type="text/javascript">
  61. /* @license magnet:?xt=urn:btih:d3d9a9a6595521f9666a5e94cc830dab83b65699&amp;dn=expat.txt MIT */
  62. $(function() {
  63. initMenu('',true,false,'search.php','Search',true);
  64. $(function() { init_search(); });
  65. });
  66. /* @license-end */
  67. </script>
  68. <div id="main-nav"></div>
  69. </div><!-- top -->
  70. <div id="side-nav" class="ui-resizable side-nav-resizable">
  71. <div id="nav-tree">
  72. <div id="nav-tree-contents">
  73. <div id="nav-sync" class="sync"></div>
  74. </div>
  75. </div>
  76. <div id="splitbar" style="-moz-user-select:none;"
  77. class="ui-resizable-handle">
  78. </div>
  79. </div>
  80. <script type="text/javascript">
  81. /* @license magnet:?xt=urn:btih:d3d9a9a6595521f9666a5e94cc830dab83b65699&amp;dn=expat.txt MIT */
  82. $(function(){initNavTree('class_rotation_quat_constraint_part.html',''); initResizable(true); });
  83. /* @license-end */
  84. </script>
  85. <div id="doc-content">
  86. <!-- window showing the filter options -->
  87. <div id="MSearchSelectWindow"
  88. onmouseover="return searchBox.OnSearchSelectShow()"
  89. onmouseout="return searchBox.OnSearchSelectHide()"
  90. onkeydown="return searchBox.OnSearchSelectKey(event)">
  91. </div>
  92. <!-- iframe showing the search results (closed by default) -->
  93. <div id="MSearchResultsWindow">
  94. <div id="MSearchResults">
  95. <div class="SRPage">
  96. <div id="SRIndex">
  97. <div id="SRResults"></div>
  98. <div class="SRStatus" id="Loading">Loading...</div>
  99. <div class="SRStatus" id="Searching">Searching...</div>
  100. <div class="SRStatus" id="NoMatches">No Matches</div>
  101. </div>
  102. </div>
  103. </div>
  104. </div>
  105. <div class="header">
  106. <div class="summary">
  107. <a href="#pub-methods">Public Member Functions</a> &#124;
  108. <a href="#pub-static-methods">Static Public Member Functions</a> &#124;
  109. <a href="class_rotation_quat_constraint_part-members.html">List of all members</a> </div>
  110. <div class="headertitle"><div class="title">RotationQuatConstraintPart Class Reference</div></div>
  111. </div><!--header-->
  112. <div class="contents">
  113. <p><code>#include &lt;<a class="el" href="_rotation_quat_constraint_part_8h_source.html">RotationQuatConstraintPart.h</a>&gt;</code></p>
  114. <table class="memberdecls">
  115. <tr class="heading"><td colspan="2"><h2 class="groupheader"><a id="pub-methods" name="pub-methods"></a>
  116. Public Member Functions</h2></td></tr>
  117. <tr class="memitem:a0c752c045f216b2d9c0570faf3f71c44" id="r_a0c752c045f216b2d9c0570faf3f71c44"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="#a0c752c045f216b2d9c0570faf3f71c44">CalculateConstraintProperties</a> (const <a class="el" href="class_body.html">Body</a> &amp;inBody1, <a class="el" href="_math_types_8h.html#af10dd31c5ad4acb62aba8025732597e6">Mat44Arg</a> inRotation1, const <a class="el" href="class_body.html">Body</a> &amp;inBody2, <a class="el" href="_math_types_8h.html#af10dd31c5ad4acb62aba8025732597e6">Mat44Arg</a> inRotation2, <a class="el" href="_math_types_8h.html#a3c723d55f34e02bc506abe3dfb7bd2aa">QuatArg</a> inInvInitialOrientation)</td></tr>
  118. <tr class="memdesc:a0c752c045f216b2d9c0570faf3f71c44"><td class="mdescLeft">&#160;</td><td class="mdescRight">Calculate properties used during the functions below. <br /></td></tr>
  119. <tr class="separator:a0c752c045f216b2d9c0570faf3f71c44"><td class="memSeparator" colspan="2">&#160;</td></tr>
  120. <tr class="memitem:a6fbaaa5c64ed9b01753780cbad3efb8b" id="r_a6fbaaa5c64ed9b01753780cbad3efb8b"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="#a6fbaaa5c64ed9b01753780cbad3efb8b">Deactivate</a> ()</td></tr>
  121. <tr class="memdesc:a6fbaaa5c64ed9b01753780cbad3efb8b"><td class="mdescLeft">&#160;</td><td class="mdescRight">Deactivate this constraint. <br /></td></tr>
  122. <tr class="separator:a6fbaaa5c64ed9b01753780cbad3efb8b"><td class="memSeparator" colspan="2">&#160;</td></tr>
  123. <tr class="memitem:ab38b8a217a4dc990ed58e9dc7210e2fc" id="r_ab38b8a217a4dc990ed58e9dc7210e2fc"><td class="memItemLeft" align="right" valign="top">bool&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="#ab38b8a217a4dc990ed58e9dc7210e2fc">IsActive</a> () const</td></tr>
  124. <tr class="memdesc:ab38b8a217a4dc990ed58e9dc7210e2fc"><td class="mdescLeft">&#160;</td><td class="mdescRight">Check if constraint is active. <br /></td></tr>
  125. <tr class="separator:ab38b8a217a4dc990ed58e9dc7210e2fc"><td class="memSeparator" colspan="2">&#160;</td></tr>
  126. <tr class="memitem:a05fa3097154059e8d7814370182a7aa5" id="r_a05fa3097154059e8d7814370182a7aa5"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="#a05fa3097154059e8d7814370182a7aa5">WarmStart</a> (<a class="el" href="class_body.html">Body</a> &amp;ioBody1, <a class="el" href="class_body.html">Body</a> &amp;ioBody2, float inWarmStartImpulseRatio)</td></tr>
  127. <tr class="memdesc:a05fa3097154059e8d7814370182a7aa5"><td class="mdescLeft">&#160;</td><td class="mdescRight">Must be called from the WarmStartVelocityConstraint call to apply the previous frame's impulses. <br /></td></tr>
  128. <tr class="separator:a05fa3097154059e8d7814370182a7aa5"><td class="memSeparator" colspan="2">&#160;</td></tr>
  129. <tr class="memitem:ad464b428f6994ee02ac203b29c561324" id="r_ad464b428f6994ee02ac203b29c561324"><td class="memItemLeft" align="right" valign="top">bool&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="#ad464b428f6994ee02ac203b29c561324">SolveVelocityConstraint</a> (<a class="el" href="class_body.html">Body</a> &amp;ioBody1, <a class="el" href="class_body.html">Body</a> &amp;ioBody2)</td></tr>
  130. <tr class="memdesc:ad464b428f6994ee02ac203b29c561324"><td class="mdescLeft">&#160;</td><td class="mdescRight">Iteratively update the velocity constraint. Makes sure d/dt C(...) = 0, where C is the constraint equation. <br /></td></tr>
  131. <tr class="separator:ad464b428f6994ee02ac203b29c561324"><td class="memSeparator" colspan="2">&#160;</td></tr>
  132. <tr class="memitem:a598d2320bf1b6d19985a183d06183f13" id="r_a598d2320bf1b6d19985a183d06183f13"><td class="memItemLeft" align="right" valign="top">bool&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="#a598d2320bf1b6d19985a183d06183f13">SolvePositionConstraint</a> (<a class="el" href="class_body.html">Body</a> &amp;ioBody1, <a class="el" href="class_body.html">Body</a> &amp;ioBody2, <a class="el" href="_math_types_8h.html#a3c723d55f34e02bc506abe3dfb7bd2aa">QuatArg</a> inInvInitialOrientation, float inBaumgarte) const</td></tr>
  133. <tr class="memdesc:a598d2320bf1b6d19985a183d06183f13"><td class="mdescLeft">&#160;</td><td class="mdescRight">Iteratively update the position constraint. Makes sure C(...) = 0. <br /></td></tr>
  134. <tr class="separator:a598d2320bf1b6d19985a183d06183f13"><td class="memSeparator" colspan="2">&#160;</td></tr>
  135. <tr class="memitem:a4aaed47e0905087e32e5dc82f6c4dca5" id="r_a4aaed47e0905087e32e5dc82f6c4dca5"><td class="memItemLeft" align="right" valign="top"><a class="el" href="class_vec3.html">Vec3</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="#a4aaed47e0905087e32e5dc82f6c4dca5">GetTotalLambda</a> () const</td></tr>
  136. <tr class="memdesc:a4aaed47e0905087e32e5dc82f6c4dca5"><td class="mdescLeft">&#160;</td><td class="mdescRight">Return lagrange multiplier. <br /></td></tr>
  137. <tr class="separator:a4aaed47e0905087e32e5dc82f6c4dca5"><td class="memSeparator" colspan="2">&#160;</td></tr>
  138. <tr class="memitem:a9ca6e071472fdc3e1ce31b115bfee6e4" id="r_a9ca6e071472fdc3e1ce31b115bfee6e4"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="#a9ca6e071472fdc3e1ce31b115bfee6e4">SaveState</a> (<a class="el" href="class_state_recorder.html">StateRecorder</a> &amp;inStream) const</td></tr>
  139. <tr class="memdesc:a9ca6e071472fdc3e1ce31b115bfee6e4"><td class="mdescLeft">&#160;</td><td class="mdescRight">Save state of this constraint part. <br /></td></tr>
  140. <tr class="separator:a9ca6e071472fdc3e1ce31b115bfee6e4"><td class="memSeparator" colspan="2">&#160;</td></tr>
  141. <tr class="memitem:a95e793a001df59cd2e8ea7e92c4f6263" id="r_a95e793a001df59cd2e8ea7e92c4f6263"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="#a95e793a001df59cd2e8ea7e92c4f6263">RestoreState</a> (<a class="el" href="class_state_recorder.html">StateRecorder</a> &amp;inStream)</td></tr>
  142. <tr class="memdesc:a95e793a001df59cd2e8ea7e92c4f6263"><td class="mdescLeft">&#160;</td><td class="mdescRight">Restore state of this constraint part. <br /></td></tr>
  143. <tr class="separator:a95e793a001df59cd2e8ea7e92c4f6263"><td class="memSeparator" colspan="2">&#160;</td></tr>
  144. </table><table class="memberdecls">
  145. <tr class="heading"><td colspan="2"><h2 class="groupheader"><a id="pub-static-methods" name="pub-static-methods"></a>
  146. Static Public Member Functions</h2></td></tr>
  147. <tr class="memitem:a8ab9f2a8f10bdbbe8000f7af5f0b7b5b" id="r_a8ab9f2a8f10bdbbe8000f7af5f0b7b5b"><td class="memItemLeft" align="right" valign="top">static <a class="el" href="class_quat.html">Quat</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="#a8ab9f2a8f10bdbbe8000f7af5f0b7b5b">sGetInvInitialOrientation</a> (const <a class="el" href="class_body.html">Body</a> &amp;inBody1, const <a class="el" href="class_body.html">Body</a> &amp;inBody2)</td></tr>
  148. <tr class="memdesc:a8ab9f2a8f10bdbbe8000f7af5f0b7b5b"><td class="mdescLeft">&#160;</td><td class="mdescRight">Return inverse of initial rotation from body 1 to body 2 in body 1 space. <br /></td></tr>
  149. <tr class="separator:a8ab9f2a8f10bdbbe8000f7af5f0b7b5b"><td class="memSeparator" colspan="2">&#160;</td></tr>
  150. </table>
  151. <a name="details" id="details"></a><h2 class="groupheader">Detailed Description</h2>
  152. <div class="textblock"><p>Quaternion based constraint that constrains rotation around all axis so that only translation is allowed.</p>
  153. <p>NOTE: This constraint part is more expensive than the <a class="el" href="class_rotation_euler_constraint_part.html">RotationEulerConstraintPart</a> and slightly more correct since <a class="el" href="class_rotation_euler_constraint_part.html#ab2276b37dd0f8eaf4229469def2627b6" title="Iteratively update the position constraint. Makes sure C(...) = 0.">RotationEulerConstraintPart::SolvePositionConstraint</a> contains an approximation. In practice the difference is small, so the <a class="el" href="class_rotation_euler_constraint_part.html">RotationEulerConstraintPart</a> is probably the better choice.</p>
  154. <p>Rotation is fixed between bodies like this:</p>
  155. <p>q2 = q1 r0</p>
  156. <p>Where: q1, q2 = world space quaternions representing rotation of body 1 and 2. r0 = initial rotation between bodies in local space of body 1, this can be calculated by:</p>
  157. <p>q20 = q10 r0 &lt;=&gt; r0 = q10^* q20</p>
  158. <p>Where: q10, q20 = initial world space rotations of body 1 and 2. q10^* = conjugate of quaternion q10 (which is the same as the inverse for a unit quaternion)</p>
  159. <p>We exclusively use the conjugate below:</p>
  160. <p>r0^* = q20^* q10</p>
  161. <p>The error in the rotation is (in local space of body 1):</p>
  162. <p>q2 = q1 error r0 &lt;=&gt; error = q1^* q2 r0^*</p>
  163. <p>The imaginary part of the quaternion represents the rotation axis * sin(angle / 2). The real part of the quaternion does not add any additional information (we know the quaternion in normalized) and we're removing 3 degrees of freedom so we want 3 parameters. Therefore we define the constraint equation like:</p>
  164. <p>C = A q1^* q2 r0^* = 0</p>
  165. <p>Where (if you write a quaternion as [real-part, i-part, j-part, k-part]): </p><pre class="fragment"> [0, 1, 0, 0]
  166. A = [0, 0, 1, 0]
  167. [0, 0, 0, 1]
  168. </pre><p>or in our case since we store a quaternion like [i-part, j-part, k-part, real-part]: </p><pre class="fragment"> [1, 0, 0, 0]
  169. A = [0, 1, 0, 0]
  170. [0, 0, 1, 0]
  171. </pre><p>Time derivative:</p>
  172. <p>d/dt C = A (q1^* d/dt(q2) + d/dt(q1^*) q2) r0^* = A (q1^* (1/2 W2 q2) + (1/2 W1 q1)^* q2) r0^* = 1/2 A (q1^* W2 q2 + q1^* W1^* q2) r0^* = 1/2 A (q1^* W2 q2 - q1^* W1 * q2) r0^* = 1/2 A ML(q1^*) MR(q2 r0^*) (W2 - W1) = 1/2 A ML(q1^*) MR(q2 r0^*) A^T (w2 - w1)</p>
  173. <p>Where: W1 = [0, w1], W2 = [0, w2] (converting angular velocity to imaginary part of quaternion). w1, w2 = angular velocity of body 1 and 2. d/dt(q) = 1/2 W q (time derivative of a quaternion). W^* = -W (conjugate negates angular velocity as quaternion). ML(q): 4x4 matrix so that q * p = ML(q) * p, where q and p are quaternions. MR(p): 4x4 matrix so that q * p = MR(p) * q, where q and p are quaternions. A^T: Transpose of A.</p>
  174. <p>Jacobian:</p>
  175. <p>J = [0, -1/2 A ML(q1^*) MR(q2 r0^*) A^T, 0, 1/2 A ML(q1^*) MR(q2 r0^*) A^T] = [0, -JP, 0, JP]</p>
  176. <p>Suggested reading:</p><ul>
  177. <li>3D <a class="el" href="class_constraint.html" title="Base class for all physics constraints. A constraint removes one or more degrees of freedom for a rig...">Constraint</a> Derivations for Impulse Solvers - Marijn Tamis</li>
  178. <li>Game Physics Pearls - Section 9 - Quaternion Based Constraints - Claude Lacoursiere </li>
  179. </ul>
  180. </div><h2 class="groupheader">Member Function Documentation</h2>
  181. <a id="a0c752c045f216b2d9c0570faf3f71c44" name="a0c752c045f216b2d9c0570faf3f71c44"></a>
  182. <h2 class="memtitle"><span class="permalink"><a href="#a0c752c045f216b2d9c0570faf3f71c44">&#9670;&#160;</a></span>CalculateConstraintProperties()</h2>
  183. <div class="memitem">
  184. <div class="memproto">
  185. <table class="mlabels">
  186. <tr>
  187. <td class="mlabels-left">
  188. <table class="memname">
  189. <tr>
  190. <td class="memname">void RotationQuatConstraintPart::CalculateConstraintProperties </td>
  191. <td>(</td>
  192. <td class="paramtype">const <a class="el" href="class_body.html">Body</a> &amp;</td> <td class="paramname"><span class="paramname"><em>inBody1</em></span>, </td>
  193. </tr>
  194. <tr>
  195. <td class="paramkey"></td>
  196. <td></td>
  197. <td class="paramtype"><a class="el" href="_math_types_8h.html#af10dd31c5ad4acb62aba8025732597e6">Mat44Arg</a></td> <td class="paramname"><span class="paramname"><em>inRotation1</em></span>, </td>
  198. </tr>
  199. <tr>
  200. <td class="paramkey"></td>
  201. <td></td>
  202. <td class="paramtype">const <a class="el" href="class_body.html">Body</a> &amp;</td> <td class="paramname"><span class="paramname"><em>inBody2</em></span>, </td>
  203. </tr>
  204. <tr>
  205. <td class="paramkey"></td>
  206. <td></td>
  207. <td class="paramtype"><a class="el" href="_math_types_8h.html#af10dd31c5ad4acb62aba8025732597e6">Mat44Arg</a></td> <td class="paramname"><span class="paramname"><em>inRotation2</em></span>, </td>
  208. </tr>
  209. <tr>
  210. <td class="paramkey"></td>
  211. <td></td>
  212. <td class="paramtype"><a class="el" href="_math_types_8h.html#a3c723d55f34e02bc506abe3dfb7bd2aa">QuatArg</a></td> <td class="paramname"><span class="paramname"><em>inInvInitialOrientation</em></span>&#160;)</td>
  213. </tr>
  214. </table>
  215. </td>
  216. <td class="mlabels-right">
  217. <span class="mlabels"><span class="mlabel">inline</span></span> </td>
  218. </tr>
  219. </table>
  220. </div><div class="memdoc">
  221. <p>Calculate properties used during the functions below. </p>
  222. </div>
  223. </div>
  224. <a id="a6fbaaa5c64ed9b01753780cbad3efb8b" name="a6fbaaa5c64ed9b01753780cbad3efb8b"></a>
  225. <h2 class="memtitle"><span class="permalink"><a href="#a6fbaaa5c64ed9b01753780cbad3efb8b">&#9670;&#160;</a></span>Deactivate()</h2>
  226. <div class="memitem">
  227. <div class="memproto">
  228. <table class="mlabels">
  229. <tr>
  230. <td class="mlabels-left">
  231. <table class="memname">
  232. <tr>
  233. <td class="memname">void RotationQuatConstraintPart::Deactivate </td>
  234. <td>(</td>
  235. <td class="paramname"><span class="paramname"><em></em></span></td><td>)</td>
  236. <td></td>
  237. </tr>
  238. </table>
  239. </td>
  240. <td class="mlabels-right">
  241. <span class="mlabels"><span class="mlabel">inline</span></span> </td>
  242. </tr>
  243. </table>
  244. </div><div class="memdoc">
  245. <p>Deactivate this constraint. </p>
  246. </div>
  247. </div>
  248. <a id="a4aaed47e0905087e32e5dc82f6c4dca5" name="a4aaed47e0905087e32e5dc82f6c4dca5"></a>
  249. <h2 class="memtitle"><span class="permalink"><a href="#a4aaed47e0905087e32e5dc82f6c4dca5">&#9670;&#160;</a></span>GetTotalLambda()</h2>
  250. <div class="memitem">
  251. <div class="memproto">
  252. <table class="mlabels">
  253. <tr>
  254. <td class="mlabels-left">
  255. <table class="memname">
  256. <tr>
  257. <td class="memname"><a class="el" href="class_vec3.html">Vec3</a> RotationQuatConstraintPart::GetTotalLambda </td>
  258. <td>(</td>
  259. <td class="paramname"><span class="paramname"><em></em></span></td><td>)</td>
  260. <td> const</td>
  261. </tr>
  262. </table>
  263. </td>
  264. <td class="mlabels-right">
  265. <span class="mlabels"><span class="mlabel">inline</span></span> </td>
  266. </tr>
  267. </table>
  268. </div><div class="memdoc">
  269. <p>Return lagrange multiplier. </p>
  270. </div>
  271. </div>
  272. <a id="ab38b8a217a4dc990ed58e9dc7210e2fc" name="ab38b8a217a4dc990ed58e9dc7210e2fc"></a>
  273. <h2 class="memtitle"><span class="permalink"><a href="#ab38b8a217a4dc990ed58e9dc7210e2fc">&#9670;&#160;</a></span>IsActive()</h2>
  274. <div class="memitem">
  275. <div class="memproto">
  276. <table class="mlabels">
  277. <tr>
  278. <td class="mlabels-left">
  279. <table class="memname">
  280. <tr>
  281. <td class="memname">bool RotationQuatConstraintPart::IsActive </td>
  282. <td>(</td>
  283. <td class="paramname"><span class="paramname"><em></em></span></td><td>)</td>
  284. <td> const</td>
  285. </tr>
  286. </table>
  287. </td>
  288. <td class="mlabels-right">
  289. <span class="mlabels"><span class="mlabel">inline</span></span> </td>
  290. </tr>
  291. </table>
  292. </div><div class="memdoc">
  293. <p>Check if constraint is active. </p>
  294. </div>
  295. </div>
  296. <a id="a95e793a001df59cd2e8ea7e92c4f6263" name="a95e793a001df59cd2e8ea7e92c4f6263"></a>
  297. <h2 class="memtitle"><span class="permalink"><a href="#a95e793a001df59cd2e8ea7e92c4f6263">&#9670;&#160;</a></span>RestoreState()</h2>
  298. <div class="memitem">
  299. <div class="memproto">
  300. <table class="mlabels">
  301. <tr>
  302. <td class="mlabels-left">
  303. <table class="memname">
  304. <tr>
  305. <td class="memname">void RotationQuatConstraintPart::RestoreState </td>
  306. <td>(</td>
  307. <td class="paramtype"><a class="el" href="class_state_recorder.html">StateRecorder</a> &amp;</td> <td class="paramname"><span class="paramname"><em>inStream</em></span></td><td>)</td>
  308. <td></td>
  309. </tr>
  310. </table>
  311. </td>
  312. <td class="mlabels-right">
  313. <span class="mlabels"><span class="mlabel">inline</span></span> </td>
  314. </tr>
  315. </table>
  316. </div><div class="memdoc">
  317. <p>Restore state of this constraint part. </p>
  318. </div>
  319. </div>
  320. <a id="a9ca6e071472fdc3e1ce31b115bfee6e4" name="a9ca6e071472fdc3e1ce31b115bfee6e4"></a>
  321. <h2 class="memtitle"><span class="permalink"><a href="#a9ca6e071472fdc3e1ce31b115bfee6e4">&#9670;&#160;</a></span>SaveState()</h2>
  322. <div class="memitem">
  323. <div class="memproto">
  324. <table class="mlabels">
  325. <tr>
  326. <td class="mlabels-left">
  327. <table class="memname">
  328. <tr>
  329. <td class="memname">void RotationQuatConstraintPart::SaveState </td>
  330. <td>(</td>
  331. <td class="paramtype"><a class="el" href="class_state_recorder.html">StateRecorder</a> &amp;</td> <td class="paramname"><span class="paramname"><em>inStream</em></span></td><td>)</td>
  332. <td> const</td>
  333. </tr>
  334. </table>
  335. </td>
  336. <td class="mlabels-right">
  337. <span class="mlabels"><span class="mlabel">inline</span></span> </td>
  338. </tr>
  339. </table>
  340. </div><div class="memdoc">
  341. <p>Save state of this constraint part. </p>
  342. </div>
  343. </div>
  344. <a id="a8ab9f2a8f10bdbbe8000f7af5f0b7b5b" name="a8ab9f2a8f10bdbbe8000f7af5f0b7b5b"></a>
  345. <h2 class="memtitle"><span class="permalink"><a href="#a8ab9f2a8f10bdbbe8000f7af5f0b7b5b">&#9670;&#160;</a></span>sGetInvInitialOrientation()</h2>
  346. <div class="memitem">
  347. <div class="memproto">
  348. <table class="mlabels">
  349. <tr>
  350. <td class="mlabels-left">
  351. <table class="memname">
  352. <tr>
  353. <td class="memname">static <a class="el" href="class_quat.html">Quat</a> RotationQuatConstraintPart::sGetInvInitialOrientation </td>
  354. <td>(</td>
  355. <td class="paramtype">const <a class="el" href="class_body.html">Body</a> &amp;</td> <td class="paramname"><span class="paramname"><em>inBody1</em></span>, </td>
  356. </tr>
  357. <tr>
  358. <td class="paramkey"></td>
  359. <td></td>
  360. <td class="paramtype">const <a class="el" href="class_body.html">Body</a> &amp;</td> <td class="paramname"><span class="paramname"><em>inBody2</em></span>&#160;)</td>
  361. </tr>
  362. </table>
  363. </td>
  364. <td class="mlabels-right">
  365. <span class="mlabels"><span class="mlabel">inline</span><span class="mlabel">static</span></span> </td>
  366. </tr>
  367. </table>
  368. </div><div class="memdoc">
  369. <p>Return inverse of initial rotation from body 1 to body 2 in body 1 space. </p>
  370. </div>
  371. </div>
  372. <a id="a598d2320bf1b6d19985a183d06183f13" name="a598d2320bf1b6d19985a183d06183f13"></a>
  373. <h2 class="memtitle"><span class="permalink"><a href="#a598d2320bf1b6d19985a183d06183f13">&#9670;&#160;</a></span>SolvePositionConstraint()</h2>
  374. <div class="memitem">
  375. <div class="memproto">
  376. <table class="mlabels">
  377. <tr>
  378. <td class="mlabels-left">
  379. <table class="memname">
  380. <tr>
  381. <td class="memname">bool RotationQuatConstraintPart::SolvePositionConstraint </td>
  382. <td>(</td>
  383. <td class="paramtype"><a class="el" href="class_body.html">Body</a> &amp;</td> <td class="paramname"><span class="paramname"><em>ioBody1</em></span>, </td>
  384. </tr>
  385. <tr>
  386. <td class="paramkey"></td>
  387. <td></td>
  388. <td class="paramtype"><a class="el" href="class_body.html">Body</a> &amp;</td> <td class="paramname"><span class="paramname"><em>ioBody2</em></span>, </td>
  389. </tr>
  390. <tr>
  391. <td class="paramkey"></td>
  392. <td></td>
  393. <td class="paramtype"><a class="el" href="_math_types_8h.html#a3c723d55f34e02bc506abe3dfb7bd2aa">QuatArg</a></td> <td class="paramname"><span class="paramname"><em>inInvInitialOrientation</em></span>, </td>
  394. </tr>
  395. <tr>
  396. <td class="paramkey"></td>
  397. <td></td>
  398. <td class="paramtype">float</td> <td class="paramname"><span class="paramname"><em>inBaumgarte</em></span>&#160;) const</td>
  399. </tr>
  400. </table>
  401. </td>
  402. <td class="mlabels-right">
  403. <span class="mlabels"><span class="mlabel">inline</span></span> </td>
  404. </tr>
  405. </table>
  406. </div><div class="memdoc">
  407. <p>Iteratively update the position constraint. Makes sure C(...) = 0. </p>
  408. </div>
  409. </div>
  410. <a id="ad464b428f6994ee02ac203b29c561324" name="ad464b428f6994ee02ac203b29c561324"></a>
  411. <h2 class="memtitle"><span class="permalink"><a href="#ad464b428f6994ee02ac203b29c561324">&#9670;&#160;</a></span>SolveVelocityConstraint()</h2>
  412. <div class="memitem">
  413. <div class="memproto">
  414. <table class="mlabels">
  415. <tr>
  416. <td class="mlabels-left">
  417. <table class="memname">
  418. <tr>
  419. <td class="memname">bool RotationQuatConstraintPart::SolveVelocityConstraint </td>
  420. <td>(</td>
  421. <td class="paramtype"><a class="el" href="class_body.html">Body</a> &amp;</td> <td class="paramname"><span class="paramname"><em>ioBody1</em></span>, </td>
  422. </tr>
  423. <tr>
  424. <td class="paramkey"></td>
  425. <td></td>
  426. <td class="paramtype"><a class="el" href="class_body.html">Body</a> &amp;</td> <td class="paramname"><span class="paramname"><em>ioBody2</em></span>&#160;)</td>
  427. </tr>
  428. </table>
  429. </td>
  430. <td class="mlabels-right">
  431. <span class="mlabels"><span class="mlabel">inline</span></span> </td>
  432. </tr>
  433. </table>
  434. </div><div class="memdoc">
  435. <p>Iteratively update the velocity constraint. Makes sure d/dt C(...) = 0, where C is the constraint equation. </p>
  436. </div>
  437. </div>
  438. <a id="a05fa3097154059e8d7814370182a7aa5" name="a05fa3097154059e8d7814370182a7aa5"></a>
  439. <h2 class="memtitle"><span class="permalink"><a href="#a05fa3097154059e8d7814370182a7aa5">&#9670;&#160;</a></span>WarmStart()</h2>
  440. <div class="memitem">
  441. <div class="memproto">
  442. <table class="mlabels">
  443. <tr>
  444. <td class="mlabels-left">
  445. <table class="memname">
  446. <tr>
  447. <td class="memname">void RotationQuatConstraintPart::WarmStart </td>
  448. <td>(</td>
  449. <td class="paramtype"><a class="el" href="class_body.html">Body</a> &amp;</td> <td class="paramname"><span class="paramname"><em>ioBody1</em></span>, </td>
  450. </tr>
  451. <tr>
  452. <td class="paramkey"></td>
  453. <td></td>
  454. <td class="paramtype"><a class="el" href="class_body.html">Body</a> &amp;</td> <td class="paramname"><span class="paramname"><em>ioBody2</em></span>, </td>
  455. </tr>
  456. <tr>
  457. <td class="paramkey"></td>
  458. <td></td>
  459. <td class="paramtype">float</td> <td class="paramname"><span class="paramname"><em>inWarmStartImpulseRatio</em></span>&#160;)</td>
  460. </tr>
  461. </table>
  462. </td>
  463. <td class="mlabels-right">
  464. <span class="mlabels"><span class="mlabel">inline</span></span> </td>
  465. </tr>
  466. </table>
  467. </div><div class="memdoc">
  468. <p>Must be called from the WarmStartVelocityConstraint call to apply the previous frame's impulses. </p>
  469. </div>
  470. </div>
  471. <hr/>The documentation for this class was generated from the following file:<ul>
  472. <li>Jolt/Physics/Constraints/ConstraintPart/<a class="el" href="_rotation_quat_constraint_part_8h_source.html">RotationQuatConstraintPart.h</a></li>
  473. </ul>
  474. </div><!-- contents -->
  475. </div><!-- doc-content -->
  476. <!-- start footer part -->
  477. <div id="nav-path" class="navpath"><!-- id is needed for treeview function! -->
  478. <ul>
  479. <li class="navelem"><a class="el" href="class_rotation_quat_constraint_part.html">RotationQuatConstraintPart</a></li>
  480. <li class="footer">Generated by <a href="https://www.doxygen.org/index.html"><img class="footer" src="doxygen.svg" width="104" height="31" alt="doxygen"/></a> 1.12.0 </li>
  481. </ul>
  482. </div>
  483. </body>
  484. </html>