浏览代码

Fix how Line2D obtains the other object's supports

Measure the distance from the line against the rotated object, not the
rotated line, when obtaining the object's supports against a line.
Marcel Admiraal 5 年之前
父节点
当前提交
7e44682c03
共有 1 个文件被更改,包括 1 次插入1 次删除
  1. 1 1
      servers/physics_2d/collision_solver_2d_sw.cpp

+ 1 - 1
servers/physics_2d/collision_solver_2d_sw.cpp

@@ -47,7 +47,7 @@ bool CollisionSolver2DSW::solve_static_line(const Shape2DSW *p_shape_A, const Tr
 	Vector2 supports[2];
 	Vector2 supports[2];
 	int support_count;
 	int support_count;
 
 
-	p_shape_B->get_supports(p_transform_A.affine_inverse().basis_xform(-n).normalized(), supports, support_count);
+	p_shape_B->get_supports(p_transform_B.affine_inverse().basis_xform(-n).normalized(), supports, support_count);
 
 
 	bool found = false;
 	bool found = false;