From f8db8a3faa30b71dca33ced38be16d3f93f43e8a Mon Sep 17 00:00:00 2001 From: Rémi Verschelde Date: Sun, 19 Mar 2017 00:36:26 +0100 Subject: Bring that Whole New World to the Old Continent too Applies the clang-format style to the 2.1 branch as done for master in 5dbf1809c6e3e905b94b8764e99491e608122261. --- scene/resources/shape_2d.cpp | 82 +++++++++++++++++++------------------------- 1 file changed, 35 insertions(+), 47 deletions(-) (limited to 'scene/resources/shape_2d.cpp') diff --git a/scene/resources/shape_2d.cpp b/scene/resources/shape_2d.cpp index 969aeb973..6f864f7f9 100644 --- a/scene/resources/shape_2d.cpp +++ b/scene/resources/shape_2d.cpp @@ -33,96 +33,84 @@ RID Shape2D::get_rid() const { return shape; } - void Shape2D::set_custom_solver_bias(real_t p_bias) { - custom_bias=p_bias; - Physics2DServer::get_singleton()->shape_set_custom_solver_bias(shape,custom_bias); + custom_bias = p_bias; + Physics2DServer::get_singleton()->shape_set_custom_solver_bias(shape, custom_bias); } -real_t Shape2D::get_custom_solver_bias() const{ +real_t Shape2D::get_custom_solver_bias() const { return custom_bias; - } +bool Shape2D::collide_with_motion(const Matrix32 &p_local_xform, const Vector2 &p_local_motion, const Ref &p_shape, const Matrix32 &p_shape_xform, const Vector2 &p_shape_motion) { -bool Shape2D::collide_with_motion(const Matrix32& p_local_xform, const Vector2& p_local_motion, const Ref& p_shape, const Matrix32& p_shape_xform, const Vector2 &p_shape_motion) { - - ERR_FAIL_COND_V(p_shape.is_null(),false); + ERR_FAIL_COND_V(p_shape.is_null(), false); int r; - return Physics2DServer::get_singleton()->shape_collide(get_rid(),p_local_xform,p_local_motion,p_shape->get_rid(),p_shape_xform,p_shape_motion,NULL,0,r); + return Physics2DServer::get_singleton()->shape_collide(get_rid(), p_local_xform, p_local_motion, p_shape->get_rid(), p_shape_xform, p_shape_motion, NULL, 0, r); } -bool Shape2D::collide(const Matrix32& p_local_xform, const Ref& p_shape, const Matrix32& p_shape_xform){ - ERR_FAIL_COND_V(p_shape.is_null(),false); +bool Shape2D::collide(const Matrix32 &p_local_xform, const Ref &p_shape, const Matrix32 &p_shape_xform) { + ERR_FAIL_COND_V(p_shape.is_null(), false); int r; - return Physics2DServer::get_singleton()->shape_collide(get_rid(),p_local_xform,Vector2(),p_shape->get_rid(),p_shape_xform,Vector2(),NULL,0,r); - - + return Physics2DServer::get_singleton()->shape_collide(get_rid(), p_local_xform, Vector2(), p_shape->get_rid(), p_shape_xform, Vector2(), NULL, 0, r); } -Variant Shape2D::collide_with_motion_and_get_contacts(const Matrix32& p_local_xform, const Vector2& p_local_motion, const Ref& p_shape, const Matrix32& p_shape_xform, const Vector2 &p_shape_motion){ +Variant Shape2D::collide_with_motion_and_get_contacts(const Matrix32 &p_local_xform, const Vector2 &p_local_motion, const Ref &p_shape, const Matrix32 &p_shape_xform, const Vector2 &p_shape_motion) { - ERR_FAIL_COND_V(p_shape.is_null(),Variant()); + ERR_FAIL_COND_V(p_shape.is_null(), Variant()); const int max_contacts = 16; - Vector2 result[max_contacts*2]; - int contacts=0; + Vector2 result[max_contacts * 2]; + int contacts = 0; - if (!Physics2DServer::get_singleton()->shape_collide(get_rid(),p_local_xform,p_local_motion,p_shape->get_rid(),p_shape_xform,p_shape_motion,result,max_contacts,contacts)) + if (!Physics2DServer::get_singleton()->shape_collide(get_rid(), p_local_xform, p_local_motion, p_shape->get_rid(), p_shape_xform, p_shape_motion, result, max_contacts, contacts)) return Variant(); Array results; - results.resize(contacts*2); - for(int i=0;i& p_shape, const Matrix32& p_shape_xform){ +Variant Shape2D::collide_and_get_contacts(const Matrix32 &p_local_xform, const Ref &p_shape, const Matrix32 &p_shape_xform) { - ERR_FAIL_COND_V(p_shape.is_null(),Variant()); + ERR_FAIL_COND_V(p_shape.is_null(), Variant()); const int max_contacts = 16; - Vector2 result[max_contacts*2]; - int contacts=0; + Vector2 result[max_contacts * 2]; + int contacts = 0; - if (!Physics2DServer::get_singleton()->shape_collide(get_rid(),p_local_xform,Vector2(),p_shape->get_rid(),p_shape_xform,Vector2(),result,max_contacts,contacts)) + if (!Physics2DServer::get_singleton()->shape_collide(get_rid(), p_local_xform, Vector2(), p_shape->get_rid(), p_shape_xform, Vector2(), result, max_contacts, contacts)) return Variant(); Array results; - results.resize(contacts*2); - for(int i=0;ifree(shape); -- cgit v1.2.3-70-g09d2