From c7095a5b5d7320f6d4450f9b9a87509daae5963a Mon Sep 17 00:00:00 2001 From: Sara Date: Fri, 17 May 2024 12:54:20 +0200 Subject: [PATCH] feat: imported hatchback vehicle model --- godot/Models/SM_Veh_Hatch_01.fbx | 3 ++ godot/Models/SM_Veh_Hatch_01.fbx.import | 34 +++++++++++++ godot/car_player.tscn | 66 +++++++++++++++++-------- 3 files changed, 83 insertions(+), 20 deletions(-) create mode 100644 godot/Models/SM_Veh_Hatch_01.fbx create mode 100644 godot/Models/SM_Veh_Hatch_01.fbx.import diff --git a/godot/Models/SM_Veh_Hatch_01.fbx b/godot/Models/SM_Veh_Hatch_01.fbx new file mode 100644 index 0000000..7563eb1 --- /dev/null +++ b/godot/Models/SM_Veh_Hatch_01.fbx @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:932f869c649420a4d16b7ca90079e11803955c44c2a399e862945fff6c715737 +size 657872 diff --git a/godot/Models/SM_Veh_Hatch_01.fbx.import b/godot/Models/SM_Veh_Hatch_01.fbx.import new file mode 100644 index 0000000..016696c --- /dev/null +++ b/godot/Models/SM_Veh_Hatch_01.fbx.import @@ -0,0 +1,34 @@ +[remap] + +importer="scene" +importer_version=1 +type="PackedScene" +uid="uid://bm2mavtmnbaw1" +path="res://.godot/imported/SM_Veh_Hatch_01.fbx-808dd9f7b5a0661a4accdc1ede282614.scn" + +[deps] + +source_file="res://Models/SM_Veh_Hatch_01.fbx" +dest_files=["res://.godot/imported/SM_Veh_Hatch_01.fbx-808dd9f7b5a0661a4accdc1ede282614.scn"] + +[params] + +nodes/root_type="" +nodes/root_name="" +nodes/apply_root_scale=true +nodes/root_scale=1.0 +meshes/ensure_tangents=true +meshes/generate_lods=true +meshes/create_shadow_meshes=true +meshes/light_baking=1 +meshes/lightmap_texel_size=0.2 +meshes/force_disable_compression=false +skins/use_named_skins=true +animation/import=true +animation/fps=30 +animation/trimming=false +animation/remove_immutable_tracks=true +import_script/path="" +_subresources={} +gltf/naming_version=1 +gltf/embedded_image_handling=1 diff --git a/godot/car_player.tscn b/godot/car_player.tscn index 567ebaf..d15452b 100644 --- a/godot/car_player.tscn +++ b/godot/car_player.tscn @@ -1,4 +1,14 @@ -[gd_scene load_steps=5 format=3 uid="uid://dkvgi7x2epurk"] +[gd_scene load_steps=8 format=3 uid="uid://dkvgi7x2epurk"] + +[ext_resource type="PackedScene" uid="uid://bm2mavtmnbaw1" path="res://Models/SM_Veh_Hatch_01.fbx" id="1_22x2m"] + +[sub_resource type="Curve" id="Curve_dpk6q"] +_data = [Vector2(0.962441, 0), 0.0, 0.0, 0, 0, Vector2(1, 1), 0.0, 0.0, 0, 0] +point_count = 2 + +[sub_resource type="Curve" id="Curve_htvme"] +_data = [Vector2(0.683099, 0), 0.0, 0.0, 0, 0, Vector2(0.823944, 0.230769), 0.0615885, 0.0615885, 0, 0] +point_count = 2 [sub_resource type="PhysicsMaterial" id="PhysicsMaterial_vwjm3"] friction = 0.0 @@ -6,34 +16,50 @@ rough = true absorbent = true [sub_resource type="BoxShape3D" id="BoxShape3D_upk84"] -size = Vector3(2, 4, 1.55) +size = Vector3(2, 3.1515, 1.28965) -[sub_resource type="BoxMesh" id="BoxMesh_xt30h"] -size = Vector3(2, 1.55, 4) +[sub_resource type="CapsuleShape3D" id="CapsuleShape3D_ctfk0"] +radius = 0.613691 -[sub_resource type="BoxMesh" id="BoxMesh_t424e"] -size = Vector3(1.4, 1.43, 0.465) +[sub_resource type="CapsuleShape3D" id="CapsuleShape3D_p38n5"] +radius = 0.48558 [node name="CarPlayer" type="CarPlayer"] -transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0.709296, 0) +oversteer_curve = SubResource("Curve_dpk6q") +oversteer_curve_x_scale = 40.0 +understeer_curve = SubResource("Curve_htvme") +understeer_curve_x_scale = 40.0 mass = 1000.0 physics_material_override = SubResource("PhysicsMaterial_vwjm3") center_of_mass_mode = 1 can_sleep = false custom_integrator = true continuous_cd = true - -[node name="CollisionShape3D" type="CollisionShape3D" parent="."] -transform = Transform3D(1, 0, 0, 0, -4.37114e-08, -1, 0, 1, -4.37114e-08, 0, 0.818, 0) -shape = SubResource("BoxShape3D_upk84") - -[node name="MeshInstance3D" type="MeshInstance3D" parent="."] -transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0.818, 0) -mesh = SubResource("BoxMesh_xt30h") - -[node name="MeshInstance3D2" type="MeshInstance3D" parent="."] -transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0.867176, 2.12183) -mesh = SubResource("BoxMesh_t424e") +max_contacts_reported = 128 +contact_monitor = true [node name="Camera3D" type="Camera3D" parent="."] -transform = Transform3D(-1, 0, -8.74228e-08, -2.87879e-08, 0.944227, 0.329295, 8.25469e-08, 0.329295, -0.944227, 0, 6.34508, -6.93722) +transform = Transform3D(-1, -1.1349e-08, -8.6683e-08, -2.87879e-08, 0.978985, 0.203932, 8.25469e-08, 0.203932, -0.978985, -2.84217e-14, 2.56194, -4.10697) + +[node name="Body" type="CollisionShape3D" parent="."] +transform = Transform3D(1, 0, 0, 0, -4.37114e-08, -1, 0, 1, -4.37114e-08, 0, 0.687824, 0.174572) +shape = SubResource("BoxShape3D_upk84") + +[node name="Front" type="CollisionShape3D" parent="."] +transform = Transform3D(-4.37114e-08, 1, 0, -1, -4.37114e-08, 0, 0, 0, 1, 0, 0.698268, 1.75074) +shape = SubResource("CapsuleShape3D_ctfk0") + +[node name="Back" type="CollisionShape3D" parent="."] +transform = Transform3D(-4.37114e-08, 1, 0, -1, -4.37114e-08, 0, 0, 0, 1, 0, 0.698268, -1.42338) +shape = SubResource("CapsuleShape3D_ctfk0") + +[node name="FrontWheels" type="CollisionShape3D" parent="."] +transform = Transform3D(-4.37114e-08, 1, 0, -1, -4.37114e-08, 0, 0, 0, 1, 0, 0.156071, 1.51353) +shape = SubResource("CapsuleShape3D_p38n5") + +[node name="BackWheels" type="CollisionShape3D" parent="."] +transform = Transform3D(-4.37114e-08, 1, 0, -1, -4.37114e-08, 0, 0, 0, 1, 0, 0.156071, -1.52522) +shape = SubResource("CapsuleShape3D_p38n5") + +[node name="Mesh" parent="." instance=ExtResource("1_22x2m")] +transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, -0.372761, 0)