浏览代码

:beetle: Fix jeep wheels passing through ground

DricomDragon 1 年之前
父节点
当前提交
31aee9c439
共有 2 个文件被更改,包括 33 次插入16 次删除
  1. 11 8
      first3d/component/entity/vehicles/jeep/Jeep.tscn
  2. 22 8
      first3d/run/levels/infinite_level.tscn

+ 11 - 8
first3d/component/entity/vehicles/jeep/Jeep.tscn

@@ -7,48 +7,51 @@
 size = Vector3(1, 0.769157, 3.09562)
 
 [node name="Jeep" type="VehicleBody3D"]
+transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, -1.25362, 0)
 collision_layer = 8
 collision_mask = 11
-mass = 500.0
-engine_force = 43.42
-steering = -0.253945
+mass = 400.0
 
 [node name="OrangeJeep_noWheel" parent="." instance=ExtResource("1_qgclq")]
 transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, -1, 0, 0, 0)
 
 [node name="CollisionShape3D" type="CollisionShape3D" parent="."]
-transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0.925237, 0)
+transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0.925237, 0.00334018)
 shape = SubResource("BoxShape3D_1maan")
 
 [node name="FrontRightWheel" type="VehicleWheel3D" parent="."]
 transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, -0.6, 0.2, 1)
-steering = -0.253945
 use_as_steering = true
+wheel_roll_influence = 0.4
 wheel_radius = 0.3
+suspension_stiffness = 50.0
 
 [node name="OrangeJeep_wheel" parent="FrontRightWheel" instance=ExtResource("2_f6y5a")]
 transform = Transform3D(-1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0)
 
 [node name="FrontLeftWheel" type="VehicleWheel3D" parent="."]
 transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0.6, 0.2, 1)
-steering = -0.253945
 use_as_steering = true
+wheel_roll_influence = 0.4
 wheel_radius = 0.3
+suspension_stiffness = 50.0
 
 [node name="OrangeJeep_wheel" parent="FrontLeftWheel" instance=ExtResource("2_f6y5a")]
 
 [node name="RearLeftWheel" type="VehicleWheel3D" parent="."]
 transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0.6, 0.2, -1.01869)
-engine_force = 43.42
 use_as_traction = true
+wheel_roll_influence = 0.4
 wheel_radius = 0.3
+suspension_stiffness = 50.0
 
 [node name="OrangeJeep_wheel" parent="RearLeftWheel" instance=ExtResource("2_f6y5a")]
 
 [node name="RearRightWheel" type="VehicleWheel3D" parent="."]
 transform = Transform3D(-1, 0, 0, 0, 1, 0, 0, 0, 1, -0.6, 0.2, -1.019)
-engine_force = 43.42
 use_as_traction = true
+wheel_roll_influence = 0.4
 wheel_radius = 0.3
+suspension_stiffness = 50.0
 
 [node name="OrangeJeep_wheel" parent="RearRightWheel" instance=ExtResource("2_f6y5a")]

+ 22 - 8
first3d/run/levels/infinite_level.tscn

@@ -7,7 +7,8 @@
 [ext_resource type="PackedScene" uid="uid://dao17ylietgyl" path="res://component/entity/vehicles/plane/tiny_plane.tscn" id="4_tbpfc"]
 [ext_resource type="PackedScene" uid="uid://cj5dmtqadl5nf" path="res://component/entity/vehicles/jeep/Jeep.tscn" id="6_nnvc5"]
 
-[sub_resource type="WorldBoundaryShape3D" id="WorldBoundaryShape3D_2xulb"]
+[sub_resource type="BoxShape3D" id="BoxShape3D_ctk0t"]
+size = Vector3(500, 10, 500)
 
 [sub_resource type="QuadMesh" id="QuadMesh_dt8nl"]
 size = Vector2(500, 500)
@@ -19,8 +20,9 @@ orientation = 1
 transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, -1, 0)
 collision_mask = 0
 
-[node name="InfinitePlan" type="CollisionShape3D" parent="Ground"]
-shape = SubResource("WorldBoundaryShape3D_2xulb")
+[node name="Shape" type="CollisionShape3D" parent="Ground"]
+transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, -5, 0)
+shape = SubResource("BoxShape3D_ctk0t")
 
 [node name="MeshInstance3D" type="MeshInstance3D" parent="Ground"]
 mesh = SubResource("QuadMesh_dt8nl")
@@ -30,14 +32,14 @@ transform = Transform3D(1, 0, 0, 0, 0.734358, 0.678762, 0, -0.678762, 0.734358,
 shadow_enabled = true
 
 [node name="CameraTracker" type="Camera3D" parent="."]
-transform = Transform3D(1, 0, 0, 0, 0.944949, 0.327218, 0, -0.327218, 0.944949, -10, 11.1852, 3.2779)
+transform = Transform3D(1, 0, 0, 0, 0.944949, 0.327218, 0, -0.327218, 0.944949, -10, 4.55409, -0.975595)
 current = true
 script = ExtResource("1_qdm47")
 max_distance = 6.0
 camera_height = 2.0
 
 [node name="MainWalker" parent="." instance=ExtResource("1_x0026")]
-transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, -10, 9, 0)
+transform = Transform3D(0.701432, 0, 0.712736, 0, 1, 0, -0.712736, 0, 0.701432, -11.0852, 1.31191, -4.00841)
 
 [node name="Control" parent="MainWalker" instance=ExtResource("2_0i5t8")]
 
@@ -55,14 +57,26 @@ transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, -6.2632, -0.5, -7.95074)
 [node name="Box3" parent="Boxes" instance=ExtResource("2_e8xto")]
 transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, -5.53697, 1.42774, -11.1883)
 
+[node name="Box4" parent="Boxes" instance=ExtResource("2_e8xto")]
+transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, -15.8675, 0, -8.18967)
+
+[node name="Box5" parent="Boxes" instance=ExtResource("2_e8xto")]
+transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, -16.5707, 0, -5.78347)
+
+[node name="Box6" parent="Boxes" instance=ExtResource("2_e8xto")]
+transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, -17.1773, 0, -8.17952)
+
 [node name="TinyPlane" parent="." instance=ExtResource("4_tbpfc")]
 transform = Transform3D(0.477312, 0.527326, -0.702923, -0.741391, 0.671074, 0, 0.471713, 0.521141, 0.711266, -76.6685, 15.7672, 53.8067)
 
 [node name="TinyPlane2" parent="." instance=ExtResource("4_tbpfc")]
-transform = Transform3D(-0.589079, -0.650805, -0.478999, -0.741391, 0.671074, 1.34747e-08, 0.321443, 0.355125, -0.877816, -10.5959, 3.94108, -6.48481)
+transform = Transform3D(-0.589079, -0.650805, -0.478999, -0.741391, 0.671074, 1.34747e-08, 0.321443, 0.355125, -0.877816, -10.5959, 3.94108, -17.5095)
+
+[node name="Jeep1" parent="." instance=ExtResource("6_nnvc5")]
+transform = Transform3D(1, 0, 0, 0, 0.956386, -0.292105, 0, 0.292105, 0.956386, -16.454, 1.16515, -7.30216)
 
-[node name="Jeep" parent="." instance=ExtResource("6_nnvc5")]
-transform = Transform3D(1, 0, 0, 0, 0.956386, -0.292105, 0, 0.292105, 0.956386, -16.454, 5.25324, -7.30216)
+[node name="Jeep2" parent="." instance=ExtResource("6_nnvc5")]
+transform = Transform3D(1, 0, 0, 0, 0.956386, -0.292105, 0, 0.292105, 0.956386, -13.4204, 0.313514, -7.30216)
 
 [connection signal="focus_required" from="MainWalker" to="CameraTracker" method="_on_focus_required"]
 [connection signal="dir_changed" from="MainWalker/Control" to="MainWalker" method="_on_dir_changed"]