diff --git a/3d/truck_town/car_select.gd b/3d/truck_town/car_select/car_select.gd similarity index 72% rename from 3d/truck_town/car_select.gd rename to 3d/truck_town/car_select/car_select.gd index 9c12c0ad..34a1a15a 100644 --- a/3d/truck_town/car_select.gd +++ b/3d/truck_town/car_select/car_select.gd @@ -10,9 +10,9 @@ func _process(_delta: float): func _load_scene(car_path: String): var car: Node3D = load(car_path).instantiate() car.name = &"car" - town = load("res://town_scene.tscn").instantiate() + town = load("res://town/town_scene.tscn").instantiate() town.get_node(^"InstancePos").add_child(car) - town.get_node(^"InstancePos/Panel/Spedometer").car_body = car.get_child(0) + town.get_node(^"Spedometer").car_body = car.get_child(0) town.get_node(^"Back").pressed.connect(_on_back_pressed) get_parent().add_child(town) @@ -30,12 +30,12 @@ func _on_back_pressed(): func _on_mini_van_pressed(): - _load_scene("res://car_base.tscn") + _load_scene("res://vehicles/car_base.tscn") func _on_trailer_truck_pressed(): - _load_scene("res://trailer_truck.tscn") + _load_scene("res://vehicles/trailer_truck.tscn") func _on_tow_truck_pressed(): - _load_scene("res://tow_truck.tscn") + _load_scene("res://vehicles/tow_truck.tscn") diff --git a/3d/truck_town/car_select.tscn b/3d/truck_town/car_select/car_select.tscn similarity index 84% rename from 3d/truck_town/car_select.tscn rename to 3d/truck_town/car_select/car_select.tscn index ec379fea..1d207626 100644 --- a/3d/truck_town/car_select.tscn +++ b/3d/truck_town/car_select/car_select.tscn @@ -1,9 +1,9 @@ -[gd_scene load_steps=5 format=3 uid="uid://dgjvvywy4m0jo"] +[gd_scene load_steps=5 format=3] -[ext_resource type="Script" path="res://car_select.gd" id="1"] -[ext_resource type="Texture2D" uid="uid://bh7b4n4lg1uqt" path="res://textures/choose_van.png" id="2"] -[ext_resource type="Texture2D" uid="uid://hvkcmpdq1t0k" path="res://textures/choose_trailer.png" id="3"] -[ext_resource type="Texture2D" uid="uid://de7itkxhl0u28" path="res://textures/choose_tow.png" id="4"] +[ext_resource type="Script" path="res://car_select/car_select.gd" id="1"] +[ext_resource type="Texture2D" uid="uid://bh7b4n4lg1uqt" path="res://car_select/choose_van.png" id="2"] +[ext_resource type="Texture2D" uid="uid://hvkcmpdq1t0k" path="res://car_select/choose_trailer.png" id="3"] +[ext_resource type="Texture2D" uid="uid://de7itkxhl0u28" path="res://car_select/choose_tow.png" id="4"] [node name="CarSelect" type="Control"] layout_mode = 3 @@ -23,7 +23,6 @@ size_flags_vertical = 2 script = ExtResource("1") [node name="HBoxContainer" type="HBoxContainer" parent="."] -layout_mode = 1 anchors_preset = 14 anchor_top = 0.5 anchor_right = 1.0 @@ -33,7 +32,6 @@ grow_vertical = 2 alignment = 1 [node name="MiniVan" type="Button" parent="HBoxContainer"] -layout_mode = 2 offset_left = 5.0 offset_right = 333.0 offset_bottom = 243.0 @@ -42,7 +40,6 @@ size_flags_vertical = 4 icon = ExtResource("2") [node name="TrailerTruck" type="Button" parent="HBoxContainer"] -layout_mode = 2 offset_left = 347.0 offset_right = 675.0 offset_bottom = 243.0 @@ -51,7 +48,6 @@ size_flags_vertical = 4 icon = ExtResource("3") [node name="TowTruck" type="Button" parent="HBoxContainer"] -layout_mode = 2 offset_left = 690.0 offset_right = 1018.0 offset_bottom = 243.0 diff --git a/3d/truck_town/textures/choose_tow.png b/3d/truck_town/car_select/choose_tow.png similarity index 100% rename from 3d/truck_town/textures/choose_tow.png rename to 3d/truck_town/car_select/choose_tow.png diff --git a/3d/truck_town/textures/choose_tow.png.import b/3d/truck_town/car_select/choose_tow.png.import similarity index 71% rename from 3d/truck_town/textures/choose_tow.png.import rename to 3d/truck_town/car_select/choose_tow.png.import index 1552e805..7e186afb 100644 --- a/3d/truck_town/textures/choose_tow.png.import +++ b/3d/truck_town/car_select/choose_tow.png.import @@ -3,15 +3,15 @@ importer="texture" type="CompressedTexture2D" uid="uid://de7itkxhl0u28" -path="res://.godot/imported/choose_tow.png-98497909563147058e33250f8d1683f4.ctex" +path="res://.godot/imported/choose_tow.png-e1d5f4ba7eb707eed82d65f6944c644a.ctex" metadata={ "vram_texture": false } [deps] -source_file="res://textures/choose_tow.png" -dest_files=["res://.godot/imported/choose_tow.png-98497909563147058e33250f8d1683f4.ctex"] +source_file="res://car_select/choose_tow.png" +dest_files=["res://.godot/imported/choose_tow.png-e1d5f4ba7eb707eed82d65f6944c644a.ctex"] [params] diff --git a/3d/truck_town/textures/choose_trailer.png b/3d/truck_town/car_select/choose_trailer.png similarity index 100% rename from 3d/truck_town/textures/choose_trailer.png rename to 3d/truck_town/car_select/choose_trailer.png diff --git a/3d/truck_town/textures/choose_trailer.png.import b/3d/truck_town/car_select/choose_trailer.png.import similarity index 70% rename from 3d/truck_town/textures/choose_trailer.png.import rename to 3d/truck_town/car_select/choose_trailer.png.import index 4ba60791..93b97a61 100644 --- a/3d/truck_town/textures/choose_trailer.png.import +++ b/3d/truck_town/car_select/choose_trailer.png.import @@ -3,15 +3,15 @@ importer="texture" type="CompressedTexture2D" uid="uid://hvkcmpdq1t0k" -path="res://.godot/imported/choose_trailer.png-fd19a6a0470bf156ff533b17c220bb25.ctex" +path="res://.godot/imported/choose_trailer.png-42b178b0fc9d742f9f23bb1d9fdfc9a7.ctex" metadata={ "vram_texture": false } [deps] -source_file="res://textures/choose_trailer.png" -dest_files=["res://.godot/imported/choose_trailer.png-fd19a6a0470bf156ff533b17c220bb25.ctex"] +source_file="res://car_select/choose_trailer.png" +dest_files=["res://.godot/imported/choose_trailer.png-42b178b0fc9d742f9f23bb1d9fdfc9a7.ctex"] [params] diff --git a/3d/truck_town/textures/choose_van.png b/3d/truck_town/car_select/choose_van.png similarity index 100% rename from 3d/truck_town/textures/choose_van.png rename to 3d/truck_town/car_select/choose_van.png diff --git a/3d/truck_town/textures/choose_van.png.import b/3d/truck_town/car_select/choose_van.png.import similarity index 71% rename from 3d/truck_town/textures/choose_van.png.import rename to 3d/truck_town/car_select/choose_van.png.import index e706c5aa..54971de4 100644 --- a/3d/truck_town/textures/choose_van.png.import +++ b/3d/truck_town/car_select/choose_van.png.import @@ -3,15 +3,15 @@ importer="texture" type="CompressedTexture2D" uid="uid://bh7b4n4lg1uqt" -path="res://.godot/imported/choose_van.png-bf155c126082baee803c63d2d237b1d3.ctex" +path="res://.godot/imported/choose_van.png-a2669a1a5e1faa5c8245c7e87ce8c490.ctex" metadata={ "vram_texture": false } [deps] -source_file="res://textures/choose_van.png" -dest_files=["res://.godot/imported/choose_van.png-bf155c126082baee803c63d2d237b1d3.ctex"] +source_file="res://car_select/choose_van.png" +dest_files=["res://.godot/imported/choose_van.png-a2669a1a5e1faa5c8245c7e87ce8c490.ctex"] [params] diff --git a/3d/truck_town/materials/cement.tres b/3d/truck_town/materials/cement.tres deleted file mode 100644 index c1819df8..00000000 --- a/3d/truck_town/materials/cement.tres +++ /dev/null @@ -1,9 +0,0 @@ -[gd_resource type="StandardMaterial3D" load_steps=2 format=3 uid="uid://dwpeihw7c20hb"] - -[ext_resource type="Texture2D" uid="uid://deeixbwehify0" path="res://textures/cement.png" id="1"] - -[resource] -resource_name = "Cement" -albedo_texture = ExtResource("1") -roughness = 0.8 -uv1_scale = Vector3(2, 2, 2) diff --git a/3d/truck_town/materials/grass.tres b/3d/truck_town/materials/grass.tres deleted file mode 100644 index 66704020..00000000 --- a/3d/truck_town/materials/grass.tres +++ /dev/null @@ -1,9 +0,0 @@ -[gd_resource type="StandardMaterial3D" load_steps=2 format=3 uid="uid://dy1i6vuu24ovq"] - -[ext_resource type="Texture2D" uid="uid://cltpie6eq33br" path="res://textures/grass.png" id="1"] - -[resource] -resource_name = "Grass" -albedo_texture = ExtResource("1") -roughness = 0.8 -uv1_scale = Vector3(2, 2, 2) diff --git a/3d/truck_town/materials/truck_trailer.tres b/3d/truck_town/materials/truck_trailer.tres deleted file mode 100644 index 0981b8cb..00000000 --- a/3d/truck_town/materials/truck_trailer.tres +++ /dev/null @@ -1,7 +0,0 @@ -[gd_resource type="StandardMaterial3D" load_steps=2 format=3 uid="uid://cebi0gcdtlo4k"] - -[ext_resource type="Texture2D" uid="uid://q7uvsiqefkwr" path="res://textures/truck_trailer.png" id="1_jkh55"] - -[resource] -albedo_texture = ExtResource("1_jkh55") -roughness = 0.6 diff --git a/3d/truck_town/project.godot b/3d/truck_town/project.godot index eef6102a..5e1add43 100644 --- a/3d/truck_town/project.godot +++ b/3d/truck_town/project.godot @@ -13,7 +13,7 @@ config_version=5 config/name="Truck Town" config/description="This is a demo implementing different types of trucks of varying complexity using vehicle physics." -run/main_scene="res://car_select.tscn" +run/main_scene="res://car_select/car_select.tscn" config/features=PackedStringArray("4.0") config/icon="res://icon.png" diff --git a/3d/truck_town/spedometer.gd b/3d/truck_town/spedometer.gd index 4f0d67d6..7e146b8b 100644 --- a/3d/truck_town/spedometer.gd +++ b/3d/truck_town/spedometer.gd @@ -10,6 +10,7 @@ enum SpeedUnit { var car_body: VehicleBody3D + func _process(_delta): var speed := car_body.linear_velocity.length() if speed_unit == SpeedUnit.METERS_PER_SECOND: diff --git a/3d/truck_town/textures/cement.png b/3d/truck_town/town/materials/cement.png similarity index 100% rename from 3d/truck_town/textures/cement.png rename to 3d/truck_town/town/materials/cement.png diff --git a/3d/truck_town/textures/cement.png.import b/3d/truck_town/town/materials/cement.png.import similarity index 59% rename from 3d/truck_town/textures/cement.png.import rename to 3d/truck_town/town/materials/cement.png.import index 2e87661c..a9d8b405 100644 --- a/3d/truck_town/textures/cement.png.import +++ b/3d/truck_town/town/materials/cement.png.import @@ -3,8 +3,8 @@ importer="texture" type="CompressedTexture2D" uid="uid://deeixbwehify0" -path.s3tc="res://.godot/imported/cement.png-ce0aa9838dd9c502970938c3444abe0d.s3tc.ctex" -path.etc2="res://.godot/imported/cement.png-ce0aa9838dd9c502970938c3444abe0d.etc2.ctex" +path.s3tc="res://.godot/imported/cement.png-48bbf8b709926144ff58f879dc65e769.s3tc.ctex" +path.etc2="res://.godot/imported/cement.png-48bbf8b709926144ff58f879dc65e769.etc2.ctex" metadata={ "imported_formats": ["s3tc", "etc2"], "vram_texture": true @@ -12,8 +12,8 @@ metadata={ [deps] -source_file="res://textures/cement.png" -dest_files=["res://.godot/imported/cement.png-ce0aa9838dd9c502970938c3444abe0d.s3tc.ctex", "res://.godot/imported/cement.png-ce0aa9838dd9c502970938c3444abe0d.etc2.ctex"] +source_file="res://town/materials/cement.png" +dest_files=["res://.godot/imported/cement.png-48bbf8b709926144ff58f879dc65e769.s3tc.ctex", "res://.godot/imported/cement.png-48bbf8b709926144ff58f879dc65e769.etc2.ctex"] [params] diff --git a/3d/truck_town/town/materials/cement.tres b/3d/truck_town/town/materials/cement.tres new file mode 100644 index 00000000..5161dbb5 --- /dev/null +++ b/3d/truck_town/town/materials/cement.tres @@ -0,0 +1,9 @@ +[gd_resource type="StandardMaterial3D" load_steps=2 format=3] + +[ext_resource type="Texture2D" path="res://town/materials/cement.png" id="1"] + +[resource] +resource_name = "Cement" +albedo_texture = ExtResource("1") +roughness = 0.8 +uv1_scale = Vector3(2, 2, 2) diff --git a/3d/truck_town/textures/grass.png b/3d/truck_town/town/materials/grass.png similarity index 100% rename from 3d/truck_town/textures/grass.png rename to 3d/truck_town/town/materials/grass.png diff --git a/3d/truck_town/textures/grass.png.import b/3d/truck_town/town/materials/grass.png.import similarity index 60% rename from 3d/truck_town/textures/grass.png.import rename to 3d/truck_town/town/materials/grass.png.import index 2f0bd030..06d6a670 100644 --- a/3d/truck_town/textures/grass.png.import +++ b/3d/truck_town/town/materials/grass.png.import @@ -3,8 +3,8 @@ importer="texture" type="CompressedTexture2D" uid="uid://cltpie6eq33br" -path.s3tc="res://.godot/imported/grass.png-c637977c146fec1b1e97e5c999cb4594.s3tc.ctex" -path.etc2="res://.godot/imported/grass.png-c637977c146fec1b1e97e5c999cb4594.etc2.ctex" +path.s3tc="res://.godot/imported/grass.png-70a5ea3cb24fafd3dc2248b5302d522c.s3tc.ctex" +path.etc2="res://.godot/imported/grass.png-70a5ea3cb24fafd3dc2248b5302d522c.etc2.ctex" metadata={ "imported_formats": ["s3tc", "etc2"], "vram_texture": true @@ -12,8 +12,8 @@ metadata={ [deps] -source_file="res://textures/grass.png" -dest_files=["res://.godot/imported/grass.png-c637977c146fec1b1e97e5c999cb4594.s3tc.ctex", "res://.godot/imported/grass.png-c637977c146fec1b1e97e5c999cb4594.etc2.ctex"] +source_file="res://town/materials/grass.png" +dest_files=["res://.godot/imported/grass.png-70a5ea3cb24fafd3dc2248b5302d522c.s3tc.ctex", "res://.godot/imported/grass.png-70a5ea3cb24fafd3dc2248b5302d522c.etc2.ctex"] [params] diff --git a/3d/truck_town/town/materials/grass.tres b/3d/truck_town/town/materials/grass.tres new file mode 100644 index 00000000..f03f1624 --- /dev/null +++ b/3d/truck_town/town/materials/grass.tres @@ -0,0 +1,9 @@ +[gd_resource type="StandardMaterial3D" load_steps=2 format=3] + +[ext_resource type="Texture2D" path="res://town/materials/grass.png" id="1"] + +[resource] +resource_name = "Grass" +albedo_texture = ExtResource("1") +roughness = 0.8 +uv1_scale = Vector3(2, 2, 2) diff --git a/3d/truck_town/town_scene.tscn b/3d/truck_town/town/town_scene.tscn similarity index 54% rename from 3d/truck_town/town_scene.tscn rename to 3d/truck_town/town/town_scene.tscn index d9964dfb..182aeadf 100644 --- a/3d/truck_town/town_scene.tscn +++ b/3d/truck_town/town/town_scene.tscn @@ -1,39 +1,25 @@ -[gd_scene load_steps=6 format=3 uid="uid://b0036qgpepmwc"] +[gd_scene load_steps=4 format=3 uid="uid://d0ygmqpylq0wy"] -[ext_resource type="PackedScene" uid="uid://2lbu3a1dk0a5" path="res://truck_town.glb" id="1_x0dmm"] +[ext_resource type="PackedScene" uid="uid://dfdgytsvtqxwv" path="res://town/truck_town.glb" id="1_x0dmm"] [ext_resource type="Script" path="res://spedometer.gd" id="2"] [ext_resource type="Environment" uid="uid://cuvs67826w51u" path="res://default_env.tres" id="3_t0mbp"] -[sub_resource type="StyleBoxEmpty" id="1"] - -[sub_resource type="Theme" id="2"] -Button/styles/focus = SubResource("1") - [node name="TownScene" type="Node3D"] [node name="TruckTown" parent="." instance=ExtResource("1_x0dmm")] [node name="InstancePos" type="Marker3D" parent="."] -transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 13.2039, 6.67095, -37.6042) +transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 14, 6, -40) -[node name="Panel" type="Panel" parent="InstancePos"] +[node name="Spedometer" type="Button" parent="."] +custom_minimum_size = Vector2(150, 40) anchors_preset = 1 anchor_left = 1.0 anchor_right = 1.0 -offset_left = -130.0 +offset_left = -150.0 offset_bottom = 40.0 grow_horizontal = 0 - -[node name="Spedometer" type="Button" parent="InstancePos/Panel"] -layout_mode = 1 -anchors_preset = 15 -anchor_right = 1.0 -anchor_bottom = 1.0 -grow_horizontal = 2 -grow_vertical = 2 -theme = SubResource("2") text = "Speed: ???" -flat = true script = ExtResource("2") [node name="Back" type="Button" parent="."] @@ -50,4 +36,4 @@ environment = ExtResource("3_t0mbp") transform = Transform3D(0.939693, -0.280167, -0.196175, -5.01437e-08, -0.573577, 0.819152, -0.34202, -0.769751, -0.538986, 0, 24.4076, 0) shadow_enabled = true -[connection signal="pressed" from="InstancePos/Panel/Spedometer" to="InstancePos/Panel/Spedometer" method="_on_spedometer_pressed"] +[connection signal="pressed" from="Spedometer" to="Spedometer" method="_on_spedometer_pressed"] diff --git a/3d/truck_town/truck_town.glb b/3d/truck_town/town/truck_town.glb similarity index 100% rename from 3d/truck_town/truck_town.glb rename to 3d/truck_town/town/truck_town.glb diff --git a/3d/truck_town/truck_town.glb.import b/3d/truck_town/town/truck_town.glb.import similarity index 80% rename from 3d/truck_town/truck_town.glb.import rename to 3d/truck_town/town/truck_town.glb.import index 87e6a369..97c0414b 100644 --- a/3d/truck_town/truck_town.glb.import +++ b/3d/truck_town/town/truck_town.glb.import @@ -3,13 +3,13 @@ importer="scene" importer_version=1 type="PackedScene" -uid="uid://2lbu3a1dk0a5" -path="res://.godot/imported/truck_town.glb-b721f5a7e8588ad7f9f8190f99e67720.scn" +uid="uid://dfdgytsvtqxwv" +path="res://.godot/imported/truck_town.glb-49b71606091d50bf5665443ce42e43d8.scn" [deps] -source_file="res://truck_town.glb" -dest_files=["res://.godot/imported/truck_town.glb-b721f5a7e8588ad7f9f8190f99e67720.scn"] +source_file="res://town/truck_town.glb" +dest_files=["res://.godot/imported/truck_town.glb-49b71606091d50bf5665443ce42e43d8.scn"] [params] @@ -29,11 +29,11 @@ _subresources={ "materials": { "grass": { "use_external/enabled": true, -"use_external/path": "res://materials/grass.tres" +"use_external/path": "res://town/materials/grass.tres" }, "road": { "use_external/enabled": true, -"use_external/path": "res://materials/cement.tres" +"use_external/path": "res://town/materials/cement.tres" } }, "nodes": { diff --git a/3d/truck_town/car_base.tscn b/3d/truck_town/vehicles/car_base.tscn similarity index 80% rename from 3d/truck_town/car_base.tscn rename to 3d/truck_town/vehicles/car_base.tscn index 7a128b96..93bf6457 100644 --- a/3d/truck_town/car_base.tscn +++ b/3d/truck_town/vehicles/car_base.tscn @@ -1,9 +1,9 @@ -[gd_scene load_steps=7 format=3 uid="uid://yuu24upxaw38"] +[gd_scene load_steps=7 format=3 uid="uid://c1uai3rvx8hul"] -[ext_resource type="Script" path="res://vehicle.gd" id="1"] -[ext_resource type="ArrayMesh" uid="uid://oj2qgrhsq5e5" path="res://meshes/wheel.res" id="2_mlrjy"] -[ext_resource type="ArrayMesh" uid="uid://cgxof0gvxjbag" path="res://meshes/minivan.res" id="4_wo1v3"] -[ext_resource type="Script" path="res://follow_camera.gd" id="5"] +[ext_resource type="Script" path="res://vehicles/vehicle.gd" id="1_r806m"] +[ext_resource type="ArrayMesh" uid="uid://s3nm456cy46b" path="res://vehicles/meshes/wheel.res" id="2_0cso8"] +[ext_resource type="ArrayMesh" uid="uid://d3ogs0rwex0kc" path="res://vehicles/meshes/minivan.res" id="3_tkg08"] +[ext_resource type="Script" path="res://vehicles/follow_camera.gd" id="4_6igu8"] [sub_resource type="PhysicsMaterial" id="1"] friction = 0.5 @@ -17,7 +17,7 @@ size = Vector3(0.954078, 1, 2.32662) transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, -0.00169557, 0.222867, -0.0955184) center_of_mass_mode = 1 physics_material_override = SubResource("1") -script = ExtResource("1") +script = ExtResource("1_r806m") [node name="Wheel1" type="VehicleWheel3D" parent="Body"] transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0.573678, 0.115169, 1.10416) @@ -32,7 +32,7 @@ damping_compression = 0.88 [node name="Wheel1" type="MeshInstance3D" parent="Body/Wheel1"] gi_mode = 2 -mesh = ExtResource("2_mlrjy") +mesh = ExtResource("2_0cso8") [node name="Wheel2" type="VehicleWheel3D" parent="Body"] transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0.573678, 0.115169, -0.783403) @@ -46,7 +46,7 @@ damping_compression = 0.88 [node name="Wheel2" type="MeshInstance3D" parent="Body/Wheel2"] gi_mode = 2 -mesh = ExtResource("2_mlrjy") +mesh = ExtResource("2_0cso8") [node name="Wheel3" type="VehicleWheel3D" parent="Body"] transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, -0.573678, 0.115169, 1.10416) @@ -61,7 +61,7 @@ damping_compression = 0.88 [node name="Wheel3" type="MeshInstance3D" parent="Body/Wheel3"] gi_mode = 2 -mesh = ExtResource("2_mlrjy") +mesh = ExtResource("2_0cso8") [node name="Wheel4" type="VehicleWheel3D" parent="Body"] transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, -0.573678, 0.115169, -0.783403) @@ -75,11 +75,11 @@ damping_compression = 0.88 [node name="Wheel4" type="MeshInstance3D" parent="Body/Wheel4"] gi_mode = 2 -mesh = ExtResource("2_mlrjy") +mesh = ExtResource("2_0cso8") [node name="Body" type="MeshInstance3D" parent="Body"] gi_mode = 2 -mesh = ExtResource("4_wo1v3") +mesh = ExtResource("3_tkg08") [node name="CollisionShape3D" type="CollisionShape3D" parent="Body"] transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0.588269, 0.0774262) @@ -93,6 +93,6 @@ transform = Transform3D(-0.709652, -0.170177, 0.683691, -2.11161e-08, 0.970391, current = true fov = 74.0 near = 0.1 -script = ExtResource("5") +script = ExtResource("4_6igu8") min_distance = 3.0 height = 1.25 diff --git a/3d/truck_town/follow_camera.gd b/3d/truck_town/vehicles/follow_camera.gd similarity index 100% rename from 3d/truck_town/follow_camera.gd rename to 3d/truck_town/vehicles/follow_camera.gd diff --git a/3d/truck_town/meshes/.gitignore b/3d/truck_town/vehicles/meshes/.gitignore similarity index 100% rename from 3d/truck_town/meshes/.gitignore rename to 3d/truck_town/vehicles/meshes/.gitignore diff --git a/3d/truck_town/meshes/meshes.glb b/3d/truck_town/vehicles/meshes/meshes.glb similarity index 100% rename from 3d/truck_town/meshes/meshes.glb rename to 3d/truck_town/vehicles/meshes/meshes.glb diff --git a/3d/truck_town/meshes/meshes.glb.import b/3d/truck_town/vehicles/meshes/meshes.glb.import similarity index 70% rename from 3d/truck_town/meshes/meshes.glb.import rename to 3d/truck_town/vehicles/meshes/meshes.glb.import index af3d2ade..b83660f3 100644 --- a/3d/truck_town/meshes/meshes.glb.import +++ b/3d/truck_town/vehicles/meshes/meshes.glb.import @@ -3,13 +3,13 @@ importer="scene" importer_version=1 type="PackedScene" -uid="uid://dsb8h0h6axw1b" -path="res://.godot/imported/meshes.glb-8f0c4b5a77cea1398eb09a33df9d7e1c.scn" +uid="uid://c4g2vx7lboxkr" +path="res://.godot/imported/meshes.glb-030ff425937f3e98d423cb5cef7ede3d.scn" [deps] -source_file="res://meshes/meshes.glb" -dest_files=["res://.godot/imported/meshes.glb-8f0c4b5a77cea1398eb09a33df9d7e1c.scn"] +source_file="res://vehicles/meshes/meshes.glb" +dest_files=["res://.godot/imported/meshes.glb-030ff425937f3e98d423cb5cef7ede3d.scn"] [params] @@ -29,19 +29,19 @@ _subresources={ "materials": { "car_blue": { "use_external/enabled": false, -"use_external/path": "res://materials/car_blue.tres" +"use_external/path": "res://town/materials/car_blue.tres" }, "car_yellow": { "use_external/enabled": false, -"use_external/path": "res://materials/car_red.tres" +"use_external/path": "res://town/materials/car_red.tres" }, "chrome": { "use_external/enabled": false, -"use_external/path": "res://materials/chrome.tres" +"use_external/path": "res://town/materials/chrome.tres" }, "truck_trailer": { "use_external/enabled": true, -"use_external/path": "res://materials/truck_trailer.tres" +"use_external/path": "res://vehicles/truck_trailer.tres" } }, "meshes": { @@ -53,7 +53,7 @@ _subresources={ "lods/normal_split_angle": 25.0, "save_to_file/enabled": true, "save_to_file/make_streamable": "", -"save_to_file/path": "res://meshes/minivan.res" +"save_to_file/path": "res://vehicles/meshes/minivan.res" }, "meshes_tow_truck": { "generate/lightmap_uv": 0, @@ -63,7 +63,7 @@ _subresources={ "lods/normal_split_angle": 25.0, "save_to_file/enabled": true, "save_to_file/make_streamable": "", -"save_to_file/path": "res://meshes/tow_truck.res" +"save_to_file/path": "res://vehicles/meshes/tow_truck.res" }, "meshes_truck_cab": { "generate/lightmap_uv": 0, @@ -73,7 +73,7 @@ _subresources={ "lods/normal_split_angle": 25.0, "save_to_file/enabled": true, "save_to_file/make_streamable": "", -"save_to_file/path": "res://meshes/truck_cab.res" +"save_to_file/path": "res://vehicles/meshes/truck_cab.res" }, "meshes_truck_trailer": { "generate/lightmap_uv": 0, @@ -83,7 +83,7 @@ _subresources={ "lods/normal_split_angle": 25.0, "save_to_file/enabled": true, "save_to_file/make_streamable": "", -"save_to_file/path": "res://meshes/truck_trailer.res" +"save_to_file/path": "res://vehicles/meshes/truck_trailer.res" }, "meshes_wheel": { "generate/lightmap_uv": 0, @@ -93,7 +93,7 @@ _subresources={ "lods/normal_split_angle": 25.0, "save_to_file/enabled": true, "save_to_file/make_streamable": "", -"save_to_file/path": "res://meshes/wheel.res" +"save_to_file/path": "res://vehicles/meshes/wheel.res" } } } diff --git a/3d/truck_town/tow_truck.tscn b/3d/truck_town/vehicles/tow_truck.tscn similarity index 89% rename from 3d/truck_town/tow_truck.tscn rename to 3d/truck_town/vehicles/tow_truck.tscn index 1c07855d..169e9486 100644 --- a/3d/truck_town/tow_truck.tscn +++ b/3d/truck_town/vehicles/tow_truck.tscn @@ -1,10 +1,10 @@ -[gd_scene load_steps=11 format=3 uid="uid://diu58mh8lj32g"] +[gd_scene load_steps=11 format=3 uid="uid://bh7765vrq5muf"] -[ext_resource type="Script" path="res://vehicle.gd" id="1"] -[ext_resource type="ArrayMesh" uid="uid://oj2qgrhsq5e5" path="res://meshes/wheel.res" id="2_n7jm5"] -[ext_resource type="ArrayMesh" uid="uid://ctfu7dwcrn40o" path="res://meshes/tow_truck.res" id="3_cphb6"] -[ext_resource type="Script" path="res://follow_camera.gd" id="5"] -[ext_resource type="ArrayMesh" uid="uid://cgxof0gvxjbag" path="res://meshes/minivan.res" id="5_virr6"] +[ext_resource type="Script" path="res://vehicles/vehicle.gd" id="1_qhfnb"] +[ext_resource type="ArrayMesh" uid="uid://s3nm456cy46b" path="res://vehicles/meshes/wheel.res" id="2_b8qij"] +[ext_resource type="ArrayMesh" uid="uid://dd70tx11n3531" path="res://vehicles/meshes/tow_truck.res" id="3_7c8iv"] +[ext_resource type="Script" path="res://vehicles/follow_camera.gd" id="4_wddne"] +[ext_resource type="ArrayMesh" uid="uid://d3ogs0rwex0kc" path="res://vehicles/meshes/minivan.res" id="5_ukw0p"] [sub_resource type="BoxShape3D" id="6"] size = Vector3(1.17624, 0.6963, 2.23996) @@ -28,7 +28,7 @@ size = Vector3(0.954078, 1, 2.32662) [node name="Body" type="VehicleBody3D" parent="."] transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, -0.00169557, 0.222867, -0.0955184) center_of_mass_mode = 1 -script = ExtResource("1") +script = ExtResource("1_qhfnb") [node name="Wheel1" type="VehicleWheel3D" parent="Body"] transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0.573678, 0.000773743, 1.10416) @@ -42,7 +42,7 @@ damping_compression = 0.88 [node name="Wheel1" type="MeshInstance3D" parent="Body/Wheel1"] gi_mode = 2 -mesh = ExtResource("2_n7jm5") +mesh = ExtResource("2_b8qij") [node name="Wheel2" type="VehicleWheel3D" parent="Body"] transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0.573678, 0.000773743, -0.783403) @@ -55,7 +55,7 @@ damping_compression = 0.88 [node name="Wheel2" type="MeshInstance3D" parent="Body/Wheel2"] gi_mode = 2 -mesh = ExtResource("2_n7jm5") +mesh = ExtResource("2_b8qij") [node name="Wheel3" type="VehicleWheel3D" parent="Body"] transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, -0.573678, 0.000773743, 1.10416) @@ -69,7 +69,7 @@ damping_compression = 0.88 [node name="Wheel3" type="MeshInstance3D" parent="Body/Wheel3"] gi_mode = 2 -mesh = ExtResource("2_n7jm5") +mesh = ExtResource("2_b8qij") [node name="Wheel4" type="VehicleWheel3D" parent="Body"] transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, -0.573678, 0.000773743, -0.783403) @@ -82,11 +82,11 @@ damping_compression = 0.88 [node name="Wheel4" type="MeshInstance3D" parent="Body/Wheel4"] gi_mode = 2 -mesh = ExtResource("2_n7jm5") +mesh = ExtResource("2_b8qij") [node name="Body" type="MeshInstance3D" parent="Body"] gi_mode = 2 -mesh = ExtResource("3_cphb6") +mesh = ExtResource("3_7c8iv") [node name="CameraBase" type="Node3D" parent="Body"] transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 1.97449, 0) @@ -96,7 +96,7 @@ transform = Transform3D(-0.709652, -0.170177, 0.683691, -2.11161e-08, 0.970391, current = true fov = 74.0 near = 0.1 -script = ExtResource("5") +script = ExtResource("4_wddne") min_distance = 5.0 max_distance = 7.0 height = 1.75 @@ -202,7 +202,7 @@ damping_compression = 0.88 [node name="Wheel1" type="MeshInstance3D" parent="Body2/Wheel1"] gi_mode = 2 -mesh = ExtResource("2_n7jm5") +mesh = ExtResource("2_b8qij") [node name="Wheel2" type="VehicleWheel3D" parent="Body2"] transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0.573678, 0.115169, -0.783403) @@ -216,7 +216,7 @@ damping_compression = 0.88 [node name="Wheel2" type="MeshInstance3D" parent="Body2/Wheel2"] gi_mode = 2 -mesh = ExtResource("2_n7jm5") +mesh = ExtResource("2_b8qij") [node name="Wheel3" type="VehicleWheel3D" parent="Body2"] transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, -0.573678, 0.115169, 1.10416) @@ -231,7 +231,7 @@ damping_compression = 0.88 [node name="Wheel3" type="MeshInstance3D" parent="Body2/Wheel3"] gi_mode = 2 -mesh = ExtResource("2_n7jm5") +mesh = ExtResource("2_b8qij") [node name="Wheel4" type="VehicleWheel3D" parent="Body2"] transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, -0.573678, 0.115169, -0.783403) @@ -245,11 +245,11 @@ damping_compression = 0.88 [node name="Wheel4" type="MeshInstance3D" parent="Body2/Wheel4"] gi_mode = 2 -mesh = ExtResource("2_n7jm5") +mesh = ExtResource("2_b8qij") [node name="Body" type="MeshInstance3D" parent="Body2"] gi_mode = 2 -mesh = ExtResource("5_virr6") +mesh = ExtResource("5_ukw0p") [node name="CollisionShape3D" type="CollisionShape3D" parent="Body2"] transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0.588269, 0.0774262) diff --git a/3d/truck_town/trailer_truck.tscn b/3d/truck_town/vehicles/trailer_truck.tscn similarity index 83% rename from 3d/truck_town/trailer_truck.tscn rename to 3d/truck_town/vehicles/trailer_truck.tscn index 2fc5edcf..f5c6efa6 100644 --- a/3d/truck_town/trailer_truck.tscn +++ b/3d/truck_town/vehicles/trailer_truck.tscn @@ -1,10 +1,10 @@ -[gd_scene load_steps=8 format=3 uid="uid://c2a3htgr3fdfu"] +[gd_scene load_steps=8 format=3 uid="uid://drinprblemj5u"] -[ext_resource type="ArrayMesh" uid="uid://oj2qgrhsq5e5" path="res://meshes/wheel.res" id="2_fnklw"] -[ext_resource type="ArrayMesh" uid="uid://cdk50iokjxakx" path="res://meshes/truck_cab.res" id="3_30otl"] -[ext_resource type="Script" path="res://vehicle.gd" id="4"] -[ext_resource type="Script" path="res://follow_camera.gd" id="5"] -[ext_resource type="ArrayMesh" uid="uid://dkgnxofmrsu5n" path="res://meshes/truck_trailer.res" id="5_8pblj"] +[ext_resource type="Script" path="res://vehicles/vehicle.gd" id="1_wetfm"] +[ext_resource type="ArrayMesh" uid="uid://s3nm456cy46b" path="res://vehicles/meshes/wheel.res" id="2_2mkj4"] +[ext_resource type="ArrayMesh" uid="uid://bjqn7crf4tlke" path="res://vehicles/meshes/truck_cab.res" id="3_8j276"] +[ext_resource type="Script" path="res://vehicles/follow_camera.gd" id="4_4yhuf"] +[ext_resource type="ArrayMesh" uid="uid://c01p2iyko2mx7" path="res://vehicles/meshes/truck_trailer.res" id="5_cgx5y"] [sub_resource type="BoxShape3D" id="14"] size = Vector3(1.3392, 1.04159, 2.3947) @@ -17,7 +17,7 @@ size = Vector3(1.49783, 1.38835, 3.94168) [node name="Body" type="VehicleBody3D" parent="."] transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, -0.00169557, 0.222867, -0.0955184) center_of_mass_mode = 1 -script = ExtResource("4") +script = ExtResource("1_wetfm") [node name="Wheel1" type="VehicleWheel3D" parent="Body"] transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0.573678, 0.000773743, 1.10416) @@ -31,7 +31,7 @@ damping_compression = 0.88 [node name="Wheel1" type="MeshInstance3D" parent="Body/Wheel1"] gi_mode = 2 -mesh = ExtResource("2_fnklw") +mesh = ExtResource("2_2mkj4") [node name="Wheel2" type="VehicleWheel3D" parent="Body"] transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0.573678, 0.000773743, -0.783403) @@ -44,7 +44,7 @@ damping_compression = 0.88 [node name="Wheel2" type="MeshInstance3D" parent="Body/Wheel2"] gi_mode = 2 -mesh = ExtResource("2_fnklw") +mesh = ExtResource("2_2mkj4") [node name="Wheel3" type="VehicleWheel3D" parent="Body"] transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, -0.573678, 0.000773743, 1.10416) @@ -58,7 +58,7 @@ damping_compression = 0.88 [node name="Wheel3" type="MeshInstance3D" parent="Body/Wheel3"] gi_mode = 2 -mesh = ExtResource("2_fnklw") +mesh = ExtResource("2_2mkj4") [node name="Wheel4" type="VehicleWheel3D" parent="Body"] transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, -0.573678, 0.000773743, -0.783403) @@ -71,11 +71,11 @@ damping_compression = 0.88 [node name="Wheel4" type="MeshInstance3D" parent="Body/Wheel4"] gi_mode = 2 -mesh = ExtResource("2_fnklw") +mesh = ExtResource("2_2mkj4") [node name="Body" type="MeshInstance3D" parent="Body"] gi_mode = 2 -mesh = ExtResource("3_30otl") +mesh = ExtResource("3_8j276") [node name="CollisionShape3D" type="CollisionShape3D" parent="Body"] transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0.571059, 0.132248) @@ -89,7 +89,7 @@ transform = Transform3D(-0.709652, -0.170177, 0.683691, -2.11161e-08, 0.970391, current = true fov = 74.0 near = 0.1 -script = ExtResource("5") +script = ExtResource("4_4yhuf") min_distance = 5.0 max_distance = 7.0 height = 2.5 @@ -108,7 +108,7 @@ damping_compression = 0.88 [node name="TWheel1" type="MeshInstance3D" parent="Trailer/TWheel1"] gi_mode = 2 -mesh = ExtResource("2_fnklw") +mesh = ExtResource("2_2mkj4") [node name="TWheel2" type="VehicleWheel3D" parent="Trailer"] transform = Transform3D(1, 0, 0, 0, 1, -1.49012e-08, 0, 0, 1, 0.573678, -0.402732, -0.600809) @@ -120,7 +120,7 @@ damping_compression = 0.88 [node name="TWheel2" type="MeshInstance3D" parent="Trailer/TWheel2"] gi_mode = 2 -mesh = ExtResource("2_fnklw") +mesh = ExtResource("2_2mkj4") [node name="TWheel3" type="VehicleWheel3D" parent="Trailer"] transform = Transform3D(1, 0, 0, 0, 1, -1.49012e-08, 0, 0, 1, -0.573678, -0.402732, -1.53277) @@ -132,7 +132,7 @@ damping_compression = 0.88 [node name="TWheel3" type="MeshInstance3D" parent="Trailer/TWheel3"] gi_mode = 2 -mesh = ExtResource("2_fnklw") +mesh = ExtResource("2_2mkj4") [node name="TWheel4" type="VehicleWheel3D" parent="Trailer"] transform = Transform3D(1, 0, 0, 0, 1, -1.49012e-08, 0, 0, 1, -0.573678, -0.402732, -0.600809) @@ -144,11 +144,11 @@ damping_compression = 0.88 [node name="TWheel4" type="MeshInstance3D" parent="Trailer/TWheel4"] gi_mode = 2 -mesh = ExtResource("2_fnklw") +mesh = ExtResource("2_2mkj4") [node name="Trailer" type="MeshInstance3D" parent="Trailer"] gi_mode = 2 -mesh = ExtResource("5_8pblj") +mesh = ExtResource("5_cgx5y") [node name="CollisionShape3D" type="CollisionShape3D" parent="Trailer"] transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0.383046, -0.0335202) diff --git a/3d/truck_town/textures/truck_trailer.png b/3d/truck_town/vehicles/truck_trailer.png similarity index 100% rename from 3d/truck_town/textures/truck_trailer.png rename to 3d/truck_town/vehicles/truck_trailer.png diff --git a/3d/truck_town/textures/truck_trailer.png.import b/3d/truck_town/vehicles/truck_trailer.png.import similarity index 58% rename from 3d/truck_town/textures/truck_trailer.png.import rename to 3d/truck_town/vehicles/truck_trailer.png.import index 0e1e2568..a26cbd23 100644 --- a/3d/truck_town/textures/truck_trailer.png.import +++ b/3d/truck_town/vehicles/truck_trailer.png.import @@ -3,8 +3,8 @@ importer="texture" type="CompressedTexture2D" uid="uid://q7uvsiqefkwr" -path.s3tc="res://.godot/imported/truck_trailer.png-1c486d64b51a1c6bf88af1f04ce48ecf.s3tc.ctex" -path.etc2="res://.godot/imported/truck_trailer.png-1c486d64b51a1c6bf88af1f04ce48ecf.etc2.ctex" +path.s3tc="res://.godot/imported/truck_trailer.png-37383ff0a7e2053e450f6ec8ff2bdcae.s3tc.ctex" +path.etc2="res://.godot/imported/truck_trailer.png-37383ff0a7e2053e450f6ec8ff2bdcae.etc2.ctex" metadata={ "imported_formats": ["s3tc", "etc2"], "vram_texture": true @@ -12,8 +12,8 @@ metadata={ [deps] -source_file="res://textures/truck_trailer.png" -dest_files=["res://.godot/imported/truck_trailer.png-1c486d64b51a1c6bf88af1f04ce48ecf.s3tc.ctex", "res://.godot/imported/truck_trailer.png-1c486d64b51a1c6bf88af1f04ce48ecf.etc2.ctex"] +source_file="res://vehicles/truck_trailer.png" +dest_files=["res://.godot/imported/truck_trailer.png-37383ff0a7e2053e450f6ec8ff2bdcae.s3tc.ctex", "res://.godot/imported/truck_trailer.png-37383ff0a7e2053e450f6ec8ff2bdcae.etc2.ctex"] [params] diff --git a/3d/truck_town/vehicles/truck_trailer.tres b/3d/truck_town/vehicles/truck_trailer.tres new file mode 100644 index 00000000..8cba5af3 --- /dev/null +++ b/3d/truck_town/vehicles/truck_trailer.tres @@ -0,0 +1,7 @@ +[gd_resource type="StandardMaterial3D" load_steps=2 format=3] + +[ext_resource type="Texture2D" path="res://vehicles/truck_trailer.png" id="1_jkh55"] + +[resource] +albedo_texture = ExtResource("1_jkh55") +roughness = 0.6 diff --git a/3d/truck_town/vehicle.gd b/3d/truck_town/vehicles/vehicle.gd similarity index 100% rename from 3d/truck_town/vehicle.gd rename to 3d/truck_town/vehicles/vehicle.gd