aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/libraries/irrlicht-1.8/doc/html/line3d_8h_source.html
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--libraries/irrlicht-1.8/doc/html/line3d_8h_source.html237
1 files changed, 237 insertions, 0 deletions
diff --git a/libraries/irrlicht-1.8/doc/html/line3d_8h_source.html b/libraries/irrlicht-1.8/doc/html/line3d_8h_source.html
new file mode 100644
index 0000000..7711cb2
--- /dev/null
+++ b/libraries/irrlicht-1.8/doc/html/line3d_8h_source.html
@@ -0,0 +1,237 @@
1<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
2<html xmlns="http://www.w3.org/1999/xhtml">
3<head>
4<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
5<title>Irrlicht 3D Engine: line3d.h Source File</title>
6
7<link href="tabs.css" rel="stylesheet" type="text/css"/>
8<link href="doxygen.css" rel="stylesheet" type="text/css" />
9<link href="navtree.css" rel="stylesheet" type="text/css"/>
10<script type="text/javascript" src="jquery.js"></script>
11<script type="text/javascript" src="resize.js"></script>
12<script type="text/javascript" src="navtree.js"></script>
13<script type="text/javascript">
14 $(document).ready(initResizable);
15</script>
16<link href="search/search.css" rel="stylesheet" type="text/css"/>
17<script type="text/javascript" src="search/search.js"></script>
18<script type="text/javascript">
19 $(document).ready(function() { searchBox.OnSelectItem(0); });
20</script>
21
22</head>
23<body>
24<div id="top"><!-- do not remove this div! -->
25
26
27<div id="titlearea">
28<table cellspacing="0" cellpadding="0">
29 <tbody>
30 <tr style="height: 56px;">
31
32 <td id="projectlogo"><img alt="Logo" src="irrlichtlogo.png"/></td>
33
34
35 <td style="padding-left: 0.5em;">
36 <div id="projectname">Irrlicht 3D Engine
37
38 </div>
39
40 </td>
41
42
43
44
45 <td> <div id="MSearchBox" class="MSearchBoxInactive">
46 <span class="left">
47 <img id="MSearchSelect" src="search/mag_sel.png"
48 onmouseover="return searchBox.OnSearchSelectShow()"
49 onmouseout="return searchBox.OnSearchSelectHide()"
50 alt=""/>
51 <input type="text" id="MSearchField" value="Search" accesskey="S"
52 onfocus="searchBox.OnSearchFieldFocus(true)"
53 onblur="searchBox.OnSearchFieldFocus(false)"
54 onkeyup="searchBox.OnSearchFieldChange(event)"/>
55 </span><span class="right">
56 <a id="MSearchClose" href="javascript:searchBox.CloseResultsWindow()"><img id="MSearchCloseImg" border="0" src="search/close.png" alt=""/></a>
57 </span>
58 </div>
59</td>
60
61
62 </tr>
63 </tbody>
64</table>
65</div>
66
67<!-- Generated by Doxygen 1.7.5.1 -->
68<script type="text/javascript">
69var searchBox = new SearchBox("searchBox", "search",false,'Search');
70</script>
71<script type="text/javascript" src="dynsections.js"></script>
72</div>
73<div id="side-nav" class="ui-resizable side-nav-resizable">
74 <div id="nav-tree">
75 <div id="nav-tree-contents">
76 </div>
77 </div>
78 <div id="splitbar" style="-moz-user-select:none;"
79 class="ui-resizable-handle">
80 </div>
81</div>
82<script type="text/javascript">
83 initNavTree('line3d_8h.html','');
84</script>
85<div id="doc-content">
86<div class="header">
87 <div class="headertitle">
88<div class="title">line3d.h</div> </div>
89</div>
90<div class="contents">
91<a href="line3d_8h.html">Go to the documentation of this file.</a><div class="fragment"><pre class="fragment"><a name="l00001"></a>00001 <span class="comment">// Copyright (C) 2002-2012 Nikolaus Gebhardt</span>
92<a name="l00002"></a>00002 <span class="comment">// This file is part of the &quot;Irrlicht Engine&quot;.</span>
93<a name="l00003"></a>00003 <span class="comment">// For conditions of distribution and use, see copyright notice in irrlicht.h</span>
94<a name="l00004"></a>00004
95<a name="l00005"></a>00005 <span class="preprocessor">#ifndef __IRR_LINE_3D_H_INCLUDED__</span>
96<a name="l00006"></a>00006 <span class="preprocessor"></span><span class="preprocessor">#define __IRR_LINE_3D_H_INCLUDED__</span>
97<a name="l00007"></a>00007 <span class="preprocessor"></span>
98<a name="l00008"></a>00008 <span class="preprocessor">#include &quot;<a class="code" href="irr_types_8h.html">irrTypes.h</a>&quot;</span>
99<a name="l00009"></a>00009 <span class="preprocessor">#include &quot;<a class="code" href="vector3d_8h.html">vector3d.h</a>&quot;</span>
100<a name="l00010"></a>00010
101<a name="l00011"></a>00011 <span class="keyword">namespace </span>irr
102<a name="l00012"></a>00012 {
103<a name="l00013"></a>00013 <span class="keyword">namespace </span>core
104<a name="l00014"></a>00014 {
105<a name="l00015"></a>00015
106<a name="l00017"></a>00017 <span class="keyword">template</span> &lt;<span class="keyword">class</span> T&gt;
107<a name="l00018"></a><a class="code" href="classirr_1_1core_1_1line3d.html">00018</a> <span class="keyword">class </span><a class="code" href="classirr_1_1core_1_1line3d.html" title="3D line between two points with intersection methods.">line3d</a>
108<a name="l00019"></a>00019 {
109<a name="l00020"></a>00020 <span class="keyword">public</span>:
110<a name="l00021"></a>00021
111<a name="l00023"></a>00023
112<a name="l00024"></a><a class="code" href="classirr_1_1core_1_1line3d.html#ab88640572a102a9eebd1bf483b7d7e75">00024</a> <a class="code" href="classirr_1_1core_1_1line3d.html#ab88640572a102a9eebd1bf483b7d7e75" title="Default constructor.">line3d</a>() : <a class="code" href="classirr_1_1core_1_1line3d.html#a8874f77324b6ef6632e66b22051a3251" title="Start point of line.">start</a>(0,0,0), <a class="code" href="classirr_1_1core_1_1line3d.html#aea19cb33971bb20e1d736facdae8a8f0" title="End point of line.">end</a>(1,1,1) {}
113<a name="l00026"></a><a class="code" href="classirr_1_1core_1_1line3d.html#a19bc6c5661d8913ac6911b2513f7804f">00026</a> <a class="code" href="classirr_1_1core_1_1line3d.html#a19bc6c5661d8913ac6911b2513f7804f" title="Constructor with two points.">line3d</a>(T xa, T ya, T za, T xb, T yb, T zb) : <a class="code" href="classirr_1_1core_1_1line3d.html#a8874f77324b6ef6632e66b22051a3251" title="Start point of line.">start</a>(xa, ya, za), <a class="code" href="classirr_1_1core_1_1line3d.html#aea19cb33971bb20e1d736facdae8a8f0" title="End point of line.">end</a>(xb, yb, zb) {}
114<a name="l00028"></a><a class="code" href="classirr_1_1core_1_1line3d.html#a9f77afda569d38afe68c9c3db39037f4">00028</a> <a class="code" href="classirr_1_1core_1_1line3d.html#a9f77afda569d38afe68c9c3db39037f4" title="Constructor with two points as vectors.">line3d</a>(<span class="keyword">const</span> <a class="code" href="classirr_1_1core_1_1vector3d.html" title="3d vector template class with lots of operators and methods.">vector3d&lt;T&gt;</a>&amp; <a class="code" href="classirr_1_1core_1_1line3d.html#a8874f77324b6ef6632e66b22051a3251" title="Start point of line.">start</a>, <span class="keyword">const</span> <a class="code" href="classirr_1_1core_1_1vector3d.html" title="3d vector template class with lots of operators and methods.">vector3d&lt;T&gt;</a>&amp; <a class="code" href="classirr_1_1core_1_1line3d.html#aea19cb33971bb20e1d736facdae8a8f0" title="End point of line.">end</a>) : start(start), end(end) {}
115<a name="l00029"></a>00029
116<a name="l00030"></a>00030 <span class="comment">// operators</span>
117<a name="l00031"></a>00031
118<a name="l00032"></a><a class="code" href="classirr_1_1core_1_1line3d.html#a1a83fbe4b2ac9a0e0127bc379bfcfa0a">00032</a> <a class="code" href="classirr_1_1core_1_1line3d.html" title="3D line between two points with intersection methods.">line3d&lt;T&gt;</a> <a class="code" href="classirr_1_1core_1_1line3d.html#a1a83fbe4b2ac9a0e0127bc379bfcfa0a">operator+</a>(<span class="keyword">const</span> <a class="code" href="classirr_1_1core_1_1vector3d.html" title="3d vector template class with lots of operators and methods.">vector3d&lt;T&gt;</a>&amp; point)<span class="keyword"> const </span>{ <span class="keywordflow">return</span> <a class="code" href="classirr_1_1core_1_1line3d.html" title="3D line between two points with intersection methods.">line3d&lt;T&gt;</a>(<a class="code" href="classirr_1_1core_1_1line3d.html#a8874f77324b6ef6632e66b22051a3251" title="Start point of line.">start</a> + point, <a class="code" href="classirr_1_1core_1_1line3d.html#aea19cb33971bb20e1d736facdae8a8f0" title="End point of line.">end</a> + point); }
119<a name="l00033"></a><a class="code" href="classirr_1_1core_1_1line3d.html#a087964aee6bc9250364a2419c4fd8bcd">00033</a> <a class="code" href="classirr_1_1core_1_1line3d.html" title="3D line between two points with intersection methods.">line3d&lt;T&gt;</a>&amp; <a class="code" href="classirr_1_1core_1_1line3d.html#a087964aee6bc9250364a2419c4fd8bcd">operator+=</a>(<span class="keyword">const</span> <a class="code" href="classirr_1_1core_1_1vector3d.html" title="3d vector template class with lots of operators and methods.">vector3d&lt;T&gt;</a>&amp; point) { <a class="code" href="classirr_1_1core_1_1line3d.html#a8874f77324b6ef6632e66b22051a3251" title="Start point of line.">start</a> += point; <a class="code" href="classirr_1_1core_1_1line3d.html#aea19cb33971bb20e1d736facdae8a8f0" title="End point of line.">end</a> += point; <span class="keywordflow">return</span> *<span class="keyword">this</span>; }
120<a name="l00034"></a>00034
121<a name="l00035"></a><a class="code" href="classirr_1_1core_1_1line3d.html#a3b068104309f8eb6ed8ae3f8ad9c0536">00035</a> <a class="code" href="classirr_1_1core_1_1line3d.html" title="3D line between two points with intersection methods.">line3d&lt;T&gt;</a> <a class="code" href="classirr_1_1core_1_1line3d.html#a3b068104309f8eb6ed8ae3f8ad9c0536">operator-</a>(<span class="keyword">const</span> <a class="code" href="classirr_1_1core_1_1vector3d.html" title="3d vector template class with lots of operators and methods.">vector3d&lt;T&gt;</a>&amp; point)<span class="keyword"> const </span>{ <span class="keywordflow">return</span> <a class="code" href="classirr_1_1core_1_1line3d.html" title="3D line between two points with intersection methods.">line3d&lt;T&gt;</a>(<a class="code" href="classirr_1_1core_1_1line3d.html#a8874f77324b6ef6632e66b22051a3251" title="Start point of line.">start</a> - point, <a class="code" href="classirr_1_1core_1_1line3d.html#aea19cb33971bb20e1d736facdae8a8f0" title="End point of line.">end</a> - point); }
122<a name="l00036"></a><a class="code" href="classirr_1_1core_1_1line3d.html#aef9ba9ecbfac940e2d221f67015774ce">00036</a> <a class="code" href="classirr_1_1core_1_1line3d.html" title="3D line between two points with intersection methods.">line3d&lt;T&gt;</a>&amp; <a class="code" href="classirr_1_1core_1_1line3d.html#aef9ba9ecbfac940e2d221f67015774ce">operator-=</a>(<span class="keyword">const</span> <a class="code" href="classirr_1_1core_1_1vector3d.html" title="3d vector template class with lots of operators and methods.">vector3d&lt;T&gt;</a>&amp; point) { <a class="code" href="classirr_1_1core_1_1line3d.html#a8874f77324b6ef6632e66b22051a3251" title="Start point of line.">start</a> -= point; <a class="code" href="classirr_1_1core_1_1line3d.html#aea19cb33971bb20e1d736facdae8a8f0" title="End point of line.">end</a> -= point; <span class="keywordflow">return</span> *<span class="keyword">this</span>; }
123<a name="l00037"></a>00037
124<a name="l00038"></a><a class="code" href="classirr_1_1core_1_1line3d.html#a4d0d98986e6bffdf0bb943e103707c65">00038</a> <span class="keywordtype">bool</span> <a class="code" href="classirr_1_1core_1_1line3d.html#a4d0d98986e6bffdf0bb943e103707c65">operator==</a>(<span class="keyword">const</span> <a class="code" href="classirr_1_1core_1_1line3d.html" title="3D line between two points with intersection methods.">line3d&lt;T&gt;</a>&amp; other)<span class="keyword"> const</span>
125<a name="l00039"></a>00039 <span class="keyword"> </span>{ <span class="keywordflow">return</span> (<a class="code" href="classirr_1_1core_1_1line3d.html#a8874f77324b6ef6632e66b22051a3251" title="Start point of line.">start</a>==other.<a class="code" href="classirr_1_1core_1_1line3d.html#a8874f77324b6ef6632e66b22051a3251" title="Start point of line.">start</a> &amp;&amp; <a class="code" href="classirr_1_1core_1_1line3d.html#aea19cb33971bb20e1d736facdae8a8f0" title="End point of line.">end</a>==other.<a class="code" href="classirr_1_1core_1_1line3d.html#aea19cb33971bb20e1d736facdae8a8f0" title="End point of line.">end</a>) || (<a class="code" href="classirr_1_1core_1_1line3d.html#aea19cb33971bb20e1d736facdae8a8f0" title="End point of line.">end</a>==other.<a class="code" href="classirr_1_1core_1_1line3d.html#a8874f77324b6ef6632e66b22051a3251" title="Start point of line.">start</a> &amp;&amp; <a class="code" href="classirr_1_1core_1_1line3d.html#a8874f77324b6ef6632e66b22051a3251" title="Start point of line.">start</a>==other.<a class="code" href="classirr_1_1core_1_1line3d.html#aea19cb33971bb20e1d736facdae8a8f0" title="End point of line.">end</a>);}
126<a name="l00040"></a><a class="code" href="classirr_1_1core_1_1line3d.html#ad73e0c54bfaded49c81b618c6caf3284">00040</a> <span class="keywordtype">bool</span> <a class="code" href="classirr_1_1core_1_1line3d.html#ad73e0c54bfaded49c81b618c6caf3284">operator!=</a>(<span class="keyword">const</span> <a class="code" href="classirr_1_1core_1_1line3d.html" title="3D line between two points with intersection methods.">line3d&lt;T&gt;</a>&amp; other)<span class="keyword"> const</span>
127<a name="l00041"></a>00041 <span class="keyword"> </span>{ <span class="keywordflow">return</span> !(<a class="code" href="classirr_1_1core_1_1line3d.html#a8874f77324b6ef6632e66b22051a3251" title="Start point of line.">start</a>==other.<a class="code" href="classirr_1_1core_1_1line3d.html#a8874f77324b6ef6632e66b22051a3251" title="Start point of line.">start</a> &amp;&amp; <a class="code" href="classirr_1_1core_1_1line3d.html#aea19cb33971bb20e1d736facdae8a8f0" title="End point of line.">end</a>==other.<a class="code" href="classirr_1_1core_1_1line3d.html#aea19cb33971bb20e1d736facdae8a8f0" title="End point of line.">end</a>) || (<a class="code" href="classirr_1_1core_1_1line3d.html#aea19cb33971bb20e1d736facdae8a8f0" title="End point of line.">end</a>==other.<a class="code" href="classirr_1_1core_1_1line3d.html#a8874f77324b6ef6632e66b22051a3251" title="Start point of line.">start</a> &amp;&amp; <a class="code" href="classirr_1_1core_1_1line3d.html#a8874f77324b6ef6632e66b22051a3251" title="Start point of line.">start</a>==other.<a class="code" href="classirr_1_1core_1_1line3d.html#aea19cb33971bb20e1d736facdae8a8f0" title="End point of line.">end</a>);}
128<a name="l00042"></a>00042
129<a name="l00043"></a>00043 <span class="comment">// functions</span>
130<a name="l00045"></a><a class="code" href="classirr_1_1core_1_1line3d.html#aa691426799bff0ccf37bc09f56b8fa59">00045</a> <span class="comment"></span> <span class="keywordtype">void</span> <a class="code" href="classirr_1_1core_1_1line3d.html#aa691426799bff0ccf37bc09f56b8fa59" title="Set this line to a new line going through the two points.">setLine</a>(<span class="keyword">const</span> T&amp; xa, <span class="keyword">const</span> T&amp; ya, <span class="keyword">const</span> T&amp; za, <span class="keyword">const</span> T&amp; xb, <span class="keyword">const</span> T&amp; yb, <span class="keyword">const</span> T&amp; zb)
131<a name="l00046"></a>00046 {<a class="code" href="classirr_1_1core_1_1line3d.html#a8874f77324b6ef6632e66b22051a3251" title="Start point of line.">start</a>.set(xa, ya, za); <a class="code" href="classirr_1_1core_1_1line3d.html#aea19cb33971bb20e1d736facdae8a8f0" title="End point of line.">end</a>.set(xb, yb, zb);}
132<a name="l00048"></a><a class="code" href="classirr_1_1core_1_1line3d.html#af66862d06acc114567e1e0cfaa23f429">00048</a> <span class="keywordtype">void</span> <a class="code" href="classirr_1_1core_1_1line3d.html#aa691426799bff0ccf37bc09f56b8fa59" title="Set this line to a new line going through the two points.">setLine</a>(<span class="keyword">const</span> <a class="code" href="classirr_1_1core_1_1vector3d.html" title="3d vector template class with lots of operators and methods.">vector3d&lt;T&gt;</a>&amp; nstart, <span class="keyword">const</span> <a class="code" href="classirr_1_1core_1_1vector3d.html" title="3d vector template class with lots of operators and methods.">vector3d&lt;T&gt;</a>&amp; nend)
133<a name="l00049"></a>00049 {<a class="code" href="classirr_1_1core_1_1line3d.html#a8874f77324b6ef6632e66b22051a3251" title="Start point of line.">start</a>.set(nstart); <a class="code" href="classirr_1_1core_1_1line3d.html#aea19cb33971bb20e1d736facdae8a8f0" title="End point of line.">end</a>.set(nend);}
134<a name="l00051"></a><a class="code" href="classirr_1_1core_1_1line3d.html#a75d2a9f34ca66c2a1399f8b9fe0fa760">00051</a> <span class="keywordtype">void</span> <a class="code" href="classirr_1_1core_1_1line3d.html#aa691426799bff0ccf37bc09f56b8fa59" title="Set this line to a new line going through the two points.">setLine</a>(<span class="keyword">const</span> <a class="code" href="classirr_1_1core_1_1line3d.html" title="3D line between two points with intersection methods.">line3d&lt;T&gt;</a>&amp; line)
135<a name="l00052"></a>00052 {<a class="code" href="classirr_1_1core_1_1line3d.html#a8874f77324b6ef6632e66b22051a3251" title="Start point of line.">start</a>.set(line.<a class="code" href="classirr_1_1core_1_1line3d.html#a8874f77324b6ef6632e66b22051a3251" title="Start point of line.">start</a>); <a class="code" href="classirr_1_1core_1_1line3d.html#aea19cb33971bb20e1d736facdae8a8f0" title="End point of line.">end</a>.set(line.<a class="code" href="classirr_1_1core_1_1line3d.html#aea19cb33971bb20e1d736facdae8a8f0" title="End point of line.">end</a>);}
136<a name="l00053"></a>00053
137<a name="l00055"></a>00055
138<a name="l00056"></a><a class="code" href="classirr_1_1core_1_1line3d.html#abbcbf8958f99c0204c54024322c07a03">00056</a> T <a class="code" href="classirr_1_1core_1_1line3d.html#abbcbf8958f99c0204c54024322c07a03" title="Get length of line.">getLength</a>()<span class="keyword"> const </span>{ <span class="keywordflow">return</span> <a class="code" href="classirr_1_1core_1_1line3d.html#a8874f77324b6ef6632e66b22051a3251" title="Start point of line.">start</a>.getDistanceFrom(<a class="code" href="classirr_1_1core_1_1line3d.html#aea19cb33971bb20e1d736facdae8a8f0" title="End point of line.">end</a>); }
139<a name="l00057"></a>00057
140<a name="l00059"></a>00059
141<a name="l00060"></a><a class="code" href="classirr_1_1core_1_1line3d.html#ab5f46ffef60794e9755fc33fdc3a0408">00060</a> T <a class="code" href="classirr_1_1core_1_1line3d.html#ab5f46ffef60794e9755fc33fdc3a0408" title="Get squared length of line.">getLengthSQ</a>()<span class="keyword"> const </span>{ <span class="keywordflow">return</span> <a class="code" href="classirr_1_1core_1_1line3d.html#a8874f77324b6ef6632e66b22051a3251" title="Start point of line.">start</a>.getDistanceFromSQ(<a class="code" href="classirr_1_1core_1_1line3d.html#aea19cb33971bb20e1d736facdae8a8f0" title="End point of line.">end</a>); }
142<a name="l00061"></a>00061
143<a name="l00063"></a>00063
144<a name="l00064"></a><a class="code" href="classirr_1_1core_1_1line3d.html#a2d4f769eb73ef41e3223dc0b2713a759">00064</a> <a class="code" href="classirr_1_1core_1_1vector3d.html" title="3d vector template class with lots of operators and methods.">vector3d&lt;T&gt;</a> <a class="code" href="classirr_1_1core_1_1line3d.html#a2d4f769eb73ef41e3223dc0b2713a759" title="Get middle of line.">getMiddle</a>()<span class="keyword"> const</span>
145<a name="l00065"></a>00065 <span class="keyword"> </span>{
146<a name="l00066"></a>00066 <span class="keywordflow">return</span> (<a class="code" href="classirr_1_1core_1_1line3d.html#a8874f77324b6ef6632e66b22051a3251" title="Start point of line.">start</a> + <a class="code" href="classirr_1_1core_1_1line3d.html#aea19cb33971bb20e1d736facdae8a8f0" title="End point of line.">end</a>)/(T)2;
147<a name="l00067"></a>00067 }
148<a name="l00068"></a>00068
149<a name="l00070"></a>00070
150<a name="l00071"></a><a class="code" href="classirr_1_1core_1_1line3d.html#a1394b59b713cec4044259d1999bbcc80">00071</a> <a class="code" href="classirr_1_1core_1_1vector3d.html" title="3d vector template class with lots of operators and methods.">vector3d&lt;T&gt;</a> <a class="code" href="classirr_1_1core_1_1line3d.html#a1394b59b713cec4044259d1999bbcc80" title="Get vector of line.">getVector</a>()<span class="keyword"> const</span>
151<a name="l00072"></a>00072 <span class="keyword"> </span>{
152<a name="l00073"></a>00073 <span class="keywordflow">return</span> <a class="code" href="classirr_1_1core_1_1line3d.html#aea19cb33971bb20e1d736facdae8a8f0" title="End point of line.">end</a> - <a class="code" href="classirr_1_1core_1_1line3d.html#a8874f77324b6ef6632e66b22051a3251" title="Start point of line.">start</a>;
153<a name="l00074"></a>00074 }
154<a name="l00075"></a>00075
155<a name="l00077"></a>00077
156<a name="l00081"></a><a class="code" href="classirr_1_1core_1_1line3d.html#a1f51d4736b808a665697fba776818239">00081</a> <span class="keywordtype">bool</span> <a class="code" href="classirr_1_1core_1_1line3d.html#a1f51d4736b808a665697fba776818239" title="Check if the given point is between start and end of the line.">isPointBetweenStartAndEnd</a>(<span class="keyword">const</span> <a class="code" href="classirr_1_1core_1_1vector3d.html" title="3d vector template class with lots of operators and methods.">vector3d&lt;T&gt;</a>&amp; point)<span class="keyword"> const</span>
157<a name="l00082"></a>00082 <span class="keyword"> </span>{
158<a name="l00083"></a>00083 <span class="keywordflow">return</span> point.<a class="code" href="classirr_1_1core_1_1vector3d.html#ace05ee3b68b47c2ec6baff0d9d64de98" title="Returns if this vector interpreted as a point is on a line between two other points.">isBetweenPoints</a>(<a class="code" href="classirr_1_1core_1_1line3d.html#a8874f77324b6ef6632e66b22051a3251" title="Start point of line.">start</a>, <a class="code" href="classirr_1_1core_1_1line3d.html#aea19cb33971bb20e1d736facdae8a8f0" title="End point of line.">end</a>);
159<a name="l00084"></a>00084 }
160<a name="l00085"></a>00085
161<a name="l00087"></a>00087
162<a name="l00089"></a><a class="code" href="classirr_1_1core_1_1line3d.html#afae16456838c8e8f88f71fe1480967e8">00089</a> <a class="code" href="classirr_1_1core_1_1vector3d.html" title="3d vector template class with lots of operators and methods.">vector3d&lt;T&gt;</a> <a class="code" href="classirr_1_1core_1_1line3d.html#afae16456838c8e8f88f71fe1480967e8" title="Get the closest point on this line to a point.">getClosestPoint</a>(<span class="keyword">const</span> <a class="code" href="classirr_1_1core_1_1vector3d.html" title="3d vector template class with lots of operators and methods.">vector3d&lt;T&gt;</a>&amp; point)<span class="keyword"> const</span>
163<a name="l00090"></a>00090 <span class="keyword"> </span>{
164<a name="l00091"></a>00091 <a class="code" href="classirr_1_1core_1_1vector3d.html" title="3d vector template class with lots of operators and methods.">vector3d&lt;T&gt;</a> c = point - <a class="code" href="classirr_1_1core_1_1line3d.html#a8874f77324b6ef6632e66b22051a3251" title="Start point of line.">start</a>;
165<a name="l00092"></a>00092 <a class="code" href="classirr_1_1core_1_1vector3d.html" title="3d vector template class with lots of operators and methods.">vector3d&lt;T&gt;</a> v = <a class="code" href="classirr_1_1core_1_1line3d.html#aea19cb33971bb20e1d736facdae8a8f0" title="End point of line.">end</a> - <a class="code" href="classirr_1_1core_1_1line3d.html#a8874f77324b6ef6632e66b22051a3251" title="Start point of line.">start</a>;
166<a name="l00093"></a>00093 T d = (T)v.<a class="code" href="classirr_1_1core_1_1vector3d.html#ab0f95138bd31d82b5486237c8e49a2d5" title="Get length of the vector.">getLength</a>();
167<a name="l00094"></a>00094 v /= d;
168<a name="l00095"></a>00095 T t = v.<a class="code" href="classirr_1_1core_1_1vector3d.html#a0b247d39047c0e51ff16d0118bb396ab" title="Get the dot product with another vector.">dotProduct</a>(c);
169<a name="l00096"></a>00096
170<a name="l00097"></a>00097 <span class="keywordflow">if</span> (t &lt; (T)0.0)
171<a name="l00098"></a>00098 <span class="keywordflow">return</span> <a class="code" href="classirr_1_1core_1_1line3d.html#a8874f77324b6ef6632e66b22051a3251" title="Start point of line.">start</a>;
172<a name="l00099"></a>00099 <span class="keywordflow">if</span> (t &gt; d)
173<a name="l00100"></a>00100 <span class="keywordflow">return</span> <a class="code" href="classirr_1_1core_1_1line3d.html#aea19cb33971bb20e1d736facdae8a8f0" title="End point of line.">end</a>;
174<a name="l00101"></a>00101
175<a name="l00102"></a>00102 v *= t;
176<a name="l00103"></a>00103 <span class="keywordflow">return</span> start + v;
177<a name="l00104"></a>00104 }
178<a name="l00105"></a>00105
179<a name="l00107"></a>00107
180<a name="l00113"></a><a class="code" href="classirr_1_1core_1_1line3d.html#aaa4419864f37980fc38ae6b618bb0133">00113</a> <span class="keywordtype">bool</span> <a class="code" href="classirr_1_1core_1_1line3d.html#aaa4419864f37980fc38ae6b618bb0133" title="Check if the line intersects with a shpere.">getIntersectionWithSphere</a>(<a class="code" href="classirr_1_1core_1_1vector3d.html" title="3d vector template class with lots of operators and methods.">vector3d&lt;T&gt;</a> sorigin, T sradius, <a class="code" href="namespaceirr.html#a1325b02603ad449f92c68fc640af9b28" title="64 bit floating point variable.">f64</a>&amp; outdistance)<span class="keyword"> const</span>
181<a name="l00114"></a>00114 <span class="keyword"> </span>{
182<a name="l00115"></a>00115 <span class="keyword">const</span> <a class="code" href="classirr_1_1core_1_1vector3d.html" title="3d vector template class with lots of operators and methods.">vector3d&lt;T&gt;</a> q = sorigin - <a class="code" href="classirr_1_1core_1_1line3d.html#a8874f77324b6ef6632e66b22051a3251" title="Start point of line.">start</a>;
183<a name="l00116"></a>00116 T c = q.<a class="code" href="classirr_1_1core_1_1vector3d.html#ab0f95138bd31d82b5486237c8e49a2d5" title="Get length of the vector.">getLength</a>();
184<a name="l00117"></a>00117 T v = q.<a class="code" href="classirr_1_1core_1_1vector3d.html#a0b247d39047c0e51ff16d0118bb396ab" title="Get the dot product with another vector.">dotProduct</a>(<a class="code" href="classirr_1_1core_1_1line3d.html#a1394b59b713cec4044259d1999bbcc80" title="Get vector of line.">getVector</a>().normalize());
185<a name="l00118"></a>00118 T d = sradius * sradius - (c*c - v*v);
186<a name="l00119"></a>00119
187<a name="l00120"></a>00120 <span class="keywordflow">if</span> (d &lt; 0.0)
188<a name="l00121"></a>00121 <span class="keywordflow">return</span> <span class="keyword">false</span>;
189<a name="l00122"></a>00122
190<a name="l00123"></a>00123 outdistance = v - <a class="code" href="namespaceirr_1_1core.html#af2f378cc34a19f5da6fe1d4961646d1d">core::squareroot</a> ( d );
191<a name="l00124"></a>00124 <span class="keywordflow">return</span> <span class="keyword">true</span>;
192<a name="l00125"></a>00125 }
193<a name="l00126"></a>00126
194<a name="l00127"></a>00127 <span class="comment">// member variables</span>
195<a name="l00128"></a>00128
196<a name="l00130"></a><a class="code" href="classirr_1_1core_1_1line3d.html#a8874f77324b6ef6632e66b22051a3251">00130</a> <a class="code" href="classirr_1_1core_1_1vector3d.html" title="3d vector template class with lots of operators and methods.">vector3d&lt;T&gt;</a> <a class="code" href="classirr_1_1core_1_1line3d.html#a8874f77324b6ef6632e66b22051a3251" title="Start point of line.">start</a>;
197<a name="l00132"></a><a class="code" href="classirr_1_1core_1_1line3d.html#aea19cb33971bb20e1d736facdae8a8f0">00132</a> <a class="code" href="classirr_1_1core_1_1vector3d.html" title="3d vector template class with lots of operators and methods.">vector3d&lt;T&gt;</a> <a class="code" href="classirr_1_1core_1_1line3d.html#aea19cb33971bb20e1d736facdae8a8f0" title="End point of line.">end</a>;
198<a name="l00133"></a>00133 };
199<a name="l00134"></a>00134
200<a name="l00136"></a><a class="code" href="namespaceirr_1_1core.html#a384a3bb17659466af5521c7f74cfcea7">00136</a> <span class="keyword">typedef</span> <a class="code" href="classirr_1_1core_1_1line3d.html" title="3D line between two points with intersection methods.">line3d&lt;f32&gt;</a> <a class="code" href="namespaceirr_1_1core.html#a384a3bb17659466af5521c7f74cfcea7" title="Typedef for an f32 line.">line3df</a>;
201<a name="l00138"></a><a class="code" href="namespaceirr_1_1core.html#ad57386c25ccca6be3db210168ae3d00c">00138</a> <span class="keyword">typedef</span> <a class="code" href="classirr_1_1core_1_1line3d.html" title="3D line between two points with intersection methods.">line3d&lt;s32&gt;</a> <a class="code" href="namespaceirr_1_1core.html#ad57386c25ccca6be3db210168ae3d00c" title="Typedef for an integer line.">line3di</a>;
202<a name="l00139"></a>00139
203<a name="l00140"></a>00140 } <span class="comment">// end namespace core</span>
204<a name="l00141"></a>00141 } <span class="comment">// end namespace irr</span>
205<a name="l00142"></a>00142
206<a name="l00143"></a>00143 <span class="preprocessor">#endif</span>
207<a name="l00144"></a>00144 <span class="preprocessor"></span>
208</pre></div></div>
209</div>
210 <div id="nav-path" class="navpath">
211 <ul>
212 <li class="navelem"><a class="el" href="line3d_8h.html">line3d.h</a> </li>
213<!-- window showing the filter options -->
214<div id="MSearchSelectWindow"
215 onmouseover="return searchBox.OnSearchSelectShow()"
216 onmouseout="return searchBox.OnSearchSelectHide()"
217 onkeydown="return searchBox.OnSearchSelectKey(event)">
218<a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(0)"><span class="SelectionMark">&#160;</span>All</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(1)"><span class="SelectionMark">&#160;</span>Classes</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(2)"><span class="SelectionMark">&#160;</span>Namespaces</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(3)"><span class="SelectionMark">&#160;</span>Files</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(4)"><span class="SelectionMark">&#160;</span>Functions</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(5)"><span class="SelectionMark">&#160;</span>Variables</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(6)"><span class="SelectionMark">&#160;</span>Typedefs</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(7)"><span class="SelectionMark">&#160;</span>Enumerations</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(8)"><span class="SelectionMark">&#160;</span>Enumerator</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(9)"><span class="SelectionMark">&#160;</span>Friends</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(10)"><span class="SelectionMark">&#160;</span>Defines</a></div>
219
220<!-- iframe showing the search results (closed by default) -->
221<div id="MSearchResultsWindow">
222<iframe src="javascript:void(0)" frameborder="0"
223 name="MSearchResults" id="MSearchResults">
224</iframe>
225</div>
226
227
228 <li class="footer">
229<a href="http://irrlicht.sourceforge.net" target="_blank">Irrlicht
230Engine</a> Documentation &copy; 2003-2012 by Nikolaus Gebhardt. Generated on Tue Nov 6 2012 11:06:00 for Irrlicht 3D Engine by
231<a href="http://www.doxygen.org/index.html" target="_blank">Doxygen</a> 1.7.5.1 </li>
232 </ul>
233 </div>
234
235
236</body>
237</html>