Skip to content

question about the ShapeMatchingConstraint3d #3

@absolutemind

Description

@absolutemind
double wsum = 0.0;
int numParticles = Body.NumParticles;

for (int i = 0; i < numParticles; i++)
{
     RestCm += Body.Positions[i] * mass;
     wsum += mass;
}

RestCm /= wsum;

Is the result of RestCm equal to the sum of body positions?

int numParticles = Body.NumParticles;
double wsum = mass * numParticles;
for (int i = 0; i < numParticles; i++)
{
     RestCm += Body.Positions[i];
}

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