mirror of
https://github.com/minetest/irrlicht.git
synced 2024-11-11 21:00:35 +01:00
405 lines
90 KiB
HTML
405 lines
90 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: vector2d.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('vector2d_8h.html','');
|
||
|
</script>
|
||
|
<div id="doc-content">
|
||
|
<div class="header">
|
||
|
<div class="headertitle">
|
||
|
<div class="title">vector2d.h</div> </div>
|
||
|
</div>
|
||
|
<div class="contents">
|
||
|
<a href="vector2d_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_2D_H_INCLUDED__</span>
|
||
|
<a name="l00006"></a>00006 <span class="preprocessor"></span><span class="preprocessor">#define __IRR_POINT_2D_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 <span class="preprocessor">#include "<a class="code" href="dimension2d_8h.html">dimension2d.h</a>"</span>
|
||
|
<a name="l00010"></a>00010
|
||
|
<a name="l00011"></a>00011 <span class="keyword">namespace </span>irr
|
||
|
<a name="l00012"></a>00012 {
|
||
|
<a name="l00013"></a>00013 <span class="keyword">namespace </span>core
|
||
|
<a name="l00014"></a>00014 {
|
||
|
<a name="l00015"></a>00015
|
||
|
<a name="l00016"></a>00016
|
||
|
<a name="l00018"></a>00018
|
||
|
<a name="l00020"></a>00020 <span class="keyword">template</span> <<span class="keyword">class</span> T>
|
||
|
<a name="l00021"></a><a class="code" href="classirr_1_1core_1_1vector2d.html">00021</a> <span class="keyword">class </span><a class="code" href="classirr_1_1core_1_1vector2d.html" title="2d vector template class with lots of operators and methods.">vector2d</a>
|
||
|
<a name="l00022"></a>00022 {
|
||
|
<a name="l00023"></a>00023 <span class="keyword">public</span>:
|
||
|
<a name="l00025"></a><a class="code" href="classirr_1_1core_1_1vector2d.html#a72c37c85b812bdaee77a32857d12bb7f">00025</a> <a class="code" href="classirr_1_1core_1_1vector2d.html#a72c37c85b812bdaee77a32857d12bb7f" title="Default constructor (null vector)">vector2d</a>() : <a class="code" href="classirr_1_1core_1_1vector2d.html#a8fabb0d10a3dd33b407b63bb3539be4d" title="X coordinate of vector.">X</a>(0), <a class="code" href="classirr_1_1core_1_1vector2d.html#aa4d36f518d3fc35a7aafcea33a31f76c" title="Y coordinate of vector.">Y</a>(0) {}
|
||
|
<a name="l00027"></a><a class="code" href="classirr_1_1core_1_1vector2d.html#addeb85b77b2f8372609330c66ffe53b0">00027</a> <a class="code" href="classirr_1_1core_1_1vector2d.html#addeb85b77b2f8372609330c66ffe53b0" title="Constructor with two different values.">vector2d</a>(T nx, T ny) : <a class="code" href="classirr_1_1core_1_1vector2d.html#a8fabb0d10a3dd33b407b63bb3539be4d" title="X coordinate of vector.">X</a>(nx), <a class="code" href="classirr_1_1core_1_1vector2d.html#aa4d36f518d3fc35a7aafcea33a31f76c" title="Y coordinate of vector.">Y</a>(ny) {}
|
||
|
<a name="l00029"></a><a class="code" href="classirr_1_1core_1_1vector2d.html#a88a082b80dbf6b5c221e5086fbade7e5">00029</a> <span class="keyword">explicit</span> <a class="code" href="classirr_1_1core_1_1vector2d.html#a88a082b80dbf6b5c221e5086fbade7e5" title="Constructor with the same value for both members.">vector2d</a>(T n) : <a class="code" href="classirr_1_1core_1_1vector2d.html#a8fabb0d10a3dd33b407b63bb3539be4d" title="X coordinate of vector.">X</a>(n), <a class="code" href="classirr_1_1core_1_1vector2d.html#aa4d36f518d3fc35a7aafcea33a31f76c" title="Y coordinate of vector.">Y</a>(n) {}
|
||
|
<a name="l00031"></a><a class="code" href="classirr_1_1core_1_1vector2d.html#a8ebd20ef37425d42120c13aabdf63298">00031</a> <a class="code" href="classirr_1_1core_1_1vector2d.html#a8ebd20ef37425d42120c13aabdf63298" title="Copy constructor.">vector2d</a>(<span class="keyword">const</span> <a class="code" href="classirr_1_1core_1_1vector2d.html" title="2d vector template class with lots of operators and methods.">vector2d<T></a>& other) : <a class="code" href="classirr_1_1core_1_1vector2d.html#a8fabb0d10a3dd33b407b63bb3539be4d" title="X coordinate of vector.">X</a>(other.<a class="code" href="classirr_1_1core_1_1vector2d.html#a8fabb0d10a3dd33b407b63bb3539be4d" title="X coordinate of vector.">X</a>), <a class="code" href="classirr_1_1core_1_1vector2d.html#aa4d36f518d3fc35a7aafcea33a31f76c" title="Y coordinate of vector.">Y</a>(other.<a class="code" href="classirr_1_1core_1_1vector2d.html#aa4d36f518d3fc35a7aafcea33a31f76c" title="Y coordinate of vector.">Y</a>) {}
|
||
|
<a name="l00032"></a>00032
|
||
|
<a name="l00033"></a><a class="code" href="classirr_1_1core_1_1vector2d.html#ad394222b16dcdc23c416d57acbb367cb">00033</a> <a class="code" href="classirr_1_1core_1_1vector2d.html#ad394222b16dcdc23c416d57acbb367cb">vector2d</a>(<span class="keyword">const</span> <a class="code" href="classirr_1_1core_1_1dimension2d.html" title="Specifies a 2 dimensional size.">dimension2d<T></a>& other) : <a class="code" href="classirr_1_1core_1_1vector2d.html#a8fabb0d10a3dd33b407b63bb3539be4d" title="X coordinate of vector.">X</a>(other.Width), <a class="code" href="classirr_1_1core_1_1vector2d.html#aa4d36f518d3fc35a7aafcea33a31f76c" title="Y coordinate of vector.">Y</a>(other.Height) {}
|
||
|
<a name="l00034"></a>00034
|
||
|
<a name="l00035"></a>00035 <span class="comment">// operators</span>
|
||
|
<a name="l00036"></a>00036
|
||
|
<a name="l00037"></a><a class="code" href="classirr_1_1core_1_1vector2d.html#ad3fec2fa4ab4a2c6e5705d67399ee84c">00037</a> <a class="code" href="classirr_1_1core_1_1vector2d.html" title="2d vector template class with lots of operators and methods.">vector2d<T></a> <a class="code" href="classirr_1_1core_1_1vector2d.html#ad3fec2fa4ab4a2c6e5705d67399ee84c">operator-</a>()<span class="keyword"> const </span>{ <span class="keywordflow">return</span> <a class="code" href="classirr_1_1core_1_1vector2d.html" title="2d vector template class with lots of operators and methods.">vector2d<T></a>(-<a class="code" href="classirr_1_1core_1_1vector2d.html#a8fabb0d10a3dd33b407b63bb3539be4d" title="X coordinate of vector.">X</a>, -<a class="code" href="classirr_1_1core_1_1vector2d.html#aa4d36f518d3fc35a7aafcea33a31f76c" title="Y coordinate of vector.">Y</a>); }
|
||
|
<a name="l00038"></a>00038
|
||
|
<a name="l00039"></a><a class="code" href="classirr_1_1core_1_1vector2d.html#a26ed12896e0f2b596b90104a10afabe1">00039</a> <a class="code" href="classirr_1_1core_1_1vector2d.html" title="2d vector template class with lots of operators and methods.">vector2d<T></a>& <a class="code" href="classirr_1_1core_1_1vector2d.html#a26ed12896e0f2b596b90104a10afabe1">operator=</a>(<span class="keyword">const</span> <a class="code" href="classirr_1_1core_1_1vector2d.html" title="2d vector template class with lots of operators and methods.">vector2d<T></a>& other) { <a class="code" href="classirr_1_1core_1_1vector2d.html#a8fabb0d10a3dd33b407b63bb3539be4d" title="X coordinate of vector.">X</a> = other.<a class="code" href="classirr_1_1core_1_1vector2d.html#a8fabb0d10a3dd33b407b63bb3539be4d" title="X coordinate of vector.">X</a>; <a class="code" href="classirr_1_1core_1_1vector2d.html#aa4d36f518d3fc35a7aafcea33a31f76c" title="Y coordinate of vector.">Y</a> = other.<a class="code" href="classirr_1_1core_1_1vector2d.html#aa4d36f518d3fc35a7aafcea33a31f76c" title="Y coordinate of vector.">Y</a>; <span class="keywordflow">return</span> *<span class="keyword">this</span>; }
|
||
|
<a name="l00040"></a>00040
|
||
|
<a name="l00041"></a><a class="code" href="classirr_1_1core_1_1vector2d.html#a0ee6c8bafead525cd415c84cf74012f2">00041</a> <a class="code" href="classirr_1_1core_1_1vector2d.html" title="2d vector template class with lots of operators and methods.">vector2d<T></a>& <a class="code" href="classirr_1_1core_1_1vector2d.html#a0ee6c8bafead525cd415c84cf74012f2">operator=</a>(<span class="keyword">const</span> <a class="code" href="classirr_1_1core_1_1dimension2d.html" title="Specifies a 2 dimensional size.">dimension2d<T></a>& other) { <a class="code" href="classirr_1_1core_1_1vector2d.html#a8fabb0d10a3dd33b407b63bb3539be4d" title="X coordinate of vector.">X</a> = other.<a class="code" href="classirr_1_1core_1_1dimension2d.html#a0399dcc023c19d381d1a192596107db4" title="Width of the dimension.">Width</a>; <a class="code" href="classirr_1_1core_1_1vector2d.html#aa4d36f518d3fc35a7aafcea33a31f76c" title="Y coordinate of vector.">Y</a> = other.<a class="code" href="classirr_1_1core_1_1dimension2d.html#a89b253523d31336c6b2a6a56dfd48a6b" title="Height of the dimension.">Height</a>; <span class="keywordflow">return</span> *<span class="keyword">this</span>; }
|
||
|
<a name="l00042"></a>00042
|
||
|
<a name="l00043"></a><a class="code" href="classirr_1_1core_1_1vector2d.html#ad61d79f7e748f3b02eb57cc61c231a99">00043</a> <a class="code" href="classirr_1_1core_1_1vector2d.html" title="2d vector template class with lots of operators and methods.">vector2d<T></a> <a class="code" href="classirr_1_1core_1_1vector2d.html#ad61d79f7e748f3b02eb57cc61c231a99">operator+</a>(<span class="keyword">const</span> <a class="code" href="classirr_1_1core_1_1vector2d.html" title="2d vector template class with lots of operators and methods.">vector2d<T></a>& other)<span class="keyword"> const </span>{ <span class="keywordflow">return</span> <a class="code" href="classirr_1_1core_1_1vector2d.html" title="2d vector template class with lots of operators and methods.">vector2d<T></a>(<a class="code" href="classirr_1_1core_1_1vector2d.html#a8fabb0d10a3dd33b407b63bb3539be4d" title="X coordinate of vector.">X</a> + other.<a class="code" href="classirr_1_1core_1_1vector2d.html#a8fabb0d10a3dd33b407b63bb3539be4d" title="X coordinate of vector.">X</a>, <a class="code" href="classirr_1_1core_1_1vector2d.html#aa4d36f518d3fc35a7aafcea33a31f76c" title="Y coordinate of vector.">Y</a> + other.<a class="code" href="classirr_1_1core_1_1vector2d.html#aa4d36f518d3fc35a7aafcea33a31f76c" title="Y coordinate of vector.">Y</a>); }
|
||
|
<a name="l00044"></a><a class="code" href="classirr_1_1core_1_1vector2d.html#a03cea10fda9ab64ad0378ab78bcbb101">00044</a> <a class="code" href="classirr_1_1core_1_1vector2d.html" title="2d vector template class with lots of operators and methods.">vector2d<T></a> <a class="code" href="classirr_1_1core_1_1vector2d.html#a03cea10fda9ab64ad0378ab78bcbb101">operator+</a>(<span class="keyword">const</span> <a class="code" href="classirr_1_1core_1_1dimension2d.html" title="Specifies a 2 dimensional size.">dimension2d<T></a>& other)<span class="keyword"> const </span>{ <span class="keywordflow">return</span> <a class="code" href="classirr_1_1core_1_1vector2d.html" title="2d vector template class with lots of operators and methods.">vector2d<T></a>(<a class="code" href="classirr_1_1core_1_1vector2d.html#a8fabb0d10a3dd33b407b63bb3539be4d" title="X coordinate of vector.">X</a> + other.<a class="code" href="classirr_1_1core_1_1dimension2d.html#a0399dcc023c19d381d1a192596107db4" title="Width of the dimension.">Width</a>, <a class="code" href="classirr_1_1core_1_1vector2d.html#aa4d36f518d3fc35a7aafcea33a31f76c" title="Y coordinate of vector.">Y</a> + other.<a class="code" href="classirr_1_1core_1_1dimension2d.html#a89b253523d31336c6b2a6a56dfd48a6b" title="Height of the dimension.">Height</a>); }
|
||
|
<a name="l00045"></a><a class="code" href="classirr_1_1core_1_1vector2d.html#a9562439453b7fe491e3f3310e6e36440">00045</a> <a class="code" href="classirr_1_1core_1_1vector2d.html" title="2d vector template class with lots of operators and methods.">vector2d<T></a>& <a class="code" href="classirr_1_1core_1_1vector2d.html#a9562439453b7fe491e3f3310e6e36440">operator+=</a>(<span class="keyword">const</span> <a class="code" href="classirr_1_1core_1_1vector2d.html" title="2d vector template class with lots of operators and methods.">vector2d<T></a>& other) { <a class="code" href="classirr_1_1core_1_1vector2d.html#a8fabb0d10a3dd33b407b63bb3539be4d" title="X coordinate of vector.">X</a>+=other.<a class="code" href="classirr_1_1core_1_1vector2d.html#a8fabb0d10a3dd33b407b63bb3539be4d" title="X coordinate of vector.">X</a>; <a class="code" href="classirr_1_1core_1_1vector2d.html#aa4d36f518d3fc35a7aafcea33a31f76c" title="Y coordinate of vector.">Y</a>+=other.<a class="code" href="classirr_1_1core_1_1vector2d.html#aa4d36f518d3fc35a7aafcea33a31f76c" title="Y coordinate of vector.">Y</a>; <span class="keywordflow">return</span> *<span class="keyword">this</span>; }
|
||
|
<a name="l00046"></a><a class="code" href="classirr_1_1core_1_1vector2d.html#a0f2a30be25c63b94cb64dc158af7d0ee">00046</a> <a class="code" href="classirr_1_1core_1_1vector2d.html" title="2d vector template class with lots of operators and methods.">vector2d<T></a> <a class="code" href="classirr_1_1core_1_1vector2d.html#a0f2a30be25c63b94cb64dc158af7d0ee">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_1vector2d.html" title="2d vector template class with lots of operators and methods.">vector2d<T></a>(<a class="code" href="classirr_1_1core_1_1vector2d.html#a8fabb0d10a3dd33b407b63bb3539be4d" title="X coordinate of vector.">X</a> + v, <a class="code" href="classirr_1_1core_1_1vector2d.html#aa4d36f518d3fc35a7aafcea33a31f76c" title="Y coordinate of vector.">Y</a> + v); }
|
||
|
<a name="l00047"></a><a class="code" href="classirr_1_1core_1_1vector2d.html#a3f2bf3a89761ccd3f63fd252e8627d06">00047</a> <a class="code" href="classirr_1_1core_1_1vector2d.html" title="2d vector template class with lots of operators and methods.">vector2d<T></a>& <a class="code" href="classirr_1_1core_1_1vector2d.html#a3f2bf3a89761ccd3f63fd252e8627d06">operator+=</a>(<span class="keyword">const</span> T v) { <a class="code" href="classirr_1_1core_1_1vector2d.html#a8fabb0d10a3dd33b407b63bb3539be4d" title="X coordinate of vector.">X</a>+=v; <a class="code" href="classirr_1_1core_1_1vector2d.html#aa4d36f518d3fc35a7aafcea33a31f76c" title="Y coordinate of vector.">Y</a>+=v; <span class="keywordflow">return</span> *<span class="keyword">this</span>; }
|
||
|
<a name="l00048"></a><a class="code" href="classirr_1_1core_1_1vector2d.html#aa05c788c6e98643e285ceaa31da30e8d">00048</a> <a class="code" href="classirr_1_1core_1_1vector2d.html" title="2d vector template class with lots of operators and methods.">vector2d<T></a>& <a class="code" href="classirr_1_1core_1_1vector2d.html#aa05c788c6e98643e285ceaa31da30e8d">operator+=</a>(<span class="keyword">const</span> <a class="code" href="classirr_1_1core_1_1dimension2d.html" title="Specifies a 2 dimensional size.">dimension2d<T></a>& other) { <a class="code" href="classirr_1_1core_1_1vector2d.html#a8fabb0d10a3dd33b407b63bb3539be4d" title="X coordinate of vector.">X</a> += other.<a class="code" href="classirr_1_1core_1_1dimension2d.html#a0399dcc023c19d381d1a192596107db4" title="Width of the dimension.">Width</a>; <a class="code" href="classirr_1_1core_1_1vector2d.html#aa4d36f518d3fc35a7aafcea33a31f76c" title="Y coordinate of vector.">Y</a> += other.<a class="code" href="classirr_1_1core_1_1dimension2d.html#a89b253523d31336c6b2a6a56dfd48a6b" title="Height of the dimension.">Height</a>; <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_1vector2d.html#a12431c746cfdefb6f4c789a610fddbd1">00050</a> <a class="code" href="classirr_1_1core_1_1vector2d.html" title="2d vector template class with lots of operators and methods.">vector2d<T></a> <a class="code" href="classirr_1_1core_1_1vector2d.html#a12431c746cfdefb6f4c789a610fddbd1">operator-</a>(<span class="keyword">const</span> <a class="code" href="classirr_1_1core_1_1vector2d.html" title="2d vector template class with lots of operators and methods.">vector2d<T></a>& other)<span class="keyword"> const </span>{ <span class="keywordflow">return</span> <a class="code" href="classirr_1_1core_1_1vector2d.html" title="2d vector template class with lots of operators and methods.">vector2d<T></a>(<a class="code" href="classirr_1_1core_1_1vector2d.html#a8fabb0d10a3dd33b407b63bb3539be4d" title="X coordinate of vector.">X</a> - other.<a class="code" href="classirr_1_1core_1_1vector2d.html#a8fabb0d10a3dd33b407b63bb3539be4d" title="X coordinate of vector.">X</a>, <a class="code" href="classirr_1_1core_1_1vector2d.html#aa4d36f518d3fc35a7aafcea33a31f76c" title="Y coordinate of vector.">Y</a> - other.<a class="code" href="classirr_1_1core_1_1vector2d.html#aa4d36f518d3fc35a7aafcea33a31f76c" title="Y coordinate of vector.">Y</a>); }
|
||
|
<a name="l00051"></a><a class="code" href="classirr_1_1core_1_1vector2d.html#af1833e3ff96a4cf3005ceb322cfc62b1">00051</a> <a class="code" href="classirr_1_1core_1_1vector2d.html" title="2d vector template class with lots of operators and methods.">vector2d<T></a> <a class="code" href="classirr_1_1core_1_1vector2d.html#af1833e3ff96a4cf3005ceb322cfc62b1">operator-</a>(<span class="keyword">const</span> <a class="code" href="classirr_1_1core_1_1dimension2d.html" title="Specifies a 2 dimensional size.">dimension2d<T></a>& other)<span class="keyword"> const </span>{ <span class="keywordflow">return</span> <a class="code" href="classirr_1_1core_1_1vector2d.html" title="2d vector template class with lots of operators and methods.">vector2d<T></a>(<a class="code" href="classirr_1_1core_1_1vector2d.html#a8fabb0d10a3dd33b407b63bb3539be4d" title="X coordinate of vector.">X</a> - other.<a class="code" href="classirr_1_1core_1_1dimension2d.html#a0399dcc023c19d381d1a192596107db4" title="Width of the dimension.">Width</a>, <a class="code" href="classirr_1_1core_1_1vector2d.html#aa4d36f518d3fc35a7aafcea33a31f76c" title="Y coordinate of vector.">Y</a> - other.<a class="code" href="classirr_1_1core_1_1dimension2d.html#a89b253523d31336c6b2a6a56dfd48a6b" title="Height of the dimension.">Height</a>); }
|
||
|
<a name="l00052"></a><a class="code" href="classirr_1_1core_1_1vector2d.html#a557a9942c5592d176276e1af8e6da2a4">00052</a> <a class="code" href="classirr_1_1core_1_1vector2d.html" title="2d vector template class with lots of operators and methods.">vector2d<T></a>& <a class="code" href="classirr_1_1core_1_1vector2d.html#a557a9942c5592d176276e1af8e6da2a4">operator-=</a>(<span class="keyword">const</span> <a class="code" href="classirr_1_1core_1_1vector2d.html" title="2d vector template class with lots of operators and methods.">vector2d<T></a>& other) { <a class="code" href="classirr_1_1core_1_1vector2d.html#a8fabb0d10a3dd33b407b63bb3539be4d" title="X coordinate of vector.">X</a>-=other.<a class="code" href="classirr_1_1core_1_1vector2d.html#a8fabb0d10a3dd33b407b63bb3539be4d" title="X coordinate of vector.">X</a>; <a class="code" href="classirr_1_1core_1_1vector2d.html#aa4d36f518d3fc35a7aafcea33a31f76c" title="Y coordinate of vector.">Y</a>-=other.<a class="code" href="classirr_1_1core_1_1vector2d.html#aa4d36f518d3fc35a7aafcea33a31f76c" title="Y coordinate of vector.">Y</a>; <span class="keywordflow">return</span> *<span class="keyword">this</span>; }
|
||
|
<a name="l00053"></a><a class="code" href="classirr_1_1core_1_1vector2d.html#a95e234978a779d84135c123e4ecd0a06">00053</a> <a class="code" href="classirr_1_1core_1_1vector2d.html" title="2d vector template class with lots of operators and methods.">vector2d<T></a> <a class="code" href="classirr_1_1core_1_1vector2d.html#a95e234978a779d84135c123e4ecd0a06">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_1vector2d.html" title="2d vector template class with lots of operators and methods.">vector2d<T></a>(<a class="code" href="classirr_1_1core_1_1vector2d.html#a8fabb0d10a3dd33b407b63bb3539be4d" title="X coordinate of vector.">X</a> - v, <a class="code" href="classirr_1_1core_1_1vector2d.html#aa4d36f518d3fc35a7aafcea33a31f76c" title="Y coordinate of vector.">Y</a> - v); }
|
||
|
<a name="l00054"></a><a class="code" href="classirr_1_1core_1_1vector2d.html#a7fbdd3a9627d4f7342c2f897b846c131">00054</a> <a class="code" href="classirr_1_1core_1_1vector2d.html" title="2d vector template class with lots of operators and methods.">vector2d<T></a>& <a class="code" href="classirr_1_1core_1_1vector2d.html#a7fbdd3a9627d4f7342c2f897b846c131">operator-=</a>(<span class="keyword">const</span> T v) { <a class="code" href="classirr_1_1core_1_1vector2d.html#a8fabb0d10a3dd33b407b63bb3539be4d" title="X coordinate of vector.">X</a>-=v; <a class="code" href="classirr_1_1core_1_1vector2d.html#aa4d36f518d3fc35a7aafcea33a31f76c" title="Y coordinate of vector.">Y</a>-=v; <span class="keywordflow">return</span> *<span class="keyword">this</span>; }
|
||
|
<a name="l00055"></a><a class="code" href="classirr_1_1core_1_1vector2d.html#a9b8112fbfaa7d1a1c07bc3b8fb82e6fa">00055</a> <a class="code" href="classirr_1_1core_1_1vector2d.html" title="2d vector template class with lots of operators and methods.">vector2d<T></a>& <a class="code" href="classirr_1_1core_1_1vector2d.html#a9b8112fbfaa7d1a1c07bc3b8fb82e6fa">operator-=</a>(<span class="keyword">const</span> <a class="code" href="classirr_1_1core_1_1dimension2d.html" title="Specifies a 2 dimensional size.">dimension2d<T></a>& other) { <a class="code" href="classirr_1_1core_1_1vector2d.html#a8fabb0d10a3dd33b407b63bb3539be4d" title="X coordinate of vector.">X</a> -= other.<a class="code" href="classirr_1_1core_1_1dimension2d.html#a0399dcc023c19d381d1a192596107db4" title="Width of the dimension.">Width</a>; <a class="code" href="classirr_1_1core_1_1vector2d.html#aa4d36f518d3fc35a7aafcea33a31f76c" title="Y coordinate of vector.">Y</a> -= other.<a class="code" href="classirr_1_1core_1_1dimension2d.html#a89b253523d31336c6b2a6a56dfd48a6b" title="Height of the dimension.">Height</a>; <span class="keywordflow">return</span> *<span class="keyword">this</span>; }
|
||
|
<a name="l00056"></a>00056
|
||
|
<a name="l00057"></a><a class="code" href="classirr_1_1core_1_1vector2d.html#ad0267af40443b941680e89803710d296">00057</a> <a class="code" href="classirr_1_1core_1_1vector2d.html" title="2d vector template class with lots of operators and methods.">vector2d<T></a> <a class="code" href="classirr_1_1core_1_1vector2d.html#ad0267af40443b941680e89803710d296">operator*</a>(<span class="keyword">const</span> <a class="code" href="classirr_1_1core_1_1vector2d.html" title="2d vector template class with lots of operators and methods.">vector2d<T></a>& other)<span class="keyword"> const </span>{ <span class="keywordflow">return</span> <a class="code" href="classirr_1_1core_1_1vector2d.html" title="2d vector template class with lots of operators and methods.">vector2d<T></a>(<a class="code" href="classirr_1_1core_1_1vector2d.html#a8fabb0d10a3dd33b407b63bb3539be4d" title="X coordinate of vector.">X</a> * other.<a class="code" href="classirr_1_1core_1_1vector2d.html#a8fabb0d10a3dd33b407b63bb3539be4d" title="X coordinate of vector.">X</a>, <a class="code" href="classirr_1_1core_1_1vector2d.html#aa4d36f518d3fc35a7aafcea33a31f76c" title="Y coordinate of vector.">Y</a> * other.<a class="code" href="classirr_1_1core_1_1vector2d.html#aa4d36f518d3fc35a7aafcea33a31f76c" title="Y coordinate of vector.">Y</a>); }
|
||
|
<a name="l00058"></a><a class="code" href="classirr_1_1core_1_1vector2d.html#a2053cd0795a974e9531412967efcc605">00058</a> <a class="code" href="classirr_1_1core_1_1vector2d.html" title="2d vector template class with lots of operators and methods.">vector2d<T></a>& <a class="code" href="classirr_1_1core_1_1vector2d.html#a2053cd0795a974e9531412967efcc605">operator*=</a>(<span class="keyword">const</span> <a class="code" href="classirr_1_1core_1_1vector2d.html" title="2d vector template class with lots of operators and methods.">vector2d<T></a>& other) { <a class="code" href="classirr_1_1core_1_1vector2d.html#a8fabb0d10a3dd33b407b63bb3539be4d" title="X coordinate of vector.">X</a>*=other.<a class="code" href="classirr_1_1core_1_1vector2d.html#a8fabb0d10a3dd33b407b63bb3539be4d" title="X coordinate of vector.">X</a>; <a class="code" href="classirr_1_1core_1_1vector2d.html#aa4d36f518d3fc35a7aafcea33a31f76c" title="Y coordinate of vector.">Y</a>*=other.<a class="code" href="classirr_1_1core_1_1vector2d.html#aa4d36f518d3fc35a7aafcea33a31f76c" title="Y coordinate of vector.">Y</a>; <span class="keywordflow">return</span> *<span class="keyword">this</span>; }
|
||
|
<a name="l00059"></a><a class="code" href="classirr_1_1core_1_1vector2d.html#afb6e3105c7a869e05042eedcbc31cc84">00059</a> <a class="code" href="classirr_1_1core_1_1vector2d.html" title="2d vector template class with lots of operators and methods.">vector2d<T></a> <a class="code" href="classirr_1_1core_1_1vector2d.html#afb6e3105c7a869e05042eedcbc31cc84">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_1vector2d.html" title="2d vector template class with lots of operators and methods.">vector2d<T></a>(<a class="code" href="classirr_1_1core_1_1vector2d.html#a8fabb0d10a3dd33b407b63bb3539be4d" title="X coordinate of vector.">X</a> * v, <a class="code" href="classirr_1_1core_1_1vector2d.html#aa4d36f518d3fc35a7aafcea33a31f76c" title="Y coordinate of vector.">Y</a> * v); }
|
||
|
<a name="l00060"></a><a class="code" href="classirr_1_1core_1_1vector2d.html#ac0935984d68c32a2f0cd7e74c53751a7">00060</a> <a class="code" href="classirr_1_1core_1_1vector2d.html" title="2d vector template class with lots of operators and methods.">vector2d<T></a>& <a class="code" href="classirr_1_1core_1_1vector2d.html#ac0935984d68c32a2f0cd7e74c53751a7">operator*=</a>(<span class="keyword">const</span> T v) { <a class="code" href="classirr_1_1core_1_1vector2d.html#a8fabb0d10a3dd33b407b63bb3539be4d" title="X coordinate of vector.">X</a>*=v; <a class="code" href="classirr_1_1core_1_1vector2d.html#aa4d36f518d3fc35a7aafcea33a31f76c" title="Y coordinate of vector.">Y</a>*=v; <span class="keywordflow">return</span> *<span class="keyword">this</span>; }
|
||
|
<a name="l00061"></a>00061
|
||
|
<a name="l00062"></a><a class="code" href="classirr_1_1core_1_1vector2d.html#a4eb3724d5c798fbbe326645829eadc11">00062</a> <a class="code" href="classirr_1_1core_1_1vector2d.html" title="2d vector template class with lots of operators and methods.">vector2d<T></a> <a class="code" href="classirr_1_1core_1_1vector2d.html#a4eb3724d5c798fbbe326645829eadc11">operator/</a>(<span class="keyword">const</span> <a class="code" href="classirr_1_1core_1_1vector2d.html" title="2d vector template class with lots of operators and methods.">vector2d<T></a>& other)<span class="keyword"> const </span>{ <span class="keywordflow">return</span> <a class="code" href="classirr_1_1core_1_1vector2d.html" title="2d vector template class with lots of operators and methods.">vector2d<T></a>(<a class="code" href="classirr_1_1core_1_1vector2d.html#a8fabb0d10a3dd33b407b63bb3539be4d" title="X coordinate of vector.">X</a> / other.<a class="code" href="classirr_1_1core_1_1vector2d.html#a8fabb0d10a3dd33b407b63bb3539be4d" title="X coordinate of vector.">X</a>, <a class="code" href="classirr_1_1core_1_1vector2d.html#aa4d36f518d3fc35a7aafcea33a31f76c" title="Y coordinate of vector.">Y</a> / other.<a class="code" href="classirr_1_1core_1_1vector2d.html#aa4d36f518d3fc35a7aafcea33a31f76c" title="Y coordinate of vector.">Y</a>); }
|
||
|
<a name="l00063"></a><a class="code" href="classirr_1_1core_1_1vector2d.html#a2ee6a9455f42afd1f6208332557c7bf6">00063</a> <a class="code" href="classirr_1_1core_1_1vector2d.html" title="2d vector template class with lots of operators and methods.">vector2d<T></a>& <a class="code" href="classirr_1_1core_1_1vector2d.html#a2ee6a9455f42afd1f6208332557c7bf6">operator/=</a>(<span class="keyword">const</span> <a class="code" href="classirr_1_1core_1_1vector2d.html" title="2d vector template class with lots of operators and methods.">vector2d<T></a>& other) { <a class="code" href="classirr_1_1core_1_1vector2d.html#a8fabb0d10a3dd33b407b63bb3539be4d" title="X coordinate of vector.">X</a>/=other.<a class="code" href="classirr_1_1core_1_1vector2d.html#a8fabb0d10a3dd33b407b63bb3539be4d" title="X coordinate of vector.">X</a>; <a class="code" href="classirr_1_1core_1_1vector2d.html#aa4d36f518d3fc35a7aafcea33a31f76c" title="Y coordinate of vector.">Y</a>/=other.<a class="code" href="classirr_1_1core_1_1vector2d.html#aa4d36f518d3fc35a7aafcea33a31f76c" title="Y coordinate of vector.">Y</a>; <span class="keywordflow">return</span> *<span class="keyword">this</span>; }
|
||
|
<a name="l00064"></a><a class="code" href="classirr_1_1core_1_1vector2d.html#a343b682b0b27782efecfcc4bc2b62162">00064</a> <a class="code" href="classirr_1_1core_1_1vector2d.html" title="2d vector template class with lots of operators and methods.">vector2d<T></a> <a class="code" href="classirr_1_1core_1_1vector2d.html#a343b682b0b27782efecfcc4bc2b62162">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_1vector2d.html" title="2d vector template class with lots of operators and methods.">vector2d<T></a>(<a class="code" href="classirr_1_1core_1_1vector2d.html#a8fabb0d10a3dd33b407b63bb3539be4d" title="X coordinate of vector.">X</a> / v, <a class="code" href="classirr_1_1core_1_1vector2d.html#aa4d36f518d3fc35a7aafcea33a31f76c" title="Y coordinate of vector.">Y</a> / v); }
|
||
|
<a name="l00065"></a><a class="code" href="classirr_1_1core_1_1vector2d.html#a0a5115fdbc8023793d11ddfea27dd124">00065</a> <a class="code" href="classirr_1_1core_1_1vector2d.html" title="2d vector template class with lots of operators and methods.">vector2d<T></a>& <a class="code" href="classirr_1_1core_1_1vector2d.html#a0a5115fdbc8023793d11ddfea27dd124">operator/=</a>(<span class="keyword">const</span> T v) { <a class="code" href="classirr_1_1core_1_1vector2d.html#a8fabb0d10a3dd33b407b63bb3539be4d" title="X coordinate of vector.">X</a>/=v; <a class="code" href="classirr_1_1core_1_1vector2d.html#aa4d36f518d3fc35a7aafcea33a31f76c" title="Y coordinate of vector.">Y</a>/=v; <span class="keywordflow">return</span> *<span class="keyword">this</span>; }
|
||
|
<a name="l00066"></a>00066
|
||
|
<a name="l00068"></a><a class="code" href="classirr_1_1core_1_1vector2d.html#a828609667abff67902f1de3c2718d9a9">00068</a> <span class="keywordtype">bool</span> operator<=(const vector2d<T>&other) <span class="keyword">const</span>
|
||
|
<a name="l00069"></a>00069 {
|
||
|
<a name="l00070"></a>00070 <span class="keywordflow">return</span> (<a class="code" href="classirr_1_1core_1_1vector2d.html#a8fabb0d10a3dd33b407b63bb3539be4d" title="X coordinate of 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_1vector2d.html#a8fabb0d10a3dd33b407b63bb3539be4d" title="X coordinate of vector.">X</a>, other.X)) ||
|
||
|
<a name="l00071"></a>00071 (<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_1vector2d.html#a8fabb0d10a3dd33b407b63bb3539be4d" title="X coordinate of vector.">X</a>, other.X) && (<a class="code" href="classirr_1_1core_1_1vector2d.html#aa4d36f518d3fc35a7aafcea33a31f76c" title="Y coordinate of vector.">Y</a><other.Y || <a class="code" href="classirr_1_1core_1_1vector2d.html#adca6dbf0b73bbed483471137b8b13bd8" title="Checks if this vector equals the other one.">core::equals</a>(<a class="code" href="classirr_1_1core_1_1vector2d.html#aa4d36f518d3fc35a7aafcea33a31f76c" title="Y coordinate of vector.">Y</a>, other.Y)));
|
||
|
<a name="l00072"></a>00072 }
|
||
|
<a name="l00073"></a>00073
|
||
|
<a name="l00075"></a><a class="code" href="classirr_1_1core_1_1vector2d.html#a09446a47463a9b09c55f87c4ffa19841">00075</a> <span class="keywordtype">bool</span> <a class="code" href="classirr_1_1core_1_1vector2d.html#a09446a47463a9b09c55f87c4ffa19841" title="sort in order X, Y. Equality with rounding tolerance.">operator>=</a>(<span class="keyword">const</span> <a class="code" href="classirr_1_1core_1_1vector2d.html" title="2d vector template class with lots of operators and methods.">vector2d<T></a>&other)<span class="keyword"> const</span>
|
||
|
<a name="l00076"></a>00076 <span class="keyword"> </span>{
|
||
|
<a name="l00077"></a>00077 <span class="keywordflow">return</span> (<a class="code" href="classirr_1_1core_1_1vector2d.html#a8fabb0d10a3dd33b407b63bb3539be4d" title="X coordinate of vector.">X</a>>other.<a class="code" href="classirr_1_1core_1_1vector2d.html#a8fabb0d10a3dd33b407b63bb3539be4d" title="X coordinate of 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_1vector2d.html#a8fabb0d10a3dd33b407b63bb3539be4d" title="X coordinate of vector.">X</a>, other.<a class="code" href="classirr_1_1core_1_1vector2d.html#a8fabb0d10a3dd33b407b63bb3539be4d" title="X coordinate of vector.">X</a>)) ||
|
||
|
<a name="l00078"></a>00078 (<a class="code" href="classirr_1_1core_1_1vector2d.html#adca6dbf0b73bbed483471137b8b13bd8" title="Checks if this vector equals the other one.">core::equals</a>(<a class="code" href="classirr_1_1core_1_1vector2d.html#a8fabb0d10a3dd33b407b63bb3539be4d" title="X coordinate of vector.">X</a>, other.<a class="code" href="classirr_1_1core_1_1vector2d.html#a8fabb0d10a3dd33b407b63bb3539be4d" title="X coordinate of vector.">X</a>) && (<a class="code" href="classirr_1_1core_1_1vector2d.html#aa4d36f518d3fc35a7aafcea33a31f76c" title="Y coordinate of vector.">Y</a>>other.<a class="code" href="classirr_1_1core_1_1vector2d.html#aa4d36f518d3fc35a7aafcea33a31f76c" title="Y coordinate of vector.">Y</a> || <a class="code" href="classirr_1_1core_1_1vector2d.html#adca6dbf0b73bbed483471137b8b13bd8" title="Checks if this vector equals the other one.">core::equals</a>(<a class="code" href="classirr_1_1core_1_1vector2d.html#aa4d36f518d3fc35a7aafcea33a31f76c" title="Y coordinate of vector.">Y</a>, other.<a class="code" href="classirr_1_1core_1_1vector2d.html#aa4d36f518d3fc35a7aafcea33a31f76c" title="Y coordinate of vector.">Y</a>)));
|
||
|
<a name="l00079"></a>00079 }
|
||
|
<a name="l00080"></a>00080
|
||
|
<a name="l00082"></a><a class="code" href="classirr_1_1core_1_1vector2d.html#ac777d6a0b25ed66e73d1b71f25fdbe48">00082</a> <span class="keywordtype">bool</span> operator<(const vector2d<T>&other) <span class="keyword">const</span>
|
||
|
<a name="l00083"></a>00083 {
|
||
|
<a name="l00084"></a>00084 <span class="keywordflow">return</span> (<a class="code" href="classirr_1_1core_1_1vector2d.html#a8fabb0d10a3dd33b407b63bb3539be4d" title="X coordinate of 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_1vector2d.html#a8fabb0d10a3dd33b407b63bb3539be4d" title="X coordinate of vector.">X</a>, other.X)) ||
|
||
|
<a name="l00085"></a>00085 (<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_1vector2d.html#a8fabb0d10a3dd33b407b63bb3539be4d" title="X coordinate of vector.">X</a>, other.X) && <a class="code" href="classirr_1_1core_1_1vector2d.html#aa4d36f518d3fc35a7aafcea33a31f76c" title="Y coordinate of vector.">Y</a><other.Y && !<a class="code" href="classirr_1_1core_1_1vector2d.html#adca6dbf0b73bbed483471137b8b13bd8" title="Checks if this vector equals the other one.">core::equals</a>(<a class="code" href="classirr_1_1core_1_1vector2d.html#aa4d36f518d3fc35a7aafcea33a31f76c" title="Y coordinate of vector.">Y</a>, other.Y));
|
||
|
<a name="l00086"></a>00086 }
|
||
|
<a name="l00087"></a>00087
|
||
|
<a name="l00089"></a><a class="code" href="classirr_1_1core_1_1vector2d.html#a8cd8cc1a497e428e0318a5f698c8396b">00089</a> <span class="keywordtype">bool</span> <a class="code" href="classirr_1_1core_1_1vector2d.html#a8cd8cc1a497e428e0318a5f698c8396b" title="sort in order X, Y. Difference must be above rounding tolerance.">operator></a>(<span class="keyword">const</span> <a class="code" href="classirr_1_1core_1_1vector2d.html" title="2d vector template class with lots of operators and methods.">vector2d<T></a>&other)<span class="keyword"> const</span>
|
||
|
<a name="l00090"></a>00090 <span class="keyword"> </span>{
|
||
|
<a name="l00091"></a>00091 <span class="keywordflow">return</span> (<a class="code" href="classirr_1_1core_1_1vector2d.html#a8fabb0d10a3dd33b407b63bb3539be4d" title="X coordinate of vector.">X</a>>other.<a class="code" href="classirr_1_1core_1_1vector2d.html#a8fabb0d10a3dd33b407b63bb3539be4d" title="X coordinate of 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_1vector2d.html#a8fabb0d10a3dd33b407b63bb3539be4d" title="X coordinate of vector.">X</a>, other.<a class="code" href="classirr_1_1core_1_1vector2d.html#a8fabb0d10a3dd33b407b63bb3539be4d" title="X coordinate of vector.">X</a>)) ||
|
||
|
<a name="l00092"></a>00092 (<a class="code" href="classirr_1_1core_1_1vector2d.html#adca6dbf0b73bbed483471137b8b13bd8" title="Checks if this vector equals the other one.">core::equals</a>(<a class="code" href="classirr_1_1core_1_1vector2d.html#a8fabb0d10a3dd33b407b63bb3539be4d" title="X coordinate of vector.">X</a>, other.<a class="code" href="classirr_1_1core_1_1vector2d.html#a8fabb0d10a3dd33b407b63bb3539be4d" title="X coordinate of vector.">X</a>) && <a class="code" href="classirr_1_1core_1_1vector2d.html#aa4d36f518d3fc35a7aafcea33a31f76c" title="Y coordinate of vector.">Y</a>>other.<a class="code" href="classirr_1_1core_1_1vector2d.html#aa4d36f518d3fc35a7aafcea33a31f76c" title="Y coordinate of vector.">Y</a> && !<a class="code" href="classirr_1_1core_1_1vector2d.html#adca6dbf0b73bbed483471137b8b13bd8" title="Checks if this vector equals the other one.">core::equals</a>(<a class="code" href="classirr_1_1core_1_1vector2d.html#aa4d36f518d3fc35a7aafcea33a31f76c" title="Y coordinate of vector.">Y</a>, other.<a class="code" href="classirr_1_1core_1_1vector2d.html#aa4d36f518d3fc35a7aafcea33a31f76c" title="Y coordinate of vector.">Y</a>));
|
||
|
<a name="l00093"></a>00093 }
|
||
|
<a name="l00094"></a>00094
|
||
|
<a name="l00095"></a><a class="code" href="classirr_1_1core_1_1vector2d.html#a39d74f53f61d65876dc884be7ebe4420">00095</a> <span class="keywordtype">bool</span> <a class="code" href="classirr_1_1core_1_1vector2d.html#a39d74f53f61d65876dc884be7ebe4420">operator==</a>(<span class="keyword">const</span> <a class="code" href="classirr_1_1core_1_1vector2d.html" title="2d vector template class with lots of operators and methods.">vector2d<T></a>& other)<span class="keyword"> const </span>{ <span class="keywordflow">return</span> <a class="code" href="classirr_1_1core_1_1vector2d.html#adca6dbf0b73bbed483471137b8b13bd8" title="Checks if this vector equals the other one.">equals</a>(other); }
|
||
|
<a name="l00096"></a><a class="code" href="classirr_1_1core_1_1vector2d.html#a9270c2d9b665790235d17ecb94450554">00096</a> <span class="keywordtype">bool</span> <a class="code" href="classirr_1_1core_1_1vector2d.html#a9270c2d9b665790235d17ecb94450554">operator!=</a>(<span class="keyword">const</span> <a class="code" href="classirr_1_1core_1_1vector2d.html" title="2d vector template class with lots of operators and methods.">vector2d<T></a>& other)<span class="keyword"> const </span>{ <span class="keywordflow">return</span> !<a class="code" href="classirr_1_1core_1_1vector2d.html#adca6dbf0b73bbed483471137b8b13bd8" title="Checks if this vector equals the other one.">equals</a>(other); }
|
||
|
<a name="l00097"></a>00097
|
||
|
<a name="l00098"></a>00098 <span class="comment">// functions</span>
|
||
|
<a name="l00099"></a>00099
|
||
|
<a name="l00101"></a>00101
|
||
|
<a name="l00104"></a><a class="code" href="classirr_1_1core_1_1vector2d.html#adca6dbf0b73bbed483471137b8b13bd8">00104</a> <span class="keywordtype">bool</span> <a class="code" href="classirr_1_1core_1_1vector2d.html#adca6dbf0b73bbed483471137b8b13bd8" title="Checks if this vector equals the other one.">equals</a>(<span class="keyword">const</span> <a class="code" href="classirr_1_1core_1_1vector2d.html" title="2d vector template class with lots of operators and methods.">vector2d<T></a>& other)<span class="keyword"> const</span>
|
||
|
<a name="l00105"></a>00105 <span class="keyword"> </span>{
|
||
|
<a name="l00106"></a>00106 <span class="keywordflow">return</span> <a class="code" href="classirr_1_1core_1_1vector2d.html#adca6dbf0b73bbed483471137b8b13bd8" title="Checks if this vector equals the other one.">core::equals</a>(<a class="code" href="classirr_1_1core_1_1vector2d.html#a8fabb0d10a3dd33b407b63bb3539be4d" title="X coordinate of vector.">X</a>, other.<a class="code" href="classirr_1_1core_1_1vector2d.html#a8fabb0d10a3dd33b407b63bb3539be4d" title="X coordinate of vector.">X</a>) && <a class="code" href="classirr_1_1core_1_1vector2d.html#adca6dbf0b73bbed483471137b8b13bd8" title="Checks if this vector equals the other one.">core::equals</a>(<a class="code" href="classirr_1_1core_1_1vector2d.html#aa4d36f518d3fc35a7aafcea33a31f76c" title="Y coordinate of vector.">Y</a>, other.<a class="code" href="classirr_1_1core_1_1vector2d.html#aa4d36f518d3fc35a7aafcea33a31f76c" title="Y coordinate of vector.">Y</a>);
|
||
|
<a name="l00107"></a>00107 }
|
||
|
<a name="l00108"></a>00108
|
||
|
<a name="l00109"></a><a class="code" href="classirr_1_1core_1_1vector2d.html#ab689d358d5ffb2ebf547d4597d6dbb9d">00109</a> <a class="code" href="classirr_1_1core_1_1vector2d.html" title="2d vector template class with lots of operators and methods.">vector2d<T></a>& <span class="keyword">set</span>(T nx, T ny) {<a class="code" href="classirr_1_1core_1_1vector2d.html#a8fabb0d10a3dd33b407b63bb3539be4d" title="X coordinate of vector.">X</a>=nx; <a class="code" href="classirr_1_1core_1_1vector2d.html#aa4d36f518d3fc35a7aafcea33a31f76c" title="Y coordinate of vector.">Y</a>=ny; <span class="keywordflow">return</span> *<span class="keyword">this</span>; }
|
||
|
<a name="l00110"></a><a class="code" href="classirr_1_1core_1_1vector2d.html#ada63a008c05eabc08b4974edc409e001">00110</a> <a class="code" href="classirr_1_1core_1_1vector2d.html" title="2d vector template class with lots of operators and methods.">vector2d<T></a>& <span class="keyword">set</span>(<span class="keyword">const</span> <a class="code" href="classirr_1_1core_1_1vector2d.html" title="2d vector template class with lots of operators and methods.">vector2d<T></a>& p) { <a class="code" href="classirr_1_1core_1_1vector2d.html#a8fabb0d10a3dd33b407b63bb3539be4d" title="X coordinate of vector.">X</a>=p.X; <a class="code" href="classirr_1_1core_1_1vector2d.html#aa4d36f518d3fc35a7aafcea33a31f76c" title="Y coordinate of vector.">Y</a>=p.Y; <span class="keywordflow">return</span> *<span class="keyword">this</span>; }
|
||
|
<a name="l00111"></a>00111
|
||
|
<a name="l00113"></a>00113
|
||
|
<a name="l00114"></a><a class="code" href="classirr_1_1core_1_1vector2d.html#ad4c3614d12e2517223349a31632007ed">00114</a> T <a class="code" href="classirr_1_1core_1_1vector2d.html#ad4c3614d12e2517223349a31632007ed" title="Gets the 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_1vector2d.html#a8fabb0d10a3dd33b407b63bb3539be4d" title="X coordinate of vector.">X</a>*<a class="code" href="classirr_1_1core_1_1vector2d.html#a8fabb0d10a3dd33b407b63bb3539be4d" title="X coordinate of vector.">X</a> + <a class="code" href="classirr_1_1core_1_1vector2d.html#aa4d36f518d3fc35a7aafcea33a31f76c" title="Y coordinate of vector.">Y</a>*<a class="code" href="classirr_1_1core_1_1vector2d.html#aa4d36f518d3fc35a7aafcea33a31f76c" title="Y coordinate of vector.">Y</a> ); }
|
||
|
<a name="l00115"></a>00115
|
||
|
<a name="l00117"></a>00117
|
||
|
<a name="l00119"></a><a class="code" href="classirr_1_1core_1_1vector2d.html#a50d7eaeed6caf2b99bf3cf86e084c362">00119</a> T <a class="code" href="classirr_1_1core_1_1vector2d.html#a50d7eaeed6caf2b99bf3cf86e084c362" title="Get the squared length of this vector.">getLengthSQ</a>()<span class="keyword"> const </span>{ <span class="keywordflow">return</span> <a class="code" href="classirr_1_1core_1_1vector2d.html#a8fabb0d10a3dd33b407b63bb3539be4d" title="X coordinate of vector.">X</a>*<a class="code" href="classirr_1_1core_1_1vector2d.html#a8fabb0d10a3dd33b407b63bb3539be4d" title="X coordinate of vector.">X</a> + <a class="code" href="classirr_1_1core_1_1vector2d.html#aa4d36f518d3fc35a7aafcea33a31f76c" title="Y coordinate of vector.">Y</a>*<a class="code" href="classirr_1_1core_1_1vector2d.html#aa4d36f518d3fc35a7aafcea33a31f76c" title="Y coordinate of vector.">Y</a>; }
|
||
|
<a name="l00120"></a>00120
|
||
|
<a name="l00122"></a>00122
|
||
|
<a name="l00124"></a><a class="code" href="classirr_1_1core_1_1vector2d.html#a3899c231259a77c4aae6fec8ed72a6bc">00124</a> T <a class="code" href="classirr_1_1core_1_1vector2d.html#a3899c231259a77c4aae6fec8ed72a6bc" title="Get the dot product of this vector with another.">dotProduct</a>(<span class="keyword">const</span> <a class="code" href="classirr_1_1core_1_1vector2d.html" title="2d vector template class with lots of operators and methods.">vector2d<T></a>& other)<span class="keyword"> const</span>
|
||
|
<a name="l00125"></a>00125 <span class="keyword"> </span>{
|
||
|
<a name="l00126"></a>00126 <span class="keywordflow">return</span> <a class="code" href="classirr_1_1core_1_1vector2d.html#a8fabb0d10a3dd33b407b63bb3539be4d" title="X coordinate of vector.">X</a>*other.<a class="code" href="classirr_1_1core_1_1vector2d.html#a8fabb0d10a3dd33b407b63bb3539be4d" title="X coordinate of vector.">X</a> + <a class="code" href="classirr_1_1core_1_1vector2d.html#aa4d36f518d3fc35a7aafcea33a31f76c" title="Y coordinate of vector.">Y</a>*other.<a class="code" href="classirr_1_1core_1_1vector2d.html#aa4d36f518d3fc35a7aafcea33a31f76c" title="Y coordinate of vector.">Y</a>;
|
||
|
<a name="l00127"></a>00127 }
|
||
|
<a name="l00128"></a>00128
|
||
|
<a name="l00130"></a>00130
|
||
|
<a name="l00133"></a><a class="code" href="classirr_1_1core_1_1vector2d.html#ae8541afbe62fe3b01e18fb04130f6d9e">00133</a> T <a class="code" href="classirr_1_1core_1_1vector2d.html#ae8541afbe62fe3b01e18fb04130f6d9e" title="Gets distance from another point.">getDistanceFrom</a>(<span class="keyword">const</span> <a class="code" href="classirr_1_1core_1_1vector2d.html" title="2d vector template class with lots of operators and methods.">vector2d<T></a>& other)<span class="keyword"> const</span>
|
||
|
<a name="l00134"></a>00134 <span class="keyword"> </span>{
|
||
|
<a name="l00135"></a>00135 <span class="keywordflow">return</span> <a class="code" href="classirr_1_1core_1_1vector2d.html" title="2d vector template class with lots of operators and methods.">vector2d<T></a>(<a class="code" href="classirr_1_1core_1_1vector2d.html#a8fabb0d10a3dd33b407b63bb3539be4d" title="X coordinate of vector.">X</a> - other.<a class="code" href="classirr_1_1core_1_1vector2d.html#a8fabb0d10a3dd33b407b63bb3539be4d" title="X coordinate of vector.">X</a>, <a class="code" href="classirr_1_1core_1_1vector2d.html#aa4d36f518d3fc35a7aafcea33a31f76c" title="Y coordinate of vector.">Y</a> - other.<a class="code" href="classirr_1_1core_1_1vector2d.html#aa4d36f518d3fc35a7aafcea33a31f76c" title="Y coordinate of vector.">Y</a>).<a class="code" href="classirr_1_1core_1_1vector2d.html#ad4c3614d12e2517223349a31632007ed" title="Gets the length of the vector.">getLength</a>();
|
||
|
<a name="l00136"></a>00136 }
|
||
|
<a name="l00137"></a>00137
|
||
|
<a name="l00139"></a>00139
|
||
|
<a name="l00142"></a><a class="code" href="classirr_1_1core_1_1vector2d.html#a77262661ca3dcd6befea9bbc20bae4aa">00142</a> T <a class="code" href="classirr_1_1core_1_1vector2d.html#a77262661ca3dcd6befea9bbc20bae4aa" title="Returns squared distance from another point.">getDistanceFromSQ</a>(<span class="keyword">const</span> <a class="code" href="classirr_1_1core_1_1vector2d.html" title="2d vector template class with lots of operators and methods.">vector2d<T></a>& other)<span class="keyword"> const</span>
|
||
|
<a name="l00143"></a>00143 <span class="keyword"> </span>{
|
||
|
<a name="l00144"></a>00144 <span class="keywordflow">return</span> <a class="code" href="classirr_1_1core_1_1vector2d.html" title="2d vector template class with lots of operators and methods.">vector2d<T></a>(<a class="code" href="classirr_1_1core_1_1vector2d.html#a8fabb0d10a3dd33b407b63bb3539be4d" title="X coordinate of vector.">X</a> - other.<a class="code" href="classirr_1_1core_1_1vector2d.html#a8fabb0d10a3dd33b407b63bb3539be4d" title="X coordinate of vector.">X</a>, <a class="code" href="classirr_1_1core_1_1vector2d.html#aa4d36f518d3fc35a7aafcea33a31f76c" title="Y coordinate of vector.">Y</a> - other.<a class="code" href="classirr_1_1core_1_1vector2d.html#aa4d36f518d3fc35a7aafcea33a31f76c" title="Y coordinate of vector.">Y</a>).<a class="code" href="classirr_1_1core_1_1vector2d.html#a50d7eaeed6caf2b99bf3cf86e084c362" title="Get the squared length of this vector.">getLengthSQ</a>();
|
||
|
<a name="l00145"></a>00145 }
|
||
|
<a name="l00146"></a>00146
|
||
|
<a name="l00148"></a>00148
|
||
|
<a name="l00151"></a><a class="code" href="classirr_1_1core_1_1vector2d.html#ac9c77997f6594d79d5daa5f6bf690ed2">00151</a> <a class="code" href="classirr_1_1core_1_1vector2d.html" title="2d vector template class with lots of operators and methods.">vector2d<T></a>& <a class="code" href="classirr_1_1core_1_1vector2d.html#ac9c77997f6594d79d5daa5f6bf690ed2" title="rotates the point anticlockwise around a center by an amount of degrees.">rotateBy</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_1vector2d.html" title="2d vector template class with lots of operators and methods.">vector2d<T></a>& center=<a class="code" href="classirr_1_1core_1_1vector2d.html" title="2d vector template class with lots of operators and methods.">vector2d<T></a>())
|
||
|
<a name="l00152"></a>00152 {
|
||
|
<a name="l00153"></a>00153 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="l00154"></a>00154 <span class="keyword">const</span> <a class="code" href="namespaceirr.html#a1325b02603ad449f92c68fc640af9b28" title="64 bit floating point variable.">f64</a> cs = cos(degrees);
|
||
|
<a name="l00155"></a>00155 <span class="keyword">const</span> <a class="code" href="namespaceirr.html#a1325b02603ad449f92c68fc640af9b28" title="64 bit floating point variable.">f64</a> sn = sin(degrees);
|
||
|
<a name="l00156"></a>00156
|
||
|
<a name="l00157"></a>00157 <a class="code" href="classirr_1_1core_1_1vector2d.html#a8fabb0d10a3dd33b407b63bb3539be4d" title="X coordinate of vector.">X</a> -= center.X;
|
||
|
<a name="l00158"></a>00158 <a class="code" href="classirr_1_1core_1_1vector2d.html#aa4d36f518d3fc35a7aafcea33a31f76c" title="Y coordinate of vector.">Y</a> -= center.Y;
|
||
|
<a name="l00159"></a>00159
|
||
|
<a name="l00160"></a>00160 <span class="keyword">set</span>((T)(<a class="code" href="classirr_1_1core_1_1vector2d.html#a8fabb0d10a3dd33b407b63bb3539be4d" title="X coordinate of vector.">X</a>*cs - <a class="code" href="classirr_1_1core_1_1vector2d.html#aa4d36f518d3fc35a7aafcea33a31f76c" title="Y coordinate of vector.">Y</a>*sn), (T)(<a class="code" href="classirr_1_1core_1_1vector2d.html#a8fabb0d10a3dd33b407b63bb3539be4d" title="X coordinate of vector.">X</a>*sn + <a class="code" href="classirr_1_1core_1_1vector2d.html#aa4d36f518d3fc35a7aafcea33a31f76c" title="Y coordinate of vector.">Y</a>*cs));
|
||
|
<a name="l00161"></a>00161
|
||
|
<a name="l00162"></a>00162 <a class="code" href="classirr_1_1core_1_1vector2d.html#a8fabb0d10a3dd33b407b63bb3539be4d" title="X coordinate of vector.">X</a> += center.X;
|
||
|
<a name="l00163"></a>00163 <a class="code" href="classirr_1_1core_1_1vector2d.html#aa4d36f518d3fc35a7aafcea33a31f76c" title="Y coordinate of vector.">Y</a> += center.Y;
|
||
|
<a name="l00164"></a>00164 <span class="keywordflow">return</span> *<span class="keyword">this</span>;
|
||
|
<a name="l00165"></a>00165 }
|
||
|
<a name="l00166"></a>00166
|
||
|
<a name="l00168"></a>00168
|
||
|
<a name="l00170"></a><a class="code" href="classirr_1_1core_1_1vector2d.html#a5d5c360ed4c4fd28d4a42272634b8e55">00170</a> <a class="code" href="classirr_1_1core_1_1vector2d.html" title="2d vector template class with lots of operators and methods.">vector2d<T></a>& <a class="code" href="classirr_1_1core_1_1vector2d.html#a5d5c360ed4c4fd28d4a42272634b8e55" title="Normalize the vector.">normalize</a>()
|
||
|
<a name="l00171"></a>00171 {
|
||
|
<a name="l00172"></a>00172 <a class="code" href="namespaceirr.html#a0277be98d67dc26ff93b1a6a1d086b07" title="32 bit floating point variable.">f32</a> length = (<a class="code" href="namespaceirr.html#a0277be98d67dc26ff93b1a6a1d086b07" title="32 bit floating point variable.">f32</a>)(<a class="code" href="classirr_1_1core_1_1vector2d.html#a8fabb0d10a3dd33b407b63bb3539be4d" title="X coordinate of vector.">X</a>*<a class="code" href="classirr_1_1core_1_1vector2d.html#a8fabb0d10a3dd33b407b63bb3539be4d" title="X coordinate of vector.">X</a> + <a class="code" href="classirr_1_1core_1_1vector2d.html#aa4d36f518d3fc35a7aafcea33a31f76c" title="Y coordinate of vector.">Y</a>*<a class="code" href="classirr_1_1core_1_1vector2d.html#aa4d36f518d3fc35a7aafcea33a31f76c" title="Y coordinate of vector.">Y</a>);
|
||
|
<a name="l00173"></a>00173 <span class="keywordflow">if</span> ( length == 0 )
|
||
|
<a name="l00174"></a>00174 <span class="keywordflow">return</span> *<span class="keyword">this</span>;
|
||
|
<a name="l00175"></a>00175 length = <a class="code" href="namespaceirr_1_1core.html#adaef309f12c2a3386e94610e24f2bfa7">core::reciprocal_squareroot</a> ( length );
|
||
|
<a name="l00176"></a>00176 <a class="code" href="classirr_1_1core_1_1vector2d.html#a8fabb0d10a3dd33b407b63bb3539be4d" title="X coordinate of vector.">X</a> = (T)(<a class="code" href="classirr_1_1core_1_1vector2d.html#a8fabb0d10a3dd33b407b63bb3539be4d" title="X coordinate of vector.">X</a> * length);
|
||
|
<a name="l00177"></a>00177 Y = (T)(Y * 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>00182
|
||
|
<a name="l00185"></a><a class="code" href="classirr_1_1core_1_1vector2d.html#af1baa5b3cf7484262fd32cfbe6698655">00185</a> <a class="code" href="namespaceirr.html#a1325b02603ad449f92c68fc640af9b28" title="64 bit floating point variable.">f64</a> <a class="code" href="classirr_1_1core_1_1vector2d.html#af1baa5b3cf7484262fd32cfbe6698655" title="Calculates the angle of this vector in degrees in the trigonometric sense.">getAngleTrig</a>()<span class="keyword"> const</span>
|
||
|
<a name="l00186"></a>00186 <span class="keyword"> </span>{
|
||
|
<a name="l00187"></a>00187 <span class="keywordflow">if</span> (<a class="code" href="classirr_1_1core_1_1vector2d.html#aa4d36f518d3fc35a7aafcea33a31f76c" title="Y coordinate of vector.">Y</a> == 0)
|
||
|
<a name="l00188"></a>00188 <span class="keywordflow">return</span> <a class="code" href="classirr_1_1core_1_1vector2d.html#a8fabb0d10a3dd33b407b63bb3539be4d" title="X coordinate of vector.">X</a> < 0 ? 180 : 0;
|
||
|
<a name="l00189"></a>00189 <span class="keywordflow">else</span>
|
||
|
<a name="l00190"></a>00190 <span class="keywordflow">if</span> (<a class="code" href="classirr_1_1core_1_1vector2d.html#a8fabb0d10a3dd33b407b63bb3539be4d" title="X coordinate of vector.">X</a> == 0)
|
||
|
<a name="l00191"></a>00191 <span class="keywordflow">return</span> <a class="code" href="classirr_1_1core_1_1vector2d.html#aa4d36f518d3fc35a7aafcea33a31f76c" title="Y coordinate of vector.">Y</a> < 0 ? 270 : 90;
|
||
|
<a name="l00192"></a>00192
|
||
|
<a name="l00193"></a>00193 <span class="keywordflow">if</span> ( <a class="code" href="classirr_1_1core_1_1vector2d.html#aa4d36f518d3fc35a7aafcea33a31f76c" title="Y coordinate of vector.">Y</a> > 0)
|
||
|
<a name="l00194"></a>00194 <span class="keywordflow">if</span> (<a class="code" href="classirr_1_1core_1_1vector2d.html#a8fabb0d10a3dd33b407b63bb3539be4d" title="X coordinate of vector.">X</a> > 0)
|
||
|
<a name="l00195"></a>00195 <span class="keywordflow">return</span> atan((<a class="code" href="namespaceirr.html#a1325b02603ad449f92c68fc640af9b28" title="64 bit floating point variable.">irr::f64</a>)<a class="code" href="classirr_1_1core_1_1vector2d.html#aa4d36f518d3fc35a7aafcea33a31f76c" title="Y coordinate of vector.">Y</a>/(<a class="code" href="namespaceirr.html#a1325b02603ad449f92c68fc640af9b28" title="64 bit floating point variable.">irr::f64</a>)<a class="code" href="classirr_1_1core_1_1vector2d.html#a8fabb0d10a3dd33b407b63bb3539be4d" title="X coordinate of 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="l00196"></a>00196 <span class="keywordflow">else</span>
|
||
|
<a name="l00197"></a>00197 <span class="keywordflow">return</span> 180.0-atan((<a class="code" href="namespaceirr.html#a1325b02603ad449f92c68fc640af9b28" title="64 bit floating point variable.">irr::f64</a>)<a class="code" href="classirr_1_1core_1_1vector2d.html#aa4d36f518d3fc35a7aafcea33a31f76c" title="Y coordinate of vector.">Y</a>/-(<a class="code" href="namespaceirr.html#a1325b02603ad449f92c68fc640af9b28" title="64 bit floating point variable.">irr::f64</a>)X) * <a class="code" href="namespaceirr_1_1core.html#ae7afeb48af12f5f5130cd179a644ec58" title="64bit constant for converting from radians to degrees">RADTODEG64</a>;
|
||
|
<a name="l00198"></a>00198 <span class="keywordflow">else</span>
|
||
|
<a name="l00199"></a>00199 <span class="keywordflow">if</span> (X > 0)
|
||
|
<a name="l00200"></a>00200 <span class="keywordflow">return</span> 360.0-atan(-(<a class="code" href="namespaceirr.html#a1325b02603ad449f92c68fc640af9b28" title="64 bit floating point variable.">irr::f64</a>)<a class="code" href="classirr_1_1core_1_1vector2d.html#aa4d36f518d3fc35a7aafcea33a31f76c" title="Y coordinate of vector.">Y</a>/(<a class="code" href="namespaceirr.html#a1325b02603ad449f92c68fc640af9b28" title="64 bit floating point variable.">irr::f64</a>)X) * <a class="code" href="namespaceirr_1_1core.html#ae7afeb48af12f5f5130cd179a644ec58" title="64bit constant for converting from radians to degrees">RADTODEG64</a>;
|
||
|
<a name="l00201"></a>00201 <span class="keywordflow">else</span>
|
||
|
<a name="l00202"></a>00202 <span class="keywordflow">return</span> 180.0+atan(-(<a class="code" href="namespaceirr.html#a1325b02603ad449f92c68fc640af9b28" title="64 bit floating point variable.">irr::f64</a>)<a class="code" href="classirr_1_1core_1_1vector2d.html#aa4d36f518d3fc35a7aafcea33a31f76c" title="Y coordinate of vector.">Y</a>/-(<a class="code" href="namespaceirr.html#a1325b02603ad449f92c68fc640af9b28" title="64 bit floating point variable.">irr::f64</a>)X) * <a class="code" href="namespaceirr_1_1core.html#ae7afeb48af12f5f5130cd179a644ec58" title="64bit constant for converting from radians to degrees">RADTODEG64</a>;
|
||
|
<a name="l00203"></a>00203 }
|
||
|
<a name="l00204"></a>00204
|
||
|
<a name="l00206"></a>00206
|
||
|
<a name="l00208"></a><a class="code" href="classirr_1_1core_1_1vector2d.html#ab75f18492cd0dac6dd0936e1ac65dc86">00208</a> <span class="keyword">inline</span> <a class="code" href="namespaceirr.html#a1325b02603ad449f92c68fc640af9b28" title="64 bit floating point variable.">f64</a> <a class="code" href="classirr_1_1core_1_1vector2d.html#ab75f18492cd0dac6dd0936e1ac65dc86" title="Calculates the angle of this vector in degrees in the counter trigonometric sense.">getAngle</a>()<span class="keyword"> const</span>
|
||
|
<a name="l00209"></a>00209 <span class="keyword"> </span>{
|
||
|
<a name="l00210"></a>00210 <span class="keywordflow">if</span> (<a class="code" href="classirr_1_1core_1_1vector2d.html#aa4d36f518d3fc35a7aafcea33a31f76c" title="Y coordinate of vector.">Y</a> == 0) <span class="comment">// corrected thanks to a suggestion by Jox</span>
|
||
|
<a name="l00211"></a>00211 <span class="keywordflow">return</span> <a class="code" href="classirr_1_1core_1_1vector2d.html#a8fabb0d10a3dd33b407b63bb3539be4d" title="X coordinate of vector.">X</a> < 0 ? 180 : 0;
|
||
|
<a name="l00212"></a>00212 <span class="keywordflow">else</span> <span class="keywordflow">if</span> (<a class="code" href="classirr_1_1core_1_1vector2d.html#a8fabb0d10a3dd33b407b63bb3539be4d" title="X coordinate of vector.">X</a> == 0)
|
||
|
<a name="l00213"></a>00213 <span class="keywordflow">return</span> <a class="code" href="classirr_1_1core_1_1vector2d.html#aa4d36f518d3fc35a7aafcea33a31f76c" title="Y coordinate of vector.">Y</a> < 0 ? 90 : 270;
|
||
|
<a name="l00214"></a>00214
|
||
|
<a name="l00215"></a>00215 <span class="comment">// don't use getLength here to avoid precision loss with s32 vectors</span>
|
||
|
<a name="l00216"></a>00216 <span class="comment">// avoid floating-point trouble as sqrt(y*y) is occasionally larger than y, so clamp</span>
|
||
|
<a name="l00217"></a>00217 <span class="keyword">const</span> <a class="code" href="namespaceirr.html#a1325b02603ad449f92c68fc640af9b28" title="64 bit floating point variable.">f64</a> tmp = <a class="code" href="namespaceirr_1_1core.html#a6162f685b68f629e77336081d3316969" title="clamps a value between low and high">core::clamp</a>(<a class="code" href="classirr_1_1core_1_1vector2d.html#aa4d36f518d3fc35a7aafcea33a31f76c" title="Y coordinate of vector.">Y</a> / sqrt((<a class="code" href="namespaceirr.html#a1325b02603ad449f92c68fc640af9b28" title="64 bit floating point variable.">f64</a>)(<a class="code" href="classirr_1_1core_1_1vector2d.html#a8fabb0d10a3dd33b407b63bb3539be4d" title="X coordinate of vector.">X</a>*<a class="code" href="classirr_1_1core_1_1vector2d.html#a8fabb0d10a3dd33b407b63bb3539be4d" title="X coordinate of vector.">X</a> + <a class="code" href="classirr_1_1core_1_1vector2d.html#aa4d36f518d3fc35a7aafcea33a31f76c" title="Y coordinate of vector.">Y</a>*<a class="code" href="classirr_1_1core_1_1vector2d.html#aa4d36f518d3fc35a7aafcea33a31f76c" title="Y coordinate of vector.">Y</a>)), -1.0, 1.0);
|
||
|
<a name="l00218"></a>00218 <span class="keyword">const</span> <a class="code" href="namespaceirr.html#a1325b02603ad449f92c68fc640af9b28" title="64 bit floating point variable.">f64</a> angle = atan( <a class="code" href="namespaceirr_1_1core.html#af2f378cc34a19f5da6fe1d4961646d1d">core::squareroot</a>(1 - tmp*tmp) / tmp) * <a class="code" href="namespaceirr_1_1core.html#ae7afeb48af12f5f5130cd179a644ec58" title="64bit constant for converting from radians to degrees">RADTODEG64</a>;
|
||
|
<a name="l00219"></a>00219
|
||
|
<a name="l00220"></a>00220 <span class="keywordflow">if</span> (<a class="code" href="classirr_1_1core_1_1vector2d.html#a8fabb0d10a3dd33b407b63bb3539be4d" title="X coordinate of vector.">X</a>>0 && Y>0)
|
||
|
<a name="l00221"></a>00221 <span class="keywordflow">return</span> angle + 270;
|
||
|
<a name="l00222"></a>00222 <span class="keywordflow">else</span>
|
||
|
<a name="l00223"></a>00223 <span class="keywordflow">if</span> (<a class="code" href="classirr_1_1core_1_1vector2d.html#a8fabb0d10a3dd33b407b63bb3539be4d" title="X coordinate of vector.">X</a>>0 && Y<0)
|
||
|
<a name="l00224"></a>00224 <span class="keywordflow">return</span> angle + 90;
|
||
|
<a name="l00225"></a>00225 <span class="keywordflow">else</span>
|
||
|
<a name="l00226"></a>00226 <span class="keywordflow">if</span> (<a class="code" href="classirr_1_1core_1_1vector2d.html#a8fabb0d10a3dd33b407b63bb3539be4d" title="X coordinate of vector.">X</a><0 && Y<0)
|
||
|
<a name="l00227"></a>00227 <span class="keywordflow">return</span> 90 - angle;
|
||
|
<a name="l00228"></a>00228 <span class="keywordflow">else</span>
|
||
|
<a name="l00229"></a>00229 <span class="keywordflow">if</span> (X<0 && Y>0)
|
||
|
<a name="l00230"></a>00230 <span class="keywordflow">return</span> 270 - angle;
|
||
|
<a name="l00231"></a>00231
|
||
|
<a name="l00232"></a>00232 <span class="keywordflow">return</span> angle;
|
||
|
<a name="l00233"></a>00233 }
|
||
|
<a name="l00234"></a>00234
|
||
|
<a name="l00236"></a>00236
|
||
|
<a name="l00238"></a><a class="code" href="classirr_1_1core_1_1vector2d.html#a581ab3975900d5af8d4c7517738beba2">00238</a> <span class="keyword">inline</span> <a class="code" href="namespaceirr.html#a1325b02603ad449f92c68fc640af9b28" title="64 bit floating point variable.">f64</a> <a class="code" href="classirr_1_1core_1_1vector2d.html#a581ab3975900d5af8d4c7517738beba2" title="Calculates the angle between this vector and another one in degree.">getAngleWith</a>(<span class="keyword">const</span> <a class="code" href="classirr_1_1core_1_1vector2d.html" title="2d vector template class with lots of operators and methods.">vector2d<T></a>& b)<span class="keyword"> const</span>
|
||
|
<a name="l00239"></a>00239 <span class="keyword"> </span>{
|
||
|
<a name="l00240"></a>00240 <a class="code" href="namespaceirr.html#a1325b02603ad449f92c68fc640af9b28" title="64 bit floating point variable.">f64</a> tmp = (<a class="code" href="namespaceirr.html#a1325b02603ad449f92c68fc640af9b28" title="64 bit floating point variable.">f64</a>)(<a class="code" href="classirr_1_1core_1_1vector2d.html#a8fabb0d10a3dd33b407b63bb3539be4d" title="X coordinate of vector.">X</a>*b.<a class="code" href="classirr_1_1core_1_1vector2d.html#a8fabb0d10a3dd33b407b63bb3539be4d" title="X coordinate of vector.">X</a> + <a class="code" href="classirr_1_1core_1_1vector2d.html#aa4d36f518d3fc35a7aafcea33a31f76c" title="Y coordinate of vector.">Y</a>*b.<a class="code" href="classirr_1_1core_1_1vector2d.html#aa4d36f518d3fc35a7aafcea33a31f76c" title="Y coordinate of vector.">Y</a>);
|
||
|
<a name="l00241"></a>00241
|
||
|
<a name="l00242"></a>00242 <span class="keywordflow">if</span> (tmp == 0.0)
|
||
|
<a name="l00243"></a>00243 <span class="keywordflow">return</span> 90.0;
|
||
|
<a name="l00244"></a>00244
|
||
|
<a name="l00245"></a>00245 tmp = tmp / <a class="code" href="namespaceirr_1_1core.html#af2f378cc34a19f5da6fe1d4961646d1d">core::squareroot</a>((<a class="code" href="namespaceirr.html#a1325b02603ad449f92c68fc640af9b28" title="64 bit floating point variable.">f64</a>)((<a class="code" href="classirr_1_1core_1_1vector2d.html#a8fabb0d10a3dd33b407b63bb3539be4d" title="X coordinate of vector.">X</a>*<a class="code" href="classirr_1_1core_1_1vector2d.html#a8fabb0d10a3dd33b407b63bb3539be4d" title="X coordinate of vector.">X</a> + <a class="code" href="classirr_1_1core_1_1vector2d.html#aa4d36f518d3fc35a7aafcea33a31f76c" title="Y coordinate of vector.">Y</a>*<a class="code" href="classirr_1_1core_1_1vector2d.html#aa4d36f518d3fc35a7aafcea33a31f76c" title="Y coordinate of vector.">Y</a>) * (b.<a class="code" href="classirr_1_1core_1_1vector2d.html#a8fabb0d10a3dd33b407b63bb3539be4d" title="X coordinate of vector.">X</a>*b.<a class="code" href="classirr_1_1core_1_1vector2d.html#a8fabb0d10a3dd33b407b63bb3539be4d" title="X coordinate of vector.">X</a> + b.<a class="code" href="classirr_1_1core_1_1vector2d.html#aa4d36f518d3fc35a7aafcea33a31f76c" title="Y coordinate of vector.">Y</a>*b.<a class="code" href="classirr_1_1core_1_1vector2d.html#aa4d36f518d3fc35a7aafcea33a31f76c" title="Y coordinate of vector.">Y</a>)));
|
||
|
<a name="l00246"></a>00246 <span class="keywordflow">if</span> (tmp < 0.0)
|
||
|
<a name="l00247"></a>00247 tmp = -tmp;
|
||
|
<a name="l00248"></a>00248 <span class="keywordflow">if</span> ( tmp > 1.0 ) <span class="comment">// avoid floating-point trouble</span>
|
||
|
<a name="l00249"></a>00249 tmp = 1.0;
|
||
|
<a name="l00250"></a>00250
|
||
|
<a name="l00251"></a>00251 <span class="keywordflow">return</span> atan(sqrt(1 - tmp*tmp) / tmp) * <a class="code" href="namespaceirr_1_1core.html#ae7afeb48af12f5f5130cd179a644ec58" title="64bit constant for converting from radians to degrees">RADTODEG64</a>;
|
||
|
<a name="l00252"></a>00252 }
|
||
|
<a name="l00253"></a>00253
|
||
|
<a name="l00255"></a>00255
|
||
|
<a name="l00259"></a><a class="code" href="classirr_1_1core_1_1vector2d.html#adc8bba9dfd48218d083dcbe88bf98da0">00259</a> <span class="keywordtype">bool</span> <a class="code" href="classirr_1_1core_1_1vector2d.html#adc8bba9dfd48218d083dcbe88bf98da0" 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_1vector2d.html" title="2d vector template class with lots of operators and methods.">vector2d<T></a>& begin, <span class="keyword">const</span> <a class="code" href="classirr_1_1core_1_1vector2d.html" title="2d vector template class with lots of operators and methods.">vector2d<T></a>& end)<span class="keyword"> const</span>
|
||
|
<a name="l00260"></a>00260 <span class="keyword"> </span>{
|
||
|
<a name="l00261"></a>00261 <span class="keywordflow">if</span> (begin.<a class="code" href="classirr_1_1core_1_1vector2d.html#a8fabb0d10a3dd33b407b63bb3539be4d" title="X coordinate of vector.">X</a> != end.<a class="code" href="classirr_1_1core_1_1vector2d.html#a8fabb0d10a3dd33b407b63bb3539be4d" title="X coordinate of vector.">X</a>)
|
||
|
<a name="l00262"></a>00262 {
|
||
|
<a name="l00263"></a>00263 <span class="keywordflow">return</span> ((begin.<a class="code" href="classirr_1_1core_1_1vector2d.html#a8fabb0d10a3dd33b407b63bb3539be4d" title="X coordinate of vector.">X</a> <= <a class="code" href="classirr_1_1core_1_1vector2d.html#a8fabb0d10a3dd33b407b63bb3539be4d" title="X coordinate of vector.">X</a> && <a class="code" href="classirr_1_1core_1_1vector2d.html#a8fabb0d10a3dd33b407b63bb3539be4d" title="X coordinate of vector.">X</a> <= end.<a class="code" href="classirr_1_1core_1_1vector2d.html#a8fabb0d10a3dd33b407b63bb3539be4d" title="X coordinate of vector.">X</a>) ||
|
||
|
<a name="l00264"></a>00264 (begin.<a class="code" href="classirr_1_1core_1_1vector2d.html#a8fabb0d10a3dd33b407b63bb3539be4d" title="X coordinate of vector.">X</a> >= <a class="code" href="classirr_1_1core_1_1vector2d.html#a8fabb0d10a3dd33b407b63bb3539be4d" title="X coordinate of vector.">X</a> && <a class="code" href="classirr_1_1core_1_1vector2d.html#a8fabb0d10a3dd33b407b63bb3539be4d" title="X coordinate of vector.">X</a> >= end.<a class="code" href="classirr_1_1core_1_1vector2d.html#a8fabb0d10a3dd33b407b63bb3539be4d" title="X coordinate of vector.">X</a>));
|
||
|
<a name="l00265"></a>00265 }
|
||
|
<a name="l00266"></a>00266 <span class="keywordflow">else</span>
|
||
|
<a name="l00267"></a>00267 {
|
||
|
<a name="l00268"></a>00268 <span class="keywordflow">return</span> ((begin.<a class="code" href="classirr_1_1core_1_1vector2d.html#aa4d36f518d3fc35a7aafcea33a31f76c" title="Y coordinate of vector.">Y</a> <= <a class="code" href="classirr_1_1core_1_1vector2d.html#aa4d36f518d3fc35a7aafcea33a31f76c" title="Y coordinate of vector.">Y</a> && <a class="code" href="classirr_1_1core_1_1vector2d.html#aa4d36f518d3fc35a7aafcea33a31f76c" title="Y coordinate of vector.">Y</a> <= end.<a class="code" href="classirr_1_1core_1_1vector2d.html#aa4d36f518d3fc35a7aafcea33a31f76c" title="Y coordinate of vector.">Y</a>) ||
|
||
|
<a name="l00269"></a>00269 (begin.<a class="code" href="classirr_1_1core_1_1vector2d.html#aa4d36f518d3fc35a7aafcea33a31f76c" title="Y coordinate of vector.">Y</a> >= <a class="code" href="classirr_1_1core_1_1vector2d.html#aa4d36f518d3fc35a7aafcea33a31f76c" title="Y coordinate of vector.">Y</a> && <a class="code" href="classirr_1_1core_1_1vector2d.html#aa4d36f518d3fc35a7aafcea33a31f76c" title="Y coordinate of vector.">Y</a> >= end.<a class="code" href="classirr_1_1core_1_1vector2d.html#aa4d36f518d3fc35a7aafcea33a31f76c" title="Y coordinate of vector.">Y</a>));
|
||
|
<a name="l00270"></a>00270 }
|
||
|
<a name="l00271"></a>00271 }
|
||
|
<a name="l00272"></a>00272
|
||
|
<a name="l00274"></a>00274
|
||
|
<a name="l00278"></a><a class="code" href="classirr_1_1core_1_1vector2d.html#a865bbbdb5d5a7408cdf733d573c8d747">00278</a> <a class="code" href="classirr_1_1core_1_1vector2d.html" title="2d vector template class with lots of operators and methods.">vector2d<T></a> <a class="code" href="classirr_1_1core_1_1vector2d.html#a865bbbdb5d5a7408cdf733d573c8d747" 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_1vector2d.html" title="2d vector template class with lots of operators and methods.">vector2d<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="l00279"></a>00279 <span class="keyword"> </span>{
|
||
|
<a name="l00280"></a>00280 <a class="code" href="namespaceirr.html#a1325b02603ad449f92c68fc640af9b28" title="64 bit floating point variable.">f64</a> inv = 1.0f - d;
|
||
|
<a name="l00281"></a>00281 <span class="keywordflow">return</span> <a class="code" href="classirr_1_1core_1_1vector2d.html" title="2d vector template class with lots of operators and methods.">vector2d<T></a>((T)(other.<a class="code" href="classirr_1_1core_1_1vector2d.html#a8fabb0d10a3dd33b407b63bb3539be4d" title="X coordinate of vector.">X</a>*inv + <a class="code" href="classirr_1_1core_1_1vector2d.html#a8fabb0d10a3dd33b407b63bb3539be4d" title="X coordinate of vector.">X</a>*d), (T)(other.<a class="code" href="classirr_1_1core_1_1vector2d.html#aa4d36f518d3fc35a7aafcea33a31f76c" title="Y coordinate of vector.">Y</a>*inv + <a class="code" href="classirr_1_1core_1_1vector2d.html#aa4d36f518d3fc35a7aafcea33a31f76c" title="Y coordinate of vector.">Y</a>*d));
|
||
|
<a name="l00282"></a>00282 }
|
||
|
<a name="l00283"></a>00283
|
||
|
<a name="l00285"></a>00285
|
||
|
<a name="l00290"></a><a class="code" href="classirr_1_1core_1_1vector2d.html#a4d1636973532da5ee0c3c42f96f19ef9">00290</a> <a class="code" href="classirr_1_1core_1_1vector2d.html" title="2d vector template class with lots of operators and methods.">vector2d<T></a> <a class="code" href="classirr_1_1core_1_1vector2d.html#a4d1636973532da5ee0c3c42f96f19ef9" 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_1vector2d.html" title="2d vector template class with lots of operators and methods.">vector2d<T></a>& v2, <span class="keyword">const</span> <a class="code" href="classirr_1_1core_1_1vector2d.html" title="2d vector template class with lots of operators and methods.">vector2d<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="l00291"></a>00291 <span class="keyword"> </span>{
|
||
|
<a name="l00292"></a>00292 <span class="comment">// this*(1-d)*(1-d) + 2 * v2 * (1-d) + v3 * d * d;</span>
|
||
|
<a name="l00293"></a>00293 <span class="keyword">const</span> <a class="code" href="namespaceirr.html#a1325b02603ad449f92c68fc640af9b28" title="64 bit floating point variable.">f64</a> inv = 1.0f - d;
|
||
|
<a name="l00294"></a>00294 <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="l00295"></a>00295 <span class="keyword">const</span> <a class="code" href="namespaceirr.html#a1325b02603ad449f92c68fc640af9b28" title="64 bit floating point variable.">f64</a> mul1 = 2.0f * d * inv;
|
||
|
<a name="l00296"></a>00296 <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="l00297"></a>00297
|
||
|
<a name="l00298"></a>00298 <span class="keywordflow">return</span> <a class="code" href="classirr_1_1core_1_1vector2d.html" title="2d vector template class with lots of operators and methods.">vector2d<T></a> ( (T)(<a class="code" href="classirr_1_1core_1_1vector2d.html#a8fabb0d10a3dd33b407b63bb3539be4d" title="X coordinate of vector.">X</a> * mul0 + v2.<a class="code" href="classirr_1_1core_1_1vector2d.html#a8fabb0d10a3dd33b407b63bb3539be4d" title="X coordinate of vector.">X</a> * mul1 + v3.<a class="code" href="classirr_1_1core_1_1vector2d.html#a8fabb0d10a3dd33b407b63bb3539be4d" title="X coordinate of vector.">X</a> * mul2),
|
||
|
<a name="l00299"></a>00299 (T)(<a class="code" href="classirr_1_1core_1_1vector2d.html#aa4d36f518d3fc35a7aafcea33a31f76c" title="Y coordinate of vector.">Y</a> * mul0 + v2.<a class="code" href="classirr_1_1core_1_1vector2d.html#aa4d36f518d3fc35a7aafcea33a31f76c" title="Y coordinate of vector.">Y</a> * mul1 + v3.<a class="code" href="classirr_1_1core_1_1vector2d.html#aa4d36f518d3fc35a7aafcea33a31f76c" title="Y coordinate of vector.">Y</a> * mul2));
|
||
|
<a name="l00300"></a>00300 }
|
||
|
<a name="l00301"></a>00301
|
||
|
<a name="l00303"></a>00303
|
||
|
<a name="l00308"></a><a class="code" href="classirr_1_1core_1_1vector2d.html#a85bc48f5c313764fd56b51c730a62210">00308</a> <a class="code" href="classirr_1_1core_1_1vector2d.html" title="2d vector template class with lots of operators and methods.">vector2d<T></a>& <a class="code" href="classirr_1_1core_1_1vector2d.html#a85bc48f5c313764fd56b51c730a62210" 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_1vector2d.html" title="2d vector template class with lots of operators and methods.">vector2d<T></a>& a, <span class="keyword">const</span> <a class="code" href="classirr_1_1core_1_1vector2d.html" title="2d vector template class with lots of operators and methods.">vector2d<T></a>& b, <a class="code" href="namespaceirr.html#a1325b02603ad449f92c68fc640af9b28" title="64 bit floating point variable.">f64</a> d)
|
||
|
<a name="l00309"></a>00309 {
|
||
|
<a name="l00310"></a>00310 <a class="code" href="classirr_1_1core_1_1vector2d.html#a8fabb0d10a3dd33b407b63bb3539be4d" title="X coordinate of 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_1vector2d.html#a8fabb0d10a3dd33b407b63bb3539be4d" title="X coordinate of vector.">X</a> + ( ( a.<a class="code" href="classirr_1_1core_1_1vector2d.html#a8fabb0d10a3dd33b407b63bb3539be4d" title="X coordinate of vector.">X</a> - b.<a class="code" href="classirr_1_1core_1_1vector2d.html#a8fabb0d10a3dd33b407b63bb3539be4d" title="X coordinate of vector.">X</a> ) * d ));
|
||
|
<a name="l00311"></a>00311 <a class="code" href="classirr_1_1core_1_1vector2d.html#aa4d36f518d3fc35a7aafcea33a31f76c" title="Y coordinate of 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_1vector2d.html#aa4d36f518d3fc35a7aafcea33a31f76c" title="Y coordinate of vector.">Y</a> + ( ( a.<a class="code" href="classirr_1_1core_1_1vector2d.html#aa4d36f518d3fc35a7aafcea33a31f76c" title="Y coordinate of vector.">Y</a> - b.<a class="code" href="classirr_1_1core_1_1vector2d.html#aa4d36f518d3fc35a7aafcea33a31f76c" title="Y coordinate of vector.">Y</a> ) * d ));
|
||
|
<a name="l00312"></a>00312 <span class="keywordflow">return</span> *<span class="keyword">this</span>;
|
||
|
<a name="l00313"></a>00313 }
|
||
|
<a name="l00314"></a>00314
|
||
|
<a name="l00316"></a><a class="code" href="classirr_1_1core_1_1vector2d.html#a8fabb0d10a3dd33b407b63bb3539be4d">00316</a> T <a class="code" href="classirr_1_1core_1_1vector2d.html#a8fabb0d10a3dd33b407b63bb3539be4d" title="X coordinate of vector.">X</a>;
|
||
|
<a name="l00317"></a>00317
|
||
|
<a name="l00319"></a><a class="code" href="classirr_1_1core_1_1vector2d.html#aa4d36f518d3fc35a7aafcea33a31f76c">00319</a> T <a class="code" href="classirr_1_1core_1_1vector2d.html#aa4d36f518d3fc35a7aafcea33a31f76c" title="Y coordinate of vector.">Y</a>;
|
||
|
<a name="l00320"></a>00320 };
|
||
|
<a name="l00321"></a>00321
|
||
|
<a name="l00323"></a><a class="code" href="namespaceirr_1_1core.html#a2cf08556d77f6f5a792973a6e27ed11b">00323</a> <span class="keyword">typedef</span> <a class="code" href="classirr_1_1core_1_1vector2d.html">vector2d<f32></a> <a class="code" href="namespaceirr_1_1core.html#a2cf08556d77f6f5a792973a6e27ed11b" title="Typedef for f32 2d vector.">vector2df</a>;
|
||
|
<a name="l00324"></a>00324
|
||
|
<a name="l00326"></a><a class="code" href="namespaceirr_1_1core.html#a990c071a8518ad2b142744b300d0d63c">00326</a> <span class="keyword">typedef</span> <a class="code" href="classirr_1_1core_1_1vector2d.html" title="2d vector template class with lots of operators and methods.">vector2d<s32></a> <a class="code" href="namespaceirr_1_1core.html#a990c071a8518ad2b142744b300d0d63c" title="Typedef for integer 2d vector.">vector2di</a>;
|
||
|
<a name="l00327"></a>00327
|
||
|
<a name="l00328"></a>00328 <span class="keyword">template</span><<span class="keyword">class</span> S, <span class="keyword">class</span> T>
|
||
|
<a name="l00329"></a><a class="code" href="namespaceirr_1_1core.html#a2bf9362df9cfbfb4c02a8f5514858cff">00329</a> <a class="code" href="classirr_1_1core_1_1vector2d.html" title="2d vector template class with lots of operators and methods.">vector2d<T></a> <a class="code" href="namespaceirr_1_1core.html#abb387ec6f0f654c7ee704345bdded96c">operator*</a>(<span class="keyword">const</span> S scalar, <span class="keyword">const</span> <a class="code" href="classirr_1_1core_1_1vector2d.html" title="2d vector template class with lots of operators and methods.">vector2d<T></a>& vector) { <span class="keywordflow">return</span> vector*scalar; }
|
||
|
<a name="l00330"></a>00330
|
||
|
<a name="l00331"></a>00331 <span class="comment">// These methods are declared in dimension2d, but need definitions of vector2d</span>
|
||
|
<a name="l00332"></a>00332 <span class="keyword">template</span><<span class="keyword">class</span> T>
|
||
|
<a name="l00333"></a><a class="code" href="classirr_1_1core_1_1dimension2d.html#a96f90d1d96392bf736a01f8def8aa7db">00333</a> <a class="code" href="classirr_1_1core_1_1dimension2d.html#ae0c2a30ce6283602c454901ef0bd6a04" title="Default constructor for empty dimension.">dimension2d<T>::dimension2d</a>(<span class="keyword">const</span> <a class="code" href="classirr_1_1core_1_1vector2d.html" title="2d vector template class with lots of operators and methods.">vector2d<T></a>& other) : Width(other.X), Height(other.Y) { }
|
||
|
<a name="l00334"></a>00334
|
||
|
<a name="l00335"></a>00335 <span class="keyword">template</span><<span class="keyword">class</span> T>
|
||
|
<a name="l00336"></a><a class="code" href="classirr_1_1core_1_1dimension2d.html#a34c99e1d9d11c1e20dde2ab6a3a0bfb9">00336</a> <span class="keywordtype">bool</span> <a class="code" href="classirr_1_1core_1_1dimension2d.html#aa8e64f2adf3d069324e6159cfb6aa82d" title="Equality operator.">dimension2d<T>::operator==</a>(<span class="keyword">const</span> <a class="code" href="classirr_1_1core_1_1vector2d.html" title="2d vector template class with lots of operators and methods.">vector2d<T></a>& other)<span class="keyword"> const </span>{ <span class="keywordflow">return</span> Width == other.<a class="code" href="classirr_1_1core_1_1vector2d.html#a8fabb0d10a3dd33b407b63bb3539be4d" title="X coordinate of vector.">X</a> && Height == other.<a class="code" href="classirr_1_1core_1_1vector2d.html#aa4d36f518d3fc35a7aafcea33a31f76c" title="Y coordinate of vector.">Y</a>; }
|
||
|
<a name="l00337"></a>00337
|
||
|
<a name="l00338"></a>00338 } <span class="comment">// end namespace core</span>
|
||
|
<a name="l00339"></a>00339 } <span class="comment">// end namespace irr</span>
|
||
|
<a name="l00340"></a>00340
|
||
|
<a name="l00341"></a>00341 <span class="preprocessor">#endif</span>
|
||
|
<a name="l00342"></a>00342 <span class="preprocessor"></span>
|
||
|
</pre></div></div>
|
||
|
</div>
|
||
|
<div id="nav-path" class="navpath">
|
||
|
<ul>
|
||
|
<li class="navelem"><a class="el" href="vector2d_8h.html">vector2d.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 Sat Jul 9 2016 18:18:21 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>
|