mirror of
https://github.com/Minestom/Minestom.git
synced 2024-11-07 19:31:37 +01:00
755 lines
34 KiB
HTML
755 lines
34 KiB
HTML
|
<!DOCTYPE HTML>
|
||
|
<!-- NewPage -->
|
||
|
<html lang="en">
|
||
|
<head>
|
||
|
<!-- Generated by javadoc -->
|
||
|
<title>Vector (Minestom 1.0 API)</title>
|
||
|
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
|
||
|
<meta name="description" content="declaration: package: net.minestom.server.utils, class: Vector">
|
||
|
<meta name="generator" content="javadoc/ClassWriterImpl">
|
||
|
<link rel="stylesheet" type="text/css" href="../../../../stylesheet.css" title="Style">
|
||
|
<link rel="stylesheet" type="text/css" href="../../../../script-dir/jquery-ui.css" title="Style">
|
||
|
<script type="text/javascript" src="../../../../script.js"></script>
|
||
|
<script type="text/javascript" src="../../../../script-dir/jszip/dist/jszip.min.js"></script>
|
||
|
<script type="text/javascript" src="../../../../script-dir/jszip-utils/dist/jszip-utils.min.js"></script>
|
||
|
<!--[if IE]>
|
||
|
<script type="text/javascript" src="../../../../script-dir/jszip-utils/dist/jszip-utils-ie.min.js"></script>
|
||
|
<![endif]-->
|
||
|
<script type="text/javascript" src="../../../../script-dir/jquery-3.4.1.js"></script>
|
||
|
<script type="text/javascript" src="../../../../script-dir/jquery-ui.js"></script>
|
||
|
</head>
|
||
|
<body class="class-declaration">
|
||
|
<script type="text/javascript">var data = {"i0":10,"i1":10,"i2":10,"i3":10,"i4":10,"i5":10,"i6":10,"i7":10,"i8":10,"i9":10,"i10":10,"i11":10,"i12":10,"i13":10,"i14":10,"i15":10,"i16":10,"i17":10,"i18":10,"i19":10,"i20":10,"i21":10,"i22":10,"i23":10,"i24":10,"i25":10};
|
||
|
var tabs = {65535:["t0","All Methods"],2:["t2","Instance Methods"],8:["t4","Concrete Methods"]};
|
||
|
var altColor = "altColor";
|
||
|
var rowColor = "rowColor";
|
||
|
var tableTab = "tableTab";
|
||
|
var activeTableTab = "activeTableTab";
|
||
|
var pathtoroot = "../../../../";
|
||
|
loadScripts(document, 'script');</script>
|
||
|
<noscript>
|
||
|
<div>JavaScript is disabled on your browser.</div>
|
||
|
</noscript>
|
||
|
<div class="flexBox">
|
||
|
<header role="banner" class="flexHeader">
|
||
|
<nav role="navigation">
|
||
|
<!-- ========= START OF TOP NAVBAR ======= -->
|
||
|
<div class="topNav"><a id="navbar.top">
|
||
|
<!-- -->
|
||
|
</a>
|
||
|
<div class="skipNav"><a href="#skip.navbar.top" title="Skip navigation links">Skip navigation links</a></div>
|
||
|
<a id="navbar.top.firstrow">
|
||
|
<!-- -->
|
||
|
</a>
|
||
|
<ul class="navList" title="Navigation">
|
||
|
<li><a href="../../../../index.html">Overview</a></li>
|
||
|
<li><a href="package-summary.html">Package</a></li>
|
||
|
<li class="navBarCell1Rev">Class</li>
|
||
|
<li><a href="package-tree.html">Tree</a></li>
|
||
|
<li><a href="../../../../deprecated-list.html">Deprecated</a></li>
|
||
|
<li><a href="../../../../index-all.html">Index</a></li>
|
||
|
<li><a href="../../../../help-doc.html">Help</a></li>
|
||
|
</ul>
|
||
|
</div>
|
||
|
<div class="subNav">
|
||
|
<div>
|
||
|
<ul class="subNavList">
|
||
|
<li>Summary: </li>
|
||
|
<li>Nested | </li>
|
||
|
<li><a href="#field.summary">Field</a> | </li>
|
||
|
<li><a href="#constructor.summary">Constr</a> | </li>
|
||
|
<li><a href="#method.summary">Method</a></li>
|
||
|
</ul>
|
||
|
<ul class="subNavList">
|
||
|
<li>Detail: </li>
|
||
|
<li><a href="#field.detail">Field</a> | </li>
|
||
|
<li><a href="#constructor.detail">Constr</a> | </li>
|
||
|
<li><a href="#method.detail">Method</a></li>
|
||
|
</ul>
|
||
|
</div>
|
||
|
<div class="navListSearch"><label for="search">SEARCH:</label>
|
||
|
<input type="text" id="search" value="search" disabled="disabled">
|
||
|
<input type="reset" id="reset" value="reset" disabled="disabled">
|
||
|
</div>
|
||
|
</div>
|
||
|
<!-- ========= END OF TOP NAVBAR ========= -->
|
||
|
<div class="skipNav"><a id="skip.navbar.top">
|
||
|
<!-- -->
|
||
|
</a></div>
|
||
|
</nav>
|
||
|
</header>
|
||
|
<div class="flexContent">
|
||
|
<main role="main">
|
||
|
<!-- ======== START OF CLASS DATA ======== -->
|
||
|
<div class="header">
|
||
|
<div class="subTitle"><span class="packageLabelInType">Package</span> <a href="package-summary.html">net.minestom.server.utils</a></div>
|
||
|
<h1 title="Class Vector" class="title">Class Vector</h1>
|
||
|
</div>
|
||
|
<div class="contentContainer">
|
||
|
<div class="inheritance" title="Inheritance Tree">java.lang.Object
|
||
|
<div class="inheritance">net.minestom.server.utils.Vector</div>
|
||
|
</div>
|
||
|
<section class="description">
|
||
|
<hr>
|
||
|
<pre>public class <span class="typeNameLabel">Vector</span>
|
||
|
extends java.lang.Object</pre>
|
||
|
</section>
|
||
|
<section class="summary">
|
||
|
<ul class="blockList">
|
||
|
<!-- =========== FIELD SUMMARY =========== -->
|
||
|
<li class="blockList">
|
||
|
<section class="fieldSummary"><a id="field.summary">
|
||
|
<!-- -->
|
||
|
</a>
|
||
|
<h2>Field Summary</h2>
|
||
|
<div class="memberSummary">
|
||
|
<table>
|
||
|
<caption><span>Fields</span><span class="tabEnd"> </span></caption>
|
||
|
<thead>
|
||
|
<tr>
|
||
|
<th class="colFirst" scope="col">Modifier and Type</th>
|
||
|
<th class="colSecond" scope="col">Field</th>
|
||
|
<th class="colLast" scope="col">Description</th>
|
||
|
</tr>
|
||
|
</thead>
|
||
|
<tbody>
|
||
|
<tr class="altColor">
|
||
|
<td class="colFirst"><code>protected float</code></td>
|
||
|
<th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="#x">x</a></span></code></th>
|
||
|
<td class="colLast"> </td>
|
||
|
</tr>
|
||
|
<tr class="rowColor">
|
||
|
<td class="colFirst"><code>protected float</code></td>
|
||
|
<th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="#y">y</a></span></code></th>
|
||
|
<td class="colLast"> </td>
|
||
|
</tr>
|
||
|
<tr class="altColor">
|
||
|
<td class="colFirst"><code>protected float</code></td>
|
||
|
<th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="#z">z</a></span></code></th>
|
||
|
<td class="colLast"> </td>
|
||
|
</tr>
|
||
|
</tbody>
|
||
|
</table>
|
||
|
</div>
|
||
|
</section>
|
||
|
</li>
|
||
|
<!-- ======== CONSTRUCTOR SUMMARY ======== -->
|
||
|
<li class="blockList">
|
||
|
<section class="constructorSummary"><a id="constructor.summary">
|
||
|
<!-- -->
|
||
|
</a>
|
||
|
<h2>Constructor Summary</h2>
|
||
|
<div class="memberSummary">
|
||
|
<table>
|
||
|
<caption><span>Constructors</span><span class="tabEnd"> </span></caption>
|
||
|
<thead>
|
||
|
<tr>
|
||
|
<th class="colFirst" scope="col">Constructor</th>
|
||
|
<th class="colLast" scope="col">Description</th>
|
||
|
</tr>
|
||
|
</thead>
|
||
|
<tbody>
|
||
|
<tr class="altColor">
|
||
|
<th class="colConstructorName" scope="row"><code><span class="memberNameLink"><a href="#%3Cinit%3E()">Vector</a></span>()</code></th>
|
||
|
<td class="colLast"> </td>
|
||
|
</tr>
|
||
|
<tr class="rowColor">
|
||
|
<th class="colConstructorName" scope="row"><code><span class="memberNameLink"><a href="#%3Cinit%3E(float,float,float)">Vector</a></span>​(float x,
|
||
|
float y,
|
||
|
float z)</code></th>
|
||
|
<td class="colLast"> </td>
|
||
|
</tr>
|
||
|
</tbody>
|
||
|
</table>
|
||
|
</div>
|
||
|
</section>
|
||
|
</li>
|
||
|
<!-- ========== METHOD SUMMARY =========== -->
|
||
|
<li class="blockList">
|
||
|
<section class="methodSummary"><a id="method.summary">
|
||
|
<!-- -->
|
||
|
</a>
|
||
|
<h2>Method Summary</h2>
|
||
|
<div class="memberSummary">
|
||
|
<div role="tablist" aria-orientation="horizontal"><button role="tab" aria-selected="true" aria-controls="memberSummary_tabpanel" tabindex="0" onkeydown="switchTab(event)" id="t0" class="activeTableTab">All Methods</button><button role="tab" aria-selected="false" aria-controls="memberSummary_tabpanel" tabindex="-1" onkeydown="switchTab(event)" id="t2" class="tableTab" onclick="show(2);">Instance Methods</button><button role="tab" aria-selected="false" aria-controls="memberSummary_tabpanel" tabindex="-1" onkeydown="switchTab(event)" id="t4" class="tableTab" onclick="show(8);">Concrete Methods</button></div>
|
||
|
<div id="memberSummary_tabpanel" role="tabpanel">
|
||
|
<table aria-labelledby="t0">
|
||
|
<thead>
|
||
|
<tr>
|
||
|
<th class="colFirst" scope="col">Modifier and Type</th>
|
||
|
<th class="colSecond" scope="col">Method</th>
|
||
|
<th class="colLast" scope="col">Description</th>
|
||
|
</tr>
|
||
|
</thead>
|
||
|
<tbody>
|
||
|
<tr class="altColor" id="i0">
|
||
|
<td class="colFirst"><code><a href="Vector.html" title="class in net.minestom.server.utils">Vector</a></code></td>
|
||
|
<th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="#add(float,float,float)">add</a></span>​(float x,
|
||
|
float y,
|
||
|
float z)</code></th>
|
||
|
<td class="colLast"> </td>
|
||
|
</tr>
|
||
|
<tr class="rowColor" id="i1">
|
||
|
<td class="colFirst"><code><a href="Vector.html" title="class in net.minestom.server.utils">Vector</a></code></td>
|
||
|
<th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="#add(net.minestom.server.utils.Vector)">add</a></span>​(<a href="Vector.html" title="class in net.minestom.server.utils">Vector</a> vec)</code></th>
|
||
|
<td class="colLast"> </td>
|
||
|
</tr>
|
||
|
<tr class="altColor" id="i2">
|
||
|
<td class="colFirst"><code><a href="Vector.html" title="class in net.minestom.server.utils">Vector</a></code></td>
|
||
|
<th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="#copy()">copy</a></span>()</code></th>
|
||
|
<td class="colLast">
|
||
|
<div class="block">Gets a new vector with the same values.</div>
|
||
|
</td>
|
||
|
</tr>
|
||
|
<tr class="rowColor" id="i3">
|
||
|
<td class="colFirst"><code><a href="Vector.html" title="class in net.minestom.server.utils">Vector</a></code></td>
|
||
|
<th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="#copy(net.minestom.server.utils.Vector)">copy</a></span>​(<a href="Vector.html" title="class in net.minestom.server.utils">Vector</a> vec)</code></th>
|
||
|
<td class="colLast">
|
||
|
<div class="block">Copies another vector</div>
|
||
|
</td>
|
||
|
</tr>
|
||
|
<tr class="altColor" id="i4">
|
||
|
<td class="colFirst"><code>double</code></td>
|
||
|
<th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="#distance(net.minestom.server.utils.Vector)">distance</a></span>​(<a href="Vector.html" title="class in net.minestom.server.utils">Vector</a> o)</code></th>
|
||
|
<td class="colLast">
|
||
|
<div class="block">Gets the distance between this vector and another.</div>
|
||
|
</td>
|
||
|
</tr>
|
||
|
<tr class="rowColor" id="i5">
|
||
|
<td class="colFirst"><code>double</code></td>
|
||
|
<th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="#distanceSquared(net.minestom.server.utils.Vector)">distanceSquared</a></span>​(<a href="Vector.html" title="class in net.minestom.server.utils">Vector</a> o)</code></th>
|
||
|
<td class="colLast">
|
||
|
<div class="block">Gets the squared distance between this vector and another.</div>
|
||
|
</td>
|
||
|
</tr>
|
||
|
<tr class="altColor" id="i6">
|
||
|
<td class="colFirst"><code><a href="Vector.html" title="class in net.minestom.server.utils">Vector</a></code></td>
|
||
|
<th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="#divide(net.minestom.server.utils.Vector)">divide</a></span>​(<a href="Vector.html" title="class in net.minestom.server.utils">Vector</a> vec)</code></th>
|
||
|
<td class="colLast">
|
||
|
<div class="block">Divides the vector by another.</div>
|
||
|
</td>
|
||
|
</tr>
|
||
|
<tr class="rowColor" id="i7">
|
||
|
<td class="colFirst"><code>boolean</code></td>
|
||
|
<th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="#equals(java.lang.Object)">equals</a></span>​(java.lang.Object obj)</code></th>
|
||
|
<td class="colLast"> </td>
|
||
|
</tr>
|
||
|
<tr class="altColor" id="i8">
|
||
|
<td class="colFirst"><code>float</code></td>
|
||
|
<th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="#getX()">getX</a></span>()</code></th>
|
||
|
<td class="colLast"> </td>
|
||
|
</tr>
|
||
|
<tr class="rowColor" id="i9">
|
||
|
<td class="colFirst"><code>float</code></td>
|
||
|
<th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="#getY()">getY</a></span>()</code></th>
|
||
|
<td class="colLast"> </td>
|
||
|
</tr>
|
||
|
<tr class="altColor" id="i10">
|
||
|
<td class="colFirst"><code>float</code></td>
|
||
|
<th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="#getZ()">getZ</a></span>()</code></th>
|
||
|
<td class="colLast"> </td>
|
||
|
</tr>
|
||
|
<tr class="rowColor" id="i11">
|
||
|
<td class="colFirst"><code>int</code></td>
|
||
|
<th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="#hashCode()">hashCode</a></span>()</code></th>
|
||
|
<td class="colLast">
|
||
|
<div class="block">Returns a hash code for this vector</div>
|
||
|
</td>
|
||
|
</tr>
|
||
|
<tr class="altColor" id="i12">
|
||
|
<td class="colFirst"><code>double</code></td>
|
||
|
<th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="#length()">length</a></span>()</code></th>
|
||
|
<td class="colLast">
|
||
|
<div class="block">Gets the magnitude of the vector, defined as sqrt(x^2+y^2+z^2).</div>
|
||
|
</td>
|
||
|
</tr>
|
||
|
<tr class="rowColor" id="i13">
|
||
|
<td class="colFirst"><code><a href="Vector.html" title="class in net.minestom.server.utils">Vector</a></code></td>
|
||
|
<th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="#multiply(double)">multiply</a></span>​(double m)</code></th>
|
||
|
<td class="colLast">
|
||
|
<div class="block">Performs scalar multiplication, multiplying all components with a
|
||
|
scalar.</div>
|
||
|
</td>
|
||
|
</tr>
|
||
|
<tr class="altColor" id="i14">
|
||
|
<td class="colFirst"><code><a href="Vector.html" title="class in net.minestom.server.utils">Vector</a></code></td>
|
||
|
<th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="#multiply(float)">multiply</a></span>​(float m)</code></th>
|
||
|
<td class="colLast">
|
||
|
<div class="block">Performs scalar multiplication, multiplying all components with a
|
||
|
scalar.</div>
|
||
|
</td>
|
||
|
</tr>
|
||
|
<tr class="rowColor" id="i15">
|
||
|
<td class="colFirst"><code><a href="Vector.html" title="class in net.minestom.server.utils">Vector</a></code></td>
|
||
|
<th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="#multiply(int)">multiply</a></span>​(int m)</code></th>
|
||
|
<td class="colLast">
|
||
|
<div class="block">Performs scalar multiplication, multiplying all components with a
|
||
|
scalar.</div>
|
||
|
</td>
|
||
|
</tr>
|
||
|
<tr class="altColor" id="i16">
|
||
|
<td class="colFirst"><code><a href="Vector.html" title="class in net.minestom.server.utils">Vector</a></code></td>
|
||
|
<th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="#multiply(net.minestom.server.utils.Vector)">multiply</a></span>​(<a href="Vector.html" title="class in net.minestom.server.utils">Vector</a> vec)</code></th>
|
||
|
<td class="colLast">
|
||
|
<div class="block">Multiplies the vector by another.</div>
|
||
|
</td>
|
||
|
</tr>
|
||
|
<tr class="rowColor" id="i17">
|
||
|
<td class="colFirst"><code><a href="Vector.html" title="class in net.minestom.server.utils">Vector</a></code></td>
|
||
|
<th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="#normalize()">normalize</a></span>()</code></th>
|
||
|
<td class="colLast">
|
||
|
<div class="block">Converts this vector to a unit vector (a vector with length of 1).</div>
|
||
|
</td>
|
||
|
</tr>
|
||
|
<tr class="altColor" id="i18">
|
||
|
<td class="colFirst"><code>void</code></td>
|
||
|
<th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="#setX(float)">setX</a></span>​(float x)</code></th>
|
||
|
<td class="colLast"> </td>
|
||
|
</tr>
|
||
|
<tr class="rowColor" id="i19">
|
||
|
<td class="colFirst"><code>void</code></td>
|
||
|
<th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="#setY(float)">setY</a></span>​(float y)</code></th>
|
||
|
<td class="colLast"> </td>
|
||
|
</tr>
|
||
|
<tr class="altColor" id="i20">
|
||
|
<td class="colFirst"><code>void</code></td>
|
||
|
<th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="#setZ(float)">setZ</a></span>​(float z)</code></th>
|
||
|
<td class="colLast"> </td>
|
||
|
</tr>
|
||
|
<tr class="rowColor" id="i21">
|
||
|
<td class="colFirst"><code><a href="Vector.html" title="class in net.minestom.server.utils">Vector</a></code></td>
|
||
|
<th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="#subtract(float,float,float)">subtract</a></span>​(float x,
|
||
|
float y,
|
||
|
float z)</code></th>
|
||
|
<td class="colLast"> </td>
|
||
|
</tr>
|
||
|
<tr class="altColor" id="i22">
|
||
|
<td class="colFirst"><code><a href="Vector.html" title="class in net.minestom.server.utils">Vector</a></code></td>
|
||
|
<th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="#subtract(net.minestom.server.utils.Vector)">subtract</a></span>​(<a href="Vector.html" title="class in net.minestom.server.utils">Vector</a> vec)</code></th>
|
||
|
<td class="colLast">
|
||
|
<div class="block">Subtracts a vector from this one.</div>
|
||
|
</td>
|
||
|
</tr>
|
||
|
<tr class="rowColor" id="i23">
|
||
|
<td class="colFirst"><code><a href="Position.html" title="class in net.minestom.server.utils">Position</a></code></td>
|
||
|
<th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="#toPosition()">toPosition</a></span>()</code></th>
|
||
|
<td class="colLast">
|
||
|
<div class="block">Gets a new <a href="Position.html" title="class in net.minestom.server.utils"><code>Position</code></a> from this vector.</div>
|
||
|
</td>
|
||
|
</tr>
|
||
|
<tr class="altColor" id="i24">
|
||
|
<td class="colFirst"><code>java.lang.String</code></td>
|
||
|
<th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="#toString()">toString</a></span>()</code></th>
|
||
|
<td class="colLast"> </td>
|
||
|
</tr>
|
||
|
<tr class="rowColor" id="i25">
|
||
|
<td class="colFirst"><code><a href="Vector.html" title="class in net.minestom.server.utils">Vector</a></code></td>
|
||
|
<th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="#zero()">zero</a></span>()</code></th>
|
||
|
<td class="colLast">
|
||
|
<div class="block">Zero this vector's components.</div>
|
||
|
</td>
|
||
|
</tr>
|
||
|
</tbody>
|
||
|
</table>
|
||
|
</div>
|
||
|
</div>
|
||
|
<div class="inheritedList">
|
||
|
<h3>Methods inherited from class java.lang.Object</h3>
|
||
|
<a id="methods.inherited.from.class.java.lang.Object">
|
||
|
<!-- -->
|
||
|
</a><code>clone, finalize, getClass, notify, notifyAll, wait, wait, wait</code></div>
|
||
|
</section>
|
||
|
</li>
|
||
|
</ul>
|
||
|
</section>
|
||
|
<section class="details">
|
||
|
<ul class="blockList">
|
||
|
<!-- ============ FIELD DETAIL =========== -->
|
||
|
<li class="blockList">
|
||
|
<section class="fieldDetails"><a id="field.detail">
|
||
|
<!-- -->
|
||
|
</a>
|
||
|
<h2>Field Details</h2>
|
||
|
<ul class="blockList">
|
||
|
<li class="blockList">
|
||
|
<section class="detail">
|
||
|
<h3><a id="x">x</a></h3>
|
||
|
<div class="memberSignature"><span class="modifiers">protected</span> <span class="returnType">float</span> <span class="memberName">x</span></div>
|
||
|
</section>
|
||
|
</li>
|
||
|
<li class="blockList">
|
||
|
<section class="detail">
|
||
|
<h3><a id="y">y</a></h3>
|
||
|
<div class="memberSignature"><span class="modifiers">protected</span> <span class="returnType">float</span> <span class="memberName">y</span></div>
|
||
|
</section>
|
||
|
</li>
|
||
|
<li class="blockList">
|
||
|
<section class="detail">
|
||
|
<h3><a id="z">z</a></h3>
|
||
|
<div class="memberSignature"><span class="modifiers">protected</span> <span class="returnType">float</span> <span class="memberName">z</span></div>
|
||
|
</section>
|
||
|
</li>
|
||
|
</ul>
|
||
|
</section>
|
||
|
</li>
|
||
|
<!-- ========= CONSTRUCTOR DETAIL ======== -->
|
||
|
<li class="blockList">
|
||
|
<section class="constructorDetails"><a id="constructor.detail">
|
||
|
<!-- -->
|
||
|
</a>
|
||
|
<h2>Constructor Details</h2>
|
||
|
<ul class="blockList">
|
||
|
<li class="blockList">
|
||
|
<section class="detail">
|
||
|
<h3><a id="<init>()">Vector</a></h3>
|
||
|
<div class="memberSignature"><span class="modifiers">public</span> <span class="memberName">Vector</span>()</div>
|
||
|
</section>
|
||
|
</li>
|
||
|
<li class="blockList">
|
||
|
<section class="detail">
|
||
|
<h3><a id="<init>(float,float,float)">Vector</a></h3>
|
||
|
<div class="memberSignature"><span class="modifiers">public</span> <span class="memberName">Vector</span>​(<span class="arguments">float x,
|
||
|
float y,
|
||
|
float z)</span></div>
|
||
|
</section>
|
||
|
</li>
|
||
|
</ul>
|
||
|
</section>
|
||
|
</li>
|
||
|
<!-- ============ METHOD DETAIL ========== -->
|
||
|
<li class="blockList">
|
||
|
<section class="methodDetails"><a id="method.detail">
|
||
|
<!-- -->
|
||
|
</a>
|
||
|
<h2>Method Details</h2>
|
||
|
<ul class="blockList">
|
||
|
<li class="blockList">
|
||
|
<section class="detail">
|
||
|
<h3><a id="add(net.minestom.server.utils.Vector)">add</a></h3>
|
||
|
<div class="memberSignature"><span class="modifiers">public</span> <span class="returnType"><a href="Vector.html" title="class in net.minestom.server.utils">Vector</a></span> <span class="memberName">add</span>​(<span class="arguments"><a href="Vector.html" title="class in net.minestom.server.utils">Vector</a> vec)</span></div>
|
||
|
</section>
|
||
|
</li>
|
||
|
<li class="blockList">
|
||
|
<section class="detail">
|
||
|
<h3><a id="add(float,float,float)">add</a></h3>
|
||
|
<div class="memberSignature"><span class="modifiers">public</span> <span class="returnType"><a href="Vector.html" title="class in net.minestom.server.utils">Vector</a></span> <span class="memberName">add</span>​(<span class="arguments">float x,
|
||
|
float y,
|
||
|
float z)</span></div>
|
||
|
</section>
|
||
|
</li>
|
||
|
<li class="blockList">
|
||
|
<section class="detail">
|
||
|
<h3><a id="subtract(net.minestom.server.utils.Vector)">subtract</a></h3>
|
||
|
<div class="memberSignature"><span class="modifiers">public</span> <span class="returnType"><a href="Vector.html" title="class in net.minestom.server.utils">Vector</a></span> <span class="memberName">subtract</span>​(<span class="arguments"><a href="Vector.html" title="class in net.minestom.server.utils">Vector</a> vec)</span></div>
|
||
|
<div class="block">Subtracts a vector from this one.</div>
|
||
|
<dl>
|
||
|
<dt><span class="paramLabel">Parameters:</span></dt>
|
||
|
<dd><code>vec</code> - The other vector</dd>
|
||
|
<dt><span class="returnLabel">Returns:</span></dt>
|
||
|
<dd>the same vector</dd>
|
||
|
</dl>
|
||
|
</section>
|
||
|
</li>
|
||
|
<li class="blockList">
|
||
|
<section class="detail">
|
||
|
<h3><a id="subtract(float,float,float)">subtract</a></h3>
|
||
|
<div class="memberSignature"><span class="modifiers">public</span> <span class="returnType"><a href="Vector.html" title="class in net.minestom.server.utils">Vector</a></span> <span class="memberName">subtract</span>​(<span class="arguments">float x,
|
||
|
float y,
|
||
|
float z)</span></div>
|
||
|
</section>
|
||
|
</li>
|
||
|
<li class="blockList">
|
||
|
<section class="detail">
|
||
|
<h3><a id="multiply(net.minestom.server.utils.Vector)">multiply</a></h3>
|
||
|
<div class="memberSignature"><span class="modifiers">public</span> <span class="returnType"><a href="Vector.html" title="class in net.minestom.server.utils">Vector</a></span> <span class="memberName">multiply</span>​(<span class="arguments"><a href="Vector.html" title="class in net.minestom.server.utils">Vector</a> vec)</span></div>
|
||
|
<div class="block">Multiplies the vector by another.</div>
|
||
|
<dl>
|
||
|
<dt><span class="paramLabel">Parameters:</span></dt>
|
||
|
<dd><code>vec</code> - The other vector</dd>
|
||
|
<dt><span class="returnLabel">Returns:</span></dt>
|
||
|
<dd>the same vector</dd>
|
||
|
</dl>
|
||
|
</section>
|
||
|
</li>
|
||
|
<li class="blockList">
|
||
|
<section class="detail">
|
||
|
<h3><a id="divide(net.minestom.server.utils.Vector)">divide</a></h3>
|
||
|
<div class="memberSignature"><span class="modifiers">public</span> <span class="returnType"><a href="Vector.html" title="class in net.minestom.server.utils">Vector</a></span> <span class="memberName">divide</span>​(<span class="arguments"><a href="Vector.html" title="class in net.minestom.server.utils">Vector</a> vec)</span></div>
|
||
|
<div class="block">Divides the vector by another.</div>
|
||
|
<dl>
|
||
|
<dt><span class="paramLabel">Parameters:</span></dt>
|
||
|
<dd><code>vec</code> - The other vector</dd>
|
||
|
<dt><span class="returnLabel">Returns:</span></dt>
|
||
|
<dd>the same vector</dd>
|
||
|
</dl>
|
||
|
</section>
|
||
|
</li>
|
||
|
<li class="blockList">
|
||
|
<section class="detail">
|
||
|
<h3><a id="copy(net.minestom.server.utils.Vector)">copy</a></h3>
|
||
|
<div class="memberSignature"><span class="modifiers">public</span> <span class="returnType"><a href="Vector.html" title="class in net.minestom.server.utils">Vector</a></span> <span class="memberName">copy</span>​(<span class="arguments"><a href="Vector.html" title="class in net.minestom.server.utils">Vector</a> vec)</span></div>
|
||
|
<div class="block">Copies another vector</div>
|
||
|
<dl>
|
||
|
<dt><span class="paramLabel">Parameters:</span></dt>
|
||
|
<dd><code>vec</code> - The other vector</dd>
|
||
|
<dt><span class="returnLabel">Returns:</span></dt>
|
||
|
<dd>the same vector</dd>
|
||
|
</dl>
|
||
|
</section>
|
||
|
</li>
|
||
|
<li class="blockList">
|
||
|
<section class="detail">
|
||
|
<h3><a id="length()">length</a></h3>
|
||
|
<div class="memberSignature"><span class="modifiers">public</span> <span class="returnType">double</span> <span class="memberName">length</span>()</div>
|
||
|
<div class="block">Gets the magnitude of the vector, defined as sqrt(x^2+y^2+z^2). The
|
||
|
value of this method is not cached and uses a costly square-root
|
||
|
function, so do not repeatedly call this method to get the vector's
|
||
|
magnitude. NaN will be returned if the inner result of the sqrt()
|
||
|
function overflows, which will be caused if the length is too long.</div>
|
||
|
<dl>
|
||
|
<dt><span class="returnLabel">Returns:</span></dt>
|
||
|
<dd>the magnitude</dd>
|
||
|
</dl>
|
||
|
</section>
|
||
|
</li>
|
||
|
<li class="blockList">
|
||
|
<section class="detail">
|
||
|
<h3><a id="distance(net.minestom.server.utils.Vector)">distance</a></h3>
|
||
|
<div class="memberSignature"><span class="modifiers">public</span> <span class="returnType">double</span> <span class="memberName">distance</span>​(<span class="arguments"><a href="Vector.html" title="class in net.minestom.server.utils">Vector</a> o)</span></div>
|
||
|
<div class="block">Gets the distance between this vector and another. The value of this
|
||
|
method is not cached and uses a costly square-root function, so do not
|
||
|
repeatedly call this method to get the vector's magnitude. NaN will be
|
||
|
returned if the inner result of the sqrt() function overflows, which
|
||
|
will be caused if the distance is too long.</div>
|
||
|
<dl>
|
||
|
<dt><span class="paramLabel">Parameters:</span></dt>
|
||
|
<dd><code>o</code> - The other vector</dd>
|
||
|
<dt><span class="returnLabel">Returns:</span></dt>
|
||
|
<dd>the distance</dd>
|
||
|
</dl>
|
||
|
</section>
|
||
|
</li>
|
||
|
<li class="blockList">
|
||
|
<section class="detail">
|
||
|
<h3><a id="distanceSquared(net.minestom.server.utils.Vector)">distanceSquared</a></h3>
|
||
|
<div class="memberSignature"><span class="modifiers">public</span> <span class="returnType">double</span> <span class="memberName">distanceSquared</span>​(<span class="arguments"><a href="Vector.html" title="class in net.minestom.server.utils">Vector</a> o)</span></div>
|
||
|
<div class="block">Gets the squared distance between this vector and another.</div>
|
||
|
<dl>
|
||
|
<dt><span class="paramLabel">Parameters:</span></dt>
|
||
|
<dd><code>o</code> - The other vector</dd>
|
||
|
<dt><span class="returnLabel">Returns:</span></dt>
|
||
|
<dd>the squared distance</dd>
|
||
|
</dl>
|
||
|
</section>
|
||
|
</li>
|
||
|
<li class="blockList">
|
||
|
<section class="detail">
|
||
|
<h3><a id="multiply(int)">multiply</a></h3>
|
||
|
<div class="memberSignature"><span class="modifiers">public</span> <span class="returnType"><a href="Vector.html" title="class in net.minestom.server.utils">Vector</a></span> <span class="memberName">multiply</span>​(<span class="arguments">int m)</span></div>
|
||
|
<div class="block">Performs scalar multiplication, multiplying all components with a
|
||
|
scalar.</div>
|
||
|
<dl>
|
||
|
<dt><span class="paramLabel">Parameters:</span></dt>
|
||
|
<dd><code>m</code> - The factor</dd>
|
||
|
<dt><span class="returnLabel">Returns:</span></dt>
|
||
|
<dd>the same vector</dd>
|
||
|
</dl>
|
||
|
</section>
|
||
|
</li>
|
||
|
<li class="blockList">
|
||
|
<section class="detail">
|
||
|
<h3><a id="multiply(double)">multiply</a></h3>
|
||
|
<div class="memberSignature"><span class="modifiers">public</span> <span class="returnType"><a href="Vector.html" title="class in net.minestom.server.utils">Vector</a></span> <span class="memberName">multiply</span>​(<span class="arguments">double m)</span></div>
|
||
|
<div class="block">Performs scalar multiplication, multiplying all components with a
|
||
|
scalar.</div>
|
||
|
<dl>
|
||
|
<dt><span class="paramLabel">Parameters:</span></dt>
|
||
|
<dd><code>m</code> - The factor</dd>
|
||
|
<dt><span class="returnLabel">Returns:</span></dt>
|
||
|
<dd>the same vector</dd>
|
||
|
</dl>
|
||
|
</section>
|
||
|
</li>
|
||
|
<li class="blockList">
|
||
|
<section class="detail">
|
||
|
<h3><a id="multiply(float)">multiply</a></h3>
|
||
|
<div class="memberSignature"><span class="modifiers">public</span> <span class="returnType"><a href="Vector.html" title="class in net.minestom.server.utils">Vector</a></span> <span class="memberName">multiply</span>​(<span class="arguments">float m)</span></div>
|
||
|
<div class="block">Performs scalar multiplication, multiplying all components with a
|
||
|
scalar.</div>
|
||
|
<dl>
|
||
|
<dt><span class="paramLabel">Parameters:</span></dt>
|
||
|
<dd><code>m</code> - The factor</dd>
|
||
|
<dt><span class="returnLabel">Returns:</span></dt>
|
||
|
<dd>the same vector</dd>
|
||
|
</dl>
|
||
|
</section>
|
||
|
</li>
|
||
|
<li class="blockList">
|
||
|
<section class="detail">
|
||
|
<h3><a id="normalize()">normalize</a></h3>
|
||
|
<div class="memberSignature"><span class="modifiers">public</span> <span class="returnType"><a href="Vector.html" title="class in net.minestom.server.utils">Vector</a></span> <span class="memberName">normalize</span>()</div>
|
||
|
<div class="block">Converts this vector to a unit vector (a vector with length of 1).</div>
|
||
|
<dl>
|
||
|
<dt><span class="returnLabel">Returns:</span></dt>
|
||
|
<dd>the same vector</dd>
|
||
|
</dl>
|
||
|
</section>
|
||
|
</li>
|
||
|
<li class="blockList">
|
||
|
<section class="detail">
|
||
|
<h3><a id="zero()">zero</a></h3>
|
||
|
<div class="memberSignature"><span class="modifiers">public</span> <span class="returnType"><a href="Vector.html" title="class in net.minestom.server.utils">Vector</a></span> <span class="memberName">zero</span>()</div>
|
||
|
<div class="block">Zero this vector's components.</div>
|
||
|
<dl>
|
||
|
<dt><span class="returnLabel">Returns:</span></dt>
|
||
|
<dd>the same vector</dd>
|
||
|
</dl>
|
||
|
</section>
|
||
|
</li>
|
||
|
<li class="blockList">
|
||
|
<section class="detail">
|
||
|
<h3><a id="equals(java.lang.Object)">equals</a></h3>
|
||
|
<div class="memberSignature"><span class="modifiers">public</span> <span class="returnType">boolean</span> <span class="memberName">equals</span>​(<span class="arguments">java.lang.Object obj)</span></div>
|
||
|
<dl>
|
||
|
<dt><span class="overrideSpecifyLabel">Overrides:</span></dt>
|
||
|
<dd><code>equals</code> in class <code>java.lang.Object</code></dd>
|
||
|
</dl>
|
||
|
</section>
|
||
|
</li>
|
||
|
<li class="blockList">
|
||
|
<section class="detail">
|
||
|
<h3><a id="hashCode()">hashCode</a></h3>
|
||
|
<div class="memberSignature"><span class="modifiers">public</span> <span class="returnType">int</span> <span class="memberName">hashCode</span>()</div>
|
||
|
<div class="block">Returns a hash code for this vector</div>
|
||
|
<dl>
|
||
|
<dt><span class="overrideSpecifyLabel">Overrides:</span></dt>
|
||
|
<dd><code>hashCode</code> in class <code>java.lang.Object</code></dd>
|
||
|
<dt><span class="returnLabel">Returns:</span></dt>
|
||
|
<dd>hash code</dd>
|
||
|
</dl>
|
||
|
</section>
|
||
|
</li>
|
||
|
<li class="blockList">
|
||
|
<section class="detail">
|
||
|
<h3><a id="toString()">toString</a></h3>
|
||
|
<div class="memberSignature"><span class="modifiers">public</span> <span class="returnType">java.lang.String</span> <span class="memberName">toString</span>()</div>
|
||
|
<dl>
|
||
|
<dt><span class="overrideSpecifyLabel">Overrides:</span></dt>
|
||
|
<dd><code>toString</code> in class <code>java.lang.Object</code></dd>
|
||
|
</dl>
|
||
|
</section>
|
||
|
</li>
|
||
|
<li class="blockList">
|
||
|
<section class="detail">
|
||
|
<h3><a id="copy()">copy</a></h3>
|
||
|
<div class="memberSignature"><span class="modifiers">public</span> <span class="returnType"><a href="Vector.html" title="class in net.minestom.server.utils">Vector</a></span> <span class="memberName">copy</span>()</div>
|
||
|
<div class="block">Gets a new vector with the same values.</div>
|
||
|
<dl>
|
||
|
<dt><span class="returnLabel">Returns:</span></dt>
|
||
|
<dd>vector</dd>
|
||
|
</dl>
|
||
|
</section>
|
||
|
</li>
|
||
|
<li class="blockList">
|
||
|
<section class="detail">
|
||
|
<h3><a id="getX()">getX</a></h3>
|
||
|
<div class="memberSignature"><span class="modifiers">public</span> <span class="returnType">float</span> <span class="memberName">getX</span>()</div>
|
||
|
</section>
|
||
|
</li>
|
||
|
<li class="blockList">
|
||
|
<section class="detail">
|
||
|
<h3><a id="setX(float)">setX</a></h3>
|
||
|
<div class="memberSignature"><span class="modifiers">public</span> <span class="returnType">void</span> <span class="memberName">setX</span>​(<span class="arguments">float x)</span></div>
|
||
|
</section>
|
||
|
</li>
|
||
|
<li class="blockList">
|
||
|
<section class="detail">
|
||
|
<h3><a id="getY()">getY</a></h3>
|
||
|
<div class="memberSignature"><span class="modifiers">public</span> <span class="returnType">float</span> <span class="memberName">getY</span>()</div>
|
||
|
</section>
|
||
|
</li>
|
||
|
<li class="blockList">
|
||
|
<section class="detail">
|
||
|
<h3><a id="setY(float)">setY</a></h3>
|
||
|
<div class="memberSignature"><span class="modifiers">public</span> <span class="returnType">void</span> <span class="memberName">setY</span>​(<span class="arguments">float y)</span></div>
|
||
|
</section>
|
||
|
</li>
|
||
|
<li class="blockList">
|
||
|
<section class="detail">
|
||
|
<h3><a id="getZ()">getZ</a></h3>
|
||
|
<div class="memberSignature"><span class="modifiers">public</span> <span class="returnType">float</span> <span class="memberName">getZ</span>()</div>
|
||
|
</section>
|
||
|
</li>
|
||
|
<li class="blockList">
|
||
|
<section class="detail">
|
||
|
<h3><a id="setZ(float)">setZ</a></h3>
|
||
|
<div class="memberSignature"><span class="modifiers">public</span> <span class="returnType">void</span> <span class="memberName">setZ</span>​(<span class="arguments">float z)</span></div>
|
||
|
</section>
|
||
|
</li>
|
||
|
<li class="blockList">
|
||
|
<section class="detail">
|
||
|
<h3><a id="toPosition()">toPosition</a></h3>
|
||
|
<div class="memberSignature"><span class="modifiers">public</span> <span class="returnType"><a href="Position.html" title="class in net.minestom.server.utils">Position</a></span> <span class="memberName">toPosition</span>()</div>
|
||
|
<div class="block">Gets a new <a href="Position.html" title="class in net.minestom.server.utils"><code>Position</code></a> from this vector.</div>
|
||
|
<dl>
|
||
|
<dt><span class="returnLabel">Returns:</span></dt>
|
||
|
<dd>this vector as a position</dd>
|
||
|
</dl>
|
||
|
</section>
|
||
|
</li>
|
||
|
</ul>
|
||
|
</section>
|
||
|
</li>
|
||
|
</ul>
|
||
|
</section>
|
||
|
</div>
|
||
|
<!-- ========= END OF CLASS DATA ========= -->
|
||
|
</main>
|
||
|
<footer role="contentinfo">
|
||
|
<nav role="navigation">
|
||
|
<!-- ======= START OF BOTTOM NAVBAR ====== -->
|
||
|
<div class="bottomNav"><a id="navbar.bottom">
|
||
|
<!-- -->
|
||
|
</a>
|
||
|
<div class="skipNav"><a href="#skip.navbar.bottom" title="Skip navigation links">Skip navigation links</a></div>
|
||
|
<a id="navbar.bottom.firstrow">
|
||
|
<!-- -->
|
||
|
</a>
|
||
|
<ul class="navList" title="Navigation">
|
||
|
<li><a href="../../../../index.html">Overview</a></li>
|
||
|
<li><a href="package-summary.html">Package</a></li>
|
||
|
<li class="navBarCell1Rev">Class</li>
|
||
|
<li><a href="package-tree.html">Tree</a></li>
|
||
|
<li><a href="../../../../deprecated-list.html">Deprecated</a></li>
|
||
|
<li><a href="../../../../index-all.html">Index</a></li>
|
||
|
<li><a href="../../../../help-doc.html">Help</a></li>
|
||
|
</ul>
|
||
|
</div>
|
||
|
<div class="subNav">
|
||
|
<div>
|
||
|
<ul class="subNavList">
|
||
|
<li>Summary: </li>
|
||
|
<li>Nested | </li>
|
||
|
<li><a href="#field.summary">Field</a> | </li>
|
||
|
<li><a href="#constructor.summary">Constr</a> | </li>
|
||
|
<li><a href="#method.summary">Method</a></li>
|
||
|
</ul>
|
||
|
<ul class="subNavList">
|
||
|
<li>Detail: </li>
|
||
|
<li><a href="#field.detail">Field</a> | </li>
|
||
|
<li><a href="#constructor.detail">Constr</a> | </li>
|
||
|
<li><a href="#method.detail">Method</a></li>
|
||
|
</ul>
|
||
|
</div>
|
||
|
</div>
|
||
|
<a id="skip.navbar.bottom">
|
||
|
<!-- -->
|
||
|
</a>
|
||
|
<!-- ======== END OF BOTTOM NAVBAR ======= -->
|
||
|
</nav>
|
||
|
</footer>
|
||
|
</div>
|
||
|
</div>
|
||
|
</body>
|
||
|
</html>
|