From dca6a0c960e0d781ebb14041b21701e2d759f57e Mon Sep 17 00:00:00 2001 From: Relintai Date: Thu, 27 Jan 2022 17:08:46 +0100 Subject: [PATCH] Now mdr ed's handle markers have a fixed size. --- .../mesh_data_resource_editor/utilities/mesh_outline.gd | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/game/addons/mesh_data_resource_editor/utilities/mesh_outline.gd b/game/addons/mesh_data_resource_editor/utilities/mesh_outline.gd index 5c3c4031..35e631f8 100644 --- a/game/addons/mesh_data_resource_editor/utilities/mesh_outline.gd +++ b/game/addons/mesh_data_resource_editor/utilities/mesh_outline.gd @@ -1,6 +1,8 @@ tool extends Reference +var marker_size : float = 0.1 + var _mdr : MeshDataResource var lines : PoolVector3Array @@ -74,7 +76,7 @@ func generate(mark_outline : bool, mark_handles : bool): for i in range(_vertices.size()): var v : Vector3 = get_vertex(i) - var l : float = v.length() / 20.0 + var l : float = marker_size lines.append(v + Vector3(l, 0, 0)) lines.append(v + Vector3(-l, 0, 0)) @@ -109,7 +111,7 @@ func generate_mark_edges(mark_outline : bool, mark_handles : bool): if mark_handles: var pmid : Vector3 = lerp(v0, v1, 0.5) - var l : float = (v0 - v1).length() / 20.0 + var l : float = marker_size lines.append(pmid + Vector3(l, 0, 0)) lines.append(pmid + Vector3(-l, 0, 0)) @@ -149,7 +151,7 @@ func generate_mark_faces(mark_outline : bool, mark_handles : bool): var pmid : Vector3 = v0 + v1 + v2 pmid /= 3 - var l : float = (v0 - v1).length() / 20.0 + var l : float = marker_size lines.append(pmid + Vector3(l, 0, 0)) lines.append(pmid + Vector3(-l, 0, 0))