mirror of
https://github.com/minetest/irrlicht.git
synced 2024-11-16 23:40:25 +01:00
493 lines
116 KiB
HTML
493 lines
116 KiB
HTML
|
<!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"/>
|
||
|
<title>Irrlicht 3D Engine: vector3d.h Source File</title>
|
||
|
|
||
|
<link href="tabs.css" rel="stylesheet" type="text/css"/>
|
||
|
<link href="doxygen.css" rel="stylesheet" type="text/css" />
|
||
|
<link href="navtree.css" rel="stylesheet" type="text/css"/>
|
||
|
<script type="text/javascript" src="jquery.js"></script>
|
||
|
<script type="text/javascript" src="resize.js"></script>
|
||
|
<script type="text/javascript" src="navtree.js"></script>
|
||
|
<script type="text/javascript">
|
||
|
$(document).ready(initResizable);
|
||
|
</script>
|
||
|
<link href="search/search.css" rel="stylesheet" type="text/css"/>
|
||
|
<script type="text/javascript" src="search/search.js"></script>
|
||
|
<script type="text/javascript">
|
||
|
$(document).ready(function() { searchBox.OnSelectItem(0); });
|
||
|
</script>
|
||
|
|
||
|
</head>
|
||
|
<body>
|
||
|
<div id="top"><!-- do not remove this div! -->
|
||
|
|
||
|
|
||
|
<div id="titlearea">
|
||
|
<table cellspacing="0" cellpadding="0">
|
||
|
<tbody>
|
||
|
<tr style="height: 56px;">
|
||
|
|
||
|
<td id="projectlogo"><img alt="Logo" src="irrlichtlogo.png"/></td>
|
||
|
|
||
|
|
||
|
<td style="padding-left: 0.5em;">
|
||
|
<div id="projectname">Irrlicht 3D Engine
|
||
|
|
||
|
</div>
|
||
|
|
||
|
</td>
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
<td> <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>
|
||
|
</td>
|
||
|
|
||
|
|
||
|
</tr>
|
||
|
</tbody>
|
||
|
</table>
|
||
|
</div>
|
||
|
|
||
|
<!-- Generated by Doxygen 1.7.5.1 -->
|
||
|
<script type="text/javascript">
|
||
|
var searchBox = new SearchBox("searchBox", "search",false,'Search');
|
||
|
</script>
|
||
|
<script type="text/javascript" src="dynsections.js"></script>
|
||
|
</div>
|
||
|
<div id="side-nav" class="ui-resizable side-nav-resizable">
|
||
|
<div id="nav-tree">
|
||
|
<div id="nav-tree-contents">
|
||
|
</div>
|
||
|
</div>
|
||
|
<div id="splitbar" style="-moz-user-select:none;"
|
||
|
class="ui-resizable-handle">
|
||
|
</div>
|
||
|
</div>
|
||
|
<script type="text/javascript">
|
||
|
initNavTree('vector3d_8h.html','');
|
||
|
</script>
|
||
|
<div id="doc-content">
|
||
|
<div class="header">
|
||
|
<div class="headertitle">
|
||
|
<div class="title">vector3d.h</div> </div>
|
||
|
</div>
|
||
|
<div class="contents">
|
||
|
<a href="vector3d_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>
|
||
|
<a name="l00002"></a>00002 <span class="comment">// This file is part of the "Irrlicht Engine".</span>
|
||
|
<a name="l00003"></a>00003 <span class="comment">// For conditions of distribution and use, see copyright notice in irrlicht.h</span>
|
||
|
<a name="l00004"></a>00004
|
||
|
<a name="l00005"></a>00005 <span class="preprocessor">#ifndef __IRR_POINT_3D_H_INCLUDED__</span>
|
||
|
<a name="l00006"></a>00006 <span class="preprocessor"></span><span class="preprocessor">#define __IRR_POINT_3D_H_INCLUDED__</span>
|
||
|
<a name="l00007"></a>00007 <span class="preprocessor"></span>
|
||
|
<a name="l00008"></a>00008 <span class="preprocessor">#include "<a class="code" href="irr_math_8h.html">irrMath.h</a>"</span>
|
||
|
<a name="l00009"></a>00009
|
||
|
<a name="l00010"></a>00010 <span class="keyword">namespace </span>irr
|
||
|
<a name="l00011"></a>00011 {
|
||
|
<a name="l00012"></a>00012 <span class="keyword">namespace </span>core
|
||
|
<a name="l00013"></a>00013 {
|
||
|
<a name="l00014"></a>00014
|
||
|
<a name="l00016"></a>00016
|
||
|
<a name="l00021"></a>00021 <span class="keyword">template</span> <<span class="keyword">class</span> T>
|
||
|
<a name="l00022"></a><a class="code" href="classirr_1_1core_1_1vector3d.html">00022</a> <span class="keyword">class </span><a class="code" href="classirr_1_1core_1_1vector3d.html" title="3d vector template class with lots of operators and methods.">vector3d</a>
|
||
|
<a name="l00023"></a>00023 {
|
||
|
<a name="l00024"></a>00024 <span class="keyword">public</span>:
|
||
|
<a name="l00026"></a><a class="code" href="classirr_1_1core_1_1vector3d.html#aed8875ec8b9653857ea87fdb8213daf1">00026</a> <a class="code" href="classirr_1_1core_1_1vector3d.html#aed8875ec8b9653857ea87fdb8213daf1" title="Default constructor (null vector).">vector3d</a>() : <a class="code" href="classirr_1_1core_1_1vector3d.html#a8c9ed06774dc668112bcefacb6e7732b" title="X coordinate of the vector.">X</a>(0), <a class="code" href="classirr_1_1core_1_1vector3d.html#af8f87c2fe0ce717ade7c3d7419302fbd" title="Y coordinate of the vector.">Y</a>(0), <a class="code" href="classirr_1_1core_1_1vector3d.html#ac2beb702e718c3579971348981b220ed" title="Z coordinate of the vector.">Z</a>(0) {}
|
||
|
<a name="l00028"></a><a class="code" href="classirr_1_1core_1_1vector3d.html#a10687f6e33f8f795961a9b8f0a71c79b">00028</a> <a class="code" href="classirr_1_1core_1_1vector3d.html#a10687f6e33f8f795961a9b8f0a71c79b" title="Constructor with three different values.">vector3d</a>(T nx, T ny, T nz) : <a class="code" href="classirr_1_1core_1_1vector3d.html#a8c9ed06774dc668112bcefacb6e7732b" title="X coordinate of the vector.">X</a>(nx), <a class="code" href="classirr_1_1core_1_1vector3d.html#af8f87c2fe0ce717ade7c3d7419302fbd" title="Y coordinate of the vector.">Y</a>(ny), <a class="code" href="classirr_1_1core_1_1vector3d.html#ac2beb702e718c3579971348981b220ed" title="Z coordinate of the vector.">Z</a>(nz) {}
|
||
|
<a name="l00030"></a><a class="code" href="classirr_1_1core_1_1vector3d.html#a08093c70044d66a5c3cdec2522b868f2">00030</a> <span class="keyword">explicit</span> <a class="code" href="classirr_1_1core_1_1vector3d.html#a08093c70044d66a5c3cdec2522b868f2" title="Constructor with the same value for all elements.">vector3d</a>(T n) : <a class="code" href="classirr_1_1core_1_1vector3d.html#a8c9ed06774dc668112bcefacb6e7732b" title="X coordinate of the vector.">X</a>(n), <a class="code" href="classirr_1_1core_1_1vector3d.html#af8f87c2fe0ce717ade7c3d7419302fbd" title="Y coordinate of the vector.">Y</a>(n), <a class="code" href="classirr_1_1core_1_1vector3d.html#ac2beb702e718c3579971348981b220ed" title="Z coordinate of the vector.">Z</a>(n) {}
|
||
|
<a name="l00032"></a><a class="code" href="classirr_1_1core_1_1vector3d.html#a039600f48ce75c9eca6c0899135e60d5">00032</a> <a class="code" href="classirr_1_1core_1_1vector3d.html#a039600f48ce75c9eca6c0899135e60d5" title="Copy constructor.">vector3d</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<T></a>& other) : <a class="code" href="classirr_1_1core_1_1vector3d.html#a8c9ed06774dc668112bcefacb6e7732b" title="X coordinate of the vector.">X</a>(other.<a class="code" href="classirr_1_1core_1_1vector3d.html#a8c9ed06774dc668112bcefacb6e7732b" title="X coordinate of the vector.">X</a>), <a class="code" href="classirr_1_1core_1_1vector3d.html#af8f87c2fe0ce717ade7c3d7419302fbd" title="Y coordinate of the vector.">Y</a>(other.<a class="code" href="classirr_1_1core_1_1vector3d.html#af8f87c2fe0ce717ade7c3d7419302fbd" title="Y coordinate of the vector.">Y</a>), <a class="code" href="classirr_1_1core_1_1vector3d.html#ac2beb702e718c3579971348981b220ed" title="Z coordinate of the vector.">Z</a>(other.<a class="code" href="classirr_1_1core_1_1vector3d.html#ac2beb702e718c3579971348981b220ed" title="Z coordinate of the vector.">Z</a>) {}
|
||
|
<a name="l00033"></a>00033
|
||
|
<a name="l00034"></a>00034 <span class="comment">// operators</span>
|
||
|
<a name="l00035"></a>00035
|
||
|
<a name="l00036"></a><a class="code" href="classirr_1_1core_1_1vector3d.html#acc66a64d3e7ee0b722d155c4e987ecbe">00036</a> <a class="code" href="classirr_1_1core_1_1vector3d.html" title="3d vector template class with lots of operators and methods.">vector3d<T></a> <a class="code" href="classirr_1_1core_1_1vector3d.html#acc66a64d3e7ee0b722d155c4e987ecbe">operator-</a>()<span class="keyword"> const </span>{ <span class="keywordflow">return</span> <a class="code" href="classirr_1_1core_1_1vector3d.html" title="3d vector template class with lots of operators and methods.">vector3d<T></a>(-<a class="code" href="classirr_1_1core_1_1vector3d.html#a8c9ed06774dc668112bcefacb6e7732b" title="X coordinate of the vector.">X</a>, -<a class="code" href="classirr_1_1core_1_1vector3d.html#af8f87c2fe0ce717ade7c3d7419302fbd" title="Y coordinate of the vector.">Y</a>, -<a class="code" href="classirr_1_1core_1_1vector3d.html#ac2beb702e718c3579971348981b220ed" title="Z coordinate of the vector.">Z</a>); }
|
||
|
<a name="l00037"></a>00037
|
||
|
<a name="l00038"></a><a class="code" href="classirr_1_1core_1_1vector3d.html#afaaaf1d22c44ac50d03026cbfc794c42">00038</a> <a class="code" href="classirr_1_1core_1_1vector3d.html" title="3d vector template class with lots of operators and methods.">vector3d<T></a>& <a class="code" href="classirr_1_1core_1_1vector3d.html#afaaaf1d22c44ac50d03026cbfc794c42">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<T></a>& other) { <a class="code" href="classirr_1_1core_1_1vector3d.html#a8c9ed06774dc668112bcefacb6e7732b" title="X coordinate of the vector.">X</a> = other.<a class="code" href="classirr_1_1core_1_1vector3d.html#a8c9ed06774dc668112bcefacb6e7732b" title="X coordinate of the vector.">X</a>; <a class="code" href="classirr_1_1core_1_1vector3d.html#af8f87c2fe0ce717ade7c3d7419302fbd" title="Y coordinate of the vector.">Y</a> = other.<a class="code" href="classirr_1_1core_1_1vector3d.html#af8f87c2fe0ce717ade7c3d7419302fbd" title="Y coordinate of the vector.">Y</a>; <a class="code" href="classirr_1_1core_1_1vector3d.html#ac2beb702e718c3579971348981b220ed" title="Z coordinate of the vector.">Z</a> = other.<a class="code" href="classirr_1_1core_1_1vector3d.html#ac2beb702e718c3579971348981b220ed" title="Z coordinate of the vector.">Z</a>; <span class="keywordflow">return</span> *<span class="keyword">this</span>; }
|
||
|
<a name="l00039"></a>00039
|
||
|
<a name="l00040"></a><a class="code" href="classirr_1_1core_1_1vector3d.html#a19d8592169d08d461a80d0e3c5a27b7f">00040</a> <a class="code" href="classirr_1_1core_1_1vector3d.html" title="3d vector template class with lots of operators and methods.">vector3d<T></a> <a class="code" href="classirr_1_1core_1_1vector3d.html#a19d8592169d08d461a80d0e3c5a27b7f">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<T></a>& other)<span class="keyword"> const </span>{ <span class="keywordflow">return</span> <a class="code" href="classirr_1_1core_1_1vector3d.html" title="3d vector template class with lots of operators and methods.">vector3d<T></a>(<a class="code" href="classirr_1_1core_1_1vector3d.html#a8c9ed06774dc668112bcefacb6e7732b" title="X coordinate of the vector.">X</a> + other.<a class="code" href="classirr_1_1core_1_1vector3d.html#a8c9ed06774dc668112bcefacb6e7732b" title="X coordinate of the vector.">X</a>, <a class="code" href="classirr_1_1core_1_1vector3d.html#af8f87c2fe0ce717ade7c3d7419302fbd" title="Y coordinate of the vector.">Y</a> + other.<a class="code" href="classirr_1_1core_1_1vector3d.html#af8f87c2fe0ce717ade7c3d7419302fbd" title="Y coordinate of the vector.">Y</a>, <a class="code" href="classirr_1_1core_1_1vector3d.html#ac2beb702e718c3579971348981b220ed" title="Z coordinate of the vector.">Z</a> + other.<a class="code" href="classirr_1_1core_1_1vector3d.html#ac2beb702e718c3579971348981b220ed" title="Z coordinate of the vector.">Z</a>); }
|
||
|
<a name="l00041"></a><a class="code" href="classirr_1_1core_1_1vector3d.html#a37360dbe7e5542e1cd3cdb768f250922">00041</a> <a class="code" href="classirr_1_1core_1_1vector3d.html" title="3d vector template class with lots of operators and methods.">vector3d<T></a>& <a class="code" href="classirr_1_1core_1_1vector3d.html#a37360dbe7e5542e1cd3cdb768f250922">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<T></a>& other) { <a class="code" href="classirr_1_1core_1_1vector3d.html#a8c9ed06774dc668112bcefacb6e7732b" title="X coordinate of the vector.">X</a>+=other.<a class="code" href="classirr_1_1core_1_1vector3d.html#a8c9ed06774dc668112bcefacb6e7732b" title="X coordinate of the vector.">X</a>; <a class="code" href="classirr_1_1core_1_1vector3d.html#af8f87c2fe0ce717ade7c3d7419302fbd" title="Y coordinate of the vector.">Y</a>+=other.<a class="code" href="classirr_1_1core_1_1vector3d.html#af8f87c2fe0ce717ade7c3d7419302fbd" title="Y coordinate of the vector.">Y</a>; <a class="code" href="classirr_1_1core_1_1vector3d.html#ac2beb702e718c3579971348981b220ed" title="Z coordinate of the vector.">Z</a>+=other.<a class="code" href="classirr_1_1core_1_1vector3d.html#ac2beb702e718c3579971348981b220ed" title="Z coordinate of the vector.">Z</a>; <span class="keywordflow">return</span> *<span class="keyword">this</span>; }
|
||
|
<a name="l00042"></a><a class="code" href="classirr_1_1core_1_1vector3d.html#a676c089849a119d557e3fd32eb47d2a8">00042</a> <a class="code" href="classirr_1_1core_1_1vector3d.html" title="3d vector template class with lots of operators and methods.">vector3d<T></a> <a class="code" href="classirr_1_1core_1_1vector3d.html#a676c089849a119d557e3fd32eb47d2a8">operator+</a>(<span class="keyword">const</span> T val)<span class="keyword"> const </span>{ <span class="keywordflow">return</span> <a class="code" href="classirr_1_1core_1_1vector3d.html" title="3d vector template class with lots of operators and methods.">vector3d<T></a>(<a class="code" href="classirr_1_1core_1_1vector3d.html#a8c9ed06774dc668112bcefacb6e7732b" title="X coordinate of the vector.">X</a> + val, <a class="code" href="classirr_1_1core_1_1vector3d.html#af8f87c2fe0ce717ade7c3d7419302fbd" title="Y coordinate of the vector.">Y</a> + val, <a class="code" href="classirr_1_1core_1_1vector3d.html#ac2beb702e718c3579971348981b220ed" title="Z coordinate of the vector.">Z</a> + val); }
|
||
|
<a name="l00043"></a><a class="code" href="classirr_1_1core_1_1vector3d.html#a90dd07738795890b90fbf4b133cd7930">00043</a> <a class="code" href="classirr_1_1core_1_1vector3d.html" title="3d vector template class with lots of operators and methods.">vector3d<T></a>& <a class="code" href="classirr_1_1core_1_1vector3d.html#a90dd07738795890b90fbf4b133cd7930">operator+=</a>(<span class="keyword">const</span> T val) { <a class="code" href="classirr_1_1core_1_1vector3d.html#a8c9ed06774dc668112bcefacb6e7732b" title="X coordinate of the vector.">X</a>+=val; <a class="code" href="classirr_1_1core_1_1vector3d.html#af8f87c2fe0ce717ade7c3d7419302fbd" title="Y coordinate of the vector.">Y</a>+=val; <a class="code" href="classirr_1_1core_1_1vector3d.html#ac2beb702e718c3579971348981b220ed" title="Z coordinate of the vector.">Z</a>+=val; <span class="keywordflow">return</span> *<span class="keyword">this</span>; }
|
||
|
<a name="l00044"></a>00044
|
||
|
<a name="l00045"></a><a class="code" href="classirr_1_1core_1_1vector3d.html#ae17fdfbc02988aff60dfde5456c9032d">00045</a> <a class="code" href="classirr_1_1core_1_1vector3d.html" title="3d vector template class with lots of operators and methods.">vector3d<T></a> <a class="code" href="classirr_1_1core_1_1vector3d.html#ae17fdfbc02988aff60dfde5456c9032d">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<T></a>& other)<span class="keyword"> const </span>{ <span class="keywordflow">return</span> <a class="code" href="classirr_1_1core_1_1vector3d.html" title="3d vector template class with lots of operators and methods.">vector3d<T></a>(<a class="code" href="classirr_1_1core_1_1vector3d.html#a8c9ed06774dc668112bcefacb6e7732b" title="X coordinate of the vector.">X</a> - other.<a class="code" href="classirr_1_1core_1_1vector3d.html#a8c9ed06774dc668112bcefacb6e7732b" title="X coordinate of the vector.">X</a>, <a class="code" href="classirr_1_1core_1_1vector3d.html#af8f87c2fe0ce717ade7c3d7419302fbd" title="Y coordinate of the vector.">Y</a> - other.<a class="code" href="classirr_1_1core_1_1vector3d.html#af8f87c2fe0ce717ade7c3d7419302fbd" title="Y coordinate of the vector.">Y</a>, <a class="code" href="classirr_1_1core_1_1vector3d.html#ac2beb702e718c3579971348981b220ed" title="Z coordinate of the vector.">Z</a> - other.<a class="code" href="classirr_1_1core_1_1vector3d.html#ac2beb702e718c3579971348981b220ed" title="Z coordinate of the vector.">Z</a>); }
|
||
|
<a name="l00046"></a><a class="code" href="classirr_1_1core_1_1vector3d.html#a91a4a39544340b3d02e81659f1a0b7d2">00046</a> <a class="code" href="classirr_1_1core_1_1vector3d.html" title="3d vector template class with lots of operators and methods.">vector3d<T></a>& <a class="code" href="classirr_1_1core_1_1vector3d.html#a91a4a39544340b3d02e81659f1a0b7d2">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<T></a>& other) { <a class="code" href="classirr_1_1core_1_1vector3d.html#a8c9ed06774dc668112bcefacb6e7732b" title="X coordinate of the vector.">X</a>-=other.<a class="code" href="classirr_1_1core_1_1vector3d.html#a8c9ed06774dc668112bcefacb6e7732b" title="X coordinate of the vector.">X</a>; <a class="code" href="classirr_1_1core_1_1vector3d.html#af8f87c2fe0ce717ade7c3d7419302fbd" title="Y coordinate of the vector.">Y</a>-=other.<a class="code" href="classirr_1_1core_1_1vector3d.html#af8f87c2fe0ce717ade7c3d7419302fbd" title="Y coordinate of the vector.">Y</a>; <a class="code" href="classirr_1_1core_1_1vector3d.html#ac2beb702e718c3579971348981b220ed" title="Z coordinate of the vector.">Z</a>-=other.<a class="code" href="classirr_1_1core_1_1vector3d.html#ac2beb702e718c3579971348981b220ed" title="Z coordinate of the vector.">Z</a>; <span class="keywordflow">return</span> *<span class="keyword">this</span>; }
|
||
|
<a name="l00047"></a><a class="code" href="classirr_1_1core_1_1vector3d.html#a4c9b7154c6d582cd49039bd4f61c48cb">00047</a> <a class="code" href="classirr_1_1core_1_1vector3d.html" title="3d vector template class with lots of operators and methods.">vector3d<T></a> <a class="code" href="classirr_1_1core_1_1vector3d.html#a4c9b7154c6d582cd49039bd4f61c48cb">operator-</a>(<span class="keyword">const</span> T val)<span class="keyword"> const </span>{ <span class="keywordflow">return</span> <a class="code" href="classirr_1_1core_1_1vector3d.html" title="3d vector template class with lots of operators and methods.">vector3d<T></a>(<a class="code" href="classirr_1_1core_1_1vector3d.html#a8c9ed06774dc668112bcefacb6e7732b" title="X coordinate of the vector.">X</a> - val, <a class="code" href="classirr_1_1core_1_1vector3d.html#af8f87c2fe0ce717ade7c3d7419302fbd" title="Y coordinate of the vector.">Y</a> - val, <a class="code" href="classirr_1_1core_1_1vector3d.html#ac2beb702e718c3579971348981b220ed" title="Z coordinate of the vector.">Z</a> - val); }
|
||
|
<a name="l00048"></a><a class="code" href="classirr_1_1core_1_1vector3d.html#afe666e30d5e903d4d910f2544829233c">00048</a> <a class="code" href="classirr_1_1core_1_1vector3d.html" title="3d vector template class with lots of operators and methods.">vector3d<T></a>& <a class="code" href="classirr_1_1core_1_1vector3d.html#afe666e30d5e903d4d910f2544829233c">operator-=</a>(<span class="keyword">const</span> T val) { <a class="code" href="classirr_1_1core_1_1vector3d.html#a8c9ed06774dc668112bcefacb6e7732b" title="X coordinate of the vector.">X</a>-=val; <a class="code" href="classirr_1_1core_1_1vector3d.html#af8f87c2fe0ce717ade7c3d7419302fbd" title="Y coordinate of the vector.">Y</a>-=val; <a class="code" href="classirr_1_1core_1_1vector3d.html#ac2beb702e718c3579971348981b220ed" title="Z coordinate of the vector.">Z</a>-=val; <span class="keywordflow">return</span> *<span class="keyword">this</span>; }
|
||
|
<a name="l00049"></a>00049
|
||
|
<a name="l00050"></a><a class="code" href="classirr_1_1core_1_1vector3d.html#aab7ded0a282f23cdc75533873f41dee5">00050</a> <a class="code" href="classirr_1_1core_1_1vector3d.html" title="3d vector template class with lots of operators and methods.">vector3d<T></a> <a class="code" href="classirr_1_1core_1_1vector3d.html#aab7ded0a282f23cdc75533873f41dee5">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<T></a>& other)<span class="keyword"> const </span>{ <span class="keywordflow">return</span> <a class="code" href="classirr_1_1core_1_1vector3d.html" title="3d vector template class with lots of operators and methods.">vector3d<T></a>(<a class="code" href="classirr_1_1core_1_1vector3d.html#a8c9ed06774dc668112bcefacb6e7732b" title="X coordinate of the vector.">X</a> * other.<a class="code" href="classirr_1_1core_1_1vector3d.html#a8c9ed06774dc668112bcefacb6e7732b" title="X coordinate of the vector.">X</a>, <a class="code" href="classirr_1_1core_1_1vector3d.html#af8f87c2fe0ce717ade7c3d7419302fbd" title="Y coordinate of the vector.">Y</a> * other.<a class="code" href="classirr_1_1core_1_1vector3d.html#af8f87c2fe0ce717ade7c3d7419302fbd" title="Y coordinate of the vector.">Y</a>, <a class="code" href="classirr_1_1core_1_1vector3d.html#ac2beb702e718c3579971348981b220ed" title="Z coordinate of the vector.">Z</a> * other.<a class="code" href="classirr_1_1core_1_1vector3d.html#ac2beb702e718c3579971348981b220ed" title="Z coordinate of the vector.">Z</a>); }
|
||
|
<a name="l00051"></a><a class="code" href="classirr_1_1core_1_1vector3d.html#a04e89643ddbd6e17ffceffd64e740760">00051</a> <a class="code" href="classirr_1_1core_1_1vector3d.html" title="3d vector template class with lots of operators and methods.">vector3d<T></a>& <a class="code" href="classirr_1_1core_1_1vector3d.html#a04e89643ddbd6e17ffceffd64e740760">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<T></a>& other) { <a class="code" href="classirr_1_1core_1_1vector3d.html#a8c9ed06774dc668112bcefacb6e7732b" title="X coordinate of the vector.">X</a>*=other.<a class="code" href="classirr_1_1core_1_1vector3d.html#a8c9ed06774dc668112bcefacb6e7732b" title="X coordinate of the vector.">X</a>; <a class="code" href="classirr_1_1core_1_1vector3d.html#af8f87c2fe0ce717ade7c3d7419302fbd" title="Y coordinate of the vector.">Y</a>*=other.<a class="code" href="classirr_1_1core_1_1vector3d.html#af8f87c2fe0ce717ade7c3d7419302fbd" title="Y coordinate of the vector.">Y</a>; <a class="code" href="classirr_1_1core_1_1vector3d.html#ac2beb702e718c3579971348981b220ed" title="Z coordinate of the vector.">Z</a>*=other.<a class="code" href="classirr_1_1core_1_1vector3d.html#ac2beb702e718c3579971348981b220ed" title="Z coordinate of the vector.">Z</a>; <span class="keywordflow">return</span> *<span class="keyword">this</span>; }
|
||
|
<a name="l00052"></a><a class="code" href="classirr_1_1core_1_1vector3d.html#ae8ecbd713bd488d45eab406f34679c1c">00052</a> <a class="code" href="classirr_1_1core_1_1vector3d.html" title="3d vector template class with lots of operators and methods.">vector3d<T></a> <a class="code" href="classirr_1_1core_1_1vector3d.html#ae8ecbd713bd488d45eab406f34679c1c">operator*</a>(<span class="keyword">const</span> T v)<span class="keyword"> const </span>{ <span class="keywordflow">return</span> <a class="code" href="classirr_1_1core_1_1vector3d.html" title="3d vector template class with lots of operators and methods.">vector3d<T></a>(<a class="code" href="classirr_1_1core_1_1vector3d.html#a8c9ed06774dc668112bcefacb6e7732b" title="X coordinate of the vector.">X</a> * v, <a class="code" href="classirr_1_1core_1_1vector3d.html#af8f87c2fe0ce717ade7c3d7419302fbd" title="Y coordinate of the vector.">Y</a> * v, <a class="code" href="classirr_1_1core_1_1vector3d.html#ac2beb702e718c3579971348981b220ed" title="Z coordinate of the vector.">Z</a> * v); }
|
||
|
<a name="l00053"></a><a class="code" href="classirr_1_1core_1_1vector3d.html#a588d293d4d3ebd95240a9d2b46072233">00053</a> <a class="code" href="classirr_1_1core_1_1vector3d.html" title="3d vector template class with lots of operators and methods.">vector3d<T></a>& <a class="code" href="classirr_1_1core_1_1vector3d.html#a588d293d4d3ebd95240a9d2b46072233">operator*=</a>(<span class="keyword">const</span> T v) { <a class="code" href="classirr_1_1core_1_1vector3d.html#a8c9ed06774dc668112bcefacb6e7732b" title="X coordinate of the vector.">X</a>*=v; <a class="code" href="classirr_1_1core_1_1vector3d.html#af8f87c2fe0ce717ade7c3d7419302fbd" title="Y coordinate of the vector.">Y</a>*=v; <a class="code" href="classirr_1_1core_1_1vector3d.html#ac2beb702e718c3579971348981b220ed" title="Z coordinate of the vector.">Z</a>*=v; <span class="keywordflow">return</span> *<span class="keyword">this</span>; }
|
||
|
<a name="l00054"></a>00054
|
||
|
<a name="l00055"></a><a class="code" href="classirr_1_1core_1_1vector3d.html#a82f734747a8d460a73482dc69a1d2ece">00055</a> <a class="code" href="classirr_1_1core_1_1vector3d.html" title="3d vector template class with lots of operators and methods.">vector3d<T></a> <a class="code" href="classirr_1_1core_1_1vector3d.html#a82f734747a8d460a73482dc69a1d2ece">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<T></a>& other)<span class="keyword"> const </span>{ <span class="keywordflow">return</span> <a class="code" href="classirr_1_1core_1_1vector3d.html" title="3d vector template class with lots of operators and methods.">vector3d<T></a>(<a class="code" href="classirr_1_1core_1_1vector3d.html#a8c9ed06774dc668112bcefacb6e7732b" title="X coordinate of the vector.">X</a> / other.<a class="code" href="classirr_1_1core_1_1vector3d.html#a8c9ed06774dc668112bcefacb6e7732b" title="X coordinate of the vector.">X</a>, <a class="code" href="classirr_1_1core_1_1vector3d.html#af8f87c2fe0ce717ade7c3d7419302fbd" title="Y coordinate of the vector.">Y</a> / other.<a class="code" href="classirr_1_1core_1_1vector3d.html#af8f87c2fe0ce717ade7c3d7419302fbd" title="Y coordinate of the vector.">Y</a>, <a class="code" href="classirr_1_1core_1_1vector3d.html#ac2beb702e718c3579971348981b220ed" title="Z coordinate of the vector.">Z</a> / other.<a class="code" href="classirr_1_1core_1_1vector3d.html#ac2beb702e718c3579971348981b220ed" title="Z coordinate of the vector.">Z</a>); }
|
||
|
<a name="l00056"></a><a class="code" href="classirr_1_1core_1_1vector3d.html#ab46c94558797997b369cfe0a38c57794">00056</a> <a class="code" href="classirr_1_1core_1_1vector3d.html" title="3d vector template class with lots of operators and methods.">vector3d<T></a>& <a class="code" href="classirr_1_1core_1_1vector3d.html#ab46c94558797997b369cfe0a38c57794">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<T></a>& other) { <a class="code" href="classirr_1_1core_1_1vector3d.html#a8c9ed06774dc668112bcefacb6e7732b" title="X coordinate of the vector.">X</a>/=other.<a class="code" href="classirr_1_1core_1_1vector3d.html#a8c9ed06774dc668112bcefacb6e7732b" title="X coordinate of the vector.">X</a>; <a class="code" href="classirr_1_1core_1_1vector3d.html#af8f87c2fe0ce717ade7c3d7419302fbd" title="Y coordinate of the vector.">Y</a>/=other.<a class="code" href="classirr_1_1core_1_1vector3d.html#af8f87c2fe0ce717ade7c3d7419302fbd" title="Y coordinate of the vector.">Y</a>; <a class="code" href="classirr_1_1core_1_1vector3d.html#ac2beb702e718c3579971348981b220ed" title="Z coordinate of the vector.">Z</a>/=other.<a class="code" href="classirr_1_1core_1_1vector3d.html#ac2beb702e718c3579971348981b220ed" title="Z coordinate of the vector.">Z</a>; <span class="keywordflow">return</span> *<span class="keyword">this</span>; }
|
||
|
<a name="l00057"></a><a class="code" href="classirr_1_1core_1_1vector3d.html#a783084cb15a1a395c54de649544de966">00057</a> <a class="code" href="classirr_1_1core_1_1vector3d.html" title="3d vector template class with lots of operators and methods.">vector3d<T></a> <a class="code" href="classirr_1_1core_1_1vector3d.html#a783084cb15a1a395c54de649544de966">operator/</a>(<span class="keyword">const</span> T v)<span class="keyword"> const </span>{ T i=(T)1.0/v; <span class="keywordflow">return</span> <a class="code" href="classirr_1_1core_1_1vector3d.html" title="3d vector template class with lots of operators and methods.">vector3d<T></a>(<a class="code" href="classirr_1_1core_1_1vector3d.html#a8c9ed06774dc668112bcefacb6e7732b" title="X coordinate of the vector.">X</a> * i, <a class="code" href="classirr_1_1core_1_1vector3d.html#af8f87c2fe0ce717ade7c3d7419302fbd" title="Y coordinate of the vector.">Y</a> * i, <a class="code" href="classirr_1_1core_1_1vector3d.html#ac2beb702e718c3579971348981b220ed" title="Z coordinate of the vector.">Z</a> * i); }
|
||
|
<a name="l00058"></a><a class="code" href="classirr_1_1core_1_1vector3d.html#a6b1f864e2316167a8b5a65ca086c11ff">00058</a> <a class="code" href="classirr_1_1core_1_1vector3d.html" title="3d vector template class with lots of operators and methods.">vector3d<T></a>& <a class="code" href="classirr_1_1core_1_1vector3d.html#a6b1f864e2316167a8b5a65ca086c11ff">operator/=</a>(<span class="keyword">const</span> T v) { T i=(T)1.0/v; <a class="code" href="classirr_1_1core_1_1vector3d.html#a8c9ed06774dc668112bcefacb6e7732b" title="X coordinate of the vector.">X</a>*=i; <a class="code" href="classirr_1_1core_1_1vector3d.html#af8f87c2fe0ce717ade7c3d7419302fbd" title="Y coordinate of the vector.">Y</a>*=i; <a class="code" href="classirr_1_1core_1_1vector3d.html#ac2beb702e718c3579971348981b220ed" title="Z coordinate of the vector.">Z</a>*=i; <span class="keywordflow">return</span> *<span class="keyword">this</span>; }
|
||
|
<a name="l00059"></a>00059
|
||
|
<a name="l00061"></a><a class="code" href="classirr_1_1core_1_1vector3d.html#ad567b75b65cd2ded2312d41f7a5263da">00061</a> <span class="keywordtype">bool</span> operator<=(const vector3d<T>&other) <span class="keyword">const</span>
|
||
|
<a name="l00062"></a>00062 {
|
||
|
<a name="l00063"></a>00063 <span class="keywordflow">return</span> (<a class="code" href="classirr_1_1core_1_1vector3d.html#a8c9ed06774dc668112bcefacb6e7732b" title="X coordinate of the vector.">X</a><other.X || <a class="code" href="namespaceirr_1_1core.html#abf9b9b140cc365908ea4c8c47451e4e3" title="returns if a equals b, taking possible rounding errors into account">core::equals</a>(<a class="code" href="classirr_1_1core_1_1vector3d.html#a8c9ed06774dc668112bcefacb6e7732b" title="X coordinate of the vector.">X</a>, other.X)) ||
|
||
|
<a name="l00064"></a>00064 (<a class="code" href="namespaceirr_1_1core.html#abf9b9b140cc365908ea4c8c47451e4e3" title="returns if a equals b, taking possible rounding errors into account">core::equals</a>(<a class="code" href="classirr_1_1core_1_1vector3d.html#a8c9ed06774dc668112bcefacb6e7732b" title="X coordinate of the vector.">X</a>, other.X) && (<a class="code" href="classirr_1_1core_1_1vector3d.html#af8f87c2fe0ce717ade7c3d7419302fbd" title="Y coordinate of the vector.">Y</a><other.Y || <a class="code" href="classirr_1_1core_1_1vector3d.html#a7aa9401191db377d67a6d5b160e4c38e" title="returns if this vector equals the other one, taking floating point rounding errors into account...">core::equals</a>(<a class="code" href="classirr_1_1core_1_1vector3d.html#af8f87c2fe0ce717ade7c3d7419302fbd" title="Y coordinate of the vector.">Y</a>, other.Y))) ||
|
||
|
<a name="l00065"></a>00065 (<a class="code" href="classirr_1_1core_1_1vector3d.html#a7aa9401191db377d67a6d5b160e4c38e" title="returns if this vector equals the other one, taking floating point rounding errors into account...">core::equals</a>(<a class="code" href="classirr_1_1core_1_1vector3d.html#a8c9ed06774dc668112bcefacb6e7732b" title="X coordinate of the vector.">X</a>, other.X) && <a class="code" href="classirr_1_1core_1_1vector3d.html#a7aa9401191db377d67a6d5b160e4c38e" title="returns if this vector equals the other one, taking floating point rounding errors into account...">core::equals</a>(<a class="code" href="classirr_1_1core_1_1vector3d.html#af8f87c2fe0ce717ade7c3d7419302fbd" title="Y coordinate of the vector.">Y</a>, other.Y) && (<a class="code" href="classirr_1_1core_1_1vector3d.html#ac2beb702e718c3579971348981b220ed" title="Z coordinate of the vector.">Z</a><other.Z || <a class="code" href="classirr_1_1core_1_1vector3d.html#a7aa9401191db377d67a6d5b160e4c38e" title="returns if this vector equals the other one, taking floating point rounding errors into account...">core::equals</a>(<a class="code" href="classirr_1_1core_1_1vector3d.html#ac2beb702e718c3579971348981b220ed" title="Z coordinate of the vector.">Z</a>, other.Z)));
|
||
|
<a name="l00066"></a>00066 }
|
||
|
<a name="l00067"></a>00067
|
||
|
<a name="l00069"></a><a class="code" href="classirr_1_1core_1_1vector3d.html#ab3c1da2da396a7f2ae336fda985cab6d">00069</a> <span class="keywordtype">bool</span> <a class="code" href="classirr_1_1core_1_1vector3d.html#ab3c1da2da396a7f2ae336fda985cab6d" title="sort in order X, Y, Z. Equality with rounding tolerance.">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<T></a>&other)<span class="keyword"> const</span>
|
||
|
<a name="l00070"></a>00070 <span class="keyword"> </span>{
|
||
|
<a name="l00071"></a>00071 <span class="keywordflow">return</span> (<a class="code" href="classirr_1_1core_1_1vector3d.html#a8c9ed06774dc668112bcefacb6e7732b" title="X coordinate of the vector.">X</a>>other.<a class="code" href="classirr_1_1core_1_1vector3d.html#a8c9ed06774dc668112bcefacb6e7732b" title="X coordinate of the vector.">X</a> || <a class="code" href="namespaceirr_1_1core.html#abf9b9b140cc365908ea4c8c47451e4e3" title="returns if a equals b, taking possible rounding errors into account">core::equals</a>(<a class="code" href="classirr_1_1core_1_1vector3d.html#a8c9ed06774dc668112bcefacb6e7732b" title="X coordinate of the vector.">X</a>, other.<a class="code" href="classirr_1_1core_1_1vector3d.html#a8c9ed06774dc668112bcefacb6e7732b" title="X coordinate of the vector.">X</a>)) ||
|
||
|
<a name="l00072"></a>00072 (<a class="code" href="classirr_1_1core_1_1vector3d.html#a7aa9401191db377d67a6d5b160e4c38e" title="returns if this vector equals the other one, taking floating point rounding errors into account...">core::equals</a>(<a class="code" href="classirr_1_1core_1_1vector3d.html#a8c9ed06774dc668112bcefacb6e7732b" title="X coordinate of the vector.">X</a>, other.<a class="code" href="classirr_1_1core_1_1vector3d.html#a8c9ed06774dc668112bcefacb6e7732b" title="X coordinate of the vector.">X</a>) && (<a class="code" href="classirr_1_1core_1_1vector3d.html#af8f87c2fe0ce717ade7c3d7419302fbd" title="Y coordinate of the vector.">Y</a>>other.<a class="code" href="classirr_1_1core_1_1vector3d.html#af8f87c2fe0ce717ade7c3d7419302fbd" title="Y coordinate of the vector.">Y</a> || <a class="code" href="classirr_1_1core_1_1vector3d.html#a7aa9401191db377d67a6d5b160e4c38e" title="returns if this vector equals the other one, taking floating point rounding errors into account...">core::equals</a>(<a class="code" href="classirr_1_1core_1_1vector3d.html#af8f87c2fe0ce717ade7c3d7419302fbd" title="Y coordinate of the vector.">Y</a>, other.<a class="code" href="classirr_1_1core_1_1vector3d.html#af8f87c2fe0ce717ade7c3d7419302fbd" title="Y coordinate of the vector.">Y</a>))) ||
|
||
|
<a name="l00073"></a>00073 (<a class="code" href="classirr_1_1core_1_1vector3d.html#a7aa9401191db377d67a6d5b160e4c38e" title="returns if this vector equals the other one, taking floating point rounding errors into account...">core::equals</a>(<a class="code" href="classirr_1_1core_1_1vector3d.html#a8c9ed06774dc668112bcefacb6e7732b" title="X coordinate of the vector.">X</a>, other.<a class="code" href="classirr_1_1core_1_1vector3d.html#a8c9ed06774dc668112bcefacb6e7732b" title="X coordinate of the vector.">X</a>) && <a class="code" href="classirr_1_1core_1_1vector3d.html#a7aa9401191db377d67a6d5b160e4c38e" title="returns if this vector equals the other one, taking floating point rounding errors into account...">core::equals</a>(<a class="code" href="classirr_1_1core_1_1vector3d.html#af8f87c2fe0ce717ade7c3d7419302fbd" title="Y coordinate of the vector.">Y</a>, other.<a class="code" href="classirr_1_1core_1_1vector3d.html#af8f87c2fe0ce717ade7c3d7419302fbd" title="Y coordinate of the vector.">Y</a>) && (<a class="code" href="classirr_1_1core_1_1vector3d.html#ac2beb702e718c3579971348981b220ed" title="Z coordinate of the vector.">Z</a>>other.<a class="code" href="classirr_1_1core_1_1vector3d.html#ac2beb702e718c3579971348981b220ed" title="Z coordinate of the vector.">Z</a> || <a class="code" href="classirr_1_1core_1_1vector3d.html#a7aa9401191db377d67a6d5b160e4c38e" title="returns if this vector equals the other one, taking floating point rounding errors into account...">core::equals</a>(<a class="code" href="classirr_1_1core_1_1vector3d.html#ac2beb702e718c3579971348981b220ed" title="Z coordinate of the vector.">Z</a>, other.<a class="code" href="classirr_1_1core_1_1vector3d.html#ac2beb702e718c3579971348981b220ed" title="Z coordinate of the vector.">Z</a>)));
|
||
|
<a name="l00074"></a>00074 }
|
||
|
<a name="l00075"></a>00075
|
||
|
<a name="l00077"></a><a class="code" href="classirr_1_1core_1_1vector3d.html#a9ce8b1cf82c64f0985cf668056698519">00077</a> <span class="keywordtype">bool</span> operator<(const vector3d<T>&other) <span class="keyword">const</span>
|
||
|
<a name="l00078"></a>00078 {
|
||
|
<a name="l00079"></a>00079 <span class="keywordflow">return</span> (<a class="code" href="classirr_1_1core_1_1vector3d.html#a8c9ed06774dc668112bcefacb6e7732b" title="X coordinate of the vector.">X</a><other.X && !<a class="code" href="namespaceirr_1_1core.html#abf9b9b140cc365908ea4c8c47451e4e3" title="returns if a equals b, taking possible rounding errors into account">core::equals</a>(<a class="code" href="classirr_1_1core_1_1vector3d.html#a8c9ed06774dc668112bcefacb6e7732b" title="X coordinate of the vector.">X</a>, other.X)) ||
|
||
|
<a name="l00080"></a>00080 (<a class="code" href="namespaceirr_1_1core.html#abf9b9b140cc365908ea4c8c47451e4e3" title="returns if a equals b, taking possible rounding errors into account">core::equals</a>(<a class="code" href="classirr_1_1core_1_1vector3d.html#a8c9ed06774dc668112bcefacb6e7732b" title="X coordinate of the vector.">X</a>, other.X) && <a class="code" href="classirr_1_1core_1_1vector3d.html#af8f87c2fe0ce717ade7c3d7419302fbd" title="Y coordinate of the vector.">Y</a><other.Y && !<a class="code" href="classirr_1_1core_1_1vector3d.html#a7aa9401191db377d67a6d5b160e4c38e" title="returns if this vector equals the other one, taking floating point rounding errors into account...">core::equals</a>(<a class="code" href="classirr_1_1core_1_1vector3d.html#af8f87c2fe0ce717ade7c3d7419302fbd" title="Y coordinate of the vector.">Y</a>, other.Y)) ||
|
||
|
<a name="l00081"></a>00081 (<a class="code" href="namespaceirr_1_1core.html#abf9b9b140cc365908ea4c8c47451e4e3" title="returns if a equals b, taking possible rounding errors into account">core::equals</a>(<a class="code" href="classirr_1_1core_1_1vector3d.html#a8c9ed06774dc668112bcefacb6e7732b" title="X coordinate of the vector.">X</a>, other.X) && <a class="code" href="classirr_1_1core_1_1vector3d.html#a7aa9401191db377d67a6d5b160e4c38e" title="returns if this vector equals the other one, taking floating point rounding errors into account...">core::equals</a>(<a class="code" href="classirr_1_1core_1_1vector3d.html#af8f87c2fe0ce717ade7c3d7419302fbd" title="Y coordinate of the vector.">Y</a>, other.Y) && <a class="code" href="classirr_1_1core_1_1vector3d.html#ac2beb702e718c3579971348981b220ed" title="Z coordinate of the vector.">Z</a><other.Z && !<a class="code" href="classirr_1_1core_1_1vector3d.html#a7aa9401191db377d67a6d5b160e4c38e" title="returns if this vector equals the other one, taking floating point rounding errors into account...">core::equals</a>(<a class="code" href="classirr_1_1core_1_1vector3d.html#ac2beb702e718c3579971348981b220ed" title="Z coordinate of the vector.">Z</a>, other.Z));
|
||
|
<a name="l00082"></a>00082 }
|
||
|
<a name="l00083"></a>00083
|
||
|
<a name="l00085"></a><a class="code" href="classirr_1_1core_1_1vector3d.html#aeabe64473259a894507360f399d7f816">00085</a> <span class="keywordtype">bool</span> <a class="code" href="classirr_1_1core_1_1vector3d.html#aeabe64473259a894507360f399d7f816" title="sort in order X, Y, Z. Difference must be above rounding tolerance.">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<T></a>&other)<span class="keyword"> const</span>
|
||
|
<a name="l00086"></a>00086 <span class="keyword"> </span>{
|
||
|
<a name="l00087"></a>00087 <span class="keywordflow">return</span> (<a class="code" href="classirr_1_1core_1_1vector3d.html#a8c9ed06774dc668112bcefacb6e7732b" title="X coordinate of the vector.">X</a>>other.<a class="code" href="classirr_1_1core_1_1vector3d.html#a8c9ed06774dc668112bcefacb6e7732b" title="X coordinate of the vector.">X</a> && !<a class="code" href="namespaceirr_1_1core.html#abf9b9b140cc365908ea4c8c47451e4e3" title="returns if a equals b, taking possible rounding errors into account">core::equals</a>(<a class="code" href="classirr_1_1core_1_1vector3d.html#a8c9ed06774dc668112bcefacb6e7732b" title="X coordinate of the vector.">X</a>, other.<a class="code" href="classirr_1_1core_1_1vector3d.html#a8c9ed06774dc668112bcefacb6e7732b" title="X coordinate of the vector.">X</a>)) ||
|
||
|
<a name="l00088"></a>00088 (<a class="code" href="classirr_1_1core_1_1vector3d.html#a7aa9401191db377d67a6d5b160e4c38e" title="returns if this vector equals the other one, taking floating point rounding errors into account...">core::equals</a>(<a class="code" href="classirr_1_1core_1_1vector3d.html#a8c9ed06774dc668112bcefacb6e7732b" title="X coordinate of the vector.">X</a>, other.<a class="code" href="classirr_1_1core_1_1vector3d.html#a8c9ed06774dc668112bcefacb6e7732b" title="X coordinate of the vector.">X</a>) && <a class="code" href="classirr_1_1core_1_1vector3d.html#af8f87c2fe0ce717ade7c3d7419302fbd" title="Y coordinate of the vector.">Y</a>>other.<a class="code" href="classirr_1_1core_1_1vector3d.html#af8f87c2fe0ce717ade7c3d7419302fbd" title="Y coordinate of the vector.">Y</a> && !<a class="code" href="classirr_1_1core_1_1vector3d.html#a7aa9401191db377d67a6d5b160e4c38e" title="returns if this vector equals the other one, taking floating point rounding errors into account...">core::equals</a>(<a class="code" href="classirr_1_1core_1_1vector3d.html#af8f87c2fe0ce717ade7c3d7419302fbd" title="Y coordinate of the vector.">Y</a>, other.<a class="code" href="classirr_1_1core_1_1vector3d.html#af8f87c2fe0ce717ade7c3d7419302fbd" title="Y coordinate of the vector.">Y</a>)) ||
|
||
|
<a name="l00089"></a>00089 (<a class="code" href="namespaceirr_1_1core.html#abf9b9b140cc365908ea4c8c47451e4e3" title="returns if a equals b, taking possible rounding errors into account">core::equals</a>(<a class="code" href="classirr_1_1core_1_1vector3d.html#a8c9ed06774dc668112bcefacb6e7732b" title="X coordinate of the vector.">X</a>, other.<a class="code" href="classirr_1_1core_1_1vector3d.html#a8c9ed06774dc668112bcefacb6e7732b" title="X coordinate of the vector.">X</a>) && <a class="code" href="classirr_1_1core_1_1vector3d.html#a7aa9401191db377d67a6d5b160e4c38e" title="returns if this vector equals the other one, taking floating point rounding errors into account...">core::equals</a>(<a class="code" href="classirr_1_1core_1_1vector3d.html#af8f87c2fe0ce717ade7c3d7419302fbd" title="Y coordinate of the vector.">Y</a>, other.<a class="code" href="classirr_1_1core_1_1vector3d.html#af8f87c2fe0ce717ade7c3d7419302fbd" title="Y coordinate of the vector.">Y</a>) && <a class="code" href="classirr_1_1core_1_1vector3d.html#ac2beb702e718c3579971348981b220ed" title="Z coordinate of the vector.">Z</a>>other.<a class="code" href="classirr_1_1core_1_1vector3d.html#ac2beb702e718c3579971348981b220ed" title="Z coordinate of the vector.">Z</a> && !<a class="code" href="classirr_1_1core_1_1vector3d.html#a7aa9401191db377d67a6d5b160e4c38e" title="returns if this vector equals the other one, taking floating point rounding errors into account...">core::equals</a>(<a class="code" href="classirr_1_1core_1_1vector3d.html#ac2beb702e718c3579971348981b220ed" title="Z coordinate of the vector.">Z</a>, other.<a class="code" href="classirr_1_1core_1_1vector3d.html#ac2beb702e718c3579971348981b220ed" title="Z coordinate of the vector.">Z</a>));
|
||
|
<a name="l00090"></a>00090 }
|
||
|
<a name="l00091"></a>00091
|
||
|
<a name="l00093"></a><a class="code" href="classirr_1_1core_1_1vector3d.html#a3908b4e712fa753a0c88ca6dfce36e34">00093</a> <span class="keywordtype">bool</span> <a class="code" href="classirr_1_1core_1_1vector3d.html#a3908b4e712fa753a0c88ca6dfce36e34" title="use weak float compare">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<T></a>& other)<span class="keyword"> const</span>
|
||
|
<a name="l00094"></a>00094 <span class="keyword"> </span>{
|
||
|
<a name="l00095"></a>00095 <span class="keywordflow">return</span> this-><a class="code" href="classirr_1_1core_1_1vector3d.html#a7aa9401191db377d67a6d5b160e4c38e" title="returns if this vector equals the other one, taking floating point rounding errors into account...">equals</a>(other);
|
||
|
<a name="l00096"></a>00096 }
|
||
|
<a name="l00097"></a>00097
|
||
|
<a name="l00098"></a><a class="code" href="classirr_1_1core_1_1vector3d.html#a125c9bfa0c551f3543f1466f1a670c51">00098</a> <span class="keywordtype">bool</span> <a class="code" href="classirr_1_1core_1_1vector3d.html#a125c9bfa0c551f3543f1466f1a670c51">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<T></a>& other)<span class="keyword"> const</span>
|
||
|
<a name="l00099"></a>00099 <span class="keyword"> </span>{
|
||
|
<a name="l00100"></a>00100 <span class="keywordflow">return</span> !this-><a class="code" href="classirr_1_1core_1_1vector3d.html#a7aa9401191db377d67a6d5b160e4c38e" title="returns if this vector equals the other one, taking floating point rounding errors into account...">equals</a>(other);
|
||
|
<a name="l00101"></a>00101 }
|
||
|
<a name="l00102"></a>00102
|
||
|
<a name="l00103"></a>00103 <span class="comment">// functions</span>
|
||
|
<a name="l00104"></a>00104
|
||
|
<a name="l00106"></a><a class="code" href="classirr_1_1core_1_1vector3d.html#a7aa9401191db377d67a6d5b160e4c38e">00106</a> <span class="keywordtype">bool</span> <a class="code" href="classirr_1_1core_1_1vector3d.html#a7aa9401191db377d67a6d5b160e4c38e" title="returns if this vector equals the other one, taking floating point rounding errors into account...">equals</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<T></a>& other, <span class="keyword">const</span> T tolerance = (T)<a class="code" href="namespaceirr_1_1core.html#a9514dd34463a30102ef8836915cf9c4c">ROUNDING_ERROR_f32</a> )<span class="keyword"> const</span>
|
||
|
<a name="l00107"></a>00107 <span class="keyword"> </span>{
|
||
|
<a name="l00108"></a>00108 <span class="keywordflow">return</span> <a class="code" href="classirr_1_1core_1_1vector3d.html#a7aa9401191db377d67a6d5b160e4c38e" title="returns if this vector equals the other one, taking floating point rounding errors into account...">core::equals</a>(<a class="code" href="classirr_1_1core_1_1vector3d.html#a8c9ed06774dc668112bcefacb6e7732b" title="X coordinate of the vector.">X</a>, other.<a class="code" href="classirr_1_1core_1_1vector3d.html#a8c9ed06774dc668112bcefacb6e7732b" title="X coordinate of the vector.">X</a>, tolerance) &&
|
||
|
<a name="l00109"></a>00109 <a class="code" href="classirr_1_1core_1_1vector3d.html#a7aa9401191db377d67a6d5b160e4c38e" title="returns if this vector equals the other one, taking floating point rounding errors into account...">core::equals</a>(<a class="code" href="classirr_1_1core_1_1vector3d.html#af8f87c2fe0ce717ade7c3d7419302fbd" title="Y coordinate of the vector.">Y</a>, other.<a class="code" href="classirr_1_1core_1_1vector3d.html#af8f87c2fe0ce717ade7c3d7419302fbd" title="Y coordinate of the vector.">Y</a>, tolerance) &&
|
||
|
<a name="l00110"></a>00110 <a class="code" href="classirr_1_1core_1_1vector3d.html#a7aa9401191db377d67a6d5b160e4c38e" title="returns if this vector equals the other one, taking floating point rounding errors into account...">core::equals</a>(<a class="code" href="classirr_1_1core_1_1vector3d.html#ac2beb702e718c3579971348981b220ed" title="Z coordinate of the vector.">Z</a>, other.<a class="code" href="classirr_1_1core_1_1vector3d.html#ac2beb702e718c3579971348981b220ed" title="Z coordinate of the vector.">Z</a>, tolerance);
|
||
|
<a name="l00111"></a>00111 }
|
||
|
<a name="l00112"></a>00112
|
||
|
<a name="l00113"></a><a class="code" href="classirr_1_1core_1_1vector3d.html#a3e9048423e1176a7342759a290d55c96">00113</a> <a class="code" href="classirr_1_1core_1_1vector3d.html" title="3d vector template class with lots of operators and methods.">vector3d<T></a>& <span class="keyword">set</span>(<span class="keyword">const</span> T nx, <span class="keyword">const</span> T ny, <span class="keyword">const</span> T nz) {<a class="code" href="classirr_1_1core_1_1vector3d.html#a8c9ed06774dc668112bcefacb6e7732b" title="X coordinate of the vector.">X</a>=nx; <a class="code" href="classirr_1_1core_1_1vector3d.html#af8f87c2fe0ce717ade7c3d7419302fbd" title="Y coordinate of the vector.">Y</a>=ny; <a class="code" href="classirr_1_1core_1_1vector3d.html#ac2beb702e718c3579971348981b220ed" title="Z coordinate of the vector.">Z</a>=nz; <span class="keywordflow">return</span> *<span class="keyword">this</span>;}
|
||
|
<a name="l00114"></a><a class="code" href="classirr_1_1core_1_1vector3d.html#aaa41e0e1f747d4d83af8ac6b621184da">00114</a> <a class="code" href="classirr_1_1core_1_1vector3d.html" title="3d vector template class with lots of operators and methods.">vector3d<T></a>& <span class="keyword">set</span>(<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<T></a>& p) {<a class="code" href="classirr_1_1core_1_1vector3d.html#a8c9ed06774dc668112bcefacb6e7732b" title="X coordinate of the vector.">X</a>=p.X; <a class="code" href="classirr_1_1core_1_1vector3d.html#af8f87c2fe0ce717ade7c3d7419302fbd" title="Y coordinate of the vector.">Y</a>=p.Y; <a class="code" href="classirr_1_1core_1_1vector3d.html#ac2beb702e718c3579971348981b220ed" title="Z coordinate of the vector.">Z</a>=p.Z;<span class="keywordflow">return</span> *<span class="keyword">this</span>;}
|
||
|
<a name="l00115"></a>00115
|
||
|
<a name="l00117"></a><a class="code" href="classirr_1_1core_1_1vector3d.html#ab0f95138bd31d82b5486237c8e49a2d5">00117</a> T <a class="code" href="classirr_1_1core_1_1vector3d.html#ab0f95138bd31d82b5486237c8e49a2d5" title="Get length of the vector.">getLength</a>()<span class="keyword"> const </span>{ <span class="keywordflow">return</span> <a class="code" href="namespaceirr_1_1core.html#af2f378cc34a19f5da6fe1d4961646d1d">core::squareroot</a>( <a class="code" href="classirr_1_1core_1_1vector3d.html#a8c9ed06774dc668112bcefacb6e7732b" title="X coordinate of the vector.">X</a>*<a class="code" href="classirr_1_1core_1_1vector3d.html#a8c9ed06774dc668112bcefacb6e7732b" title="X coordinate of the vector.">X</a> + <a class="code" href="classirr_1_1core_1_1vector3d.html#af8f87c2fe0ce717ade7c3d7419302fbd" title="Y coordinate of the vector.">Y</a>*<a class="code" href="classirr_1_1core_1_1vector3d.html#af8f87c2fe0ce717ade7c3d7419302fbd" title="Y coordinate of the vector.">Y</a> + <a class="code" href="classirr_1_1core_1_1vector3d.html#ac2beb702e718c3579971348981b220ed" title="Z coordinate of the vector.">Z</a>*<a class="code" href="classirr_1_1core_1_1vector3d.html#ac2beb702e718c3579971348981b220ed" title="Z coordinate of the vector.">Z</a> ); }
|
||
|
<a name="l00118"></a>00118
|
||
|
<a name="l00120"></a>00120
|
||
|
<a name="l00122"></a><a class="code" href="classirr_1_1core_1_1vector3d.html#ad72df96d0e280b0e6383be273f94f6ae">00122</a> T <a class="code" href="classirr_1_1core_1_1vector3d.html#ad72df96d0e280b0e6383be273f94f6ae" title="Get squared length of the vector.">getLengthSQ</a>()<span class="keyword"> const </span>{ <span class="keywordflow">return</span> <a class="code" href="classirr_1_1core_1_1vector3d.html#a8c9ed06774dc668112bcefacb6e7732b" title="X coordinate of the vector.">X</a>*<a class="code" href="classirr_1_1core_1_1vector3d.html#a8c9ed06774dc668112bcefacb6e7732b" title="X coordinate of the vector.">X</a> + <a class="code" href="classirr_1_1core_1_1vector3d.html#af8f87c2fe0ce717ade7c3d7419302fbd" title="Y coordinate of the vector.">Y</a>*<a class="code" href="classirr_1_1core_1_1vector3d.html#af8f87c2fe0ce717ade7c3d7419302fbd" title="Y coordinate of the vector.">Y</a> + <a class="code" href="classirr_1_1core_1_1vector3d.html#ac2beb702e718c3579971348981b220ed" title="Z coordinate of the vector.">Z</a>*<a class="code" href="classirr_1_1core_1_1vector3d.html#ac2beb702e718c3579971348981b220ed" title="Z coordinate of the vector.">Z</a>; }
|
||
|
<a name="l00123"></a>00123
|
||
|
<a name="l00125"></a><a class="code" href="classirr_1_1core_1_1vector3d.html#a0b247d39047c0e51ff16d0118bb396ab">00125</a> T <a class="code" href="classirr_1_1core_1_1vector3d.html#a0b247d39047c0e51ff16d0118bb396ab" title="Get the dot product with another vector.">dotProduct</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<T></a>& other)<span class="keyword"> const</span>
|
||
|
<a name="l00126"></a>00126 <span class="keyword"> </span>{
|
||
|
<a name="l00127"></a>00127 <span class="keywordflow">return</span> <a class="code" href="classirr_1_1core_1_1vector3d.html#a8c9ed06774dc668112bcefacb6e7732b" title="X coordinate of the vector.">X</a>*other.<a class="code" href="classirr_1_1core_1_1vector3d.html#a8c9ed06774dc668112bcefacb6e7732b" title="X coordinate of the vector.">X</a> + <a class="code" href="classirr_1_1core_1_1vector3d.html#af8f87c2fe0ce717ade7c3d7419302fbd" title="Y coordinate of the vector.">Y</a>*other.<a class="code" href="classirr_1_1core_1_1vector3d.html#af8f87c2fe0ce717ade7c3d7419302fbd" title="Y coordinate of the vector.">Y</a> + <a class="code" href="classirr_1_1core_1_1vector3d.html#ac2beb702e718c3579971348981b220ed" title="Z coordinate of the vector.">Z</a>*other.<a class="code" href="classirr_1_1core_1_1vector3d.html#ac2beb702e718c3579971348981b220ed" title="Z coordinate of the vector.">Z</a>;
|
||
|
<a name="l00128"></a>00128 }
|
||
|
<a name="l00129"></a>00129
|
||
|
<a name="l00131"></a>00131
|
||
|
<a name="l00132"></a><a class="code" href="classirr_1_1core_1_1vector3d.html#afd81bdc7d165f0e2082155127c3005e2">00132</a> T <a class="code" href="classirr_1_1core_1_1vector3d.html#afd81bdc7d165f0e2082155127c3005e2" title="Get distance from another point.">getDistanceFrom</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<T></a>& other)<span class="keyword"> const</span>
|
||
|
<a name="l00133"></a>00133 <span class="keyword"> </span>{
|
||
|
<a name="l00134"></a>00134 <span class="keywordflow">return</span> <a class="code" href="classirr_1_1core_1_1vector3d.html" title="3d vector template class with lots of operators and methods.">vector3d<T></a>(<a class="code" href="classirr_1_1core_1_1vector3d.html#a8c9ed06774dc668112bcefacb6e7732b" title="X coordinate of the vector.">X</a> - other.<a class="code" href="classirr_1_1core_1_1vector3d.html#a8c9ed06774dc668112bcefacb6e7732b" title="X coordinate of the vector.">X</a>, <a class="code" href="classirr_1_1core_1_1vector3d.html#af8f87c2fe0ce717ade7c3d7419302fbd" title="Y coordinate of the vector.">Y</a> - other.<a class="code" href="classirr_1_1core_1_1vector3d.html#af8f87c2fe0ce717ade7c3d7419302fbd" title="Y coordinate of the vector.">Y</a>, <a class="code" href="classirr_1_1core_1_1vector3d.html#ac2beb702e718c3579971348981b220ed" title="Z coordinate of the vector.">Z</a> - other.<a class="code" href="classirr_1_1core_1_1vector3d.html#ac2beb702e718c3579971348981b220ed" title="Z coordinate of the vector.">Z</a>).<a class="code" href="classirr_1_1core_1_1vector3d.html#ab0f95138bd31d82b5486237c8e49a2d5" title="Get length of the vector.">getLength</a>();
|
||
|
<a name="l00135"></a>00135 }
|
||
|
<a name="l00136"></a>00136
|
||
|
<a name="l00138"></a>00138
|
||
|
<a name="l00139"></a><a class="code" href="classirr_1_1core_1_1vector3d.html#afe85829b53b8ea449a4b51a2fb14c7be">00139</a> T <a class="code" href="classirr_1_1core_1_1vector3d.html#afe85829b53b8ea449a4b51a2fb14c7be" title="Returns squared distance from another point.">getDistanceFromSQ</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<T></a>& other)<span class="keyword"> const</span>
|
||
|
<a name="l00140"></a>00140 <span class="keyword"> </span>{
|
||
|
<a name="l00141"></a>00141 <span class="keywordflow">return</span> <a class="code" href="classirr_1_1core_1_1vector3d.html" title="3d vector template class with lots of operators and methods.">vector3d<T></a>(<a class="code" href="classirr_1_1core_1_1vector3d.html#a8c9ed06774dc668112bcefacb6e7732b" title="X coordinate of the vector.">X</a> - other.<a class="code" href="classirr_1_1core_1_1vector3d.html#a8c9ed06774dc668112bcefacb6e7732b" title="X coordinate of the vector.">X</a>, <a class="code" href="classirr_1_1core_1_1vector3d.html#af8f87c2fe0ce717ade7c3d7419302fbd" title="Y coordinate of the vector.">Y</a> - other.<a class="code" href="classirr_1_1core_1_1vector3d.html#af8f87c2fe0ce717ade7c3d7419302fbd" title="Y coordinate of the vector.">Y</a>, <a class="code" href="classirr_1_1core_1_1vector3d.html#ac2beb702e718c3579971348981b220ed" title="Z coordinate of the vector.">Z</a> - other.<a class="code" href="classirr_1_1core_1_1vector3d.html#ac2beb702e718c3579971348981b220ed" title="Z coordinate of the vector.">Z</a>).<a class="code" href="classirr_1_1core_1_1vector3d.html#ad72df96d0e280b0e6383be273f94f6ae" title="Get squared length of the vector.">getLengthSQ</a>();
|
||
|
<a name="l00142"></a>00142 }
|
||
|
<a name="l00143"></a>00143
|
||
|
<a name="l00145"></a>00145
|
||
|
<a name="l00147"></a><a class="code" href="classirr_1_1core_1_1vector3d.html#aa2470a12e1ef53f440c95df6249e9aa4">00147</a> <a class="code" href="classirr_1_1core_1_1vector3d.html" title="3d vector template class with lots of operators and methods.">vector3d<T></a> <a class="code" href="classirr_1_1core_1_1vector3d.html#aa2470a12e1ef53f440c95df6249e9aa4" title="Calculates the cross product with another vector.">crossProduct</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<T></a>& p)<span class="keyword"> const</span>
|
||
|
<a name="l00148"></a>00148 <span class="keyword"> </span>{
|
||
|
<a name="l00149"></a>00149 <span class="keywordflow">return</span> <a class="code" href="classirr_1_1core_1_1vector3d.html" title="3d vector template class with lots of operators and methods.">vector3d<T></a>(<a class="code" href="classirr_1_1core_1_1vector3d.html#af8f87c2fe0ce717ade7c3d7419302fbd" title="Y coordinate of the vector.">Y</a> * p.<a class="code" href="classirr_1_1core_1_1vector3d.html#ac2beb702e718c3579971348981b220ed" title="Z coordinate of the vector.">Z</a> - <a class="code" href="classirr_1_1core_1_1vector3d.html#ac2beb702e718c3579971348981b220ed" title="Z coordinate of the vector.">Z</a> * p.<a class="code" href="classirr_1_1core_1_1vector3d.html#af8f87c2fe0ce717ade7c3d7419302fbd" title="Y coordinate of the vector.">Y</a>, <a class="code" href="classirr_1_1core_1_1vector3d.html#ac2beb702e718c3579971348981b220ed" title="Z coordinate of the vector.">Z</a> * p.<a class="code" href="classirr_1_1core_1_1vector3d.html#a8c9ed06774dc668112bcefacb6e7732b" title="X coordinate of the vector.">X</a> - <a class="code" href="classirr_1_1core_1_1vector3d.html#a8c9ed06774dc668112bcefacb6e7732b" title="X coordinate of the vector.">X</a> * p.<a class="code" href="classirr_1_1core_1_1vector3d.html#ac2beb702e718c3579971348981b220ed" title="Z coordinate of the vector.">Z</a>, <a class="code" href="classirr_1_1core_1_1vector3d.html#a8c9ed06774dc668112bcefacb6e7732b" title="X coordinate of the vector.">X</a> * p.<a class="code" href="classirr_1_1core_1_1vector3d.html#af8f87c2fe0ce717ade7c3d7419302fbd" title="Y coordinate of the vector.">Y</a> - <a class="code" href="classirr_1_1core_1_1vector3d.html#af8f87c2fe0ce717ade7c3d7419302fbd" title="Y coordinate of the vector.">Y</a> * p.<a class="code" href="classirr_1_1core_1_1vector3d.html#a8c9ed06774dc668112bcefacb6e7732b" title="X coordinate of the vector.">X</a>);
|
||
|
<a name="l00150"></a>00150 }
|
||
|
<a name="l00151"></a>00151
|
||
|
<a name="l00153"></a>00153
|
||
|
<a name="l00157"></a><a class="code" href="classirr_1_1core_1_1vector3d.html#ace05ee3b68b47c2ec6baff0d9d64de98">00157</a> <span class="keywordtype">bool</span> <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>(<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<T></a>& begin, <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<T></a>& end)<span class="keyword"> const</span>
|
||
|
<a name="l00158"></a>00158 <span class="keyword"> </span>{
|
||
|
<a name="l00159"></a>00159 <span class="keyword">const</span> T f = (end - begin).<a class="code" href="classirr_1_1core_1_1vector3d.html#ad72df96d0e280b0e6383be273f94f6ae" title="Get squared length of the vector.">getLengthSQ</a>();
|
||
|
<a name="l00160"></a>00160 <span class="keywordflow">return</span> <a class="code" href="classirr_1_1core_1_1vector3d.html#afe85829b53b8ea449a4b51a2fb14c7be" title="Returns squared distance from another point.">getDistanceFromSQ</a>(begin) <= f &&
|
||
|
<a name="l00161"></a>00161 <a class="code" href="classirr_1_1core_1_1vector3d.html#afe85829b53b8ea449a4b51a2fb14c7be" title="Returns squared distance from another point.">getDistanceFromSQ</a>(end) <= f;
|
||
|
<a name="l00162"></a>00162 }
|
||
|
<a name="l00163"></a>00163
|
||
|
<a name="l00165"></a>00165
|
||
|
<a name="l00168"></a><a class="code" href="classirr_1_1core_1_1vector3d.html#a84a1861464ef70e6965c146732103c09">00168</a> <a class="code" href="classirr_1_1core_1_1vector3d.html" title="3d vector template class with lots of operators and methods.">vector3d<T></a>& <a class="code" href="classirr_1_1core_1_1vector3d.html#a84a1861464ef70e6965c146732103c09" title="Normalizes the vector.">normalize</a>()
|
||
|
<a name="l00169"></a>00169 {
|
||
|
<a name="l00170"></a>00170 <a class="code" href="namespaceirr.html#a1325b02603ad449f92c68fc640af9b28" title="64 bit floating point variable.">f64</a> length = <a class="code" href="classirr_1_1core_1_1vector3d.html#a8c9ed06774dc668112bcefacb6e7732b" title="X coordinate of the vector.">X</a>*<a class="code" href="classirr_1_1core_1_1vector3d.html#a8c9ed06774dc668112bcefacb6e7732b" title="X coordinate of the vector.">X</a> + <a class="code" href="classirr_1_1core_1_1vector3d.html#af8f87c2fe0ce717ade7c3d7419302fbd" title="Y coordinate of the vector.">Y</a>*<a class="code" href="classirr_1_1core_1_1vector3d.html#af8f87c2fe0ce717ade7c3d7419302fbd" title="Y coordinate of the vector.">Y</a> + <a class="code" href="classirr_1_1core_1_1vector3d.html#ac2beb702e718c3579971348981b220ed" title="Z coordinate of the vector.">Z</a>*<a class="code" href="classirr_1_1core_1_1vector3d.html#ac2beb702e718c3579971348981b220ed" title="Z coordinate of the vector.">Z</a>;
|
||
|
<a name="l00171"></a>00171 <span class="keywordflow">if</span> (length == 0 ) <span class="comment">// this check isn't an optimization but prevents getting NAN in the sqrt.</span>
|
||
|
<a name="l00172"></a>00172 <span class="keywordflow">return</span> *<span class="keyword">this</span>;
|
||
|
<a name="l00173"></a>00173 length = <a class="code" href="namespaceirr_1_1core.html#adaef309f12c2a3386e94610e24f2bfa7">core::reciprocal_squareroot</a>(length);
|
||
|
<a name="l00174"></a>00174
|
||
|
<a name="l00175"></a>00175 <a class="code" href="classirr_1_1core_1_1vector3d.html#a8c9ed06774dc668112bcefacb6e7732b" title="X coordinate of the vector.">X</a> = (T)(<a class="code" href="classirr_1_1core_1_1vector3d.html#a8c9ed06774dc668112bcefacb6e7732b" title="X coordinate of the vector.">X</a> * length);
|
||
|
<a name="l00176"></a>00176 <a class="code" href="classirr_1_1core_1_1vector3d.html#af8f87c2fe0ce717ade7c3d7419302fbd" title="Y coordinate of the vector.">Y</a> = (T)(<a class="code" href="classirr_1_1core_1_1vector3d.html#af8f87c2fe0ce717ade7c3d7419302fbd" title="Y coordinate of the vector.">Y</a> * length);
|
||
|
<a name="l00177"></a>00177 Z = (T)(Z * length);
|
||
|
<a name="l00178"></a>00178 <span class="keywordflow">return</span> *<span class="keyword">this</span>;
|
||
|
<a name="l00179"></a>00179 }
|
||
|
<a name="l00180"></a>00180
|
||
|
<a name="l00182"></a><a class="code" href="classirr_1_1core_1_1vector3d.html#ae593448ac63803b3d254b0e6c7600f28">00182</a> <a class="code" href="classirr_1_1core_1_1vector3d.html" title="3d vector template class with lots of operators and methods.">vector3d<T></a>& <a class="code" href="classirr_1_1core_1_1vector3d.html#ae593448ac63803b3d254b0e6c7600f28" title="Sets the length of the vector to a new value.">setLength</a>(T newlength)
|
||
|
<a name="l00183"></a>00183 {
|
||
|
<a name="l00184"></a>00184 <a class="code" href="classirr_1_1core_1_1vector3d.html#a84a1861464ef70e6965c146732103c09" title="Normalizes the vector.">normalize</a>();
|
||
|
<a name="l00185"></a>00185 <span class="keywordflow">return</span> (*<span class="keyword">this</span> *= newlength);
|
||
|
<a name="l00186"></a>00186 }
|
||
|
<a name="l00187"></a>00187
|
||
|
<a name="l00189"></a><a class="code" href="classirr_1_1core_1_1vector3d.html#a55a10e03bc09f87b95fc81ea0d508722">00189</a> <a class="code" href="classirr_1_1core_1_1vector3d.html" title="3d vector template class with lots of operators and methods.">vector3d<T></a>& <a class="code" href="classirr_1_1core_1_1vector3d.html#a55a10e03bc09f87b95fc81ea0d508722" title="Inverts the vector.">invert</a>()
|
||
|
<a name="l00190"></a>00190 {
|
||
|
<a name="l00191"></a>00191 <a class="code" href="classirr_1_1core_1_1vector3d.html#a8c9ed06774dc668112bcefacb6e7732b" title="X coordinate of the vector.">X</a> *= -1;
|
||
|
<a name="l00192"></a>00192 <a class="code" href="classirr_1_1core_1_1vector3d.html#af8f87c2fe0ce717ade7c3d7419302fbd" title="Y coordinate of the vector.">Y</a> *= -1;
|
||
|
<a name="l00193"></a>00193 <a class="code" href="classirr_1_1core_1_1vector3d.html#ac2beb702e718c3579971348981b220ed" title="Z coordinate of the vector.">Z</a> *= -1;
|
||
|
<a name="l00194"></a>00194 <span class="keywordflow">return</span> *<span class="keyword">this</span>;
|
||
|
<a name="l00195"></a>00195 }
|
||
|
<a name="l00196"></a>00196
|
||
|
<a name="l00198"></a>00198
|
||
|
<a name="l00200"></a><a class="code" href="classirr_1_1core_1_1vector3d.html#a621fbddb42814edd3d14410252cf7b7a">00200</a> <span class="keywordtype">void</span> <a class="code" href="classirr_1_1core_1_1vector3d.html#a621fbddb42814edd3d14410252cf7b7a" title="Rotates the vector by a specified number of degrees around the Y axis and the specified center...">rotateXZBy</a>(<a class="code" href="namespaceirr.html#a1325b02603ad449f92c68fc640af9b28" title="64 bit floating point variable.">f64</a> degrees, <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<T></a>& center=<a class="code" href="classirr_1_1core_1_1vector3d.html" title="3d vector template class with lots of operators and methods.">vector3d<T></a>())
|
||
|
<a name="l00201"></a>00201 {
|
||
|
<a name="l00202"></a>00202 degrees *= <a class="code" href="namespaceirr_1_1core.html#a8e21b5969c8292857f7c9c5dcfd61c35" title="64bit constant for converting from degrees to radians (formally known as GRAD_PI2)">DEGTORAD64</a>;
|
||
|
<a name="l00203"></a>00203 <a class="code" href="namespaceirr.html#a1325b02603ad449f92c68fc640af9b28" title="64 bit floating point variable.">f64</a> cs = cos(degrees);
|
||
|
<a name="l00204"></a>00204 <a class="code" href="namespaceirr.html#a1325b02603ad449f92c68fc640af9b28" title="64 bit floating point variable.">f64</a> sn = sin(degrees);
|
||
|
<a name="l00205"></a>00205 <a class="code" href="classirr_1_1core_1_1vector3d.html#a8c9ed06774dc668112bcefacb6e7732b" title="X coordinate of the vector.">X</a> -= center.X;
|
||
|
<a name="l00206"></a>00206 <a class="code" href="classirr_1_1core_1_1vector3d.html#ac2beb702e718c3579971348981b220ed" title="Z coordinate of the vector.">Z</a> -= center.Z;
|
||
|
<a name="l00207"></a>00207 <span class="keyword">set</span>((T)(<a class="code" href="classirr_1_1core_1_1vector3d.html#a8c9ed06774dc668112bcefacb6e7732b" title="X coordinate of the vector.">X</a>*cs - <a class="code" href="classirr_1_1core_1_1vector3d.html#ac2beb702e718c3579971348981b220ed" title="Z coordinate of the vector.">Z</a>*sn), <a class="code" href="classirr_1_1core_1_1vector3d.html#af8f87c2fe0ce717ade7c3d7419302fbd" title="Y coordinate of the vector.">Y</a>, (T)(<a class="code" href="classirr_1_1core_1_1vector3d.html#a8c9ed06774dc668112bcefacb6e7732b" title="X coordinate of the vector.">X</a>*sn + <a class="code" href="classirr_1_1core_1_1vector3d.html#ac2beb702e718c3579971348981b220ed" title="Z coordinate of the vector.">Z</a>*cs));
|
||
|
<a name="l00208"></a>00208 <a class="code" href="classirr_1_1core_1_1vector3d.html#a8c9ed06774dc668112bcefacb6e7732b" title="X coordinate of the vector.">X</a> += center.X;
|
||
|
<a name="l00209"></a>00209 <a class="code" href="classirr_1_1core_1_1vector3d.html#ac2beb702e718c3579971348981b220ed" title="Z coordinate of the vector.">Z</a> += center.Z;
|
||
|
<a name="l00210"></a>00210 }
|
||
|
<a name="l00211"></a>00211
|
||
|
<a name="l00213"></a>00213
|
||
|
<a name="l00215"></a><a class="code" href="classirr_1_1core_1_1vector3d.html#ac38b75735ec06716305fbb09ec71784d">00215</a> <span class="keywordtype">void</span> <a class="code" href="classirr_1_1core_1_1vector3d.html#ac38b75735ec06716305fbb09ec71784d" title="Rotates the vector by a specified number of degrees around the Z axis and the specified center...">rotateXYBy</a>(<a class="code" href="namespaceirr.html#a1325b02603ad449f92c68fc640af9b28" title="64 bit floating point variable.">f64</a> degrees, <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<T></a>& center=<a class="code" href="classirr_1_1core_1_1vector3d.html" title="3d vector template class with lots of operators and methods.">vector3d<T></a>())
|
||
|
<a name="l00216"></a>00216 {
|
||
|
<a name="l00217"></a>00217 degrees *= <a class="code" href="namespaceirr_1_1core.html#a8e21b5969c8292857f7c9c5dcfd61c35" title="64bit constant for converting from degrees to radians (formally known as GRAD_PI2)">DEGTORAD64</a>;
|
||
|
<a name="l00218"></a>00218 <a class="code" href="namespaceirr.html#a1325b02603ad449f92c68fc640af9b28" title="64 bit floating point variable.">f64</a> cs = cos(degrees);
|
||
|
<a name="l00219"></a>00219 <a class="code" href="namespaceirr.html#a1325b02603ad449f92c68fc640af9b28" title="64 bit floating point variable.">f64</a> sn = sin(degrees);
|
||
|
<a name="l00220"></a>00220 <a class="code" href="classirr_1_1core_1_1vector3d.html#a8c9ed06774dc668112bcefacb6e7732b" title="X coordinate of the vector.">X</a> -= center.X;
|
||
|
<a name="l00221"></a>00221 <a class="code" href="classirr_1_1core_1_1vector3d.html#af8f87c2fe0ce717ade7c3d7419302fbd" title="Y coordinate of the vector.">Y</a> -= center.Y;
|
||
|
<a name="l00222"></a>00222 <span class="keyword">set</span>((T)(<a class="code" href="classirr_1_1core_1_1vector3d.html#a8c9ed06774dc668112bcefacb6e7732b" title="X coordinate of the vector.">X</a>*cs - <a class="code" href="classirr_1_1core_1_1vector3d.html#af8f87c2fe0ce717ade7c3d7419302fbd" title="Y coordinate of the vector.">Y</a>*sn), (T)(<a class="code" href="classirr_1_1core_1_1vector3d.html#a8c9ed06774dc668112bcefacb6e7732b" title="X coordinate of the vector.">X</a>*sn + <a class="code" href="classirr_1_1core_1_1vector3d.html#af8f87c2fe0ce717ade7c3d7419302fbd" title="Y coordinate of the vector.">Y</a>*cs), <a class="code" href="classirr_1_1core_1_1vector3d.html#ac2beb702e718c3579971348981b220ed" title="Z coordinate of the vector.">Z</a>);
|
||
|
<a name="l00223"></a>00223 <a class="code" href="classirr_1_1core_1_1vector3d.html#a8c9ed06774dc668112bcefacb6e7732b" title="X coordinate of the vector.">X</a> += center.X;
|
||
|
<a name="l00224"></a>00224 <a class="code" href="classirr_1_1core_1_1vector3d.html#af8f87c2fe0ce717ade7c3d7419302fbd" title="Y coordinate of the vector.">Y</a> += center.Y;
|
||
|
<a name="l00225"></a>00225 }
|
||
|
<a name="l00226"></a>00226
|
||
|
<a name="l00228"></a>00228
|
||
|
<a name="l00230"></a><a class="code" href="classirr_1_1core_1_1vector3d.html#aaa048312f75f152861479cb48e2ddfe4">00230</a> <span class="keywordtype">void</span> <a class="code" href="classirr_1_1core_1_1vector3d.html#aaa048312f75f152861479cb48e2ddfe4" title="Rotates the vector by a specified number of degrees around the X axis and the specified center...">rotateYZBy</a>(<a class="code" href="namespaceirr.html#a1325b02603ad449f92c68fc640af9b28" title="64 bit floating point variable.">f64</a> degrees, <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<T></a>& center=<a class="code" href="classirr_1_1core_1_1vector3d.html" title="3d vector template class with lots of operators and methods.">vector3d<T></a>())
|
||
|
<a name="l00231"></a>00231 {
|
||
|
<a name="l00232"></a>00232 degrees *= <a class="code" href="namespaceirr_1_1core.html#a8e21b5969c8292857f7c9c5dcfd61c35" title="64bit constant for converting from degrees to radians (formally known as GRAD_PI2)">DEGTORAD64</a>;
|
||
|
<a name="l00233"></a>00233 <a class="code" href="namespaceirr.html#a1325b02603ad449f92c68fc640af9b28" title="64 bit floating point variable.">f64</a> cs = cos(degrees);
|
||
|
<a name="l00234"></a>00234 <a class="code" href="namespaceirr.html#a1325b02603ad449f92c68fc640af9b28" title="64 bit floating point variable.">f64</a> sn = sin(degrees);
|
||
|
<a name="l00235"></a>00235 <a class="code" href="classirr_1_1core_1_1vector3d.html#ac2beb702e718c3579971348981b220ed" title="Z coordinate of the vector.">Z</a> -= center.Z;
|
||
|
<a name="l00236"></a>00236 <a class="code" href="classirr_1_1core_1_1vector3d.html#af8f87c2fe0ce717ade7c3d7419302fbd" title="Y coordinate of the vector.">Y</a> -= center.Y;
|
||
|
<a name="l00237"></a>00237 <span class="keyword">set</span>(<a class="code" href="classirr_1_1core_1_1vector3d.html#a8c9ed06774dc668112bcefacb6e7732b" title="X coordinate of the vector.">X</a>, (T)(<a class="code" href="classirr_1_1core_1_1vector3d.html#af8f87c2fe0ce717ade7c3d7419302fbd" title="Y coordinate of the vector.">Y</a>*cs - <a class="code" href="classirr_1_1core_1_1vector3d.html#ac2beb702e718c3579971348981b220ed" title="Z coordinate of the vector.">Z</a>*sn), (T)(<a class="code" href="classirr_1_1core_1_1vector3d.html#af8f87c2fe0ce717ade7c3d7419302fbd" title="Y coordinate of the vector.">Y</a>*sn + <a class="code" href="classirr_1_1core_1_1vector3d.html#ac2beb702e718c3579971348981b220ed" title="Z coordinate of the vector.">Z</a>*cs));
|
||
|
<a name="l00238"></a>00238 <a class="code" href="classirr_1_1core_1_1vector3d.html#ac2beb702e718c3579971348981b220ed" title="Z coordinate of the vector.">Z</a> += center.Z;
|
||
|
<a name="l00239"></a>00239 <a class="code" href="classirr_1_1core_1_1vector3d.html#af8f87c2fe0ce717ade7c3d7419302fbd" title="Y coordinate of the vector.">Y</a> += center.Y;
|
||
|
<a name="l00240"></a>00240 }
|
||
|
<a name="l00241"></a>00241
|
||
|
<a name="l00243"></a>00243
|
||
|
<a name="l00247"></a><a class="code" href="classirr_1_1core_1_1vector3d.html#ab0ad2c732121c2b6e36c2c2e9ed715fd">00247</a> <a class="code" href="classirr_1_1core_1_1vector3d.html" title="3d vector template class with lots of operators and methods.">vector3d<T></a> <a class="code" href="classirr_1_1core_1_1vector3d.html#ab0ad2c732121c2b6e36c2c2e9ed715fd" title="Creates an interpolated vector between this vector and another vector.">getInterpolated</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<T></a>& other, <a class="code" href="namespaceirr.html#a1325b02603ad449f92c68fc640af9b28" title="64 bit floating point variable.">f64</a> d)<span class="keyword"> const</span>
|
||
|
<a name="l00248"></a>00248 <span class="keyword"> </span>{
|
||
|
<a name="l00249"></a>00249 <span class="keyword">const</span> <a class="code" href="namespaceirr.html#a1325b02603ad449f92c68fc640af9b28" title="64 bit floating point variable.">f64</a> inv = 1.0 - d;
|
||
|
<a name="l00250"></a>00250 <span class="keywordflow">return</span> <a class="code" href="classirr_1_1core_1_1vector3d.html" title="3d vector template class with lots of operators and methods.">vector3d<T></a>((T)(other.<a class="code" href="classirr_1_1core_1_1vector3d.html#a8c9ed06774dc668112bcefacb6e7732b" title="X coordinate of the vector.">X</a>*inv + <a class="code" href="classirr_1_1core_1_1vector3d.html#a8c9ed06774dc668112bcefacb6e7732b" title="X coordinate of the vector.">X</a>*d), (T)(other.<a class="code" href="classirr_1_1core_1_1vector3d.html#af8f87c2fe0ce717ade7c3d7419302fbd" title="Y coordinate of the vector.">Y</a>*inv + <a class="code" href="classirr_1_1core_1_1vector3d.html#af8f87c2fe0ce717ade7c3d7419302fbd" title="Y coordinate of the vector.">Y</a>*d), (T)(other.<a class="code" href="classirr_1_1core_1_1vector3d.html#ac2beb702e718c3579971348981b220ed" title="Z coordinate of the vector.">Z</a>*inv + <a class="code" href="classirr_1_1core_1_1vector3d.html#ac2beb702e718c3579971348981b220ed" title="Z coordinate of the vector.">Z</a>*d));
|
||
|
<a name="l00251"></a>00251 }
|
||
|
<a name="l00252"></a>00252
|
||
|
<a name="l00254"></a>00254
|
||
|
<a name="l00259"></a><a class="code" href="classirr_1_1core_1_1vector3d.html#adb749559ee0941687d4692941146a388">00259</a> <a class="code" href="classirr_1_1core_1_1vector3d.html" title="3d vector template class with lots of operators and methods.">vector3d<T></a> <a class="code" href="classirr_1_1core_1_1vector3d.html#adb749559ee0941687d4692941146a388" title="Creates a quadratically interpolated vector between this and two other vectors.">getInterpolated_quadratic</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<T></a>& v2, <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<T></a>& v3, <a class="code" href="namespaceirr.html#a1325b02603ad449f92c68fc640af9b28" title="64 bit floating point variable.">f64</a> d)<span class="keyword"> const</span>
|
||
|
<a name="l00260"></a>00260 <span class="keyword"> </span>{
|
||
|
<a name="l00261"></a>00261 <span class="comment">// this*(1-d)*(1-d) + 2 * v2 * (1-d) + v3 * d * d;</span>
|
||
|
<a name="l00262"></a>00262 <span class="keyword">const</span> <a class="code" href="namespaceirr.html#a1325b02603ad449f92c68fc640af9b28" title="64 bit floating point variable.">f64</a> inv = (T) 1.0 - d;
|
||
|
<a name="l00263"></a>00263 <span class="keyword">const</span> <a class="code" href="namespaceirr.html#a1325b02603ad449f92c68fc640af9b28" title="64 bit floating point variable.">f64</a> mul0 = inv * inv;
|
||
|
<a name="l00264"></a>00264 <span class="keyword">const</span> <a class="code" href="namespaceirr.html#a1325b02603ad449f92c68fc640af9b28" title="64 bit floating point variable.">f64</a> mul1 = (T) 2.0 * d * inv;
|
||
|
<a name="l00265"></a>00265 <span class="keyword">const</span> <a class="code" href="namespaceirr.html#a1325b02603ad449f92c68fc640af9b28" title="64 bit floating point variable.">f64</a> mul2 = d * d;
|
||
|
<a name="l00266"></a>00266
|
||
|
<a name="l00267"></a>00267 <span class="keywordflow">return</span> <a class="code" href="classirr_1_1core_1_1vector3d.html" title="3d vector template class with lots of operators and methods.">vector3d<T></a> ((T)(<a class="code" href="classirr_1_1core_1_1vector3d.html#a8c9ed06774dc668112bcefacb6e7732b" title="X coordinate of the vector.">X</a> * mul0 + v2.<a class="code" href="classirr_1_1core_1_1vector3d.html#a8c9ed06774dc668112bcefacb6e7732b" title="X coordinate of the vector.">X</a> * mul1 + v3.<a class="code" href="classirr_1_1core_1_1vector3d.html#a8c9ed06774dc668112bcefacb6e7732b" title="X coordinate of the vector.">X</a> * mul2),
|
||
|
<a name="l00268"></a>00268 (T)(<a class="code" href="classirr_1_1core_1_1vector3d.html#af8f87c2fe0ce717ade7c3d7419302fbd" title="Y coordinate of the vector.">Y</a> * mul0 + v2.<a class="code" href="classirr_1_1core_1_1vector3d.html#af8f87c2fe0ce717ade7c3d7419302fbd" title="Y coordinate of the vector.">Y</a> * mul1 + v3.<a class="code" href="classirr_1_1core_1_1vector3d.html#af8f87c2fe0ce717ade7c3d7419302fbd" title="Y coordinate of the vector.">Y</a> * mul2),
|
||
|
<a name="l00269"></a>00269 (T)(<a class="code" href="classirr_1_1core_1_1vector3d.html#ac2beb702e718c3579971348981b220ed" title="Z coordinate of the vector.">Z</a> * mul0 + v2.<a class="code" href="classirr_1_1core_1_1vector3d.html#ac2beb702e718c3579971348981b220ed" title="Z coordinate of the vector.">Z</a> * mul1 + v3.<a class="code" href="classirr_1_1core_1_1vector3d.html#ac2beb702e718c3579971348981b220ed" title="Z coordinate of the vector.">Z</a> * mul2));
|
||
|
<a name="l00270"></a>00270 }
|
||
|
<a name="l00271"></a>00271
|
||
|
<a name="l00273"></a>00273
|
||
|
<a name="l00278"></a><a class="code" href="classirr_1_1core_1_1vector3d.html#a32a888e0f608a20deee98c794a321c4c">00278</a> <a class="code" href="classirr_1_1core_1_1vector3d.html" title="3d vector template class with lots of operators and methods.">vector3d<T></a>& <a class="code" href="classirr_1_1core_1_1vector3d.html#a32a888e0f608a20deee98c794a321c4c" title="Sets this vector to the linearly interpolated vector between a and b.">interpolate</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<T></a>& 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<T></a>& b, <a class="code" href="namespaceirr.html#a1325b02603ad449f92c68fc640af9b28" title="64 bit floating point variable.">f64</a> d)
|
||
|
<a name="l00279"></a>00279 {
|
||
|
<a name="l00280"></a>00280 <a class="code" href="classirr_1_1core_1_1vector3d.html#a8c9ed06774dc668112bcefacb6e7732b" title="X coordinate of the vector.">X</a> = (T)((<a class="code" href="namespaceirr.html#a1325b02603ad449f92c68fc640af9b28" title="64 bit floating point variable.">f64</a>)b.<a class="code" href="classirr_1_1core_1_1vector3d.html#a8c9ed06774dc668112bcefacb6e7732b" title="X coordinate of the vector.">X</a> + ( ( a.<a class="code" href="classirr_1_1core_1_1vector3d.html#a8c9ed06774dc668112bcefacb6e7732b" title="X coordinate of the vector.">X</a> - b.<a class="code" href="classirr_1_1core_1_1vector3d.html#a8c9ed06774dc668112bcefacb6e7732b" title="X coordinate of the vector.">X</a> ) * d ));
|
||
|
<a name="l00281"></a>00281 <a class="code" href="classirr_1_1core_1_1vector3d.html#af8f87c2fe0ce717ade7c3d7419302fbd" title="Y coordinate of the vector.">Y</a> = (T)((<a class="code" href="namespaceirr.html#a1325b02603ad449f92c68fc640af9b28" title="64 bit floating point variable.">f64</a>)b.<a class="code" href="classirr_1_1core_1_1vector3d.html#af8f87c2fe0ce717ade7c3d7419302fbd" title="Y coordinate of the vector.">Y</a> + ( ( a.<a class="code" href="classirr_1_1core_1_1vector3d.html#af8f87c2fe0ce717ade7c3d7419302fbd" title="Y coordinate of the vector.">Y</a> - b.<a class="code" href="classirr_1_1core_1_1vector3d.html#af8f87c2fe0ce717ade7c3d7419302fbd" title="Y coordinate of the vector.">Y</a> ) * d ));
|
||
|
<a name="l00282"></a>00282 <a class="code" href="classirr_1_1core_1_1vector3d.html#ac2beb702e718c3579971348981b220ed" title="Z coordinate of the vector.">Z</a> = (T)((<a class="code" href="namespaceirr.html#a1325b02603ad449f92c68fc640af9b28" title="64 bit floating point variable.">f64</a>)b.<a class="code" href="classirr_1_1core_1_1vector3d.html#ac2beb702e718c3579971348981b220ed" title="Z coordinate of the vector.">Z</a> + ( ( a.<a class="code" href="classirr_1_1core_1_1vector3d.html#ac2beb702e718c3579971348981b220ed" title="Z coordinate of the vector.">Z</a> - b.<a class="code" href="classirr_1_1core_1_1vector3d.html#ac2beb702e718c3579971348981b220ed" title="Z coordinate of the vector.">Z</a> ) * d ));
|
||
|
<a name="l00283"></a>00283 <span class="keywordflow">return</span> *<span class="keyword">this</span>;
|
||
|
<a name="l00284"></a>00284 }
|
||
|
<a name="l00285"></a>00285
|
||
|
<a name="l00286"></a>00286
|
||
|
<a name="l00288"></a>00288
|
||
|
<a name="l00301"></a><a class="code" href="classirr_1_1core_1_1vector3d.html#a9485549addf9967247d3431c7746fbda">00301</a> <a class="code" href="classirr_1_1core_1_1vector3d.html" title="3d vector template class with lots of operators and methods.">vector3d<T></a> <a class="code" href="classirr_1_1core_1_1vector3d.html#a9485549addf9967247d3431c7746fbda" title="Get the rotations that would make a (0,0,1) direction vector point in the same direction as this dire...">getHorizontalAngle</a>()<span class="keyword"> const</span>
|
||
|
<a name="l00302"></a>00302 <span class="keyword"> </span>{
|
||
|
<a name="l00303"></a>00303 <a class="code" href="classirr_1_1core_1_1vector3d.html" title="3d vector template class with lots of operators and methods.">vector3d<T></a> angle;
|
||
|
<a name="l00304"></a>00304
|
||
|
<a name="l00305"></a>00305 <span class="keyword">const</span> <a class="code" href="namespaceirr.html#a1325b02603ad449f92c68fc640af9b28" title="64 bit floating point variable.">f64</a> tmp = (atan2((<a class="code" href="namespaceirr.html#a1325b02603ad449f92c68fc640af9b28" title="64 bit floating point variable.">f64</a>)<a class="code" href="classirr_1_1core_1_1vector3d.html#a8c9ed06774dc668112bcefacb6e7732b" title="X coordinate of the vector.">X</a>, (<a class="code" href="namespaceirr.html#a1325b02603ad449f92c68fc640af9b28" title="64 bit floating point variable.">f64</a>)<a class="code" href="classirr_1_1core_1_1vector3d.html#ac2beb702e718c3579971348981b220ed" title="Z coordinate of the vector.">Z</a>) * <a class="code" href="namespaceirr_1_1core.html#ae7afeb48af12f5f5130cd179a644ec58" title="64bit constant for converting from radians to degrees">RADTODEG64</a>);
|
||
|
<a name="l00306"></a>00306 angle.<a class="code" href="classirr_1_1core_1_1vector3d.html#af8f87c2fe0ce717ade7c3d7419302fbd" title="Y coordinate of the vector.">Y</a> = (T)tmp;
|
||
|
<a name="l00307"></a>00307
|
||
|
<a name="l00308"></a>00308 <span class="keywordflow">if</span> (angle.<a class="code" href="classirr_1_1core_1_1vector3d.html#af8f87c2fe0ce717ade7c3d7419302fbd" title="Y coordinate of the vector.">Y</a> < 0)
|
||
|
<a name="l00309"></a>00309 angle.<a class="code" href="classirr_1_1core_1_1vector3d.html#af8f87c2fe0ce717ade7c3d7419302fbd" title="Y coordinate of the vector.">Y</a> += 360;
|
||
|
<a name="l00310"></a>00310 <span class="keywordflow">if</span> (angle.<a class="code" href="classirr_1_1core_1_1vector3d.html#af8f87c2fe0ce717ade7c3d7419302fbd" title="Y coordinate of the vector.">Y</a> >= 360)
|
||
|
<a name="l00311"></a>00311 angle.<a class="code" href="classirr_1_1core_1_1vector3d.html#af8f87c2fe0ce717ade7c3d7419302fbd" title="Y coordinate of the vector.">Y</a> -= 360;
|
||
|
<a name="l00312"></a>00312
|
||
|
<a name="l00313"></a>00313 <span class="keyword">const</span> <a class="code" href="namespaceirr.html#a1325b02603ad449f92c68fc640af9b28" title="64 bit floating point variable.">f64</a> z1 = <a class="code" href="namespaceirr_1_1core.html#af2f378cc34a19f5da6fe1d4961646d1d">core::squareroot</a>(X*X + Z*Z);
|
||
|
<a name="l00314"></a>00314
|
||
|
<a name="l00315"></a>00315 angle.<a class="code" href="classirr_1_1core_1_1vector3d.html#a8c9ed06774dc668112bcefacb6e7732b" title="X coordinate of the vector.">X</a> = (T)(atan2((<a class="code" href="namespaceirr.html#a1325b02603ad449f92c68fc640af9b28" title="64 bit floating point variable.">f64</a>)z1, (<a class="code" href="namespaceirr.html#a1325b02603ad449f92c68fc640af9b28" title="64 bit floating point variable.">f64</a>)<a class="code" href="classirr_1_1core_1_1vector3d.html#af8f87c2fe0ce717ade7c3d7419302fbd" title="Y coordinate of the vector.">Y</a>) * <a class="code" href="namespaceirr_1_1core.html#ae7afeb48af12f5f5130cd179a644ec58" title="64bit constant for converting from radians to degrees">RADTODEG64</a> - 90.0);
|
||
|
<a name="l00316"></a>00316
|
||
|
<a name="l00317"></a>00317 <span class="keywordflow">if</span> (angle.<a class="code" href="classirr_1_1core_1_1vector3d.html#a8c9ed06774dc668112bcefacb6e7732b" title="X coordinate of the vector.">X</a> < 0)
|
||
|
<a name="l00318"></a>00318 angle.<a class="code" href="classirr_1_1core_1_1vector3d.html#a8c9ed06774dc668112bcefacb6e7732b" title="X coordinate of the vector.">X</a> += 360;
|
||
|
<a name="l00319"></a>00319 <span class="keywordflow">if</span> (angle.<a class="code" href="classirr_1_1core_1_1vector3d.html#a8c9ed06774dc668112bcefacb6e7732b" title="X coordinate of the vector.">X</a> >= 360)
|
||
|
<a name="l00320"></a>00320 angle.<a class="code" href="classirr_1_1core_1_1vector3d.html#a8c9ed06774dc668112bcefacb6e7732b" title="X coordinate of the vector.">X</a> -= 360;
|
||
|
<a name="l00321"></a>00321
|
||
|
<a name="l00322"></a>00322 <span class="keywordflow">return</span> angle;
|
||
|
<a name="l00323"></a>00323 }
|
||
|
<a name="l00324"></a>00324
|
||
|
<a name="l00326"></a>00326
|
||
|
<a name="l00330"></a><a class="code" href="classirr_1_1core_1_1vector3d.html#aab6d3c2dc082d8142c7ac4da8625f93a">00330</a> <a class="code" href="classirr_1_1core_1_1vector3d.html" title="3d vector template class with lots of operators and methods.">vector3d<T></a> <a class="code" href="classirr_1_1core_1_1vector3d.html#aab6d3c2dc082d8142c7ac4da8625f93a" title="Get the spherical coordinate angles.">getSphericalCoordinateAngles</a>()<span class="keyword"> const</span>
|
||
|
<a name="l00331"></a>00331 <span class="keyword"> </span>{
|
||
|
<a name="l00332"></a>00332 <a class="code" href="classirr_1_1core_1_1vector3d.html" title="3d vector template class with lots of operators and methods.">vector3d<T></a> angle;
|
||
|
<a name="l00333"></a>00333 <span class="keyword">const</span> <a class="code" href="namespaceirr.html#a1325b02603ad449f92c68fc640af9b28" title="64 bit floating point variable.">f64</a> length = <a class="code" href="classirr_1_1core_1_1vector3d.html#a8c9ed06774dc668112bcefacb6e7732b" title="X coordinate of the vector.">X</a>*<a class="code" href="classirr_1_1core_1_1vector3d.html#a8c9ed06774dc668112bcefacb6e7732b" title="X coordinate of the vector.">X</a> + <a class="code" href="classirr_1_1core_1_1vector3d.html#af8f87c2fe0ce717ade7c3d7419302fbd" title="Y coordinate of the vector.">Y</a>*<a class="code" href="classirr_1_1core_1_1vector3d.html#af8f87c2fe0ce717ade7c3d7419302fbd" title="Y coordinate of the vector.">Y</a> + <a class="code" href="classirr_1_1core_1_1vector3d.html#ac2beb702e718c3579971348981b220ed" title="Z coordinate of the vector.">Z</a>*<a class="code" href="classirr_1_1core_1_1vector3d.html#ac2beb702e718c3579971348981b220ed" title="Z coordinate of the vector.">Z</a>;
|
||
|
<a name="l00334"></a>00334
|
||
|
<a name="l00335"></a>00335 <span class="keywordflow">if</span> (length)
|
||
|
<a name="l00336"></a>00336 {
|
||
|
<a name="l00337"></a>00337 <span class="keywordflow">if</span> (<a class="code" href="classirr_1_1core_1_1vector3d.html#a8c9ed06774dc668112bcefacb6e7732b" title="X coordinate of the vector.">X</a>!=0)
|
||
|
<a name="l00338"></a>00338 {
|
||
|
<a name="l00339"></a>00339 angle.<a class="code" href="classirr_1_1core_1_1vector3d.html#af8f87c2fe0ce717ade7c3d7419302fbd" title="Y coordinate of the vector.">Y</a> = (T)(atan2((<a class="code" href="namespaceirr.html#a1325b02603ad449f92c68fc640af9b28" title="64 bit floating point variable.">f64</a>)Z,(<a class="code" href="namespaceirr.html#a1325b02603ad449f92c68fc640af9b28" title="64 bit floating point variable.">f64</a>)<a class="code" href="classirr_1_1core_1_1vector3d.html#a8c9ed06774dc668112bcefacb6e7732b" title="X coordinate of the vector.">X</a>) * <a class="code" href="namespaceirr_1_1core.html#ae7afeb48af12f5f5130cd179a644ec58" title="64bit constant for converting from radians to degrees">RADTODEG64</a>);
|
||
|
<a name="l00340"></a>00340 }
|
||
|
<a name="l00341"></a>00341 <span class="keywordflow">else</span> <span class="keywordflow">if</span> (Z<0)
|
||
|
<a name="l00342"></a>00342 angle.<a class="code" href="classirr_1_1core_1_1vector3d.html#af8f87c2fe0ce717ade7c3d7419302fbd" title="Y coordinate of the vector.">Y</a>=180;
|
||
|
<a name="l00343"></a>00343
|
||
|
<a name="l00344"></a>00344 angle.<a class="code" href="classirr_1_1core_1_1vector3d.html#a8c9ed06774dc668112bcefacb6e7732b" title="X coordinate of the vector.">X</a> = (T)(acos(<a class="code" href="classirr_1_1core_1_1vector3d.html#af8f87c2fe0ce717ade7c3d7419302fbd" title="Y coordinate of the vector.">Y</a> * <a class="code" href="namespaceirr_1_1core.html#adaef309f12c2a3386e94610e24f2bfa7">core::reciprocal_squareroot</a>(length)) * <a class="code" href="namespaceirr_1_1core.html#ae7afeb48af12f5f5130cd179a644ec58" title="64bit constant for converting from radians to degrees">RADTODEG64</a>);
|
||
|
<a name="l00345"></a>00345 }
|
||
|
<a name="l00346"></a>00346 <span class="keywordflow">return</span> angle;
|
||
|
<a name="l00347"></a>00347 }
|
||
|
<a name="l00348"></a>00348
|
||
|
<a name="l00350"></a>00350
|
||
|
<a name="l00357"></a><a class="code" href="classirr_1_1core_1_1vector3d.html#a4db5cfbb71995227e37334a19278474d">00357</a> <a class="code" href="classirr_1_1core_1_1vector3d.html" title="3d vector template class with lots of operators and methods.">vector3d<T></a> <a class="code" href="classirr_1_1core_1_1vector3d.html#a4db5cfbb71995227e37334a19278474d" title="Builds a direction vector from (this) rotation vector.">rotationToDirection</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<T></a> & forwards = <a class="code" href="classirr_1_1core_1_1vector3d.html" title="3d vector template class with lots of operators and methods.">vector3d<T></a>(0, 0, 1))<span class="keyword"> const</span>
|
||
|
<a name="l00358"></a>00358 <span class="keyword"> </span>{
|
||
|
<a name="l00359"></a>00359 <span class="keyword">const</span> <a class="code" href="namespaceirr.html#a1325b02603ad449f92c68fc640af9b28" title="64 bit floating point variable.">f64</a> cr = cos( <a class="code" href="namespaceirr_1_1core.html#a8e21b5969c8292857f7c9c5dcfd61c35" title="64bit constant for converting from degrees to radians (formally known as GRAD_PI2)">core::DEGTORAD64</a> * <a class="code" href="classirr_1_1core_1_1vector3d.html#a8c9ed06774dc668112bcefacb6e7732b" title="X coordinate of the vector.">X</a> );
|
||
|
<a name="l00360"></a>00360 <span class="keyword">const</span> <a class="code" href="namespaceirr.html#a1325b02603ad449f92c68fc640af9b28" title="64 bit floating point variable.">f64</a> sr = sin( <a class="code" href="namespaceirr_1_1core.html#a8e21b5969c8292857f7c9c5dcfd61c35" title="64bit constant for converting from degrees to radians (formally known as GRAD_PI2)">core::DEGTORAD64</a> * X );
|
||
|
<a name="l00361"></a>00361 <span class="keyword">const</span> <a class="code" href="namespaceirr.html#a1325b02603ad449f92c68fc640af9b28" title="64 bit floating point variable.">f64</a> cp = cos( <a class="code" href="namespaceirr_1_1core.html#a8e21b5969c8292857f7c9c5dcfd61c35" title="64bit constant for converting from degrees to radians (formally known as GRAD_PI2)">core::DEGTORAD64</a> * <a class="code" href="classirr_1_1core_1_1vector3d.html#af8f87c2fe0ce717ade7c3d7419302fbd" title="Y coordinate of the vector.">Y</a> );
|
||
|
<a name="l00362"></a>00362 <span class="keyword">const</span> <a class="code" href="namespaceirr.html#a1325b02603ad449f92c68fc640af9b28" title="64 bit floating point variable.">f64</a> sp = sin( <a class="code" href="namespaceirr_1_1core.html#a8e21b5969c8292857f7c9c5dcfd61c35" title="64bit constant for converting from degrees to radians (formally known as GRAD_PI2)">core::DEGTORAD64</a> * Y );
|
||
|
<a name="l00363"></a>00363 <span class="keyword">const</span> <a class="code" href="namespaceirr.html#a1325b02603ad449f92c68fc640af9b28" title="64 bit floating point variable.">f64</a> cy = cos( <a class="code" href="namespaceirr_1_1core.html#a8e21b5969c8292857f7c9c5dcfd61c35" title="64bit constant for converting from degrees to radians (formally known as GRAD_PI2)">core::DEGTORAD64</a> * <a class="code" href="classirr_1_1core_1_1vector3d.html#ac2beb702e718c3579971348981b220ed" title="Z coordinate of the vector.">Z</a> );
|
||
|
<a name="l00364"></a>00364 <span class="keyword">const</span> <a class="code" href="namespaceirr.html#a1325b02603ad449f92c68fc640af9b28" title="64 bit floating point variable.">f64</a> sy = sin( <a class="code" href="namespaceirr_1_1core.html#a8e21b5969c8292857f7c9c5dcfd61c35" title="64bit constant for converting from degrees to radians (formally known as GRAD_PI2)">core::DEGTORAD64</a> * Z );
|
||
|
<a name="l00365"></a>00365
|
||
|
<a name="l00366"></a>00366 <span class="keyword">const</span> <a class="code" href="namespaceirr.html#a1325b02603ad449f92c68fc640af9b28" title="64 bit floating point variable.">f64</a> srsp = sr*sp;
|
||
|
<a name="l00367"></a>00367 <span class="keyword">const</span> <a class="code" href="namespaceirr.html#a1325b02603ad449f92c68fc640af9b28" title="64 bit floating point variable.">f64</a> crsp = cr*sp;
|
||
|
<a name="l00368"></a>00368
|
||
|
<a name="l00369"></a>00369 <span class="keyword">const</span> <a class="code" href="namespaceirr.html#a1325b02603ad449f92c68fc640af9b28" title="64 bit floating point variable.">f64</a> pseudoMatrix[] = {
|
||
|
<a name="l00370"></a>00370 ( cp*cy ), ( cp*sy ), ( -sp ),
|
||
|
<a name="l00371"></a>00371 ( srsp*cy-cr*sy ), ( srsp*sy+cr*cy ), ( sr*cp ),
|
||
|
<a name="l00372"></a>00372 ( crsp*cy+sr*sy ), ( crsp*sy-sr*cy ), ( cr*cp )};
|
||
|
<a name="l00373"></a>00373
|
||
|
<a name="l00374"></a>00374 <span class="keywordflow">return</span> <a class="code" href="classirr_1_1core_1_1vector3d.html" title="3d vector template class with lots of operators and methods.">vector3d<T></a>(
|
||
|
<a name="l00375"></a>00375 (T)(forwards.X * pseudoMatrix[0] +
|
||
|
<a name="l00376"></a>00376 forwards.Y * pseudoMatrix[3] +
|
||
|
<a name="l00377"></a>00377 forwards.Z * pseudoMatrix[6]),
|
||
|
<a name="l00378"></a>00378 (T)(forwards.X * pseudoMatrix[1] +
|
||
|
<a name="l00379"></a>00379 forwards.Y * pseudoMatrix[4] +
|
||
|
<a name="l00380"></a>00380 forwards.Z * pseudoMatrix[7]),
|
||
|
<a name="l00381"></a>00381 (T)(forwards.X * pseudoMatrix[2] +
|
||
|
<a name="l00382"></a>00382 forwards.Y * pseudoMatrix[5] +
|
||
|
<a name="l00383"></a>00383 forwards.Z * pseudoMatrix[8]));
|
||
|
<a name="l00384"></a>00384 }
|
||
|
<a name="l00385"></a>00385
|
||
|
<a name="l00387"></a>00387
|
||
|
<a name="l00389"></a><a class="code" href="classirr_1_1core_1_1vector3d.html#a357c8d00022e04a68fb20b24f9eb34ce">00389</a> <span class="keywordtype">void</span> <a class="code" href="classirr_1_1core_1_1vector3d.html#a357c8d00022e04a68fb20b24f9eb34ce" title="Fills an array of 4 values with the vector data (usually floats).">getAs4Values</a>(T* <a class="code" href="classirr_1_1core_1_1array.html" title="Self reallocating template array (like stl vector) with additional features.">array</a>)<span class="keyword"> const</span>
|
||
|
<a name="l00390"></a>00390 <span class="keyword"> </span>{
|
||
|
<a name="l00391"></a>00391 array[0] = <a class="code" href="classirr_1_1core_1_1vector3d.html#a8c9ed06774dc668112bcefacb6e7732b" title="X coordinate of the vector.">X</a>;
|
||
|
<a name="l00392"></a>00392 array[1] = <a class="code" href="classirr_1_1core_1_1vector3d.html#af8f87c2fe0ce717ade7c3d7419302fbd" title="Y coordinate of the vector.">Y</a>;
|
||
|
<a name="l00393"></a>00393 array[2] = <a class="code" href="classirr_1_1core_1_1vector3d.html#ac2beb702e718c3579971348981b220ed" title="Z coordinate of the vector.">Z</a>;
|
||
|
<a name="l00394"></a>00394 array[3] = 0;
|
||
|
<a name="l00395"></a>00395 }
|
||
|
<a name="l00396"></a>00396
|
||
|
<a name="l00398"></a>00398
|
||
|
<a name="l00399"></a><a class="code" href="classirr_1_1core_1_1vector3d.html#a543aaa4376afd2b5321228fa71540329">00399</a> <span class="keywordtype">void</span> <a class="code" href="classirr_1_1core_1_1vector3d.html#a543aaa4376afd2b5321228fa71540329" title="Fills an array of 3 values with the vector data (usually floats).">getAs3Values</a>(T* <a class="code" href="classirr_1_1core_1_1array.html" title="Self reallocating template array (like stl vector) with additional features.">array</a>)<span class="keyword"> const</span>
|
||
|
<a name="l00400"></a>00400 <span class="keyword"> </span>{
|
||
|
<a name="l00401"></a>00401 array[0] = <a class="code" href="classirr_1_1core_1_1vector3d.html#a8c9ed06774dc668112bcefacb6e7732b" title="X coordinate of the vector.">X</a>;
|
||
|
<a name="l00402"></a>00402 array[1] = <a class="code" href="classirr_1_1core_1_1vector3d.html#af8f87c2fe0ce717ade7c3d7419302fbd" title="Y coordinate of the vector.">Y</a>;
|
||
|
<a name="l00403"></a>00403 array[2] = <a class="code" href="classirr_1_1core_1_1vector3d.html#ac2beb702e718c3579971348981b220ed" title="Z coordinate of the vector.">Z</a>;
|
||
|
<a name="l00404"></a>00404 }
|
||
|
<a name="l00405"></a>00405
|
||
|
<a name="l00406"></a>00406
|
||
|
<a name="l00408"></a><a class="code" href="classirr_1_1core_1_1vector3d.html#a8c9ed06774dc668112bcefacb6e7732b">00408</a> T <a class="code" href="classirr_1_1core_1_1vector3d.html#a8c9ed06774dc668112bcefacb6e7732b" title="X coordinate of the vector.">X</a>;
|
||
|
<a name="l00409"></a>00409
|
||
|
<a name="l00411"></a><a class="code" href="classirr_1_1core_1_1vector3d.html#af8f87c2fe0ce717ade7c3d7419302fbd">00411</a> T <a class="code" href="classirr_1_1core_1_1vector3d.html#af8f87c2fe0ce717ade7c3d7419302fbd" title="Y coordinate of the vector.">Y</a>;
|
||
|
<a name="l00412"></a>00412
|
||
|
<a name="l00414"></a><a class="code" href="classirr_1_1core_1_1vector3d.html#ac2beb702e718c3579971348981b220ed">00414</a> T <a class="code" href="classirr_1_1core_1_1vector3d.html#ac2beb702e718c3579971348981b220ed" title="Z coordinate of the vector.">Z</a>;
|
||
|
<a name="l00415"></a>00415 };
|
||
|
<a name="l00416"></a>00416
|
||
|
<a name="l00418"></a>00418 <span class="comment">// Implementor note: inline keyword needed due to template specialization for s32. Otherwise put specialization into a .cpp</span>
|
||
|
<a name="l00419"></a>00419 <span class="keyword">template</span> <>
|
||
|
<a name="l00420"></a><a class="code" href="classirr_1_1core_1_1vector3d.html#a7597f07300c420146117f2e5854153c2">00420</a> <span class="keyword">inline</span> <a class="code" href="classirr_1_1core_1_1vector3d.html" title="3d vector template class with lots of operators and methods.">vector3d<s32></a> <a class="code" href="classirr_1_1core_1_1vector3d.html#a82f734747a8d460a73482dc69a1d2ece">vector3d<s32>::operator /</a>(<a class="code" href="namespaceirr.html#ac66849b7a6ed16e30ebede579f9b47c6" title="32 bit signed variable.">s32</a> val)<span class="keyword"> const </span>{<span class="keywordflow">return</span> <a class="code" href="classirr_1_1core_1_1vector3d.html" title="3d vector template class with lots of operators and methods.">core::vector3d<s32></a>(<a class="code" href="classirr_1_1core_1_1vector3d.html#a8c9ed06774dc668112bcefacb6e7732b" title="X coordinate of the vector.">X</a>/val,<a class="code" href="classirr_1_1core_1_1vector3d.html#af8f87c2fe0ce717ade7c3d7419302fbd" title="Y coordinate of the vector.">Y</a>/val,<a class="code" href="classirr_1_1core_1_1vector3d.html#ac2beb702e718c3579971348981b220ed" title="Z coordinate of the vector.">Z</a>/val);}
|
||
|
<a name="l00421"></a>00421 <span class="keyword">template</span> <>
|
||
|
<a name="l00422"></a><a class="code" href="classirr_1_1core_1_1vector3d.html#a1d153631bde79b7bf50c2ab453d2bc60">00422</a> <span class="keyword">inline</span> <a class="code" href="classirr_1_1core_1_1vector3d.html" title="3d vector template class with lots of operators and methods.">vector3d<s32></a>& <a class="code" href="classirr_1_1core_1_1vector3d.html#ab46c94558797997b369cfe0a38c57794">vector3d<s32>::operator /=</a>(<a class="code" href="namespaceirr.html#ac66849b7a6ed16e30ebede579f9b47c6" title="32 bit signed variable.">s32</a> val) {<a class="code" href="classirr_1_1core_1_1vector3d.html#a8c9ed06774dc668112bcefacb6e7732b" title="X coordinate of the vector.">X</a>/=val;<a class="code" href="classirr_1_1core_1_1vector3d.html#af8f87c2fe0ce717ade7c3d7419302fbd" title="Y coordinate of the vector.">Y</a>/=val;<a class="code" href="classirr_1_1core_1_1vector3d.html#ac2beb702e718c3579971348981b220ed" title="Z coordinate of the vector.">Z</a>/=val; <span class="keywordflow">return</span> *<span class="keyword">this</span>;}
|
||
|
<a name="l00423"></a>00423
|
||
|
<a name="l00424"></a>00424 <span class="keyword">template</span> <>
|
||
|
<a name="l00425"></a><a class="code" href="classirr_1_1core_1_1vector3d.html#aa11de50e7f575c6c282de66417279444">00425</a> <span class="keyword">inline</span> <a class="code" href="classirr_1_1core_1_1vector3d.html" title="3d vector template class with lots of operators and methods.">vector3d<s32></a> <a class="code" href="classirr_1_1core_1_1vector3d.html#aab6d3c2dc082d8142c7ac4da8625f93a" title="Get the spherical coordinate angles.">vector3d<s32>::getSphericalCoordinateAngles</a>()<span class="keyword"> const</span>
|
||
|
<a name="l00426"></a>00426 <span class="keyword"> </span>{
|
||
|
<a name="l00427"></a>00427 <a class="code" href="classirr_1_1core_1_1vector3d.html" title="3d vector template class with lots of operators and methods.">vector3d<s32></a> angle;
|
||
|
<a name="l00428"></a>00428 <span class="keyword">const</span> <a class="code" href="namespaceirr.html#a1325b02603ad449f92c68fc640af9b28" title="64 bit floating point variable.">f64</a> length = <a class="code" href="classirr_1_1core_1_1vector3d.html#a8c9ed06774dc668112bcefacb6e7732b" title="X coordinate of the vector.">X</a>*<a class="code" href="classirr_1_1core_1_1vector3d.html#a8c9ed06774dc668112bcefacb6e7732b" title="X coordinate of the vector.">X</a> + <a class="code" href="classirr_1_1core_1_1vector3d.html#af8f87c2fe0ce717ade7c3d7419302fbd" title="Y coordinate of the vector.">Y</a>*<a class="code" href="classirr_1_1core_1_1vector3d.html#af8f87c2fe0ce717ade7c3d7419302fbd" title="Y coordinate of the vector.">Y</a> + <a class="code" href="classirr_1_1core_1_1vector3d.html#ac2beb702e718c3579971348981b220ed" title="Z coordinate of the vector.">Z</a>*<a class="code" href="classirr_1_1core_1_1vector3d.html#ac2beb702e718c3579971348981b220ed" title="Z coordinate of the vector.">Z</a>;
|
||
|
<a name="l00429"></a>00429
|
||
|
<a name="l00430"></a>00430 <span class="keywordflow">if</span> (length)
|
||
|
<a name="l00431"></a>00431 {
|
||
|
<a name="l00432"></a>00432 <span class="keywordflow">if</span> (<a class="code" href="classirr_1_1core_1_1vector3d.html#a8c9ed06774dc668112bcefacb6e7732b" title="X coordinate of the vector.">X</a>!=0)
|
||
|
<a name="l00433"></a>00433 {
|
||
|
<a name="l00434"></a>00434 angle.<a class="code" href="classirr_1_1core_1_1vector3d.html#af8f87c2fe0ce717ade7c3d7419302fbd" title="Y coordinate of the vector.">Y</a> = <a class="code" href="namespaceirr_1_1core.html#ae46f57f03e9033c57c180fbe83b04cf2">round32</a>((<a class="code" href="namespaceirr.html#a0277be98d67dc26ff93b1a6a1d086b07" title="32 bit floating point variable.">f32</a>)(atan2((<a class="code" href="namespaceirr.html#a1325b02603ad449f92c68fc640af9b28" title="64 bit floating point variable.">f64</a>)Z,(<a class="code" href="namespaceirr.html#a1325b02603ad449f92c68fc640af9b28" title="64 bit floating point variable.">f64</a>)<a class="code" href="classirr_1_1core_1_1vector3d.html#a8c9ed06774dc668112bcefacb6e7732b" title="X coordinate of the vector.">X</a>) * <a class="code" href="namespaceirr_1_1core.html#ae7afeb48af12f5f5130cd179a644ec58" title="64bit constant for converting from radians to degrees">RADTODEG64</a>));
|
||
|
<a name="l00435"></a>00435 }
|
||
|
<a name="l00436"></a>00436 <span class="keywordflow">else</span> <span class="keywordflow">if</span> (Z<0)
|
||
|
<a name="l00437"></a>00437 angle.<a class="code" href="classirr_1_1core_1_1vector3d.html#af8f87c2fe0ce717ade7c3d7419302fbd" title="Y coordinate of the vector.">Y</a>=180;
|
||
|
<a name="l00438"></a>00438
|
||
|
<a name="l00439"></a>00439 angle.<a class="code" href="classirr_1_1core_1_1vector3d.html#a8c9ed06774dc668112bcefacb6e7732b" title="X coordinate of the vector.">X</a> = <a class="code" href="namespaceirr_1_1core.html#ae46f57f03e9033c57c180fbe83b04cf2">round32</a>((<a class="code" href="namespaceirr.html#a0277be98d67dc26ff93b1a6a1d086b07" title="32 bit floating point variable.">f32</a>)(acos(<a class="code" href="classirr_1_1core_1_1vector3d.html#af8f87c2fe0ce717ade7c3d7419302fbd" title="Y coordinate of the vector.">Y</a> * <a class="code" href="namespaceirr_1_1core.html#adaef309f12c2a3386e94610e24f2bfa7">core::reciprocal_squareroot</a>(length)) * <a class="code" href="namespaceirr_1_1core.html#ae7afeb48af12f5f5130cd179a644ec58" title="64bit constant for converting from radians to degrees">RADTODEG64</a>));
|
||
|
<a name="l00440"></a>00440 }
|
||
|
<a name="l00441"></a>00441 <span class="keywordflow">return</span> angle;
|
||
|
<a name="l00442"></a>00442 }
|
||
|
<a name="l00443"></a>00443
|
||
|
<a name="l00445"></a><a class="code" href="namespaceirr_1_1core.html#a06f169d08b5c429f5575acb7edbad811">00445</a> <span class="keyword">typedef</span> <a class="code" href="classirr_1_1core_1_1vector3d.html">vector3d<f32></a> <a class="code" href="namespaceirr_1_1core.html#a06f169d08b5c429f5575acb7edbad811" title="Typedef for a f32 3d vector.">vector3df</a>;
|
||
|
<a name="l00446"></a>00446
|
||
|
<a name="l00448"></a><a class="code" href="namespaceirr_1_1core.html#a5608360e6c03b6bc9d600dad4d3b25ab">00448</a> <span class="keyword">typedef</span> <a class="code" href="classirr_1_1core_1_1vector3d.html" title="3d vector template class with lots of operators and methods.">vector3d<s32></a> <a class="code" href="namespaceirr_1_1core.html#a5608360e6c03b6bc9d600dad4d3b25ab" title="Typedef for an integer 3d vector.">vector3di</a>;
|
||
|
<a name="l00449"></a>00449
|
||
|
<a name="l00451"></a>00451 <span class="keyword">template</span><<span class="keyword">class</span> S, <span class="keyword">class</span> T>
|
||
|
<a name="l00452"></a><a class="code" href="namespaceirr_1_1core.html#a169752e96cde0be366fd3d9efea44dc1">00452</a> <a class="code" href="classirr_1_1core_1_1vector3d.html" title="3d vector template class with lots of operators and methods.">vector3d<T></a> <a class="code" href="classirr_1_1core_1_1vector3d.html#aab7ded0a282f23cdc75533873f41dee5">operator*</a>(<span class="keyword">const</span> S scalar, <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<T></a>& vector) { <span class="keywordflow">return</span> vector*scalar; }
|
||
|
<a name="l00453"></a>00453
|
||
|
<a name="l00454"></a>00454 } <span class="comment">// end namespace core</span>
|
||
|
<a name="l00455"></a>00455 } <span class="comment">// end namespace irr</span>
|
||
|
<a name="l00456"></a>00456
|
||
|
<a name="l00457"></a>00457 <span class="preprocessor">#endif</span>
|
||
|
<a name="l00458"></a>00458 <span class="preprocessor"></span>
|
||
|
</pre></div></div>
|
||
|
</div>
|
||
|
<div id="nav-path" class="navpath">
|
||
|
<ul>
|
||
|
<li class="navelem"><a class="el" href="vector3d_8h.html">vector3d.h</a> </li>
|
||
|
<!-- window showing the filter options -->
|
||
|
<div id="MSearchSelectWindow"
|
||
|
onmouseover="return searchBox.OnSearchSelectShow()"
|
||
|
onmouseout="return searchBox.OnSearchSelectHide()"
|
||
|
onkeydown="return searchBox.OnSearchSelectKey(event)">
|
||
|
<a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(0)"><span class="SelectionMark"> </span>All</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(1)"><span class="SelectionMark"> </span>Classes</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(2)"><span class="SelectionMark"> </span>Namespaces</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(3)"><span class="SelectionMark"> </span>Files</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(4)"><span class="SelectionMark"> </span>Functions</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(5)"><span class="SelectionMark"> </span>Variables</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(6)"><span class="SelectionMark"> </span>Typedefs</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(7)"><span class="SelectionMark"> </span>Enumerations</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(8)"><span class="SelectionMark"> </span>Enumerator</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(9)"><span class="SelectionMark"> </span>Friends</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(10)"><span class="SelectionMark"> </span>Defines</a></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>
|
||
|
|
||
|
|
||
|
<li class="footer">
|
||
|
<a href="http://irrlicht.sourceforge.net" target="_blank">Irrlicht
|
||
|
Engine</a> Documentation © 2003-2012 by Nikolaus Gebhardt. Generated on Tue Jan 19 2016 16:08:46 for Irrlicht 3D Engine by
|
||
|
<a href="http://www.doxygen.org/index.html" target="_blank">Doxygen</a> 1.7.5.1 </li>
|
||
|
</ul>
|
||
|
</div>
|
||
|
|
||
|
|
||
|
</body>
|
||
|
</html>
|