Interior Maps #13
|
@ -22,7 +22,7 @@ class Chunk:
|
|||
|
||||
var _floor_orientation := PackedInt32Array()
|
||||
|
||||
var _multimesh_instances: Array[MultiMeshInstance] = []
|
||||
var _multi_mesh_instances: Array[MultiMeshInstance] = []
|
||||
|
||||
var _wall_meshes: Array[Mesh] = []
|
||||
|
||||
|
@ -41,11 +41,11 @@ class Chunk:
|
|||
##
|
||||
func invalidate(interior_map: InteriorMap, coordinate: Vector2i) -> void:
|
||||
# TODO: Once this is all lowered into native code, look for ways to parallelize the loops.
|
||||
for multi_mesh_instance in _multimesh_instances:
|
||||
for multi_mesh_instance in _multi_mesh_instances:
|
||||
RenderingServer.free_rid(multi_mesh_instance._instance_rid)
|
||||
RenderingServer.free_rid(multi_mesh_instance._multimesh_rid)
|
||||
|
||||
_multimesh_instances.clear()
|
||||
_multi_mesh_instances.clear()
|
||||
|
||||
# Normalize mesh instance data for the chunk.
|
||||
var transforms_by_mesh := {}
|
||||
|
@ -89,7 +89,7 @@ class Chunk:
|
|||
scenario_rid, chunk_mesh.get_rid(), transforms_by_mesh[chunk_mesh])
|
||||
|
||||
multi_mesh_instance.set_offset(global_transform)
|
||||
_multimesh_instances.append(multi_mesh_instance)
|
||||
_multi_mesh_instances.append(multi_mesh_instance)
|
||||
|
||||
##
|
||||
## Sets the floor mesh in the chunk at the location relative [code]coordinatess[/code] to
|
||||
|
@ -178,12 +178,12 @@ func _notification(what: int) -> void:
|
|||
match what:
|
||||
NOTIFICATION_TRANSFORM_CHANGED:
|
||||
for chunk in _chunks:
|
||||
for multi_mesh_instance in chunk._multimesh_instances:
|
||||
for multi_mesh_instance in chunk._multi_mesh_instances:
|
||||
multi_mesh_instance.set_offset_transform(global_transform)
|
||||
|
||||
NOTIFICATION_VISIBILITY_CHANGED:
|
||||
for chunk in _chunks:
|
||||
for multi_mesh_instance in chunk._multimesh_instances:
|
||||
for multi_mesh_instance in chunk._multi_mesh_instances:
|
||||
multi_mesh_instance.set_visible(visible)
|
||||
|
||||
##
|
||||
|
|
BIN
map_editor.scn (Stored with Git LFS)
BIN
map_editor.scn (Stored with Git LFS)
Binary file not shown.
Loading…
Reference in New Issue