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

Uploaded CPython 3.14tWindows x86-64

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

Uploaded CPython 3.14tmacOS 13.0+ ARM64

culverin-0.4.0-cp314-cp314-win_amd64.whl (777.3 kB view details)

Uploaded CPython 3.14Windows x86-64

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

Uploaded CPython 3.14macOS 13.0+ ARM64

culverin-0.4.0-cp313-cp313t-win_amd64.whl (756.7 kB view details)

Uploaded CPython 3.13tWindows x86-64

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

Uploaded CPython 3.13tmacOS 13.0+ ARM64

culverin-0.4.0-cp313-cp313-win_amd64.whl (756.6 kB view details)

Uploaded CPython 3.13Windows x86-64

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

Uploaded CPython 3.13macOS 13.0+ ARM64

culverin-0.4.0-cp312-cp312-win_amd64.whl (755.3 kB view details)

Uploaded CPython 3.12Windows x86-64

culverin-0.4.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.4.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.4.0-cp314-cp314t-win_amd64.whl.

File metadata

  • Download URL: culverin-0.4.0-cp314-cp314t-win_amd64.whl
  • Upload date:
  • Size: 777.5 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.4.0-cp314-cp314t-win_amd64.whl
Algorithm Hash digest
SHA256 9b67c07b838197db27359b53de72ea9591681408fd9a4c148e66cf1e5511e8b6
MD5 e539972ca9620f109693041bbee3f50b
BLAKE2b-256 4333e47c3bca8744a185e973a1fc8308e8384aab6337017d9fc1002bef7ae704

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for culverin-0.4.0-cp314-cp314t-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 e20c60c99965bb4b22a295be19fe3780f52debb746a1ed41d8df029cb0770632
MD5 b0b3fd706f40d02d0c891c1dfc41d108
BLAKE2b-256 484a945b5e78bbbe404698b4d988b64d4915b981a2591d8016bf846c0baa54c8

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for culverin-0.4.0-cp314-cp314t-macosx_13_0_arm64.whl
Algorithm Hash digest
SHA256 1bcdf8adc0b0b876b35765c4cd646b170718db2e1b350fcbe184b074b5e8a670
MD5 cbdbb80d7024cace503b0c33e3ca3d7e
BLAKE2b-256 f93e826c39ea8df79f38ca2f7c08eff1e89b1cc5aa186648d5ff43a81f086335

See more details on using hashes here.

Provenance

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

File metadata

  • Download URL: culverin-0.4.0-cp314-cp314-win_amd64.whl
  • Upload date:
  • Size: 777.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.4.0-cp314-cp314-win_amd64.whl
Algorithm Hash digest
SHA256 06dbae6f8d847a16aac168d37932a0bc3e79696622b69045586e6af331b1d7e1
MD5 554dc8bd6659fb295cab4aecdf6ccfce
BLAKE2b-256 fb0974125b973840b4478b2beda8dd324d2c0b412f5df76c65b00c8315d37475

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for culverin-0.4.0-cp314-cp314-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 31e748d802929a30da267309c9c721acf303f5487f8ebb999a2df3233a1bf7cb
MD5 33cbe4f13855282ab44fab64d38f6ec7
BLAKE2b-256 e55f72ec4a2331343e085e6d84e690831cd4b9355fc52356f07be6a5fa4ad790

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for culverin-0.4.0-cp314-cp314-macosx_13_0_arm64.whl
Algorithm Hash digest
SHA256 2b93faa7cabf48dd017b046eb4945e39077f4557be21359c385a762c2b98424c
MD5 de7ecc5a59322157f8ea1c87c5f0af43
BLAKE2b-256 16432f89fce114a2864d2140aed8862e103ddb400903d743a9bb1014d5760f85

See more details on using hashes here.

Provenance

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

File metadata

  • Download URL: culverin-0.4.0-cp313-cp313t-win_amd64.whl
  • Upload date:
  • Size: 756.7 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.4.0-cp313-cp313t-win_amd64.whl
Algorithm Hash digest
SHA256 eeb3e694364c4cd36d911332c01ee9e43cb216fd311c6aff8991507c8a9227c0
MD5 642be68545a513ca016f53d9cfc08c4d
BLAKE2b-256 c83b31aef595f9f85d1d9c4da75083ea0c89205b2283f12fd9f215280f6d0732

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for culverin-0.4.0-cp313-cp313t-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 9a54e2981f8b03896df743019367a20d427fe5b2e8c8da7497c8ff170c9eedcf
MD5 717cbe32e2933c1f08dc577037e1d450
BLAKE2b-256 3a147bbcc1f354574ba7a4cf8057ffd8e17531990ffeea73b2d1fe592decc991

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for culverin-0.4.0-cp313-cp313t-macosx_13_0_arm64.whl
Algorithm Hash digest
SHA256 7a8babfbddbddc75cdf7dd9d33ea3c663fcb96919849bc8cb28162b79fb59f2d
MD5 4b7890b8755eea67796e2d5424cae939
BLAKE2b-256 d4d5bcd75200ea6b198a2fbb54bdba35d415ef90d49f265b824e66530da171cb

See more details on using hashes here.

Provenance

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

File metadata

  • Download URL: culverin-0.4.0-cp313-cp313-win_amd64.whl
  • Upload date:
  • Size: 756.6 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.4.0-cp313-cp313-win_amd64.whl
Algorithm Hash digest
SHA256 70f0323c0383561794d1a1f0b7c74a2090fc869a70f7a47808a7c5215fdbf2d0
MD5 f8cd6c9791535e8abd932753ecf0eb5c
BLAKE2b-256 516c2e5993ef2974dc156758538d3b64ef4815821ec0b8ed3b611c08d3aeaf7c

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for culverin-0.4.0-cp313-cp313-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 ac74762b94bd59f2c048b91b3b49137b2f0260e46319814d448b8cb31d38054c
MD5 fded499cc658f5f54fd8fe7d7cadf61f
BLAKE2b-256 75dbf14b71d4a08c509b572c0f2a828e56f9e49f5d0882a55e0ece8653aca10f

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for culverin-0.4.0-cp313-cp313-macosx_13_0_arm64.whl
Algorithm Hash digest
SHA256 aeef9db4f989b4ef1d1986b5345c2cebaf3d721d74a908bf316814c008c4a0fd
MD5 50c0e3a279b7fd49c0bf427db4bb43bc
BLAKE2b-256 7482160f8b7057ee7bcb60486435c393efd5ea32e6c4f6efcb818c8312fe8696

See more details on using hashes here.

Provenance

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

File metadata

  • Download URL: culverin-0.4.0-cp312-cp312-win_amd64.whl
  • Upload date:
  • Size: 755.3 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.4.0-cp312-cp312-win_amd64.whl
Algorithm Hash digest
SHA256 8a97397241ea40afaf170b48bcd7d785163684a8363d733cd35ff06ca83ce8c5
MD5 c584888249ffd33cd9b7c4375a082539
BLAKE2b-256 43c961df4ce7897ff43e47df3a4c2391f8af3898dcd3248b24a4d807c452fe59

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for culverin-0.4.0-cp312-cp312-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 0578d81c7998eaa488d9660d925faf7b4579688b115b5bc4de55a38dac69c320
MD5 c1727b3fcfa2524a5cc201d344f60865
BLAKE2b-256 fb7a8a9b955074c5461254e6dc4c80125446b03dd9cf40bbcd75c46a4ce83a9a

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for culverin-0.4.0-cp312-cp312-macosx_13_0_arm64.whl
Algorithm Hash digest
SHA256 8e8b2bf21a7cd172f2888681af9206a0273dd99781340262585f5e6fe625638e
MD5 f2499df00535a03da66bd72f2bb28228
BLAKE2b-256 52dfeb8f804d117f0e2e7b974b24084d6f33e7488a76b89983217d0e43f8fe78

See more details on using hashes here.

Provenance

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