Skip to content

Commit

Permalink
Improve Truck Town model, fix issues, use OMI glTF Physics (#1110)
Browse files Browse the repository at this point in the history
  • Loading branch information
aaronfranke authored Nov 25, 2024
1 parent 0fb1b4e commit 5d95421
Show file tree
Hide file tree
Showing 17 changed files with 1,548 additions and 377 deletions.
1 change: 0 additions & 1 deletion 3d/truck_town/town/materials/cement.tres
Original file line number Diff line number Diff line change
Expand Up @@ -6,5 +6,4 @@
resource_name = "Cement"
albedo_texture = ExtResource("1_but66")
roughness = 0.8
uv1_scale = Vector3(2, 2, 2)
texture_filter = 5
Binary file modified 3d/truck_town/town/materials/cement.webp
Binary file not shown.
1 change: 0 additions & 1 deletion 3d/truck_town/town/materials/grass.tres
Original file line number Diff line number Diff line change
Expand Up @@ -6,5 +6,4 @@
resource_name = "Grass"
albedo_texture = ExtResource("1_5bi3i")
roughness = 0.8
uv1_scale = Vector3(2, 2, 2)
texture_filter = 5
Binary file modified 3d/truck_town/town/materials/grass.webp
Binary file not shown.
197 changes: 197 additions & 0 deletions 3d/truck_town/town/model/racetrack_csg.tscn

Large diffs are not rendered by default.

Binary file not shown.
36 changes: 36 additions & 0 deletions 3d/truck_town/town/model/textures/cement_lossy.webp.import
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
[remap]

importer="texture"
type="CompressedTexture2D"
uid="uid://j42e6fghic08"
path.bptc="res://.godot/imported/cement_lossy.webp-8ec670e9f910145022115abfcf96325b.bptc.ctex"
path.astc="res://.godot/imported/cement_lossy.webp-8ec670e9f910145022115abfcf96325b.astc.ctex"
metadata={
"imported_formats": ["s3tc_bptc", "etc2_astc"],
"vram_texture": true
}

[deps]

source_file="res://town/model/textures/cement_lossy.webp"
dest_files=["res://.godot/imported/cement_lossy.webp-8ec670e9f910145022115abfcf96325b.bptc.ctex", "res://.godot/imported/cement_lossy.webp-8ec670e9f910145022115abfcf96325b.astc.ctex"]

[params]

compress/mode=2
compress/high_quality=true
compress/lossy_quality=0.7
compress/hdr_compression=1
compress/normal_map=0
compress/channel_pack=0
mipmaps/generate=true
mipmaps/limit=-1
roughness/mode=0
roughness/src_normal=""
process/fix_alpha_border=true
process/premult_alpha=false
process/normal_map_invert_y=false
process/hdr_as_srgb=false
process/hdr_clamp_exposure=false
process/size_limit=0
detect_3d/compress_to=0
Binary file not shown.
36 changes: 36 additions & 0 deletions 3d/truck_town/town/model/textures/grass_lossy.webp.import
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
[remap]

importer="texture"
type="CompressedTexture2D"
uid="uid://csxl8xxs3vcm4"
path.bptc="res://.godot/imported/grass_lossy.webp-8d729bb1beb4fa54f09f92965c817f82.bptc.ctex"
path.astc="res://.godot/imported/grass_lossy.webp-8d729bb1beb4fa54f09f92965c817f82.astc.ctex"
metadata={
"imported_formats": ["s3tc_bptc", "etc2_astc"],
"vram_texture": true
}

[deps]

source_file="res://town/model/textures/grass_lossy.webp"
dest_files=["res://.godot/imported/grass_lossy.webp-8d729bb1beb4fa54f09f92965c817f82.bptc.ctex", "res://.godot/imported/grass_lossy.webp-8d729bb1beb4fa54f09f92965c817f82.astc.ctex"]

[params]

compress/mode=2
compress/high_quality=true
compress/lossy_quality=0.7
compress/hdr_compression=1
compress/normal_map=0
compress/channel_pack=0
mipmaps/generate=true
mipmaps/limit=-1
roughness/mode=0
roughness/src_normal=""
process/fix_alpha_border=true
process/premult_alpha=false
process/normal_map_invert_y=false
process/hdr_as_srgb=false
process/hdr_clamp_exposure=false
process/size_limit=0
detect_3d/compress_to=0
1,216 changes: 1,216 additions & 0 deletions 3d/truck_town/town/model/town_model.gltf

Large diffs are not rendered by default.

36 changes: 36 additions & 0 deletions 3d/truck_town/town/model/town_model.gltf.import
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
[remap]

importer="scene"
importer_version=1
type="PackedScene"
uid="uid://csucj4oj3q3qt"
path="res://.godot/imported/town_model.gltf-49bac3ffe9fdc768d5dacfe949b37b46.scn"

[deps]

source_file="res://town/model/town_model.gltf"
dest_files=["res://.godot/imported/town_model.gltf-49bac3ffe9fdc768d5dacfe949b37b46.scn"]

[params]

nodes/root_type=""
nodes/root_name=""
nodes/apply_root_scale=true
nodes/root_scale=1.0
nodes/import_as_skeleton_bones=false
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
animation/import_rest_as_RESET=false
import_script/path=""
_subresources={}
gltf/naming_version=1
gltf/embedded_image_handling=1
Binary file added 3d/truck_town/town/model/town_model0.bin
Binary file not shown.
296 changes: 21 additions & 275 deletions 3d/truck_town/town/town_scene.tscn

Large diffs are not rendered by default.

Binary file removed 3d/truck_town/town/truck_town.glb
Binary file not shown.
99 changes: 0 additions & 99 deletions 3d/truck_town/town/truck_town.glb.import

This file was deleted.

5 changes: 5 additions & 0 deletions 3d/truck_town/vehicles/meshes/meshes.glb.import
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,7 @@ _subresources={
"generate/shadow_meshes": 0,
"lods/normal_merge_angle": 60.0,
"lods/normal_split_angle": 25.0,
"lods/raycast_normals": false,
"save_to_file/enabled": true,
"save_to_file/make_streamable": "",
"save_to_file/path": "res://vehicles/meshes/minivan.res"
Expand All @@ -67,6 +68,7 @@ _subresources={
"generate/shadow_meshes": 0,
"lods/normal_merge_angle": 60.0,
"lods/normal_split_angle": 25.0,
"lods/raycast_normals": false,
"save_to_file/enabled": true,
"save_to_file/make_streamable": "",
"save_to_file/path": "res://vehicles/meshes/tow_truck.res"
Expand All @@ -77,6 +79,7 @@ _subresources={
"generate/shadow_meshes": 0,
"lods/normal_merge_angle": 60.0,
"lods/normal_split_angle": 25.0,
"lods/raycast_normals": false,
"save_to_file/enabled": true,
"save_to_file/make_streamable": "",
"save_to_file/path": "res://vehicles/meshes/truck_cab.res"
Expand All @@ -87,6 +90,7 @@ _subresources={
"generate/shadow_meshes": 0,
"lods/normal_merge_angle": 60.0,
"lods/normal_split_angle": 25.0,
"lods/raycast_normals": false,
"save_to_file/enabled": true,
"save_to_file/make_streamable": "",
"save_to_file/path": "res://vehicles/meshes/truck_trailer.res"
Expand All @@ -97,6 +101,7 @@ _subresources={
"generate/shadow_meshes": 0,
"lods/normal_merge_angle": 60.0,
"lods/normal_split_angle": 25.0,
"lods/raycast_normals": false,
"save_to_file/enabled": true,
"save_to_file/make_streamable": "",
"save_to_file/path": "res://vehicles/meshes/wheel.res"
Expand Down
2 changes: 1 addition & 1 deletion 3d/truck_town/vehicles/vehicle.gd
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ func _physics_process(delta: float) -> void:
# Change pitch smoothly to avoid abrupt change on collision.
$EngineSound.pitch_scale = lerpf($EngineSound.pitch_scale, desired_engine_pitch, 0.2)

if abs(linear_velocity.length() - previous_speed) > 1.0:
if absf(linear_velocity.length() - previous_speed) > 1.0:
# Sudden velocity change, likely due to a collision. Play an impact sound to give audible feedback,
# and vibrate for haptic feedback.
$ImpactSound.play()
Expand Down

0 comments on commit 5d95421

Please sign in to comment.