summaryrefslogtreecommitdiffstats
path: root/world/chunk/Chunk.gd
diff options
context:
space:
mode:
Diffstat (limited to 'world/chunk/Chunk.gd')
-rw-r--r--world/chunk/Chunk.gd32
1 files changed, 32 insertions, 0 deletions
diff --git a/world/chunk/Chunk.gd b/world/chunk/Chunk.gd
new file mode 100644
index 0000000..4356caf
--- /dev/null
+++ b/world/chunk/Chunk.gd
@@ -0,0 +1,32 @@
+extends Area
+
+enum LOD {DISTANCE,MID,CLOSE}
+var lod = -1
+
+onready var lod_distance = $"gen_tree/lod_distance"
+onready var lod_mid = $"gen_tree/lod_mid"
+onready var lod_close = $"gen_tree/lod_close"
+
+onready var _collision_enabled = lod_close.collision_layer
+
+func _ready():
+ lod_update()
+
+func lod_update():
+ match lod:
+ LOD.CLOSE:
+ lod_distance.visible = false
+ lod_mid.visible = true
+ lod_close.collision_layer = _collision_enabled
+ LOD.MID:
+ lod_distance.visible = false
+ lod_mid.visible = true
+ lod_close.collision_layer = 0
+ LOD.DISTANCE:
+ lod_distance.visible = true
+ lod_mid.visible = false
+ lod_close.collision_layer = 0
+ _:
+ lod_distance.visible = true
+ lod_mid.visible = false
+ lod_close.collision_layer = 0