Skip to main content

High-performance Jolt Physics bindings for Python featuring Shadow Buffers and Free-Threading support.

Project description

Culverin Physics

PyPI - Version Python Version

Culverin is a Python wrapper for the Jolt Physics engine. It is designed for 3D games and simulations that require high performance and multi-threaded execution.

Key Concepts

  • Free-Threading Support: Designed for Python 3.13t and 3.14t. The engine releases the Global Interpreter Lock (GIL) during physics updates and raycast batches.
  • Shadow Buffers: All body positions, rotations, and velocities are stored in contiguous C-arrays. You can access this data via memoryview or numpy without the overhead of creating Python objects for every body.
  • Thread-Safe API: The engine uses a priority-based locking system. Simulation steps, state mutations, and queries can run on different threads without causing deadlocks or memory corruption.
  • Generational Handles: Bodies are referenced by 64-bit handles rather than pointers. This ensures that using a handle for a deleted object will not crash the program.
  • Double-Precision Internal: Uses double-precision floats for world positions to prevent physics jitter in large environments, while mirroring data to float32 buffers for rendering efficiency.

Features

  • Standard Primitives: Box, Sphere, Capsule, Cylinder, and Plane shapes.
  • Complex Shapes: Support for Convex Hulls, Heightfields (Terrain), and static Meshes.
  • Compound Bodies: Create single bodies composed of multiple child shapes.
  • Character Controller: A virtual character controller with built-in support for climbing stairs, sliding down slopes, and pushing objects.
  • Vehicles: Support for wheeled vehicles and tracked vehicles (tanks) with physical treads and skid-steering.
  • Constraints: Fixed, Point, Hinge, Slider, Distance, and Cone constraints.
  • Queries: Efficient single and batch Raycasting, Shapecasting (sweeps), and Overlap queries.
  • Collision Events: Native event buffer for contact added, persisted, and removed events.

Installation

Building from source requires CMake and a C++ compiler (Visual Studio on Windows, GCC or Clang on Linux/macOS).

# Clone the repository including submodules
git clone --recursive https://github.com/Evilpasture/culverin.git
cd culverin

# Install the package
pip install .

If you want Python 3.14t:

# Please install build module
pip install build

# Then build your wheel. Keyword: python3.14t, and have your 3.14t interpreter activated or available in PATH. usually the Python installer manages it for you.
python3.14t -m build --wheel

# then install via the wheel. please use your actual file name.
pip install culverin-*-win_amd64.whl

Quick Start

import culverin
import numpy as np

# Initialize the world with 500 bodies capacity
world = culverin.PhysicsWorld(settings={"gravity": (0, -9.81, 0), "max_bodies": 1000})

# Create a ground plane
world.create_body(pos=(0, 0, 0), shape=culverin.SHAPE_PLANE, motion=culverin.MOTION_STATIC)

# Create a dynamic box
handle = world.create_body(pos=(0, 10, 0), size=(1, 1, 1), shape=culverin.SHAPE_BOX, motion=culverin.MOTION_DYNAMIC)

# Simulation loop
for _ in range(1000):
    world.step(1/60)
    
    # Access position directly from the shadow buffer
    idx = world.get_index(handle)
    pos = world.positions[idx * 4 : idx * 4 + 3]
    print(f"Box Height: {pos[1]}")

Technical Specifications

Spec Standard
Units Metric (1.0 = 1 meter)
Coordinate System Right-Handed (Y-Up)
Angle Units Radians
Quaternion Format (x, y, z, w)
Internal Precision Float64 (Double)
Buffer Precision Float32
Minimum Python 3.11 (3.13+ recommended for multi-threading)

Performance Note

For maximum performance when reading state, use the world.positions and world.rotations attributes. These return memoryview objects that point directly to the engine's internal memory. Use numpy.frombuffer(world.positions, dtype=np.float32) to wrap them in a NumPy array without copying the data.

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.

culverin-0.3.1b1-cp314-cp314t-win_amd64.whl (752.1 kB view details)

Uploaded CPython 3.14tWindows x86-64

culverin-0.3.1b1-cp314-cp314t-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl (1.3 MB view details)

Uploaded CPython 3.14tmanylinux: glibc 2.27+ x86-64manylinux: glibc 2.28+ x86-64

culverin-0.3.1b1-cp314-cp314t-macosx_13_0_arm64.whl (1.2 MB view details)

Uploaded CPython 3.14tmacOS 13.0+ ARM64

culverin-0.3.1b1-cp314-cp314-win_amd64.whl (753.1 kB view details)

Uploaded CPython 3.14Windows x86-64

culverin-0.3.1b1-cp314-cp314-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl (1.3 MB view details)

Uploaded CPython 3.14manylinux: glibc 2.27+ x86-64manylinux: glibc 2.28+ x86-64

culverin-0.3.1b1-cp314-cp314-macosx_13_0_arm64.whl (1.2 MB view details)

Uploaded CPython 3.14macOS 13.0+ ARM64

culverin-0.3.1b1-cp313-cp313t-win_amd64.whl (732.1 kB view details)

Uploaded CPython 3.13tWindows x86-64

culverin-0.3.1b1-cp313-cp313t-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl (1.3 MB view details)

Uploaded CPython 3.13tmanylinux: glibc 2.27+ x86-64manylinux: glibc 2.28+ x86-64

culverin-0.3.1b1-cp313-cp313t-macosx_13_0_arm64.whl (1.2 MB view details)

Uploaded CPython 3.13tmacOS 13.0+ ARM64

culverin-0.3.1b1-cp313-cp313-win_amd64.whl (733.0 kB view details)

Uploaded CPython 3.13Windows x86-64

culverin-0.3.1b1-cp313-cp313-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl (1.3 MB view details)

Uploaded CPython 3.13manylinux: glibc 2.27+ x86-64manylinux: glibc 2.28+ x86-64

culverin-0.3.1b1-cp313-cp313-macosx_13_0_arm64.whl (1.2 MB view details)

Uploaded CPython 3.13macOS 13.0+ ARM64

File details

Details for the file culverin-0.3.1b1-cp314-cp314t-win_amd64.whl.

File metadata

  • Download URL: culverin-0.3.1b1-cp314-cp314t-win_amd64.whl
  • Upload date:
  • Size: 752.1 kB
  • Tags: CPython 3.14t, Windows x86-64
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for culverin-0.3.1b1-cp314-cp314t-win_amd64.whl
Algorithm Hash digest
SHA256 03c168c3dc1393109047372de15aaf87096e6f91c1157001d4bac800fa7c2cc7
MD5 90bcb3de8d553cebf940a45449997bae
BLAKE2b-256 aadd877b88392b7376e5d6ee4117dd53b0e846c3b23e7356903e2e74266bd464

See more details on using hashes here.

Provenance

The following attestation bundles were made for culverin-0.3.1b1-cp314-cp314t-win_amd64.whl:

Publisher: build_wheels.yml on Evilpasture/Culverin

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file culverin-0.3.1b1-cp314-cp314t-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl.

File metadata

File hashes

Hashes for culverin-0.3.1b1-cp314-cp314t-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 09d7150f36325e443c65b71668eb33b986d174f3ee1168314f5f6ea006d67415
MD5 02a0dfaa227155edbf427fa9a6899ecd
BLAKE2b-256 e7e551e5d2d13f64b4d8f97f3e09fc249dda6896b2df482cdc551b01e4b58944

See more details on using hashes here.

Provenance

The following attestation bundles were made for culverin-0.3.1b1-cp314-cp314t-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl:

Publisher: build_wheels.yml on Evilpasture/Culverin

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file culverin-0.3.1b1-cp314-cp314t-macosx_13_0_arm64.whl.

File metadata

File hashes

Hashes for culverin-0.3.1b1-cp314-cp314t-macosx_13_0_arm64.whl
Algorithm Hash digest
SHA256 00f4c948c763b097b7d73b6ddcd6adc1cc5c2eb84b62e169c4304f6f0ea550c2
MD5 8b6ae5282a3deea2d14c12ee3098a098
BLAKE2b-256 861de87d220f7f286ab982644d4a0ba0912fee26e6900124e47f39e28bfe35ca

See more details on using hashes here.

Provenance

The following attestation bundles were made for culverin-0.3.1b1-cp314-cp314t-macosx_13_0_arm64.whl:

Publisher: build_wheels.yml on Evilpasture/Culverin

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file culverin-0.3.1b1-cp314-cp314-win_amd64.whl.

File metadata

  • Download URL: culverin-0.3.1b1-cp314-cp314-win_amd64.whl
  • Upload date:
  • Size: 753.1 kB
  • Tags: CPython 3.14, Windows x86-64
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for culverin-0.3.1b1-cp314-cp314-win_amd64.whl
Algorithm Hash digest
SHA256 f870554ac29ca3522a6c9c243eac48484c15a8d5d7dccbc1fccc1408552cf8e3
MD5 6ea4032ea8873879f64e70fe98c7c4ac
BLAKE2b-256 298fc035d98de7f47f60d689fd658a1279274d87cf0744b6887ffdea256e475e

See more details on using hashes here.

Provenance

The following attestation bundles were made for culverin-0.3.1b1-cp314-cp314-win_amd64.whl:

Publisher: build_wheels.yml on Evilpasture/Culverin

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file culverin-0.3.1b1-cp314-cp314-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl.

File metadata

File hashes

Hashes for culverin-0.3.1b1-cp314-cp314-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 e691d61fae5c04d6944d3ed0920bf14d982fafcbb3ea3596e6ba04885e797dbc
MD5 ec9b76633fdb70fc55d035cac03b020d
BLAKE2b-256 d907c26a182c29be4b959edae951f145c6a8d11182e666d29caf947baa0b283e

See more details on using hashes here.

Provenance

The following attestation bundles were made for culverin-0.3.1b1-cp314-cp314-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl:

Publisher: build_wheels.yml on Evilpasture/Culverin

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file culverin-0.3.1b1-cp314-cp314-macosx_13_0_arm64.whl.

File metadata

File hashes

Hashes for culverin-0.3.1b1-cp314-cp314-macosx_13_0_arm64.whl
Algorithm Hash digest
SHA256 02a4149963dbefd4a2d2d9dcb2acc7aa4aa9177f2d4359135bc31c2f955ed56d
MD5 859defd39a8163c843158ab52dcecfd5
BLAKE2b-256 9ec470d6420b5ee406e60d965d1d855e0e009fd67f0b415093b2600f3d906c0f

See more details on using hashes here.

Provenance

The following attestation bundles were made for culverin-0.3.1b1-cp314-cp314-macosx_13_0_arm64.whl:

Publisher: build_wheels.yml on Evilpasture/Culverin

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file culverin-0.3.1b1-cp313-cp313t-win_amd64.whl.

File metadata

  • Download URL: culverin-0.3.1b1-cp313-cp313t-win_amd64.whl
  • Upload date:
  • Size: 732.1 kB
  • Tags: CPython 3.13t, Windows x86-64
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for culverin-0.3.1b1-cp313-cp313t-win_amd64.whl
Algorithm Hash digest
SHA256 ebc385e4b7019a5551584b89fadb7eebc1126931b3297d736907a992a338ff6b
MD5 1e00bacd6db3905eb20e75e0efa8fdb9
BLAKE2b-256 56f5a49a1f880962e8d9e47ac35f31bcbcf297f7db2e32503cbcde4442e03ead

See more details on using hashes here.

Provenance

The following attestation bundles were made for culverin-0.3.1b1-cp313-cp313t-win_amd64.whl:

Publisher: build_wheels.yml on Evilpasture/Culverin

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file culverin-0.3.1b1-cp313-cp313t-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl.

File metadata

File hashes

Hashes for culverin-0.3.1b1-cp313-cp313t-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 5d34e1cc8ddbebcab2f34fbddae59cc86a53bec7aef0f47c13a8df3e956d4e33
MD5 878bad790ca27db639c3b3098cdf3269
BLAKE2b-256 9207a57ce00907b5acaaa18fda1c40140cfed3dfce3f6a89e3e80c44f71b50de

See more details on using hashes here.

Provenance

The following attestation bundles were made for culverin-0.3.1b1-cp313-cp313t-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl:

Publisher: build_wheels.yml on Evilpasture/Culverin

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file culverin-0.3.1b1-cp313-cp313t-macosx_13_0_arm64.whl.

File metadata

File hashes

Hashes for culverin-0.3.1b1-cp313-cp313t-macosx_13_0_arm64.whl
Algorithm Hash digest
SHA256 5d47ff48e4fa4f320c05519e75bae68374d3d4b2d3f793f1fa8deea2c31d94a5
MD5 59000ad37648273c491039aa28f12743
BLAKE2b-256 fd9fb8341016c49c7467296592693a83942819437bf82225c3d15fdbecb53519

See more details on using hashes here.

Provenance

The following attestation bundles were made for culverin-0.3.1b1-cp313-cp313t-macosx_13_0_arm64.whl:

Publisher: build_wheels.yml on Evilpasture/Culverin

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file culverin-0.3.1b1-cp313-cp313-win_amd64.whl.

File metadata

  • Download URL: culverin-0.3.1b1-cp313-cp313-win_amd64.whl
  • Upload date:
  • Size: 733.0 kB
  • Tags: CPython 3.13, Windows x86-64
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for culverin-0.3.1b1-cp313-cp313-win_amd64.whl
Algorithm Hash digest
SHA256 e120e6872ad76213b1f1dd361459378447c9a3bec9df17bb3e4c042dbbdb21e2
MD5 b560e463e29c1fe8152d9cdcb0dad79d
BLAKE2b-256 863b1a41f0e425a0be05b8fc4808ca1a67c05f70e7e89ea4c76406673ef20a09

See more details on using hashes here.

Provenance

The following attestation bundles were made for culverin-0.3.1b1-cp313-cp313-win_amd64.whl:

Publisher: build_wheels.yml on Evilpasture/Culverin

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file culverin-0.3.1b1-cp313-cp313-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl.

File metadata

File hashes

Hashes for culverin-0.3.1b1-cp313-cp313-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 964a98d6c505ca7e9707cd687c9d3f50bac47b09991a81b66f28b457a6aaaba1
MD5 1fc690fef2f587f5d5d51429404b4ce7
BLAKE2b-256 a84a54f439ea61f5a2ea01e589b420ef98b44414dd86476d896d578730722335

See more details on using hashes here.

Provenance

The following attestation bundles were made for culverin-0.3.1b1-cp313-cp313-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl:

Publisher: build_wheels.yml on Evilpasture/Culverin

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file culverin-0.3.1b1-cp313-cp313-macosx_13_0_arm64.whl.

File metadata

File hashes

Hashes for culverin-0.3.1b1-cp313-cp313-macosx_13_0_arm64.whl
Algorithm Hash digest
SHA256 6914ce1ba78e399699f52fa05808097f213992d7ae0d94b352695de7fcbb0829
MD5 5134b4660e0490c88f6546656b2c6453
BLAKE2b-256 3a1909387965e798deb5ef5ffb4bff38de4f2e4f7d7b520e757cf58726ecd5e0

See more details on using hashes here.

Provenance

The following attestation bundles were made for culverin-0.3.1b1-cp313-cp313-macosx_13_0_arm64.whl:

Publisher: build_wheels.yml on Evilpasture/Culverin

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

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