khaotic-engine-Reborn/doxygen_docs/html/classecs_1_1_physics_component.html

931 lines
53 KiB
HTML
Raw Blame History

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "https://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" lang="en-US">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=11"/>
<meta name="generator" content="Doxygen 1.12.0"/>
<meta name="viewport" content="width=device-width, initial-scale=1"/>
<title>Khaotic Engine Reborn: ecs::PhysicsComponent 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>
<script type="text/javascript" src="clipboard.js"></script>
<link href="navtree.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="navtreedata.js"></script>
<script type="text/javascript" src="navtree.js"></script>
<script type="text/javascript" src="resize.js"></script>
<script type="text/javascript" src="cookie.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 id="projectrow">
<td id="projectalign">
<div id="projectname">Khaotic Engine Reborn
</div>
</td>
</tr>
</tbody>
</table>
</div>
<!-- end header part -->
<!-- Generated by Doxygen 1.12.0 -->
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:d3d9a9a6595521f9666a5e94cc830dab83b65699&amp;dn=expat.txt MIT */
var searchBox = new SearchBox("searchBox", "search/",'.html');
/* @license-end */
</script>
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:d3d9a9a6595521f9666a5e94cc830dab83b65699&amp;dn=expat.txt MIT */
$(function() { codefold.init(0); });
/* @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:d3d9a9a6595521f9666a5e94cc830dab83b65699&amp;dn=expat.txt MIT */
$(function() {
initMenu('',true,false,'search.php','Search',true);
$(function() { init_search(); });
});
/* @license-end */
</script>
<div id="main-nav"></div>
</div><!-- top -->
<div id="side-nav" class="ui-resizable side-nav-resizable">
<div id="nav-tree">
<div id="nav-tree-contents">
<div id="nav-sync" class="sync"></div>
</div>
</div>
<div id="splitbar" style="-moz-user-select:none;"
class="ui-resizable-handle">
</div>
</div>
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:d3d9a9a6595521f9666a5e94cc830dab83b65699&amp;dn=expat.txt MIT */
$(function(){initNavTree('classecs_1_1_physics_component.html',''); initResizable(true); });
/* @license-end */
</script>
<div id="doc-content">
<!-- 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">
<div id="MSearchResults">
<div class="SRPage">
<div id="SRIndex">
<div id="SRResults"></div>
<div class="SRStatus" id="Loading">Loading...</div>
<div class="SRStatus" id="Searching">Searching...</div>
<div class="SRStatus" id="NoMatches">No Matches</div>
</div>
</div>
</div>
</div>
<div class="header">
<div class="summary">
<a href="#pub-methods">Public Member Functions</a> &#124;
<a href="classecs_1_1_physics_component-members.html">List of all members</a> </div>
<div class="headertitle"><div class="title">ecs::PhysicsComponent Class Reference</div></div>
</div><!--header-->
<div class="contents">
<div class="dynheader">
Inheritance diagram for ecs::PhysicsComponent:</div>
<div class="dyncontent">
<div class="center">
<img src="classecs_1_1_physics_component.png" usemap="#ecs::PhysicsComponent_map" alt=""/>
<map id="ecs::PhysicsComponent_map" name="ecs::PhysicsComponent_map">
<area href="classecs_1_1_component.html" alt="ecs::Component" shape="rect" coords="0,0,145,24"/>
</map>
</div></div>
<table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a id="pub-methods" name="pub-methods"></a>
Public Member Functions</h2></td></tr>
<tr class="memitem:a13c45de519868a3e035fc8a3cb4c3da0" id="r_a13c45de519868a3e035fc8a3cb4c3da0"><td class="memItemLeft" align="right" valign="top">&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="#a13c45de519868a3e035fc8a3cb4c3da0">PhysicsComponent</a> ()</td></tr>
<tr class="separator:a13c45de519868a3e035fc8a3cb4c3da0"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ab58952fc61030f1047beb2d6dbec82cf" id="r_ab58952fc61030f1047beb2d6dbec82cf"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="#ab58952fc61030f1047beb2d6dbec82cf">Initialize</a> () override</td></tr>
<tr class="separator:ab58952fc61030f1047beb2d6dbec82cf"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a83aaa878464b8ef2dbc0e7a927689d79" id="r_a83aaa878464b8ef2dbc0e7a927689d79"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="#a83aaa878464b8ef2dbc0e7a927689d79">Update</a> (float deltaTime) override</td></tr>
<tr class="separator:a83aaa878464b8ef2dbc0e7a927689d79"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a156fb8329b7b2434ee94ab8c03fdc6e2" id="r_a156fb8329b7b2434ee94ab8c03fdc6e2"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="#a156fb8329b7b2434ee94ab8c03fdc6e2">LaunchObject</a> (float alpha, float initialStretch, float springConstant)</td></tr>
<tr class="separator:a156fb8329b7b2434ee94ab8c03fdc6e2"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a5a4f3b4503ce9b199da87f5e11673501" id="r_a5a4f3b4503ce9b199da87f5e11673501"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="#a5a4f3b4503ce9b199da87f5e11673501">SetVelocity</a> (XMVECTOR velocity)</td></tr>
<tr class="separator:a5a4f3b4503ce9b199da87f5e11673501"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a462dd9f0b3452e9c98d5dea7d9959f50" id="r_a462dd9f0b3452e9c98d5dea7d9959f50"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="#a462dd9f0b3452e9c98d5dea7d9959f50">SetAcceleration</a> (XMVECTOR acceleration)</td></tr>
<tr class="separator:a462dd9f0b3452e9c98d5dea7d9959f50"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:af091ab5887798b0407700d4712795a0c" id="r_af091ab5887798b0407700d4712795a0c"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="#af091ab5887798b0407700d4712795a0c">SetMass</a> (float mass)</td></tr>
<tr class="separator:af091ab5887798b0407700d4712795a0c"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ab750af34ccb7fd9f2cb4cea2c7a9a253" id="r_ab750af34ccb7fd9f2cb4cea2c7a9a253"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="#ab750af34ccb7fd9f2cb4cea2c7a9a253">SetGrounded</a> (bool isGrounded)</td></tr>
<tr class="separator:ab750af34ccb7fd9f2cb4cea2c7a9a253"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:afb716a1474b17b0bcf1c4eb7b6f3c758" id="r_afb716a1474b17b0bcf1c4eb7b6f3c758"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="#afb716a1474b17b0bcf1c4eb7b6f3c758">SetPhysicsEnabled</a> (bool enabled)</td></tr>
<tr class="separator:afb716a1474b17b0bcf1c4eb7b6f3c758"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ab95922862da80f63814d47f8c2b69cea" id="r_ab95922862da80f63814d47f8c2b69cea"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="#ab95922862da80f63814d47f8c2b69cea">SetBoundingRadius</a> (float radius)</td></tr>
<tr class="separator:ab95922862da80f63814d47f8c2b69cea"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a9fd15ccd7dfe9955116ac5d52e01a6e7" id="r_a9fd15ccd7dfe9955116ac5d52e01a6e7"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="#a9fd15ccd7dfe9955116ac5d52e01a6e7">SetPreviousPosition</a> (XMVECTOR position)</td></tr>
<tr class="separator:a9fd15ccd7dfe9955116ac5d52e01a6e7"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a19fa3fa510051cc0d8a0ddb21e92f9fe" id="r_a19fa3fa510051cc0d8a0ddb21e92f9fe"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="#a19fa3fa510051cc0d8a0ddb21e92f9fe">SetGravityEnabled</a> (bool enabled)</td></tr>
<tr class="separator:a19fa3fa510051cc0d8a0ddb21e92f9fe"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a93d17ee763b557489210f35b54829976" id="r_a93d17ee763b557489210f35b54829976"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="#a93d17ee763b557489210f35b54829976">SetUpdatePositionCallback</a> (std::function&lt; void(XMVECTOR)&gt; callback)</td></tr>
<tr class="separator:a93d17ee763b557489210f35b54829976"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:abc1702442a7fa0915f7760b20d5a17ae" id="r_abc1702442a7fa0915f7760b20d5a17ae"><td class="memItemLeft" align="right" valign="top">XMVECTOR&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="#abc1702442a7fa0915f7760b20d5a17ae">GetVelocity</a> () const</td></tr>
<tr class="separator:abc1702442a7fa0915f7760b20d5a17ae"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ae40284b6a494abd2ad1d8a4bbb641117" id="r_ae40284b6a494abd2ad1d8a4bbb641117"><td class="memItemLeft" align="right" valign="top">XMVECTOR&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="#ae40284b6a494abd2ad1d8a4bbb641117">GetAcceleration</a> () const</td></tr>
<tr class="separator:ae40284b6a494abd2ad1d8a4bbb641117"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:acbe98be444ae347a32951435472e5a28" id="r_acbe98be444ae347a32951435472e5a28"><td class="memItemLeft" align="right" valign="top">float&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="#acbe98be444ae347a32951435472e5a28">GetMass</a> () const</td></tr>
<tr class="separator:acbe98be444ae347a32951435472e5a28"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ae3438c93efe882c97086e0f9bc2f54dd" id="r_ae3438c93efe882c97086e0f9bc2f54dd"><td class="memItemLeft" align="right" valign="top">bool&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="#ae3438c93efe882c97086e0f9bc2f54dd">IsGrounded</a> () const</td></tr>
<tr class="separator:ae3438c93efe882c97086e0f9bc2f54dd"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ab1d2d882d7ff058a67d3e266257edb95" id="r_ab1d2d882d7ff058a67d3e266257edb95"><td class="memItemLeft" align="right" valign="top">bool&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="#ab1d2d882d7ff058a67d3e266257edb95">IsPhysicsEnabled</a> () const</td></tr>
<tr class="separator:ab1d2d882d7ff058a67d3e266257edb95"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:acb77c488322bbb5776e08fd9be5908d7" id="r_acb77c488322bbb5776e08fd9be5908d7"><td class="memItemLeft" align="right" valign="top">float&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="#acb77c488322bbb5776e08fd9be5908d7">GetBoundingRadius</a> () const</td></tr>
<tr class="separator:acb77c488322bbb5776e08fd9be5908d7"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:af3e592a83a8145612bea36927c222082" id="r_af3e592a83a8145612bea36927c222082"><td class="memItemLeft" align="right" valign="top">XMVECTOR&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="#af3e592a83a8145612bea36927c222082">GetPreviousPosition</a> () const</td></tr>
<tr class="separator:af3e592a83a8145612bea36927c222082"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a29ed13dad5513dff62d8427e856bd74d" id="r_a29ed13dad5513dff62d8427e856bd74d"><td class="memItemLeft" align="right" valign="top">bool&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="#a29ed13dad5513dff62d8427e856bd74d">IsGravityEnabled</a> () const</td></tr>
<tr class="separator:a29ed13dad5513dff62d8427e856bd74d"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="inherit_header pub_methods_classecs_1_1_component"><td colspan="2" onclick="javascript:dynsection.toggleInherit('pub_methods_classecs_1_1_component')"><img src="closed.png" alt="-"/>&#160;Public Member Functions inherited from <a class="el" href="classecs_1_1_component.html">ecs::Component</a></td></tr>
<tr class="memitem:a8dbee43fa54890ad07145aa1160b0b09 inherit pub_methods_classecs_1_1_component" id="r_a8dbee43fa54890ad07145aa1160b0b09"><td class="memItemLeft" align="right" valign="top">
&#160;</td><td class="memItemRight" valign="bottom"><b>Component</b> (const <a class="el" href="classecs_1_1_component.html">Component</a> &amp;)=delete</td></tr>
<tr class="separator:a8dbee43fa54890ad07145aa1160b0b09 inherit pub_methods_classecs_1_1_component"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a34000da33471994c2550e416505026ad inherit pub_methods_classecs_1_1_component" id="r_a34000da33471994c2550e416505026ad"><td class="memItemLeft" align="right" valign="top">
<a class="el" href="classecs_1_1_component.html">Component</a> &amp;&#160;</td><td class="memItemRight" valign="bottom"><b>operator=</b> (const <a class="el" href="classecs_1_1_component.html">Component</a> &amp;)=delete</td></tr>
<tr class="separator:a34000da33471994c2550e416505026ad inherit pub_methods_classecs_1_1_component"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a213cfa3482dca1ffc458b9cf020b4814 inherit pub_methods_classecs_1_1_component" id="r_a213cfa3482dca1ffc458b9cf020b4814"><td class="memItemLeft" align="right" valign="top">
&#160;</td><td class="memItemRight" valign="bottom"><b>Component</b> (<a class="el" href="classecs_1_1_component.html">Component</a> &amp;&amp;)=default</td></tr>
<tr class="separator:a213cfa3482dca1ffc458b9cf020b4814 inherit pub_methods_classecs_1_1_component"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a8089d7e43f9ac2a6eedd3b0598c46694 inherit pub_methods_classecs_1_1_component" id="r_a8089d7e43f9ac2a6eedd3b0598c46694"><td class="memItemLeft" align="right" valign="top">
<a class="el" href="classecs_1_1_component.html">Component</a> &amp;&#160;</td><td class="memItemRight" valign="bottom"><b>operator=</b> (<a class="el" href="classecs_1_1_component.html">Component</a> &amp;&amp;)=default</td></tr>
<tr class="separator:a8089d7e43f9ac2a6eedd3b0598c46694 inherit pub_methods_classecs_1_1_component"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table>
<a name="details" id="details"></a><h2 class="groupheader">Detailed Description</h2>
<div class="textblock">
<p class="definition">Definition at line <a class="el" href="physics__component_8h_source.html#l00009">9</a> of file <a class="el" href="physics__component_8h_source.html">physics_component.h</a>.</p>
</div><h2 class="groupheader">Constructor &amp; Destructor Documentation</h2>
<a id="a13c45de519868a3e035fc8a3cb4c3da0" name="a13c45de519868a3e035fc8a3cb4c3da0"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a13c45de519868a3e035fc8a3cb4c3da0">&#9670;&#160;</a></span>PhysicsComponent()</h2>
<div class="memitem">
<div class="memproto">
<table class="mlabels">
<tr>
<td class="mlabels-left">
<table class="memname">
<tr>
<td class="memname">ecs::PhysicsComponent::PhysicsComponent </td>
<td>(</td>
<td class="paramname"><span class="paramname"><em></em></span></td><td>)</td>
<td></td>
</tr>
</table>
</td>
<td class="mlabels-right">
<span class="mlabels"><span class="mlabel">inline</span></span> </td>
</tr>
</table>
</div><div class="memdoc">
<p>Builder for the <a class="el" href="classecs_1_1_physics_component.html">PhysicsComponent</a> class. Use default values for velocity, acceleration, mass, bounding radius, and grounded state. </p>
<p class="definition">Definition at line <a class="el" href="physics__component_8h_source.html#l00015">15</a> of file <a class="el" href="physics__component_8h_source.html">physics_component.h</a>.</p>
<div class="fragment"><div class="line"><span class="lineno"> 15</span> {</div>
<div class="line"><span class="lineno"> 16</span> m_Velocity = XMVectorZero();</div>
<div class="line"><span class="lineno"> 17</span> m_Acceleration = XMVectorZero();</div>
<div class="line"><span class="lineno"> 18</span> m_PreviousPosition = XMVectorZero();</div>
<div class="line"><span class="lineno"> 19</span> m_Mass = 1.0f;</div>
<div class="line"><span class="lineno"> 20</span> m_BoundingRadius = 1.0f;</div>
<div class="line"><span class="lineno"> 21</span> m_IsGrounded = <span class="keyword">false</span>;</div>
<div class="line"><span class="lineno"> 22</span> m_IsPhysicsEnabled = <span class="keyword">false</span>;</div>
<div class="line"><span class="lineno"> 23</span> m_GravityEnabled = <span class="keyword">true</span>;</div>
<div class="line"><span class="lineno"> 24</span> }</div>
</div><!-- fragment -->
</div>
</div>
<h2 class="groupheader">Member Function Documentation</h2>
<a id="ae40284b6a494abd2ad1d8a4bbb641117" name="ae40284b6a494abd2ad1d8a4bbb641117"></a>
<h2 class="memtitle"><span class="permalink"><a href="#ae40284b6a494abd2ad1d8a4bbb641117">&#9670;&#160;</a></span>GetAcceleration()</h2>
<div class="memitem">
<div class="memproto">
<table class="mlabels">
<tr>
<td class="mlabels-left">
<table class="memname">
<tr>
<td class="memname">XMVECTOR ecs::PhysicsComponent::GetAcceleration </td>
<td>(</td>
<td class="paramname"><span class="paramname"><em></em></span></td><td>)</td>
<td> const</td>
</tr>
</table>
</td>
<td class="mlabels-right">
<span class="mlabels"><span class="mlabel">inline</span></span> </td>
</tr>
</table>
</div><div class="memdoc">
<p>Get the current acceleration of the object. </p><dl class="section return"><dt>Returns</dt><dd>The acceleration as an XMVECTOR. </dd></dl>
<p class="definition">Definition at line <a class="el" href="physics__component_8h_source.html#l00160">160</a> of file <a class="el" href="physics__component_8h_source.html">physics_component.h</a>.</p>
<div class="fragment"><div class="line"><span class="lineno"> 160</span>{ <span class="keywordflow">return</span> m_Acceleration; }</div>
</div><!-- fragment -->
</div>
</div>
<a id="acb77c488322bbb5776e08fd9be5908d7" name="acb77c488322bbb5776e08fd9be5908d7"></a>
<h2 class="memtitle"><span class="permalink"><a href="#acb77c488322bbb5776e08fd9be5908d7">&#9670;&#160;</a></span>GetBoundingRadius()</h2>
<div class="memitem">
<div class="memproto">
<table class="mlabels">
<tr>
<td class="mlabels-left">
<table class="memname">
<tr>
<td class="memname">float ecs::PhysicsComponent::GetBoundingRadius </td>
<td>(</td>
<td class="paramname"><span class="paramname"><em></em></span></td><td>)</td>
<td> const</td>
</tr>
</table>
</td>
<td class="mlabels-right">
<span class="mlabels"><span class="mlabel">inline</span></span> </td>
</tr>
</table>
</div><div class="memdoc">
<p>Get the bounding radius of the object. </p><dl class="section return"><dt>Returns</dt><dd>The bounding radius as a float. </dd></dl>
<p class="definition">Definition at line <a class="el" href="physics__component_8h_source.html#l00180">180</a> of file <a class="el" href="physics__component_8h_source.html">physics_component.h</a>.</p>
<div class="fragment"><div class="line"><span class="lineno"> 180</span>{ <span class="keywordflow">return</span> m_BoundingRadius; }</div>
</div><!-- fragment -->
</div>
</div>
<a id="acbe98be444ae347a32951435472e5a28" name="acbe98be444ae347a32951435472e5a28"></a>
<h2 class="memtitle"><span class="permalink"><a href="#acbe98be444ae347a32951435472e5a28">&#9670;&#160;</a></span>GetMass()</h2>
<div class="memitem">
<div class="memproto">
<table class="mlabels">
<tr>
<td class="mlabels-left">
<table class="memname">
<tr>
<td class="memname">float ecs::PhysicsComponent::GetMass </td>
<td>(</td>
<td class="paramname"><span class="paramname"><em></em></span></td><td>)</td>
<td> const</td>
</tr>
</table>
</td>
<td class="mlabels-right">
<span class="mlabels"><span class="mlabel">inline</span></span> </td>
</tr>
</table>
</div><div class="memdoc">
<p>Get the mass of the object. </p><dl class="section return"><dt>Returns</dt><dd>The mass as a float. </dd></dl>
<p class="definition">Definition at line <a class="el" href="physics__component_8h_source.html#l00165">165</a> of file <a class="el" href="physics__component_8h_source.html">physics_component.h</a>.</p>
<div class="fragment"><div class="line"><span class="lineno"> 165</span>{ <span class="keywordflow">return</span> m_Mass; }</div>
</div><!-- fragment -->
</div>
</div>
<a id="af3e592a83a8145612bea36927c222082" name="af3e592a83a8145612bea36927c222082"></a>
<h2 class="memtitle"><span class="permalink"><a href="#af3e592a83a8145612bea36927c222082">&#9670;&#160;</a></span>GetPreviousPosition()</h2>
<div class="memitem">
<div class="memproto">
<table class="mlabels">
<tr>
<td class="mlabels-left">
<table class="memname">
<tr>
<td class="memname">XMVECTOR ecs::PhysicsComponent::GetPreviousPosition </td>
<td>(</td>
<td class="paramname"><span class="paramname"><em></em></span></td><td>)</td>
<td> const</td>
</tr>
</table>
</td>
<td class="mlabels-right">
<span class="mlabels"><span class="mlabel">inline</span></span> </td>
</tr>
</table>
</div><div class="memdoc">
<p>Get the previous position of the object. This is used to calculate the movement and collision detection. </p><dl class="section return"><dt>Returns</dt><dd>The previous position as an XMVECTOR. </dd></dl>
<p class="definition">Definition at line <a class="el" href="physics__component_8h_source.html#l00186">186</a> of file <a class="el" href="physics__component_8h_source.html">physics_component.h</a>.</p>
<div class="fragment"><div class="line"><span class="lineno"> 186</span>{ <span class="keywordflow">return</span> m_PreviousPosition; }</div>
</div><!-- fragment -->
</div>
</div>
<a id="abc1702442a7fa0915f7760b20d5a17ae" name="abc1702442a7fa0915f7760b20d5a17ae"></a>
<h2 class="memtitle"><span class="permalink"><a href="#abc1702442a7fa0915f7760b20d5a17ae">&#9670;&#160;</a></span>GetVelocity()</h2>
<div class="memitem">
<div class="memproto">
<table class="mlabels">
<tr>
<td class="mlabels-left">
<table class="memname">
<tr>
<td class="memname">XMVECTOR ecs::PhysicsComponent::GetVelocity </td>
<td>(</td>
<td class="paramname"><span class="paramname"><em></em></span></td><td>)</td>
<td> const</td>
</tr>
</table>
</td>
<td class="mlabels-right">
<span class="mlabels"><span class="mlabel">inline</span></span> </td>
</tr>
</table>
</div><div class="memdoc">
<p>Get the current velocity of the object. </p><dl class="section return"><dt>Returns</dt><dd>The velocity as an XMVECTOR. </dd></dl>
<p class="definition">Definition at line <a class="el" href="physics__component_8h_source.html#l00155">155</a> of file <a class="el" href="physics__component_8h_source.html">physics_component.h</a>.</p>
<div class="fragment"><div class="line"><span class="lineno"> 155</span>{ <span class="keywordflow">return</span> m_Velocity; }</div>
</div><!-- fragment -->
</div>
</div>
<a id="ab58952fc61030f1047beb2d6dbec82cf" name="ab58952fc61030f1047beb2d6dbec82cf"></a>
<h2 class="memtitle"><span class="permalink"><a href="#ab58952fc61030f1047beb2d6dbec82cf">&#9670;&#160;</a></span>Initialize()</h2>
<div class="memitem">
<div class="memproto">
<table class="mlabels">
<tr>
<td class="mlabels-left">
<table class="memname">
<tr>
<td class="memname">void ecs::PhysicsComponent::Initialize </td>
<td>(</td>
<td class="paramname"><span class="paramname"><em></em></span></td><td>)</td>
<td></td>
</tr>
</table>
</td>
<td class="mlabels-right">
<span class="mlabels"><span class="mlabel">inline</span><span class="mlabel">override</span><span class="mlabel">virtual</span></span> </td>
</tr>
</table>
</div><div class="memdoc">
<p>Initialize the component. This method is called when the component is added to an entity. It can be used to set up initial values or perform any necessary setup. </p>
<p>Reimplemented from <a class="el" href="classecs_1_1_component.html#a9372874f51e5f63584d65fc378d39459">ecs::Component</a>.</p>
<p class="definition">Definition at line <a class="el" href="physics__component_8h_source.html#l00033">33</a> of file <a class="el" href="physics__component_8h_source.html">physics_component.h</a>.</p>
<div class="fragment"><div class="line"><span class="lineno"> 33</span> {</div>
<div class="line"><span class="lineno"> 34</span> <span class="comment">// Initialisation du composant physique</span></div>
<div class="line"><span class="lineno"> 35</span> }</div>
</div><!-- fragment -->
</div>
</div>
<a id="a29ed13dad5513dff62d8427e856bd74d" name="a29ed13dad5513dff62d8427e856bd74d"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a29ed13dad5513dff62d8427e856bd74d">&#9670;&#160;</a></span>IsGravityEnabled()</h2>
<div class="memitem">
<div class="memproto">
<table class="mlabels">
<tr>
<td class="mlabels-left">
<table class="memname">
<tr>
<td class="memname">bool ecs::PhysicsComponent::IsGravityEnabled </td>
<td>(</td>
<td class="paramname"><span class="paramname"><em></em></span></td><td>)</td>
<td> const</td>
</tr>
</table>
</td>
<td class="mlabels-right">
<span class="mlabels"><span class="mlabel">inline</span></span> </td>
</tr>
</table>
</div><div class="memdoc">
<p>Check if gravity is enabled for the object. </p><dl class="section return"><dt>Returns</dt><dd>True if gravity is enabled, false otherwise. </dd></dl>
<p class="definition">Definition at line <a class="el" href="physics__component_8h_source.html#l00191">191</a> of file <a class="el" href="physics__component_8h_source.html">physics_component.h</a>.</p>
<div class="fragment"><div class="line"><span class="lineno"> 191</span>{ <span class="keywordflow">return</span> m_GravityEnabled; }</div>
</div><!-- fragment -->
</div>
</div>
<a id="ae3438c93efe882c97086e0f9bc2f54dd" name="ae3438c93efe882c97086e0f9bc2f54dd"></a>
<h2 class="memtitle"><span class="permalink"><a href="#ae3438c93efe882c97086e0f9bc2f54dd">&#9670;&#160;</a></span>IsGrounded()</h2>
<div class="memitem">
<div class="memproto">
<table class="mlabels">
<tr>
<td class="mlabels-left">
<table class="memname">
<tr>
<td class="memname">bool ecs::PhysicsComponent::IsGrounded </td>
<td>(</td>
<td class="paramname"><span class="paramname"><em></em></span></td><td>)</td>
<td> const</td>
</tr>
</table>
</td>
<td class="mlabels-right">
<span class="mlabels"><span class="mlabel">inline</span></span> </td>
</tr>
</table>
</div><div class="memdoc">
<p>Get the grounded state of the object. </p><dl class="section return"><dt>Returns</dt><dd>True if the object is grounded, false otherwise. </dd></dl>
<p class="definition">Definition at line <a class="el" href="physics__component_8h_source.html#l00170">170</a> of file <a class="el" href="physics__component_8h_source.html">physics_component.h</a>.</p>
<div class="fragment"><div class="line"><span class="lineno"> 170</span>{ <span class="keywordflow">return</span> m_IsGrounded; }</div>
</div><!-- fragment -->
</div>
</div>
<a id="ab1d2d882d7ff058a67d3e266257edb95" name="ab1d2d882d7ff058a67d3e266257edb95"></a>
<h2 class="memtitle"><span class="permalink"><a href="#ab1d2d882d7ff058a67d3e266257edb95">&#9670;&#160;</a></span>IsPhysicsEnabled()</h2>
<div class="memitem">
<div class="memproto">
<table class="mlabels">
<tr>
<td class="mlabels-left">
<table class="memname">
<tr>
<td class="memname">bool ecs::PhysicsComponent::IsPhysicsEnabled </td>
<td>(</td>
<td class="paramname"><span class="paramname"><em></em></span></td><td>)</td>
<td> const</td>
</tr>
</table>
</td>
<td class="mlabels-right">
<span class="mlabels"><span class="mlabel">inline</span></span> </td>
</tr>
</table>
</div><div class="memdoc">
<p>Check if physics is enabled for the object. </p><dl class="section return"><dt>Returns</dt><dd>True if physics is enabled, false otherwise. </dd></dl>
<p class="definition">Definition at line <a class="el" href="physics__component_8h_source.html#l00175">175</a> of file <a class="el" href="physics__component_8h_source.html">physics_component.h</a>.</p>
<div class="fragment"><div class="line"><span class="lineno"> 175</span>{ <span class="keywordflow">return</span> m_IsPhysicsEnabled; }</div>
</div><!-- fragment -->
</div>
</div>
<a id="a156fb8329b7b2434ee94ab8c03fdc6e2" name="a156fb8329b7b2434ee94ab8c03fdc6e2"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a156fb8329b7b2434ee94ab8c03fdc6e2">&#9670;&#160;</a></span>LaunchObject()</h2>
<div class="memitem">
<div class="memproto">
<table class="mlabels">
<tr>
<td class="mlabels-left">
<table class="memname">
<tr>
<td class="memname">void ecs::PhysicsComponent::LaunchObject </td>
<td>(</td>
<td class="paramtype">float</td> <td class="paramname"><span class="paramname"><em>alpha</em></span>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">float</td> <td class="paramname"><span class="paramname"><em>initialStretch</em></span>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">float</td> <td class="paramname"><span class="paramname"><em>springConstant</em></span>&#160;)</td>
</tr>
</table>
</td>
<td class="mlabels-right">
<span class="mlabels"><span class="mlabel">inline</span></span> </td>
</tr>
</table>
</div><div class="memdoc">
<p>Launch an object with a spring-like force. This method calculates the initial velocity based on the angle, initial stretch, and spring constant.</p>
<p>This method will be removed in the future</p>
<dl class="params"><dt>Parameters</dt><dd>
<table class="params">
<tr><td class="paramname">alpha</td><td>The launch angle in degrees. </td></tr>
<tr><td class="paramname">initialStretch</td><td>The initial stretch of the spring. </td></tr>
<tr><td class="paramname">springConstant</td><td>The spring constant. </td></tr>
</table>
</dd>
</dl>
<p class="definition">Definition at line <a class="el" href="physics__component_8h_source.html#l00070">70</a> of file <a class="el" href="physics__component_8h_source.html">physics_component.h</a>.</p>
<div class="fragment"><div class="line"><span class="lineno"> 70</span> {</div>
<div class="line"><span class="lineno"> 71</span> <span class="comment">// Constants</span></div>
<div class="line"><span class="lineno"> 72</span> <span class="keyword">const</span> <span class="keywordtype">float</span> gravity = -9.81f;</div>
<div class="line"><span class="lineno"> 73</span> </div>
<div class="line"><span class="lineno"> 74</span> <span class="comment">// Convert alpha from degrees to radians if needed</span></div>
<div class="line"><span class="lineno"> 75</span> <span class="keywordtype">float</span> alphaRadians = alpha * (XM_PI / 180.0f);</div>
<div class="line"><span class="lineno"> 76</span> </div>
<div class="line"><span class="lineno"> 77</span> <span class="comment">// Scale factors to make the physics simulation more visible</span></div>
<div class="line"><span class="lineno"> 78</span> <span class="keywordtype">float</span> scaleFactor = 200.0f; <span class="comment">// Adjust this based on your world scale</span></div>
<div class="line"><span class="lineno"> 79</span> </div>
<div class="line"><span class="lineno"> 80</span> <span class="comment">// Calculate initial velocity magnitude</span></div>
<div class="line"><span class="lineno"> 81</span> <span class="keywordtype">float</span> velocityMagnitude = initialStretch * sqrtf(springConstant / m_Mass) * </div>
<div class="line"><span class="lineno"> 82</span> sqrtf(1.0f - powf((m_Mass * gravity * sinf(alphaRadians) / </div>
<div class="line"><span class="lineno"> 83</span> (springConstant * initialStretch)), 2.0f));</div>
<div class="line"><span class="lineno"> 84</span> </div>
<div class="line"><span class="lineno"> 85</span> <span class="comment">// Apply scale factor</span></div>
<div class="line"><span class="lineno"> 86</span> velocityMagnitude *= scaleFactor;</div>
<div class="line"><span class="lineno"> 87</span> </div>
<div class="line"><span class="lineno"> 88</span> <span class="comment">// Calculate velocity components</span></div>
<div class="line"><span class="lineno"> 89</span> XMVECTOR velocity = XMVectorSet(</div>
<div class="line"><span class="lineno"> 90</span> velocityMagnitude * cosf(alphaRadians), <span class="comment">// vx = v0 * cos(alpha)</span></div>
<div class="line"><span class="lineno"> 91</span> velocityMagnitude * sinf(alphaRadians), <span class="comment">// vy = v0 * sin(alpha)</span></div>
<div class="line"><span class="lineno"> 92</span> 0.0f, <span class="comment">// z-component (0 for 2D trajectory)</span></div>
<div class="line"><span class="lineno"> 93</span> 0.0f</div>
<div class="line"><span class="lineno"> 94</span> );</div>
<div class="line"><span class="lineno"> 95</span> </div>
<div class="line"><span class="lineno"> 96</span> <span class="comment">// Apply velocity</span></div>
<div class="line"><span class="lineno"> 97</span> <a class="code hl_function" href="#a5a4f3b4503ce9b199da87f5e11673501">SetVelocity</a>(velocity);</div>
<div class="line"><span class="lineno"> 98</span> </div>
<div class="line"><span class="lineno"> 99</span> <span class="comment">// Enable physics and reset grounded state</span></div>
<div class="line"><span class="lineno"> 100</span> <a class="code hl_function" href="#afb716a1474b17b0bcf1c4eb7b6f3c758">SetPhysicsEnabled</a>(<span class="keyword">true</span>);</div>
<div class="line"><span class="lineno"> 101</span> <a class="code hl_function" href="#ab750af34ccb7fd9f2cb4cea2c7a9a253">SetGrounded</a>(<span class="keyword">false</span>);</div>
<div class="line"><span class="lineno"> 102</span> }</div>
<div class="ttc" id="aclassecs_1_1_physics_component_html_a5a4f3b4503ce9b199da87f5e11673501"><div class="ttname"><a href="#a5a4f3b4503ce9b199da87f5e11673501">ecs::PhysicsComponent::SetVelocity</a></div><div class="ttdeci">void SetVelocity(XMVECTOR velocity)</div><div class="ttdef"><b>Definition</b> <a href="physics__component_8h_source.html#l00108">physics_component.h:108</a></div></div>
<div class="ttc" id="aclassecs_1_1_physics_component_html_ab750af34ccb7fd9f2cb4cea2c7a9a253"><div class="ttname"><a href="#ab750af34ccb7fd9f2cb4cea2c7a9a253">ecs::PhysicsComponent::SetGrounded</a></div><div class="ttdeci">void SetGrounded(bool isGrounded)</div><div class="ttdef"><b>Definition</b> <a href="physics__component_8h_source.html#l00123">physics_component.h:123</a></div></div>
<div class="ttc" id="aclassecs_1_1_physics_component_html_afb716a1474b17b0bcf1c4eb7b6f3c758"><div class="ttname"><a href="#afb716a1474b17b0bcf1c4eb7b6f3c758">ecs::PhysicsComponent::SetPhysicsEnabled</a></div><div class="ttdeci">void SetPhysicsEnabled(bool enabled)</div><div class="ttdef"><b>Definition</b> <a href="physics__component_8h_source.html#l00128">physics_component.h:128</a></div></div>
</div><!-- fragment -->
</div>
</div>
<a id="a462dd9f0b3452e9c98d5dea7d9959f50" name="a462dd9f0b3452e9c98d5dea7d9959f50"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a462dd9f0b3452e9c98d5dea7d9959f50">&#9670;&#160;</a></span>SetAcceleration()</h2>
<div class="memitem">
<div class="memproto">
<table class="mlabels">
<tr>
<td class="mlabels-left">
<table class="memname">
<tr>
<td class="memname">void ecs::PhysicsComponent::SetAcceleration </td>
<td>(</td>
<td class="paramtype">XMVECTOR</td> <td class="paramname"><span class="paramname"><em>acceleration</em></span></td><td>)</td>
<td></td>
</tr>
</table>
</td>
<td class="mlabels-right">
<span class="mlabels"><span class="mlabel">inline</span></span> </td>
</tr>
</table>
</div><div class="memdoc">
<p>Set the acceleration of the object. </p><dl class="params"><dt>Parameters</dt><dd>
<table class="params">
<tr><td class="paramname">acceleration</td><td></td></tr>
</table>
</dd>
</dl>
<p class="definition">Definition at line <a class="el" href="physics__component_8h_source.html#l00113">113</a> of file <a class="el" href="physics__component_8h_source.html">physics_component.h</a>.</p>
<div class="fragment"><div class="line"><span class="lineno"> 113</span>{ m_Acceleration = acceleration; }</div>
</div><!-- fragment -->
</div>
</div>
<a id="ab95922862da80f63814d47f8c2b69cea" name="ab95922862da80f63814d47f8c2b69cea"></a>
<h2 class="memtitle"><span class="permalink"><a href="#ab95922862da80f63814d47f8c2b69cea">&#9670;&#160;</a></span>SetBoundingRadius()</h2>
<div class="memitem">
<div class="memproto">
<table class="mlabels">
<tr>
<td class="mlabels-left">
<table class="memname">
<tr>
<td class="memname">void ecs::PhysicsComponent::SetBoundingRadius </td>
<td>(</td>
<td class="paramtype">float</td> <td class="paramname"><span class="paramname"><em>radius</em></span></td><td>)</td>
<td></td>
</tr>
</table>
</td>
<td class="mlabels-right">
<span class="mlabels"><span class="mlabel">inline</span></span> </td>
</tr>
</table>
</div><div class="memdoc">
<p>Set the bounding radius of the object. </p><dl class="params"><dt>Parameters</dt><dd>
<table class="params">
<tr><td class="paramname">radius</td><td>The bounding radius to set. </td></tr>
</table>
</dd>
</dl>
<p class="definition">Definition at line <a class="el" href="physics__component_8h_source.html#l00133">133</a> of file <a class="el" href="physics__component_8h_source.html">physics_component.h</a>.</p>
<div class="fragment"><div class="line"><span class="lineno"> 133</span>{ m_BoundingRadius = radius; }</div>
</div><!-- fragment -->
</div>
</div>
<a id="a19fa3fa510051cc0d8a0ddb21e92f9fe" name="a19fa3fa510051cc0d8a0ddb21e92f9fe"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a19fa3fa510051cc0d8a0ddb21e92f9fe">&#9670;&#160;</a></span>SetGravityEnabled()</h2>
<div class="memitem">
<div class="memproto">
<table class="mlabels">
<tr>
<td class="mlabels-left">
<table class="memname">
<tr>
<td class="memname">void ecs::PhysicsComponent::SetGravityEnabled </td>
<td>(</td>
<td class="paramtype">bool</td> <td class="paramname"><span class="paramname"><em>enabled</em></span></td><td>)</td>
<td></td>
</tr>
</table>
</td>
<td class="mlabels-right">
<span class="mlabels"><span class="mlabel">inline</span></span> </td>
</tr>
</table>
</div><div class="memdoc">
<p>Enable or disable gravity for the object. </p><dl class="params"><dt>Parameters</dt><dd>
<table class="params">
<tr><td class="paramname">enabled</td><td>True to enable gravity, false to disable. </td></tr>
</table>
</dd>
</dl>
<p class="definition">Definition at line <a class="el" href="physics__component_8h_source.html#l00143">143</a> of file <a class="el" href="physics__component_8h_source.html">physics_component.h</a>.</p>
<div class="fragment"><div class="line"><span class="lineno"> 143</span>{ m_GravityEnabled = enabled; }</div>
</div><!-- fragment -->
</div>
</div>
<a id="ab750af34ccb7fd9f2cb4cea2c7a9a253" name="ab750af34ccb7fd9f2cb4cea2c7a9a253"></a>
<h2 class="memtitle"><span class="permalink"><a href="#ab750af34ccb7fd9f2cb4cea2c7a9a253">&#9670;&#160;</a></span>SetGrounded()</h2>
<div class="memitem">
<div class="memproto">
<table class="mlabels">
<tr>
<td class="mlabels-left">
<table class="memname">
<tr>
<td class="memname">void ecs::PhysicsComponent::SetGrounded </td>
<td>(</td>
<td class="paramtype">bool</td> <td class="paramname"><span class="paramname"><em>isGrounded</em></span></td><td>)</td>
<td></td>
</tr>
</table>
</td>
<td class="mlabels-right">
<span class="mlabels"><span class="mlabel">inline</span></span> </td>
</tr>
</table>
</div><div class="memdoc">
<p>Set the grounded state of the object. </p><dl class="params"><dt>Parameters</dt><dd>
<table class="params">
<tr><td class="paramname">isGrounded</td><td>True if the object is grounded, false otherwise. </td></tr>
</table>
</dd>
</dl>
<p class="definition">Definition at line <a class="el" href="physics__component_8h_source.html#l00123">123</a> of file <a class="el" href="physics__component_8h_source.html">physics_component.h</a>.</p>
<div class="fragment"><div class="line"><span class="lineno"> 123</span>{ m_IsGrounded = isGrounded; }</div>
</div><!-- fragment -->
</div>
</div>
<a id="af091ab5887798b0407700d4712795a0c" name="af091ab5887798b0407700d4712795a0c"></a>
<h2 class="memtitle"><span class="permalink"><a href="#af091ab5887798b0407700d4712795a0c">&#9670;&#160;</a></span>SetMass()</h2>
<div class="memitem">
<div class="memproto">
<table class="mlabels">
<tr>
<td class="mlabels-left">
<table class="memname">
<tr>
<td class="memname">void ecs::PhysicsComponent::SetMass </td>
<td>(</td>
<td class="paramtype">float</td> <td class="paramname"><span class="paramname"><em>mass</em></span></td><td>)</td>
<td></td>
</tr>
</table>
</td>
<td class="mlabels-right">
<span class="mlabels"><span class="mlabel">inline</span></span> </td>
</tr>
</table>
</div><div class="memdoc">
<p>Set the mass of the object. </p><dl class="params"><dt>Parameters</dt><dd>
<table class="params">
<tr><td class="paramname">mass</td><td>The mass to set. </td></tr>
</table>
</dd>
</dl>
<p class="definition">Definition at line <a class="el" href="physics__component_8h_source.html#l00118">118</a> of file <a class="el" href="physics__component_8h_source.html">physics_component.h</a>.</p>
<div class="fragment"><div class="line"><span class="lineno"> 118</span>{ m_Mass = mass; }</div>
</div><!-- fragment -->
</div>
</div>
<a id="afb716a1474b17b0bcf1c4eb7b6f3c758" name="afb716a1474b17b0bcf1c4eb7b6f3c758"></a>
<h2 class="memtitle"><span class="permalink"><a href="#afb716a1474b17b0bcf1c4eb7b6f3c758">&#9670;&#160;</a></span>SetPhysicsEnabled()</h2>
<div class="memitem">
<div class="memproto">
<table class="mlabels">
<tr>
<td class="mlabels-left">
<table class="memname">
<tr>
<td class="memname">void ecs::PhysicsComponent::SetPhysicsEnabled </td>
<td>(</td>
<td class="paramtype">bool</td> <td class="paramname"><span class="paramname"><em>enabled</em></span></td><td>)</td>
<td></td>
</tr>
</table>
</td>
<td class="mlabels-right">
<span class="mlabels"><span class="mlabel">inline</span></span> </td>
</tr>
</table>
</div><div class="memdoc">
<p>Enable or disable physics for the object. </p><dl class="params"><dt>Parameters</dt><dd>
<table class="params">
<tr><td class="paramname">enabled</td><td>True to enable physics, false to disable. </td></tr>
</table>
</dd>
</dl>
<p class="definition">Definition at line <a class="el" href="physics__component_8h_source.html#l00128">128</a> of file <a class="el" href="physics__component_8h_source.html">physics_component.h</a>.</p>
<div class="fragment"><div class="line"><span class="lineno"> 128</span>{ m_IsPhysicsEnabled = enabled; }</div>
</div><!-- fragment -->
</div>
</div>
<a id="a9fd15ccd7dfe9955116ac5d52e01a6e7" name="a9fd15ccd7dfe9955116ac5d52e01a6e7"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a9fd15ccd7dfe9955116ac5d52e01a6e7">&#9670;&#160;</a></span>SetPreviousPosition()</h2>
<div class="memitem">
<div class="memproto">
<table class="mlabels">
<tr>
<td class="mlabels-left">
<table class="memname">
<tr>
<td class="memname">void ecs::PhysicsComponent::SetPreviousPosition </td>
<td>(</td>
<td class="paramtype">XMVECTOR</td> <td class="paramname"><span class="paramname"><em>position</em></span></td><td>)</td>
<td></td>
</tr>
</table>
</td>
<td class="mlabels-right">
<span class="mlabels"><span class="mlabel">inline</span></span> </td>
</tr>
</table>
</div><div class="memdoc">
<p>Set the previous position of the object. </p><dl class="params"><dt>Parameters</dt><dd>
<table class="params">
<tr><td class="paramname">position</td><td>The previous position to set. </td></tr>
</table>
</dd>
</dl>
<p class="definition">Definition at line <a class="el" href="physics__component_8h_source.html#l00138">138</a> of file <a class="el" href="physics__component_8h_source.html">physics_component.h</a>.</p>
<div class="fragment"><div class="line"><span class="lineno"> 138</span>{ m_PreviousPosition = position; }</div>
</div><!-- fragment -->
</div>
</div>
<a id="a93d17ee763b557489210f35b54829976" name="a93d17ee763b557489210f35b54829976"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a93d17ee763b557489210f35b54829976">&#9670;&#160;</a></span>SetUpdatePositionCallback()</h2>
<div class="memitem">
<div class="memproto">
<table class="mlabels">
<tr>
<td class="mlabels-left">
<table class="memname">
<tr>
<td class="memname">void ecs::PhysicsComponent::SetUpdatePositionCallback </td>
<td>(</td>
<td class="paramtype">std::function&lt; void(XMVECTOR)&gt;</td> <td class="paramname"><span class="paramname"><em>callback</em></span></td><td>)</td>
<td></td>
</tr>
</table>
</td>
<td class="mlabels-right">
<span class="mlabels"><span class="mlabel">inline</span></span> </td>
</tr>
</table>
</div><div class="memdoc">
<p>Set the callback to update the position of the object. This callback will be connected to the <a class="el" href="classecs_1_1_transform_component.html">TransformComponent</a> to update the position. </p><dl class="params"><dt>Parameters</dt><dd>
<table class="params">
<tr><td class="paramname">callback</td><td>The callback function that takes an XMVECTOR as a parameter. </td></tr>
</table>
</dd>
</dl>
<p class="definition">Definition at line <a class="el" href="physics__component_8h_source.html#l00149">149</a> of file <a class="el" href="physics__component_8h_source.html">physics_component.h</a>.</p>
<div class="fragment"><div class="line"><span class="lineno"> 149</span>{ m_UpdatePositionCallback = callback; }</div>
</div><!-- fragment -->
</div>
</div>
<a id="a5a4f3b4503ce9b199da87f5e11673501" name="a5a4f3b4503ce9b199da87f5e11673501"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a5a4f3b4503ce9b199da87f5e11673501">&#9670;&#160;</a></span>SetVelocity()</h2>
<div class="memitem">
<div class="memproto">
<table class="mlabels">
<tr>
<td class="mlabels-left">
<table class="memname">
<tr>
<td class="memname">void ecs::PhysicsComponent::SetVelocity </td>
<td>(</td>
<td class="paramtype">XMVECTOR</td> <td class="paramname"><span class="paramname"><em>velocity</em></span></td><td>)</td>
<td></td>
</tr>
</table>
</td>
<td class="mlabels-right">
<span class="mlabels"><span class="mlabel">inline</span></span> </td>
</tr>
</table>
</div><div class="memdoc">
<p>Set the velocity of the object. </p><dl class="params"><dt>Parameters</dt><dd>
<table class="params">
<tr><td class="paramname">velocity</td><td></td></tr>
</table>
</dd>
</dl>
<p class="definition">Definition at line <a class="el" href="physics__component_8h_source.html#l00108">108</a> of file <a class="el" href="physics__component_8h_source.html">physics_component.h</a>.</p>
<div class="fragment"><div class="line"><span class="lineno"> 108</span>{ m_Velocity = velocity; }</div>
</div><!-- fragment -->
</div>
</div>
<a id="a83aaa878464b8ef2dbc0e7a927689d79" name="a83aaa878464b8ef2dbc0e7a927689d79"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a83aaa878464b8ef2dbc0e7a927689d79">&#9670;&#160;</a></span>Update()</h2>
<div class="memitem">
<div class="memproto">
<table class="mlabels">
<tr>
<td class="mlabels-left">
<table class="memname">
<tr>
<td class="memname">void ecs::PhysicsComponent::Update </td>
<td>(</td>
<td class="paramtype">float</td> <td class="paramname"><span class="paramname"><em>deltaTime</em></span></td><td>)</td>
<td></td>
</tr>
</table>
</td>
<td class="mlabels-right">
<span class="mlabels"><span class="mlabel">inline</span><span class="mlabel">override</span><span class="mlabel">virtual</span></span> </td>
</tr>
</table>
</div><div class="memdoc">
<p>Update the physics component. This method is called every frame to update the physics state.</p>
<p>This method is not the final update method It will be called by the <a class="el" href="classecs_1_1_entity_manager.html">EntityManager</a>'s in the physics Thread. This is due to the fact that the physics system is not updated every frame. The physics thread is called at a fixed time step (50 FPS by default).</p>
<dl class="params"><dt>Parameters</dt><dd>
<table class="params">
<tr><td class="paramname">deltaTime</td><td>The time elapsed since the last frame. </td></tr>
</table>
</dd>
</dl>
<p>Reimplemented from <a class="el" href="classecs_1_1_component.html#a59c0f739c4ff19227e27ed7b9f6352e0">ecs::Component</a>.</p>
<p class="definition">Definition at line <a class="el" href="physics__component_8h_source.html#l00048">48</a> of file <a class="el" href="physics__component_8h_source.html">physics_component.h</a>.</p>
<div class="fragment"><div class="line"><span class="lineno"> 48</span> {</div>
<div class="line"><span class="lineno"> 49</span> <span class="keywordflow">if</span> (!m_IsPhysicsEnabled) <span class="keywordflow">return</span>;</div>
<div class="line"><span class="lineno"> 50</span> </div>
<div class="line"><span class="lineno"> 51</span> <span class="comment">// Mise <20> jour de la v<>locit<69> bas<61>e sur l&#39;acc<EFBFBD>l<EFBFBD>ration</span></div>
<div class="line"><span class="lineno"> 52</span> m_Velocity = m_Velocity + m_Acceleration * deltaTime;</div>
<div class="line"><span class="lineno"> 53</span> </div>
<div class="line"><span class="lineno"> 54</span> <span class="comment">// Si la physique est activ<69>e et qu&#39;une fonction de mise <20> jour de position est d<>finie</span></div>
<div class="line"><span class="lineno"> 55</span> <span class="keywordflow">if</span> (m_UpdatePositionCallback) {</div>
<div class="line"><span class="lineno"> 56</span> m_UpdatePositionCallback(m_Velocity * deltaTime);</div>
<div class="line"><span class="lineno"> 57</span> }</div>
<div class="line"><span class="lineno"> 58</span> }</div>
</div><!-- fragment -->
</div>
</div>
<hr/>The documentation for this class was generated from the following file:<ul>
<li>enginecustom/src/inc/system/ecs/components/<a class="el" href="physics__component_8h_source.html">physics_component.h</a></li>
</ul>
</div><!-- contents -->
</div><!-- doc-content -->
<!-- start footer part -->
<div id="nav-path" class="navpath"><!-- id is needed for treeview function! -->
<ul>
<li class="navelem"><a class="el" href="namespaceecs.html">ecs</a></li><li class="navelem"><a class="el" href="classecs_1_1_physics_component.html">PhysicsComponent</a></li>
<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>
</ul>
</div>
</body>
</html>