Liking cljdoc? Tell your friends :D

cljbox2d

cljdoc badge Clojars Project

Idiomatic and cross-platform Clojure version of the Box2D physics engine API. Wraps jBox2D (Clojure) and Planck.js (ClojureScript).

Created for use with Quil, but can be used independently or with other rendering engines.

Work in progress. See the demo directory for examples.

Demos

Run these commands to see cljbox2d in action:

clojure -Sdeps '{:deps {com.lambdaisland/cljbox2d {:mvn/version "0.2.12"} quil/quil {:mvn/version "3.1.0"}}}' -M -m lambdaisland.cljbox2d.demo.simple-shapes
clojure -Sdeps '{:deps {com.lambdaisland/cljbox2d {:mvn/version "0.2.12"} quil/quil {:mvn/version "3.1.0"}}}' -M -m lambdaisland.cljbox2d.demo.pyramid
clojure -Sdeps '{:deps {com.lambdaisland/cljbox2d {:mvn/version "0.2.12"} quil/quil {:mvn/version "3.1.0"}}}' -M -m lambdaisland.cljbox2d.demo.platformer

Installation

To use the latest release, add the following to your deps.edn (Clojure CLI)

com.lambdaisland/cljbox2d {:mvn/version "0.2.12"}

or add the following to your project.clj (Leiningen)

[com.lambdaisland/cljbox2d "0.2.12"]

Rationale

Usage

Writing portable code

The following jBox2D features are not supported by planck.js

  • ConstantVolumeJoin
  • Particles (and thus particle raycast)

Lambda Island Open Source

 

cljbox2d is part of a growing collection of quality Clojure libraries created and maintained by the fine folks at Gaiwan.

Pay it forward by becoming a backer on our Open Collective, so that we may continue to enjoy a thriving Clojure ecosystem.

You can find an overview of our projects at lambdaisland/open-source.

 

 

Contributing

Everyone has a right to submit patches to cljbox2d, and thus become a contributor.

Contributors MUST

  • adhere to the LambdaIsland Clojure Style Guide
  • write patches that solve a problem. Start by stating the problem, then supply a minimal solution. *
  • agree to license their contributions as MPL 2.0.
  • not break the contract with downstream consumers. **
  • not break the tests.

Contributors SHOULD

  • update the CHANGELOG and README.
  • add tests for new functionality.

If you submit a pull request that adheres to these rules, then it will almost certainly be merged immediately. However some things may require more consideration. If you add new dependencies, or significantly increase the API surface, then we need to decide if these changes are in line with the project's goals. In this case you can start by writing a pitch, and collecting feedback on it.

* This goes for features too, a feature needs to solve a problem. State the problem it solves, then supply a minimal solution.

** As long as this project has not seen a public release (i.e. is not on Clojars) we may still consider making breaking changes, if there is consensus that the changes are justified.

License

Copyright © 2021-2022 Arne Brasseur and Contributors

Licensed under the term of the Mozilla Public License 2.0, see LICENSE.

Can you improve this documentation?Edit on GitHub

cljdoc is a website building & hosting documentation for Clojure/Script libraries

× close