Handle Depth In Mesh Generation

This commit is contained in:
2025-11-27 18:39:24 -05:00
parent 1c8e3d7314
commit 32c5e8fa9b
3 changed files with 149 additions and 149 deletions

View File

@@ -64,7 +64,7 @@ func _func_godot_apply_properties(entity_properties: Dictionary) -> void:
depth_min = d depth_min = d
depth = -(abs(depth_min) + abs(depth_max)) depth = -(abs(depth_min) + abs(depth_max))
depth_position_offset = -(Vector3.BACK * (depth/2)) depth_position_offset = Vector3.BACK * (depth/2)
elif extrusion_direction == ExtrudeDirection.RIGHT: elif extrusion_direction == ExtrudeDirection.RIGHT:
for vert in verticies: for vert in verticies:
verts_2d.append(Vector2(vert.z, vert.y)) verts_2d.append(Vector2(vert.z, vert.y))
@@ -90,7 +90,7 @@ func _func_godot_apply_properties(entity_properties: Dictionary) -> void:
depth_min = d depth_min = d
depth = -(abs(depth_min) + abs(depth_max)) depth = -(abs(depth_min) + abs(depth_max))
depth_position_offset = (Vector3.UP * (depth/2)) depth_position_offset = Vector3.UP * (depth/2)
var outer_boudary = Geometry2D.convex_hull(verts_2d) var outer_boudary = Geometry2D.convex_hull(verts_2d)
verts2d = outer_boudary verts2d = outer_boudary

View File

@@ -31,7 +31,7 @@ func _init(vector_indexes: PackedInt32Array, vector_points: PackedVector2Array,
elif extrude_direction == DestructableWall.ExtrudeDirection.RIGHT: elif extrude_direction == DestructableWall.ExtrudeDirection.RIGHT:
for point in vector_points: for point in vector_points:
self._v_points.append(Vector3(0, point.y, point.x)) self._v_points.append(Vector3(0, point.y, point.x))
depth_vector = -Vector3.RIGHT * depth depth_vector = Vector3.LEFT * depth
elif extrude_direction == DestructableWall.ExtrudeDirection.UP: elif extrude_direction == DestructableWall.ExtrudeDirection.UP:
for point in vector_points: for point in vector_points:
self._v_points.append(Vector3(point.x, 0, point.y)) self._v_points.append(Vector3(point.x, 0, point.y))