diff options
| author | Xavier Del Campo Romero <xavi.dcr@tutanota.com> | 2022-06-06 04:25:06 +0200 |
|---|---|---|
| committer | Xavier Del Campo Romero <xavi.dcr@tutanota.com> | 2022-06-06 04:25:19 +0200 |
| commit | abc27d4d6b590fbf6adb2fe136208df0ebe2deeb (patch) | |
| tree | e1cb6eccc8958a99b6432faf9d2fd459d30b589c /car.tscn | |
| parent | 3cb24b9d4d23b875cc7719c56cd4a664a9ec1b19 (diff) | |
| download | car-abc27d4d6b590fbf6adb2fe136208df0ebe2deeb.tar.gz | |
Better handling, handbrake, follow camera
Diffstat (limited to 'car.tscn')
| -rw-r--r-- | car.tscn | 159 |
1 files changed, 99 insertions, 60 deletions
@@ -1,93 +1,132 @@ -[gd_scene load_steps=7 format=2] +[gd_scene load_steps=12 format=2] [ext_resource path="res://car.gd" type="Script" id=1] [ext_resource path="res://Spatial.gd" type="Script" id=2] +[ext_resource path="res://nimrud/nimrud.obj" type="ArrayMesh" id=3] +[ext_resource path="res://nimrud/wheel.obj" type="ArrayMesh" id=4] +[ext_resource path="res://nimrud/nimrud.png" type="Texture" id=5] -[sub_resource type="CubeMesh" id=1] -size = Vector3( 1.5, 0.5, 3 ) +[sub_resource type="SpatialMaterial" id=14] +albedo_texture = ExtResource( 5 ) +metallic = 0.44 -[sub_resource type="ConvexPolygonShape" id=2] -points = PoolVector3Array( -0.7225, -0.25, -1.43083, -0.7225, -0.25, 1.43083, -0.694167, 0.25, -1.37472, -0.694167, 0.25, 1.37472, 0.694167, 0.25, -1.37472, 0.694167, 0.25, 1.37472, 0.7225, -0.25, -1.43083, 0.7225, -0.25, 1.43083 ) +[sub_resource type="ConvexPolygonShape" id=18] +points = PoolVector3Array( -1.13796, 2.68186, 0.956256, 1.71697, 3.50819, 0.129863, -1.73953, 3.50819, 0.129863, 0.8487, 2.62735, 0.148826, 1.54339, 2.63334, 0.861018, -1.06318, 3.50819, 0.805863, -1.73953, 2.60667, 0.430326, 1.64118, 3.35789, 0.805863, 1.71697, 2.60667, 0.430326, -1.58897, 3.35789, 0.805863, -0.8606, 2.63268, 0.153711, 0.739841, 2.90726, 0.956256, 1.04063, 3.50819, 0.805863, 1.1154, 2.60667, 0.956256, -1.50403, 2.63093, 0.862824, 1.64118, 3.05738, 0.881019, -1.58897, 3.05738, 0.881019, -1.58897, 3.50819, 0.730707, -1.13796, 2.60667, 0.956256, 1.56641, 3.50819, 0.730707, -0.987733, 3.20759, 0.881019, -1.73953, 3.43299, 0.129863, 1.71697, 3.43299, 0.129863, -0.987733, 2.75696, 0.956256 ) -[sub_resource type="CylinderMesh" id=3] -top_radius = 0.4 -bottom_radius = 0.4 -height = 0.25 -radial_segments = 12 +[sub_resource type="ConvexPolygonShape" id=19] +points = PoolVector3Array( 1.11904, 0.846649, 1.50608, -1.73953, -2.65332, 0.355464, -1.60043, -2.50534, 0.661949, 1.79211, -2.65332, 0.355464, -0.161421, 1.10375, -0.546571, -1.20401, 0.983175, 1.36364, 0.0636276, -1.97663, 2.00823, 1.70892, 1.09505, -0.465482, -1.63078, -1.55025, -0.4679, -1.70196, 1.06378, -0.445476, 1.416, -2.35249, -0.321, 0.851211, -2.56856, 1.73521, -0.864973, -2.55798, 1.72928, -0.9219, 0.208148, 1.7845, 1.69242, -1.55449, -0.474217, -0.150249, 0.991942, 1.72006, 1.48381, 1.00305, 0.872836, -1.43877, -2.42751, -0.245726, 0.903194, 0.27689, 1.78287, -1.64933, 1.0078, 0.303445, 0.2761, -2.34622, -0.411935, 1.10494, -2.51459, 1.49607, 0.8487, -2.5631, -0.127167, 1.56054, 0.652367, 0.802085, -1.53675, 0.128032, 0.800201, -1.13981, -2.54232, 1.43768, 0.98489, 1.00063, 1.58288, 1.70697, 0.512281, 0.158868, -1.00112, 0.997033, 1.58115, 0.200502, 0.759394, 1.77686, 1.65964, -1.53915, 0.661437, -0.921046, -1.19556, 1.78355, 0.900943, -1.26417, 1.78018, -1.43877, -2.35249, -0.321, 1.04244, 0.557007, 1.64181, -0.430149, 0.630361, 1.78478, -0.8606, -2.54923, -0.120516, -1.58413, -0.911289, 0.730832, -0.98813, -1.33406, 1.71037, -1.47824, 0.974774, 0.870577, -0.011043, -1.97663, 2.00823, 1.61832, 0.994371, 0.447975, -0.0791468, -1.82869, -0.4643, 1.68809, -2.54265, 0.589624, 1.0379, -1.05348, 1.63775, 0.971817, -1.96545, 1.71113, -0.853881, 0.704217, 1.71686, -0.990762, 0.417757, 1.71291, 0.912394, 0.642853, 1.7229, 1.416, -2.42751, -0.245726, -0.921546, -2.45947, 1.71377, 0.551835, 0.557557, 1.78269, 1.61615, -0.421641, 0.730832, 1.71693, 0.519908, -0.419875, -1.62067, 0.0659307, -0.460586, 0.910342, -2.5429, 1.7206, -0.148346, 0.763164, 1.77943, 1.25308, 0.978156, 1.29159, 0.201111, 0.974711, 1.71041, 0.275374, -2.41278, -0.337725 ) -[sub_resource type="SpatialMaterial" id=4] -albedo_color = Color( 0.156863, 0.160784, 0.290196, 1 ) +[sub_resource type="ConvexPolygonShape" id=20] +points = PoolVector3Array( 0.965552, -2.80364, 1.78281, -1.73953, -2.95389, -0.471429, 1.79211, -2.95389, -0.471429, 0.664795, -3.47987, 0.355155, -0.611865, -3.10405, 1.78281, -1.73953, -2.65332, 0.280131, -1.43843, -3.40471, 0.280131, 1.79211, -2.65332, 0.280131, 0.965552, -3.40471, -0.471429, -0.868133, -2.67304, 1.72901, 1.41634, -3.2543, 0.805738, 0.841425, -2.67664, -0.124027, 0.589779, -3.10405, 1.78281, -1.28805, -3.02913, 1.25676, -1.21303, -3.2543, -0.471429, -0.912967, -3.47987, 0.280131, 1.41634, -3.40471, 0.280131, 0.904357, -2.68024, 1.70938, -0.859948, -2.67664, -0.124027, -1.063, -3.40471, -0.170673, -1.36341, -3.2543, 0.880762, -1.21303, -2.87889, 1.48205, 1.26596, -2.95389, 1.33179, 1.71675, -3.10405, -0.471429, -0.912967, -2.95389, 1.78281, -1.43843, -3.32954, -0.245917, -1.51379, -3.32954, 0.280131, -0.686881, -3.47987, 0.355155, 0.89019, -3.47987, 0.204887, 0.89019, -2.95389, 1.78281, 1.49136, -3.32954, -0.170673, 1.49136, -3.32954, 0.355155, -1.14299, -2.67667, 1.43535, -0.912967, -3.47987, 0.204887, 1.69739, -2.67549, 0.513693, -1.51379, -3.32954, -0.0956491, 1.34098, -3.1793, 1.03103, 0.89019, -3.47987, 0.280131, 1.34098, -3.2543, 0.880762, 1.10601, -2.68346, 1.49155, 1.19095, -2.87889, 1.48205, -1.58626, -2.68919, 0.655691, -1.43843, -3.2543, -0.396185, 1.34098, -3.10405, 1.10627, 1.49136, -3.2543, -0.396185 ) + +[sub_resource type="ConvexPolygonShape" id=21] +points = PoolVector3Array( 1.1154, 4.25958, 0.430112, -1.73953, 3.58356, -0.546571, -1.51352, 3.50836, 0.730832, 1.71697, 3.50836, -0.0205298, -0.721215, 4.34644, -0.456672, 1.30458, 4.16686, -0.496632, -0.83751, 4.33469, 0.430112, 1.56641, 3.50836, 0.730832, 1.71697, 3.58356, -0.546571, 1.26596, 4.33469, 0.279815, -1.24301, 4.23285, 0.194655, 0.890065, 3.73385, 0.730832, -1.261, 4.23685, -0.498248, -1.73953, 3.50836, -0.0205298, 0.756218, 4.34295, -0.451726, -0.912621, 3.73385, 0.730832, 0.890065, 4.33469, 0.430112, -1.51352, 3.58356, 0.730832, 1.56641, 3.58356, 0.730832, 1.1323, 4.29539, -0.479733, -1.21307, 4.10929, 0.505261, -1.14585, 4.29274, -0.475228, -1.13796, 4.03418, 0.58041, 1.1154, 4.03418, 0.58041, 0.753222, 4.34145, 0.187581, -1.13849, 4.29057, 0.191447, 1.26596, 4.10929, 0.505261, -1.59879, 3.7522, -0.0803843 ) + +[sub_resource type="ConvexPolygonShape" id=22] +points = PoolVector3Array( -0.160973, 1.10375, -0.546571, -0.160973, 2.38107, -0.546571, -1.81467, 1.25409, 1.25669, 1.50598, 2.57775, 0.868092, 1.70742, 1.10788, -0.465494, -1.73947, 2.60658, 0.430568, -1.70117, 1.1204, -0.448589, 1.06113, 1.14012, 1.50815, -1.28827, 2.60658, 0.956146, 1.71691, 2.1557, -0.471062, 1.79211, 1.25409, 1.25669, -1.73947, 2.1557, -0.471062, 1.71691, 2.60658, 0.430568, -1.06452, 1.15267, 1.4912, -0.0798763, 2.5471, -0.3908, 1.34127, 2.60658, 0.956146, 1.19087, 1.40443, 1.48215, -1.81467, 1.47946, 1.25669, 1.79211, 1.47946, 1.25669, -0.759448, 1.17496, 1.52927, -1.51387, 2.53141, 0.956146, 1.49934, 1.13574, 0.866671, 1.56651, 2.45624, 0.956146, -1.49941, 1.14645, 0.861851, 1.79211, 1.40443, 0.956146, -1.81467, 1.32926, 0.956146, 0.803347, 2.53402, -0.101814, -0.397099, 1.33998, 1.47684, -1.73947, 1.55463, 1.25669, 0.73942, 1.17266, 1.53261, -1.81467, 1.47946, 1.03123, 1.49131, 2.53141, 0.956146 ) [node name="car" type="VehicleBody"] -transform = Transform( 1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0.00634003, 0 ) +transform = Transform( 1, 0, 0, 0, 1, 0, 0, 0, 1, 0, -0.757732, 0 ) mass = 200.0 script = ExtResource( 1 ) [node name="car_body" type="MeshInstance" parent="."] -mesh = SubResource( 1 ) -material/0 = null +transform = Transform( -1, 3.25841e-07, 5.30863e-14, 0, -1.62921e-07, 1, 3.25841e-07, 1, 1.62921e-07, 0, 1.28304, 0 ) +mesh = ExtResource( 3 ) +material/0 = SubResource( 14 ) + +[node name="CollisionShape6" type="CollisionShape" parent="."] +transform = Transform( -1, 3.25841e-07, 5.30863e-14, 0, -1.62921e-07, 1, 3.25841e-07, 1, 1.62921e-07, 0, 1.28304, 0 ) +shape = SubResource( 18 ) + +[node name="CollisionShape5" type="CollisionShape" parent="."] +transform = Transform( -1, 3.25841e-07, 5.30863e-14, 0, -1.62921e-07, 1, 3.25841e-07, 1, 1.62921e-07, 0, 1.28304, 0 ) +shape = SubResource( 19 ) + +[node name="CollisionShape4" type="CollisionShape" parent="."] +transform = Transform( -1, 3.25841e-07, 5.30863e-14, 0, -1.62921e-07, 1, 3.25841e-07, 1, 1.62921e-07, 0, 1.28304, 0 ) +shape = SubResource( 20 ) -[node name="CollisionShape" type="CollisionShape" parent="."] -shape = SubResource( 2 ) +[node name="CollisionShape3" type="CollisionShape" parent="."] +transform = Transform( -1, 3.25841e-07, 5.30863e-14, 0, -1.62921e-07, 1, 3.25841e-07, 1, 1.62921e-07, 0, 1.28304, 0 ) +shape = SubResource( 21 ) + +[node name="CollisionShape2" type="CollisionShape" parent="."] +transform = Transform( -1, 3.25841e-07, 5.30863e-14, 0, -1.62921e-07, 1, 3.25841e-07, 1, 1.62921e-07, 0, 1.28304, 0 ) +shape = SubResource( 22 ) + +[node name="back_left_wheel" type="VehicleWheel" parent="."] +transform = Transform( 1, 0, 0, 0, 1, 0, 0, 0, 1, 1.45591, 1.12444, -2.301 ) +use_as_traction = true +wheel_roll_influence = 0.0 +wheel_radius = 0.6 +wheel_friction_slip = 15.0 +suspension_travel = 0.3 +suspension_stiffness = 100.0 +suspension_max_force = 60000.0 +damping_compression = 2.0 +damping_relaxation = 3.0 + +[node name="MeshInstance" type="MeshInstance" parent="back_left_wheel"] +transform = Transform( 0.02, 0, 0, 0, 0.02, 0, 0, 0, 0.02, 0, 0, 0 ) +mesh = ExtResource( 4 ) +material/0 = null [node name="front_left_wheel" type="VehicleWheel" parent="."] -transform = Transform( 1, 0, 0, 0, 1, 0, 0, 0, 1, 1, 0, 1 ) -engine_force = 1.0 +transform = Transform( 1, 0, 0, 0, 1, 0, 0, 0, 1, 1.45591, 1.12444, 2.85433 ) use_as_steering = true -wheel_radius = 0.4 -suspension_stiffness = 50.0 -damping_compression = 1.9 -damping_relaxation = 2.0 +wheel_roll_influence = 0.0 +wheel_radius = 0.6 +wheel_friction_slip = 8.0 +suspension_travel = 0.3 +suspension_stiffness = 100.0 +suspension_max_force = 60000.0 +damping_compression = 2.0 +damping_relaxation = 3.0 [node name="MeshInstance" type="MeshInstance" parent="front_left_wheel"] -transform = Transform( -1.62921e-07, -1, 0, 1, -1.62921e-07, 0, 0, 0, 1, 0, 0, 0 ) -mesh = SubResource( 3 ) -material/0 = SubResource( 4 ) +transform = Transform( 0.02, 0, 0, 0, 0.02, 0, 0, 0, 0.02, 0, 0, 0 ) +mesh = ExtResource( 4 ) +material/0 = null [node name="front_right_wheel" type="VehicleWheel" parent="."] -transform = Transform( 1, 0, 0, 0, 1, 0, 0, 0, 1, -1, 0, 1 ) -engine_force = 1.0 +transform = Transform( 1, 0, 0, 0, 1, 0, 0, 0, 1, -1.444, 1.12427, 2.854 ) use_as_steering = true -wheel_radius = 0.4 -suspension_stiffness = 50.0 -damping_compression = 1.9 -damping_relaxation = 2.0 +wheel_roll_influence = 0.0 +wheel_radius = 0.6 +wheel_friction_slip = 8.0 +suspension_travel = 0.3 +suspension_stiffness = 100.0 +suspension_max_force = 60000.0 +damping_compression = 2.0 +damping_relaxation = 3.0 [node name="MeshInstance" type="MeshInstance" parent="front_right_wheel"] -transform = Transform( -1.62921e-07, -1, 0, 1, -1.62921e-07, 0, 0, 0, 1, 0, 0, 0 ) -mesh = SubResource( 3 ) -material/0 = SubResource( 4 ) - -[node name="back_left_wheel" type="VehicleWheel" parent="."] -transform = Transform( 1, 0, 0, 0, 1, 0, 0, 0, 1, 1, 0, -1 ) -engine_force = 0.125 -use_as_traction = true -wheel_radius = 0.4 -suspension_stiffness = 50.0 -damping_compression = 1.9 -damping_relaxation = 2.0 - -[node name="MeshInstance" type="MeshInstance" parent="back_left_wheel"] -transform = Transform( -1.62921e-07, -1, 0, 1, -1.62921e-07, 0, 0, 0, 1, 0, 0, 0 ) -mesh = SubResource( 3 ) -material/0 = SubResource( 4 ) +transform = Transform( 0.02, 0, 0, 0, 0.02, 0, 0, 0, 0.02, 0, 0, 0 ) +mesh = ExtResource( 4 ) +material/0 = null [node name="back_right_wheel" type="VehicleWheel" parent="."] -transform = Transform( 1, 0, 0, 0, 1, 0, 0, 0, 1, -1, 0, -1 ) -engine_force = 6.16571e-44 +transform = Transform( 1, 0, 0, 0, 1, 0, 0, 0, 1, -1.44361, 1.12444, -2.301 ) use_as_traction = true -wheel_radius = 0.4 -suspension_stiffness = 50.0 -damping_compression = 1.9 -damping_relaxation = 2.0 +wheel_roll_influence = 0.0 +wheel_radius = 0.6 +wheel_friction_slip = 15.0 +suspension_travel = 0.3 +suspension_stiffness = 100.0 +suspension_max_force = 60000.0 +damping_compression = 2.0 +damping_relaxation = 3.0 [node name="MeshInstance" type="MeshInstance" parent="back_right_wheel"] -transform = Transform( -1.62921e-07, -1, 0, 1, -1.62921e-07, 0, 0, 0, 1, 0, 0, 0 ) -mesh = SubResource( 3 ) -material/0 = SubResource( 4 ) +transform = Transform( 0.02, 0, 0, 0, 0.02, 0, 0, 0, 0.02, 0, 0, 0 ) +mesh = ExtResource( 4 ) +material/0 = null [node name="Spatial" type="Spatial" parent="."] +transform = Transform( 1, 0, 1.74846e-07, 0, 1, 0, -1.74846e-07, 0, 1, 0, 1.17638, 0 ) script = ExtResource( 2 ) -[node name="Camera" type="Camera" parent="Spatial"] -transform = Transform( -1, 3.10202e-08, -8.17343e-08, 9.25045e-09, 0.967228, 0.25391, 8.6932e-08, 0.25391, -0.967228, 0, 2, -7.21412 ) +[node name="ClippedCamera" type="ClippedCamera" parent="Spatial"] +transform = Transform( -1, -3.72773e-08, -9.14428e-08, -5.59159e-08, 0.977008, 0.213201, 8.13928e-08, 0.213201, -0.977008, 2.71887e-06, 5.92579, -15.5501 ) +far = 400.0 |
