diff options
Diffstat (limited to 'servers/physics/body_pair_sw.h')
-rw-r--r-- | servers/physics/body_pair_sw.h | 22 |
1 files changed, 9 insertions, 13 deletions
diff --git a/servers/physics/body_pair_sw.h b/servers/physics/body_pair_sw.h index f282a56b9e..fa426adafd 100644 --- a/servers/physics/body_pair_sw.h +++ b/servers/physics/body_pair_sw.h @@ -35,7 +35,7 @@ class BodyPairSW : public ConstraintSW { enum { - MAX_CONTACTS=4 + MAX_CONTACTS = 4 }; union { @@ -50,22 +50,21 @@ class BodyPairSW : public ConstraintSW { int shape_A; int shape_B; - struct Contact { Vector3 position; Vector3 normal; Vector3 local_A, local_B; - real_t acc_normal_impulse; // accumulated normal impulse (Pn) - Vector3 acc_tangent_impulse; // accumulated tangent impulse (Pt) - real_t acc_bias_impulse; // accumulated normal impulse for position bias (Pnb) + real_t acc_normal_impulse; // accumulated normal impulse (Pn) + Vector3 acc_tangent_impulse; // accumulated tangent impulse (Pt) + real_t acc_bias_impulse; // accumulated normal impulse for position bias (Pnb) real_t mass_normal; real_t bias; real_t bounce; real_t depth; bool active; - Vector3 rA,rB; // Offset in world orientation with respect to center of mass + Vector3 rA, rB; // Offset in world orientation with respect to center of mass }; Vector3 offset_B; //use local A coordinates to avoid numerical issues on collision detection @@ -76,24 +75,21 @@ class BodyPairSW : public ConstraintSW { bool collided; int cc; + static void _contact_added_callback(const Vector3 &p_point_A, const Vector3 &p_point_B, void *p_userdata); - static void _contact_added_callback(const Vector3& p_point_A,const Vector3& p_point_B,void *p_userdata); - - void contact_added_callback(const Vector3& p_point_A,const Vector3& p_point_B); + void contact_added_callback(const Vector3 &p_point_A, const Vector3 &p_point_B); void validate_contacts(); - bool _test_ccd(real_t p_step,BodySW *p_A, int p_shape_A,const Transform& p_xform_A,BodySW *p_B, int p_shape_B,const Transform& p_xform_B); + bool _test_ccd(real_t p_step, BodySW *p_A, int p_shape_A, const Transform &p_xform_A, BodySW *p_B, int p_shape_B, const Transform &p_xform_B); SpaceSW *space; public: - bool setup(real_t p_step); void solve(real_t p_step); - BodyPairSW(BodySW *p_A, int p_shape_A,BodySW *p_B, int p_shape_B); + BodyPairSW(BodySW *p_A, int p_shape_A, BodySW *p_B, int p_shape_B); ~BodyPairSW(); - }; #endif // BODY_PAIR__SW_H |