3 /* TODO: Get rid of this! */
4 #define VG_MAX_CONTACTS 256
6 typedef struct rb_ct rb_ct
;
12 float p
, bias
, norm_impulse
, tangent_impulse
[2],
13 normal_mass
, tangent_mass
[2];
17 enum contact_type type
;
19 extern rb_contact_buffer
[VG_MAX_CONTACTS
];
20 extern int rb_contact_count
;
22 int rb_capsule__sphere( m4x3f mtxA
, rb_capsule
*ca
,
23 v3f coB
, f32 rb
, rb_ct
*buf
);
24 int rb_capsule__capsule( m4x3f mtxA
, rb_capsule
*ca
,
25 m4x3f mtxB
, rb_capsule
*cb
, rb_ct
*buf
);
26 int rb_capsule__box( m4x3f mtxA
, rb_capsule
*ca
,
27 m4x3f mtxB
, m4x3f mtxB_inverse
, boxf box
,
29 int rb_sphere__box( v3f coA
, f32 ra
,
30 m4x3f mtxB
, m4x3f mtxB_inverse
, boxf box
,
32 int rb_sphere__sphere( v3f coA
, f32 ra
, v3f coB
, f32 rb
, rb_ct
*buf
);
33 int rb_sphere__triangle( m4x3f mtxA
, f32 r
, v3f tri
[3], rb_ct
*buf
);
34 int rb_capsule__triangle( m4x3f mtxA
, rb_capsule
*c
, v3f tri
[3], rb_ct
*buf
);
35 int rb_global_has_space( void );
36 rb_ct
*rb_global_buffer( void );
37 int rb_manifold_apply_filtered( rb_ct
*man
, int len
);
39 int rb_box_triangle_sat( v3f extent
, v3f center
,
40 m4x3f to_local
, v3f tri_src
[3] );
43 * Merge two contacts if they are within radius(r) of eachother
45 void rb_manifold_contact_weld( rb_ct
*ci
, rb_ct
*cj
, float r
);
46 void rb_manifold_filter_joint_edges( rb_ct
*man
, int len
, float r
);
49 * Resolve overlapping pairs
51 void rb_manifold_filter_pairs( rb_ct
*man
, int len
, float r
);
54 * Remove contacts that are facing away from A
56 void rb_manifold_filter_backface( rb_ct
*man
, int len
);
59 * Filter out duplicate coplanar results. Good for spheres.
61 void rb_manifold_filter_coplanar( rb_ct
*man
, int len
, float w
);
63 void rb_debug_contact( rb_ct
*ct
);
64 void rb_solver_reset(void);
65 rb_ct
*rb_global_ct(void);
66 void rb_prepare_contact( rb_ct
*ct
, f32 dt
);
67 void rb_depenetrate( rb_ct
*manifold
, int len
, v3f dt
);
68 void rb_presolve_contacts( rb_ct
*buffer
, f32 dt
, int len
);
69 void rb_contact_restitution( rb_ct
*ct
, float cr
);
70 void rb_solve_contacts( rb_ct
*buf
, int len
);