src / world / world.tscn

Diagram

Diagram

Assets

200

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

    • Mist res://src/world/mist/mist.tscn

    • AnimationPlayer AnimationPlayer

Signal Connections

$AnimationPlayer:[animation_finished]⇒$.
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

Diagram

back_to_circular_move

Diagram

circular_move

Diagram

focus_chapter_0

Diagram

focus_chapter_1

Diagram

focus_chapter_2

Diagram

focus_chapter_3

Diagram

focus_chapter_4

Diagram

focus_chapter_5

Diagram

focus_chapter_6

Diagram

focus_chapter_7

Diagram

focus_chapter_8

Diagram

opening (autoplay)

Diagram

zoom_chapter_0

Diagram

zoom_chapter_1

Diagram

zoom_chapter_2

Diagram

zoom_chapter_3

Diagram

zoom_chapter_4

Diagram

zoom_chapter_5

Diagram

zoom_chapter_6

Diagram

zoom_chapter_7

Diagram

zoom_chapter_8

Diagram

Properties

Table 1. Root properties
Name Value

script

CameraNode

NodePath("Path3D/PathFollow3D/Camera3D")

Table 2. $SpotLights/Chapter0 properties
Name Value

transform

Transform3D(0.00701346, -0.958252, 0.285839, 0.0572578, 0.285762, 0.956589, -0.998335, 0.00965756, 0.0568716, -0.28715, 0.0306233, -0.840506)

light_color

Color(0.914361, 0.553244, 0.844536, 1)

spot_range

0.1

Table 3. $SpotLights/Chapter1 properties
Name Value

transform

Transform3D(0.0801051, -0.989197, -0.122772, 0.00810283, -0.122517, 0.992433, -0.996754, -0.0804937, -0.00179896, -0.453171, 0.118333, -0.297492)

light_color

Color(0.295293, 0.426444, 0.435629, 1)

light_energy

0.5

light_specular

5.0

light_bake_mode

1

spot_range

0.091

spot_angle

67.956

Table 4. $SpotLights/Chapter2_1 properties
Name Value

transform

Transform3D(0.872807, -0.440018, -0.211168, 0.178005, -0.115872, 0.977184, -0.454447, -0.890482, -0.0228083, -0.469845, 0.233757, 0.0936139)

light_color

Color(0.369019, 0.215366, 0.133746, 1)

light_energy

0.5

light_specular

5.0

spot_range

0.1

Table 5. $SpotLights/Chapter2_2 properties
Name Value

transform

Transform3D(0.882029, -0.453417, 0.128208, -0.124509, 0.0381462, 0.991485, -0.454447, -0.890482, -0.0228083, -0.469845, 0.274668, 0.0936139)

light_color

Color(0.369019, 0.215366, 0.133746, 1)

light_energy

0.5

light_specular

5.0

spot_range

0.1

Table 6. $SpotLights/Chapter3 properties
Name Value

transform

Transform3D(-0.92179, -0.371002, 0.112523, 0.223451, -0.271233, 0.936217, -0.316818, 0.888139, 0.332921, -0.110666, 0.373874, 0.347782)

light_color

Color(0.816799, 0.597135, 0.462843, 1)

light_energy

0.1

spot_range

0.1

Table 7. $SpotLights/Chapter8 properties
Name Value

transform

Transform3D(-0.250815, 0.0633653, 0.965959, 0.00601347, 0.997938, -0.0639017, -0.968017, -0.0102187, -0.250678, -0.0657851, 0.607352, -0.217476)

light_color

Color(0.914361, 0.553244, 0.844536, 1)

spot_range

0.1

Table 8. $DirectionalLight3D properties
Name Value

transform

Transform3D(1, 0, 0, 0, 0.318943, 0.947774, 0, -0.947774, 0.318943, 0, 0, 0)

light_color

Color(0.427192, 0.516328, 0.867139, 1)

sky_mode

1

Table 9. $WorldEnvironment properties
Name Value

environment

SubResource("Environment_b1s5s")

compositor

SubResource("Compositor_vow5d")

Table 10. $Path3D properties
Name Value

transform

Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0.0614908, 0, -0.286387)

curve

SubResource("Curve3D_bt8sv")

Table 11. $Path3D/PathFollow3D properties
Name Value

transform

Transform3D(7.5485e-08, 0.000999828, 0.999827, -5.81978e-11, 0.999828, -0.000999827, -0.99983, 1.72872e-11, 7.54849e-08, -3.77489e-10, 2.91038e-13, 2.005)

h_offset

-0.005

Table 12. $Path3D/PathFollow3D/Camera3D properties
Name Value

unique_name_in_owner

true

transform

Transform3D(-0.519203, 0.0753502, -0.851524, 0.000438006, 0.996302, 0.0878944, 0.85485, 0.0452544, -0.517228, 0.52904, 0.621466, -0.783036)

fov

40.0

near

0.057

Table 13. $Blinder properties
Name Value

modulate

Color(0, 0, 0, 0.784314)

anchors_preset

15

anchor_right

1.0

anchor_bottom

1.0

grow_horizontal

2

grow_vertical

2

Table 14. $Mist properties
Name Value

modulate

Color(1, 1, 1, 1)

position

Vector2(0, -1)

Table 15. $AnimationPlayer properties
Name Value

unique_name_in_owner

true

libraries

{ &"": SubResource("AnimationLibrary_as40k") }

autoplay

opening

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