diff options
Diffstat (limited to 'servers/physics_3d/gjk_epa.cpp')
| -rw-r--r-- | servers/physics_3d/gjk_epa.cpp | 32 | 
1 files changed, 16 insertions, 16 deletions
diff --git a/servers/physics_3d/gjk_epa.cpp b/servers/physics_3d/gjk_epa.cpp index f2f712193a..ef6535a878 100644 --- a/servers/physics_3d/gjk_epa.cpp +++ b/servers/physics_3d/gjk_epa.cpp @@ -37,7 +37,7 @@  /*  Bullet Continuous Collision Detection and Physics Library -Copyright (c) 2003-2008 Erwin Coumans  https://bulletphysics.org +Copyright (c) 2003-2008 Erwin Coumans  http://continuousphysics.com/Bullet/  This software is provided 'as-is', without any express or implied warranty.  In no event will the authors be held liable for any damages arising from the @@ -96,7 +96,7 @@ struct sResults	{  	Vector3	witnesses[2];  	Vector3	normal; -	real_t	distance; +	real_t	distance = 0.0;  };  // Shorthands @@ -105,7 +105,7 @@ typedef unsigned char	U1;  // MinkowskiDiff  struct	MinkowskiDiff { -	const Shape3DSW* m_shapes[2]; +	const GodotShape3D* m_shapes[2];  	Transform3D transform_A;  	Transform3D transform_B; @@ -113,10 +113,10 @@ struct	MinkowskiDiff {  	real_t margin_A = 0.0;  	real_t margin_B = 0.0; -	Vector3 (*get_support)(const Shape3DSW*, const Vector3&, real_t); +	Vector3 (*get_support)(const GodotShape3D*, const Vector3&, real_t); -	void Initialize(const Shape3DSW* shape0, const Transform3D& wtrs0, const real_t margin0, -		const Shape3DSW* shape1, const Transform3D& wtrs1, const real_t margin1) { +	void Initialize(const GodotShape3D* shape0, const Transform3D& wtrs0, const real_t margin0, +		const GodotShape3D* shape1, const Transform3D& wtrs1, const real_t margin1) {  		m_shapes[0]		=	shape0;  		m_shapes[1]		=	shape1;  		transform_A		=	wtrs0; @@ -131,11 +131,11 @@ struct	MinkowskiDiff {  		}  	} -	static Vector3 get_support_without_margin(const Shape3DSW* p_shape, const Vector3& p_dir, real_t p_margin) { +	static Vector3 get_support_without_margin(const GodotShape3D* p_shape, const Vector3& p_dir, real_t p_margin) {  		return p_shape->get_support(p_dir.normalized());  	} -	static Vector3 get_support_with_margin(const Shape3DSW* p_shape, const Vector3& p_dir, real_t p_margin) { +	static Vector3 get_support_with_margin(const GodotShape3D* p_shape, const Vector3& p_dir, real_t p_margin) {  		Vector3 local_dir_norm = p_dir;  		if (local_dir_norm.length_squared() < CMP_EPSILON2) {  			local_dir_norm = Vector3(-1.0, -1.0, -1.0); @@ -862,8 +862,8 @@ struct	GJK  	};  	// -	static void	Initialize(	const Shape3DSW* shape0, const Transform3D& wtrs0, real_t margin0, -		const Shape3DSW* shape1, const Transform3D& wtrs1, real_t margin1, +	static void	Initialize(	const GodotShape3D* shape0, const Transform3D& wtrs0, real_t margin0, +		const GodotShape3D* shape1, const Transform3D& wtrs1, real_t margin1,  		sResults& results,  		tShape& shape)  	{ @@ -884,10 +884,10 @@ struct	GJK  //  // -bool Distance(	const Shape3DSW*	shape0, +bool Distance(	const GodotShape3D*	shape0,  									  const Transform3D&		wtrs0,  									  real_t				margin0, -									  const Shape3DSW*		shape1, +									  const GodotShape3D*		shape1,  									  const Transform3D&		wtrs1,  									  real_t				margin1,  									  const Vector3&		guess, @@ -925,10 +925,10 @@ bool Distance(	const Shape3DSW*	shape0,  // -bool Penetration(	const Shape3DSW*	shape0, +bool Penetration(	const GodotShape3D*	shape0,  									 const Transform3D&		wtrs0,  									 real_t					margin0, -									 const Shape3DSW*		shape1, +									 const GodotShape3D*		shape1,  									 const Transform3D&		wtrs1,  									 real_t					margin1,  									 const Vector3&			guess, @@ -993,7 +993,7 @@ bool Penetration(	const Shape3DSW*	shape0,  /* clang-format on */ -bool gjk_epa_calculate_distance(const Shape3DSW *p_shape_A, const Transform3D &p_transform_A, const Shape3DSW *p_shape_B, const Transform3D &p_transform_B, Vector3 &r_result_A, Vector3 &r_result_B) { +bool gjk_epa_calculate_distance(const GodotShape3D *p_shape_A, const Transform3D &p_transform_A, const GodotShape3D *p_shape_B, const Transform3D &p_transform_B, Vector3 &r_result_A, Vector3 &r_result_B) {  	GjkEpa2::sResults res;  	if (GjkEpa2::Distance(p_shape_A, p_transform_A, 0.0, p_shape_B, p_transform_B, 0.0, p_transform_B.origin - p_transform_A.origin, res)) { @@ -1005,7 +1005,7 @@ bool gjk_epa_calculate_distance(const Shape3DSW *p_shape_A, const Transform3D &p  	return false;  } -bool gjk_epa_calculate_penetration(const Shape3DSW *p_shape_A, const Transform3D &p_transform_A, const Shape3DSW *p_shape_B, const Transform3D &p_transform_B, CollisionSolver3DSW::CallbackResult p_result_callback, void *p_userdata, bool p_swap, real_t p_margin_A, real_t p_margin_B) { +bool gjk_epa_calculate_penetration(const GodotShape3D *p_shape_A, const Transform3D &p_transform_A, const GodotShape3D *p_shape_B, const Transform3D &p_transform_B, GodotCollisionSolver3D::CallbackResult p_result_callback, void *p_userdata, bool p_swap, real_t p_margin_A, real_t p_margin_B) {  	GjkEpa2::sResults res;  	if (GjkEpa2::Penetration(p_shape_A, p_transform_A, p_margin_A, p_shape_B, p_transform_B, p_margin_B, p_transform_B.origin - p_transform_A.origin, res)) {  |