Use a different color for GPUParticlesAttractor3D editor gizmos

This makes attractor gizmos (orange) distinguishable from
collision gizmos (blue).
This commit is contained in:
Hugo Locurcio 2022-05-16 01:45:12 +02:00
parent e8520044e7
commit d329229ad6
No known key found for this signature in database
GPG key ID: 39E8F8BE30B0A49C

View file

@ -2993,10 +2993,15 @@ void GPUParticles3DGizmoPlugin::redraw(EditorNode3DGizmo *p_gizmo) {
//// ////
GPUParticlesCollision3DGizmoPlugin::GPUParticlesCollision3DGizmoPlugin() { GPUParticlesCollision3DGizmoPlugin::GPUParticlesCollision3DGizmoPlugin() {
Color gizmo_color = EDITOR_DEF("editors/3d_gizmos/gizmo_colors/particle_collision", Color(0.5, 0.7, 1)); Color gizmo_color_attractor = EDITOR_DEF("editors/3d_gizmos/gizmo_colors/particle_attractor", Color(1, 0.7, 0.5));
create_material("shape_material", gizmo_color); create_material("shape_material_attractor", gizmo_color_attractor);
gizmo_color.a = 0.15; gizmo_color_attractor.a = 0.15;
create_material("shape_material_internal", gizmo_color); create_material("shape_material_attractor_internal", gizmo_color_attractor);
Color gizmo_color_collision = EDITOR_DEF("editors/3d_gizmos/gizmo_colors/particle_collision", Color(0.5, 0.7, 1));
create_material("shape_material_collision", gizmo_color_collision);
gizmo_color_collision.a = 0.15;
create_material("shape_material_collision_internal", gizmo_color_collision);
create_handle_material("handles"); create_handle_material("handles");
} }
@ -3122,12 +3127,17 @@ void GPUParticlesCollision3DGizmoPlugin::redraw(EditorNode3DGizmo *p_gizmo) {
p_gizmo->clear(); p_gizmo->clear();
const Ref<Material> material = Ref<Material> material;
get_material("shape_material", p_gizmo); Ref<Material> material_internal;
const Ref<Material> material_internal = if (Object::cast_to<GPUParticlesAttractor3D>(cs)) {
get_material("shape_material_internal", p_gizmo); 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);
}
Ref<Material> handles_material = get_material("handles"); const Ref<Material> handles_material = get_material("handles");
if (Object::cast_to<GPUParticlesCollisionSphere3D>(cs) || Object::cast_to<GPUParticlesAttractorSphere3D>(cs)) { if (Object::cast_to<GPUParticlesCollisionSphere3D>(cs) || Object::cast_to<GPUParticlesAttractorSphere3D>(cs)) {
float r = cs->call("get_radius"); float r = cs->call("get_radius");