-
Notifications
You must be signed in to change notification settings - Fork 2
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
V4 #27
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
- convert require to import and module.exports to exports - export _fromMat39 in quat - replace var/let with const - use console.assert over assert - add contributors Closes #9 BREAKING CHANGE: switch to type module
- add math benchmarks - run benchmark over n iterations
- scale matrix components to avoid useless multiplication
…ye/target edge case in _lookAt9
- reorder - add mat3.copy and remove mat3._set9 - add mat3x3.copy and mat3x3.equals
- ~500% gain
- translate matrix components to avoid useless multiplication
- rotate matrix components to avoid useless multiplication
Thanks for the work so far. Yes let's discuss TBD items one by one below. |
Benchmark lean towards keeping array |
|
Should we default + export function add(a, i, b, j = 0) {
- export function add(a, i, b, j) {
a[i * 3] += b[j * 3];
a[i * 3 + 1] += b[j * 3 + 1];
a[i * 3 + 2] += b[j * 3 + 2];
} This would help when transforming an avec by a regular vec3 eg.: import { avec3 } from "pex-math";
const myVec3 = [1,0,0];
const myGeom = plane();
for (let i = 0; i < myGeom.positions.length /3; i++) {
avec3.add(myGeom.positions, i, myVec3);
// instead of avec3.add(myGeom.positions, i, myVec3, 0);
} |
I would say no defaults. I like to see the 0 |
* 'v4' of github.com:pex-gl/pex-math: docs: fix vec2 comment chore(release): 4.0.0-alpha.5 feat: add forEach/map to avec build: use builtin code coverage feat: add avec2 chore(release): 4.0.0-alpha.4 fix: remove array returns in avec
feat: add quat/mat4. fromPointToPoint
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Changes:
To test:
use Math.hypot (quat.length, vec2/3.length, vec2/3.distance)/ 2 or * 0.5 ? (quat.fromEuler)copyImplementation:
TBD:
Closes #9
Closes #10
Closes #14
Closes #16
Closes #25
Closes #26
Closes #30
Closes #31