You've already forked godot
mirror of
https://github.com/godotengine/godot.git
synced 2025-11-04 12:00:25 +00:00
Swap args of Plane(point, normal) constructor
Now (normal, point)
This commit is contained in:
@@ -819,11 +819,9 @@ Vector<Plane> Geometry3D::build_sphere_planes(real_t p_radius, int p_lats, int p
|
||||
planes.push_back(Plane(normal, p_radius));
|
||||
|
||||
for (int j = 1; j <= p_lats; j++) {
|
||||
// FIXME: This is stupid.
|
||||
Vector3 angle = normal.lerp(axis, j / (real_t)p_lats).normalized();
|
||||
Vector3 pos = angle * p_radius;
|
||||
planes.push_back(Plane(pos, angle));
|
||||
planes.push_back(Plane(pos * axis_neg, angle * axis_neg));
|
||||
Vector3 plane_normal = normal.lerp(axis, j / (real_t)p_lats).normalized();
|
||||
planes.push_back(Plane(plane_normal, p_radius));
|
||||
planes.push_back(Plane(plane_normal * axis_neg, p_radius));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -852,10 +850,10 @@ Vector<Plane> Geometry3D::build_capsule_planes(real_t p_radius, real_t p_height,
|
||||
planes.push_back(Plane(normal, p_radius));
|
||||
|
||||
for (int j = 1; j <= p_lats; j++) {
|
||||
Vector3 angle = normal.lerp(axis, j / (real_t)p_lats).normalized();
|
||||
Vector3 pos = axis * p_height * 0.5 + angle * p_radius;
|
||||
planes.push_back(Plane(pos, angle));
|
||||
planes.push_back(Plane(pos * axis_neg, angle * axis_neg));
|
||||
Vector3 plane_normal = normal.lerp(axis, j / (real_t)p_lats).normalized();
|
||||
Vector3 position = axis * p_height * 0.5 + plane_normal * p_radius;
|
||||
planes.push_back(Plane(plane_normal, position));
|
||||
planes.push_back(Plane(plane_normal * axis_neg, position * axis_neg));
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user