* corrections at the end instead of meaning as it goes.
*/
-#include <gtk/gtk.h>
-#include <cairo.h>
-#include <cairo-xlib.h>
-#include <gdk/gdkx.h>
+#include <glib.h>
#include <stdlib.h>
#include <string.h>
-#include <sys/time.h>
+#include <stdarg.h>
#include <math.h>
#include "akamaru.h"
const double friction = 1;
const double gravity = 20;
+void
+object_init (Object *object, double x, double y, double mass)
+{
+ object->position.x = x;
+ object->position.y = y;
+ object->previous_position.x = x;
+ object->previous_position.y = y;
+ object->mass = mass;
+}
+
+void
+spring_init (Spring *spring, Object *a, Object *b, double length)
+{
+ spring->a = a;
+ spring->b = b;
+ spring->length = length;
+}
+
+void
+stick_init (Stick *stick, Object *a, Object *b, double length)
+{
+ stick->a = a;
+ stick->b = b;
+ stick->length = length;
+}
+
+void
+string_init (String *string, Object *a, Object *b, double length)
+{
+ string->a = a;
+ string->b = b;
+ string->length = length;
+}
+
+void
+offset_spring_init (OffsetSpring *spring, Object *a, Object *b,
+ double dx, double dy)
+{
+ spring->a = a;
+ spring->b = b;
+ spring->dx = dx;
+ spring->dy = dy;
+}
+
void
polygon_init (Polygon *p, int num_points, ...)
{
model->objects[i].force.x * model->objects[i].force.x +
model->objects[i].force.y * model->objects[i].force.y;
- if (f > 1000000)
+ if (f > 100000000)
abort();
}
}