X-Git-Url: https://git.cworth.org/git?a=blobdiff_plain;f=akamaru.h;h=cf7bf8b682412c6970706af7c020d5cd291efa1a;hb=b5f68f48302a165bed1dd5f824373189eacd85b9;hp=9b544ae710d27f86f0520c03fcdfa1aa97c504a1;hpb=4e16902eb4a956c7ea79cb4d7f7e56419ea29012;p=akamaru diff --git a/akamaru.h b/akamaru.h index 9b544ae..cf7bf8b 100644 --- a/akamaru.h +++ b/akamaru.h @@ -12,6 +12,8 @@ typedef struct _Stick Stick; 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; @@ -53,6 +55,16 @@ struct _OffsetSpring { int dx, dy; }; +struct _Spacer { + Object *a, *b; + int length; +}; + +struct _Anchor { + Object *object; + double x, y; +}; + struct _Polygon { int num_points; Point *points; @@ -73,13 +85,16 @@ struct _Model { Spring *springs; int num_offset_springs; 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; }; @@ -90,6 +105,8 @@ 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 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);