<?xml version='1.0' encoding='UTF-8' standalone='no'?>
<doxygen xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="compound.xsd" version="1.9.7" xml:lang="en-US">
  <compounddef id="d4/d4e/RigidbodyComponent_8cpp" kind="file" language="C++">
    <compoundname>RigidbodyComponent.cpp</compoundname>
    <includes refid="d8/d16/RigidbodyComponent_8hpp" local="yes">RigidbodyComponent.hpp</includes>
    <incdepgraph>
      <node id="4">
        <label>Component.hpp</label>
        <link refid="df/d1f/Component_8hpp_source"/>
        <childnode refid="5" relation="include">
        </childnode>
        <childnode refid="6" relation="include">
        </childnode>
        <childnode refid="7" relation="include">
        </childnode>
        <childnode refid="8" relation="include">
        </childnode>
        <childnode refid="9" relation="include">
        </childnode>
        <childnode refid="10" relation="include">
        </childnode>
        <childnode refid="11" relation="include">
        </childnode>
      </node>
      <node id="3">
        <label>IPhysicsComponent.hpp</label>
        <link refid="d5/d69/IPhysicsComponent_8hpp_source"/>
        <childnode refid="4" relation="include">
        </childnode>
        <childnode refid="12" relation="include">
        </childnode>
        <childnode refid="13" relation="include">
        </childnode>
      </node>
      <node id="2">
        <label>RigidbodyComponent.hpp</label>
        <link refid="d8/d16/RigidbodyComponent_8hpp_source"/>
        <childnode refid="3" relation="include">
        </childnode>
        <childnode refid="12" relation="include">
        </childnode>
        <childnode refid="13" relation="include">
        </childnode>
        <childnode refid="10" relation="include">
        </childnode>
      </node>
      <node id="13">
        <label>TinyMath.hpp</label>
        <link refid="d9/dec/TinyMath_8hpp_source"/>
        <childnode refid="14" relation="include">
        </childnode>
        <childnode refid="15" relation="include">
        </childnode>
      </node>
      <node id="12">
        <label>TransformComponent.hpp</label>
        <link refid="d9/da8/TransformComponent_8hpp_source"/>
        <childnode refid="13" relation="include">
        </childnode>
        <childnode refid="4" relation="include">
        </childnode>
        <childnode refid="10" relation="include">
        </childnode>
      </node>
      <node id="1">
        <label>src/RigidbodyComponent.cpp</label>
        <link refid="d4/d4e/RigidbodyComponent_8cpp"/>
        <childnode refid="2" relation="include">
        </childnode>
      </node>
      <node id="5">
        <label>SDL.h</label>
      </node>
      <node id="11">
        <label>algorithm</label>
      </node>
      <node id="14">
        <label>cmath</label>
      </node>
      <node id="6">
        <label>imgui.h</label>
      </node>
      <node id="7">
        <label>imgui_impl_sdl2.h</label>
      </node>
      <node id="8">
        <label>imgui_impl_sdlrenderer.h</label>
      </node>
      <node id="15">
        <label>ostream</label>
      </node>
      <node id="10">
        <label>string</label>
      </node>
      <node id="9">
        <label>vector</label>
      </node>
    </incdepgraph>
    <briefdescription>
    </briefdescription>
    <detaileddescription>
    </detaileddescription>
    <programlisting>
<codeline lineno="1"><highlight class="preprocessor">#include<sp/>&quot;RigidbodyComponent.hpp&quot;</highlight><highlight class="normal"></highlight></codeline>
<codeline lineno="2"><highlight class="normal"></highlight></codeline>
<codeline lineno="3"><highlight class="normal"></highlight></codeline>
<codeline lineno="4" refid="de/d87/classRigidbodyComponent_1a870828e81a3946f12bc09d49848072af" refkind="member"><highlight class="normal"><ref refid="de/d87/classRigidbodyComponent_1a870828e81a3946f12bc09d49848072af" kindref="member">RigidbodyComponent::RigidbodyComponent</ref>(<ref refid="d2/d0a/classTransformComponent" kindref="compound">TransformComponent</ref>*<sp/>pos,<sp/><ref refid="dd/d40/structVec2D" kindref="compound">Vec2D</ref><sp/>dim,<sp/><ref refid="dd/d40/structVec2D" kindref="compound">Vec2D</ref><sp/>vel,<sp/></highlight><highlight class="keywordtype">float</highlight><highlight class="normal"><sp/>m,<sp/></highlight></codeline>
<codeline lineno="5"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keywordtype">bool</highlight><highlight class="normal"><sp/>elastic,<sp/></highlight><highlight class="keywordtype">bool</highlight><highlight class="normal"><sp/>grav)<sp/>:<sp/><ref refid="d9/d15/classIPhysicsComponent" kindref="compound">IPhysicsComponent</ref>{pos,<sp/>dim}<sp/>{</highlight></codeline>
<codeline lineno="6"><highlight class="normal"><sp/><sp/><sp/><sp/>velocity<sp/>=<sp/>vel;</highlight></codeline>
<codeline lineno="7"><highlight class="normal"><sp/><sp/><sp/><sp/>mass<sp/>=<sp/>m;</highlight></codeline>
<codeline lineno="8"><highlight class="normal"><sp/><sp/><sp/><sp/>isElastic<sp/>=<sp/>elastic;</highlight></codeline>
<codeline lineno="9"><highlight class="normal"><sp/><sp/><sp/><sp/>usesGravity<sp/>=<sp/>grav;</highlight></codeline>
<codeline lineno="10"><highlight class="normal">}</highlight></codeline>
<codeline lineno="11"><highlight class="normal"></highlight></codeline>
<codeline lineno="12" refid="de/d87/classRigidbodyComponent_1afc85f13b28ca4dd1377fbbd2c9ddfd32" refkind="member"><highlight class="normal"><ref refid="de/d87/classRigidbodyComponent_1afc85f13b28ca4dd1377fbbd2c9ddfd32" kindref="member">RigidbodyComponent::~RigidbodyComponent</ref>(){</highlight></codeline>
<codeline lineno="13"><highlight class="normal"><sp/><sp/><sp/><sp/></highlight><highlight class="comment">//<sp/>TODO</highlight><highlight class="normal"></highlight></codeline>
<codeline lineno="14"><highlight class="normal">}</highlight></codeline>
<codeline lineno="15"><highlight class="normal"></highlight></codeline>
<codeline lineno="16" refid="de/d87/classRigidbodyComponent_1a1883fe26d2113b4aa5e74f21c0b49eab" refkind="member"><highlight class="normal"></highlight><highlight class="keywordtype">void</highlight><highlight class="normal"><sp/><ref refid="de/d87/classRigidbodyComponent_1a1883fe26d2113b4aa5e74f21c0b49eab" kindref="member">RigidbodyComponent::ApplyForce</ref>(<ref refid="dd/d40/structVec2D" kindref="compound">Vec2D</ref><sp/>force){</highlight></codeline>
<codeline lineno="17"><highlight class="normal"><sp/><sp/><sp/><sp/></highlight><highlight class="comment">//<sp/>F=ma</highlight><highlight class="normal"></highlight></codeline>
<codeline lineno="18"><highlight class="normal"><sp/><sp/><sp/><sp/><ref refid="dd/d40/structVec2D" kindref="compound">Vec2D</ref><sp/>acceleration<sp/>=<sp/>force<sp/>/<sp/><ref refid="de/d87/classRigidbodyComponent_1a96b7ca6de81de1347b2daf4f9c32a66b" kindref="member">GetMass</ref>();</highlight></codeline>
<codeline lineno="19"><highlight class="normal"><sp/><sp/><sp/><sp/><ref refid="de/d87/classRigidbodyComponent_1ae30aa822d90c6426fdbb96ec05a37d28" kindref="member">ApplyAcceleration</ref>(acceleration);</highlight></codeline>
<codeline lineno="20"><highlight class="normal">}</highlight></codeline>
<codeline lineno="21"><highlight class="normal"></highlight></codeline>
<codeline lineno="22" refid="de/d87/classRigidbodyComponent_1ae30aa822d90c6426fdbb96ec05a37d28" refkind="member"><highlight class="normal"></highlight><highlight class="keywordtype">void</highlight><highlight class="normal"><sp/><ref refid="de/d87/classRigidbodyComponent_1ae30aa822d90c6426fdbb96ec05a37d28" kindref="member">RigidbodyComponent::ApplyAcceleration</ref>(<ref refid="dd/d40/structVec2D" kindref="compound">Vec2D</ref><sp/>acceleration){</highlight></codeline>
<codeline lineno="23"><highlight class="normal"><sp/><sp/><sp/><sp/>velocity<sp/>+=<sp/>acceleration;</highlight></codeline>
<codeline lineno="24"><highlight class="normal">}</highlight></codeline>
<codeline lineno="25"><highlight class="normal"></highlight></codeline>
<codeline lineno="26" refid="de/d87/classRigidbodyComponent_1a7dafbd3c40121afeb2e30ad99d9be4ca" refkind="member"><highlight class="normal"></highlight><highlight class="keywordtype">void</highlight><highlight class="normal"><sp/><ref refid="de/d87/classRigidbodyComponent_1a7dafbd3c40121afeb2e30ad99d9be4ca" kindref="member">RigidbodyComponent::ApplyVelocity</ref>(){</highlight></codeline>
<codeline lineno="27"><highlight class="normal"><sp/><sp/><sp/><sp/>m_position-&gt;<ref refid="d2/d0a/classTransformComponent_1aa3cd2785878a82d02103778d04761a32" kindref="member">SetTransform</ref>(m_position-&gt;<ref refid="d2/d0a/classTransformComponent_1a5452c308a26521441745d3edc1ab5d4d" kindref="member">getPos</ref>()<sp/>+<sp/>velocity);</highlight></codeline>
<codeline lineno="28"><highlight class="normal">}</highlight></codeline>
<codeline lineno="29"><highlight class="normal"></highlight></codeline>
<codeline lineno="30" refid="de/d87/classRigidbodyComponent_1afc82759bee18cd1bd0cc90d7482307c1" refkind="member"><highlight class="normal"></highlight><highlight class="keywordtype">void</highlight><highlight class="normal"><sp/><ref refid="de/d87/classRigidbodyComponent_1afc82759bee18cd1bd0cc90d7482307c1" kindref="member">RigidbodyComponent::Update</ref>(SDL_Event<sp/>e,<sp/></highlight><highlight class="keywordtype">int</highlight><highlight class="normal"><sp/>frame,<sp/>std::vector&lt;std::string&gt;<sp/>broadcastList){</highlight></codeline>
<codeline lineno="31"><highlight class="normal"><sp/><sp/><sp/><sp/><ref refid="d8/d6b/classComponent_1aea8f0f460a62d86183020bd667b6cbf0" kindref="member">ParseAndUpdateBroadcast</ref>(broadcastList);</highlight></codeline>
<codeline lineno="32"><highlight class="normal"><sp/><sp/><sp/><sp/>m_position-&gt;<ref refid="d2/d0a/classTransformComponent_1aa3cd2785878a82d02103778d04761a32" kindref="member">SetTransform</ref>(m_position-&gt;<ref refid="d2/d0a/classTransformComponent_1a5452c308a26521441745d3edc1ab5d4d" kindref="member">getPos</ref>()<sp/>+<sp/>velocity);</highlight></codeline>
<codeline lineno="33"><highlight class="normal">}</highlight></codeline>
<codeline lineno="34"><highlight class="normal"></highlight></codeline>
<codeline lineno="35" refid="de/d87/classRigidbodyComponent_1a397796f2f8deb197ee0f0d96eb6ba23d" refkind="member"><highlight class="normal"></highlight><highlight class="keywordtype">void</highlight><highlight class="normal"><sp/><ref refid="de/d87/classRigidbodyComponent_1a397796f2f8deb197ee0f0d96eb6ba23d" kindref="member">RigidbodyComponent::ShowComponentEditor</ref>(</highlight><highlight class="keywordtype">bool</highlight><highlight class="normal">*<sp/>showEditor){</highlight></codeline>
<codeline lineno="36"><highlight class="normal"><sp/><sp/><sp/><sp/>ImGuiWindowFlags<sp/>window_flags<sp/>=<sp/>0;</highlight></codeline>
<codeline lineno="37"><highlight class="normal"><sp/><sp/><sp/><sp/>window_flags<sp/>|=<sp/>ImGuiWindowFlags_MenuBar;</highlight></codeline>
<codeline lineno="38"><highlight class="normal"><sp/><sp/><sp/><sp/>window_flags<sp/>|=<sp/>ImGuiWindowFlags_NoCollapse;</highlight></codeline>
<codeline lineno="39"><highlight class="normal"></highlight></codeline>
<codeline lineno="40"><highlight class="normal"><sp/><sp/><sp/><sp/></highlight><highlight class="keywordflow">if</highlight><highlight class="normal">(ImGui::Begin(</highlight><highlight class="stringliteral">&quot;Editing<sp/>Rigidbody<sp/>Component&quot;</highlight><highlight class="normal">,<sp/>showEditor,<sp/>window_flags)){</highlight></codeline>
<codeline lineno="41"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>ImGui::InputFloat(</highlight><highlight class="stringliteral">&quot;Mass&quot;</highlight><highlight class="normal">,<sp/>&amp;mass);</highlight></codeline>
<codeline lineno="42"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>ImGui::Checkbox(</highlight><highlight class="stringliteral">&quot;Elastic?&quot;</highlight><highlight class="normal">,<sp/>&amp;isElastic);</highlight></codeline>
<codeline lineno="43"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>ImGui::Checkbox(</highlight><highlight class="stringliteral">&quot;Gravity?&quot;</highlight><highlight class="normal">,<sp/>&amp;usesGravity);</highlight></codeline>
<codeline lineno="44"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>ImGui::End();</highlight></codeline>
<codeline lineno="45"><highlight class="normal"><sp/><sp/><sp/><sp/>}</highlight></codeline>
<codeline lineno="46"><highlight class="normal">}</highlight></codeline>
<codeline lineno="47"><highlight class="normal"></highlight></codeline>
<codeline lineno="48"><highlight class="normal"></highlight><highlight class="comment">//<sp/>SETTERS</highlight><highlight class="normal"></highlight></codeline>
<codeline lineno="49"><highlight class="normal"></highlight></codeline>
<codeline lineno="50" refid="de/d87/classRigidbodyComponent_1a5c6caca7d911fb61f00a2a35de0f62ef" refkind="member"><highlight class="normal"></highlight><highlight class="keywordtype">void</highlight><highlight class="normal"><sp/><ref refid="de/d87/classRigidbodyComponent_1a5c6caca7d911fb61f00a2a35de0f62ef" kindref="member">RigidbodyComponent::SetVelocity</ref>(<ref refid="dd/d40/structVec2D" kindref="compound">Vec2D</ref><sp/>vel){</highlight></codeline>
<codeline lineno="51"><highlight class="normal"><sp/><sp/><sp/><sp/>velocity<sp/>=<sp/>vel;</highlight></codeline>
<codeline lineno="52"><highlight class="normal">}</highlight></codeline>
<codeline lineno="53"><highlight class="normal"></highlight></codeline>
<codeline lineno="54"><highlight class="normal"></highlight><highlight class="comment">//<sp/>GETTERS</highlight><highlight class="normal"></highlight></codeline>
<codeline lineno="55"><highlight class="normal"></highlight></codeline>
<codeline lineno="56" refid="de/d87/classRigidbodyComponent_1a73b252b29fbb76a6354b0c56aebe36f9" refkind="member"><highlight class="normal"></highlight><highlight class="keywordtype">bool</highlight><highlight class="normal"><sp/><ref refid="de/d87/classRigidbodyComponent_1a73b252b29fbb76a6354b0c56aebe36f9" kindref="member">RigidbodyComponent::IsKinematic</ref>(){</highlight><highlight class="keywordflow">return</highlight><highlight class="normal"><sp/></highlight><highlight class="keyword">true</highlight><highlight class="normal">;}</highlight></codeline>
<codeline lineno="57" refid="de/d87/classRigidbodyComponent_1adc67765c449d8cde1c9dcdd279b97194" refkind="member"><highlight class="normal"></highlight><highlight class="keywordtype">bool</highlight><highlight class="normal"><sp/><ref refid="de/d87/classRigidbodyComponent_1adc67765c449d8cde1c9dcdd279b97194" kindref="member">RigidbodyComponent::IsElastic</ref>(){</highlight><highlight class="keywordflow">return</highlight><highlight class="normal"><sp/>isElastic;}</highlight></codeline>
<codeline lineno="58" refid="de/d87/classRigidbodyComponent_1aa4d0c27e47cef8b74058d70a5054eb31" refkind="member"><highlight class="normal"></highlight><highlight class="keywordtype">bool</highlight><highlight class="normal"><sp/><ref refid="de/d87/classRigidbodyComponent_1aa4d0c27e47cef8b74058d70a5054eb31" kindref="member">RigidbodyComponent::UsesGravity</ref>(){</highlight><highlight class="keywordflow">return</highlight><highlight class="normal"><sp/>usesGravity;}</highlight></codeline>
<codeline lineno="59" refid="de/d87/classRigidbodyComponent_1aca2cbab492d09175e0f2aa1e87f62f1f" refkind="member"><highlight class="normal"><ref refid="dd/d40/structVec2D" kindref="compound">Vec2D</ref><sp/><ref refid="de/d87/classRigidbodyComponent_1aca2cbab492d09175e0f2aa1e87f62f1f" kindref="member">RigidbodyComponent::GetVelocity</ref>(){</highlight><highlight class="keywordflow">return</highlight><highlight class="normal"><sp/>velocity;}</highlight></codeline>
<codeline lineno="60" refid="de/d87/classRigidbodyComponent_1a96b7ca6de81de1347b2daf4f9c32a66b" refkind="member"><highlight class="normal"></highlight><highlight class="keywordtype">float</highlight><highlight class="normal"><sp/><ref refid="de/d87/classRigidbodyComponent_1a96b7ca6de81de1347b2daf4f9c32a66b" kindref="member">RigidbodyComponent::GetMass</ref>(){</highlight><highlight class="keywordflow">return</highlight><highlight class="normal"><sp/>mass;}</highlight></codeline>
    </programlisting>
    <location file="src/RigidbodyComponent.cpp"/>
  </compounddef>
</doxygen>
