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

Uploaded CPython 3.14tWindows x86-64

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

Uploaded CPython 3.14tmacOS 13.0+ ARM64

culverin-0.5.0-cp314-cp314-win_amd64.whl (823.3 kB view details)

Uploaded CPython 3.14Windows x86-64

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

Uploaded CPython 3.14macOS 13.0+ ARM64

culverin-0.5.0-cp313-cp313t-win_amd64.whl (802.8 kB view details)

Uploaded CPython 3.13tWindows x86-64

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

Uploaded CPython 3.13tmacOS 13.0+ ARM64

culverin-0.5.0-cp313-cp313-win_amd64.whl (801.9 kB view details)

Uploaded CPython 3.13Windows x86-64

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

Uploaded CPython 3.13macOS 13.0+ ARM64

culverin-0.5.0-cp312-cp312-win_amd64.whl (800.2 kB view details)

Uploaded CPython 3.12Windows x86-64

culverin-0.5.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.5.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.5.0-cp314-cp314t-win_amd64.whl.

File metadata

  • Download URL: culverin-0.5.0-cp314-cp314t-win_amd64.whl
  • Upload date:
  • Size: 824.2 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.5.0-cp314-cp314t-win_amd64.whl
Algorithm Hash digest
SHA256 b44adc44fdedacc128c6544535825ab055203b9c70c6c0613c5d06485da867d3
MD5 b2773ad07f4a7e2d25ddd2c78a2dd320
BLAKE2b-256 1109f959e48344dd997caab0d3e617da0e7f38be7a06830643263ecb8f5254ba

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for culverin-0.5.0-cp314-cp314t-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 06c330d24f7e18be4704a5b7b2e724b2f729c14491a1b1a62e97ee74b2f2dd43
MD5 8119221ff80d42d835e45df83d8bf2fb
BLAKE2b-256 22a588acd9052e9dbf638544b1904b12c7c304cda96bcb7476995f9ead594d18

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for culverin-0.5.0-cp314-cp314t-macosx_13_0_arm64.whl
Algorithm Hash digest
SHA256 14042f38319b7b4323783f5723a924de8eb10eaf65acf869199fa509e3090a89
MD5 8eb5f0c4304d5abbef19a2d9b0e0c300
BLAKE2b-256 c7739ccb076f46211401fd92db2d2df721e522e0d8afbff6ef53577c9d356399

See more details on using hashes here.

Provenance

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

File metadata

  • Download URL: culverin-0.5.0-cp314-cp314-win_amd64.whl
  • Upload date:
  • Size: 823.3 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.5.0-cp314-cp314-win_amd64.whl
Algorithm Hash digest
SHA256 bb9df645a993efcd99513ec637afa2d2929c275eb80ba264e708aff08c2e1105
MD5 819aa437ea5113c008825a2e41d08cd9
BLAKE2b-256 992bbd5f49757c687123a5693af9b4a033fb680fc39ae07472aa4ffa440d36b3

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for culverin-0.5.0-cp314-cp314-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 8ee4e9f95d2cb5c20998def317ba9f72d06f7aba15e70d4e3763ddfc264d7776
MD5 02c3e0aa3595032709465575a9798447
BLAKE2b-256 0e44763aa08a1b7fee76737b9a596beeeaddffd590696446e5bb12345aa7a542

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for culverin-0.5.0-cp314-cp314-macosx_13_0_arm64.whl
Algorithm Hash digest
SHA256 55acb790a87831f6b656701626b5ea7d1a2475d6b4035223fff9e38ada95df94
MD5 acdcb8ad7929279ab73450a92a7e1939
BLAKE2b-256 17dbc7e39749d6035a07b86e726b264f82611dfeec221e5e2ef34b8e3ca2f1aa

See more details on using hashes here.

Provenance

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

File metadata

  • Download URL: culverin-0.5.0-cp313-cp313t-win_amd64.whl
  • Upload date:
  • Size: 802.8 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.5.0-cp313-cp313t-win_amd64.whl
Algorithm Hash digest
SHA256 4f8459cf88591100f99597c8c816c77a789a4bb2f83411c1a32851b60cdb0f2a
MD5 a02e0a41bb7340f3720c2e8c4b44b5f5
BLAKE2b-256 860d4dc20f797ef05741828e1543253561bf66d43cffcca1481d9a032412a1cd

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for culverin-0.5.0-cp313-cp313t-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 b3ef2e70aa5cf95eec0cb49884c1fbb4ef9de9bf8f9cadc341468ddd7fcf31d4
MD5 96029deb68a4d91c8bf277b33b782160
BLAKE2b-256 2c1ecb505bea59761595e533b5f2d386dce40155b4a86cf8f7ba7ff93e994940

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for culverin-0.5.0-cp313-cp313t-macosx_13_0_arm64.whl
Algorithm Hash digest
SHA256 9fd97389527dff84cda83de13b2d9fc46583b8e5ce9fd5a1b75a4c8e3a4ced29
MD5 03fee86c5987d53768b5758165332026
BLAKE2b-256 00309eafe2248d5739ad1eb4cc13424ac6e38d91b566b52a602c632f14a82db1

See more details on using hashes here.

Provenance

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

File metadata

  • Download URL: culverin-0.5.0-cp313-cp313-win_amd64.whl
  • Upload date:
  • Size: 801.9 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.5.0-cp313-cp313-win_amd64.whl
Algorithm Hash digest
SHA256 47863107ad6f357e8016b676d0962a9680614e3813184e1d7ad22e9b859df79e
MD5 0786a3b113e85034364dfeb0d6e55016
BLAKE2b-256 5fdd8fd3c830436f4255cf5e6278d509a008b23b0752e42f2cb5087ebb723c96

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for culverin-0.5.0-cp313-cp313-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 d280dbde7bd776d29c496461475b51fa1154a4110098f0fca999bc375a776406
MD5 9e6584731e7bb1b99b47a35955e1eb6f
BLAKE2b-256 0a97d147e82f434a683086be02d77f37fb8a9e721c0c7c3c57dfbf3e1b99f8a9

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for culverin-0.5.0-cp313-cp313-macosx_13_0_arm64.whl
Algorithm Hash digest
SHA256 f9dab5e5b08eeced6375280f25b6dd1ad4222d5c792ebca9654755ab935fbd48
MD5 211a5a11b72c74895adba40daa103960
BLAKE2b-256 824b6263c0274adb0b42354c8af37a8b8b969cc7dafe68e1c820be0745ce50c3

See more details on using hashes here.

Provenance

The following attestation bundles were made for culverin-0.5.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.5.0-cp312-cp312-win_amd64.whl.

File metadata

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

File hashes

Hashes for culverin-0.5.0-cp312-cp312-win_amd64.whl
Algorithm Hash digest
SHA256 36b0ce90349338f714679996f34f0e65da5a89120b2862a045435865688c8058
MD5 aa23c8696959eaf459c67a6b0cfb710b
BLAKE2b-256 4963d7269345f34de94efdd13418f94d7023199e0550e1364f03a2ca8fb19e55

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for culverin-0.5.0-cp312-cp312-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 cb8087c6b1da196c16b958b7d9d314716589035d30daa0724543de2b79eef082
MD5 1ca496962637da1ae4ab032c3d45edb4
BLAKE2b-256 bde2fa2821e4c8b39f5a2f0075e365c6e3be3ad755e6e01d170772cfee72d675

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for culverin-0.5.0-cp312-cp312-macosx_13_0_arm64.whl
Algorithm Hash digest
SHA256 457bc111fbcfd6fd78e7bc24177d8d155f02f4f57b9887c02735ab3b39f7ef4f
MD5 28d5bccfbc569b55ce23a3f793a58860
BLAKE2b-256 48df8732374c20f4192f1d2f7fd2e050655de0fc599e9c48a1cd8062d3be209e

See more details on using hashes here.

Provenance

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