summaryrefslogtreecommitdiff
path: root/editor
diff options
context:
space:
mode:
authorRémi Verschelde <rverschelde@gmail.com>2020-05-10 16:47:11 +0200
committerRémi Verschelde <rverschelde@gmail.com>2020-05-10 16:47:11 +0200
commit94721f5ab8af9e7d91a4de58baf2c8d849ceab6e (patch)
tree92fb34d709310b76de1c2d45cfe2aad8db7a523a /editor
parent6ab92464bc6356f3342c3efd1fc1bb1a5e4467d5 (diff)
Revert "Renamed plane's d to distance"
This reverts commit ec7b481170dcd6a7b4cf0e6c1221e204ff7945f3. This was wrong, `d` is not a distance but the `d` constant in the parametric equation `ax + by + cz = d` describing the plane.
Diffstat (limited to 'editor')
-rw-r--r--editor/editor_properties.cpp4
-rw-r--r--editor/import/editor_import_collada.cpp6
-rw-r--r--editor/node_3d_editor_gizmos.cpp12
-rw-r--r--editor/plugins/node_3d_editor_plugin.cpp4
-rw-r--r--editor/property_editor.cpp4
5 files changed, 15 insertions, 15 deletions
diff --git a/editor/editor_properties.cpp b/editor/editor_properties.cpp
index d411b6dec4..c5772e0ea7 100644
--- a/editor/editor_properties.cpp
+++ b/editor/editor_properties.cpp
@@ -1611,7 +1611,7 @@ void EditorPropertyPlane::_value_changed(double val, const String &p_name) {
p.normal.x = spin[0]->get_value();
p.normal.y = spin[1]->get_value();
p.normal.z = spin[2]->get_value();
- p.distance = spin[3]->get_value();
+ p.d = spin[3]->get_value();
emit_changed(get_edited_property(), p, p_name);
}
@@ -1621,7 +1621,7 @@ void EditorPropertyPlane::update_property() {
spin[0]->set_value(val.normal.x);
spin[1]->set_value(val.normal.y);
spin[2]->set_value(val.normal.z);
- spin[3]->set_value(val.distance);
+ spin[3]->set_value(val.d);
setting = false;
}
void EditorPropertyPlane::_notification(int p_what) {
diff --git a/editor/import/editor_import_collada.cpp b/editor/import/editor_import_collada.cpp
index 7e7a982501..697ddfba96 100644
--- a/editor/import/editor_import_collada.cpp
+++ b/editor/import/editor_import_collada.cpp
@@ -766,7 +766,7 @@ Error ColladaImport::_create_mesh_surfaces(bool p_optimize, Ref<ArrayMesh> &p_me
Vector3 tangent = Vector3(tangent_src->array[tangent_pos + 0], tangent_src->array[tangent_pos + 1], tangent_src->array[tangent_pos + 2]);
vertex.tangent.normal = tangent;
- vertex.tangent.distance = vertex.normal.cross(tangent).dot(binormal) > 0 ? 1 : -1;
+ vertex.tangent.d = vertex.normal.cross(tangent).dot(binormal) > 0 ? 1 : -1;
}
}
@@ -794,7 +794,7 @@ Error ColladaImport::_create_mesh_surfaces(bool p_optimize, Ref<ArrayMesh> &p_me
#ifndef NO_UP_AXIS_SWAP
if (collada.state.up_axis == Vector3::AXIS_Z) {
- Vector3 bn = vertex.normal.cross(vertex.tangent.normal) * vertex.tangent.distance;
+ Vector3 bn = vertex.normal.cross(vertex.tangent.normal) * vertex.tangent.d;
SWAP(vertex.vertex.z, vertex.vertex.y);
vertex.vertex.z = -vertex.vertex.z;
@@ -805,7 +805,7 @@ Error ColladaImport::_create_mesh_surfaces(bool p_optimize, Ref<ArrayMesh> &p_me
SWAP(bn.z, bn.y);
bn.z = -bn.z;
- vertex.tangent.distance = vertex.normal.cross(vertex.tangent.normal).dot(bn) > 0 ? 1 : -1;
+ vertex.tangent.d = vertex.normal.cross(vertex.tangent.normal).dot(bn) > 0 ? 1 : -1;
}
#endif
diff --git a/editor/node_3d_editor_gizmos.cpp b/editor/node_3d_editor_gizmos.cpp
index 901dfdfb38..2a399087b2 100644
--- a/editor/node_3d_editor_gizmos.cpp
+++ b/editor/node_3d_editor_gizmos.cpp
@@ -3753,10 +3753,10 @@ void CollisionShape3DGizmoPlugin::redraw(EditorNode3DGizmo *p_gizmo) {
Vector3 n2 = p.normal.cross(n1).normalized();
Vector3 pface[4] = {
- p.normal * p.distance + n1 * 10.0 + n2 * 10.0,
- p.normal * p.distance + n1 * 10.0 + n2 * -10.0,
- p.normal * p.distance + n1 * -10.0 + n2 * -10.0,
- p.normal * p.distance + n1 * -10.0 + n2 * 10.0,
+ p.normal * p.d + n1 * 10.0 + n2 * 10.0,
+ p.normal * p.d + n1 * 10.0 + n2 * -10.0,
+ p.normal * p.d + n1 * -10.0 + n2 * -10.0,
+ p.normal * p.d + n1 * -10.0 + n2 * 10.0,
};
points.push_back(pface[0]);
@@ -3767,8 +3767,8 @@ void CollisionShape3DGizmoPlugin::redraw(EditorNode3DGizmo *p_gizmo) {
points.push_back(pface[3]);
points.push_back(pface[3]);
points.push_back(pface[0]);
- points.push_back(p.normal * p.distance);
- points.push_back(p.normal * p.distance + p.normal * 3);
+ points.push_back(p.normal * p.d);
+ points.push_back(p.normal * p.d + p.normal * 3);
p_gizmo->add_lines(points, material);
p_gizmo->add_collision_segments(points);
diff --git a/editor/plugins/node_3d_editor_plugin.cpp b/editor/plugins/node_3d_editor_plugin.cpp
index bac00ed038..1bf5999906 100644
--- a/editor/plugins/node_3d_editor_plugin.cpp
+++ b/editor/plugins/node_3d_editor_plugin.cpp
@@ -682,11 +682,11 @@ void Node3DEditorViewport::_select_region() {
}
Plane near(cam_pos, -_get_camera_normal());
- near.distance -= get_znear();
+ near.d -= get_znear();
frustum.push_back(near);
Plane far = -near;
- far.distance += get_zfar();
+ far.d += get_zfar();
frustum.push_back(far);
Vector<ObjectID> instances = RenderingServer::get_singleton()->instances_cull_convex(frustum, get_tree()->get_root()->get_world_3d()->get_scenario());
diff --git a/editor/property_editor.cpp b/editor/property_editor.cpp
index 15fbf19fdb..60329fb7bc 100644
--- a/editor/property_editor.cpp
+++ b/editor/property_editor.cpp
@@ -752,7 +752,7 @@ bool CustomPropertyEditor::edit(Object *p_owner, const String &p_name, Variant::
value_editor[0]->set_text(String::num(plane.normal.x));
value_editor[1]->set_text(String::num(plane.normal.y));
value_editor[2]->set_text(String::num(plane.normal.z));
- value_editor[3]->set_text(String::num(plane.distance));
+ value_editor[3]->set_text(String::num(plane.d));
} break;
case Variant::QUAT: {
@@ -1598,7 +1598,7 @@ void CustomPropertyEditor::_modified(String p_string) {
pl.normal.x = _parse_real_expression(value_editor[0]->get_text());
pl.normal.y = _parse_real_expression(value_editor[1]->get_text());
pl.normal.z = _parse_real_expression(value_editor[2]->get_text());
- pl.distance = _parse_real_expression(value_editor[3]->get_text());
+ pl.d = _parse_real_expression(value_editor[3]->get_text());
v = pl;
_emit_changed_whole_or_field();