-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path_physics_body_8h_source.html
96 lines (96 loc) · 39.1 KB
/
_physics_body_8h_source.html
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
<!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.13"/>
<meta name="viewport" content="width=device-width, initial-scale=1"/>
<title>Gamedev Framework (gf): PhysicsBody.h Source File</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>
<script type="text/x-mathjax-config">
MathJax.Hub.Config({
extensions: ["tex2jax.js"],
jax: ["input/TeX","output/HTML-CSS"],
});
</script><script type="text/javascript" src="http://cdn.mathjax.org/mathjax/latest/MathJax.js"></script>
<link href="doxygen.css" rel="stylesheet" type="text/css" />
<link href="custom.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="gf_logo.png"/></td>
<td id="projectalign" style="padding-left: 0.5em;">
<div id="projectname">Gamedev Framework (gf)
 <span id="projectnumber">0.14.0</span>
</div>
<div id="projectbrief">A C++14 framework for 2D games</div>
</td>
</tr>
</tbody>
</table>
</div>
<!-- end header part -->
<!-- Generated by Doxygen 1.8.13 -->
<script type="text/javascript" src="menudata.js"></script>
<script type="text/javascript" src="menu.js"></script>
<script type="text/javascript">
$(function() {
initMenu('',false,false,'search.php','Search');
});
</script>
<div id="main-nav"></div>
<div id="nav-path" class="navpath">
<ul>
<li class="navelem"><a class="el" href="dir_d44c64559bbebec7f509842c48db8b23.html">include</a></li><li class="navelem"><a class="el" href="dir_6d069d519ae9d12fa11dd8e685586b60.html">gf</a></li> </ul>
</div>
</div><!-- top -->
<div class="header">
<div class="headertitle">
<div class="title">PhysicsBody.h</div> </div>
</div><!--header-->
<div class="contents">
<div class="fragment"><div class="line"><a name="l00001"></a><span class="lineno"> 1</span> <span class="comment">/*</span></div><div class="line"><a name="l00002"></a><span class="lineno"> 2</span> <span class="comment"> * Gamedev Framework (gf)</span></div><div class="line"><a name="l00003"></a><span class="lineno"> 3</span> <span class="comment"> * Copyright (C) 2016-2019 Julien Bernard</span></div><div class="line"><a name="l00004"></a><span class="lineno"> 4</span> <span class="comment"> *</span></div><div class="line"><a name="l00005"></a><span class="lineno"> 5</span> <span class="comment"> * This software is provided 'as-is', without any express or implied</span></div><div class="line"><a name="l00006"></a><span class="lineno"> 6</span> <span class="comment"> * warranty. In no event will the authors be held liable for any damages</span></div><div class="line"><a name="l00007"></a><span class="lineno"> 7</span> <span class="comment"> * arising from the use of this software.</span></div><div class="line"><a name="l00008"></a><span class="lineno"> 8</span> <span class="comment"> *</span></div><div class="line"><a name="l00009"></a><span class="lineno"> 9</span> <span class="comment"> * Permission is granted to anyone to use this software for any purpose,</span></div><div class="line"><a name="l00010"></a><span class="lineno"> 10</span> <span class="comment"> * including commercial applications, and to alter it and redistribute it</span></div><div class="line"><a name="l00011"></a><span class="lineno"> 11</span> <span class="comment"> * freely, subject to the following restrictions:</span></div><div class="line"><a name="l00012"></a><span class="lineno"> 12</span> <span class="comment"> *</span></div><div class="line"><a name="l00013"></a><span class="lineno"> 13</span> <span class="comment"> * 1. The origin of this software must not be misrepresented; you must not</span></div><div class="line"><a name="l00014"></a><span class="lineno"> 14</span> <span class="comment"> * claim that you wrote the original software. If you use this software</span></div><div class="line"><a name="l00015"></a><span class="lineno"> 15</span> <span class="comment"> * in a product, an acknowledgment in the product documentation would be</span></div><div class="line"><a name="l00016"></a><span class="lineno"> 16</span> <span class="comment"> * appreciated but is not required.</span></div><div class="line"><a name="l00017"></a><span class="lineno"> 17</span> <span class="comment"> * 2. Altered source versions must be plainly marked as such, and must not be</span></div><div class="line"><a name="l00018"></a><span class="lineno"> 18</span> <span class="comment"> * misrepresented as being the original software.</span></div><div class="line"><a name="l00019"></a><span class="lineno"> 19</span> <span class="comment"> * 3. This notice may not be removed or altered from any source distribution.</span></div><div class="line"><a name="l00020"></a><span class="lineno"> 20</span> <span class="comment"> */</span></div><div class="line"><a name="l00021"></a><span class="lineno"> 21</span> <span class="preprocessor">#ifndef GF_PHYSICS_BODY_H</span></div><div class="line"><a name="l00022"></a><span class="lineno"> 22</span> <span class="preprocessor">#define GF_PHYSICS_BODY_H</span></div><div class="line"><a name="l00023"></a><span class="lineno"> 23</span> </div><div class="line"><a name="l00024"></a><span class="lineno"> 24</span> <span class="preprocessor">#include <memory></span></div><div class="line"><a name="l00025"></a><span class="lineno"> 25</span> </div><div class="line"><a name="l00026"></a><span class="lineno"> 26</span> <span class="preprocessor">#include "Circ.h"</span></div><div class="line"><a name="l00027"></a><span class="lineno"> 27</span> <span class="preprocessor">#include "PhysicsGeometry.h"</span></div><div class="line"><a name="l00028"></a><span class="lineno"> 28</span> <span class="preprocessor">#include "Polygon.h"</span></div><div class="line"><a name="l00029"></a><span class="lineno"> 29</span> <span class="preprocessor">#include "Rect.h"</span></div><div class="line"><a name="l00030"></a><span class="lineno"> 30</span> <span class="preprocessor">#include "Time.h"</span></div><div class="line"><a name="l00031"></a><span class="lineno"> 31</span> <span class="preprocessor">#include "Transform.h"</span></div><div class="line"><a name="l00032"></a><span class="lineno"> 32</span> <span class="preprocessor">#include "Vector.h"</span></div><div class="line"><a name="l00033"></a><span class="lineno"> 33</span> </div><div class="line"><a name="l00034"></a><span class="lineno"> 34</span> <span class="keyword">namespace </span><a class="code" href="namespacegf.html">gf</a> {</div><div class="line"><a name="l00035"></a><span class="lineno"> 35</span> <span class="preprocessor">#ifndef DOXYGEN_SHOULD_SKIP_THIS</span></div><div class="line"><a name="l00036"></a><span class="lineno"> 36</span> <span class="keyword">inline</span> <span class="keyword">namespace </span>v1 {</div><div class="line"><a name="l00037"></a><span class="lineno"> 37</span> <span class="preprocessor">#endif</span></div><div class="line"><a name="l00038"></a><span class="lineno"> 38</span> </div><div class="line"><a name="l00039"></a><span class="lineno"> 39</span>  <span class="keyword">struct </span>RenderStates;</div><div class="line"><a name="l00040"></a><span class="lineno"> 40</span>  <span class="keyword">class </span>RenderTarget;</div><div class="line"><a name="l00041"></a><span class="lineno"> 41</span>  <span class="keyword">struct </span>Penetration;</div><div class="line"><a name="l00042"></a><span class="lineno"> 42</span> </div><div class="line"><a name="l00056"></a><span class="lineno"><a class="line" href="classgf_1_1_physics_body.html"> 56</a></span>  <span class="keyword">class </span>GF_API <a class="code" href="classgf_1_1_physics_body.html">PhysicsBody</a> {</div><div class="line"><a name="l00057"></a><span class="lineno"> 57</span>  <span class="keyword">public</span>:</div><div class="line"><a name="l00061"></a><span class="lineno"><a class="line" href="classgf_1_1_physics_body.html#a028e27932aab1c36d31ae18b6304702f"> 61</a></span>  <span class="keyword">enum</span> <a class="code" href="classgf_1_1_physics_body.html#a028e27932aab1c36d31ae18b6304702f">Type</a> {</div><div class="line"><a name="l00062"></a><span class="lineno"><a class="line" href="classgf_1_1_physics_body.html#a028e27932aab1c36d31ae18b6304702fafa32023dee2aa3ab1b165cc6807fad10"> 62</a></span>  <a class="code" href="classgf_1_1_physics_body.html#a028e27932aab1c36d31ae18b6304702fafa32023dee2aa3ab1b165cc6807fad10">Static</a>, </div><div class="line"><a name="l00063"></a><span class="lineno"><a class="line" href="classgf_1_1_physics_body.html#a028e27932aab1c36d31ae18b6304702fa79a18ed43dd064c7e2ba118afdc59df4"> 63</a></span>  <a class="code" href="classgf_1_1_physics_body.html#a028e27932aab1c36d31ae18b6304702fa79a18ed43dd064c7e2ba118afdc59df4">Dynamic</a>, </div><div class="line"><a name="l00064"></a><span class="lineno"> 64</span>  };</div><div class="line"><a name="l00065"></a><span class="lineno"> 65</span> </div><div class="line"><a name="l00072"></a><span class="lineno"> 72</span>  <a class="code" href="classgf_1_1_physics_body.html">PhysicsBody</a>(<span class="keyword">const</span> <a class="code" href="classgf_1_1_physics_geometry.html">PhysicsGeometry</a>& geometry, <a class="code" href="classgf_1_1_physics_body.html#a028e27932aab1c36d31ae18b6304702f">Type</a> type = <a class="code" href="group__graphics.html#gga6a42c4039729410b3839e01afe754719a971fd8cc345d8bd9f92e9f7d88fdf20c">Dynamic</a>);</div><div class="line"><a name="l00073"></a><span class="lineno"> 73</span> </div><div class="line"><a name="l00079"></a><span class="lineno"><a class="line" href="classgf_1_1_physics_body.html#a40bc7b5e0effcdb56599fd45d5b44327"> 79</a></span>  <a class="code" href="classgf_1_1_physics_body.html#a028e27932aab1c36d31ae18b6304702f">Type</a> <a class="code" href="classgf_1_1_physics_body.html#a40bc7b5e0effcdb56599fd45d5b44327">getType</a>()<span class="keyword"> const </span>{</div><div class="line"><a name="l00080"></a><span class="lineno"> 80</span>  <span class="keywordflow">return</span> m_type;</div><div class="line"><a name="l00081"></a><span class="lineno"> 81</span>  }</div><div class="line"><a name="l00082"></a><span class="lineno"> 82</span> </div><div class="line"><a name="l00088"></a><span class="lineno"> 88</span>  <span class="keywordtype">void</span> step(<span class="keywordtype">float</span> dt);</div><div class="line"><a name="l00089"></a><span class="lineno"> 89</span> </div><div class="line"><a name="l00098"></a><span class="lineno"> 98</span>  <span class="keywordtype">void</span> render(<a class="code" href="classgf_1_1_render_target.html">RenderTarget</a>& target, <span class="keyword">const</span> <a class="code" href="structgf_1_1_render_states.html">RenderStates</a>& states) <span class="keyword">const</span>;</div><div class="line"><a name="l00099"></a><span class="lineno"> 99</span> </div><div class="line"><a name="l00110"></a><span class="lineno"><a class="line" href="classgf_1_1_physics_body.html#a97acccff218d1c116937ed4be17247ca"> 110</a></span>  <a class="code" href="structgf_1_1_vector.html">Vector2f</a> <a class="code" href="classgf_1_1_physics_body.html#a97acccff218d1c116937ed4be17247ca">getPosition</a>()<span class="keyword"> const </span>{</div><div class="line"><a name="l00111"></a><span class="lineno"> 111</span>  <span class="keywordflow">return</span> m_position;</div><div class="line"><a name="l00112"></a><span class="lineno"> 112</span>  }</div><div class="line"><a name="l00113"></a><span class="lineno"> 113</span> </div><div class="line"><a name="l00119"></a><span class="lineno"> 119</span>  <span class="keywordtype">void</span> setPosition(<a class="code" href="structgf_1_1_vector.html">Vector2f</a> position);</div><div class="line"><a name="l00120"></a><span class="lineno"> 120</span> </div><div class="line"><a name="l00126"></a><span class="lineno"> 126</span>  <span class="keywordtype">void</span> move(<a class="code" href="structgf_1_1_vector.html">Vector2f</a> offset);</div><div class="line"><a name="l00127"></a><span class="lineno"> 127</span> </div><div class="line"><a name="l00133"></a><span class="lineno"><a class="line" href="classgf_1_1_physics_body.html#ad32902adfefc0c26d55963afdadd15c9"> 133</a></span>  <a class="code" href="structgf_1_1_vector.html">Vector2f</a> <a class="code" href="classgf_1_1_physics_body.html#ad32902adfefc0c26d55963afdadd15c9">getLinearVelocity</a>()<span class="keyword"> const </span>{</div><div class="line"><a name="l00134"></a><span class="lineno"> 134</span>  <span class="keywordflow">return</span> m_linearVelocity;</div><div class="line"><a name="l00135"></a><span class="lineno"> 135</span>  }</div><div class="line"><a name="l00136"></a><span class="lineno"> 136</span> </div><div class="line"><a name="l00142"></a><span class="lineno"><a class="line" href="classgf_1_1_physics_body.html#a123a92093c38edbed20bc93fde099d60"> 142</a></span>  <span class="keywordtype">void</span> <a class="code" href="classgf_1_1_physics_body.html#a123a92093c38edbed20bc93fde099d60">setLinearVelocity</a>(<a class="code" href="structgf_1_1_vector.html">Vector2f</a> velocity) {</div><div class="line"><a name="l00143"></a><span class="lineno"> 143</span>  m_linearVelocity = velocity;</div><div class="line"><a name="l00144"></a><span class="lineno"> 144</span>  }</div><div class="line"><a name="l00145"></a><span class="lineno"> 145</span> </div><div class="line"><a name="l00153"></a><span class="lineno"> 153</span>  <span class="keywordtype">void</span> applyLinearImpulse(<a class="code" href="structgf_1_1_vector.html">Vector2f</a> impulse);</div><div class="line"><a name="l00154"></a><span class="lineno"> 154</span> </div><div class="line"><a name="l00160"></a><span class="lineno"><a class="line" href="classgf_1_1_physics_body.html#a2b1db15fa14af45c45eb50adff2e8f7e"> 160</a></span>  <a class="code" href="structgf_1_1_vector.html">Vector2f</a> <a class="code" href="classgf_1_1_physics_body.html#a2b1db15fa14af45c45eb50adff2e8f7e">getAcceleration</a>()<span class="keyword"> const </span>{</div><div class="line"><a name="l00161"></a><span class="lineno"> 161</span>  <span class="keywordflow">return</span> m_acceleration;</div><div class="line"><a name="l00162"></a><span class="lineno"> 162</span>  }</div><div class="line"><a name="l00163"></a><span class="lineno"> 163</span> </div><div class="line"><a name="l00171"></a><span class="lineno"> 171</span>  <span class="keywordtype">void</span> applyForce(<a class="code" href="structgf_1_1_vector.html">Vector2f</a> force);</div><div class="line"><a name="l00172"></a><span class="lineno"> 172</span> </div><div class="line"><a name="l00178"></a><span class="lineno"><a class="line" href="classgf_1_1_physics_body.html#af9f2052aed49bc2a809d6678806543cd"> 178</a></span>  <span class="keywordtype">float</span> <a class="code" href="classgf_1_1_physics_body.html#af9f2052aed49bc2a809d6678806543cd">getAngle</a>()<span class="keyword"> const </span>{</div><div class="line"><a name="l00179"></a><span class="lineno"> 179</span>  <span class="keywordflow">return</span> m_angle;</div><div class="line"><a name="l00180"></a><span class="lineno"> 180</span>  }</div><div class="line"><a name="l00181"></a><span class="lineno"> 181</span> </div><div class="line"><a name="l00187"></a><span class="lineno"><a class="line" href="classgf_1_1_physics_body.html#aa788e11a971227be18ced4fadcfeefe3"> 187</a></span>  <span class="keywordtype">void</span> <a class="code" href="classgf_1_1_physics_body.html#aa788e11a971227be18ced4fadcfeefe3">setAngle</a>(<span class="keywordtype">float</span> <a class="code" href="group__core.html#ga96c554e4534b63fd34ac457d563e7c32">angle</a>) {</div><div class="line"><a name="l00188"></a><span class="lineno"> 188</span>  m_angle = <a class="code" href="group__core.html#ga96c554e4534b63fd34ac457d563e7c32">angle</a>;</div><div class="line"><a name="l00189"></a><span class="lineno"> 189</span>  }</div><div class="line"><a name="l00190"></a><span class="lineno"> 190</span> </div><div class="line"><a name="l00196"></a><span class="lineno"><a class="line" href="classgf_1_1_physics_body.html#a042fab2ae6fe4695a495cafbf3421b93"> 196</a></span>  <span class="keywordtype">void</span> <a class="code" href="classgf_1_1_physics_body.html#a042fab2ae6fe4695a495cafbf3421b93">turn</a>(<span class="keywordtype">float</span> arc) {</div><div class="line"><a name="l00197"></a><span class="lineno"> 197</span>  m_angle += arc;</div><div class="line"><a name="l00198"></a><span class="lineno"> 198</span>  }</div><div class="line"><a name="l00199"></a><span class="lineno"> 199</span> </div><div class="line"><a name="l00203"></a><span class="lineno"> 203</span>  <span class="keywordtype">void</span> setVelocityFromAngle();</div><div class="line"><a name="l00204"></a><span class="lineno"> 204</span> </div><div class="line"><a name="l00212"></a><span class="lineno"> 212</span>  <span class="keywordtype">void</span> updateTransform();</div><div class="line"><a name="l00213"></a><span class="lineno"> 213</span> </div><div class="line"><a name="l00220"></a><span class="lineno"> 220</span>  <span class="keyword">const</span> <a class="code" href="structgf_1_1_transform.html">Transform</a>& getTransform() <span class="keyword">const</span>;</div><div class="line"><a name="l00221"></a><span class="lineno"> 221</span> </div><div class="line"><a name="l00222"></a><span class="lineno"> 222</span> </div><div class="line"><a name="l00235"></a><span class="lineno"><a class="line" href="classgf_1_1_physics_body.html#adedbd1cd2a73c498628856c1763bded5"> 235</a></span>  <span class="keywordtype">void</span> <a class="code" href="classgf_1_1_physics_body.html#adedbd1cd2a73c498628856c1763bded5">setRestitution</a>(<span class="keywordtype">float</span> restitution) {</div><div class="line"><a name="l00236"></a><span class="lineno"> 236</span>  m_restitution = restitution;</div><div class="line"><a name="l00237"></a><span class="lineno"> 237</span>  }</div><div class="line"><a name="l00238"></a><span class="lineno"> 238</span> </div><div class="line"><a name="l00244"></a><span class="lineno"><a class="line" href="classgf_1_1_physics_body.html#ad09a1a312eceafc21aa473248936581d"> 244</a></span>  <span class="keywordtype">float</span> <a class="code" href="classgf_1_1_physics_body.html#ad09a1a312eceafc21aa473248936581d">getRestitution</a>()<span class="keyword"> const </span>{</div><div class="line"><a name="l00245"></a><span class="lineno"> 245</span>  <span class="keywordflow">return</span> m_restitution;</div><div class="line"><a name="l00246"></a><span class="lineno"> 246</span>  }</div><div class="line"><a name="l00247"></a><span class="lineno"> 247</span> </div><div class="line"><a name="l00253"></a><span class="lineno"><a class="line" href="classgf_1_1_physics_body.html#a6c6dca7ab89d87c06fc34f8dc4599815"> 253</a></span>  <span class="keywordtype">void</span> <a class="code" href="classgf_1_1_physics_body.html#a6c6dca7ab89d87c06fc34f8dc4599815">setStaticFriction</a>(<span class="keywordtype">float</span> friction) {</div><div class="line"><a name="l00254"></a><span class="lineno"> 254</span>  m_staticFriction = friction;</div><div class="line"><a name="l00255"></a><span class="lineno"> 255</span>  }</div><div class="line"><a name="l00256"></a><span class="lineno"> 256</span> </div><div class="line"><a name="l00262"></a><span class="lineno"><a class="line" href="classgf_1_1_physics_body.html#a65e9da0d64758b9c912966afbd39bb45"> 262</a></span>  <span class="keywordtype">float</span> <a class="code" href="classgf_1_1_physics_body.html#a65e9da0d64758b9c912966afbd39bb45">getStaticFriction</a>()<span class="keyword"> const </span>{</div><div class="line"><a name="l00263"></a><span class="lineno"> 263</span>  <span class="keywordflow">return</span> m_staticFriction;</div><div class="line"><a name="l00264"></a><span class="lineno"> 264</span>  }</div><div class="line"><a name="l00265"></a><span class="lineno"> 265</span> </div><div class="line"><a name="l00271"></a><span class="lineno"><a class="line" href="classgf_1_1_physics_body.html#a16686ce8f0a318a0be94a845a197883b"> 271</a></span>  <span class="keywordtype">void</span> <a class="code" href="classgf_1_1_physics_body.html#a16686ce8f0a318a0be94a845a197883b">setDynamicFriction</a>(<span class="keywordtype">float</span> friction) {</div><div class="line"><a name="l00272"></a><span class="lineno"> 272</span>  m_dynamicFriction = friction;</div><div class="line"><a name="l00273"></a><span class="lineno"> 273</span>  }</div><div class="line"><a name="l00274"></a><span class="lineno"> 274</span> </div><div class="line"><a name="l00280"></a><span class="lineno"><a class="line" href="classgf_1_1_physics_body.html#ad18b9625c13ec7f2298f623dfc683411"> 280</a></span>  <span class="keywordtype">float</span> <a class="code" href="classgf_1_1_physics_body.html#ad18b9625c13ec7f2298f623dfc683411">getDynamicFriction</a>()<span class="keyword"> const </span>{</div><div class="line"><a name="l00281"></a><span class="lineno"> 281</span>  <span class="keywordflow">return</span> m_dynamicFriction;</div><div class="line"><a name="l00282"></a><span class="lineno"> 282</span>  }</div><div class="line"><a name="l00283"></a><span class="lineno"> 283</span> </div><div class="line"><a name="l00289"></a><span class="lineno"><a class="line" href="classgf_1_1_physics_body.html#aea32624b3636ef226fd2438c8e79459c"> 289</a></span>  <span class="keywordtype">void</span> <a class="code" href="classgf_1_1_physics_body.html#aea32624b3636ef226fd2438c8e79459c">setLinearDamping</a>(<span class="keywordtype">float</span> damping) {</div><div class="line"><a name="l00290"></a><span class="lineno"> 290</span>  m_linearDamping = damping;</div><div class="line"><a name="l00291"></a><span class="lineno"> 291</span>  }</div><div class="line"><a name="l00292"></a><span class="lineno"> 292</span> </div><div class="line"><a name="l00298"></a><span class="lineno"><a class="line" href="classgf_1_1_physics_body.html#a6587a1176f4a7cc3214e67ee9f4fa8ad"> 298</a></span>  <span class="keywordtype">float</span> <a class="code" href="classgf_1_1_physics_body.html#a6587a1176f4a7cc3214e67ee9f4fa8ad">getLinearDamping</a>()<span class="keyword"> const </span>{</div><div class="line"><a name="l00299"></a><span class="lineno"> 299</span>  <span class="keywordflow">return</span> m_linearDamping;</div><div class="line"><a name="l00300"></a><span class="lineno"> 300</span>  }</div><div class="line"><a name="l00301"></a><span class="lineno"> 301</span> </div><div class="line"><a name="l00309"></a><span class="lineno"> 309</span>  <span class="keywordtype">void</span> setDensity(<span class="keywordtype">float</span> density);</div><div class="line"><a name="l00310"></a><span class="lineno"> 310</span> </div><div class="line"><a name="l00318"></a><span class="lineno"><a class="line" href="classgf_1_1_physics_body.html#aef4645e6058c4ab291cb38a7ede26e42"> 318</a></span>  <span class="keywordtype">float</span> <a class="code" href="classgf_1_1_physics_body.html#aef4645e6058c4ab291cb38a7ede26e42">getInverseMass</a>()<span class="keyword"> const </span>{</div><div class="line"><a name="l00319"></a><span class="lineno"> 319</span>  <span class="keywordflow">return</span> m_inverseMass;</div><div class="line"><a name="l00320"></a><span class="lineno"> 320</span>  }</div><div class="line"><a name="l00321"></a><span class="lineno"> 321</span> </div><div class="line"><a name="l00330"></a><span class="lineno"> 330</span>  <span class="keywordtype">bool</span> collidesWith(<span class="keyword">const</span> <a class="code" href="classgf_1_1_physics_body.html">PhysicsBody</a>& other, <a class="code" href="structgf_1_1_penetration.html">Penetration</a>& p) <span class="keyword">const</span>;</div><div class="line"><a name="l00331"></a><span class="lineno"> 331</span> </div><div class="line"><a name="l00332"></a><span class="lineno"> 332</span>  <span class="keyword">private</span>:</div><div class="line"><a name="l00333"></a><span class="lineno"> 333</span>  <a class="code" href="classgf_1_1_physics_body.html#a028e27932aab1c36d31ae18b6304702f">Type</a> m_type;</div><div class="line"><a name="l00334"></a><span class="lineno"> 334</span> </div><div class="line"><a name="l00335"></a><span class="lineno"> 335</span>  <a class="code" href="structgf_1_1_vector.html">Vector2f</a> m_position;</div><div class="line"><a name="l00336"></a><span class="lineno"> 336</span>  <a class="code" href="structgf_1_1_vector.html">Vector2f</a> m_linearVelocity;</div><div class="line"><a name="l00337"></a><span class="lineno"> 337</span>  <a class="code" href="structgf_1_1_vector.html">Vector2f</a> m_acceleration;</div><div class="line"><a name="l00338"></a><span class="lineno"> 338</span> </div><div class="line"><a name="l00339"></a><span class="lineno"> 339</span>  <span class="keywordtype">float</span> m_angle;</div><div class="line"><a name="l00340"></a><span class="lineno"> 340</span> </div><div class="line"><a name="l00341"></a><span class="lineno"> 341</span>  <span class="keywordtype">float</span> m_inverseMass;</div><div class="line"><a name="l00342"></a><span class="lineno"> 342</span> </div><div class="line"><a name="l00343"></a><span class="lineno"> 343</span>  <span class="keywordtype">float</span> m_restitution;</div><div class="line"><a name="l00344"></a><span class="lineno"> 344</span>  <span class="keywordtype">float</span> m_staticFriction;</div><div class="line"><a name="l00345"></a><span class="lineno"> 345</span>  <span class="keywordtype">float</span> m_dynamicFriction;</div><div class="line"><a name="l00346"></a><span class="lineno"> 346</span>  <span class="keywordtype">float</span> m_linearDamping;</div><div class="line"><a name="l00347"></a><span class="lineno"> 347</span> </div><div class="line"><a name="l00348"></a><span class="lineno"> 348</span>  <a class="code" href="structgf_1_1_transform.html">Transform</a> m_transform;</div><div class="line"><a name="l00349"></a><span class="lineno"> 349</span> </div><div class="line"><a name="l00350"></a><span class="lineno"> 350</span>  <span class="keyword">const</span> <a class="code" href="classgf_1_1_physics_geometry.html">PhysicsGeometry</a>& m_geometry;</div><div class="line"><a name="l00351"></a><span class="lineno"> 351</span>  };</div><div class="line"><a name="l00352"></a><span class="lineno"> 352</span> </div><div class="line"><a name="l00353"></a><span class="lineno"> 353</span> <span class="preprocessor">#ifndef DOXYGEN_SHOULD_SKIP_THIS</span></div><div class="line"><a name="l00354"></a><span class="lineno"> 354</span> }</div><div class="line"><a name="l00355"></a><span class="lineno"> 355</span> <span class="preprocessor">#endif</span></div><div class="line"><a name="l00356"></a><span class="lineno"> 356</span> }</div><div class="line"><a name="l00357"></a><span class="lineno"> 357</span> </div><div class="line"><a name="l00358"></a><span class="lineno"> 358</span> <span class="preprocessor">#endif // GF_PHYSICS_BODY_H</span></div><div class="ttc" id="classgf_1_1_physics_body_html_ad32902adfefc0c26d55963afdadd15c9"><div class="ttname"><a href="classgf_1_1_physics_body.html#ad32902adfefc0c26d55963afdadd15c9">gf::PhysicsBody::getLinearVelocity</a></div><div class="ttdeci">Vector2f getLinearVelocity() const</div><div class="ttdoc">Get the linear velocity of the body. </div><div class="ttdef"><b>Definition:</b> PhysicsBody.h:133</div></div>
<div class="ttc" id="group__graphics_html_gga6a42c4039729410b3839e01afe754719a971fd8cc345d8bd9f92e9f7d88fdf20c"><div class="ttname"><a href="group__graphics.html#gga6a42c4039729410b3839e01afe754719a971fd8cc345d8bd9f92e9f7d88fdf20c">gf::UILayout::Dynamic</a></div><div class="ttdoc">The row has a dynamic layout. </div></div>
<div class="ttc" id="classgf_1_1_physics_body_html_aea32624b3636ef226fd2438c8e79459c"><div class="ttname"><a href="classgf_1_1_physics_body.html#aea32624b3636ef226fd2438c8e79459c">gf::PhysicsBody::setLinearDamping</a></div><div class="ttdeci">void setLinearDamping(float damping)</div><div class="ttdoc">Set the linear damping of the body. </div><div class="ttdef"><b>Definition:</b> PhysicsBody.h:289</div></div>
<div class="ttc" id="classgf_1_1_physics_body_html_aef4645e6058c4ab291cb38a7ede26e42"><div class="ttname"><a href="classgf_1_1_physics_body.html#aef4645e6058c4ab291cb38a7ede26e42">gf::PhysicsBody::getInverseMass</a></div><div class="ttdeci">float getInverseMass() const</div><div class="ttdoc">Get the inverse mass of the body. </div><div class="ttdef"><b>Definition:</b> PhysicsBody.h:318</div></div>
<div class="ttc" id="classgf_1_1_render_target_html"><div class="ttname"><a href="classgf_1_1_render_target.html">gf::RenderTarget</a></div><div class="ttdoc">Base class for all render targets (window, texture, ...) </div><div class="ttdef"><b>Definition:</b> RenderTarget.h:73</div></div>
<div class="ttc" id="classgf_1_1_physics_body_html_a40bc7b5e0effcdb56599fd45d5b44327"><div class="ttname"><a href="classgf_1_1_physics_body.html#a40bc7b5e0effcdb56599fd45d5b44327">gf::PhysicsBody::getType</a></div><div class="ttdeci">Type getType() const</div><div class="ttdoc">Get the type of the body. </div><div class="ttdef"><b>Definition:</b> PhysicsBody.h:79</div></div>
<div class="ttc" id="classgf_1_1_physics_body_html_a2b1db15fa14af45c45eb50adff2e8f7e"><div class="ttname"><a href="classgf_1_1_physics_body.html#a2b1db15fa14af45c45eb50adff2e8f7e">gf::PhysicsBody::getAcceleration</a></div><div class="ttdeci">Vector2f getAcceleration() const</div><div class="ttdoc">Get the acceleration of the body. </div><div class="ttdef"><b>Definition:</b> PhysicsBody.h:160</div></div>
<div class="ttc" id="structgf_1_1_render_states_html"><div class="ttname"><a href="structgf_1_1_render_states.html">gf::RenderStates</a></div><div class="ttdoc">Define the states used for drawing to a RenderTarget. </div><div class="ttdef"><b>Definition:</b> RenderStates.h:82</div></div>
<div class="ttc" id="classgf_1_1_physics_body_html"><div class="ttname"><a href="classgf_1_1_physics_body.html">gf::PhysicsBody</a></div><div class="ttdoc">A physics body. </div><div class="ttdef"><b>Definition:</b> PhysicsBody.h:56</div></div>
<div class="ttc" id="structgf_1_1_transform_html"><div class="ttname"><a href="structgf_1_1_transform.html">gf::Transform</a></div><div class="ttdoc">A simple transformation (rotation then translation) </div><div class="ttdef"><b>Definition:</b> Transform.h:200</div></div>
<div class="ttc" id="classgf_1_1_physics_body_html_af9f2052aed49bc2a809d6678806543cd"><div class="ttname"><a href="classgf_1_1_physics_body.html#af9f2052aed49bc2a809d6678806543cd">gf::PhysicsBody::getAngle</a></div><div class="ttdeci">float getAngle() const</div><div class="ttdoc">Get the angle of the body. </div><div class="ttdef"><b>Definition:</b> PhysicsBody.h:178</div></div>
<div class="ttc" id="classgf_1_1_physics_body_html_a028e27932aab1c36d31ae18b6304702f"><div class="ttname"><a href="classgf_1_1_physics_body.html#a028e27932aab1c36d31ae18b6304702f">gf::PhysicsBody::Type</a></div><div class="ttdeci">Type</div><div class="ttdoc">Type of body. </div><div class="ttdef"><b>Definition:</b> PhysicsBody.h:61</div></div>
<div class="ttc" id="classgf_1_1_physics_body_html_ad18b9625c13ec7f2298f623dfc683411"><div class="ttname"><a href="classgf_1_1_physics_body.html#ad18b9625c13ec7f2298f623dfc683411">gf::PhysicsBody::getDynamicFriction</a></div><div class="ttdeci">float getDynamicFriction() const</div><div class="ttdoc">Get the dynamic friction coefficient of the body. </div><div class="ttdef"><b>Definition:</b> PhysicsBody.h:280</div></div>
<div class="ttc" id="classgf_1_1_physics_body_html_a6587a1176f4a7cc3214e67ee9f4fa8ad"><div class="ttname"><a href="classgf_1_1_physics_body.html#a6587a1176f4a7cc3214e67ee9f4fa8ad">gf::PhysicsBody::getLinearDamping</a></div><div class="ttdeci">float getLinearDamping() const</div><div class="ttdoc">Get the linear damping of the body. </div><div class="ttdef"><b>Definition:</b> PhysicsBody.h:298</div></div>
<div class="ttc" id="classgf_1_1_physics_body_html_a028e27932aab1c36d31ae18b6304702fafa32023dee2aa3ab1b165cc6807fad10"><div class="ttname"><a href="classgf_1_1_physics_body.html#a028e27932aab1c36d31ae18b6304702fafa32023dee2aa3ab1b165cc6807fad10">gf::PhysicsBody::Static</a></div><div class="ttdoc">Static body with infinite mass. </div><div class="ttdef"><b>Definition:</b> PhysicsBody.h:62</div></div>
<div class="ttc" id="namespacegf_html"><div class="ttname"><a href="namespacegf.html">gf</a></div><div class="ttdoc">The namespace for gf classes. </div><div class="ttdef"><b>Definition:</b> Action.h:35</div></div>
<div class="ttc" id="classgf_1_1_physics_body_html_a65e9da0d64758b9c912966afbd39bb45"><div class="ttname"><a href="classgf_1_1_physics_body.html#a65e9da0d64758b9c912966afbd39bb45">gf::PhysicsBody::getStaticFriction</a></div><div class="ttdeci">float getStaticFriction() const</div><div class="ttdoc">Get the static friction coefficient of the body. </div><div class="ttdef"><b>Definition:</b> PhysicsBody.h:262</div></div>
<div class="ttc" id="group__core_html_ga96c554e4534b63fd34ac457d563e7c32"><div class="ttname"><a href="group__core.html#ga96c554e4534b63fd34ac457d563e7c32">gf::angle</a></div><div class="ttdeci">float angle(Direction direction)</div><div class="ttdoc">Get an angle from a direction. </div></div>
<div class="ttc" id="classgf_1_1_physics_body_html_adedbd1cd2a73c498628856c1763bded5"><div class="ttname"><a href="classgf_1_1_physics_body.html#adedbd1cd2a73c498628856c1763bded5">gf::PhysicsBody::setRestitution</a></div><div class="ttdeci">void setRestitution(float restitution)</div><div class="ttdoc">Set the restitution of the body of the body. </div><div class="ttdef"><b>Definition:</b> PhysicsBody.h:235</div></div>
<div class="ttc" id="classgf_1_1_physics_body_html_a97acccff218d1c116937ed4be17247ca"><div class="ttname"><a href="classgf_1_1_physics_body.html#a97acccff218d1c116937ed4be17247ca">gf::PhysicsBody::getPosition</a></div><div class="ttdeci">Vector2f getPosition() const</div><div class="ttdoc">Get the position of the body. </div><div class="ttdef"><b>Definition:</b> PhysicsBody.h:110</div></div>
<div class="ttc" id="structgf_1_1_penetration_html"><div class="ttname"><a href="structgf_1_1_penetration.html">gf::Penetration</a></div><div class="ttdoc">Data about the collision between two objects. </div><div class="ttdef"><b>Definition:</b> Collision.h:43</div></div>
<div class="ttc" id="classgf_1_1_physics_body_html_aa788e11a971227be18ced4fadcfeefe3"><div class="ttname"><a href="classgf_1_1_physics_body.html#aa788e11a971227be18ced4fadcfeefe3">gf::PhysicsBody::setAngle</a></div><div class="ttdeci">void setAngle(float angle)</div><div class="ttdoc">Set the angle of the body. </div><div class="ttdef"><b>Definition:</b> PhysicsBody.h:187</div></div>
<div class="ttc" id="classgf_1_1_physics_body_html_a042fab2ae6fe4695a495cafbf3421b93"><div class="ttname"><a href="classgf_1_1_physics_body.html#a042fab2ae6fe4695a495cafbf3421b93">gf::PhysicsBody::turn</a></div><div class="ttdeci">void turn(float arc)</div><div class="ttdoc">Change the angle of the body. </div><div class="ttdef"><b>Definition:</b> PhysicsBody.h:196</div></div>
<div class="ttc" id="classgf_1_1_physics_geometry_html"><div class="ttname"><a href="classgf_1_1_physics_geometry.html">gf::PhysicsGeometry</a></div><div class="ttdoc">The geometry of a physics body. </div><div class="ttdef"><b>Definition:</b> PhysicsGeometry.h:46</div></div>
<div class="ttc" id="classgf_1_1_physics_body_html_a16686ce8f0a318a0be94a845a197883b"><div class="ttname"><a href="classgf_1_1_physics_body.html#a16686ce8f0a318a0be94a845a197883b">gf::PhysicsBody::setDynamicFriction</a></div><div class="ttdeci">void setDynamicFriction(float friction)</div><div class="ttdoc">Set the dynamic friction coefficient of the body. </div><div class="ttdef"><b>Definition:</b> PhysicsBody.h:271</div></div>
<div class="ttc" id="classgf_1_1_physics_body_html_ad09a1a312eceafc21aa473248936581d"><div class="ttname"><a href="classgf_1_1_physics_body.html#ad09a1a312eceafc21aa473248936581d">gf::PhysicsBody::getRestitution</a></div><div class="ttdeci">float getRestitution() const</div><div class="ttdoc">Get the restitution of the body of the body. </div><div class="ttdef"><b>Definition:</b> PhysicsBody.h:244</div></div>
<div class="ttc" id="classgf_1_1_physics_body_html_a028e27932aab1c36d31ae18b6304702fa79a18ed43dd064c7e2ba118afdc59df4"><div class="ttname"><a href="classgf_1_1_physics_body.html#a028e27932aab1c36d31ae18b6304702fa79a18ed43dd064c7e2ba118afdc59df4">gf::PhysicsBody::Dynamic</a></div><div class="ttdoc">Dynamic bodies with finite mass. </div><div class="ttdef"><b>Definition:</b> PhysicsBody.h:63</div></div>
<div class="ttc" id="structgf_1_1_vector_html"><div class="ttname"><a href="structgf_1_1_vector.html">gf::Vector< float, 2 ></a></div></div>
<div class="ttc" id="classgf_1_1_physics_body_html_a6c6dca7ab89d87c06fc34f8dc4599815"><div class="ttname"><a href="classgf_1_1_physics_body.html#a6c6dca7ab89d87c06fc34f8dc4599815">gf::PhysicsBody::setStaticFriction</a></div><div class="ttdeci">void setStaticFriction(float friction)</div><div class="ttdoc">Set the static friction coefficient of the body. </div><div class="ttdef"><b>Definition:</b> PhysicsBody.h:253</div></div>
<div class="ttc" id="classgf_1_1_physics_body_html_a123a92093c38edbed20bc93fde099d60"><div class="ttname"><a href="classgf_1_1_physics_body.html#a123a92093c38edbed20bc93fde099d60">gf::PhysicsBody::setLinearVelocity</a></div><div class="ttdeci">void setLinearVelocity(Vector2f velocity)</div><div class="ttdoc">Set the linear velocity of the body. </div><div class="ttdef"><b>Definition:</b> PhysicsBody.h:142</div></div>
</div><!-- fragment --></div><!-- contents -->
<!-- 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.8.13
</small></address>
</body>
</html>