Using MultiMeshInstance for the 3D tiles

WorldChunkRefactoring
Martin Felis 2023-07-01 09:47:23 +02:00
parent c8921bfb7b
commit 7070a2de74
2 changed files with 25 additions and 9 deletions

View File

@ -0,0 +1,11 @@
[gd_resource type="CylinderMesh" load_steps=2 format=2]
[ext_resource path="res://materials/HexTileTextureLookup.tres" type="Material" id=1]
[resource]
material = ExtResource( 1 )
top_radius = 0.5
bottom_radius = 0.5
height = 10.0
radial_segments = 6
rings = 1

View File

@ -1,26 +1,27 @@
[gd_scene load_steps=5 format=2] [gd_scene load_steps=6 format=2]
[ext_resource path="res://scenes/HexTile3D.cs" type="Script" id=1] [ext_resource path="res://scenes/HexTile3D.cs" type="Script" id=1]
[ext_resource path="res://materials/HexTileTextureLookup.tres" type="Material" id=2] [ext_resource path="res://materials/HexTileTextureLookup.tres" type="Material" id=2]
[ext_resource path="res://assets/Environment/HexTileMesh.tres" type="CylinderMesh" id=3]
[sub_resource type="CylinderMesh" id=6]
top_radius = 0.5
bottom_radius = 0.5
height = 10.0
radial_segments = 6
rings = 1
[sub_resource type="CylinderShape" id=5] [sub_resource type="CylinderShape" id=5]
height = 1.0 height = 1.0
radius = 0.5 radius = 0.5
[sub_resource type="MultiMesh" id=6]
transform_format = 1
instance_count = 1
mesh = ExtResource( 3 )
transform_array = PoolVector3Array( 1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0 )
[node name="HexTile3D" type="Spatial"] [node name="HexTile3D" type="Spatial"]
transform = Transform( 1, 0, 0, 0, 1, 0, 0, 0, 1, 0.0096302, 0, 0 ) transform = Transform( 1, 0, 0, 0, 1, 0, 0, 0, 1, 0.0096302, 0, 0 )
script = ExtResource( 1 ) script = ExtResource( 1 )
[node name="Mesh" type="MeshInstance" parent="."] [node name="Mesh" type="MeshInstance" parent="."]
transform = Transform( -4.37114e-08, 0, 1, 0, 1, 0, -1, 0, -4.37114e-08, 0, -5, 0 ) transform = Transform( -4.37114e-08, 0, 1, 0, 1, 0, -1, 0, -4.37114e-08, 0, -5, 0 )
mesh = SubResource( 6 ) visible = false
mesh = ExtResource( 3 )
material/0 = ExtResource( 2 ) material/0 = ExtResource( 2 )
[node name="StaticBody" type="StaticBody" parent="."] [node name="StaticBody" type="StaticBody" parent="."]
@ -28,3 +29,7 @@ material/0 = ExtResource( 2 )
[node name="CollisionShape" type="CollisionShape" parent="StaticBody"] [node name="CollisionShape" type="CollisionShape" parent="StaticBody"]
transform = Transform( -4.37114e-08, 0, 1, 0, 10, 0, -1, 0, -4.37114e-08, 0, -5, 0 ) transform = Transform( -4.37114e-08, 0, 1, 0, 10, 0, -1, 0, -4.37114e-08, 0, -5, 0 )
shape = SubResource( 5 ) shape = SubResource( 5 )
[node name="MultiMeshInstance" type="MultiMeshInstance" parent="."]
transform = Transform( -4.37114e-08, 0, 1, 0, 1, 0, -1, 0, -4.37114e-08, 0, -5, 0 )
multimesh = SubResource( 6 )