src / world / world.tscn
Diagram
Instantiators
Scene Tree
-
World Node3D
-
Mountain Node
-
SpotLights Node
-
Chapter0 SpotLight3D
-
Chapter1 SpotLight3D
-
Chapter2_1 SpotLight3D
-
Chapter2_2 SpotLight3D
-
Chapter3 SpotLight3D
-
Chapter8 SpotLight3D
-
-
DirectionalLight3D DirectionalLight3D
-
WorldEnvironment WorldEnvironment
-
Path3D Path3D
-
PathFollow3D PathFollow3D
-
Camera3D Camera3D
-
-
-
Blinder ColorRect
-
AnimationPlayer AnimationPlayer
-
Signal Connections
func _on_animation_player_animation_finished(anim_name: StringName) -> void:
match anim_name:
'opening': %AnimationPlayer.play('circular_move')
'back_to_circular_move': %AnimationPlayer.play('circular_move')
_: pass
Animations
Animation_kwh1a
back_to_circular_move
circular_move
focus_chapter_0
focus_chapter_1
focus_chapter_2
focus_chapter_3
focus_chapter_4
focus_chapter_5
focus_chapter_6
focus_chapter_7
focus_chapter_8
opening (autoplay)
zoom_chapter_0
zoom_chapter_1
zoom_chapter_2
zoom_chapter_3
zoom_chapter_4
zoom_chapter_5
zoom_chapter_6
zoom_chapter_7
zoom_chapter_8
Properties
| Name | Value |
|---|---|
script |
|
CameraNode |
|
| Name | Value |
|---|---|
transform |
|
light_color |
|
spot_range |
|
| Name | Value |
|---|---|
transform |
|
light_color |
|
light_energy |
|
light_specular |
|
light_bake_mode |
|
spot_range |
|
spot_angle |
|
| Name | Value |
|---|---|
transform |
|
light_color |
|
light_energy |
|
light_specular |
|
spot_range |
|
| Name | Value |
|---|---|
transform |
|
light_color |
|
light_energy |
|
light_specular |
|
spot_range |
|
| Name | Value |
|---|---|
transform |
|
light_color |
|
light_energy |
|
spot_range |
|
| Name | Value |
|---|---|
transform |
|
light_color |
|
spot_range |
|
| Name | Value |
|---|---|
transform |
|
light_color |
|
sky_mode |
|
| Name | Value |
|---|---|
environment |
|
compositor |
|
| Name | Value |
|---|---|
transform |
|
curve |
|
| Name | Value |
|---|---|
transform |
|
h_offset |
|
| Name | Value |
|---|---|
unique_name_in_owner |
|
transform |
|
fov |
|
near |
|
| Name | Value |
|---|---|
modulate |
|
anchors_preset |
|
anchor_right |
|
anchor_bottom |
|
grow_horizontal |
|
grow_vertical |
|
| Name | Value |
|---|---|
modulate |
|
position |
|
| Name | Value |
|---|---|
unique_name_in_owner |
|
libraries |
|
autoplay |
|
world.gd
extends Node3D
@export_node_path("Camera3D") var CameraNode : NodePath
func back_to_circular_move() -> void:
%AnimationPlayer.play('back_to_circular_move')
func focus_chapter(idx: int) -> void:
var anim_name = "focus_chapter_%s" % idx
var animation = %AnimationPlayer.get_animation(anim_name)
initialize_animation_camera_key(animation, 'position')
initialize_animation_camera_key(animation, 'rotation')
%AnimationPlayer.play(anim_name)
func zoom_chapter(idx: int) -> void:
var anim_name = "zoom_chapter_%s" % idx
%AnimationPlayer.play(anim_name)
func initialize_animation_camera_key(animation: Animation, key: String) -> void:
var track_idx = animation.find_track(
'%s:%s' % [CameraNode, key], Animation.TrackType.TYPE_VALUE)
var value = %Camera3D.get(key)
var goal = animation.track_get_key_value(track_idx, 1)
if key == 'rotation': value = smooth_rotation(value, goal)
animation.track_set_key_value(track_idx, 0, value)
func smooth_rotation(rot: Vector3, goal: Vector3) -> Vector3:
return Vector3(rot.x, acute_angle(rot.y, goal.y), rot.z)
func acute_angle(val: float, goal: float) -> float:
var delta = val - goal
if delta > PI: return val - 2*PI
elif delta < -PI: return val + 2*PI
else: return val
func _on_animation_player_animation_finished(anim_name: StringName) -> void:
match anim_name:
'opening': %AnimationPlayer.play('circular_move')
'back_to_circular_move': %AnimationPlayer.play('circular_move')
_: pass
