Skip to content
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

A collection of improvement ideas #34

Open
mreinstein opened this issue Feb 10, 2024 · 2 comments
Open

A collection of improvement ideas #34

mreinstein opened this issue Feb 10, 2024 · 2 comments

Comments

@mreinstein
Copy link
Contributor

mreinstein commented Feb 10, 2024

I don't know if you'd be up for any of these, so I'll just throw the ideas here. If you're game for any of them, happy to PR:

  • standardize on the vec2 module from gl-matrix - this would mean vectors would be [ x, y ] rather than { x, y }.
    it's nice in that it re-uses a popular vector module. I'm always a little saddened looking at various game/sim repos in javascript, and every one invents it's own vector/matrix libraries. :(
  • switch from Object-oriented to data-oriented design - rather than using classes to bundle code, the different primitives (sticks, dots etc.) essentially become structs, and the data structure gets passed in to all of the related functions

Will add more ideas as they come up., just wanted to throw these in as a starting point.

@mreinstein
Copy link
Contributor Author

  • avoid attaching things to window and rely on pure es imports/exports.
  • search the code for browser only APIs (I don't think we use many except for window) this would enable running the verlet logic on node/deno/bun if someone wanted to.

@anuraghazra
Copy link
Owner

  1. standardize vec2

I'm up for it as long as it doesn't increase the bundle size too much, not sure how large gl-matrix is

  1. switch to data-oriented design

Up for it, though would love to discuss more about the approach/architecture.

  1. avoid window globals

Absolutely, we should remove this dependency and this could be clubbed with #32

  1. run on node

Yeah I think that's fair, could be clubbed with #33

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants