Skip to content

Commit

Permalink
Update README
Browse files Browse the repository at this point in the history
  • Loading branch information
jon-edward committed Jul 15, 2024
1 parent eefd055 commit 97d4bd9
Showing 1 changed file with 9 additions and 28 deletions.
37 changes: 9 additions & 28 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,35 +9,16 @@ nimble install box2d

## Documentation

I've kept the names of external library members consistent with that of Box2D v3 to help in searching its
[documentation](https://box2d.org/documentation_v3/). In cases when the identifiers conflict with
reserved Nim keywords (ie. `b2BodyDef.type`), I've escaped the names with backticks (\`type\`).
See library documentation [here](https://jon-edward.github.io/box2d.nim/). Also,
because the library's naming is largely consistent with that of Box2D, you can use the
[Box2D v3 documentation](https://box2d.org/documentation_v3/) directly.

The only exception to the naming consistency is `b2BodyDef.type` being translated to `b2BodyDef.bodyType`
because of the reserved `type` keyword in Nim.

## Testing

I've translated most of Box2D's tests to Nim to demonstrate how the wrapped definitions should be used in a
Nim environment. In addition, I've included larger examples using [naylib](https://github.com/planetis-m/naylib)
for rendering in the [examples](https://github.com/jon-edward/box2d.nim/tree/main/examples)
There are most of Box2D's unit tests translated to Nim in the
[tests](https://github.com/jon-edward/box2d.nim/tree/main/tests) directory. In addition, there are larger examples
using [naylib](https://github.com/planetis-m/naylib) for rendering in the [examples](https://github.com/jon-edward/box2d.nim/tree/main/examples)
directory.

## Notes

I was motivated to wrap Box2D v3 instead of (the currently more widely known) v2 because wrapping C is more
straightforward than wrapping C++ in Nim, which was v2's implementation language. My hope is that having
Erin Catto's work available to Nim developers will have a meaningful impact on the game development community
within the Nim ecosystem.

I used [futhark](https://github.com/PMunch/futhark) to create the initial wrapping script to automate much of
the work generating declarations, and I've included what I used to generate the starting point in the
[scripts](https://github.com/jon-edward/box2d.nim/tree/main/scripts) directory.

## Next steps

- [ ] Add automated unit testing
- [ ] Add build tests
- [ ] Improve in-library documentation
- [ ] Add more examples
- [ ] Implement a higher level API that includes more idiomatic Nim patterns
- [ ] Add procedures to make vector math easier
- [ ] Make generated WASM faster
- [ ] Create utilities for performing physics calculations in a secondary thread

0 comments on commit 97d4bd9

Please sign in to comment.