X-Git-Url: https://git.cworth.org/git?p=akamaru;a=blobdiff_plain;f=akamaru.h;fp=akamaru.h;h=cf7bf8b682412c6970706af7c020d5cd291efa1a;hp=1646a342e6bcb2e69d2b206663249200ce6d2f47;hb=4be5b6593af8db64cd39dba290a2c64193bcdabd;hpb=ac886f983a984a951187fae89c530858013ef118 diff --git a/akamaru.h b/akamaru.h index 1646a34..cf7bf8b 100644 --- a/akamaru.h +++ b/akamaru.h @@ -13,6 +13,7 @@ typedef struct _String String; typedef struct _Spring Spring; typedef struct _OffsetSpring OffsetSpring; typedef struct _Spacer Spacer; +typedef struct _Anchor Anchor; typedef struct _Polygon Polygon; typedef struct _Offset Offset; typedef struct _Model Model; @@ -59,6 +60,11 @@ struct _Spacer { int length; }; +struct _Anchor { + Object *object; + double x, y; +}; + struct _Polygon { int num_points; Point *points; @@ -81,13 +87,14 @@ struct _Model { OffsetSpring *offset_springs; int num_spacers; Spacer *spacers; + int num_anchors; + Anchor *anchors; int num_polygons; Polygon *polygons; double k; double friction; - Object *anchor_object; - Vector anchor_position; + Anchor mouse_anchor; double theta; }; @@ -99,6 +106,7 @@ 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 anchor_init (Anchor *anchor, Object *object, double x, double y); void polygon_init (Polygon *p, int num_points, ...); void polygon_init_diamond (Polygon *polygon, double x, double y);