XPBD achieves the same stiffness as TGS_NGS in BallAndChain and Bridge scenes using a 2×2 effective mass matrix.

Open
#23 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
4/5
Estimated time
3-5 days
Newbie friendliness
45/100
Issue type
Feature
Clarity
Mostly clear
Activity status
Stale
Tech stack
c

Research direction

Start by reproducing the BallAndChain and Bridge scenes and comparing XPBD with TGS_NGS. Then inspect the XPBD implementation and the proposed 2×2 effective mass matrix; done means XPBD reaches the same stiffness in both named scenes without regressions.

Written by the indexing model from the issue text.

Description

I found that by using for XPBD:

s2Mat22 K;
K.cx.x = mA + mB + rA.y * rA.y * iA + rB.y * rB.y * iB;
K.cy.x = -rA.y * rA.x * iA - rB.y * rB.x * iB;
K.cx.y = K.cy.x;
K.cy.y = mA + mB + rA.x * rA.x * iA + rB.x * rB.x * iB;

s2Vec2 Impulse = s2MulMV(s2GetInverse22(K),...);

XPBD in the BallAndChain and Bridge scenes can achieve the same stiffness as TGS_NGS.

Dominant language
C
Stars
237
Forks
19
PR merge metrics
No merged PRs in 30d

Getting set up

This project ships no dev container, Dockerfile or contributing guide, so setting up is up to you: start from its README, and see our first-contribution guide for the general steps.

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from erincatto/solver2d

All issues in erincatto/solver2d

Similar issues

More C issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.