Skip to content

Question About The Distance Constraint #1

@JanHoChoi

Description

@JanHoChoi

It seems that the distance constraint function is different from the one from C++ version.
In your code:

double invMass = 1.0 / mass;
double sum = mass * 2.0;
corr = CompressionStiffness * n * (d - RestLength) * sum;
Body.Predicted[i0] += invMass * corr * di;

But in the C++ version:

Real wSum = invMass0 + invMass1;
corr = compressionStiffness * n * (d - restLength) / wSum;
corr0 =  invMass0 * corr;

The results are different even though I assume mass0 equals to mass1.
Is it a bug or something else?

And I also wonder what's the theory of your bending constraint? The C++'s bending constraint is different too.

Finally, thanks for your contribution in PBD's unity version which helps me a lot!

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions