About Store Forum Documentation Contact



Post Reply 
Cloth Physics
Author Message
Fex Offline
Gold Supporter

Post: #1
Cloth Physics
Cloth Physics (XPBD)
A first-party CPU cloth solver built into the engine at Engine/Source/Physics/Cloth.{h,cpp} + Engine/Source/Physics/Cloth Solver.{h,cpp}, sitting behind the existing Cloth / ClothMesh public API. Replaces NVIDIA's deprecated PhysX 3.x cloth (removed in PhysX 4+) with an XPBD (Extended Position-Based Dynamics) implementation — stable, deterministic, tunable, and owned entirely by the engine.

Core idea — each cloth is a set of mass-weighted particles connected by constraints. Per simulate(dt) the solver substeps (default 8) Jakobsen-style: semi-implicit-Euler predict → XPBD Gauss-Seidel constraint solve (Δλ = (-C - α̃λ)/(w_i+w_j+α̃), α̃ = compliance/dt²) → collision projection against author-placed balls/capsules → derive velocity from position delta. Pinned particles (inv_mass == 0) follow skeleton bones each sub-step via smooth prev↔cur lerp so fast character motion doesn't yank the cape.

[Image: Screenshot-from-2026-04-18-08-13-11.png]

[Image: Screenshot-from-2026-04-18-08-15-29.png]

In this repo: https://github.com/DrewGilpin/EsenthelEngine
See README.md for more info.
(This post was last modified: Yesterday 06:44 PM by Fex.)
Yesterday 01:56 PM
Find all posts by this user Quote this message in a reply
Esenthel Offline
Administrator

Post: #2
RE: Cloth Physics
Haha I was just thinking yesterday, about if you're going to do cloth simulation grin
Yesterday 11:00 PM
Find all posts by this user Quote this message in a reply
Fex Offline
Gold Supporter

Post: #3
RE: Cloth Physics
(Yesterday 11:00 PM)Esenthel Wrote:  Haha I was just thinking yesterday, about if you're going to do cloth simulation grin

I asked ChatGPT what features were missing from Esenthel then had Claude Code do those smile
Yesterday 11:37 PM
Find all posts by this user Quote this message in a reply
Zervox Offline
Member

Post: #4
RE: Cloth Physics
Nice, It's been a blast looking at your fork commits since your first AI code post. wink

I've personally just used AI for class separation and first past structure cleanup on my own code.
Today 01:14 AM
Find all posts by this user Quote this message in a reply
Post Reply