]> git.cworth.org Git - akamaru/blobdiff - akamaru.h
Add new Spacer constraint and a 'dock' model.
[akamaru] / akamaru.h
index 9b544ae710d27f86f0520c03fcdfa1aa97c504a1..1646a342e6bcb2e69d2b206663249200ce6d2f47 100644 (file)
--- a/akamaru.h
+++ b/akamaru.h
@@ -12,6 +12,7 @@ typedef struct _Stick Stick;
 typedef struct _String String;
 typedef struct _Spring Spring;
 typedef struct _OffsetSpring OffsetSpring;
+typedef struct _Spacer Spacer;
 typedef struct _Polygon Polygon;
 typedef struct _Offset Offset;
 typedef struct _Model Model;
@@ -53,6 +54,11 @@ struct _OffsetSpring {
   int dx, dy;
 };
 
+struct _Spacer {
+  Object *a, *b;
+  int length;
+};
+
 struct _Polygon {
   int num_points;
   Point *points;
@@ -73,6 +79,8 @@ struct _Model {
   Spring *springs;
   int num_offset_springs;
   OffsetSpring *offset_springs;
+  int num_spacers;
+  Spacer *spacers;
   int num_polygons;
   Polygon *polygons;
   double k;
@@ -90,6 +98,7 @@ void offset_spring_init (OffsetSpring *spring,
 void spring_init (Spring *spring, Object *a, Object *b, double length);
 void stick_init (Stick *stick, Object *a, Object *b, double length);
 void string_init (String *string, Object *a, Object *b, double length);
+void spacer_init (Spacer *spacer, Object *a, Object *b, double length);
 
 void polygon_init (Polygon *p, int num_points, ...);
 void polygon_init_diamond (Polygon *polygon, double x, double y);