Fix terrain not loading by adding VoxelViewers

master
Marc Gilleron 2020-11-11 20:31:10 +00:00
parent 9069bfaaa6
commit 32efe47e3d
6 changed files with 13 additions and 9 deletions

View File

@ -64,4 +64,6 @@ texture = ExtResource( 4 )
[node name="Inventory" parent="." instance=ExtResource( 7 )]
visible = false
color = Color( 0, 0, 0, 0.501961 )
[node name="VoxelViewer" type="VoxelViewer" parent="."]
[connection signal="changed" from="Inventory" to="HotBar" method="_on_Inventory_changed"]

View File

@ -67,3 +67,6 @@ margin_right = 520.0
margin_bottom = 308.0
mouse_filter = 2
texture = ExtResource( 4 )
[node name="VoxelViewer" type="VoxelViewer" parent="."]
view_distance = 128

View File

@ -43,17 +43,17 @@ environment = SubResource( 2 )
[node name="VoxelTerrain" type="VoxelTerrain" parent="."]
stream = ExtResource( 4 )
voxel_library = ExtResource( 1 )
view_distance = 256
viewer_path = NodePath("../CharacterAvatar")
generate_collisions = false
material/0 = ExtResource( 2 )
material/1 = ExtResource( 3 )
max_view_distance = 256
[node name="DirectionalLight" type="DirectionalLight" parent="."]
transform = Transform( -0.985468, 0.124099, -0.11598, 0.0154004, 0.745271, 0.666584, 0.169159, 0.655111, -0.736353, 1.51966, 19.7004, 14.0879 )
directional_shadow_normal_bias = 0.1
[node name="CharacterAvatar" parent="." instance=ExtResource( 6 )]
transform = Transform( 1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 58.0914, 17 )
transform = Transform( 1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 28.0914, 17 )
head = NodePath("../../Main/CharacterAvatar/Camera")
terrain = NodePath("../../Main/VoxelTerrain")

View File

@ -8,7 +8,7 @@ transparent = true
[sub_resource type="Voxel" id=2]
geometry_type = 1
collision_aabbs = [ AABB( 0, 0, 0, 1, 1, 1 ) ]
cube_geometry/padding_y = 0.0
cube_geometry/padding_y = null
cube_tiles/left = Vector2( 0, 0 )
cube_tiles/right = Vector2( 0, 0 )
cube_tiles/bottom = Vector2( 0, 0 )
@ -19,7 +19,7 @@ cube_tiles/front = Vector2( 0, 0 )
[sub_resource type="Voxel" id=3]
geometry_type = 1
collision_aabbs = [ AABB( 0, 0, 0, 1, 1, 1 ) ]
cube_geometry/padding_y = 0.0
cube_geometry/padding_y = null
cube_tiles/left = Vector2( 1, 0 )
cube_tiles/right = Vector2( 1, 0 )
cube_tiles/bottom = Vector2( 1, 0 )

View File

@ -3,14 +3,14 @@
[ext_resource path="res://common/mouse_look.gd" type="Script" id=1]
[ext_resource path="res://common/spectator_avatar.gd" type="Script" id=2]
[node name="SpectatorAvatar" type="Spatial"]
script = ExtResource( 2 )
speed = 5.0
[node name="Camera" type="Camera" parent="."]
far = 4000.0
script = ExtResource( 1 )
sensitivity = 0.2
distance = 0.0
far = 4000.0
[node name="VoxelViewer" type="VoxelViewer" parent="."]

View File

@ -57,7 +57,6 @@ script = ExtResource( 6 )
stream = ExtResource( 7 )
view_distance = 2048
lod_count = 6
viewer_path = NodePath("../SpectatorAvatar")
material = ExtResource( 2 )
generate_collisions = false
collision_lod_count = 1