mirror of
https://github.com/Relintai/broken_seals.git
synced 2024-12-21 13:16:49 +01:00
Removing a triangle will also remove it's marked edges.
This commit is contained in:
parent
25c71e2c14
commit
5c70ceb63f
@ -17,6 +17,15 @@ static func remove_triangle(mdr : MeshDataResource, triangle_index : int) -> voi
|
|||||||
|
|
||||||
# Just remove that triangle
|
# Just remove that triangle
|
||||||
var i : int = triangle_index * 3
|
var i : int = triangle_index * 3
|
||||||
|
|
||||||
|
var i0 : int = indices[i]
|
||||||
|
var i1 : int = indices[i + 1]
|
||||||
|
var i2 : int = indices[i + 2]
|
||||||
|
|
||||||
|
remove_seam_not_ordered(mdr, i0, i1)
|
||||||
|
remove_seam_not_ordered(mdr, i1, i2)
|
||||||
|
remove_seam_not_ordered(mdr, i2, i0)
|
||||||
|
|
||||||
indices.remove(i)
|
indices.remove(i)
|
||||||
indices.remove(i)
|
indices.remove(i)
|
||||||
indices.remove(i)
|
indices.remove(i)
|
||||||
@ -673,6 +682,18 @@ static func order_seam_indices(arr : PoolIntArray) -> PoolIntArray:
|
|||||||
|
|
||||||
return ret
|
return ret
|
||||||
|
|
||||||
|
static func add_seam_not_ordered(mdr : MeshDataResource, index0 : int, index1 : int) -> void:
|
||||||
|
if index0 > index1:
|
||||||
|
add_seam(mdr, index1, index0)
|
||||||
|
else:
|
||||||
|
add_seam(mdr, index0, index1)
|
||||||
|
|
||||||
|
static func remove_seam_not_ordered(mdr : MeshDataResource, index0 : int, index1 : int) -> void:
|
||||||
|
if index0 > index1:
|
||||||
|
remove_seam(mdr, index1, index0)
|
||||||
|
else:
|
||||||
|
remove_seam(mdr, index0, index1)
|
||||||
|
|
||||||
static func has_seam(mdr : MeshDataResource, index0 : int, index1 : int) -> bool:
|
static func has_seam(mdr : MeshDataResource, index0 : int, index1 : int) -> bool:
|
||||||
var seams : PoolIntArray = mdr.seams
|
var seams : PoolIntArray = mdr.seams
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user