dimforge / dimforge/rapier

Expose static contact softness in the JavaScript bindings

Open
#998 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
Rust
Stars
5.7k
Forks
387
Avg merge
4d 23h
Merged PRs (30d)
6

Description

Would you be open to a small PR exposing Rapier's contact softness settings through the WASM/TypeScript bindings?

Rapier 0.35 has separate `contact_softness` and `static_contact_softness` settings. The latter makes it possible to tune contacts against fixed floors and walls without also changing contacts between dynamic bodies.

The Python bindings expose both profiles, but the JavaScript bindings currently only expose the existing `contact_natural_frequency` setter. There is no access to the damping ratio or to the static-contact profile.

I'd propose exposing the natural frequency and damping ratio for both profiles on `IntegrationParameters`, while keeping the existing setter for compatibility. This would only expose the existing core settings; it wouldn't change any defaults or solver behavior.

This came up while investigating load-bearing stacks where it would be useful to tune support-to-floor contacts separately from object-to-object contacts. Since the same control is already public in core and exposed by the Python bindings, it seems useful to make it available to JavaScript users as well.

If that API shape sounds reasonable, I'm happy to put together a small PR with the WASM/TypeScript wiring and tests.

References:

- Core field: https://github.com/dimforge/rapier/blob/v0.35.0/src/dynamics/integration_parameters.rs#L202-L209
- Python binding: https://github.com/dimforge/rapier/blob/v0.35.0/python/rapier-py-3d/src/dynamics.rs#L1362-L1384
- Current TypeScript/WASM binding: https://github.com/dimforge/rapier/blob/master/typescript/src/dynamics/integration_parameters.rs

Contributor guide

Open the contributing guide

Research direction

Start in typescript/src/dynamics/integration_parameters.rs, then compare the core fields in src/dynamics/integration_parameters.rs with the existing Python binding in python/rapier-py-3d/src/dynamics.rs. Trace the current contact_natural_frequency setter and identify the binding tests to update. Done means JavaScript users can access natural frequency and damping ratio for both contact profiles while preserving the existing setter and solver behavior.

Written by the indexing model from the issue text.

Assessment

Tech stack
rust, typescript, wasm
Domain
api, game-dev
Issue type
Feature
Difficulty
3/5
Estimated time
1-2 days
Activity status
Active
Clarity
Mostly clear
Newbie friendliness
76/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.