浏览代码

replace confusing code in CapsuleShape2D

golfinq 2 年之前
父节点
当前提交
e03a65fdea
共有 1 个文件被更改,包括 1 次插入2 次删除
  1. 1 2
      servers/physics_2d/godot_shape_2d.cpp

+ 1 - 2
servers/physics_2d/godot_shape_2d.cpp

@@ -373,8 +373,7 @@ void GodotCapsuleShape2D::get_supports(const Vector2 &p_normal, Vector2 *r_suppo
 	if (h > 0 && Math::abs(n.x) > segment_is_valid_support_threshold) {
 		// make it flat
 		n.y = 0.0;
-		n.normalize();
-		n *= radius;
+		n.x = SIGN(n.x) * radius;
 
 		r_amount = 2;
 		r_supports[0] = n;