Rename Curve/Curve2D/Curve3D/Gradient interpolate() to sample()
"sampling" is a more accurate term than "interpolating" for what's happening when using that function.
This commit is contained in:
@ -739,17 +739,17 @@ void CPUParticles3D::_particles_process(double p_delta) {
|
||||
|
||||
/*real_t tex_linear_velocity = 0;
|
||||
if (curve_parameters[PARAM_INITIAL_LINEAR_VELOCITY].is_valid()) {
|
||||
tex_linear_velocity = curve_parameters[PARAM_INITIAL_LINEAR_VELOCITY]->interpolate(0);
|
||||
tex_linear_velocity = curve_parameters[PARAM_INITIAL_LINEAR_VELOCITY]->sample(0);
|
||||
}*/
|
||||
|
||||
real_t tex_angle = 0.0;
|
||||
if (curve_parameters[PARAM_ANGLE].is_valid()) {
|
||||
tex_angle = curve_parameters[PARAM_ANGLE]->interpolate(tv);
|
||||
tex_angle = curve_parameters[PARAM_ANGLE]->sample(tv);
|
||||
}
|
||||
|
||||
real_t tex_anim_offset = 0.0;
|
||||
if (curve_parameters[PARAM_ANGLE].is_valid()) {
|
||||
tex_anim_offset = curve_parameters[PARAM_ANGLE]->interpolate(tv);
|
||||
tex_anim_offset = curve_parameters[PARAM_ANGLE]->sample(tv);
|
||||
}
|
||||
|
||||
p.seed = Math::rand();
|
||||
@ -907,53 +907,53 @@ void CPUParticles3D::_particles_process(double p_delta) {
|
||||
|
||||
real_t tex_linear_velocity = 1.0;
|
||||
if (curve_parameters[PARAM_INITIAL_LINEAR_VELOCITY].is_valid()) {
|
||||
tex_linear_velocity = curve_parameters[PARAM_INITIAL_LINEAR_VELOCITY]->interpolate(tv);
|
||||
tex_linear_velocity = curve_parameters[PARAM_INITIAL_LINEAR_VELOCITY]->sample(tv);
|
||||
}
|
||||
|
||||
real_t tex_orbit_velocity = 1.0;
|
||||
if (particle_flags[PARTICLE_FLAG_DISABLE_Z]) {
|
||||
if (curve_parameters[PARAM_ORBIT_VELOCITY].is_valid()) {
|
||||
tex_orbit_velocity = curve_parameters[PARAM_ORBIT_VELOCITY]->interpolate(tv);
|
||||
tex_orbit_velocity = curve_parameters[PARAM_ORBIT_VELOCITY]->sample(tv);
|
||||
}
|
||||
}
|
||||
|
||||
real_t tex_angular_velocity = 1.0;
|
||||
if (curve_parameters[PARAM_ANGULAR_VELOCITY].is_valid()) {
|
||||
tex_angular_velocity = curve_parameters[PARAM_ANGULAR_VELOCITY]->interpolate(tv);
|
||||
tex_angular_velocity = curve_parameters[PARAM_ANGULAR_VELOCITY]->sample(tv);
|
||||
}
|
||||
|
||||
real_t tex_linear_accel = 1.0;
|
||||
if (curve_parameters[PARAM_LINEAR_ACCEL].is_valid()) {
|
||||
tex_linear_accel = curve_parameters[PARAM_LINEAR_ACCEL]->interpolate(tv);
|
||||
tex_linear_accel = curve_parameters[PARAM_LINEAR_ACCEL]->sample(tv);
|
||||
}
|
||||
|
||||
real_t tex_tangential_accel = 1.0;
|
||||
if (curve_parameters[PARAM_TANGENTIAL_ACCEL].is_valid()) {
|
||||
tex_tangential_accel = curve_parameters[PARAM_TANGENTIAL_ACCEL]->interpolate(tv);
|
||||
tex_tangential_accel = curve_parameters[PARAM_TANGENTIAL_ACCEL]->sample(tv);
|
||||
}
|
||||
|
||||
real_t tex_radial_accel = 1.0;
|
||||
if (curve_parameters[PARAM_RADIAL_ACCEL].is_valid()) {
|
||||
tex_radial_accel = curve_parameters[PARAM_RADIAL_ACCEL]->interpolate(tv);
|
||||
tex_radial_accel = curve_parameters[PARAM_RADIAL_ACCEL]->sample(tv);
|
||||
}
|
||||
|
||||
real_t tex_damping = 1.0;
|
||||
if (curve_parameters[PARAM_DAMPING].is_valid()) {
|
||||
tex_damping = curve_parameters[PARAM_DAMPING]->interpolate(tv);
|
||||
tex_damping = curve_parameters[PARAM_DAMPING]->sample(tv);
|
||||
}
|
||||
|
||||
real_t tex_angle = 1.0;
|
||||
if (curve_parameters[PARAM_ANGLE].is_valid()) {
|
||||
tex_angle = curve_parameters[PARAM_ANGLE]->interpolate(tv);
|
||||
tex_angle = curve_parameters[PARAM_ANGLE]->sample(tv);
|
||||
}
|
||||
real_t tex_anim_speed = 1.0;
|
||||
if (curve_parameters[PARAM_ANIM_SPEED].is_valid()) {
|
||||
tex_anim_speed = curve_parameters[PARAM_ANIM_SPEED]->interpolate(tv);
|
||||
tex_anim_speed = curve_parameters[PARAM_ANIM_SPEED]->sample(tv);
|
||||
}
|
||||
|
||||
real_t tex_anim_offset = 1.0;
|
||||
if (curve_parameters[PARAM_ANIM_OFFSET].is_valid()) {
|
||||
tex_anim_offset = curve_parameters[PARAM_ANIM_OFFSET]->interpolate(tv);
|
||||
tex_anim_offset = curve_parameters[PARAM_ANIM_OFFSET]->sample(tv);
|
||||
}
|
||||
|
||||
Vector3 force = gravity;
|
||||
@ -1016,23 +1016,23 @@ void CPUParticles3D::_particles_process(double p_delta) {
|
||||
Vector3 tex_scale = Vector3(1.0, 1.0, 1.0);
|
||||
if (split_scale) {
|
||||
if (scale_curve_x.is_valid()) {
|
||||
tex_scale.x = scale_curve_x->interpolate(tv);
|
||||
tex_scale.x = scale_curve_x->sample(tv);
|
||||
} else {
|
||||
tex_scale.x = 1.0;
|
||||
}
|
||||
if (scale_curve_y.is_valid()) {
|
||||
tex_scale.y = scale_curve_y->interpolate(tv);
|
||||
tex_scale.y = scale_curve_y->sample(tv);
|
||||
} else {
|
||||
tex_scale.y = 1.0;
|
||||
}
|
||||
if (scale_curve_z.is_valid()) {
|
||||
tex_scale.z = scale_curve_z->interpolate(tv);
|
||||
tex_scale.z = scale_curve_z->sample(tv);
|
||||
} else {
|
||||
tex_scale.z = 1.0;
|
||||
}
|
||||
} else {
|
||||
if (curve_parameters[PARAM_SCALE].is_valid()) {
|
||||
float tmp_scale = curve_parameters[PARAM_SCALE]->interpolate(tv);
|
||||
float tmp_scale = curve_parameters[PARAM_SCALE]->sample(tv);
|
||||
tex_scale.x = tmp_scale;
|
||||
tex_scale.y = tmp_scale;
|
||||
tex_scale.z = tmp_scale;
|
||||
@ -1041,7 +1041,7 @@ void CPUParticles3D::_particles_process(double p_delta) {
|
||||
|
||||
real_t tex_hue_variation = 0.0;
|
||||
if (curve_parameters[PARAM_HUE_VARIATION].is_valid()) {
|
||||
tex_hue_variation = curve_parameters[PARAM_HUE_VARIATION]->interpolate(tv);
|
||||
tex_hue_variation = curve_parameters[PARAM_HUE_VARIATION]->sample(tv);
|
||||
}
|
||||
|
||||
real_t hue_rot_angle = (tex_hue_variation)*Math_TAU * Math::lerp(parameters_min[PARAM_HUE_VARIATION], parameters_max[PARAM_HUE_VARIATION], p.hue_rot_rand);
|
||||
|
||||
Reference in New Issue
Block a user