4 typedef struct _xy_pair Point;
5 typedef struct _xy_pair Vector;
10 typedef struct _Object Object;
11 typedef struct _Stick Stick;
12 typedef struct _String String;
13 typedef struct _Spring Spring;
14 typedef struct _OffsetSpring OffsetSpring;
15 typedef struct _Spacer Spacer;
16 typedef struct _Polygon Polygon;
17 typedef struct _Offset Offset;
18 typedef struct _Model Model;
24 Point previous_position;
52 struct _OffsetSpring {
80 int num_offset_springs;
81 OffsetSpring *offset_springs;
89 Object *anchor_object;
90 Vector anchor_position;
95 void object_init (Object *object, double x, double y, double mass);
96 void offset_spring_init (OffsetSpring *spring,
97 Object *a, Object *b, double dx, double dy);
98 void spring_init (Spring *spring, Object *a, Object *b, double length);
99 void stick_init (Stick *stick, Object *a, Object *b, double length);
100 void string_init (String *string, Object *a, Object *b, double length);
101 void spacer_init (Spacer *spacer, Object *a, Object *b, double length);
103 void polygon_init (Polygon *p, int num_points, ...);
104 void polygon_init_diamond (Polygon *polygon, double x, double y);
105 void polygon_init_rectangle (Polygon *polygon, double x0, double y0,
106 double x1, double y1);
108 void model_fini (Model *model);
110 void model_step (Model *model, double delta_t);
112 Object *model_find_nearest (Model *model, double x, double y);