libanimation
libanimation copied to clipboard
Settings are not copied
Currently, one can fall into the following trap:
wobbly::Model* model = nullptr;
...
if (...) {
wobbly::Model::Settings settings;
settings.springConstant = 8.0;
settings.friction = 3.0;
settings.maximumRange = 500.0;
model = new wobbly::Model(Point(0.0, 0.0), 42.0, 42.0, settings);
}
...
model.Step(1);
When Model::Step() is called, Model::Private::mSettings will be a dangling reference.