diff --git a/models/props/speedpad.blend b/models/props/speedpad.blend index 9e0113b..52b0a1c 100644 Binary files a/models/props/speedpad.blend and b/models/props/speedpad.blend differ diff --git a/models/props/speedpad.blend1 b/models/props/speedpad.blend1 index 472bcaa..caa20f6 100644 Binary files a/models/props/speedpad.blend1 and b/models/props/speedpad.blend1 differ diff --git a/models/props/speedpad_constructed.blend b/models/props/speedpad_constructed.blend new file mode 100644 index 0000000..e1d0df0 Binary files /dev/null and b/models/props/speedpad_constructed.blend differ diff --git a/models/props/speedpad_constructed.blend.import b/models/props/speedpad_constructed.blend.import new file mode 100644 index 0000000..dc1bec9 --- /dev/null +++ b/models/props/speedpad_constructed.blend.import @@ -0,0 +1,53 @@ +[remap] + +importer="scene" +importer_version=1 +type="PackedScene" +uid="uid://dyfbuqjb1638w" +path="res://.godot/imported/speedpad_constructed.blend-380cbcf2513ed765d15b2c7ea9437719.scn" + +[deps] + +source_file="res://models/props/speedpad_constructed.blend" +dest_files=["res://.godot/imported/speedpad_constructed.blend-380cbcf2513ed765d15b2c7ea9437719.scn"] + +[params] + +nodes/root_type="" +nodes/root_name="" +nodes/apply_root_scale=true +nodes/root_scale=1.0 +nodes/import_as_skeleton_bones=false +nodes/use_node_type_suffixes=true +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={} +blender/nodes/visible=0 +blender/nodes/active_collection_only=false +blender/nodes/punctual_lights=true +blender/nodes/cameras=true +blender/nodes/custom_properties=true +blender/nodes/modifiers=1 +blender/meshes/colors=false +blender/meshes/uvs=true +blender/meshes/normals=true +blender/meshes/export_geometry_nodes_instances=false +blender/meshes/tangents=true +blender/meshes/skins=2 +blender/meshes/export_bones_deforming_mesh_only=false +blender/materials/unpack_enabled=true +blender/materials/export_materials=1 +blender/animation/limit_playback=true +blender/animation/always_sample=true +blender/animation/group_tracks=true diff --git a/models/props/speedpad_constructed.blend1 b/models/props/speedpad_constructed.blend1 new file mode 100644 index 0000000..44da81b Binary files /dev/null and b/models/props/speedpad_constructed.blend1 differ diff --git a/models/props/textures/Speedpad_AlbedoTexture.png b/models/props/textures/Speedpad_AlbedoTexture.png new file mode 100644 index 0000000..67bf426 Binary files /dev/null and b/models/props/textures/Speedpad_AlbedoTexture.png differ diff --git a/models/props/textures/Speedpad_AlbedoTexture.png.import b/models/props/textures/Speedpad_AlbedoTexture.png.import new file mode 100644 index 0000000..0fa76cb --- /dev/null +++ b/models/props/textures/Speedpad_AlbedoTexture.png.import @@ -0,0 +1,35 @@ +[remap] + +importer="texture" +type="CompressedTexture2D" +uid="uid://ch2sqjvy5xqp0" +path.s3tc="res://.godot/imported/Speedpad_AlbedoTexture.png-2e70f25f4860fefe73c541de73487c36.s3tc.ctex" +metadata={ +"imported_formats": ["s3tc_bptc"], +"vram_texture": true +} + +[deps] + +source_file="res://models/props/textures/Speedpad_AlbedoTexture.png" +dest_files=["res://.godot/imported/Speedpad_AlbedoTexture.png-2e70f25f4860fefe73c541de73487c36.s3tc.ctex"] + +[params] + +compress/mode=2 +compress/high_quality=false +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 diff --git a/models/props/textures/Speedpad_Constructed_AlbedoTexture.png b/models/props/textures/Speedpad_Constructed_AlbedoTexture.png new file mode 100644 index 0000000..76bd325 Binary files /dev/null and b/models/props/textures/Speedpad_Constructed_AlbedoTexture.png differ diff --git a/models/props/textures/Speedpad_Constructed_AlbedoTexture.png.import b/models/props/textures/Speedpad_Constructed_AlbedoTexture.png.import new file mode 100644 index 0000000..e204595 --- /dev/null +++ b/models/props/textures/Speedpad_Constructed_AlbedoTexture.png.import @@ -0,0 +1,35 @@ +[remap] + +importer="texture" +type="CompressedTexture2D" +uid="uid://b5abafsqsxpe5" +path.s3tc="res://.godot/imported/Speedpad_Constructed_AlbedoTexture.png-9d45f7cc63660e70b5fb62742070e172.s3tc.ctex" +metadata={ +"imported_formats": ["s3tc_bptc"], +"vram_texture": true +} + +[deps] + +source_file="res://models/props/textures/Speedpad_Constructed_AlbedoTexture.png" +dest_files=["res://.godot/imported/Speedpad_Constructed_AlbedoTexture.png-9d45f7cc63660e70b5fb62742070e172.s3tc.ctex"] + +[params] + +compress/mode=2 +compress/high_quality=false +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 diff --git a/models/props/textures/Speedpad_Constructed_RoughnessTexture.png b/models/props/textures/Speedpad_Constructed_RoughnessTexture.png new file mode 100644 index 0000000..d98ac92 Binary files /dev/null and b/models/props/textures/Speedpad_Constructed_RoughnessTexture.png differ diff --git a/models/props/textures/Speedpad_Constructed_RoughnessTexture.png.import b/models/props/textures/Speedpad_Constructed_RoughnessTexture.png.import new file mode 100644 index 0000000..361930c --- /dev/null +++ b/models/props/textures/Speedpad_Constructed_RoughnessTexture.png.import @@ -0,0 +1,35 @@ +[remap] + +importer="texture" +type="CompressedTexture2D" +uid="uid://dkvl0d1ax4lpb" +path.s3tc="res://.godot/imported/Speedpad_Constructed_RoughnessTexture.png-5e7ac4450a08bed22e38df7b96e06313.s3tc.ctex" +metadata={ +"imported_formats": ["s3tc_bptc"], +"vram_texture": true +} + +[deps] + +source_file="res://models/props/textures/Speedpad_Constructed_RoughnessTexture.png" +dest_files=["res://.godot/imported/Speedpad_Constructed_RoughnessTexture.png-5e7ac4450a08bed22e38df7b96e06313.s3tc.ctex"] + +[params] + +compress/mode=2 +compress/high_quality=false +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 diff --git a/models/props/textures/Speedpad_EmissionTexture.png b/models/props/textures/Speedpad_EmissionTexture.png new file mode 100644 index 0000000..7f49bc2 Binary files /dev/null and b/models/props/textures/Speedpad_EmissionTexture.png differ diff --git a/models/props/textures/Speedpad_EmissionTexture.png.import b/models/props/textures/Speedpad_EmissionTexture.png.import new file mode 100644 index 0000000..3a2aa68 --- /dev/null +++ b/models/props/textures/Speedpad_EmissionTexture.png.import @@ -0,0 +1,35 @@ +[remap] + +importer="texture" +type="CompressedTexture2D" +uid="uid://ctk2wr52knq8n" +path.s3tc="res://.godot/imported/Speedpad_EmissionTexture.png-b44f3ca220856e87af3bc57fefcf1369.s3tc.ctex" +metadata={ +"imported_formats": ["s3tc_bptc"], +"vram_texture": true +} + +[deps] + +source_file="res://models/props/textures/Speedpad_EmissionTexture.png" +dest_files=["res://.godot/imported/Speedpad_EmissionTexture.png-b44f3ca220856e87af3bc57fefcf1369.s3tc.ctex"] + +[params] + +compress/mode=2 +compress/high_quality=false +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 diff --git a/models/props/textures/Speedpad_MetallicityTexture.png b/models/props/textures/Speedpad_MetallicityTexture.png new file mode 100644 index 0000000..31e502d Binary files /dev/null and b/models/props/textures/Speedpad_MetallicityTexture.png differ diff --git a/models/props/textures/Speedpad_MetallicityTexture.png.import b/models/props/textures/Speedpad_MetallicityTexture.png.import new file mode 100644 index 0000000..6a48d14 --- /dev/null +++ b/models/props/textures/Speedpad_MetallicityTexture.png.import @@ -0,0 +1,35 @@ +[remap] + +importer="texture" +type="CompressedTexture2D" +uid="uid://dqlauxpfh2lxf" +path.s3tc="res://.godot/imported/Speedpad_MetallicityTexture.png-a90c4ee1a211bf7af196d563bd4f616b.s3tc.ctex" +metadata={ +"imported_formats": ["s3tc_bptc"], +"vram_texture": true +} + +[deps] + +source_file="res://models/props/textures/Speedpad_MetallicityTexture.png" +dest_files=["res://.godot/imported/Speedpad_MetallicityTexture.png-a90c4ee1a211bf7af196d563bd4f616b.s3tc.ctex"] + +[params] + +compress/mode=2 +compress/high_quality=false +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 diff --git a/models/props/textures/Speedpad_RoughnessTexture.png b/models/props/textures/Speedpad_RoughnessTexture.png new file mode 100644 index 0000000..f9bb8b3 Binary files /dev/null and b/models/props/textures/Speedpad_RoughnessTexture.png differ diff --git a/models/props/textures/Speedpad_RoughnessTexture.png.import b/models/props/textures/Speedpad_RoughnessTexture.png.import new file mode 100644 index 0000000..71587fd --- /dev/null +++ b/models/props/textures/Speedpad_RoughnessTexture.png.import @@ -0,0 +1,35 @@ +[remap] + +importer="texture" +type="CompressedTexture2D" +uid="uid://m6jbw2c08how" +path.s3tc="res://.godot/imported/Speedpad_RoughnessTexture.png-650fc2044c175aacb1c0cabf6d386624.s3tc.ctex" +metadata={ +"imported_formats": ["s3tc_bptc"], +"vram_texture": true +} + +[deps] + +source_file="res://models/props/textures/Speedpad_RoughnessTexture.png" +dest_files=["res://.godot/imported/Speedpad_RoughnessTexture.png-650fc2044c175aacb1c0cabf6d386624.s3tc.ctex"] + +[params] + +compress/mode=2 +compress/high_quality=false +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 diff --git a/props/speedpad.gd b/props/speedpad.gd new file mode 100644 index 0000000..b6d861f --- /dev/null +++ b/props/speedpad.gd @@ -0,0 +1,14 @@ +class_name Speedpad extends Area3D + +@export var speed_boost: float = 20.0 +@export var audio_player: AudioStreamPlayer3D + +func _ready() -> void: + body_entered.connect(_on_body_entered) + +func _on_body_entered(body: PhysicsBody3D) -> void: + var rbody := body as RigidBody3D + if rbody: + var dir := -global_basis.z.normalized() + rbody.apply_central_impulse(rbody.mass*speed_boost*dir) + audio_player.play() diff --git a/props/speedpad.gd.uid b/props/speedpad.gd.uid new file mode 100644 index 0000000..e3d0c1e --- /dev/null +++ b/props/speedpad.gd.uid @@ -0,0 +1 @@ +uid://cbcugywj0f3uw diff --git a/props/speedpad.tscn b/props/speedpad.tscn new file mode 100644 index 0000000..7b5f4bc --- /dev/null +++ b/props/speedpad.tscn @@ -0,0 +1,25 @@ +[gd_scene load_steps=5 format=3 uid="uid://ddga068u8m4i3"] + +[ext_resource type="Script" uid="uid://gcbe3ih1fv75" path="res://props/speedpad_artificial.gd" id="1_flbj4"] +[ext_resource type="AudioStream" uid="uid://b62clfgatxgll" path="res://audio/whoosh.ogg" id="2_2i4vf"] +[ext_resource type="PackedScene" uid="uid://1w7b3o3qasi3" path="res://models/props/speedpad.blend" id="3_nl8my"] + +[sub_resource type="BoxShape3D" id="BoxShape3D_2i4vf"] +size = Vector3(0.75, 0.125, 1) + +[node name="Speedpad" type="Area3D" node_paths=PackedStringArray("model", "audio_player")] +script = ExtResource("1_flbj4") +model = NodePath("speedpad/Speedpad") +audio_player = NodePath("AudioStreamPlayer3D") +metadata/_custom_type_script = "uid://gcbe3ih1fv75" + +[node name="speedpad" parent="." instance=ExtResource("3_nl8my")] + +[node name="AudioStreamPlayer3D" type="AudioStreamPlayer3D" parent="."] +stream = ExtResource("2_2i4vf") +bus = &"Sound Effects" + +[node name="CollisionShape3D" type="CollisionShape3D" parent="."] +shape = SubResource("BoxShape3D_2i4vf") + +[editable path="speedpad"] diff --git a/props/speedpad_artificial.gd b/props/speedpad_artificial.gd new file mode 100644 index 0000000..9327357 --- /dev/null +++ b/props/speedpad_artificial.gd @@ -0,0 +1,58 @@ +class_name SpeedpadArtificial extends Speedpad + +@export var model: MeshInstance3D + +@onready var _sk1: int = model.find_blend_shape_by_name(&'Key 1') +@onready var _sk2: int = model.find_blend_shape_by_name(&'Key 2') +@onready var _sk3: int = model.find_blend_shape_by_name(&'Key 3') +@onready var _sk4: int = model.find_blend_shape_by_name(&'Key 4') +@onready var _sk5: int = model.find_blend_shape_by_name(&'Key 5') +@onready var _sk6: int = model.find_blend_shape_by_name(&'Key 6') + +var _anim_progress: float = 0.0 + +func _process(delta: float) -> void: + _anim_progress = fposmod(_anim_progress + speed_boost*delta/4.0, 6.0) + var _subprogress: float = fposmod(_anim_progress, 1.0) + if _anim_progress <= 1.0: + model.set_blend_shape_value(_sk1, _subprogress) + model.set_blend_shape_value(_sk2, 0.0) + model.set_blend_shape_value(_sk3, 0.0) + model.set_blend_shape_value(_sk4, 0.0) + model.set_blend_shape_value(_sk5, 0.0) + model.set_blend_shape_value(_sk6, 1.0 - _subprogress) + elif _anim_progress <= 2.0: + model.set_blend_shape_value(_sk1, 1.0 - _subprogress) + model.set_blend_shape_value(_sk2, _subprogress) + model.set_blend_shape_value(_sk3, 0.0) + model.set_blend_shape_value(_sk4, 0.0) + model.set_blend_shape_value(_sk5, 0.0) + model.set_blend_shape_value(_sk6, 0.0) + elif _anim_progress <= 3.0: + model.set_blend_shape_value(_sk1, 0.0) + model.set_blend_shape_value(_sk2, 1.0 - _subprogress) + model.set_blend_shape_value(_sk3, _subprogress) + model.set_blend_shape_value(_sk4, 0.0) + model.set_blend_shape_value(_sk5, 0.0) + model.set_blend_shape_value(_sk6, 0.0) + elif _anim_progress <= 4.0: + model.set_blend_shape_value(_sk1, 0.0) + model.set_blend_shape_value(_sk2, 0.0) + model.set_blend_shape_value(_sk3, 1.0 - _subprogress) + model.set_blend_shape_value(_sk4, _subprogress) + model.set_blend_shape_value(_sk5, 0.0) + model.set_blend_shape_value(_sk6, 0.0) + elif _anim_progress <= 5.0: + model.set_blend_shape_value(_sk1, 0.0) + model.set_blend_shape_value(_sk2, 0.0) + model.set_blend_shape_value(_sk3, 0.0) + model.set_blend_shape_value(_sk4, 1.0 - _subprogress) + model.set_blend_shape_value(_sk5, _subprogress) + model.set_blend_shape_value(_sk6, 0.0) + else: + model.set_blend_shape_value(_sk1, 0.0) + model.set_blend_shape_value(_sk2, 0.0) + model.set_blend_shape_value(_sk3, 0.0) + model.set_blend_shape_value(_sk4, 0.0) + model.set_blend_shape_value(_sk5, 1.0 - _subprogress) + model.set_blend_shape_value(_sk6, _subprogress) diff --git a/props/speedpad_artificial.gd.uid b/props/speedpad_artificial.gd.uid new file mode 100644 index 0000000..fcc8a5e --- /dev/null +++ b/props/speedpad_artificial.gd.uid @@ -0,0 +1 @@ +uid://gcbe3ih1fv75 diff --git a/props/speedpad_constructed.gd b/props/speedpad_constructed.gd new file mode 100644 index 0000000..1e869d2 --- /dev/null +++ b/props/speedpad_constructed.gd @@ -0,0 +1,26 @@ +class_name SpeedpadConstructed extends Speedpad + +@export var model: MeshInstance3D + +@onready var _sk: int = model.find_blend_shape_by_name(&'whoosh') + +var _up := false + +var _sk_val: float: + get(): + return model.get_blend_shape_value(_sk) + set(value): + model.set_blend_shape_value(_sk, value) + +func _on_body_entered(body: PhysicsBody3D) -> void: + super(body) + if body is RigidBody3D: + _up = true + +func _process(delta: float) -> void: + if _up: + _sk_val = lerp(_sk_val, 1.0, 1.0 - 0.00001**delta) + if abs(_sk_val - 1.0) < 0.001: + _up = false + else: + _sk_val = lerp(_sk_val, 0.0, 1.0 - 0.1**delta) diff --git a/props/speedpad_constructed.gd.uid b/props/speedpad_constructed.gd.uid new file mode 100644 index 0000000..781ad6a --- /dev/null +++ b/props/speedpad_constructed.gd.uid @@ -0,0 +1 @@ +uid://ddjca7kk2m72u diff --git a/props/speedpad_constructed.tscn b/props/speedpad_constructed.tscn new file mode 100644 index 0000000..0553b14 --- /dev/null +++ b/props/speedpad_constructed.tscn @@ -0,0 +1,26 @@ +[gd_scene load_steps=5 format=3 uid="uid://img70a34s4vc"] + +[ext_resource type="Script" uid="uid://ddjca7kk2m72u" path="res://props/speedpad_constructed.gd" id="1_gimm5"] +[ext_resource type="PackedScene" uid="uid://dyfbuqjb1638w" path="res://models/props/speedpad_constructed.blend" id="2_gtv45"] +[ext_resource type="AudioStream" uid="uid://b62clfgatxgll" path="res://audio/whoosh.ogg" id="3_3p31n"] + +[sub_resource type="BoxShape3D" id="BoxShape3D_wrik4"] +size = Vector3(0.75, 0.125, 0.538269) + +[node name="SpeedpadConstructed" type="Area3D" node_paths=PackedStringArray("model", "audio_player")] +script = ExtResource("1_gimm5") +model = NodePath("speedpad_constructed/Twig") +audio_player = NodePath("AudioStreamPlayer3D") +metadata/_custom_type_script = "uid://ddjca7kk2m72u" + +[node name="speedpad_constructed" parent="." instance=ExtResource("2_gtv45")] + +[node name="AudioStreamPlayer3D" type="AudioStreamPlayer3D" parent="."] +stream = ExtResource("3_3p31n") +bus = &"Sound Effects" + +[node name="CollisionShape3D" type="CollisionShape3D" parent="."] +transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0.489655) +shape = SubResource("BoxShape3D_wrik4") + +[editable path="speedpad_constructed"] diff --git a/test/blender_test_map.tscn b/test/blender_test_map.tscn index 4e07b31..519b6bb 100644 --- a/test/blender_test_map.tscn +++ b/test/blender_test_map.tscn @@ -1,4 +1,4 @@ -[gd_scene load_steps=16 format=3 uid="uid://6wjqqijnie4p"] +[gd_scene load_steps=18 format=3 uid="uid://6wjqqijnie4p"] [ext_resource type="Script" uid="uid://cmoaplk7fly6y" path="res://vfx/gameplay_camera.gd" id="1_qjty2"] [ext_resource type="Texture2D" uid="uid://b334g66yuhwtv" path="res://vfx/textures/skybox1.png" id="2_p5rwy"] @@ -9,6 +9,8 @@ [ext_resource type="PackedScene" uid="uid://b7mqd4ps8e3uj" path="res://props/springboard_constructed.tscn" id="9_4tub8"] [ext_resource type="Script" uid="uid://16os114krms3" path="res://characters/controllers/player_character_controller.gd" id="9_j70wf"] [ext_resource type="Script" uid="uid://dotkfe7cs5010" path="res://test/pick_up_item.gd" id="10_ld4ib"] +[ext_resource type="PackedScene" uid="uid://ddga068u8m4i3" path="res://props/speedpad.tscn" id="10_qjty2"] +[ext_resource type="PackedScene" uid="uid://img70a34s4vc" path="res://props/speedpad_constructed.tscn" id="11_vhybo"] [sub_resource type="PanoramaSkyMaterial" id="PanoramaSkyMaterial_sj3fr"] panorama = ExtResource("2_p5rwy") @@ -88,4 +90,10 @@ transform = Transform3D(0.555329, -0.584704, 0.59138, 0.725086, 0.688658, 0, -0. [node name="Springboard4" parent="." instance=ExtResource("8_p5rwy")] transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 30.3396, 6.38962e-05, 2.86398) +[node name="Speedpad" parent="." instance=ExtResource("10_qjty2")] +transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 30.1043, 0.0802538, 15.8815) + +[node name="SpeedpadConstructed" parent="." instance=ExtResource("11_vhybo")] +transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 26.2941, 0.0469744, 10.3884) + [editable path="StaticBody3D/blender_test_map"]