diff options
Diffstat (limited to 'scene/2d/gpu_particles_2d.cpp')
-rw-r--r-- | scene/2d/gpu_particles_2d.cpp | 18 |
1 files changed, 9 insertions, 9 deletions
diff --git a/scene/2d/gpu_particles_2d.cpp b/scene/2d/gpu_particles_2d.cpp index 4739d3dd46..58525c6954 100644 --- a/scene/2d/gpu_particles_2d.cpp +++ b/scene/2d/gpu_particles_2d.cpp @@ -81,12 +81,12 @@ void GPUParticles2D::set_pre_process_time(double p_time) { RS::get_singleton()->particles_set_pre_process_time(particles, pre_process_time); } -void GPUParticles2D::set_explosiveness_ratio(float p_ratio) { +void GPUParticles2D::set_explosiveness_ratio(real_t p_ratio) { explosiveness_ratio = p_ratio; RS::get_singleton()->particles_set_explosiveness_ratio(particles, explosiveness_ratio); } -void GPUParticles2D::set_randomness_ratio(float p_ratio) { +void GPUParticles2D::set_randomness_ratio(real_t p_ratio) { randomness_ratio = p_ratio; RS::get_singleton()->particles_set_randomness_ratio(particles, randomness_ratio); } @@ -176,7 +176,7 @@ bool GPUParticles2D::is_trail_enabled() const { return trail_enabled; } -real_t GPUParticles2D::get_trail_length() const { +double GPUParticles2D::get_trail_length() const { return trail_length; } @@ -355,19 +355,19 @@ void GPUParticles2D::_notification(int p_what) { PackedInt32Array indices; int total_segments = trail_sections * trail_section_subdivisions; - float depth = size.height * trail_sections; + real_t depth = size.height * trail_sections; for (int j = 0; j <= total_segments; j++) { - float v = j; + real_t v = j; v /= total_segments; - float y = depth * v; + real_t y = depth * v; y = (depth * 0.5) - y; int bone = j / trail_section_subdivisions; - float blend = 1.0 - float(j % trail_section_subdivisions) / float(trail_section_subdivisions); + real_t blend = 1.0 - real_t(j % trail_section_subdivisions) / real_t(trail_section_subdivisions); - float s = size.width; + real_t s = size.width; points.push_back(Vector2(-s * 0.5, 0)); points.push_back(Vector2(+s * 0.5, 0)); @@ -413,7 +413,7 @@ void GPUParticles2D::_notification(int p_what) { for (int i = 0; i <= trail_sections; i++) { Transform3D xform; /* - xform.origin.y = depth / 2.0 - size.height * float(i); + xform.origin.y = depth / 2.0 - size.height * real_t(i); xform.origin.y = -xform.origin.y; //bind is an inverse transform, so negate y */ xforms.push_back(xform); } |