Skip to main content

Bindings for box2d v3

Project description

box2d-py

Python Bindings for Box2D v3 using CFFI

Documentation Status Build Status

Python bindings for the Box2D physics engine version 3. Provides Pythonic access to Box2D's feature set.

Installation

Install from source using pipx:

pipx install "git+https://github.com/giorgosg/box2d-py.git"

To include the testbed:

pipx install "box2d-py[testbed] @ git+https://github.com/giorgosg/box2d-py.git"

Running the Testbed

box2d-testbed

Example Usage

from box2d import World, Vec2
# Create physics world
world = World(gravity=(0, -9.81))
# Create static ground body
ground = world.new_body().static().position((0, -5)).box(1, 10).build()
# Create dynamic bodies
bodybuilder = world.new_body().dynamic().box(0.5, 0.5)
bodies = [bodybuilder.position((x, 5)).build() for x in range(-5, 5)]
# Simulation loop
for _ in range(60):
    world.step(1/60, 4)

Development Status

⚠️ Early development preview - API subject to change
Currently supports some of the Box2D v3.0 functionality with active development ongoing.

Full API Documentation | Box2D Project

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distributions

No source distribution files available for this release.See tutorial on generating distribution archives.

Built Distributions

If you're not sure about the file name format, learn more about wheel file names.

box2d_python-0.1.1-cp312-cp312-win_amd64.whl (306.6 kB view details)

Uploaded CPython 3.12Windows x86-64

box2d_python-0.1.1-cp312-cp312-musllinux_1_2_x86_64.whl (1.6 MB view details)

Uploaded CPython 3.12musllinux: musl 1.2+ x86-64

box2d_python-0.1.1-cp312-cp312-musllinux_1_2_i686.whl (1.6 MB view details)

Uploaded CPython 3.12musllinux: musl 1.2+ i686

box2d_python-0.1.1-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (540.0 kB view details)

Uploaded CPython 3.12manylinux: glibc 2.17+ x86-64

box2d_python-0.1.1-cp312-cp312-manylinux_2_17_i686.manylinux2014_i686.whl (495.4 kB view details)

Uploaded CPython 3.12manylinux: glibc 2.17+ i686

box2d_python-0.1.1-cp312-cp312-macosx_11_0_arm64.whl (280.6 kB view details)

Uploaded CPython 3.12macOS 11.0+ ARM64

File details

Details for the file box2d_python-0.1.1-cp312-cp312-win_amd64.whl.

File metadata

File hashes

Hashes for box2d_python-0.1.1-cp312-cp312-win_amd64.whl
Algorithm Hash digest
SHA256 d5b0440b99252a6e285decd4a78684acfb69a31a7d9a4f85d3e6bf7b2f91323f
MD5 1acc7823018c7325243431115ed660f2
BLAKE2b-256 79998cbd23010a4f22431b8377f6cc6f1e97809fbf24c724b88664e07fd1fd96

See more details on using hashes here.

File details

Details for the file box2d_python-0.1.1-cp312-cp312-musllinux_1_2_x86_64.whl.

File metadata

File hashes

Hashes for box2d_python-0.1.1-cp312-cp312-musllinux_1_2_x86_64.whl
Algorithm Hash digest
SHA256 0858d1b7a083b000401b747a2fe61ea38392ebdf6670b03c994f02cc4c259448
MD5 22559e4b11affac43f94b7a0b4684f1a
BLAKE2b-256 69bfdfdc863875f7a260d0dbc4373714d407f5dee5f133a40b2015b02f60d0b0

See more details on using hashes here.

File details

Details for the file box2d_python-0.1.1-cp312-cp312-musllinux_1_2_i686.whl.

File metadata

File hashes

Hashes for box2d_python-0.1.1-cp312-cp312-musllinux_1_2_i686.whl
Algorithm Hash digest
SHA256 ced025e874e77ddc4377710e76a41f1add6cec7d53952aa8868ccf43362a7bc3
MD5 f2813ebffb38c20c28c566a99fd2a632
BLAKE2b-256 a1cb4b567b67214ec8aef9084415206f152d57aa155c43741f8427fcef19cadc

See more details on using hashes here.

File details

Details for the file box2d_python-0.1.1-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for box2d_python-0.1.1-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 92c28a9907f84830284f72b5018fcfe6cab2387b4d4f73f45ab521c0432805cf
MD5 95ac3159d457c7681f6e20acd064b6a5
BLAKE2b-256 4563e0859efff5a73bf11434b3fb50d24dd13923a73d45a024a8dd5e7be6a3af

See more details on using hashes here.

File details

Details for the file box2d_python-0.1.1-cp312-cp312-manylinux_2_17_i686.manylinux2014_i686.whl.

File metadata

File hashes

Hashes for box2d_python-0.1.1-cp312-cp312-manylinux_2_17_i686.manylinux2014_i686.whl
Algorithm Hash digest
SHA256 dd27d7ea9b0a16abc7d36aef8eef662e7e2343e1f5867bf8fdc98fc5e7ba28a5
MD5 6af370556a64f9d11dc61c49b8a4d78b
BLAKE2b-256 5673e55271873c15a964405acfce1e8579fa602b85ddf58406a45e8c78b2ba07

See more details on using hashes here.

File details

Details for the file box2d_python-0.1.1-cp312-cp312-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for box2d_python-0.1.1-cp312-cp312-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 0832cba05fa0eaf963930c2350345a7de07d384cbc56acb3e557b2dcb1b8c102
MD5 d5dcb6e7e2762c45931249d92660da4d
BLAKE2b-256 0b21e6a915eb7766d104173604797ebafb29a762c67ef94bf0cc99bf7e596799

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page