blob: f1806e44f9f8974a2e0530bc8ef0d6febd369a79 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
|
class_name Main
extends Node3D
@onready var noise := FastNoiseLite.new()
var chunks := []
func _ready() -> void:
brrr()
class OtherThread extends Thread:
func _exit_tree():
wait_to_finish()
func brrr():
noise.seed = randi()
var thread = OtherThread.new()
var rrrb = func():
for row in range(0, 8):
chunks.append([])
for column in range(0, 4):
chunks[row].append([])
for depth in range(0, 8):
chunks[row][column].append([])
var chunk = Chunk.new()
chunk.noise = noise
var mesh = chunk.generate_chunk(row, column, depth)
add_child.call_deferred(mesh)
chunks[row][column][depth] = chunk
thread.start(rrrb)
#thread.wait_to_finish()
|