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

575 lines
36 KiB
HTML

<!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: camera_class 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('classcamera__class.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="classcamera__class-members.html">List of all members</a> </div>
<div class="headertitle"><div class="title">camera_class Class Reference</div></div>
</div><!--header-->
<div class="contents">
<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:ac18562f9e46ca033440ba9df2d180e20" id="r_ac18562f9e46ca033440ba9df2d180e20"><td class="memItemLeft" align="right" valign="top">&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="#ac18562f9e46ca033440ba9df2d180e20">camera_class</a> ()</td></tr>
<tr class="memdesc:ac18562f9e46ca033440ba9df2d180e20"><td class="mdescLeft">&#160;</td><td class="mdescRight">Default constructor for <a class="el" href="classcamera__class.html">camera_class</a>. Initializes the camera position and rotation to zero. <br /></td></tr>
<tr class="separator:ac18562f9e46ca033440ba9df2d180e20"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ad2cfbf1c511ff8dbfdf413be52076621" id="r_ad2cfbf1c511ff8dbfdf413be52076621"><td class="memItemLeft" align="right" valign="top">&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="#ad2cfbf1c511ff8dbfdf413be52076621">camera_class</a> (const <a class="el" href="classcamera__class.html">camera_class</a> &amp;)</td></tr>
<tr class="separator:ad2cfbf1c511ff8dbfdf413be52076621"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a4b9ac7f98297d2007abd1ed3d326d381" id="r_a4b9ac7f98297d2007abd1ed3d326d381"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="#a4b9ac7f98297d2007abd1ed3d326d381">set_position</a> (float, float, float)</td></tr>
<tr class="memdesc:a4b9ac7f98297d2007abd1ed3d326d381"><td class="mdescLeft">&#160;</td><td class="mdescRight">Sets the position of the camera in 3D space. <br /></td></tr>
<tr class="separator:a4b9ac7f98297d2007abd1ed3d326d381"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a410c4bbfd5ba10d0785f5ac9178f9b3f" id="r_a410c4bbfd5ba10d0785f5ac9178f9b3f"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="#a410c4bbfd5ba10d0785f5ac9178f9b3f">set_rotation</a> (float, float, float)</td></tr>
<tr class="memdesc:a410c4bbfd5ba10d0785f5ac9178f9b3f"><td class="mdescLeft">&#160;</td><td class="mdescRight">Sets the rotation of the camera in 3D space. <br /></td></tr>
<tr class="separator:a410c4bbfd5ba10d0785f5ac9178f9b3f"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:af416c69abe70579751cd404cba8bf388" id="r_af416c69abe70579751cd404cba8bf388"><td class="memItemLeft" align="right" valign="top">XMFLOAT3&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="#af416c69abe70579751cd404cba8bf388">get_position</a> ()</td></tr>
<tr class="memdesc:af416c69abe70579751cd404cba8bf388"><td class="mdescLeft">&#160;</td><td class="mdescRight">Gets the current position of the camera. <br /></td></tr>
<tr class="separator:af416c69abe70579751cd404cba8bf388"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:aa8073c109a536d48478257a3e1e889cd" id="r_aa8073c109a536d48478257a3e1e889cd"><td class="memItemLeft" align="right" valign="top">XMFLOAT3&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="#aa8073c109a536d48478257a3e1e889cd">get_rotation</a> ()</td></tr>
<tr class="memdesc:aa8073c109a536d48478257a3e1e889cd"><td class="mdescLeft">&#160;</td><td class="mdescRight">Gets the current rotation of the camera. <br /></td></tr>
<tr class="separator:aa8073c109a536d48478257a3e1e889cd"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a0820187f209f9628e6b2a8af34d71057" id="r_a0820187f209f9628e6b2a8af34d71057"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="#a0820187f209f9628e6b2a8af34d71057">render</a> ()</td></tr>
<tr class="memdesc:a0820187f209f9628e6b2a8af34d71057"><td class="mdescLeft">&#160;</td><td class="mdescRight">Updates the camera's view matrix based on its position and rotation. This method recalculates the view matrix to reflect the current camera state. <br /></td></tr>
<tr class="separator:a0820187f209f9628e6b2a8af34d71057"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ac17736821f337ce7fd52b9857095de68" id="r_ac17736821f337ce7fd52b9857095de68"><td class="memItemLeft" align="right" valign="top">XMMATRIX&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="#ac17736821f337ce7fd52b9857095de68">get_view_matrix</a> (XMMATRIX &amp;view_matrix) const</td></tr>
<tr class="memdesc:ac17736821f337ce7fd52b9857095de68"><td class="mdescLeft">&#160;</td><td class="mdescRight">Retrieves the current view matrix of the camera. <br /></td></tr>
<tr class="separator:ac17736821f337ce7fd52b9857095de68"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a58b36223405de07000d108129c998075" id="r_a58b36223405de07000d108129c998075"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="#a58b36223405de07000d108129c998075">render_reflection</a> (float)</td></tr>
<tr class="memdesc:a58b36223405de07000d108129c998075"><td class="mdescLeft">&#160;</td><td class="mdescRight">Renders the reflection of the scene from the camera's perspective. <br /></td></tr>
<tr class="separator:a58b36223405de07000d108129c998075"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ac4d85cc166aec75e54528dc9dee8a075" id="r_ac4d85cc166aec75e54528dc9dee8a075"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="#ac4d85cc166aec75e54528dc9dee8a075">get_reflection_view_matrix</a> (XMMATRIX &amp;) const</td></tr>
<tr class="memdesc:ac4d85cc166aec75e54528dc9dee8a075"><td class="mdescLeft">&#160;</td><td class="mdescRight">Retrieves the reflection view matrix of the camera. <br /></td></tr>
<tr class="separator:ac4d85cc166aec75e54528dc9dee8a075"><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="camera__class_8h_source.html#l00018">18</a> of file <a class="el" href="camera__class_8h_source.html">camera_class.h</a>.</p>
</div><h2 class="groupheader">Constructor &amp; Destructor Documentation</h2>
<a id="ac18562f9e46ca033440ba9df2d180e20" name="ac18562f9e46ca033440ba9df2d180e20"></a>
<h2 class="memtitle"><span class="permalink"><a href="#ac18562f9e46ca033440ba9df2d180e20">&#9670;&#160;</a></span>camera_class() <span class="overload">[1/2]</span></h2>
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">camera_class::camera_class </td>
<td>(</td>
<td class="paramname"><span class="paramname"><em></em></span></td><td>)</td>
<td></td>
</tr>
</table>
</div><div class="memdoc">
<p>Default constructor for <a class="el" href="classcamera__class.html">camera_class</a>. Initializes the camera position and rotation to zero. </p>
<p class="definition">Definition at line <a class="el" href="camera__class_8cpp_source.html#l00006">6</a> of file <a class="el" href="camera__class_8cpp_source.html">camera_class.cpp</a>.</p>
<div class="fragment"><div class="line"><span class="lineno"> 7</span>{</div>
<div class="line"><span class="lineno"> 8</span> position_x_ = 0.0f;</div>
<div class="line"><span class="lineno"> 9</span> position_y_ = 0.0f;</div>
<div class="line"><span class="lineno"> 10</span> position_z_ = 0.0f;</div>
<div class="line"><span class="lineno"> 11</span> </div>
<div class="line"><span class="lineno"> 12</span> rotation_x_ = 0.0f;</div>
<div class="line"><span class="lineno"> 13</span> rotation_y_ = 0.0f;</div>
<div class="line"><span class="lineno"> 14</span> rotation_z_ = 0.0f;</div>
<div class="line"><span class="lineno"> 15</span>}</div>
</div><!-- fragment -->
</div>
</div>
<a id="ad2cfbf1c511ff8dbfdf413be52076621" name="ad2cfbf1c511ff8dbfdf413be52076621"></a>
<h2 class="memtitle"><span class="permalink"><a href="#ad2cfbf1c511ff8dbfdf413be52076621">&#9670;&#160;</a></span>camera_class() <span class="overload">[2/2]</span></h2>
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">camera_class::camera_class </td>
<td>(</td>
<td class="paramtype">const <a class="el" href="classcamera__class.html">camera_class</a> &amp;</td> <td class="paramname"><span class="paramname"><em>other</em></span></td><td>)</td>
<td></td>
</tr>
</table>
</div><div class="memdoc">
<p class="definition">Definition at line <a class="el" href="camera__class_8cpp_source.html#l00018">18</a> of file <a class="el" href="camera__class_8cpp_source.html">camera_class.cpp</a>.</p>
<div class="fragment"><div class="line"><span class="lineno"> 19</span>{</div>
<div class="line"><span class="lineno"> 20</span>}</div>
</div><!-- fragment -->
</div>
</div>
<a id="abc411f8ee950139a041d88192f9711ed" name="abc411f8ee950139a041d88192f9711ed"></a>
<h2 class="memtitle"><span class="permalink"><a href="#abc411f8ee950139a041d88192f9711ed">&#9670;&#160;</a></span>~camera_class()</h2>
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">camera_class::~camera_class </td>
<td>(</td>
<td class="paramname"><span class="paramname"><em></em></span></td><td>)</td>
<td></td>
</tr>
</table>
</div><div class="memdoc">
<p class="definition">Definition at line <a class="el" href="camera__class_8cpp_source.html#l00023">23</a> of file <a class="el" href="camera__class_8cpp_source.html">camera_class.cpp</a>.</p>
<div class="fragment"><div class="line"><span class="lineno"> 24</span>{</div>
<div class="line"><span class="lineno"> 25</span>}</div>
</div><!-- fragment -->
</div>
</div>
<h2 class="groupheader">Member Function Documentation</h2>
<a id="af416c69abe70579751cd404cba8bf388" name="af416c69abe70579751cd404cba8bf388"></a>
<h2 class="memtitle"><span class="permalink"><a href="#af416c69abe70579751cd404cba8bf388">&#9670;&#160;</a></span>get_position()</h2>
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">XMFLOAT3 camera_class::get_position </td>
<td>(</td>
<td class="paramname"><span class="paramname"><em></em></span></td><td>)</td>
<td></td>
</tr>
</table>
</div><div class="memdoc">
<p>Gets the current position of the camera. </p>
<dl class="section return"><dt>Returns</dt><dd>A 3D vector representing the camera's position. </dd></dl>
<p class="definition">Definition at line <a class="el" href="camera__class_8cpp_source.html#l00044">44</a> of file <a class="el" href="camera__class_8cpp_source.html">camera_class.cpp</a>.</p>
<div class="fragment"><div class="line"><span class="lineno"> 45</span>{</div>
<div class="line"><span class="lineno"> 46</span> <span class="keywordflow">return</span> XMFLOAT3(position_x_, position_y_, position_z_);</div>
<div class="line"><span class="lineno"> 47</span>}</div>
</div><!-- fragment -->
</div>
</div>
<a id="ac4d85cc166aec75e54528dc9dee8a075" name="ac4d85cc166aec75e54528dc9dee8a075"></a>
<h2 class="memtitle"><span class="permalink"><a href="#ac4d85cc166aec75e54528dc9dee8a075">&#9670;&#160;</a></span>get_reflection_view_matrix()</h2>
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">void camera_class::get_reflection_view_matrix </td>
<td>(</td>
<td class="paramtype">XMMATRIX &amp;</td> <td class="paramname"><span class="paramname"><em>reflectionViewMatrix</em></span></td><td>)</td>
<td> const</td>
</tr>
</table>
</div><div class="memdoc">
<p>Retrieves the reflection view matrix of the camera. </p>
<dl class="params"><dt>Parameters</dt><dd>
<table class="params">
<tr><td class="paramname">reflection_view_matrix</td><td>The matrix to store the reflection view matrix. </td></tr>
</table>
</dd>
</dl>
<p class="definition">Definition at line <a class="el" href="camera__class_8cpp_source.html#l00167">167</a> of file <a class="el" href="camera__class_8cpp_source.html">camera_class.cpp</a>.</p>
<div class="fragment"><div class="line"><span class="lineno"> 168</span>{</div>
<div class="line"><span class="lineno"> 169</span> reflectionViewMatrix = reflection_view_matrix_;</div>
<div class="line"><span class="lineno"> 170</span> <span class="keywordflow">return</span>;</div>
<div class="line"><span class="lineno"> 171</span>}</div>
</div><!-- fragment -->
</div>
</div>
<a id="aa8073c109a536d48478257a3e1e889cd" name="aa8073c109a536d48478257a3e1e889cd"></a>
<h2 class="memtitle"><span class="permalink"><a href="#aa8073c109a536d48478257a3e1e889cd">&#9670;&#160;</a></span>get_rotation()</h2>
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">XMFLOAT3 camera_class::get_rotation </td>
<td>(</td>
<td class="paramname"><span class="paramname"><em></em></span></td><td>)</td>
<td></td>
</tr>
</table>
</div><div class="memdoc">
<p>Gets the current rotation of the camera. </p>
<dl class="section return"><dt>Returns</dt><dd>A 3D vector representing the camera's rotation in degrees. </dd></dl>
<p class="definition">Definition at line <a class="el" href="camera__class_8cpp_source.html#l00050">50</a> of file <a class="el" href="camera__class_8cpp_source.html">camera_class.cpp</a>.</p>
<div class="fragment"><div class="line"><span class="lineno"> 51</span>{</div>
<div class="line"><span class="lineno"> 52</span> <span class="keywordflow">return</span> XMFLOAT3(rotation_x_, rotation_y_, rotation_z_);</div>
<div class="line"><span class="lineno"> 53</span>}</div>
</div><!-- fragment -->
</div>
</div>
<a id="ac17736821f337ce7fd52b9857095de68" name="ac17736821f337ce7fd52b9857095de68"></a>
<h2 class="memtitle"><span class="permalink"><a href="#ac17736821f337ce7fd52b9857095de68">&#9670;&#160;</a></span>get_view_matrix()</h2>
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">XMMATRIX camera_class::get_view_matrix </td>
<td>(</td>
<td class="paramtype">XMMATRIX &amp;</td> <td class="paramname"><span class="paramname"><em>view_matrix</em></span></td><td>)</td>
<td> const</td>
</tr>
</table>
</div><div class="memdoc">
<p>Retrieves the current view matrix of the camera. </p>
<dl class="section return"><dt>Returns</dt><dd>The view matrix representing the camera's orientation and position. </dd></dl>
<p class="definition">Definition at line <a class="el" href="camera__class_8cpp_source.html#l00108">108</a> of file <a class="el" href="camera__class_8cpp_source.html">camera_class.cpp</a>.</p>
<div class="fragment"><div class="line"><span class="lineno"> 109</span>{</div>
<div class="line"><span class="lineno"> 110</span> view_matrix = view_matrix_;</div>
<div class="line"><span class="lineno"> 111</span> <span class="keywordflow">return</span> view_matrix;</div>
<div class="line"><span class="lineno"> 112</span>}</div>
</div><!-- fragment -->
</div>
</div>
<a id="a0820187f209f9628e6b2a8af34d71057" name="a0820187f209f9628e6b2a8af34d71057"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a0820187f209f9628e6b2a8af34d71057">&#9670;&#160;</a></span>render()</h2>
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">void camera_class::render </td>
<td>(</td>
<td class="paramname"><span class="paramname"><em></em></span></td><td>)</td>
<td></td>
</tr>
</table>
</div><div class="memdoc">
<p>Updates the camera's view matrix based on its position and rotation. This method recalculates the view matrix to reflect the current camera state. </p>
<p class="definition">Definition at line <a class="el" href="camera__class_8cpp_source.html#l00055">55</a> of file <a class="el" href="camera__class_8cpp_source.html">camera_class.cpp</a>.</p>
<div class="fragment"><div class="line"><span class="lineno"> 56</span>{</div>
<div class="line"><span class="lineno"> 57</span> XMFLOAT3 up, position, lookAt;</div>
<div class="line"><span class="lineno"> 58</span> XMVECTOR upVector, positionVector, lookAtVector;</div>
<div class="line"><span class="lineno"> 59</span> <span class="keywordtype">float</span> yaw, pitch, roll;</div>
<div class="line"><span class="lineno"> 60</span> XMMATRIX rotationMatrix;</div>
<div class="line"><span class="lineno"> 61</span> </div>
<div class="line"><span class="lineno"> 62</span> </div>
<div class="line"><span class="lineno"> 63</span> <span class="comment">// Setup the vector that points upwards.</span></div>
<div class="line"><span class="lineno"> 64</span> up.x = 0.0f;</div>
<div class="line"><span class="lineno"> 65</span> up.y = 1.0f;</div>
<div class="line"><span class="lineno"> 66</span> up.z = 0.0f;</div>
<div class="line"><span class="lineno"> 67</span> </div>
<div class="line"><span class="lineno"> 68</span> <span class="comment">// Load it into a XMVECTOR structure.</span></div>
<div class="line"><span class="lineno"> 69</span> upVector = XMLoadFloat3(&amp;up);</div>
<div class="line"><span class="lineno"> 70</span> </div>
<div class="line"><span class="lineno"> 71</span> <span class="comment">// Setup the position of the camera in the world.</span></div>
<div class="line"><span class="lineno"> 72</span> position.x = position_x_;</div>
<div class="line"><span class="lineno"> 73</span> position.y = position_y_;</div>
<div class="line"><span class="lineno"> 74</span> position.z = position_z_;</div>
<div class="line"><span class="lineno"> 75</span> </div>
<div class="line"><span class="lineno"> 76</span> <span class="comment">// Load it into a XMVECTOR structure.</span></div>
<div class="line"><span class="lineno"> 77</span> positionVector = XMLoadFloat3(&amp;position);</div>
<div class="line"><span class="lineno"> 78</span> </div>
<div class="line"><span class="lineno"> 79</span> <span class="comment">// Setup where the camera is looking by default.</span></div>
<div class="line"><span class="lineno"> 80</span> lookAt.x = 0.0f;</div>
<div class="line"><span class="lineno"> 81</span> lookAt.y = 0.0f;</div>
<div class="line"><span class="lineno"> 82</span> lookAt.z = 1.0f;</div>
<div class="line"><span class="lineno"> 83</span> </div>
<div class="line"><span class="lineno"> 84</span> <span class="comment">// Load it into a XMVECTOR structure.</span></div>
<div class="line"><span class="lineno"> 85</span> lookAtVector = XMLoadFloat3(&amp;lookAt);</div>
<div class="line"><span class="lineno"> 86</span> </div>
<div class="line"><span class="lineno"> 87</span> <span class="comment">// Set the yaw (Y axis), pitch (X axis), and roll (Z axis) rotations in radians.</span></div>
<div class="line"><span class="lineno"> 88</span> pitch = rotation_x_ * 0.0174532925f;</div>
<div class="line"><span class="lineno"> 89</span> yaw = rotation_y_ * 0.0174532925f;</div>
<div class="line"><span class="lineno"> 90</span> roll = rotation_z_ * 0.0174532925f;</div>
<div class="line"><span class="lineno"> 91</span> </div>
<div class="line"><span class="lineno"> 92</span> <span class="comment">// Create the rotation matrix from the yaw, pitch, and roll values.</span></div>
<div class="line"><span class="lineno"> 93</span> rotationMatrix = XMMatrixRotationRollPitchYaw(pitch, yaw, roll);</div>
<div class="line"><span class="lineno"> 94</span> </div>
<div class="line"><span class="lineno"> 95</span> <span class="comment">// Transform the lookAt and up vector by the rotation matrix so the view is correctly rotated at the origin.</span></div>
<div class="line"><span class="lineno"> 96</span> lookAtVector = XMVector3TransformCoord(lookAtVector, rotationMatrix);</div>
<div class="line"><span class="lineno"> 97</span> upVector = XMVector3TransformCoord(upVector, rotationMatrix);</div>
<div class="line"><span class="lineno"> 98</span> </div>
<div class="line"><span class="lineno"> 99</span> <span class="comment">// Translate the rotated camera position to the location of the viewer.</span></div>
<div class="line"><span class="lineno"> 100</span> lookAtVector = XMVectorAdd(positionVector, lookAtVector);</div>
<div class="line"><span class="lineno"> 101</span> </div>
<div class="line"><span class="lineno"> 102</span> <span class="comment">// Finally create the view matrix from the three updated vectors.</span></div>
<div class="line"><span class="lineno"> 103</span> view_matrix_ = XMMatrixLookAtLH(positionVector, lookAtVector, upVector);</div>
<div class="line"><span class="lineno"> 104</span> </div>
<div class="line"><span class="lineno"> 105</span> <span class="keywordflow">return</span>;</div>
<div class="line"><span class="lineno"> 106</span>}</div>
</div><!-- fragment -->
</div>
</div>
<a id="a58b36223405de07000d108129c998075" name="a58b36223405de07000d108129c998075"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a58b36223405de07000d108129c998075">&#9670;&#160;</a></span>render_reflection()</h2>
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">void camera_class::render_reflection </td>
<td>(</td>
<td class="paramtype">float</td> <td class="paramname"><span class="paramname"><em>height</em></span></td><td>)</td>
<td></td>
</tr>
</table>
</div><div class="memdoc">
<p>Renders the reflection of the scene from the camera's perspective. </p>
<dl class="params"><dt>Parameters</dt><dd>
<table class="params">
<tr><td class="paramname">reflection_plane_y</td><td>The y-coordinate of the reflection plane. </td></tr>
</table>
</dd>
</dl>
<p class="definition">Definition at line <a class="el" href="camera__class_8cpp_source.html#l00114">114</a> of file <a class="el" href="camera__class_8cpp_source.html">camera_class.cpp</a>.</p>
<div class="fragment"><div class="line"><span class="lineno"> 115</span>{</div>
<div class="line"><span class="lineno"> 116</span> XMFLOAT3 up, position, lookAt;</div>
<div class="line"><span class="lineno"> 117</span> XMVECTOR upVector, positionVector, lookAtVector;</div>
<div class="line"><span class="lineno"> 118</span> <span class="keywordtype">float</span> yaw, pitch, roll;</div>
<div class="line"><span class="lineno"> 119</span> XMMATRIX rotationMatrix;</div>
<div class="line"><span class="lineno"> 120</span> </div>
<div class="line"><span class="lineno"> 121</span> </div>
<div class="line"><span class="lineno"> 122</span> <span class="comment">// Setup the vector that points upwards.</span></div>
<div class="line"><span class="lineno"> 123</span> up.x = 0.0f;</div>
<div class="line"><span class="lineno"> 124</span> up.y = 1.0f;</div>
<div class="line"><span class="lineno"> 125</span> up.z = 0.0f;</div>
<div class="line"><span class="lineno"> 126</span> </div>
<div class="line"><span class="lineno"> 127</span> <span class="comment">// Load it into a XMVECTOR structure.</span></div>
<div class="line"><span class="lineno"> 128</span> upVector = XMLoadFloat3(&amp;up);</div>
<div class="line"><span class="lineno"> 129</span> </div>
<div class="line"><span class="lineno"> 130</span> <span class="comment">// Setup the position of the camera in the world.</span></div>
<div class="line"><span class="lineno"> 131</span> position.x = position_x_;</div>
<div class="line"><span class="lineno"> 132</span> position.y = -position_y_ + (height * 2.0f);</div>
<div class="line"><span class="lineno"> 133</span> position.z = position_z_;</div>
<div class="line"><span class="lineno"> 134</span> </div>
<div class="line"><span class="lineno"> 135</span> <span class="comment">// Load it into a XMVECTOR structure.</span></div>
<div class="line"><span class="lineno"> 136</span> positionVector = XMLoadFloat3(&amp;position);</div>
<div class="line"><span class="lineno"> 137</span> </div>
<div class="line"><span class="lineno"> 138</span> <span class="comment">// Setup where the camera is looking by default.</span></div>
<div class="line"><span class="lineno"> 139</span> lookAt.x = 0.0f;</div>
<div class="line"><span class="lineno"> 140</span> lookAt.y = 0.0f;</div>
<div class="line"><span class="lineno"> 141</span> lookAt.z = 1.0f;</div>
<div class="line"><span class="lineno"> 142</span> </div>
<div class="line"><span class="lineno"> 143</span> <span class="comment">// Load it into a XMVECTOR structure.</span></div>
<div class="line"><span class="lineno"> 144</span> lookAtVector = XMLoadFloat3(&amp;lookAt);</div>
<div class="line"><span class="lineno"> 145</span> </div>
<div class="line"><span class="lineno"> 146</span> <span class="comment">// Set the yaw (Y axis), pitch (X axis), and roll (Z axis) rotations in radians.</span></div>
<div class="line"><span class="lineno"> 147</span> pitch = (-1.0f * rotation_x_) * 0.0174532925f; <span class="comment">// Invert for reflection</span></div>
<div class="line"><span class="lineno"> 148</span> yaw = rotation_y_ * 0.0174532925f;</div>
<div class="line"><span class="lineno"> 149</span> roll = rotation_z_ * 0.0174532925f;</div>
<div class="line"><span class="lineno"> 150</span> </div>
<div class="line"><span class="lineno"> 151</span> <span class="comment">// Create the rotation matrix from the yaw, pitch, and roll values.</span></div>
<div class="line"><span class="lineno"> 152</span> rotationMatrix = XMMatrixRotationRollPitchYaw(pitch, yaw, roll);</div>
<div class="line"><span class="lineno"> 153</span> </div>
<div class="line"><span class="lineno"> 154</span> <span class="comment">// Transform the lookAt and up vector by the rotation matrix so the view is correctly rotated at the origin.</span></div>
<div class="line"><span class="lineno"> 155</span> lookAtVector = XMVector3TransformCoord(lookAtVector, rotationMatrix);</div>
<div class="line"><span class="lineno"> 156</span> upVector = XMVector3TransformCoord(upVector, rotationMatrix);</div>
<div class="line"><span class="lineno"> 157</span> </div>
<div class="line"><span class="lineno"> 158</span> <span class="comment">// Translate the rotated camera position to the location of the viewer.</span></div>
<div class="line"><span class="lineno"> 159</span> lookAtVector = XMVectorAdd(positionVector, lookAtVector);</div>
<div class="line"><span class="lineno"> 160</span> </div>
<div class="line"><span class="lineno"> 161</span> <span class="comment">// Finally create the view matrix from the three updated vectors.</span></div>
<div class="line"><span class="lineno"> 162</span> reflection_view_matrix_ = XMMatrixLookAtLH(positionVector, lookAtVector, upVector);</div>
<div class="line"><span class="lineno"> 163</span> </div>
<div class="line"><span class="lineno"> 164</span> <span class="keywordflow">return</span>;</div>
<div class="line"><span class="lineno"> 165</span>}</div>
</div><!-- fragment -->
</div>
</div>
<a id="a4b9ac7f98297d2007abd1ed3d326d381" name="a4b9ac7f98297d2007abd1ed3d326d381"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a4b9ac7f98297d2007abd1ed3d326d381">&#9670;&#160;</a></span>set_position()</h2>
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">void camera_class::set_position </td>
<td>(</td>
<td class="paramtype">float</td> <td class="paramname"><span class="paramname"><em>x</em></span>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">float</td> <td class="paramname"><span class="paramname"><em>y</em></span>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">float</td> <td class="paramname"><span class="paramname"><em>z</em></span>&#160;)</td>
</tr>
</table>
</div><div class="memdoc">
<p>Sets the position of the camera in 3D space. </p>
<dl class="params"><dt>Parameters</dt><dd>
<table class="params">
<tr><td class="paramname">position_x</td><td>The x-coordinate of the camera's position. </td></tr>
<tr><td class="paramname">position_y</td><td>The y-coordinate of the camera's position. </td></tr>
<tr><td class="paramname">position_z</td><td>The z-coordinate of the camera's position. </td></tr>
</table>
</dd>
</dl>
<p class="definition">Definition at line <a class="el" href="camera__class_8cpp_source.html#l00027">27</a> of file <a class="el" href="camera__class_8cpp_source.html">camera_class.cpp</a>.</p>
<div class="fragment"><div class="line"><span class="lineno"> 28</span>{</div>
<div class="line"><span class="lineno"> 29</span> position_x_ = x;</div>
<div class="line"><span class="lineno"> 30</span> position_y_ = y;</div>
<div class="line"><span class="lineno"> 31</span> position_z_ = z;</div>
<div class="line"><span class="lineno"> 32</span> <span class="keywordflow">return</span>;</div>
<div class="line"><span class="lineno"> 33</span>}</div>
</div><!-- fragment -->
</div>
</div>
<a id="a410c4bbfd5ba10d0785f5ac9178f9b3f" name="a410c4bbfd5ba10d0785f5ac9178f9b3f"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a410c4bbfd5ba10d0785f5ac9178f9b3f">&#9670;&#160;</a></span>set_rotation()</h2>
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">void camera_class::set_rotation </td>
<td>(</td>
<td class="paramtype">float</td> <td class="paramname"><span class="paramname"><em>x</em></span>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">float</td> <td class="paramname"><span class="paramname"><em>y</em></span>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">float</td> <td class="paramname"><span class="paramname"><em>z</em></span>&#160;)</td>
</tr>
</table>
</div><div class="memdoc">
<p>Sets the rotation of the camera in 3D space. </p>
<dl class="params"><dt>Parameters</dt><dd>
<table class="params">
<tr><td class="paramname">rotation_x</td><td>The rotation around the x-axis in degrees. </td></tr>
<tr><td class="paramname">rotation_y</td><td>The rotation around the y-axis in degrees. </td></tr>
<tr><td class="paramname">rotation_z</td><td>The rotation around the z-axis in degrees. </td></tr>
</table>
</dd>
</dl>
<p class="definition">Definition at line <a class="el" href="camera__class_8cpp_source.html#l00036">36</a> of file <a class="el" href="camera__class_8cpp_source.html">camera_class.cpp</a>.</p>
<div class="fragment"><div class="line"><span class="lineno"> 37</span>{</div>
<div class="line"><span class="lineno"> 38</span> rotation_x_ = x;</div>
<div class="line"><span class="lineno"> 39</span> rotation_y_ = y;</div>
<div class="line"><span class="lineno"> 40</span> rotation_z_ = z;</div>
<div class="line"><span class="lineno"> 41</span> <span class="keywordflow">return</span>;</div>
<div class="line"><span class="lineno"> 42</span>}</div>
</div><!-- fragment -->
</div>
</div>
<hr/>The documentation for this class was generated from the following files:<ul>
<li>enginecustom/src/inc/system/<a class="el" href="camera__class_8h_source.html">camera_class.h</a></li>
<li>enginecustom/src/src/system/<a class="el" href="camera__class_8cpp_source.html">camera_class.cpp</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="classcamera__class.html">camera_class</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>