Merge pull request #89960 from Mknsri/fix/cylinder_face_edge_point_collision

Fix separating axes for 3D cylinder-face collisions
This commit is contained in:
Rémi Verschelde 2024-04-04 14:35:34 +02:00
commit d604899be8
No known key found for this signature in database
GPG key ID: C3336907360768E1

View file

@ -1962,7 +1962,7 @@ static void _collision_cylinder_face(const GodotShape3D *p_a, const Transform3D
// Points of B, cylinder lateral surface.
for (int i = 0; i < 3; i++) {
const Vector3 &point = vertex[i];
const Vector3 point = vertex[i] - p_transform_a.origin;
Vector3 axis = Plane(cyl_axis).project(point).normalized();
if (axis.dot(normal) < 0.0) {
axis *= -1.0;