model->objects[index].position.y = y;
model->objects[index].previous_position.x = x;
model->objects[index].previous_position.y = y;
- model->objects[i].mass = 1;
+ model->objects[index].mass = 1;
if (j + 1 < num_rope_objects) {
stick_index = i * (num_rope_objects - 1) + j;
model->num_objects = num_objects;
model->springs = g_new (Spring, num_springs);
model->num_springs = num_springs;
- model->k = 0.2;
+ model->k = 2;
for (i = 0; i < num_objects; i++) {
model->objects[i].position.x = 200 + i * 20;
static void
model_init_wobbly (Model *model)
{
- const int width = 6, height = 6;
+ const int width = 4, height = 4;
const int num_objects = width * height;
const int num_offset_springs = (width - 1) * height + width * (height - 1);
- const int distance = 10;
+ const int distance = 20;
double x, y;
int i, j, object_index, spring_index;
model->num_objects = num_objects;
model->offset_springs = g_new (OffsetSpring, num_offset_springs);
model->num_offset_springs = num_offset_springs;
- model->k = 1;
+ model->k = 6.5;
model_init_polygons (model);
model->objects[object_index].position.y = y;
model->objects[object_index].previous_position.x = x;
model->objects[object_index].previous_position.y = y;
- model->objects[object_index].mass = 0.3;
+ model->objects[object_index].mass = 0;
if (i + 1 < width) {
model->offset_springs[spring_index].a = &model->objects[object_index];
{
Closure *closure = data;
- model_step (closure->model, 1);
+ model_step (closure->model, 0.4);
closure->i++;
if (closure->i == 1) {