summaryrefslogtreecommitdiff
path: root/editor
diff options
context:
space:
mode:
Diffstat (limited to 'editor')
-rw-r--r--editor/editor_properties.cpp72
-rw-r--r--editor/import/collada.cpp34
-rw-r--r--editor/plugins/animation_player_editor_plugin.cpp2
-rw-r--r--editor/plugins/node_3d_editor_plugin.cpp24
-rw-r--r--editor/plugins/sprite_frames_editor_plugin.cpp2
-rw-r--r--editor/property_editor.cpp8
6 files changed, 71 insertions, 71 deletions
diff --git a/editor/editor_properties.cpp b/editor/editor_properties.cpp
index 2d50d25ff5..daafe095ce 100644
--- a/editor/editor_properties.cpp
+++ b/editor/editor_properties.cpp
@@ -3275,10 +3275,10 @@ bool EditorInspectorDefaultPlugin::parse_property(Object *p_object, Variant::Typ
if ((p_hint == PROPERTY_HINT_RANGE || p_hint == PROPERTY_HINT_EXP_RANGE) && p_hint_text.get_slice_count(",") >= 2) {
greater = false; //if using ranged, assume false by default
lesser = false;
- min = p_hint_text.get_slice(",", 0).to_double();
- max = p_hint_text.get_slice(",", 1).to_double();
+ min = p_hint_text.get_slice(",", 0).to_float();
+ max = p_hint_text.get_slice(",", 1).to_float();
if (p_hint_text.get_slice_count(",") >= 3) {
- step = p_hint_text.get_slice(",", 2).to_double();
+ step = p_hint_text.get_slice(",", 2).to_float();
}
hide_slider = false;
exp_range = p_hint == PROPERTY_HINT_EXP_RANGE;
@@ -3378,10 +3378,10 @@ bool EditorInspectorDefaultPlugin::parse_property(Object *p_object, Variant::Typ
bool hide_slider = true;
if (p_hint == PROPERTY_HINT_RANGE && p_hint_text.get_slice_count(",") >= 2) {
- min = p_hint_text.get_slice(",", 0).to_double();
- max = p_hint_text.get_slice(",", 1).to_double();
+ min = p_hint_text.get_slice(",", 0).to_float();
+ max = p_hint_text.get_slice(",", 1).to_float();
if (p_hint_text.get_slice_count(",") >= 3) {
- step = p_hint_text.get_slice(",", 2).to_double();
+ step = p_hint_text.get_slice(",", 2).to_float();
}
hide_slider = false;
}
@@ -3396,8 +3396,8 @@ bool EditorInspectorDefaultPlugin::parse_property(Object *p_object, Variant::Typ
bool hide_slider = true;
if (p_hint == PROPERTY_HINT_RANGE && p_hint_text.get_slice_count(",") >= 2) {
- min = p_hint_text.get_slice(",", 0).to_double();
- max = p_hint_text.get_slice(",", 1).to_double();
+ min = p_hint_text.get_slice(",", 0).to_float();
+ max = p_hint_text.get_slice(",", 1).to_float();
hide_slider = false;
}
@@ -3411,10 +3411,10 @@ bool EditorInspectorDefaultPlugin::parse_property(Object *p_object, Variant::Typ
bool hide_slider = true;
if (p_hint == PROPERTY_HINT_RANGE && p_hint_text.get_slice_count(",") >= 2) {
- min = p_hint_text.get_slice(",", 0).to_double();
- max = p_hint_text.get_slice(",", 1).to_double();
+ min = p_hint_text.get_slice(",", 0).to_float();
+ max = p_hint_text.get_slice(",", 1).to_float();
if (p_hint_text.get_slice_count(",") >= 3) {
- step = p_hint_text.get_slice(",", 2).to_double();
+ step = p_hint_text.get_slice(",", 2).to_float();
}
hide_slider = false;
}
@@ -3428,8 +3428,8 @@ bool EditorInspectorDefaultPlugin::parse_property(Object *p_object, Variant::Typ
bool hide_slider = true;
if (p_hint == PROPERTY_HINT_RANGE && p_hint_text.get_slice_count(",") >= 2) {
- min = p_hint_text.get_slice(",", 0).to_double();
- max = p_hint_text.get_slice(",", 1).to_double();
+ min = p_hint_text.get_slice(",", 0).to_float();
+ max = p_hint_text.get_slice(",", 1).to_float();
hide_slider = false;
}
@@ -3442,10 +3442,10 @@ bool EditorInspectorDefaultPlugin::parse_property(Object *p_object, Variant::Typ
bool hide_slider = true;
if (p_hint == PROPERTY_HINT_RANGE && p_hint_text.get_slice_count(",") >= 2) {
- min = p_hint_text.get_slice(",", 0).to_double();
- max = p_hint_text.get_slice(",", 1).to_double();
+ min = p_hint_text.get_slice(",", 0).to_float();
+ max = p_hint_text.get_slice(",", 1).to_float();
if (p_hint_text.get_slice_count(",") >= 3) {
- step = p_hint_text.get_slice(",", 2).to_double();
+ step = p_hint_text.get_slice(",", 2).to_float();
}
hide_slider = false;
}
@@ -3460,8 +3460,8 @@ bool EditorInspectorDefaultPlugin::parse_property(Object *p_object, Variant::Typ
bool hide_slider = true;
if (p_hint == PROPERTY_HINT_RANGE && p_hint_text.get_slice_count(",") >= 2) {
- min = p_hint_text.get_slice(",", 0).to_double();
- max = p_hint_text.get_slice(",", 1).to_double();
+ min = p_hint_text.get_slice(",", 0).to_float();
+ max = p_hint_text.get_slice(",", 1).to_float();
hide_slider = false;
}
@@ -3476,10 +3476,10 @@ bool EditorInspectorDefaultPlugin::parse_property(Object *p_object, Variant::Typ
bool hide_slider = true;
if (p_hint == PROPERTY_HINT_RANGE && p_hint_text.get_slice_count(",") >= 2) {
- min = p_hint_text.get_slice(",", 0).to_double();
- max = p_hint_text.get_slice(",", 1).to_double();
+ min = p_hint_text.get_slice(",", 0).to_float();
+ max = p_hint_text.get_slice(",", 1).to_float();
if (p_hint_text.get_slice_count(",") >= 3) {
- step = p_hint_text.get_slice(",", 2).to_double();
+ step = p_hint_text.get_slice(",", 2).to_float();
}
hide_slider = false;
}
@@ -3494,10 +3494,10 @@ bool EditorInspectorDefaultPlugin::parse_property(Object *p_object, Variant::Typ
bool hide_slider = true;
if (p_hint == PROPERTY_HINT_RANGE && p_hint_text.get_slice_count(",") >= 2) {
- min = p_hint_text.get_slice(",", 0).to_double();
- max = p_hint_text.get_slice(",", 1).to_double();
+ min = p_hint_text.get_slice(",", 0).to_float();
+ max = p_hint_text.get_slice(",", 1).to_float();
if (p_hint_text.get_slice_count(",") >= 3) {
- step = p_hint_text.get_slice(",", 2).to_double();
+ step = p_hint_text.get_slice(",", 2).to_float();
}
hide_slider = false;
}
@@ -3511,10 +3511,10 @@ bool EditorInspectorDefaultPlugin::parse_property(Object *p_object, Variant::Typ
bool hide_slider = true;
if (p_hint == PROPERTY_HINT_RANGE && p_hint_text.get_slice_count(",") >= 2) {
- min = p_hint_text.get_slice(",", 0).to_double();
- max = p_hint_text.get_slice(",", 1).to_double();
+ min = p_hint_text.get_slice(",", 0).to_float();
+ max = p_hint_text.get_slice(",", 1).to_float();
if (p_hint_text.get_slice_count(",") >= 3) {
- step = p_hint_text.get_slice(",", 2).to_double();
+ step = p_hint_text.get_slice(",", 2).to_float();
}
hide_slider = false;
}
@@ -3528,10 +3528,10 @@ bool EditorInspectorDefaultPlugin::parse_property(Object *p_object, Variant::Typ
bool hide_slider = true;
if (p_hint == PROPERTY_HINT_RANGE && p_hint_text.get_slice_count(",") >= 2) {
- min = p_hint_text.get_slice(",", 0).to_double();
- max = p_hint_text.get_slice(",", 1).to_double();
+ min = p_hint_text.get_slice(",", 0).to_float();
+ max = p_hint_text.get_slice(",", 1).to_float();
if (p_hint_text.get_slice_count(",") >= 3) {
- step = p_hint_text.get_slice(",", 2).to_double();
+ step = p_hint_text.get_slice(",", 2).to_float();
}
hide_slider = false;
}
@@ -3545,10 +3545,10 @@ bool EditorInspectorDefaultPlugin::parse_property(Object *p_object, Variant::Typ
bool hide_slider = true;
if (p_hint == PROPERTY_HINT_RANGE && p_hint_text.get_slice_count(",") >= 2) {
- min = p_hint_text.get_slice(",", 0).to_double();
- max = p_hint_text.get_slice(",", 1).to_double();
+ min = p_hint_text.get_slice(",", 0).to_float();
+ max = p_hint_text.get_slice(",", 1).to_float();
if (p_hint_text.get_slice_count(",") >= 3) {
- step = p_hint_text.get_slice(",", 2).to_double();
+ step = p_hint_text.get_slice(",", 2).to_float();
}
hide_slider = false;
}
@@ -3562,10 +3562,10 @@ bool EditorInspectorDefaultPlugin::parse_property(Object *p_object, Variant::Typ
bool hide_slider = true;
if (p_hint == PROPERTY_HINT_RANGE && p_hint_text.get_slice_count(",") >= 2) {
- min = p_hint_text.get_slice(",", 0).to_double();
- max = p_hint_text.get_slice(",", 1).to_double();
+ min = p_hint_text.get_slice(",", 0).to_float();
+ max = p_hint_text.get_slice(",", 1).to_float();
if (p_hint_text.get_slice_count(",") >= 3) {
- step = p_hint_text.get_slice(",", 2).to_double();
+ step = p_hint_text.get_slice(",", 2).to_float();
}
hide_slider = false;
}
diff --git a/editor/import/collada.cpp b/editor/import/collada.cpp
index 41e71248a9..8eb68ecdcf 100644
--- a/editor/import/collada.cpp
+++ b/editor/import/collada.cpp
@@ -262,7 +262,7 @@ void Collada::_parse_asset(XMLParser &parser) {
COLLADA_PRINT("up axis: " + parser.get_node_data());
} else if (name == "unit") {
- state.unit_scale = parser.get_attribute_value("meter").to_double();
+ state.unit_scale = parser.get_attribute_value("meter").to_float();
COLLADA_PRINT("unit scale: " + rtos(state.unit_scale));
}
@@ -433,7 +433,7 @@ Transform Collada::_read_transform(XMLParser &parser) {
Vector<float> farr;
farr.resize(16);
for (int i = 0; i < 16; i++) {
- farr.write[i] = array[i].to_double();
+ farr.write[i] = array[i].to_float();
}
return _read_transform_from_array(farr);
@@ -469,7 +469,7 @@ Variant Collada::_parse_param(XMLParser &parser) {
if (parser.get_node_name() == "float") {
parser.read();
if (parser.get_node_type() == XMLParser::NODE_TEXT) {
- data = parser.get_node_data().to_double();
+ data = parser.get_node_data().to_float();
}
} else if (parser.get_node_name() == "float2") {
Vector<float> v2 = _read_float_array(parser);
@@ -735,29 +735,29 @@ void Collada::_parse_camera(XMLParser &parser) {
camera.mode = CameraData::MODE_ORTHOGONAL;
} else if (name == "xfov") {
parser.read();
- camera.perspective.x_fov = parser.get_node_data().to_double();
+ camera.perspective.x_fov = parser.get_node_data().to_float();
} else if (name == "yfov") {
parser.read();
- camera.perspective.y_fov = parser.get_node_data().to_double();
+ camera.perspective.y_fov = parser.get_node_data().to_float();
} else if (name == "xmag") {
parser.read();
- camera.orthogonal.x_mag = parser.get_node_data().to_double();
+ camera.orthogonal.x_mag = parser.get_node_data().to_float();
} else if (name == "ymag") {
parser.read();
- camera.orthogonal.y_mag = parser.get_node_data().to_double();
+ camera.orthogonal.y_mag = parser.get_node_data().to_float();
} else if (name == "aspect_ratio") {
parser.read();
- camera.aspect = parser.get_node_data().to_double();
+ camera.aspect = parser.get_node_data().to_float();
} else if (name == "znear") {
parser.read();
- camera.z_near = parser.get_node_data().to_double();
+ camera.z_near = parser.get_node_data().to_float();
} else if (name == "zfar") {
parser.read();
- camera.z_far = parser.get_node_data().to_double();
+ camera.z_far = parser.get_node_data().to_float();
}
} else if (parser.get_node_type() == XMLParser::NODE_ELEMENT_END && parser.get_node_name() == "camera") {
@@ -806,20 +806,20 @@ void Collada::_parse_light(XMLParser &parser) {
} else if (name == "constant_attenuation") {
parser.read();
- light.constant_att = parser.get_node_data().to_double();
+ light.constant_att = parser.get_node_data().to_float();
} else if (name == "linear_attenuation") {
parser.read();
- light.linear_att = parser.get_node_data().to_double();
+ light.linear_att = parser.get_node_data().to_float();
} else if (name == "quadratic_attenuation") {
parser.read();
- light.quad_att = parser.get_node_data().to_double();
+ light.quad_att = parser.get_node_data().to_float();
} else if (name == "falloff_angle") {
parser.read();
- light.spot_angle = parser.get_node_data().to_double();
+ light.spot_angle = parser.get_node_data().to_float();
} else if (name == "falloff_exponent") {
parser.read();
- light.spot_exp = parser.get_node_data().to_double();
+ light.spot_exp = parser.get_node_data().to_float();
}
} else if (parser.get_node_type() == XMLParser::NODE_ELEMENT_END && parser.get_node_name() == "light") {
@@ -1877,10 +1877,10 @@ void Collada::_parse_animation_clip(XMLParser &parser) {
clip.name = parser.get_attribute_value("id");
}
if (parser.has_attribute("start")) {
- clip.begin = parser.get_attribute_value("start").to_double();
+ clip.begin = parser.get_attribute_value("start").to_float();
}
if (parser.has_attribute("end")) {
- clip.end = parser.get_attribute_value("end").to_double();
+ clip.end = parser.get_attribute_value("end").to_float();
}
while (parser.read() == OK) {
diff --git a/editor/plugins/animation_player_editor_plugin.cpp b/editor/plugins/animation_player_editor_plugin.cpp
index af1d266832..6e4a39d3f0 100644
--- a/editor/plugins/animation_player_editor_plugin.cpp
+++ b/editor/plugins/animation_player_editor_plugin.cpp
@@ -744,7 +744,7 @@ void AnimationPlayerEditor::_dialog_action(String p_path) {
}
void AnimationPlayerEditor::_scale_changed(const String &p_scale) {
- player->set_speed_scale(p_scale.to_double());
+ player->set_speed_scale(p_scale.to_float());
}
void AnimationPlayerEditor::_update_animation() {
diff --git a/editor/plugins/node_3d_editor_plugin.cpp b/editor/plugins/node_3d_editor_plugin.cpp
index 6f209c512e..b4b81cc7f0 100644
--- a/editor/plugins/node_3d_editor_plugin.cpp
+++ b/editor/plugins/node_3d_editor_plugin.cpp
@@ -4689,9 +4689,9 @@ void Node3DEditor::edit(Node3D *p_spatial) {
}
void Node3DEditor::_snap_changed() {
- snap_translate_value = snap_translate->get_text().to_double();
- snap_rotate_value = snap_rotate->get_text().to_double();
- snap_scale_value = snap_scale->get_text().to_double();
+ snap_translate_value = snap_translate->get_text().to_float();
+ snap_rotate_value = snap_rotate->get_text().to_float();
+ snap_scale_value = snap_scale->get_text().to_float();
}
void Node3DEditor::_snap_update() {
@@ -4708,9 +4708,9 @@ void Node3DEditor::_xform_dialog_action() {
Vector3 translate;
for (int i = 0; i < 3; i++) {
- translate[i] = xform_translate[i]->get_text().to_double();
- rotate[i] = Math::deg2rad(xform_rotate[i]->get_text().to_double());
- scale[i] = xform_scale[i]->get_text().to_double();
+ translate[i] = xform_translate[i]->get_text().to_float();
+ rotate[i] = Math::deg2rad(xform_rotate[i]->get_text().to_float());
+ scale[i] = xform_scale[i]->get_text().to_float();
}
t.basis.scale(scale);
@@ -6432,9 +6432,9 @@ Vector3 Node3DEditor::snap_point(Vector3 p_target, Vector3 p_start) const {
float Node3DEditor::get_translate_snap() const {
float snap_value;
if (Input::get_singleton()->is_key_pressed(KEY_SHIFT)) {
- snap_value = snap_translate->get_text().to_double() / 10.0;
+ snap_value = snap_translate->get_text().to_float() / 10.0;
} else {
- snap_value = snap_translate->get_text().to_double();
+ snap_value = snap_translate->get_text().to_float();
}
return snap_value;
@@ -6443,9 +6443,9 @@ float Node3DEditor::get_translate_snap() const {
float Node3DEditor::get_rotate_snap() const {
float snap_value;
if (Input::get_singleton()->is_key_pressed(KEY_SHIFT)) {
- snap_value = snap_rotate->get_text().to_double() / 3.0;
+ snap_value = snap_rotate->get_text().to_float() / 3.0;
} else {
- snap_value = snap_rotate->get_text().to_double();
+ snap_value = snap_rotate->get_text().to_float();
}
return snap_value;
@@ -6454,9 +6454,9 @@ float Node3DEditor::get_rotate_snap() const {
float Node3DEditor::get_scale_snap() const {
float snap_value;
if (Input::get_singleton()->is_key_pressed(KEY_SHIFT)) {
- snap_value = snap_scale->get_text().to_double() / 2.0;
+ snap_value = snap_scale->get_text().to_float() / 2.0;
} else {
- snap_value = snap_scale->get_text().to_double();
+ snap_value = snap_scale->get_text().to_float();
}
return snap_value;
diff --git a/editor/plugins/sprite_frames_editor_plugin.cpp b/editor/plugins/sprite_frames_editor_plugin.cpp
index 516c14329c..1073da7d8c 100644
--- a/editor/plugins/sprite_frames_editor_plugin.cpp
+++ b/editor/plugins/sprite_frames_editor_plugin.cpp
@@ -458,7 +458,7 @@ void SpriteFramesEditor::_animation_select() {
}
if (frames->has_animation(edited_anim)) {
- double value = anim_speed->get_line_edit()->get_text().to_double();
+ double value = anim_speed->get_line_edit()->get_text().to_float();
if (!Math::is_equal_approx(value, frames->get_animation_speed(edited_anim))) {
_animation_fps_changed(value);
}
diff --git a/editor/property_editor.cpp b/editor/property_editor.cpp
index c9115fb870..cb56358ae6 100644
--- a/editor/property_editor.cpp
+++ b/editor/property_editor.cpp
@@ -368,18 +368,18 @@ bool CustomPropertyEditor::edit(Object *p_owner, const String &p_name, Variant::
float min = 0, max = 100, step = type == Variant::FLOAT ? .01 : 1;
if (c >= 1) {
if (!hint_text.get_slice(",", 0).empty()) {
- min = hint_text.get_slice(",", 0).to_double();
+ min = hint_text.get_slice(",", 0).to_float();
}
}
if (c >= 2) {
if (!hint_text.get_slice(",", 1).empty()) {
- max = hint_text.get_slice(",", 1).to_double();
+ max = hint_text.get_slice(",", 1).to_float();
}
}
if (c >= 3) {
if (!hint_text.get_slice(",", 2).empty()) {
- step = hint_text.get_slice(",", 2).to_double();
+ step = hint_text.get_slice(",", 2).to_float();
}
}
@@ -1590,7 +1590,7 @@ real_t CustomPropertyEditor::_parse_real_expression(String text) {
Error err = expr->parse(text);
real_t out;
if (err != OK) {
- out = value_editor[0]->get_text().to_double();
+ out = value_editor[0]->get_text().to_float();
} else {
out = expr->execute(Array(), nullptr, false);
}