Skip to content

Commit

Permalink
Change default curve range for particle angles to [-1, 1]
Browse files Browse the repository at this point in the history
Fixes godotengine#91404
Curve is applied as a multiplier, so range [-1, 1] makes much more sense than [-360, 360]. Same goes for angular velocity.
  • Loading branch information
aXu-AP committed May 4, 2024
1 parent 7ebc866 commit 64f667a
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 6 deletions.
4 changes: 2 additions & 2 deletions scene/2d/cpu_particles_2d.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -346,7 +346,7 @@ void CPUParticles2D::set_param_curve(Parameter p_param, const Ref<Curve> &p_curv
//do none for this one
} break;
case PARAM_ANGULAR_VELOCITY: {
_adjust_curve_range(p_curve, -360, 360);
_adjust_curve_range(p_curve, -1, 1);
} break;
case PARAM_ORBIT_VELOCITY: {
_adjust_curve_range(p_curve, -500, 500);
Expand All @@ -364,7 +364,7 @@ void CPUParticles2D::set_param_curve(Parameter p_param, const Ref<Curve> &p_curv
_adjust_curve_range(p_curve, 0, 100);
} break;
case PARAM_ANGLE: {
_adjust_curve_range(p_curve, -360, 360);
_adjust_curve_range(p_curve, -1, 1);
} break;
case PARAM_SCALE: {
} break;
Expand Down
4 changes: 2 additions & 2 deletions scene/3d/cpu_particles_3d.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -328,7 +328,7 @@ void CPUParticles3D::set_param_curve(Parameter p_param, const Ref<Curve> &p_curv
//do none for this one
} break;
case PARAM_ANGULAR_VELOCITY: {
_adjust_curve_range(p_curve, -360, 360);
_adjust_curve_range(p_curve, -1, 1);
} break;
case PARAM_ORBIT_VELOCITY: {
_adjust_curve_range(p_curve, -500, 500);
Expand All @@ -346,7 +346,7 @@ void CPUParticles3D::set_param_curve(Parameter p_param, const Ref<Curve> &p_curv
_adjust_curve_range(p_curve, 0, 100);
} break;
case PARAM_ANGLE: {
_adjust_curve_range(p_curve, -360, 360);
_adjust_curve_range(p_curve, -1, 1);
} break;
case PARAM_SCALE: {
} break;
Expand Down
4 changes: 2 additions & 2 deletions scene/resources/particle_process_material.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1412,7 +1412,7 @@ void ParticleProcessMaterial::set_param_texture(Parameter p_param, const Ref<Tex
} break;
case PARAM_ANGULAR_VELOCITY: {
RenderingServer::get_singleton()->material_set_param(_get_material(), shader_names->angular_velocity_texture, tex_rid);
_adjust_curve_range(p_texture, -360, 360);
_adjust_curve_range(p_texture, -1, 1);
} break;
case PARAM_ORBIT_VELOCITY: {
RenderingServer::get_singleton()->material_set_param(_get_material(), shader_names->orbit_velocity_texture, tex_rid);
Expand All @@ -1437,7 +1437,7 @@ void ParticleProcessMaterial::set_param_texture(Parameter p_param, const Ref<Tex
} break;
case PARAM_ANGLE: {
RenderingServer::get_singleton()->material_set_param(_get_material(), shader_names->angle_texture, tex_rid);
_adjust_curve_range(p_texture, -360, 360);
_adjust_curve_range(p_texture, -1, 1);
} break;
case PARAM_SCALE: {
RenderingServer::get_singleton()->material_set_param(_get_material(), shader_names->scale_texture, tex_rid);
Expand Down

0 comments on commit 64f667a

Please sign in to comment.