summaryrefslogtreecommitdiff
path: root/car.tscn
diff options
context:
space:
mode:
authorXavier Del Campo Romero <xavi.dcr@tutanota.com>2022-06-05 00:36:03 +0200
committerXavier Del Campo Romero <xavi.dcr@tutanota.com>2022-06-05 00:36:03 +0200
commit2a81306abc47e94c7ffd5173a031baf36bbfcc24 (patch)
treecf0175a26984e616f762055e2374db73e137849a /car.tscn
parent9c918c4a04a656f1017955bcb772ae8ce7c61089 (diff)
downloadcar-2a81306abc47e94c7ffd5173a031baf36bbfcc24.tar.gz
Implement camera and ball
Diffstat (limited to 'car.tscn')
-rw-r--r--car.tscn93
1 files changed, 93 insertions, 0 deletions
diff --git a/car.tscn b/car.tscn
new file mode 100644
index 0000000..eb713da
--- /dev/null
+++ b/car.tscn
@@ -0,0 +1,93 @@
+[gd_scene load_steps=7 format=2]
+
+[ext_resource path="res://car.gd" type="Script" id=1]
+[ext_resource path="res://Spatial.gd" type="Script" id=2]
+
+[sub_resource type="CubeMesh" id=1]
+size = Vector3( 1.5, 0.5, 3 )
+
+[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="CylinderMesh" id=3]
+top_radius = 0.4
+bottom_radius = 0.4
+height = 0.25
+radial_segments = 12
+
+[sub_resource type="SpatialMaterial" id=4]
+albedo_color = Color( 0.156863, 0.160784, 0.290196, 1 )
+
+[node name="car" type="VehicleBody"]
+transform = Transform( 1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0.00634003, 0 )
+mass = 200.0
+script = ExtResource( 1 )
+
+[node name="car_body" type="MeshInstance" parent="."]
+mesh = SubResource( 1 )
+material/0 = null
+
+[node name="CollisionShape" type="CollisionShape" parent="."]
+shape = SubResource( 2 )
+
+[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
+use_as_steering = true
+wheel_radius = 0.4
+suspension_stiffness = 50.0
+damping_compression = 1.9
+damping_relaxation = 2.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 )
+
+[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
+use_as_steering = true
+wheel_radius = 0.4
+suspension_stiffness = 50.0
+damping_compression = 1.9
+damping_relaxation = 2.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 )
+
+[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
+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_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="Spatial" type="Spatial" parent="."]
+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 )