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

Code before:
	if (Object::cast_to<GPUParticlesCollisionBox3D>(sn) || Object::cast_to<GPUParticlesAttractorBox3D>(sn) || Object::cast_to<GPUParticlesAttractorVectorField3D>(sn) || Object::cast_to<GPUParticlesCollisionSDF3D>(sn) || Object::cast_to<GPUParticlesCollisionHeightField3D>(sn)) {
		helper->box_commit_handle("Change Box Shape Size", p_cancel, sn);
	}
}

void GPUParticlesCollision3DGizmoPlugin::redraw(EditorNode3DGizmo *p_gizmo) {
	Node3D *cs = p_gizmo->get_node_3d();

	p_gizmo->clear();

	Ref<Material> material;
	Ref<Material> material_internal;
	if (Object::cast_to<GPUParticlesAttractor3D>(cs)) {
		material = get_material("shape_material_attractor", p_gizmo);
		material_internal = get_material("shape_material_attractor_internal", p_gizmo);
	} else {
		material = get_material("shape_material_collision", p_gizmo);
		material_internal = get_material("shape_material_collision_internal", p_gizmo);
	}

	const Ref<Material> handles_material = get_material("handles");

	if (Object::cast_to<GPUParticlesCollisionSphere3D>(cs) || Object::cast_to<GPUParticlesAttractorSphere3D>(cs)) {
		float radius = cs->call("get_radius");

#define PUSH_QUARTER(from_x, from_y, to_x, to_y, y)      \
	points_ptrw[index++] = Vector3(from_x, y, from_y);   \
	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);      \
	points_ptrw[index++] = Vector3(-from_x, y, from_y);  \
	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)      \
	points_ptrw[index++] = Vector3(from_x, -from_y, 0);  \
	points_ptrw[index++] = Vector3(to_x, -to_y, 0);      \
	points_ptrw[index++] = Vector3(from_x, from_y, 0);   \
	points_ptrw[index++] = Vector3(to_x, to_y, 0);       \
	points_ptrw[index++] = Vector3(-from_x, -from_y, 0); \
	points_ptrw[index++] = Vector3(-to_x, -to_y, 0);     \
	points_ptrw[index++] = Vector3(-from_x, from_y, 0);  \
	points_ptrw[index++] = Vector3(-to_x, to_y, 0);

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

Review comment (suggestion):
```suggestion
#define PUSH_QUARTER(m_from_x, m_from_y, m_to_x, m_to_y, m_y)      \
```
Per macro argument naming standards, for all

Code after:
	if (Object::cast_to<GPUParticlesCollisionBox3D>(sn) || Object::cast_to<GPUParticlesAttractorBox3D>(sn) || Object::cast_to<GPUParticlesAttractorVectorField3D>(sn) || Object::cast_to<GPUParticlesCollisionSDF3D>(sn) || Object::cast_to<GPUParticlesCollisionHeightField3D>(sn)) {
		helper->box_commit_handle("Change Box Shape Size", p_cancel, sn);
	}
}

void GPUParticlesCollision3DGizmoPlugin::redraw(EditorNode3DGizmo *p_gizmo) {
	Node3D *cs = p_gizmo->get_node_3d();

	p_gizmo->clear();

	Ref<Material> material;
	Ref<Material> material_internal;
	if (Object::cast_to<GPUParticlesAttractor3D>(cs)) {
		material = get_material("shape_material_attractor", p_gizmo);
		material_internal = get_material("shape_material_attractor_internal", p_gizmo);
	} else {
		material = get_material("shape_material_collision", p_gizmo);
		material_internal = get_material("shape_material_collision_internal", p_gizmo);
	}

	const Ref<Material> handles_material = get_material("handles");

	if (Object::cast_to<GPUParticlesCollisionSphere3D>(cs) || Object::cast_to<GPUParticlesAttractorSphere3D>(cs)) {
		float radius = cs->call("get_radius");

#define PUSH_QUARTER(m_from_x, m_from_y, m_to_x, m_to_y, m_y)  \
	points_ptrw[index++] = Vector3(m_from_x, m_y, m_from_y);   \
	points_ptrw[index++] = Vector3(m_to_x, m_y, m_to_y);       \
	points_ptrw[index++] = Vector3(m_from_x, m_y, -m_from_y);  \
	points_ptrw[index++] = Vector3(m_to_x, m_y, -m_to_y);      \
	points_ptrw[index++] = Vector3(-m_from_x, m_y, m_from_y);  \
	points_ptrw[index++] = Vector3(-m_to_x, m_y, m_to_y);      \
	points_ptrw[index++] = Vector3(-m_from_x, m_y, -m_from_y); \
	points_ptrw[index++] = Vector3(-m_to_x, m_y, -m_to_y);

#define PUSH_QUARTER_XY(m_from_x, m_from_y, m_to_x, m_to_y)  \
	points_ptrw[index++] = Vector3(m_from_x, -m_from_y, 0);  \
	points_ptrw[index++] = Vector3(m_to_x, -m_to_y, 0);      \
	points_ptrw[index++] = Vector3(m_from_x, m_from_y, 0);   \
	points_ptrw[index++] = Vector3(m_to_x, m_to_y, 0);       \
	points_ptrw[index++] = Vector3(-m_from_x, -m_from_y, 0); \
	points_ptrw[index++] = Vector3(-m_to_x, -m_to_y, 0);     \
	points_ptrw[index++] = Vector3(-m_from_x, m_from_y, 0);  \
	points_ptrw[index++] = Vector3(-m_to_x, m_to_y, 0);

#define PUSH_QUARTER_YZ(m_from_x, m_from_y, m_to_x, m_to_y)  \
	points_ptrw[index++] = Vector3(0, -m_from_y, m_from_x);  \
	points_ptrw[index++] = Vector3(0, -m_to_y, m_to_x);      \
	points_ptrw[index++] = Vector3(0, m_from_y, m_from_x);   \
	points_ptrw[index++] = Vector3(0, m_to_y, m_to_x);       \
	points_ptrw[index++] = Vector3(0, -m_from_y, -m_from_x); \