Skip to content

Commit

Permalink
add JS impl of vec and mat
Browse files Browse the repository at this point in the history
  • Loading branch information
andykswong committed Mar 17, 2024
1 parent 7627fd7 commit f3d1e39
Show file tree
Hide file tree
Showing 22 changed files with 1,239 additions and 63 deletions.
5 changes: 3 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,6 @@
## Overview
`munum` is a minimalistic numerical library for high-performance 3D math with Rust, WebAssembly and JavaScript bindings.

WIP v0.2: unification of Rust and JS source

## Documentation
- Docs.rs: https://docs.rs/munum
- TSDoc: http://andykswong.github.io/munum
Expand Down Expand Up @@ -60,6 +58,9 @@ using viewProj = perspective(aspectRatio, yfov, znear, zfar).mul(view);

Note the use of `using` (which automatically calls `.free()` when out of scope). When using JavaScript binding, `munum` resources are allocated on WebAssembly memory which need to be deallocated later. `munum` uses `FinalizationRegistry` for automatic memory management, so explicit memory management with `using` or `.free()` is not required through recommended.

## Usage (Pure JavaScript)
Import from `munum/js` for pure JavaScript implementation.

## Usage (Rust)
Sample usage to build a perspective camera view-projection matrix:

Expand Down
40 changes: 0 additions & 40 deletions as-pect.config.cjs

This file was deleted.

6 changes: 6 additions & 0 deletions assembly/index.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
/**
* Deprecated - This will be removed once the new code base reaches feature parity.
*
* @packageDocumentation
*/

import * as aabb from './aabb';
import * as frustum from './frustum';
import * as mat from './mat';
Expand Down
12 changes: 12 additions & 0 deletions codecov.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
comment:
layout: "header, diff, flags"
coverage:
status:
project:
default:
target: 90%
threshold: 2%
patch:
default:
target: 90%
threshold: 2%
2 changes: 2 additions & 0 deletions dist/js/helpers.js

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

4 changes: 2 additions & 2 deletions dist/js/index.js

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

Loading

0 comments on commit f3d1e39

Please sign in to comment.