summaryrefslogtreecommitdiff
path: root/scene
diff options
context:
space:
mode:
Diffstat (limited to 'scene')
-rw-r--r--scene/2d/particles_2d.cpp6
-rw-r--r--scene/2d/physics_body_2d.cpp4
-rw-r--r--scene/3d/baked_light_instance.cpp8
-rw-r--r--scene/3d/gi_probe.cpp8
-rw-r--r--scene/animation/animation_player.cpp4
-rw-r--r--scene/gui/range.cpp10
-rw-r--r--scene/gui/spin_box.cpp2
-rw-r--r--scene/gui/tree.cpp6
-rw-r--r--scene/resources/capsule_shape.cpp4
-rw-r--r--scene/resources/curve.cpp6
-rw-r--r--scene/resources/sphere_shape.cpp4
11 files changed, 31 insertions, 31 deletions
diff --git a/scene/2d/particles_2d.cpp b/scene/2d/particles_2d.cpp
index cd99f30f6d..1051d3f5ff 100644
--- a/scene/2d/particles_2d.cpp
+++ b/scene/2d/particles_2d.cpp
@@ -364,7 +364,7 @@ void Particles2D::_process_particles(float p_delta) {
p.rot=Math::deg2rad(param[PARAM_INITIAL_ANGLE]+param[PARAM_INITIAL_ANGLE]*randomness[PARAM_INITIAL_ANGLE]*_rand_from_seed(&rand_seed));
active_count++;
- p.frame=Math::fmod(param[PARAM_ANIM_INITIAL_POS]+randomness[PARAM_ANIM_INITIAL_POS]*_rand_from_seed(&rand_seed),1.0);
+ p.frame=Math::fmod(param[PARAM_ANIM_INITIAL_POS]+randomness[PARAM_ANIM_INITIAL_POS]*_rand_from_seed(&rand_seed),1.0f);
} else {
@@ -438,7 +438,7 @@ void Particles2D::_process_particles(float p_delta) {
p.pos+=p.velocity*frame_time;
p.rot+=Math::lerp(param[PARAM_SPIN_VELOCITY],param[PARAM_SPIN_VELOCITY]*randomness[PARAM_SPIN_VELOCITY]*_rand_from_seed(&rand_seed),randomness[PARAM_SPIN_VELOCITY])*frame_time;
float anim_spd=param[PARAM_ANIM_SPEED_SCALE]+param[PARAM_ANIM_SPEED_SCALE]*randomness[PARAM_ANIM_SPEED_SCALE]*_rand_from_seed(&rand_seed);
- p.frame=Math::fposmod(p.frame+(frame_time/lifetime)*anim_spd,1.0);
+ p.frame=Math::fposmod(p.frame+(frame_time/lifetime)*anim_spd,1.0f);
active_count++;
@@ -555,7 +555,7 @@ void Particles2D::_notification(int p_what) {
float a=color.a;
//float preh=h;
h+=huerot;
- h=Math::abs(Math::fposmod(h,1.0));
+ h=Math::abs(Math::fposmod(h,1.0f));
//print_line("rand: "+rtos(randomness[PARAM_HUE_VARIATION])+" rand: "+rtos(huerand));
//print_line(itos(i)+":hue: "+rtos(preh)+" + "+rtos(huerot)+" = "+rtos(h));
color.set_hsv(h,s,v);
diff --git a/scene/2d/physics_body_2d.cpp b/scene/2d/physics_body_2d.cpp
index feecbd9e20..96d90a1de6 100644
--- a/scene/2d/physics_body_2d.cpp
+++ b/scene/2d/physics_body_2d.cpp
@@ -1262,7 +1262,7 @@ Vector2 KinematicBody2D::move_and_slide(const Vector2& p_linear_velocity,const V
//all is a wall
move_and_slide_on_wall=true;
} else {
- if ( get_collision_normal().dot(p_floor_direction) > Math::cos(Math::deg2rad(45))) { //floor
+ if ( get_collision_normal().dot(p_floor_direction) > Math::cos(Math::deg2rad((float)45))) { //floor
move_and_slide_on_floor=true;
@@ -1272,7 +1272,7 @@ Vector2 KinematicBody2D::move_and_slide(const Vector2& p_linear_velocity,const V
revert_motion();
return Vector2();
}
- } else if ( get_collision_normal().dot(p_floor_direction) < Math::cos(Math::deg2rad(45))) { //ceiling
+ } else if ( get_collision_normal().dot(p_floor_direction) < Math::cos(Math::deg2rad((float)45))) { //ceiling
move_and_slide_on_ceiling=true;
} else {
move_and_slide_on_wall=true;
diff --git a/scene/3d/baked_light_instance.cpp b/scene/3d/baked_light_instance.cpp
index 514c73a488..b67b75d48f 100644
--- a/scene/3d/baked_light_instance.cpp
+++ b/scene/3d/baked_light_instance.cpp
@@ -389,8 +389,8 @@ void BakedLight::_plot_face(int p_idx, int p_level, const Vector3 *p_vtx, const
Vector2 uv = get_uv(intersection,p_vtx,p_uv);
- int uv_x = CLAMP(Math::fposmod(uv.x,1.0)*bake_texture_size,0,bake_texture_size-1);
- int uv_y = CLAMP(Math::fposmod(uv.y,1.0)*bake_texture_size,0,bake_texture_size-1);
+ int uv_x = CLAMP(Math::fposmod(uv.x,1.0f)*bake_texture_size,0,bake_texture_size-1);
+ int uv_y = CLAMP(Math::fposmod(uv.y,1.0f)*bake_texture_size,0,bake_texture_size-1);
int ofs = uv_y*bake_texture_size+uv_x;
albedo_accum.r+=p_material.albedo[ofs].r;
@@ -415,8 +415,8 @@ void BakedLight::_plot_face(int p_idx, int p_level, const Vector3 *p_vtx, const
Vector2 uv = get_uv(inters,p_vtx,p_uv);
- int uv_x = CLAMP(Math::fposmod(uv.x,1.0)*bake_texture_size,0,bake_texture_size-1);
- int uv_y = CLAMP(Math::fposmod(uv.y,1.0)*bake_texture_size,0,bake_texture_size-1);
+ int uv_x = CLAMP(Math::fposmod(uv.x,1.0f)*bake_texture_size,0,bake_texture_size-1);
+ int uv_y = CLAMP(Math::fposmod(uv.y,1.0f)*bake_texture_size,0,bake_texture_size-1);
int ofs = uv_y*bake_texture_size+uv_x;
diff --git a/scene/3d/gi_probe.cpp b/scene/3d/gi_probe.cpp
index 8035ce1cc7..b29ae211de 100644
--- a/scene/3d/gi_probe.cpp
+++ b/scene/3d/gi_probe.cpp
@@ -510,8 +510,8 @@ void GIProbe::_plot_face(int p_idx, int p_level,int p_x,int p_y,int p_z, const V
Vector2 uv = get_uv(intersection,p_vtx,p_uv);
- int uv_x = CLAMP(Math::fposmod(uv.x,1.0)*bake_texture_size,0,bake_texture_size-1);
- int uv_y = CLAMP(Math::fposmod(uv.y,1.0)*bake_texture_size,0,bake_texture_size-1);
+ int uv_x = CLAMP(Math::fposmod(uv.x,1.0f)*bake_texture_size,0,bake_texture_size-1);
+ int uv_y = CLAMP(Math::fposmod(uv.y,1.0f)*bake_texture_size,0,bake_texture_size-1);
int ofs = uv_y*bake_texture_size+uv_x;
albedo_accum.r+=p_material.albedo[ofs].r;
@@ -539,8 +539,8 @@ void GIProbe::_plot_face(int p_idx, int p_level,int p_x,int p_y,int p_z, const V
Vector2 uv = get_uv(inters,p_vtx,p_uv);
- int uv_x = CLAMP(Math::fposmod(uv.x,1.0)*bake_texture_size,0,bake_texture_size-1);
- int uv_y = CLAMP(Math::fposmod(uv.y,1.0)*bake_texture_size,0,bake_texture_size-1);
+ int uv_x = CLAMP(Math::fposmod(uv.x,1.0f)*bake_texture_size,0,bake_texture_size-1);
+ int uv_y = CLAMP(Math::fposmod(uv.y,1.0f)*bake_texture_size,0,bake_texture_size-1);
int ofs = uv_y*bake_texture_size+uv_x;
diff --git a/scene/animation/animation_player.cpp b/scene/animation/animation_player.cpp
index 7fa8458fe9..958b065881 100644
--- a/scene/animation/animation_player.cpp
+++ b/scene/animation/animation_player.cpp
@@ -476,7 +476,7 @@ void AnimationPlayer::_animation_process_animation(AnimationData* p_anim,float p
}
#endif
- static_cast<Node2D*>(pa->object)->set_rotation(Math::deg2rad(value));
+ static_cast<Node2D*>(pa->object)->set_rotation(Math::deg2rad((double)value));
} break;
case SP_NODE2D_SCALE: {
#ifdef DEBUG_ENABLED
@@ -690,7 +690,7 @@ void AnimationPlayer::_animation_update_transforms() {
}
#endif
- static_cast<Node2D*>(pa->object)->set_rotation(Math::deg2rad(pa->value_accum));
+ static_cast<Node2D*>(pa->object)->set_rotation(Math::deg2rad((double)pa->value_accum));
} break;
case SP_NODE2D_SCALE: {
#ifdef DEBUG_ENABLED
diff --git a/scene/gui/range.cpp b/scene/gui/range.cpp
index d5c1034c9c..5ecafccaca 100644
--- a/scene/gui/range.cpp
+++ b/scene/gui/range.cpp
@@ -141,8 +141,8 @@ void Range::set_as_ratio(double p_value) {
if (shared->exp_ratio && get_min()>0) {
- double exp_min = Math::log(get_min())/Math::log(2);
- double exp_max = Math::log(get_max())/Math::log(2);
+ double exp_min = Math::log(get_min())/Math::log((double)2);
+ double exp_max = Math::log(get_max())/Math::log((double)2);
v = Math::pow(2,exp_min+(exp_max-exp_min)*p_value);
} else {
@@ -160,9 +160,9 @@ double Range::get_as_ratio() const {
if (shared->exp_ratio && get_min()>0) {
- double exp_min = Math::log(get_min())/Math::log(2);
- double exp_max = Math::log(get_max())/Math::log(2);
- double v = Math::log(get_value())/Math::log(2);
+ double exp_min = Math::log(get_min())/Math::log((double)2);
+ double exp_max = Math::log(get_max())/Math::log((double)2);
+ double v = Math::log(get_value())/Math::log((double)2);
return (v - exp_min) / (exp_max - exp_min);
diff --git a/scene/gui/spin_box.cpp b/scene/gui/spin_box.cpp
index ec6be0d19d..8920f8f056 100644
--- a/scene/gui/spin_box.cpp
+++ b/scene/gui/spin_box.cpp
@@ -162,7 +162,7 @@ void SpinBox::_gui_input(const InputEvent& p_event) {
if (drag.enabled) {
float diff_y = drag.mouse_pos.y - cpos.y;
- diff_y=Math::pow(ABS(diff_y),1.8)*SGN(diff_y);
+ diff_y=Math::pow(ABS(diff_y),1.8f)*SGN(diff_y);
diff_y*=0.1;
drag.mouse_pos=cpos;
diff --git a/scene/gui/tree.cpp b/scene/gui/tree.cpp
index 2cfebb7c1e..c52283ecde 100644
--- a/scene/gui/tree.cpp
+++ b/scene/gui/tree.cpp
@@ -943,7 +943,7 @@ void Tree::draw_item_rect(const TreeItem::Cell& p_cell,const Rect2i& p_rect,cons
bmsize.width=p_cell.icon_max_w;
}
- p_cell.draw_icon(ci,rect.pos + Size2i(0,Math::floor((rect.size.y-bmsize.y)/2)),bmsize);
+ p_cell.draw_icon(ci,rect.pos + Size2i(0,Math::floor((real_t)(rect.size.y-bmsize.y)/2)),bmsize);
rect.pos.x+=bmsize.x+cache.hseparation;
rect.size.x-=bmsize.x+cache.hseparation;
@@ -1173,7 +1173,7 @@ int Tree::draw_item(const Point2i& p_pos,const Point2& p_draw_ofs, const Size2&
Ref<Texture> checked = cache.checked;
Ref<Texture> unchecked = cache.unchecked;
Point2i check_ofs=item_rect.pos;
- check_ofs.y+=Math::floor((item_rect.size.y-checked->get_height())/2);
+ check_ofs.y+=Math::floor((real_t)(item_rect.size.y-checked->get_height())/2);
if (p_item->cells[i].checked) {
@@ -2321,7 +2321,7 @@ void Tree::_gui_input(InputEvent p_event) {
TreeItem::Cell &c=popup_edited_item->cells[popup_edited_item_col];
float diff_y = -b.relative_y;
- diff_y=Math::pow(ABS(diff_y),1.8)*SGN(diff_y);
+ diff_y=Math::pow(ABS(diff_y),1.8f)*SGN(diff_y);
diff_y*=0.1;
range_drag_base=CLAMP(range_drag_base + c.step * diff_y, c.min, c.max);
popup_edited_item->set_range(popup_edited_item_col,range_drag_base);
diff --git a/scene/resources/capsule_shape.cpp b/scene/resources/capsule_shape.cpp
index db83a20f38..23538c1957 100644
--- a/scene/resources/capsule_shape.cpp
+++ b/scene/resources/capsule_shape.cpp
@@ -42,8 +42,8 @@ Vector<Vector3> CapsuleShape::_gen_debug_mesh_lines() {
Vector3 d(0,0,height*0.5);
for(int i=0;i<360;i++) {
- float ra=Math::deg2rad(i);
- float rb=Math::deg2rad(i+1);
+ float ra=Math::deg2rad((float)i);
+ float rb=Math::deg2rad((float)i+1);
Point2 a = Vector2(Math::sin(ra),Math::cos(ra))*radius;
Point2 b = Vector2(Math::sin(rb),Math::cos(rb))*radius;
diff --git a/scene/resources/curve.cpp b/scene/resources/curve.cpp
index e201cb16ac..3392c68e75 100644
--- a/scene/resources/curve.cpp
+++ b/scene/resources/curve.cpp
@@ -498,7 +498,7 @@ Vector2 Curve2D::interpolatef(real_t p_findex) const {
else if (p_findex>=points.size())
p_findex=points.size();
- return interpolate((int)p_findex,Math::fmod(p_findex,1.0));
+ return interpolate((int)p_findex,Math::fmod(p_findex,(real_t)1.0));
}
@@ -653,7 +653,7 @@ Vector2 Curve2D::interpolate_baked(float p_offset,bool p_cubic) const{
return r[bpc-1];
int idx = Math::floor((double)p_offset/(double)bake_interval);
- float frac = Math::fmod(p_offset,bake_interval);
+ float frac = Math::fmod(p_offset,(float)bake_interval);
if (idx>=bpc-1) {
return r[bpc-1];
@@ -974,7 +974,7 @@ Vector3 Curve3D::interpolatef(real_t p_findex) const {
else if (p_findex>=points.size())
p_findex=points.size();
- return interpolate((int)p_findex,Math::fmod(p_findex,1.0));
+ return interpolate((int)p_findex,Math::fmod(p_findex,(real_t)1.0));
}
diff --git a/scene/resources/sphere_shape.cpp b/scene/resources/sphere_shape.cpp
index bcfb164b4c..c7c4d94aad 100644
--- a/scene/resources/sphere_shape.cpp
+++ b/scene/resources/sphere_shape.cpp
@@ -37,8 +37,8 @@ Vector<Vector3> SphereShape::_gen_debug_mesh_lines() {
for(int i=0;i<=360;i++) {
- float ra=Math::deg2rad(i);
- float rb=Math::deg2rad(i+1);
+ float ra=Math::deg2rad((float)i);
+ float rb=Math::deg2rad((float)i+1);
Point2 a = Vector2(Math::sin(ra),Math::cos(ra))*r;
Point2 b = Vector2(Math::sin(rb),Math::cos(rb))*r;