Repository: godotengine/godot
File: editor/plugins/gizmos/collision_shape_3d_gizmo_plugin.cpp (C++)

Code before:
	points_ptrw[index++] = Vector3(-to_x, y, to_y);      \
	points_ptrw[index++] = Vector3(-from_x, y, -from_y); \
	points_ptrw[index++] = Vector3(-to_x, y, -to_y);

#define PUSH_QUARTER_XY(from_x, from_y, to_x, to_y, y)       \
	points_ptrw[index++] = Vector3(from_x, -from_y - y, 0);  \
	points_ptrw[index++] = Vector3(to_x, -to_y - y, 0);      \
	points_ptrw[index++] = Vector3(from_x, from_y + y, 0);   \
	points_ptrw[index++] = Vector3(to_x, to_y + y, 0);       \
	points_ptrw[index++] = Vector3(-from_x, -from_y - y, 0); \
	points_ptrw[index++] = Vector3(-to_x, -to_y - y, 0);     \
	points_ptrw[index++] = Vector3(-from_x, from_y + y, 0);  \
	points_ptrw[index++] = Vector3(-to_x, to_y + y, 0);

#define PUSH_QUARTER_YZ(from_x, from_y, to_x, to_y, y)       \
	points_ptrw[index++] = Vector3(0, -from_y - y, from_x);  \
	points_ptrw[index++] = Vector3(0, -to_y - y, to_x);      \
	points_ptrw[index++] = Vector3(0, from_y + y, from_x);   \
	points_ptrw[index++] = Vector3(0, to_y + y, to_x);       \
	points_ptrw[index++] = Vector3(0, -from_y - y, -from_x); \
	points_ptrw[index++] = Vector3(0, -to_y - y, -to_x);     \
	points_ptrw[index++] = Vector3(0, from_y + y, -from_x);  \
	points_ptrw[index++] = Vector3(0, to_y + y, -to_x);

		// Number of points in an octant. So there will be 8 * points_in_octant * 2 points in total for one circle.
		// Correspond to the smoothness of the circle.
		const uint32_t points_in_octant = 16;
		const real_t inc = (Math_PI / (4 * points_in_octant));
		const real_t radius_squared = radius * radius;
		real_t r = 0;

		Vector<Vector3> points;
		uint32_t index = 0;
		// 3 fullCircles.
		points.resize(3 * 8 * points_in_octant * 2);
		Vector3 *points_ptrw = points.ptrw();

		float previous_x = radius;
		float previous_y = 0.f;

		for (uint32_t i = 0; i < points_in_octant; ++i) {
			r += inc;
			real_t x = Math::cos(r) * radius;
			real_t y = Math::sqrt(radius_squared - (x * x));

			PUSH_QUARTER(previous_x, previous_y, x, y, 0);
			PUSH_QUARTER(previous_y, previous_x, y, x, 0);

			PUSH_QUARTER_XY(previous_x, previous_y, x, y, 0);
			PUSH_QUARTER_XY(previous_y, previous_x, y, x, 0);


Review comment (suggestion):
```suggestion
		// Number of points in an octant. So there will be 8 * points_in_octant * 2 points in total for one circle.
		// This corresponds to the smoothness of the circle.
```

Code after:
	points_ptrw[index++] = Vector3(-to_x, y, to_y);      \
	points_ptrw[index++] = Vector3(-from_x, y, -from_y); \
	points_ptrw[index++] = Vector3(-to_x, y, -to_y);

#define PUSH_QUARTER_XY(from_x, from_y, to_x, to_y, y)       \
	points_ptrw[index++] = Vector3(from_x, -from_y - y, 0);  \
	points_ptrw[index++] = Vector3(to_x, -to_y - y, 0);      \
	points_ptrw[index++] = Vector3(from_x, from_y + y, 0);   \
	points_ptrw[index++] = Vector3(to_x, to_y + y, 0);       \
	points_ptrw[index++] = Vector3(-from_x, -from_y - y, 0); \
	points_ptrw[index++] = Vector3(-to_x, -to_y - y, 0);     \
	points_ptrw[index++] = Vector3(-from_x, from_y + y, 0);  \
	points_ptrw[index++] = Vector3(-to_x, to_y + y, 0);

#define PUSH_QUARTER_YZ(from_x, from_y, to_x, to_y, y)       \
	points_ptrw[index++] = Vector3(0, -from_y - y, from_x);  \
	points_ptrw[index++] = Vector3(0, -to_y - y, to_x);      \
	points_ptrw[index++] = Vector3(0, from_y + y, from_x);   \
	points_ptrw[index++] = Vector3(0, to_y + y, to_x);       \
	points_ptrw[index++] = Vector3(0, -from_y - y, -from_x); \
	points_ptrw[index++] = Vector3(0, -to_y - y, -to_x);     \
	points_ptrw[index++] = Vector3(0, from_y + y, -from_x);  \
	points_ptrw[index++] = Vector3(0, to_y + y, -to_x);

		// Number of points in an octant. So there will be 8 * points_in_octant * 2 points in total for one circle.
		// This Corresponds to the smoothness of the circle.
		const uint32_t points_in_octant = 16;
		const real_t inc = (Math_PI / (4 * points_in_octant));
		const real_t radius_squared = radius * radius;
		real_t r = 0;

		Vector<Vector3> points;
		uint32_t index = 0;
		// 3 full circles.
		points.resize(3 * 8 * points_in_octant * 2);
		Vector3 *points_ptrw = points.ptrw();

		float previous_x = radius;
		float previous_y = 0.f;

		for (uint32_t i = 0; i < points_in_octant; ++i) {
			r += inc;
			real_t x = Math::cos(r) * radius;
			real_t y = Math::sqrt(radius_squared - (x * x));

			PUSH_QUARTER(previous_x, previous_y, x, y, 0);
			PUSH_QUARTER(previous_y, previous_x, y, x, 0);

			PUSH_QUARTER_XY(previous_x, previous_y, x, y, 0);
			PUSH_QUARTER_XY(previous_y, previous_x, y, x, 0);