gl-matrix
Version:
Javascript Matrix and Vector library for High Performance WebGL apps
4,358 lines (1,175 loc) • 116 kB
HTML
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<title>JSDoc: Global</title>
<script src="scripts/prettify/prettify.js"> </script>
<script src="scripts/prettify/lang-css.js"> </script>
<!--[if lt IE 9]>
<script src="//html5shiv.googlecode.com/svn/trunk/html5.js"></script>
<![endif]-->
<link type="text/css" rel="stylesheet" href="styles/prettify-tomorrow.css">
<link type="text/css" rel="stylesheet" href="styles/jsdoc-default.css">
</head>
<body>
<div id="main">
<h1 class="page-title">Global</h1>
<section>
<header>
<h2></h2>
</header>
<article>
<div class="container-overview">
<dl class="details">
</dl>
</div>
<h3 class="subsection-title">Methods</h3>
<h4 class="name" id="add"><span class="type-signature"></span>add<span class="signature">(out, a, b)</span><span class="type-signature"> → {<a href="mat4.html">mat4</a>}</span></h4>
<div class="description">
Adds two mat4's
</div>
<h5>Parameters:</h5>
<table class="params">
<thead>
<tr>
<th>Name</th>
<th>Type</th>
<th class="last">Description</th>
</tr>
</thead>
<tbody>
<tr>
<td class="name"><code>out</code></td>
<td class="type">
<span class="param-type"><a href="mat4.html">mat4</a></span>
</td>
<td class="description last">the receiving matrix</td>
</tr>
<tr>
<td class="name"><code>a</code></td>
<td class="type">
<span class="param-type"><a href="mat4.html">mat4</a></span>
</td>
<td class="description last">the first operand</td>
</tr>
<tr>
<td class="name"><code>b</code></td>
<td class="type">
<span class="param-type"><a href="mat4.html">mat4</a></span>
</td>
<td class="description last">the second operand</td>
</tr>
</tbody>
</table>
<dl class="details">
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="mat4.js.html">mat4.js</a>, <a href="mat4.js.html#line1562">line 1562</a>
</li></ul></dd>
</dl>
<h5>Returns:</h5>
<div class="param-desc">
out
</div>
<dl>
<dt>
Type
</dt>
<dd>
<span class="param-type"><a href="mat4.html">mat4</a></span>
</dd>
</dl>
<h4 class="name" id="adjoint"><span class="type-signature"></span>adjoint<span class="signature">(out, a)</span><span class="type-signature"> → {<a href="mat4.html">mat4</a>}</span></h4>
<div class="description">
Calculates the adjugate of a mat4
</div>
<h5>Parameters:</h5>
<table class="params">
<thead>
<tr>
<th>Name</th>
<th>Type</th>
<th class="last">Description</th>
</tr>
</thead>
<tbody>
<tr>
<td class="name"><code>out</code></td>
<td class="type">
<span class="param-type"><a href="mat4.html">mat4</a></span>
</td>
<td class="description last">the receiving matrix</td>
</tr>
<tr>
<td class="name"><code>a</code></td>
<td class="type">
<span class="param-type"><a href="mat4.html">mat4</a></span>
</td>
<td class="description last">the source matrix</td>
</tr>
</tbody>
</table>
<dl class="details">
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="mat4.js.html">mat4.js</a>, <a href="mat4.js.html#line328">line 328</a>
</li></ul></dd>
</dl>
<h5>Returns:</h5>
<div class="param-desc">
out
</div>
<dl>
<dt>
Type
</dt>
<dd>
<span class="param-type"><a href="mat4.html">mat4</a></span>
</dd>
</dl>
<h4 class="name" id="clone"><span class="type-signature"></span>clone<span class="signature">(a)</span><span class="type-signature"> → {<a href="mat4.html">mat4</a>}</span></h4>
<div class="description">
Creates a new mat4 initialized with values from an existing matrix
</div>
<h5>Parameters:</h5>
<table class="params">
<thead>
<tr>
<th>Name</th>
<th>Type</th>
<th class="last">Description</th>
</tr>
</thead>
<tbody>
<tr>
<td class="name"><code>a</code></td>
<td class="type">
<span class="param-type"><a href="mat4.html">mat4</a></span>
</td>
<td class="description last">matrix to clone</td>
</tr>
</tbody>
</table>
<dl class="details">
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="mat4.js.html">mat4.js</a>, <a href="mat4.js.html#line60">line 60</a>
</li></ul></dd>
</dl>
<h5>Returns:</h5>
<div class="param-desc">
a new 4x4 matrix
</div>
<dl>
<dt>
Type
</dt>
<dd>
<span class="param-type"><a href="mat4.html">mat4</a></span>
</dd>
</dl>
<h4 class="name" id="copy"><span class="type-signature"></span>copy<span class="signature">(out, a)</span><span class="type-signature"> → {<a href="mat4.html">mat4</a>}</span></h4>
<div class="description">
Copy the values from one mat4 to another
</div>
<h5>Parameters:</h5>
<table class="params">
<thead>
<tr>
<th>Name</th>
<th>Type</th>
<th class="last">Description</th>
</tr>
</thead>
<tbody>
<tr>
<td class="name"><code>out</code></td>
<td class="type">
<span class="param-type"><a href="mat4.html">mat4</a></span>
</td>
<td class="description last">the receiving matrix</td>
</tr>
<tr>
<td class="name"><code>a</code></td>
<td class="type">
<span class="param-type"><a href="mat4.html">mat4</a></span>
</td>
<td class="description last">the source matrix</td>
</tr>
</tbody>
</table>
<dl class="details">
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="mat4.js.html">mat4.js</a>, <a href="mat4.js.html#line88">line 88</a>
</li></ul></dd>
</dl>
<h5>Returns:</h5>
<div class="param-desc">
out
</div>
<dl>
<dt>
Type
</dt>
<dd>
<span class="param-type"><a href="mat4.html">mat4</a></span>
</dd>
</dl>
<h4 class="name" id="create"><span class="type-signature"></span>create<span class="signature">()</span><span class="type-signature"> → {<a href="mat4.html">mat4</a>}</span></h4>
<div class="description">
Creates a new identity mat4
</div>
<dl class="details">
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="mat4.js.html">mat4.js</a>, <a href="mat4.js.html#line33">line 33</a>
</li></ul></dd>
</dl>
<h5>Returns:</h5>
<div class="param-desc">
a new 4x4 matrix
</div>
<dl>
<dt>
Type
</dt>
<dd>
<span class="param-type"><a href="mat4.html">mat4</a></span>
</dd>
</dl>
<h4 class="name" id="determinant"><span class="type-signature"></span>determinant<span class="signature">(a)</span><span class="type-signature"> → {Number}</span></h4>
<div class="description">
Calculates the determinant of a mat4
</div>
<h5>Parameters:</h5>
<table class="params">
<thead>
<tr>
<th>Name</th>
<th>Type</th>
<th class="last">Description</th>
</tr>
</thead>
<tbody>
<tr>
<td class="name"><code>a</code></td>
<td class="type">
<span class="param-type"><a href="mat4.html">mat4</a></span>
</td>
<td class="description last">the source matrix</td>
</tr>
</tbody>
</table>
<dl class="details">
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="mat4.js.html">mat4.js</a>, <a href="mat4.js.html#line359">line 359</a>
</li></ul></dd>
</dl>
<h5>Returns:</h5>
<div class="param-desc">
determinant of a
</div>
<dl>
<dt>
Type
</dt>
<dd>
<span class="param-type">Number</span>
</dd>
</dl>
<h4 class="name" id="equals"><span class="type-signature"></span>equals<span class="signature">(a, b)</span><span class="type-signature"> → {Boolean}</span></h4>
<div class="description">
Returns whether or not the matrices have approximately the same elements in the same position.
</div>
<h5>Parameters:</h5>
<table class="params">
<thead>
<tr>
<th>Name</th>
<th>Type</th>
<th class="last">Description</th>
</tr>
</thead>
<tbody>
<tr>
<td class="name"><code>a</code></td>
<td class="type">
<span class="param-type"><a href="mat4.html">mat4</a></span>
</td>
<td class="description last">The first matrix.</td>
</tr>
<tr>
<td class="name"><code>b</code></td>
<td class="type">
<span class="param-type"><a href="mat4.html">mat4</a></span>
</td>
<td class="description last">The second matrix.</td>
</tr>
</tbody>
</table>
<dl class="details">
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="mat4.js.html">mat4.js</a>, <a href="mat4.js.html#line1688">line 1688</a>
</li></ul></dd>
</dl>
<h5>Returns:</h5>
<div class="param-desc">
True if the matrices are equal, false otherwise.
</div>
<dl>
<dt>
Type
</dt>
<dd>
<span class="param-type">Boolean</span>
</dd>
</dl>
<h4 class="name" id="exactEquals"><span class="type-signature"></span>exactEquals<span class="signature">(a, b)</span><span class="type-signature"> → {Boolean}</span></h4>
<div class="description">
Returns whether or not the matrices have exactly the same elements in the same position (when compared with ===)
</div>
<h5>Parameters:</h5>
<table class="params">
<thead>
<tr>
<th>Name</th>
<th>Type</th>
<th class="last">Description</th>
</tr>
</thead>
<tbody>
<tr>
<td class="name"><code>a</code></td>
<td class="type">
<span class="param-type"><a href="mat4.html">mat4</a></span>
</td>
<td class="description last">The first matrix.</td>
</tr>
<tr>
<td class="name"><code>b</code></td>
<td class="type">
<span class="param-type"><a href="mat4.html">mat4</a></span>
</td>
<td class="description last">The second matrix.</td>
</tr>
</tbody>
</table>
<dl class="details">
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="mat4.js.html">mat4.js</a>, <a href="mat4.js.html#line1674">line 1674</a>
</li></ul></dd>
</dl>
<h5>Returns:</h5>
<div class="param-desc">
True if the matrices are equal, false otherwise.
</div>
<dl>
<dt>
Type
</dt>
<dd>
<span class="param-type">Boolean</span>
</dd>
</dl>
<h4 class="name" id="frob"><span class="type-signature"></span>frob<span class="signature">(a)</span><span class="type-signature"> → {Number}</span></h4>
<div class="description">
Returns Frobenius norm of a mat4
</div>
<h5>Parameters:</h5>
<table class="params">
<thead>
<tr>
<th>Name</th>
<th>Type</th>
<th class="last">Description</th>
</tr>
</thead>
<tbody>
<tr>
<td class="name"><code>a</code></td>
<td class="type">
<span class="param-type"><a href="mat4.html">mat4</a></span>
</td>
<td class="description last">the matrix to calculate Frobenius norm of</td>
</tr>
</tbody>
</table>
<dl class="details">
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="mat4.js.html">mat4.js</a>, <a href="mat4.js.html#line1550">line 1550</a>
</li></ul></dd>
</dl>
<h5>Returns:</h5>
<div class="param-desc">
Frobenius norm
</div>
<dl>
<dt>
Type
</dt>
<dd>
<span class="param-type">Number</span>
</dd>
</dl>
<h4 class="name" id="fromQuat"><span class="type-signature"></span>fromQuat<span class="signature">(out, q)</span><span class="type-signature"> → {<a href="mat4.html">mat4</a>}</span></h4>
<div class="description">
Calculates a 4x4 matrix from the given quaternion
</div>
<h5>Parameters:</h5>
<table class="params">
<thead>
<tr>
<th>Name</th>
<th>Type</th>
<th class="last">Description</th>
</tr>
</thead>
<tbody>
<tr>
<td class="name"><code>out</code></td>
<td class="type">
<span class="param-type"><a href="mat4.html">mat4</a></span>
</td>
<td class="description last">mat4 receiving operation result</td>
</tr>
<tr>
<td class="name"><code>q</code></td>
<td class="type">
<span class="param-type">quat</span>
</td>
<td class="description last">Quaternion to create matrix from</td>
</tr>
</tbody>
</table>
<dl class="details">
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="mat4.js.html">mat4.js</a>, <a href="mat4.js.html#line1204">line 1204</a>
</li></ul></dd>
</dl>
<h5>Returns:</h5>
<div class="param-desc">
out
</div>
<dl>
<dt>
Type
</dt>
<dd>
<span class="param-type"><a href="mat4.html">mat4</a></span>
</dd>
</dl>
<h4 class="name" id="fromQuat2"><span class="type-signature"></span>fromQuat2<span class="signature">(out, a)</span><span class="type-signature"> → {<a href="mat4.html">mat4</a>}</span></h4>
<div class="description">
Creates a new mat4 from a dual quat.
</div>
<h5>Parameters:</h5>
<table class="params">
<thead>
<tr>
<th>Name</th>
<th>Type</th>
<th class="last">Description</th>
</tr>
</thead>
<tbody>
<tr>
<td class="name"><code>out</code></td>
<td class="type">
<span class="param-type"><a href="mat4.html">mat4</a></span>
</td>
<td class="description last">Matrix</td>
</tr>
<tr>
<td class="name"><code>a</code></td>
<td class="type">
<span class="param-type">quat2</span>
</td>
<td class="description last">Dual Quaternion</td>
</tr>
</tbody>
</table>
<dl class="details">
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="mat4.js.html">mat4.js</a>, <a href="mat4.js.html#line956">line 956</a>
</li></ul></dd>
</dl>
<h5>Returns:</h5>
<div class="param-desc">
mat4 receiving operation result
</div>
<dl>
<dt>
Type
</dt>
<dd>
<span class="param-type"><a href="mat4.html">mat4</a></span>
</dd>
</dl>
<h4 class="name" id="fromRotation"><span class="type-signature"></span>fromRotation<span class="signature">(out, rad, axis)</span><span class="type-signature"> → {<a href="mat4.html">mat4</a>}</span></h4>
<div class="description">
Creates a matrix from a given angle around a given axis
This is equivalent to (but much faster than):
mat4.identity(dest);
mat4.rotate(dest, dest, rad, axis);
</div>
<h5>Parameters:</h5>
<table class="params">
<thead>
<tr>
<th>Name</th>
<th>Type</th>
<th class="last">Description</th>
</tr>
</thead>
<tbody>
<tr>
<td class="name"><code>out</code></td>
<td class="type">
<span class="param-type"><a href="mat4.html">mat4</a></span>
</td>
<td class="description last">mat4 receiving operation result</td>
</tr>
<tr>
<td class="name"><code>rad</code></td>
<td class="type">
<span class="param-type">Number</span>
</td>
<td class="description last">the angle to rotate the matrix by</td>
</tr>
<tr>
<td class="name"><code>axis</code></td>
<td class="type">
<span class="param-type">vec3</span>
</td>
<td class="description last">the axis to rotate around</td>
</tr>
</tbody>
</table>
<dl class="details">
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="mat4.js.html">mat4.js</a>, <a href="mat4.js.html#line756">line 756</a>
</li></ul></dd>
</dl>
<h5>Returns:</h5>
<div class="param-desc">
out
</div>
<dl>
<dt>
Type
</dt>
<dd>
<span class="param-type"><a href="mat4.html">mat4</a></span>
</dd>
</dl>
<h4 class="name" id="fromRotationTranslation"><span class="type-signature"></span>fromRotationTranslation<span class="signature">(out, q, v)</span><span class="type-signature"> → {<a href="mat4.html">mat4</a>}</span></h4>
<div class="description">
Creates a matrix from a quaternion rotation and vector translation
This is equivalent to (but much faster than):
mat4.identity(dest);
mat4.translate(dest, vec);
let quatMat = mat4.create();
quat4.toMat4(quat, quatMat);
mat4.multiply(dest, quatMat);
</div>
<h5>Parameters:</h5>
<table class="params">
<thead>
<tr>
<th>Name</th>
<th>Type</th>
<th class="last">Description</th>
</tr>
</thead>
<tbody>
<tr>
<td class="name"><code>out</code></td>
<td class="type">
<span class="param-type"><a href="mat4.html">mat4</a></span>
</td>
<td class="description last">mat4 receiving operation result</td>
</tr>
<tr>
<td class="name"><code>q</code></td>
<td class="type">
<span class="param-type">quat4</span>
</td>
<td class="description last">Rotation quaternion</td>
</tr>
<tr>
<td class="name"><code>v</code></td>
<td class="type">
<span class="param-type">vec3</span>
</td>
<td class="description last">Translation vector</td>
</tr>
</tbody>
</table>
<dl class="details">
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="mat4.js.html">mat4.js</a>, <a href="mat4.js.html#line912">line 912</a>
</li></ul></dd>
</dl>
<h5>Returns:</h5>
<div class="param-desc">
out
</div>
<dl>
<dt>
Type
</dt>
<dd>
<span class="param-type"><a href="mat4.html">mat4</a></span>
</dd>
</dl>
<h4 class="name" id="fromRotationTranslationScale"><span class="type-signature"></span>fromRotationTranslationScale<span class="signature">(out, q, v, s)</span><span class="type-signature"> → {<a href="mat4.html">mat4</a>}</span></h4>
<div class="description">
Creates a matrix from a quaternion rotation, vector translation and vector scale
This is equivalent to (but much faster than):
mat4.identity(dest);
mat4.translate(dest, vec);
let quatMat = mat4.create();
quat4.toMat4(quat, quatMat);
mat4.multiply(dest, quatMat);
mat4.scale(dest, scale)
</div>
<h5>Parameters:</h5>
<table class="params">
<thead>
<tr>
<th>Name</th>
<th>Type</th>
<th class="last">Description</th>
</tr>
</thead>
<tbody>
<tr>
<td class="name"><code>out</code></td>
<td class="type">
<span class="param-type"><a href="mat4.html">mat4</a></span>
</td>
<td class="description last">mat4 receiving operation result</td>
</tr>
<tr>
<td class="name"><code>q</code></td>
<td class="type">
<span class="param-type">quat4</span>
</td>
<td class="description last">Rotation quaternion</td>
</tr>
<tr>
<td class="name"><code>v</code></td>
<td class="type">
<span class="param-type">vec3</span>
</td>
<td class="description last">Translation vector</td>
</tr>
<tr>
<td class="name"><code>s</code></td>
<td class="type">
<span class="param-type">vec3</span>
</td>
<td class="description last">Scaling vector</td>
</tr>
</tbody>
</table>
<dl class="details">
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="mat4.js.html">mat4.js</a>, <a href="mat4.js.html#line1081">line 1081</a>
</li></ul></dd>
</dl>
<h5>Returns:</h5>
<div class="param-desc">
out
</div>
<dl>
<dt>
Type
</dt>
<dd>
<span class="param-type"><a href="mat4.html">mat4</a></span>
</dd>
</dl>
<h4 class="name" id="fromRotationTranslationScaleOrigin"><span class="type-signature"></span>fromRotationTranslationScaleOrigin<span class="signature">(out, q, v, s, o)</span><span class="type-signature"> → {<a href="mat4.html">mat4</a>}</span></h4>
<div class="description">
Creates a matrix from a quaternion rotation, vector translation and vector scale, rotating and scaling around the given origin
This is equivalent to (but much faster than):
mat4.identity(dest);
mat4.translate(dest, vec);
mat4.translate(dest, origin);
let quatMat = mat4.create();
quat4.toMat4(quat, quatMat);
mat4.multiply(dest, quatMat);
mat4.scale(dest, scale)
mat4.translate(dest, negativeOrigin);
</div>
<h5>Parameters:</h5>
<table class="params">
<thead>
<tr>
<th>Name</th>
<th>Type</th>
<th class="last">Description</th>
</tr>
</thead>
<tbody>
<tr>
<td class="name"><code>out</code></td>
<td class="type">
<span class="param-type"><a href="mat4.html">mat4</a></span>
</td>
<td class="description last">mat4 receiving operation result</td>
</tr>
<tr>
<td class="name"><code>q</code></td>
<td class="type">
<span class="param-type">quat4</span>
</td>
<td class="description last">Rotation quaternion</td>
</tr>
<tr>
<td class="name"><code>v</code></td>
<td class="type">
<span class="param-type">vec3</span>
</td>
<td class="description last">Translation vector</td>
</tr>
<tr>
<td class="name"><code>s</code></td>
<td class="type">
<span class="param-type">vec3</span>
</td>
<td class="description last">Scaling vector</td>
</tr>
<tr>
<td class="name"><code>o</code></td>
<td class="type">
<span class="param-type">vec3</span>
</td>
<td class="description last">The origin vector around which to scale and rotate</td>
</tr>
</tbody>
</table>
<dl class="details">
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="mat4.js.html">mat4.js</a>, <a href="mat4.js.html#line1141">line 1141</a>
</li></ul></dd>
</dl>
<h5>Returns:</h5>
<div class="param-desc">
out
</div>
<dl>
<dt>
Type
</dt>
<dd>
<span class="param-type"><a href="mat4.html">mat4</a></span>
</dd>
</dl>
<h4 class="name" id="fromScaling"><span class="type-signature"></span>fromScaling<span class="signature">(out, v)</span><span class="type-signature"> → {<a href="mat4.html">mat4</a>}</span></h4>
<div class="description">
Creates a matrix from a vector scaling
This is equivalent to (but much faster than):
mat4.identity(dest);
mat4.scale(dest, dest, vec);
</div>
<h5>Parameters:</h5>
<table class="params">
<thead>
<tr>
<th>Name</th>
<th>Type</th>
<th class="last">Description</th>
</tr>
</thead>
<tbody>
<tr>
<td class="name"><code>out</code></td>
<td class="type">
<span class="param-type"><a href="mat4.html">mat4</a></span>
</td>
<td class="description last">mat4 receiving operation result</td>
</tr>
<tr>
<td class="name"><code>v</code></td>
<td class="type">
<span class="param-type">vec3</span>
</td>
<td class="description last">Scaling vector</td>
</tr>
</tbody>
</table>
<dl class="details">
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="mat4.js.html">mat4.js</a>, <a href="mat4.js.html#line724">line 724</a>
</li></ul></dd>
</dl>
<h5>Returns:</h5>
<div class="param-desc">
out
</div>
<dl>
<dt>
Type
</dt>
<dd>
<span class="param-type"><a href="mat4.html">mat4</a></span>
</dd>
</dl>
<h4 class="name" id="fromTranslation"><span class="type-signature"></span>fromTranslation<span class="signature">(out, v)</span><span class="type-signature"> → {<a href="mat4.html">mat4</a>}</span></h4>
<div class="description">
Creates a matrix from a vector translation
This is equivalent to (but much faster than):
mat4.identity(dest);
mat4.translate(dest, dest, vec);
</div>
<h5>Parameters:</h5>
<table class="params">
<thead>
<tr>
<th>Name</th>
<th>Type</th>
<th class="last">Description</th>
</tr>
</thead>
<tbody>
<tr>
<td class="name"><code>out</code></td>
<td class="type">
<span class="param-type"><a href="mat4.html">mat4</a></span>
</td>
<td class="description last">mat4 receiving operation result</td>
</tr>
<tr>
<td class="name"><code>v</code></td>
<td class="type">
<span class="param-type">vec3</span>
</td>
<td class="description last">Translation vector</td>
</tr>
</tbody>
</table>
<dl class="details">
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="mat4.js.html">mat4.js</a>, <a href="mat4.js.html#line693">line 693</a>
</li></ul></dd>
</dl>
<h5>Returns:</h5>
<div class="param-desc">
out
</div>
<dl>
<dt>
Type
</dt>
<dd>
<span class="param-type"><a href="mat4.html">mat4</a></span>
</dd>
</dl>
<h4 class="name" id="fromValues"><span class="type-signature"></span>fromValues<span class="signature">(m00, m01, m02, m03, m10, m11, m12, m13, m20, m21, m22, m23, m30, m31, m32, m33)</span><span class="type-signature"> → {<a href="mat4.html">mat4</a>}</span></h4>
<div class="description">
Create a new mat4 with the given values
</div>
<h5>Parameters:</h5>
<table class="params">
<thead>
<tr>
<th>Name</th>
<th>Type</th>
<th class="last">Description</th>
</tr>
</thead>
<tbody>
<tr>
<td class="name"><code>m00</code></td>
<td class="type">
<span class="param-type">Number</span>
</td>
<td class="description last">Component in column 0, row 0 position (index 0)</td>
</tr>
<tr>
<td class="name"><code>m01</code></td>
<td class="type">
<span class="param-type">Number</span>
</td>
<td class="description last">Component in column 0, row 1 position (index 1)</td>
</tr>
<tr>
<td class="name"><code>m02</code></td>
<td class="type">
<span class="param-type">Number</span>
</td>
<td class="description last">Component in column 0, row 2 position (index 2)</td>
</tr>
<tr>
<td class="name"><code>m03</code></td>
<td class="type">
<span class="param-type">Number</span>
</td>
<td class="description last">Component in column 0, row 3 position (index 3)</td>
</tr>
<tr>
<td class="name"><code>m10</code></td>
<td class="type">
<span class="param-type">Number</span>
</td>
<td class="description last">Component in column 1, row 0 position (index 4)</td>
</tr>
<tr>
<td class="name"><code>m11</code></td>
<td class="type">
<span class="param-type">Number</span>
</td>
<td class="description last">Component in column 1, row 1 position (index 5)</td>
</tr>
<tr>
<td class="name"><code>m12</code></td>
<td class="type">
<span class="param-type">Number</span>
</td>
<td class="description last">Component in column 1, row 2 position (index 6)</td>
</tr>
<tr>
<td class="name"><code>m13</code></td>
<td class="type">
<span class="param-type">Number</span>
</td>
<td class="description last">Component in column 1, row 3 position (index 7)</td>
</tr>
<tr>
<td class="name"><code>m20</code></td>
<td class="type">
<span class="param-type">Number</span>
</td>
<td class="description last">Component in column 2, row 0 position (index 8)</td>
</tr>
<tr>
<td class="name"><code>m21</code></td>
<td class="type">
<span class="param-type">Number</span>
</td>
<td class="description last">Component in column 2, row 1 position (index 9)</td>
</tr>
<tr>
<td class="name"><code>m22</code></td>
<td class="type">
<span class="param-type">Number</span>
</td>
<td class="description last">Component in column 2, row 2 position (index 10)</td>
</tr>
<tr>
<td class="name"><code>m23</code></td>
<td class="type">
<span class="param-type">Number</span>
</td>
<td class="description last">Component in column 2, row 3 position (index 11)</td>
</tr>
<tr>
<td class="name"><code>m30</code></td>
<td class="type">
<span class="param-type">Number</span>
</td>
<td class="description last">Component in column 3, row 0 position (index 12)</td>
</tr>
<tr>
<td class="name"><code>m31</code></td>
<td class="type">
<span class="param-type">Number</span>
</td>
<td class="description last">Component in column 3, row 1 position (index 13)</td>
</tr>
<tr>
<td class="name"><code>m32</code></td>
<td class="type">
<span class="param-type">Number</span>
</td>
<td class="description last">Component in column 3, row 2 position (index 14)</td>
</tr>
<tr>
<td class="name"><code>m33</code></td>
<td class="type">
<span class="param-type">Number</span>
</td>
<td class="description last">Component in column 3, row 3 position (index 15)</td>
</tr>
</tbody>
</table>
<dl class="details">
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="mat4.js.html">mat4.js</a>, <a href="mat4.js.html#line129">line 129</a>
</li></ul></dd>
</dl>
<h5>Returns:</h5>
<div class="param-desc">
A new mat4
</div>
<dl>
<dt>
Type
</dt>
<dd>
<span class="param-type"><a href="mat4.html">mat4</a></span>
</dd>
</dl>
<h4 class="name" id="fromXRotation"><span class="type-signature"></span>fromXRotation<span class="signature">(out, rad)</span><span class="type-signature"> → {<a href="mat4.html">mat4</a>}</span></h4>
<div class="description">
Creates a matrix from the given angle around the X axis
This is equivalent to (but much faster than):
mat4.identity(dest);
mat4.rotateX(dest, dest, rad);
</div>
<h5>Parameters:</h5>
<table class="params">
<thead>
<tr>
<th>Name</th>
<th>Type</th>
<th class="last">Description</th>
</tr>
</thead>
<tbody>
<tr>
<td class="name"><code>out</code></td>
<td class="type">
<span class="param-type"><a href="mat4.html">mat4</a></span>
</td>
<td class="description last">mat4 receiving operation result</td>
</tr>
<tr>
<td class="name"><code>rad</code></td>
<td class="type">
<span class="param-type">Number</span>
</td>
<td class="description last">the angle to rotate the matrix by</td>
</tr>
</tbody>
</table>
<dl class="details">
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="mat4.js.html">mat4.js</a>, <a href="mat4.js.html#line803">line 803</a>
</li></ul></dd>
</dl>
<h5>Returns:</h5>
<div class="param-desc">
out
</div>
<dl>
<dt>
Type
</dt>
<dd>
<span class="param-type"><a href="mat4.html">mat4</a></span>
</dd>
</dl>
<h4 class="name" id="fromYRotation"><span class="type-signature"></span>fromYRotation<span class="signature">(out, rad)</span><span class="type-signature"> → {<a href="mat4.html">mat4</a>}</span></h4>
<div class="description">
Creates a matrix from the given angle around the Y axis
This is equivalent to (but much faster than):
mat4.identity(dest);
mat4.rotateY(dest, dest, rad);
</div>
<h5>Parameters:</h5>
<table class="params">
<thead>
<tr>
<th>Name</th>
<th>Type</th>
<th class="last">Description</th>
</tr>
</thead>
<tbody>
<tr>
<td class="name"><code>out</code></td>
<td class="type">
<span class="param-type"><a href="mat4.html">mat4</a></span>
</td>
<td class="description last">mat4 receiving operation result</td>
</tr>
<tr>
<td class="name"><code>rad</code></td>
<td class="type">
<span class="param-type">Number</span>
</td>
<td class="description last">the angle to rotate the matrix by</td>
</tr>
</tbody>
</table>
<dl class="details">
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="mat4.js.html">mat4.js</a>, <a href="mat4.js.html#line838">line 838</a>
</li></ul></dd>
</dl>
<h5>Returns:</h5>
<div class="param-desc">
out
</div>
<dl>
<dt>
Type
</dt>
<dd>
<span class="param-type"><a href="mat4.html">mat4</a></span>
</dd>
</dl>
<h4 class="name" id="fromZRotation"><span class="type-signature"></span>fromZRotation<span class="signature">(out, rad)</span><span class="type-signature"> → {<a href="mat4.html">mat4</a>}</span></h4>
<div class="description">
Creates a matrix from the given angle around the Z axis
This is equivalent to (but much faster than):
mat4.identity(dest);
mat4.rotateZ(dest, dest, rad);
</div>
<h5>Parameters:</h5>
<table class="params">
<thead>
<tr>
<th>Name</th>
<th>Type</th>
<th class="last">Description</th>
</tr>
</thead>
<tbody>
<tr>
<td class="name"><code>out</code></td>
<td class="type">
<span class="param-type"><a href="mat4.html">mat4</a></span>
</td>
<td class="description last">mat4 receiving operation result</td>
</tr>
<tr>
<td class="name"><code>rad</code></td>
<td class="type">
<span class="param-type">Number</span>
</td>
<td class="description last">the angle to rotate the matrix by</td>
</tr>
</tbody>
</table>
<dl class="details">
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="mat4.js.html">mat4.js</a>, <a href="mat4.js.html#line873">line 873</a>
</li></ul></dd>
</dl>
<h5>Returns:</h5>
<div class="param-desc">
out
</div>
<dl>
<dt>
Type
</dt>
<dd>
<span class="param-type"><a href="mat4.html">mat4</a></span>
</dd>
</dl>
<h4 class="name" id="frustum"><span class="type-signature"></span>frustum<span class="signature">(out, left, right, bottom, top, near, far)</span><span class="type-signature"> → {<a href="mat4.html">mat4</a>}</span></h4>
<div class="description">
Generates a frustum matrix with the given bounds
</div>
<h5>Parameters:</h5>
<table class="params">
<thead>
<tr>
<th>Name</th>
<th>Type</th>
<th class="last">Description</th>
</tr>
</thead>
<tbody>
<tr>
<td class="name"><code>out</code></td>
<td class="type">
<span class="param-type"><a href="mat4.html">mat4</a></span>
</td>
<td class="description last">mat4 frustum matrix will be written into</td>
</tr>
<tr>
<td class="name"><code>left</code></td>
<td class="type">
<span class="param-type">Number</span>
</td>
<td class="description last">Left bound of the frustum</td>
</tr>
<tr>
<td class="name"><code>right</code></td>
<td class="type">
<span class="param-type">Number</span>
</td>
<td class="description last">Right bound of the fru