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 Positions: Uses double-precision floats (float64) for world positions to prevent physics jitter in massive open worlds, while using float32 for rotations and velocities to save memory.

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.
  • Ragdolls & Skeletons: Multi-body articulated physics with active motorized poses.
  • Constraints: Fixed, Point, Hinge, Slider, Distance, Swing-Twist, 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

pip install culverin

📚 Documentation

Detailed API references for every class and method are available:

Quick Start

import culverin
import numpy as np

# Initialize the world with a capacity limit
world = culverin.PhysicsWorld(settings={"max_bodies": 1000})

# Create a static 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)
    
    # Zero-Copy Data Access
    # Wrap the internal engine memory in NumPy without copying a single byte.
    # This gives you O(1) access to all 1,000+ bodies at once.
    positions = np.frombuffer(world.positions, dtype=np.float64).reshape(-1, 4)
    
    # Print the Y position of our box
    idx = world.get_index(handle)
    print(f"Box Height: {positions[idx, 1]:.2f}m")

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)
Position Buffer Float64 (Stride 4: x, y, z, pad)
Rotation/Velocity Buffers Float32 (Stride 4: x, y, z, w/pad)
Minimum Python 3.12 (3.13t+ recommended for multi-threading)

Performance & Rendering Note

For maximum performance when updating a renderer (like OpenGL or Vulkan), do not loop through individual handles in Python. Instead, use the interpolating export method:

# Returns a single, tightly packed bytes object of Float32s 
# formatted as [px, py, pz, rx, ry, rz, rw] for every active body.
# The 'alpha' parameter (0.0 to 1.0) interpolates between the previous 
# and current physics steps for buttery-smooth rendering.
render_data = world.get_render_state(alpha=0.5)

To read data for gameplay logic, use numpy.frombuffer(world.positions, dtype=np.float64) and numpy.frombuffer(world.rotations, dtype=np.float32) to wrap the internal engine memory without making copies.

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.6.0-cp314-cp314t-win_amd64.whl (821.3 kB view details)

Uploaded CPython 3.14tWindows x86-64

culverin-0.6.0-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.6.0-cp314-cp314t-macosx_13_0_arm64.whl (1.2 MB view details)

Uploaded CPython 3.14tmacOS 13.0+ ARM64

culverin-0.6.0-cp314-cp314-win_amd64.whl (820.5 kB view details)

Uploaded CPython 3.14Windows x86-64

culverin-0.6.0-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.6.0-cp314-cp314-macosx_13_0_arm64.whl (1.2 MB view details)

Uploaded CPython 3.14macOS 13.0+ ARM64

culverin-0.6.0-cp313-cp313t-win_amd64.whl (799.3 kB view details)

Uploaded CPython 3.13tWindows x86-64

culverin-0.6.0-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.6.0-cp313-cp313t-macosx_13_0_arm64.whl (1.2 MB view details)

Uploaded CPython 3.13tmacOS 13.0+ ARM64

culverin-0.6.0-cp313-cp313-win_amd64.whl (798.9 kB view details)

Uploaded CPython 3.13Windows x86-64

culverin-0.6.0-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.6.0-cp313-cp313-macosx_13_0_arm64.whl (1.2 MB view details)

Uploaded CPython 3.13macOS 13.0+ ARM64

culverin-0.6.0-cp312-cp312-win_amd64.whl (798.9 kB view details)

Uploaded CPython 3.12Windows x86-64

culverin-0.6.0-cp312-cp312-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl (1.3 MB view details)

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

culverin-0.6.0-cp312-cp312-macosx_13_0_arm64.whl (1.2 MB view details)

Uploaded CPython 3.12macOS 13.0+ ARM64

File details

Details for the file culverin-0.6.0-cp314-cp314t-win_amd64.whl.

File metadata

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

File hashes

Hashes for culverin-0.6.0-cp314-cp314t-win_amd64.whl
Algorithm Hash digest
SHA256 d10c517afe1f29c4fbae4a5dd58a3363795132dc852794805e310397ed5c6d6e
MD5 f14f636dbc3eb752a4a20da4d8389d08
BLAKE2b-256 8ec17247a71ac2e17103b1b791c5a9d66ef34fb398e62fa94ab948cc0f14ddc0

See more details on using hashes here.

Provenance

The following attestation bundles were made for culverin-0.6.0-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.6.0-cp314-cp314t-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl.

File metadata

File hashes

Hashes for culverin-0.6.0-cp314-cp314t-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 ad7182c2addd33b0c8ee6f599764f315c3b24723116bb8ec17d8341e1df83df7
MD5 b4e615b9f9c5b9996a7101ee50a9cb32
BLAKE2b-256 9a993459c71ced353d2e495565d22f88326054b9c671e5be6f2604d57817cce2

See more details on using hashes here.

Provenance

The following attestation bundles were made for culverin-0.6.0-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.6.0-cp314-cp314t-macosx_13_0_arm64.whl.

File metadata

File hashes

Hashes for culverin-0.6.0-cp314-cp314t-macosx_13_0_arm64.whl
Algorithm Hash digest
SHA256 b2d2348060d756425854b353089229cbe7817a01b903ecd1d84f4de3c462e4d9
MD5 ef5986f43583ae4537be41d4e4609f25
BLAKE2b-256 fb1e13ce029526bde946b5deefb67b1072079e3cfcae62f2fef2338ba7b01e4d

See more details on using hashes here.

Provenance

The following attestation bundles were made for culverin-0.6.0-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.6.0-cp314-cp314-win_amd64.whl.

File metadata

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

File hashes

Hashes for culverin-0.6.0-cp314-cp314-win_amd64.whl
Algorithm Hash digest
SHA256 e4a7972386bd984a5b5a347a7157d0af08013f9b3d80b81de3c08742499fb91a
MD5 6e0ae10390a0963b59371c45157fc54e
BLAKE2b-256 2c4ca7d84a0bc002f4527cd5f6ce5f7108bdf099c717adbbc9fea8d4ba1530f3

See more details on using hashes here.

Provenance

The following attestation bundles were made for culverin-0.6.0-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.6.0-cp314-cp314-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl.

File metadata

File hashes

Hashes for culverin-0.6.0-cp314-cp314-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 87d3a98ea1828349076c678cecc0bbd0123dd75f81d1c89907fe62e023fffe90
MD5 9fd3719a73bc4552f1586b007d4dfc1f
BLAKE2b-256 31cc8ca5759103917545f1a10ef1675cb05db5dced7a17ce9889eda6bdbff5b7

See more details on using hashes here.

Provenance

The following attestation bundles were made for culverin-0.6.0-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.6.0-cp314-cp314-macosx_13_0_arm64.whl.

File metadata

File hashes

Hashes for culverin-0.6.0-cp314-cp314-macosx_13_0_arm64.whl
Algorithm Hash digest
SHA256 97d02b54140ccf116bb05ec223d5e7bf298900c70d5b39af3323283893dd08a4
MD5 f60f7402c9792e5be325ed5aa0315a32
BLAKE2b-256 a65df5d8e19b0a66c325af821da656a1869c2b02354aded3774fd5c28edcb6ba

See more details on using hashes here.

Provenance

The following attestation bundles were made for culverin-0.6.0-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.6.0-cp313-cp313t-win_amd64.whl.

File metadata

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

File hashes

Hashes for culverin-0.6.0-cp313-cp313t-win_amd64.whl
Algorithm Hash digest
SHA256 7e28efc55ae07f43a366efccfabfa3889a085071c787dea52ebe4e40087692a3
MD5 b7a81d32bccfd1bfe6a6b6b90418a0c9
BLAKE2b-256 0c78eb8dd5f540649921d55567602d1534b76f7c833dedfc2e2ee5dc49b5f8e5

See more details on using hashes here.

Provenance

The following attestation bundles were made for culverin-0.6.0-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.6.0-cp313-cp313t-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl.

File metadata

File hashes

Hashes for culverin-0.6.0-cp313-cp313t-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 7848d83191e2bdbe647c80661b932c678a356044c5912ec1a58c0404d2408e11
MD5 543c1e109e32fd596d88931611792c20
BLAKE2b-256 9ff87c9e3b17efbdc764d0e7d7e87dd545e4a3b6a68eb3d0d5dd9abe7996df6f

See more details on using hashes here.

Provenance

The following attestation bundles were made for culverin-0.6.0-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.6.0-cp313-cp313t-macosx_13_0_arm64.whl.

File metadata

File hashes

Hashes for culverin-0.6.0-cp313-cp313t-macosx_13_0_arm64.whl
Algorithm Hash digest
SHA256 3ce66dc0543cb5f038ddb471eb0a944f13776ee6ed78bfa43bf3205f4718e89b
MD5 45df63ce6ecee94d6234d60d943b13b4
BLAKE2b-256 4608b0643db7bf5c4cb426f92af8a732a3d4f5dfd2855e9e40417be2415fae85

See more details on using hashes here.

Provenance

The following attestation bundles were made for culverin-0.6.0-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.6.0-cp313-cp313-win_amd64.whl.

File metadata

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

File hashes

Hashes for culverin-0.6.0-cp313-cp313-win_amd64.whl
Algorithm Hash digest
SHA256 d12694d83361b0c08e1c252f61f33361426339abd1f89499c3b3fa398d48ddf0
MD5 cb328004ce0f1e98b48c5233bbcca378
BLAKE2b-256 f73d8b348ab7c1f64b3374719189b8c15d9dff01282e42df3954fde3c899c05f

See more details on using hashes here.

Provenance

The following attestation bundles were made for culverin-0.6.0-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.6.0-cp313-cp313-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl.

File metadata

File hashes

Hashes for culverin-0.6.0-cp313-cp313-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 ad03c69345b44ac29f0f2fce99da4b3bdc19a3d2e3422a7dbcc0a19421cadad6
MD5 ad2a3df22547ff835db13f4758f16a51
BLAKE2b-256 d8dcd3164646b4c8fcdb7a877dae8fefef29fdb95a534682f4d82eb25710b260

See more details on using hashes here.

Provenance

The following attestation bundles were made for culverin-0.6.0-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.6.0-cp313-cp313-macosx_13_0_arm64.whl.

File metadata

File hashes

Hashes for culverin-0.6.0-cp313-cp313-macosx_13_0_arm64.whl
Algorithm Hash digest
SHA256 df98d5b0e1fec786b39f0809c1ea336b3978ea5524f7db394ed94a484b8763ac
MD5 9dbd1cec953d720df45f92fa9e59eedf
BLAKE2b-256 751dde01a365cdfe9963747f70c0dffc91e2151384fccd06a85cf1c5fe1b4554

See more details on using hashes here.

Provenance

The following attestation bundles were made for culverin-0.6.0-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.

File details

Details for the file culverin-0.6.0-cp312-cp312-win_amd64.whl.

File metadata

  • Download URL: culverin-0.6.0-cp312-cp312-win_amd64.whl
  • Upload date:
  • Size: 798.9 kB
  • Tags: CPython 3.12, Windows x86-64
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for culverin-0.6.0-cp312-cp312-win_amd64.whl
Algorithm Hash digest
SHA256 a5c3031ad2c5776ca7963d41c0b5566af6ec8539642db15e7d325c724c367bf6
MD5 8d1091e617e5b109dea99088495013c5
BLAKE2b-256 c38c2f97612f5305e6b9966eef06a501d17f750b3b25de59c2d8312e1dd10dfb

See more details on using hashes here.

Provenance

The following attestation bundles were made for culverin-0.6.0-cp312-cp312-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.6.0-cp312-cp312-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl.

File metadata

File hashes

Hashes for culverin-0.6.0-cp312-cp312-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 523b782fc4b846a99e21093a37de1d0a97504fffe3506f86b45ffd4e912b06c2
MD5 fe86aa3d111b86d2d81def561ee9cffe
BLAKE2b-256 94738fcf2568b550406edd57a4741c708bf5814761fcfbb49938c7b2ea2a8c1e

See more details on using hashes here.

Provenance

The following attestation bundles were made for culverin-0.6.0-cp312-cp312-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.6.0-cp312-cp312-macosx_13_0_arm64.whl.

File metadata

File hashes

Hashes for culverin-0.6.0-cp312-cp312-macosx_13_0_arm64.whl
Algorithm Hash digest
SHA256 807d04e5a9d2ec7aa130aee2e8a5e175e1bb0cc654f6569a85ecfff24ca937d2
MD5 d1b8478ad991da18e443c51cd241a5dd
BLAKE2b-256 c106ddee6f91f12fd3798f2bd5482959c715e6c7ac2f33de124d831798910b6e

See more details on using hashes here.

Provenance

The following attestation bundles were made for culverin-0.6.0-cp312-cp312-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