-
Notifications
You must be signed in to change notification settings - Fork 79
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add resource decay animations, closes #67
- Loading branch information
Showing
6 changed files
with
199 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,78 @@ | ||
# Blender v3.0.0 OBJ File: '' | ||
# www.blender.org | ||
o Icosphere_Icosphere.001 | ||
v 0.000000 -1.000000 0.000000 | ||
v 0.723600 -0.447215 0.525720 | ||
v -0.276385 -0.447215 0.850640 | ||
v -0.894425 -0.447215 0.000000 | ||
v -0.276385 -0.447215 -0.850640 | ||
v 0.723600 -0.447215 -0.525720 | ||
v 0.276385 0.447215 0.850640 | ||
v -0.723600 0.447215 0.525720 | ||
v -0.723600 0.447215 -0.525720 | ||
v 0.276385 0.447215 -0.850640 | ||
v 0.894425 0.447215 0.000000 | ||
v 0.000000 1.000000 0.000000 | ||
vt 0.181819 0.000000 | ||
vt 0.272728 0.157461 | ||
vt 0.090910 0.157461 | ||
vt 0.363637 0.000000 | ||
vt 0.454546 0.157461 | ||
vt 0.909091 0.000000 | ||
vt 1.000000 0.157461 | ||
vt 0.818182 0.157461 | ||
vt 0.727273 0.000000 | ||
vt 0.636364 0.157461 | ||
vt 0.545455 0.000000 | ||
vt 0.363637 0.314921 | ||
vt 0.181819 0.314921 | ||
vt 0.909091 0.314921 | ||
vt 0.727273 0.314921 | ||
vt 0.545455 0.314921 | ||
vt 0.000000 0.314921 | ||
vt 0.272728 0.472382 | ||
vt 0.090910 0.472382 | ||
vt 0.818182 0.472382 | ||
vt 0.636364 0.472382 | ||
vt 0.454546 0.472382 | ||
vn 0.1876 -0.7947 0.5774 | ||
vn 0.6071 -0.7947 0.0000 | ||
vn -0.4911 -0.7947 0.3568 | ||
vn -0.4911 -0.7947 -0.3568 | ||
vn 0.1876 -0.7947 -0.5774 | ||
vn 0.9822 -0.1876 0.0000 | ||
vn 0.3035 -0.1876 0.9342 | ||
vn -0.7946 -0.1876 0.5774 | ||
vn -0.7946 -0.1876 -0.5774 | ||
vn 0.3035 -0.1876 -0.9342 | ||
vn 0.7946 0.1876 0.5774 | ||
vn -0.3035 0.1876 0.9342 | ||
vn -0.9822 0.1876 0.0000 | ||
vn -0.3035 0.1876 -0.9342 | ||
vn 0.7946 0.1876 -0.5774 | ||
vn 0.4911 0.7947 0.3568 | ||
vn -0.1876 0.7947 0.5774 | ||
vn -0.6071 0.7947 0.0000 | ||
vn -0.1876 0.7947 -0.5774 | ||
vn 0.4911 0.7947 -0.3568 | ||
s off | ||
f 1/1/1 2/2/1 3/3/1 | ||
f 2/2/2 1/4/2 6/5/2 | ||
f 1/6/3 3/7/3 4/8/3 | ||
f 1/9/4 4/8/4 5/10/4 | ||
f 1/11/5 5/10/5 6/5/5 | ||
f 2/2/6 6/5/6 11/12/6 | ||
f 3/3/7 2/2/7 7/13/7 | ||
f 4/8/8 3/7/8 8/14/8 | ||
f 5/10/9 4/8/9 9/15/9 | ||
f 6/5/10 5/10/10 10/16/10 | ||
f 2/2/11 11/12/11 7/13/11 | ||
f 3/3/12 7/13/12 8/17/12 | ||
f 4/8/13 8/14/13 9/15/13 | ||
f 5/10/14 9/15/14 10/16/14 | ||
f 6/5/15 10/16/15 11/12/15 | ||
f 7/13/16 11/12/16 12/18/16 | ||
f 8/17/17 7/13/17 12/19/17 | ||
f 9/15/18 8/14/18 12/20/18 | ||
f 10/16/19 9/15/19 12/21/19 | ||
f 11/12/20 10/16/20 12/22/20 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
[remap] | ||
|
||
importer="wavefront_obj" | ||
importer_version=1 | ||
type="Mesh" | ||
uid="uid://b4iu37hx5nsmp" | ||
path="res://.godot/imported/icosphere.obj-e49a82048b23f2140e3aa30c9b8b65ca.mesh" | ||
|
||
[deps] | ||
|
||
files=["res://.godot/imported/icosphere.obj-e49a82048b23f2140e3aa30c9b8b65ca.mesh"] | ||
|
||
source_file="res://assets/models/primitives/icosphere.obj" | ||
dest_files=["res://.godot/imported/icosphere.obj-e49a82048b23f2140e3aa30c9b8b65ca.mesh", "res://.godot/imported/icosphere.obj-e49a82048b23f2140e3aa30c9b8b65ca.mesh"] | ||
|
||
[params] | ||
|
||
generate_tangents=true | ||
scale_mesh=Vector3(1, 1, 1) | ||
offset_mesh=Vector3(0, 0, 0) | ||
optimize_mesh=true | ||
force_disable_mesh_compression=false |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,13 +1,25 @@ | ||
extends Area3D | ||
|
||
const ResourceDecayAnimation = preload("res://source/match/utils/ResourceDecayAnimation.tscn") | ||
|
||
var radius = null: | ||
set = _ignore, | ||
get = _get_radius | ||
|
||
|
||
func _enter_tree(): | ||
tree_exiting.connect(_animate_decay) | ||
|
||
|
||
func _ignore(_value): | ||
pass | ||
|
||
|
||
func _get_radius(): | ||
return find_child("MovementObstacle").radius | ||
|
||
|
||
func _animate_decay(): | ||
var decay_animation = ResourceDecayAnimation.instantiate() | ||
decay_animation.global_transform = global_transform | ||
get_parent().add_child.call_deferred(decay_animation) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
extends Node3D | ||
|
||
@onready var _particles = find_child("GPUParticles3D") | ||
|
||
|
||
func _ready(): | ||
await get_tree().physics_frame # wait one frame for transform to propagate | ||
_particles.finished.connect(queue_free) | ||
_particles.emitting = true |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,47 @@ | ||
[gd_scene load_steps=9 format=3 uid="uid://th6p6c16rur5"] | ||
|
||
[ext_resource type="ArrayMesh" uid="uid://b4iu37hx5nsmp" path="res://assets/models/primitives/icosphere.obj" id="1_2m585"] | ||
[ext_resource type="Script" path="res://source/match/utils/ResourceDecayAnimation.gd" id="1_wnl5r"] | ||
|
||
[sub_resource type="StandardMaterial3D" id="StandardMaterial3D_eoeij"] | ||
transparency = 1 | ||
vertex_color_use_as_albedo = true | ||
|
||
[sub_resource type="Gradient" id="Gradient_n80mp"] | ||
colors = PackedColorArray(1, 1, 1, 1, 1, 1, 1, 0) | ||
|
||
[sub_resource type="GradientTexture1D" id="GradientTexture1D_v2005"] | ||
gradient = SubResource("Gradient_n80mp") | ||
|
||
[sub_resource type="Curve" id="Curve_eymjl"] | ||
max_value = 3.0 | ||
_data = [Vector2(0, 0.396055), 0.0, 0.0, 0, 0, Vector2(0.0147602, 3), 0.0, 0.0, 0, 0] | ||
point_count = 2 | ||
|
||
[sub_resource type="CurveTexture" id="CurveTexture_om0lt"] | ||
curve = SubResource("Curve_eymjl") | ||
|
||
[sub_resource type="ParticleProcessMaterial" id="ParticleProcessMaterial_4ju5i"] | ||
emission_shape_offset = Vector3(0, 0.1, 0) | ||
emission_shape = 1 | ||
emission_sphere_radius = 0.5 | ||
gravity = Vector3(0, 0.1, 0) | ||
linear_accel_min = 0.01 | ||
linear_accel_max = 0.05 | ||
scale_min = 0.05 | ||
scale_max = 0.15 | ||
scale_over_velocity_curve = SubResource("CurveTexture_om0lt") | ||
color = Color(0.960784, 0.745098, 0.654902, 1) | ||
color_ramp = SubResource("GradientTexture1D_v2005") | ||
|
||
[node name="ResourceDecayAnimation" type="Node3D"] | ||
script = ExtResource("1_wnl5r") | ||
|
||
[node name="GPUParticles3D" type="GPUParticles3D" parent="."] | ||
material_override = SubResource("StandardMaterial3D_eoeij") | ||
emitting = false | ||
one_shot = true | ||
speed_scale = 2.0 | ||
explosiveness = 0.79 | ||
process_material = SubResource("ParticleProcessMaterial_4ju5i") | ||
draw_pass_1 = ExtResource("1_2m585") |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters