Memory Leak Fixed
Have to free the mesh generator after we process our mesh.
This commit is contained in:
@@ -2,7 +2,7 @@ extends Node
|
|||||||
|
|
||||||
class_name Cutter
|
class_name Cutter
|
||||||
|
|
||||||
static func circleCutter(num_sides = 8, perimerter_length = 0.1) -> PackedVector2Array:
|
static func circleCutter(num_sides = 7, perimerter_length = 0.2) -> PackedVector2Array:
|
||||||
var line_length: float = perimerter_length/num_sides
|
var line_length: float = perimerter_length/num_sides
|
||||||
var line_angle: float = 360.0/num_sides
|
var line_angle: float = 360.0/num_sides
|
||||||
var current_angle: float = 0.0
|
var current_angle: float = 0.0
|
||||||
|
|||||||
@@ -93,6 +93,8 @@ func _draw():
|
|||||||
|
|
||||||
var meshGenerator = GeoPolyMesh.new(vector_indexes, vectors, extrusion_direction, depth)
|
var meshGenerator = GeoPolyMesh.new(vector_indexes, vectors, extrusion_direction, depth)
|
||||||
var commited_mesh = meshGenerator.commit_mesh(meshInstance3d.get_active_material(0))
|
var commited_mesh = meshGenerator.commit_mesh(meshInstance3d.get_active_material(0))
|
||||||
|
meshGenerator.free()
|
||||||
|
|
||||||
|
|
||||||
meshInstance3d.mesh = commited_mesh
|
meshInstance3d.mesh = commited_mesh
|
||||||
meshInstance3d.position += depth_position_offset
|
meshInstance3d.position += depth_position_offset
|
||||||
@@ -112,6 +114,7 @@ func _re_draw():
|
|||||||
|
|
||||||
var meshGenerator = GeoPolyMesh.new(vector_indexes, vectors, extrusion_direction, depth)
|
var meshGenerator = GeoPolyMesh.new(vector_indexes, vectors, extrusion_direction, depth)
|
||||||
var commited_mesh = meshGenerator.commit_mesh(meshInstance3d.get_active_material(0))
|
var commited_mesh = meshGenerator.commit_mesh(meshInstance3d.get_active_material(0))
|
||||||
|
meshGenerator.free()
|
||||||
|
|
||||||
meshInstance3d.mesh = commited_mesh
|
meshInstance3d.mesh = commited_mesh
|
||||||
meshInstance3d.create_trimesh_collision()
|
meshInstance3d.create_trimesh_collision()
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
extends Node
|
extends Object
|
||||||
|
|
||||||
class_name GeoPolyMesh
|
class_name GeoPolyMesh
|
||||||
|
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
extends Node
|
extends Object
|
||||||
|
|
||||||
# provides all the utility functions for generating
|
# provides all the utility functions for generating
|
||||||
# a triangulized Polygon with holes
|
# a triangulized Polygon with holes
|
||||||
|
|||||||
@@ -50,6 +50,7 @@ offset_right = 711.0
|
|||||||
offset_bottom = 543.0
|
offset_bottom = 543.0
|
||||||
grow_horizontal = 1
|
grow_horizontal = 1
|
||||||
grow_vertical = 1
|
grow_vertical = 1
|
||||||
|
enabled = false
|
||||||
initial_node_to_watch = NodePath("../StateChart")
|
initial_node_to_watch = NodePath("../StateChart")
|
||||||
|
|
||||||
[node name="PlaceholderMesh" type="MeshInstance3D" parent="."]
|
[node name="PlaceholderMesh" type="MeshInstance3D" parent="."]
|
||||||
@@ -80,6 +81,7 @@ script = ExtResource("4_0l0yx")
|
|||||||
player = NodePath("../..")
|
player = NodePath("../..")
|
||||||
|
|
||||||
[node name="InteractionRaycast" type="RayCast3D" parent="CameraController/Camera3D"]
|
[node name="InteractionRaycast" type="RayCast3D" parent="CameraController/Camera3D"]
|
||||||
|
enabled = false
|
||||||
target_position = Vector3(0, 0, -3)
|
target_position = Vector3(0, 0, -3)
|
||||||
debug_shape_custom_color = Color(0, 1, 0, 1)
|
debug_shape_custom_color = Color(0, 1, 0, 1)
|
||||||
script = ExtResource("4_cv1cy")
|
script = ExtResource("4_cv1cy")
|
||||||
|
|||||||
Reference in New Issue
Block a user