class_name Monument var xform:Transform = Transform(Basis(),Vector3.ZERO) var scene:PackedScene = null var chunks = {} var origin_chunk = Vector2.ZERO var loaded_chunk = null func is_chunk_in_monument(chunk_coords:Vector2): return self.chunks.has(chunk_coords) func _init(transform,scn,member_chunks, origin): self.xform = transform self.xform.origin = ChunkLoader.v3_coords(ChunkLoader.chunk_coords(ChunkLoader.v2_coords(self.xform.origin))) self.scene = scn var org = ChunkLoader.chunk_coords(ChunkLoader.v2_coords(self.xform.origin)) for c in member_chunks.keys(): var c2 = ChunkLoader.v2_coords(self.xform.basis * ChunkLoader.v3_coords(c)) self.chunks[ChunkLoader.chunk_coords(c2)+org] = member_chunks[c] origin = ChunkLoader.v2_coords(self.xform.basis * ChunkLoader.v3_coords(origin)) self.origin_chunk = ChunkLoader.chunk_coords(origin)+org