diff options
author | dusoleil <howcansocksbereal@gmail.com> | 2022-09-19 10:32:24 -0400 |
---|---|---|
committer | dusoleil <howcansocksbereal@gmail.com> | 2022-09-19 10:32:24 -0400 |
commit | 51a0664a1c2265adddbf4c42d4eda747c8ea8aaf (patch) | |
tree | 1bcdb3bcee5a0c1e303d55a001158ec906810329 /world/obstacles | |
parent | 9bc2a0767e15d4dde7fd6231b07882d6456af71e (diff) | |
download | game_jam49-51a0664a1c2265adddbf4c42d4eda747c8ea8aaf.tar.gz game_jam49-51a0664a1c2265adddbf4c42d4eda747c8ea8aaf.zip |
Add Levels of Detail per Chunk
Diffstat (limited to 'world/obstacles')
-rw-r--r-- | world/obstacles/Rock.gd | 18 | ||||
-rw-r--r-- | world/obstacles/Rock.tscn | 32 | ||||
-rw-r--r-- | world/obstacles/Rock_coll.tres | 4 | ||||
-rw-r--r-- | world/obstacles/Rock_lowres_mesh.tres | 4 |
4 files changed, 8 insertions, 50 deletions
diff --git a/world/obstacles/Rock.gd b/world/obstacles/Rock.gd deleted file mode 100644 index 577e626..0000000 --- a/world/obstacles/Rock.gd +++ /dev/null @@ -1,18 +0,0 @@ -extends StaticBody - -onready var collision_enabled = self.collision_layer - -func lod_distance(): - $"MeshInstance".visible = false - $"MeshInstance2".visible = true - self.collision_layer = 0 - -func lod_mid(): - $"MeshInstance".visible = true - $"MeshInstance2".visible = false - self.collision_layer = 0 - -func lod_close(): - $"MeshInstance".visible = true - $"MeshInstance2".visible = false - self.collision_layer = collision_enabled diff --git a/world/obstacles/Rock.tscn b/world/obstacles/Rock.tscn deleted file mode 100644 index 819e9a8..0000000 --- a/world/obstacles/Rock.tscn +++ /dev/null @@ -1,32 +0,0 @@ -[gd_scene load_steps=7 format=2] - -[ext_resource path="res://world/obstacles/Rock.gd" type="Script" id=1] -[ext_resource path="res://world/chunk/helper/ChunkedMeshInstance.gd" type="Script" id=2] -[ext_resource path="res://world/obstacles/Rock_mesh.tres" type="PrismMesh" id=3] -[ext_resource path="res://world/obstacles/Rock_mat.tres" type="Material" id=4] - -[sub_resource type="ConvexPolygonShape" id=2] -points = PoolVector3Array( 2.5, -5, 2.5, 2.5, -5, -2.5, -2.5, -5, -2.5, -2.5, -5, 2.5, 0, 5, 2.5, 0, 5, -2.5 ) - -[sub_resource type="CubeMesh" id=9] -size = Vector3( 5, 10, 5 ) - -[node name="Rock" type="StaticBody"] -collision_layer = 8 -collision_mask = 0 -script = ExtResource( 1 ) - -[node name="CollisionShape" type="CollisionShape" parent="."] -shape = SubResource( 2 ) - -[node name="MeshInstance" type="MeshInstance" parent="."] -visible = false -material_override = ExtResource( 4 ) -script = ExtResource( 2 ) -_mesh = ExtResource( 3 ) - -[node name="MeshInstance2" type="MeshInstance" parent="."] -visible = false -material_override = ExtResource( 4 ) -script = ExtResource( 2 ) -_mesh = SubResource( 9 ) diff --git a/world/obstacles/Rock_coll.tres b/world/obstacles/Rock_coll.tres new file mode 100644 index 0000000..b06d080 --- /dev/null +++ b/world/obstacles/Rock_coll.tres @@ -0,0 +1,4 @@ +[gd_resource type="ConvexPolygonShape" format=2] + +[resource] +points = PoolVector3Array( 2.5, -5, 2.5, 2.5, -5, -2.5, -2.5, -5, -2.5, -2.5, -5, 2.5, 0, 5, 2.5, 0, 5, -2.5 ) diff --git a/world/obstacles/Rock_lowres_mesh.tres b/world/obstacles/Rock_lowres_mesh.tres new file mode 100644 index 0000000..910d7f6 --- /dev/null +++ b/world/obstacles/Rock_lowres_mesh.tres @@ -0,0 +1,4 @@ +[gd_resource type="CubeMesh" format=2] + +[resource] +size = Vector3( 5, 10, 5 ) |