Skip to content

Commit

Permalink
Deploying to gh-pages from @ 4b9b99a 🚀
Browse files Browse the repository at this point in the history
  • Loading branch information
greggman committed May 11, 2024
1 parent 3eb8861 commit 6821306
Show file tree
Hide file tree
Showing 13 changed files with 29 additions and 29 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,7 @@ There is also the minified version
import {
vec3,
mat4,
} from 'https://wgpu-matrix.org/dist/2.x/wgpu-matrix.module.min.js';
} from 'https://wgpu-matrix.org/dist/2.x/wgpu-matrix.module.js';

// ... etc ...
```
Expand Down
12 changes: 6 additions & 6 deletions dist/2.x/wgpu-matrix.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion dist/2.x/wgpu-matrix.js.map

Large diffs are not rendered by default.

6 changes: 3 additions & 3 deletions dist/2.x/wgpu-matrix.min.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

12 changes: 6 additions & 6 deletions dist/2.x/wgpu-matrix.module.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion dist/2.x/wgpu-matrix.module.js.map

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion docs/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ <h2>wgpu-matrix</h2></div>
<pre><code class="language-js"><span class="hl-1">const</span><span class="hl-2"> </span><span class="hl-3">m</span><span class="hl-2"> = </span><span class="hl-4">mat4</span><span class="hl-2">.</span><span class="hl-5">create</span><span class="hl-2">(); </span><span class="hl-0">// m = new mat4</span><br/><span class="hl-4">mat4</span><span class="hl-2">.</span><span class="hl-5">identity</span><span class="hl-2">(</span><span class="hl-4">m</span><span class="hl-2">); </span><span class="hl-0">// m = identity</span><br/><span class="hl-4">mat4</span><span class="hl-2">.</span><span class="hl-5">translate</span><span class="hl-2">(</span><span class="hl-4">m</span><span class="hl-2">, [</span><span class="hl-8">1</span><span class="hl-2">, </span><span class="hl-8">2</span><span class="hl-2">, </span><span class="hl-8">3</span><span class="hl-2">], </span><span class="hl-4">m</span><span class="hl-2">); </span><span class="hl-0">// m *= translation([1, 2, 3])</span><br/><span class="hl-4">mat4</span><span class="hl-2">.</span><span class="hl-5">rotateX</span><span class="hl-2">(</span><span class="hl-4">m</span><span class="hl-2">, </span><span class="hl-4">Math</span><span class="hl-2">.</span><span class="hl-3">PI</span><span class="hl-2"> * </span><span class="hl-8">0.5</span><span class="hl-2">, </span><span class="hl-4">m</span><span class="hl-2">); </span><span class="hl-0">// m *= rotationX(Math.PI * 0.5)</span><br/><span class="hl-4">mat4</span><span class="hl-2">.</span><span class="hl-5">scale</span><span class="hl-2">(</span><span class="hl-4">m</span><span class="hl-2">, [</span><span class="hl-8">1</span><span class="hl-2">, </span><span class="hl-8">2</span><span class="hl-2">, </span><span class="hl-8">3</span><span class="hl-2">], </span><span class="hl-4">m</span><span class="hl-2">); </span><span class="hl-0">// m *= scaling([1, 2, 3])</span>
</code><button>Copy</button></pre>
<p>There is also the minified version</p>
<pre><code class="language-js"><span class="hl-6">import</span><span class="hl-2"> {</span><br/><span class="hl-2"> </span><span class="hl-4">vec3</span><span class="hl-2">,</span><br/><span class="hl-2"> </span><span class="hl-4">mat4</span><span class="hl-2">,</span><br/><span class="hl-2">} </span><span class="hl-6">from</span><span class="hl-2"> </span><span class="hl-7">&#39;https://wgpu-matrix.org/dist/2.x/wgpu-matrix.module.min.js&#39;</span><span class="hl-2">;</span><br/><br/><span class="hl-0">// ... etc ...</span>
<pre><code class="language-js"><span class="hl-6">import</span><span class="hl-2"> {</span><br/><span class="hl-2"> </span><span class="hl-4">vec3</span><span class="hl-2">,</span><br/><span class="hl-2"> </span><span class="hl-4">mat4</span><span class="hl-2">,</span><br/><span class="hl-2">} </span><span class="hl-6">from</span><span class="hl-2"> </span><span class="hl-7">&#39;https://wgpu-matrix.org/dist/2.x/wgpu-matrix.module.js&#39;</span><span class="hl-2">;</span><br/><br/><span class="hl-0">// ... etc ...</span>
</code><button>Copy</button></pre>
<p>or via npm</p>
<pre><code class="language-sh"><span class="hl-5">npm</span><span class="hl-2"> </span><span class="hl-7">install</span><span class="hl-2"> </span><span class="hl-1">--save</span><span class="hl-2"> </span><span class="hl-7">wgpu-matrix</span>
Expand Down
4 changes: 2 additions & 2 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "wgpu-matrix",
"version": "2.8.0",
"version": "2.8.1",
"description": "fast matrix math library for WebGPU",
"main": "dist/2.x/wgpu-matrix.module.js",
"module": "dist/2.x/wgpu-matrix.module.js",
Expand Down
4 changes: 2 additions & 2 deletions src/vec2-impl.ts
Original file line number Diff line number Diff line change
Expand Up @@ -158,8 +158,8 @@ export function addScaled(a: Vec2, b: Vec2, scale: number, dst?: Vec2) {
export function angle(a: Vec2, b: Vec2): number {
const ax = a[0];
const ay = a[1];
const bx = a[0];
const by = a[1];
const bx = b[0];
const by = b[1];
const mag1 = Math.sqrt(ax * ax + ay * ay);
const mag2 = Math.sqrt(bx * bx + by * by);
const mag = mag1 * mag2;
Expand Down
6 changes: 3 additions & 3 deletions src/vec3-impl.ts
Original file line number Diff line number Diff line change
Expand Up @@ -168,9 +168,9 @@ export function angle(a: Vec3, b: Vec3): number {
const ax = a[0];
const ay = a[1];
const az = a[2];
const bx = a[0];
const by = a[1];
const bz = a[2];
const bx = b[0];
const by = b[1];
const bz = b[2];
const mag1 = Math.sqrt(ax * ax + ay * ay + az * az);
const mag2 = Math.sqrt(bx * bx + by * by + bz * bz);
const mag = mag1 * mag2;
Expand Down
2 changes: 1 addition & 1 deletion test/tests/vec2-test.js
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,7 @@ function check(Type) {
{ a: [1, 0], b: [ 0, 1], expected: Math.PI / 2, },
{ a: [1, 0], b: [-1, 0], expected: Math.PI, },
{ a: [1, 0], b: [ 1, 0], expected: 0, },
{ a: [1, 2], b: [ 4, 5], expected: 0.225726 },
{ a: [1, 2], b: [ 4, 5], expected: 0.2110933, },
{ a: [1, 0], b: [ 0, Number.POSITIVE_INFINITY], expected: Math.PI / 2, },
];
for (const {a, b, expected} of tests) {
Expand Down
2 changes: 1 addition & 1 deletion test/tests/vec3-test.js
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,7 @@ function check(Type) {
{ a: [1, 0, 0], b: [ 0, 1, 0], expected: Math.PI / 2, },
{ a: [1, 0, 0], b: [-1, 0, 0], expected: Math.PI, },
{ a: [1, 0, 0], b: [ 1, 0, 0], expected: 0, },
{ a: [1, 2, 3], b: [ 4, 5, 6], expected: 0.225726 },
{ a: [1, 2, 3], b: [ 4, 5, 6], expected: 0.2257261 },
{ a: [1, 0, 0], b: [ 0, Number.POSITIVE_INFINITY, 0], expected: Math.PI / 2, },
];
for (const {a, b, expected} of tests) {
Expand Down

0 comments on commit 6821306

Please sign in to comment.