Merge pull request #57990 from jmb462/fix-drag-lines-precision-issue

Fix 3D editor axis drag lines precision issue
This commit is contained in:
JFonS 2022-02-14 10:39:44 +01:00 committed by GitHub
commit 58199e5ad0
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -6308,14 +6308,15 @@ void fragment() {
// Lines to visualize transforms locked to an axis/plane
{
Ref<SurfaceTool> surftool = memnew(SurfaceTool);
surftool->begin(Mesh::PRIMITIVE_LINES);
surftool->begin(Mesh::PRIMITIVE_LINE_STRIP);
Vector3 vec;
vec[i] = 1;
// line extending through infinity(ish)
surftool->add_vertex(vec * -99999);
surftool->add_vertex(vec * 99999);
surftool->add_vertex(vec * -1048576);
surftool->add_vertex(Vector3());
surftool->add_vertex(vec * 1048576);
surftool->set_material(mat_hl);
surftool->commit(axis_gizmo[i]);
}