-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path_im_guizmo_8h_source.html
100 lines (98 loc) · 29.9 KB
/
_im_guizmo_8h_source.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=9"/>
<meta name="generator" content="Doxygen 1.8.11"/>
<title>OpenGP: /home/drebain/Workspace/research/OpenGPFork/src/OpenGP/external/imgui/ImGuizmo.h Source File</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="dynsections.js"></script>
<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>
<script type="text/javascript">
$(document).ready(function() { init_search(); });
</script>
<link href="doxygen.css" rel="stylesheet" type="text/css" />
<link href="style.css" rel="stylesheet" type="text/css"/>
</head>
<body>
<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
<div id="titlearea">
<table cellspacing="0" cellpadding="0">
<tbody>
<tr style="height: 56px;">
<td id="projectalign" style="padding-left: 0.5em;">
<div id="projectname">OpenGP
 <span id="projectnumber">1.1</span>
</div>
<div id="projectbrief">Open Geometry Processing Library</div>
</td>
</tr>
</tbody>
</table>
</div>
<!-- end header part -->
<!-- Generated by Doxygen 1.8.11 -->
<script type="text/javascript">
var searchBox = new SearchBox("searchBox", "search",false,'Search');
</script>
<div id="navrow1" class="tabs">
<ul class="tablist">
<li><a href="index.html"><span>Main Page</span></a></li>
<li><a href="tutorial.html"><span>Tutorial</span></a></li>
<li><a href="devel.html"><span>Development</span></a></li>
<li><a href="annotated.html"><span>Reference Manual</span></a></li>
<li><a href="https://github.com/OpenGP/OpenGP/issues"><span>Report Bug</span></a></li>
<li>
<div id="MSearchBox" class="MSearchBoxInactive">
<span class="left">
<img id="MSearchSelect" src="search/mag_sel.png"
onmouseover="return searchBox.OnSearchSelectShow()"
onmouseout="return searchBox.OnSearchSelectHide()"
alt=""/>
<input type="text" id="MSearchField" value="Search" accesskey="S"
onfocus="searchBox.OnSearchFieldFocus(true)"
onblur="searchBox.OnSearchFieldFocus(false)"
onkeyup="searchBox.OnSearchFieldChange(event)"/>
</span><span class="right">
<a id="MSearchClose" href="javascript:searchBox.CloseResultsWindow()"><img id="MSearchCloseImg" border="0" src="search/close.png" alt=""/></a>
</span>
</div>
</li>
</ul>
</div>
<!-- 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">
<iframe src="javascript:void(0)" frameborder="0"
name="MSearchResults" id="MSearchResults">
</iframe>
</div>
<div id="nav-path" class="navpath">
<ul>
<li class="navelem"><a class="el" href="dir_68267d1309a1af8e8297ef4c3efbcdba.html">src</a></li><li class="navelem"><a class="el" href="dir_ceaee8241810cc418efcd8e45299d116.html">OpenGP</a></li><li class="navelem"><a class="el" href="dir_e1a2621128574a9035f9188825a300b3.html">external</a></li><li class="navelem"><a class="el" href="dir_6229e58f1a7f83484c3b808b62fff7d1.html">imgui</a></li> </ul>
</div>
</div><!-- top -->
<div class="header">
<div class="headertitle">
<div class="title">ImGuizmo.h</div> </div>
</div><!--header-->
<div class="contents">
<div class="fragment"><div class="line"><a name="l00001"></a><span class="lineno"> 1</span> <span class="comment">// https://github.com/CedricGuillemet/ImGuizmo</span></div><div class="line"><a name="l00002"></a><span class="lineno"> 2</span> <span class="comment">// v 1.04 WIP</span></div><div class="line"><a name="l00003"></a><span class="lineno"> 3</span> <span class="comment">//</span></div><div class="line"><a name="l00004"></a><span class="lineno"> 4</span> <span class="comment">// The MIT License(MIT)</span></div><div class="line"><a name="l00005"></a><span class="lineno"> 5</span> <span class="comment">//</span></div><div class="line"><a name="l00006"></a><span class="lineno"> 6</span> <span class="comment">// Copyright(c) 2016 Cedric Guillemet</span></div><div class="line"><a name="l00007"></a><span class="lineno"> 7</span> <span class="comment">//</span></div><div class="line"><a name="l00008"></a><span class="lineno"> 8</span> <span class="comment">// Permission is hereby granted, free of charge, to any person obtaining a copy</span></div><div class="line"><a name="l00009"></a><span class="lineno"> 9</span> <span class="comment">// of this software and associated documentation files(the "Software"), to deal</span></div><div class="line"><a name="l00010"></a><span class="lineno"> 10</span> <span class="comment">// in the Software without restriction, including without limitation the rights</span></div><div class="line"><a name="l00011"></a><span class="lineno"> 11</span> <span class="comment">// to use, copy, modify, merge, publish, distribute, sublicense, and / or sell</span></div><div class="line"><a name="l00012"></a><span class="lineno"> 12</span> <span class="comment">// copies of the Software, and to permit persons to whom the Software is</span></div><div class="line"><a name="l00013"></a><span class="lineno"> 13</span> <span class="comment">// furnished to do so, subject to the following conditions :</span></div><div class="line"><a name="l00014"></a><span class="lineno"> 14</span> <span class="comment">//</span></div><div class="line"><a name="l00015"></a><span class="lineno"> 15</span> <span class="comment">// The above copyright notice and this permission notice shall be included in all</span></div><div class="line"><a name="l00016"></a><span class="lineno"> 16</span> <span class="comment">// copies or substantial portions of the Software.</span></div><div class="line"><a name="l00017"></a><span class="lineno"> 17</span> <span class="comment">//</span></div><div class="line"><a name="l00018"></a><span class="lineno"> 18</span> <span class="comment">// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR</span></div><div class="line"><a name="l00019"></a><span class="lineno"> 19</span> <span class="comment">// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,</span></div><div class="line"><a name="l00020"></a><span class="lineno"> 20</span> <span class="comment">// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.IN NO EVENT SHALL THE</span></div><div class="line"><a name="l00021"></a><span class="lineno"> 21</span> <span class="comment">// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER</span></div><div class="line"><a name="l00022"></a><span class="lineno"> 22</span> <span class="comment">// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,</span></div><div class="line"><a name="l00023"></a><span class="lineno"> 23</span> <span class="comment">// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE</span></div><div class="line"><a name="l00024"></a><span class="lineno"> 24</span> <span class="comment">// SOFTWARE.</span></div><div class="line"><a name="l00025"></a><span class="lineno"> 25</span> <span class="comment">//</span></div><div class="line"><a name="l00026"></a><span class="lineno"> 26</span> <span class="comment">// -------------------------------------------------------------------------------------------</span></div><div class="line"><a name="l00027"></a><span class="lineno"> 27</span> <span class="comment">// History :</span></div><div class="line"><a name="l00028"></a><span class="lineno"> 28</span> <span class="comment">// 2016/09/11 Behind camera culling. Scaling Delta matrix not multiplied by source matrix scales. local/world rotation and translation fixed. Display message is incorrect (X: ... Y:...) in local mode.</span></div><div class="line"><a name="l00029"></a><span class="lineno"> 29</span> <span class="comment">// 2016/09/09 Hatched negative axis. Snapping. Documentation update.</span></div><div class="line"><a name="l00030"></a><span class="lineno"> 30</span> <span class="comment">// 2016/09/04 Axis switch and translation plan autohiding. Scale transform stability improved</span></div><div class="line"><a name="l00031"></a><span class="lineno"> 31</span> <span class="comment">// 2016/09/01 Mogwai changed to Manipulate. Draw debug cube. Fixed inverted scale. Mixing scale and translation/rotation gives bad results.</span></div><div class="line"><a name="l00032"></a><span class="lineno"> 32</span> <span class="comment">// 2016/08/31 First version</span></div><div class="line"><a name="l00033"></a><span class="lineno"> 33</span> <span class="comment">//</span></div><div class="line"><a name="l00034"></a><span class="lineno"> 34</span> <span class="comment">// -------------------------------------------------------------------------------------------</span></div><div class="line"><a name="l00035"></a><span class="lineno"> 35</span> <span class="comment">// Future (no order):</span></div><div class="line"><a name="l00036"></a><span class="lineno"> 36</span> <span class="comment">//</span></div><div class="line"><a name="l00037"></a><span class="lineno"> 37</span> <span class="comment">// - Multi view</span></div><div class="line"><a name="l00038"></a><span class="lineno"> 38</span> <span class="comment">// - display rotation/translation/scale infos in local/world space and not only local</span></div><div class="line"><a name="l00039"></a><span class="lineno"> 39</span> <span class="comment">// - finish local/world matrix application</span></div><div class="line"><a name="l00040"></a><span class="lineno"> 40</span> <span class="comment">// - OPERATION as bitmask</span></div><div class="line"><a name="l00041"></a><span class="lineno"> 41</span> <span class="comment">//</span></div><div class="line"><a name="l00042"></a><span class="lineno"> 42</span> <span class="comment">// -------------------------------------------------------------------------------------------</span></div><div class="line"><a name="l00043"></a><span class="lineno"> 43</span> <span class="comment">// Example</span></div><div class="line"><a name="l00044"></a><span class="lineno"> 44</span> <span class="preprocessor">#if 0</span></div><div class="line"><a name="l00045"></a><span class="lineno"> 45</span> <span class="keywordtype">void</span> EditTransform(<span class="keyword">const</span> Camera& camera, matrix_t& matrix)</div><div class="line"><a name="l00046"></a><span class="lineno"> 46</span> {</div><div class="line"><a name="l00047"></a><span class="lineno"> 47</span>  <span class="keyword">static</span> ImGuizmo::OPERATION mCurrentGizmoOperation(ImGuizmo::ROTATE);</div><div class="line"><a name="l00048"></a><span class="lineno"> 48</span>  <span class="keyword">static</span> ImGuizmo::MODE mCurrentGizmoMode(ImGuizmo::WORLD);</div><div class="line"><a name="l00049"></a><span class="lineno"> 49</span>  <span class="keywordflow">if</span> (ImGui::IsKeyPressed(90))</div><div class="line"><a name="l00050"></a><span class="lineno"> 50</span>  mCurrentGizmoOperation = ImGuizmo::TRANSLATE;</div><div class="line"><a name="l00051"></a><span class="lineno"> 51</span>  <span class="keywordflow">if</span> (ImGui::IsKeyPressed(69))</div><div class="line"><a name="l00052"></a><span class="lineno"> 52</span>  mCurrentGizmoOperation = ImGuizmo::ROTATE;</div><div class="line"><a name="l00053"></a><span class="lineno"> 53</span>  <span class="keywordflow">if</span> (ImGui::IsKeyPressed(82)) <span class="comment">// r Key</span></div><div class="line"><a name="l00054"></a><span class="lineno"> 54</span>  mCurrentGizmoOperation = ImGuizmo::SCALE;</div><div class="line"><a name="l00055"></a><span class="lineno"> 55</span>  <span class="keywordflow">if</span> (ImGui::RadioButton(<span class="stringliteral">"Translate"</span>, mCurrentGizmoOperation == ImGuizmo::TRANSLATE))</div><div class="line"><a name="l00056"></a><span class="lineno"> 56</span>  mCurrentGizmoOperation = ImGuizmo::TRANSLATE;</div><div class="line"><a name="l00057"></a><span class="lineno"> 57</span>  ImGui::SameLine();</div><div class="line"><a name="l00058"></a><span class="lineno"> 58</span>  <span class="keywordflow">if</span> (ImGui::RadioButton(<span class="stringliteral">"Rotate"</span>, mCurrentGizmoOperation == ImGuizmo::ROTATE))</div><div class="line"><a name="l00059"></a><span class="lineno"> 59</span>  mCurrentGizmoOperation = ImGuizmo::ROTATE;</div><div class="line"><a name="l00060"></a><span class="lineno"> 60</span>  ImGui::SameLine();</div><div class="line"><a name="l00061"></a><span class="lineno"> 61</span>  <span class="keywordflow">if</span> (ImGui::RadioButton(<span class="stringliteral">"Scale"</span>, mCurrentGizmoOperation == ImGuizmo::SCALE))</div><div class="line"><a name="l00062"></a><span class="lineno"> 62</span>  mCurrentGizmoOperation = ImGuizmo::SCALE;</div><div class="line"><a name="l00063"></a><span class="lineno"> 63</span>  <span class="keywordtype">float</span> matrixTranslation[3], matrixRotation[3], matrixScale[3];</div><div class="line"><a name="l00064"></a><span class="lineno"> 64</span>  ImGuizmo::DecomposeMatrixToComponents(matrix.m16, matrixTranslation, matrixRotation, matrixScale);</div><div class="line"><a name="l00065"></a><span class="lineno"> 65</span>  ImGui::InputFloat3(<span class="stringliteral">"Tr"</span>, matrixTranslation, 3);</div><div class="line"><a name="l00066"></a><span class="lineno"> 66</span>  ImGui::InputFloat3(<span class="stringliteral">"Rt"</span>, matrixRotation, 3);</div><div class="line"><a name="l00067"></a><span class="lineno"> 67</span>  ImGui::InputFloat3(<span class="stringliteral">"Sc"</span>, matrixScale, 3);</div><div class="line"><a name="l00068"></a><span class="lineno"> 68</span>  ImGuizmo::RecomposeMatrixFromComponents(matrixTranslation, matrixRotation, matrixScale, matrix.m16);</div><div class="line"><a name="l00069"></a><span class="lineno"> 69</span> </div><div class="line"><a name="l00070"></a><span class="lineno"> 70</span>  <span class="keywordflow">if</span> (mCurrentGizmoOperation != ImGuizmo::SCALE)</div><div class="line"><a name="l00071"></a><span class="lineno"> 71</span>  {</div><div class="line"><a name="l00072"></a><span class="lineno"> 72</span>  <span class="keywordflow">if</span> (ImGui::RadioButton(<span class="stringliteral">"Local"</span>, mCurrentGizmoMode == ImGuizmo::LOCAL))</div><div class="line"><a name="l00073"></a><span class="lineno"> 73</span>  mCurrentGizmoMode = ImGuizmo::LOCAL;</div><div class="line"><a name="l00074"></a><span class="lineno"> 74</span>  ImGui::SameLine();</div><div class="line"><a name="l00075"></a><span class="lineno"> 75</span>  <span class="keywordflow">if</span> (ImGui::RadioButton(<span class="stringliteral">"World"</span>, mCurrentGizmoMode == ImGuizmo::WORLD))</div><div class="line"><a name="l00076"></a><span class="lineno"> 76</span>  mCurrentGizmoMode = ImGuizmo::WORLD;</div><div class="line"><a name="l00077"></a><span class="lineno"> 77</span>  }</div><div class="line"><a name="l00078"></a><span class="lineno"> 78</span>  <span class="keyword">static</span> <span class="keywordtype">bool</span> useSnap(<span class="keyword">false</span>);</div><div class="line"><a name="l00079"></a><span class="lineno"> 79</span>  <span class="keywordflow">if</span> (ImGui::IsKeyPressed(83))</div><div class="line"><a name="l00080"></a><span class="lineno"> 80</span>  useSnap = !useSnap;</div><div class="line"><a name="l00081"></a><span class="lineno"> 81</span>  ImGui::Checkbox(<span class="stringliteral">""</span>, &useSnap);</div><div class="line"><a name="l00082"></a><span class="lineno"> 82</span>  ImGui::SameLine();</div><div class="line"><a name="l00083"></a><span class="lineno"> 83</span>  vec_t snap;</div><div class="line"><a name="l00084"></a><span class="lineno"> 84</span>  <span class="keywordflow">switch</span> (mCurrentGizmoOperation)</div><div class="line"><a name="l00085"></a><span class="lineno"> 85</span>  {</div><div class="line"><a name="l00086"></a><span class="lineno"> 86</span>  <span class="keywordflow">case</span> ImGuizmo::TRANSLATE:</div><div class="line"><a name="l00087"></a><span class="lineno"> 87</span>  snap = config.mSnapTranslation;</div><div class="line"><a name="l00088"></a><span class="lineno"> 88</span>  ImGui::InputFloat3(<span class="stringliteral">"Snap"</span>, &snap.x);</div><div class="line"><a name="l00089"></a><span class="lineno"> 89</span>  <span class="keywordflow">break</span>;</div><div class="line"><a name="l00090"></a><span class="lineno"> 90</span>  <span class="keywordflow">case</span> ImGuizmo::ROTATE:</div><div class="line"><a name="l00091"></a><span class="lineno"> 91</span>  snap = config.mSnapRotation;</div><div class="line"><a name="l00092"></a><span class="lineno"> 92</span>  ImGui::InputFloat(<span class="stringliteral">"Angle Snap"</span>, &snap.x);</div><div class="line"><a name="l00093"></a><span class="lineno"> 93</span>  <span class="keywordflow">break</span>;</div><div class="line"><a name="l00094"></a><span class="lineno"> 94</span>  <span class="keywordflow">case</span> ImGuizmo::SCALE:</div><div class="line"><a name="l00095"></a><span class="lineno"> 95</span>  snap = config.mSnapScale;</div><div class="line"><a name="l00096"></a><span class="lineno"> 96</span>  ImGui::InputFloat(<span class="stringliteral">"Scale Snap"</span>, &snap.x);</div><div class="line"><a name="l00097"></a><span class="lineno"> 97</span>  <span class="keywordflow">break</span>;</div><div class="line"><a name="l00098"></a><span class="lineno"> 98</span>  }</div><div class="line"><a name="l00099"></a><span class="lineno"> 99</span>  ImGuiIO& io = ImGui::GetIO();</div><div class="line"><a name="l00100"></a><span class="lineno"> 100</span>  ImGuizmo::SetRect(0, 0, io.DisplaySize.x, io.DisplaySize.y);</div><div class="line"><a name="l00101"></a><span class="lineno"> 101</span>  ImGuizmo::Manipulate(camera.mView.m16, camera.mProjection.m16, mCurrentGizmoOperation, mCurrentGizmoMode, matrix.m16, NULL, useSnap ? &snap.x : NULL);</div><div class="line"><a name="l00102"></a><span class="lineno"> 102</span> }</div><div class="line"><a name="l00103"></a><span class="lineno"> 103</span> <span class="preprocessor">#endif</span></div><div class="line"><a name="l00104"></a><span class="lineno"> 104</span> <span class="preprocessor">#pragma once</span></div><div class="line"><a name="l00105"></a><span class="lineno"> 105</span> </div><div class="line"><a name="l00106"></a><span class="lineno"> 106</span> <span class="preprocessor">#ifdef USE_IMGUI_API</span></div><div class="line"><a name="l00107"></a><span class="lineno"> 107</span> <span class="preprocessor">#include "imconfig.h"</span></div><div class="line"><a name="l00108"></a><span class="lineno"> 108</span> <span class="preprocessor">#endif</span></div><div class="line"><a name="l00109"></a><span class="lineno"> 109</span> <span class="preprocessor">#ifndef IMGUI_API</span></div><div class="line"><a name="l00110"></a><span class="lineno"> 110</span> <span class="preprocessor">#define IMGUI_API</span></div><div class="line"><a name="l00111"></a><span class="lineno"> 111</span> <span class="preprocessor">#endif</span></div><div class="line"><a name="l00112"></a><span class="lineno"> 112</span> </div><div class="line"><a name="l00113"></a><span class="lineno"> 113</span> <span class="keyword">namespace </span><a class="code" href="namespace_im_guizmo.html">ImGuizmo</a></div><div class="line"><a name="l00114"></a><span class="lineno"> 114</span> {</div><div class="line"><a name="l00115"></a><span class="lineno"> 115</span>  <span class="comment">// call BeginFrame right after ImGui_XXXX_NewFrame();</span></div><div class="line"><a name="l00116"></a><span class="lineno"> 116</span>  IMGUI_API <span class="keywordtype">void</span> BeginFrame();</div><div class="line"><a name="l00117"></a><span class="lineno"> 117</span> </div><div class="line"><a name="l00118"></a><span class="lineno"> 118</span>  <span class="comment">// return true if mouse cursor is over any gizmo control (axis, plan or screen component)</span></div><div class="line"><a name="l00119"></a><span class="lineno"> 119</span>  IMGUI_API <span class="keywordtype">bool</span> IsOver();</div><div class="line"><a name="l00120"></a><span class="lineno"> 120</span> </div><div class="line"><a name="l00121"></a><span class="lineno"> 121</span>  <span class="comment">// return true if mouse IsOver or if the gizmo is in moving state</span></div><div class="line"><a name="l00122"></a><span class="lineno"> 122</span>  IMGUI_API <span class="keywordtype">bool</span> IsUsing();</div><div class="line"><a name="l00123"></a><span class="lineno"> 123</span> </div><div class="line"><a name="l00124"></a><span class="lineno"> 124</span>  <span class="comment">// enable/disable the gizmo. Stay in the state until next call to Enable.</span></div><div class="line"><a name="l00125"></a><span class="lineno"> 125</span>  <span class="comment">// gizmo is rendered with gray half transparent color when disabled</span></div><div class="line"><a name="l00126"></a><span class="lineno"> 126</span>  IMGUI_API <span class="keywordtype">void</span> Enable(<span class="keywordtype">bool</span> enable);</div><div class="line"><a name="l00127"></a><span class="lineno"> 127</span> </div><div class="line"><a name="l00128"></a><span class="lineno"> 128</span>  <span class="comment">// helper functions for manualy editing translation/rotation/scale with an input float</span></div><div class="line"><a name="l00129"></a><span class="lineno"> 129</span>  <span class="comment">// translation, rotation and scale float points to 3 floats each</span></div><div class="line"><a name="l00130"></a><span class="lineno"> 130</span>  <span class="comment">// Angles are in degrees (more suitable for human editing)</span></div><div class="line"><a name="l00131"></a><span class="lineno"> 131</span>  <span class="comment">// example:</span></div><div class="line"><a name="l00132"></a><span class="lineno"> 132</span>  <span class="comment">// float matrixTranslation[3], matrixRotation[3], matrixScale[3];</span></div><div class="line"><a name="l00133"></a><span class="lineno"> 133</span>  <span class="comment">// ImGuizmo::DecomposeMatrixToComponents(gizmoMatrix.m16, matrixTranslation, matrixRotation, matrixScale);</span></div><div class="line"><a name="l00134"></a><span class="lineno"> 134</span>  <span class="comment">// ImGui::InputFloat3("Tr", matrixTranslation, 3);</span></div><div class="line"><a name="l00135"></a><span class="lineno"> 135</span>  <span class="comment">// ImGui::InputFloat3("Rt", matrixRotation, 3);</span></div><div class="line"><a name="l00136"></a><span class="lineno"> 136</span>  <span class="comment">// ImGui::InputFloat3("Sc", matrixScale, 3);</span></div><div class="line"><a name="l00137"></a><span class="lineno"> 137</span>  <span class="comment">// ImGuizmo::RecomposeMatrixFromComponents(matrixTranslation, matrixRotation, matrixScale, gizmoMatrix.m16);</span></div><div class="line"><a name="l00138"></a><span class="lineno"> 138</span>  <span class="comment">//</span></div><div class="line"><a name="l00139"></a><span class="lineno"> 139</span>  <span class="comment">// These functions have some numerical stability issues for now. Use with caution.</span></div><div class="line"><a name="l00140"></a><span class="lineno"> 140</span>  IMGUI_API <span class="keywordtype">void</span> DecomposeMatrixToComponents(<span class="keyword">const</span> <span class="keywordtype">float</span> *matrix, <span class="keywordtype">float</span> *translation, <span class="keywordtype">float</span> *rotation, <span class="keywordtype">float</span> *scale);</div><div class="line"><a name="l00141"></a><span class="lineno"> 141</span>  IMGUI_API <span class="keywordtype">void</span> RecomposeMatrixFromComponents(<span class="keyword">const</span> <span class="keywordtype">float</span> *translation, <span class="keyword">const</span> <span class="keywordtype">float</span> *rotation, <span class="keyword">const</span> <span class="keywordtype">float</span> *scale, <span class="keywordtype">float</span> *matrix);</div><div class="line"><a name="l00142"></a><span class="lineno"> 142</span> </div><div class="line"><a name="l00143"></a><span class="lineno"> 143</span>  IMGUI_API <span class="keywordtype">void</span> SetRect(<span class="keywordtype">float</span> x, <span class="keywordtype">float</span> y, <span class="keywordtype">float</span> width, <span class="keywordtype">float</span> height);</div><div class="line"><a name="l00144"></a><span class="lineno"> 144</span> </div><div class="line"><a name="l00145"></a><span class="lineno"> 145</span>  <span class="comment">// Render a cube with face color corresponding to face normal. Usefull for debug/tests</span></div><div class="line"><a name="l00146"></a><span class="lineno"> 146</span>  IMGUI_API <span class="keywordtype">void</span> DrawCube(<span class="keyword">const</span> <span class="keywordtype">float</span> *view, <span class="keyword">const</span> <span class="keywordtype">float</span> *projection, <span class="keywordtype">float</span> *matrix);</div><div class="line"><a name="l00147"></a><span class="lineno"> 147</span> </div><div class="line"><a name="l00148"></a><span class="lineno"> 148</span>  <span class="comment">// call it when you want a gizmo</span></div><div class="line"><a name="l00149"></a><span class="lineno"> 149</span>  <span class="comment">// Needs view and projection matrices.</span></div><div class="line"><a name="l00150"></a><span class="lineno"> 150</span>  <span class="comment">// matrix parameter is the source matrix (where will be gizmo be drawn) and might be transformed by the function. Return deltaMatrix is optional</span></div><div class="line"><a name="l00151"></a><span class="lineno"> 151</span>  <span class="comment">// translation is applied in world space</span></div><div class="line"><a name="l00152"></a><span class="lineno"> 152</span>  <span class="keyword">enum</span> OPERATION</div><div class="line"><a name="l00153"></a><span class="lineno"> 153</span>  {</div><div class="line"><a name="l00154"></a><span class="lineno"> 154</span>  TRANSLATE,</div><div class="line"><a name="l00155"></a><span class="lineno"> 155</span>  ROTATE,</div><div class="line"><a name="l00156"></a><span class="lineno"> 156</span>  SCALE</div><div class="line"><a name="l00157"></a><span class="lineno"> 157</span>  };</div><div class="line"><a name="l00158"></a><span class="lineno"> 158</span> </div><div class="line"><a name="l00159"></a><span class="lineno"> 159</span>  <span class="keyword">enum</span> MODE</div><div class="line"><a name="l00160"></a><span class="lineno"> 160</span>  {</div><div class="line"><a name="l00161"></a><span class="lineno"> 161</span>  LOCAL,</div><div class="line"><a name="l00162"></a><span class="lineno"> 162</span>  WORLD</div><div class="line"><a name="l00163"></a><span class="lineno"> 163</span>  };</div><div class="line"><a name="l00164"></a><span class="lineno"> 164</span> </div><div class="line"><a name="l00165"></a><span class="lineno"> 165</span>  IMGUI_API <span class="keywordtype">void</span> Manipulate(<span class="keyword">const</span> <span class="keywordtype">float</span> *view, <span class="keyword">const</span> <span class="keywordtype">float</span> *projection, OPERATION operation, MODE mode, <span class="keywordtype">float</span> *matrix, <span class="keywordtype">float</span> *deltaMatrix = 0, <span class="keywordtype">float</span> *snap = 0, <span class="keywordtype">float</span> *localBounds = NULL, <span class="keywordtype">float</span> *boundsSnap = NULL);</div><div class="line"><a name="l00166"></a><span class="lineno"> 166</span> }</div><div class="ttc" id="namespace_im_guizmo_html"><div class="ttname"><a href="namespace_im_guizmo.html">ImGuizmo</a></div><div class="ttdef"><b>Definition:</b> ImGuizmo.cpp:31</div></div>
</div><!-- fragment --></div><!-- contents -->
<div id="footer">
<!-- <address>
<small>
Copyright © 2013
</small>
</address> -->
</div>
</body>
</html>