4 #include "cgmath/cgmath.h"
13 /* used for stringing fixed masses together */
14 struct rsim_mass *next;
19 struct rsim_mass *mass[2];
23 struct rsim_mass *masses;
25 struct rsim_spring *springs;
28 /* elements of the masses array which are fixed */
29 struct rsim_mass *fixedlist;
31 struct rsim_rope *next;
35 struct rsim_rope *ropes; /* list of ropes to simulate */
37 cgm_vec3 grav, extforce;
40 float udt; /* microstepping delta (valid if > 0) */
41 float udelta_acc; /* dt leftover accumulator for microstepping */
44 int rsim_init(struct rsim_world *rsim);
45 void rsim_destroy(struct rsim_world *rsim);
47 int rsim_add_rope(struct rsim_world *rsim, struct rsim_rope *rope);
49 void rsim_step(struct rsim_world *rsim, float dt);
51 struct rsim_rope *rsim_alloc_rope(int nmasses, int nsprings);
52 void rsim_free_rope(struct rsim_rope *rope);
53 int rsim_init_rope(struct rsim_rope *rope, int nmasses, int nsprings);
54 void rsim_destroy_rope(struct rsim_rope *rope);
56 int rsim_freeze_rope_mass(struct rsim_rope *rope, struct rsim_mass *m);
57 int rsim_unfreeze_rope_mass(struct rsim_rope *rope, struct rsim_mass *m);
59 #endif /* ROPESIM_H_ */