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 _Polygon Polygon;
16 typedef struct _Offset Offset;
17 typedef struct _Model Model;
23 Point previous_position;
51 struct _OffsetSpring {
74 int num_offset_springs;
75 OffsetSpring *offset_springs;
81 Object *anchor_object;
82 Vector anchor_position;
87 void object_init (Object *object, double x, double y, double mass);
88 void offset_spring_init (OffsetSpring *spring,
89 Object *a, Object *b, double dx, double dy);
90 void spring_init (Spring *spring, Object *a, Object *b, double length);
91 void string_init (String *string, Object *a, Object *b, double length);
93 void polygon_init (Polygon *p, int num_points, ...);
94 void polygon_init_diamond (Polygon *polygon, double x, double y);
95 void polygon_init_rectangle (Polygon *polygon, double x0, double y0,
96 double x1, double y1);
98 void model_fini (Model *model);
100 void model_step (Model *model, double delta_t);
102 Object *model_find_nearest (Model *model, double x, double y);