[gd_scene load_steps=11 format=2]

[ext_resource path="res://assets/moonbase_whitebox/Moonbase_Whitebox.tscn" type="PackedScene" id=1]
[ext_resource path="res://scripts/cameras.gd" type="Script" id=2]
[ext_resource path="res://scenes/player.tscn" type="PackedScene" id=3]
[ext_resource path="res://scenes/camera_room.tscn" type="PackedScene" id=4]
[ext_resource path="res://scripts/camera_room.gd" type="Script" id=5]
[ext_resource path="res://scripts/tracking_camera.gd" type="Script" id=6]

[sub_resource type="CylinderShape" id=1]
height = 5.22615
radius = 8.72145

[sub_resource type="BoxShape" id=4]
extents = Vector3( 1.78436, 2.33105, 6.04815 )

[sub_resource type="Animation" id=3]
length = 0.001
tracks/0/type = "value"
tracks/0/path = NodePath(".:camera_lerp")
tracks/0/interp = 1
tracks/0/loop_wrap = true
tracks/0/imported = false
tracks/0/enabled = true
tracks/0/keys = {
"times": PoolRealArray( 0 ),
"transitions": PoolRealArray( 1 ),
"update": 0,
"values": [ 0.0 ]
}

[sub_resource type="Animation" id=2]
resource_name = "switch_camera"
length = 0.3
tracks/0/type = "value"
tracks/0/path = NodePath(".:camera_lerp")
tracks/0/interp = 1
tracks/0/loop_wrap = true
tracks/0/imported = false
tracks/0/enabled = true
tracks/0/keys = {
"times": PoolRealArray( 0, 0.3 ),
"transitions": PoolRealArray( -2, 1 ),
"update": 0,
"values": [ 0.0, 1.0 ]
}

[node name="main" type="Spatial"]

[node name="Moonbase_Whitebox" parent="." instance=ExtResource( 1 )]

[node name="Player" parent="." instance=ExtResource( 3 )]
transform = Transform( 1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 5.27448 )

[node name="cameras" type="Spatial" parent="."]
script = ExtResource( 2 )
target = NodePath("../Player")
camera_lerp = 0.0

[node name="main_camera" type="Camera" parent="cameras"]
current = true

[node name="camera_room_center" type="Spatial" parent="cameras"]
script = ExtResource( 5 )

[node name="camera" type="Camera" parent="cameras/camera_room_center"]
transform = Transform( 1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 12, 0 )
script = ExtResource( 6 )
target = NodePath("../../../Player")

[node name="hitbox" type="Area" parent="cameras/camera_room_center"]
collision_layer = 16
collision_mask = 2

[node name="CollisionShape" type="CollisionShape" parent="cameras/camera_room_center/hitbox"]
transform = Transform( 1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 2.52689, 0 )
shape = SubResource( 1 )

[node name="camera_room_hallway" type="Spatial" parent="cameras"]
transform = Transform( 1, 0, 0, 0, 1, 0, 0, 0, 1, -0.0726166, 0, 17.4284 )
script = ExtResource( 5 )

[node name="camera" type="Camera" parent="cameras/camera_room_hallway"]
transform = Transform( -4.37114e-08, 0.965926, -0.258819, 0, 0.258819, 0.965926, 1, 4.2222e-08, -1.13133e-08, -1.397, 10, -2.312 )

[node name="hitbox" type="Area" parent="cameras/camera_room_hallway"]
collision_layer = 16
collision_mask = 2

[node name="CollisionShape" type="CollisionShape" parent="cameras/camera_room_hallway/hitbox"]
transform = Transform( 1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 2.52689, -1.44831 )
shape = SubResource( 4 )

[node name="camera_room0" parent="cameras" instance=ExtResource( 4 )]
transform = Transform( 1, 0, 0, 0, 1, 0, 0, 0, 1, 15.408, 0, 0 )

[node name="camera_room1" parent="cameras" instance=ExtResource( 4 )]
transform = Transform( 0.707107, 0, 0.707107, 0, 1, 0, -0.707107, 0, 0.707107, 10.653, 0, -10.485 )

[node name="camera_room2" parent="cameras" instance=ExtResource( 4 )]
transform = Transform( -0.0170336, 0, 0.999855, 0, 1, 0, -0.999855, 0, -0.0170336, -0.079, 0, -15.007 )

[node name="camera_room3" parent="cameras" instance=ExtResource( 4 )]
transform = Transform( -0.70219, 0, 0.711989, 0, 1, 0, -0.711989, 0, -0.70219, -10.6346, 0, -10.3156 )

[node name="camera_room4" parent="cameras" instance=ExtResource( 4 )]
transform = Transform( -0.999986, 0, 0.00521851, 0, 1, 0, -0.00521851, 0, -0.999986, -15.0328, 0, 0.198143 )

[node name="camera_room5" parent="cameras" instance=ExtResource( 4 )]
transform = Transform( -0.661796, 0, -0.749684, 0, 1, 0, 0.749684, 0, -0.661796, -10.4671, 0, 10.8794 )

[node name="camera_room6" parent="cameras" instance=ExtResource( 4 )]
transform = Transform( 0.696427, 0, -0.717628, 0, 1, 0, 0.717628, 0, 0.696427, 10.8827, 0, 10.7342 )

[node name="AnimationPlayer" type="AnimationPlayer" parent="cameras"]
anims/RESET = SubResource( 3 )
anims/switch_camera = SubResource( 2 )

[connection signal="player_entered" from="cameras/camera_room_center" to="cameras" method="_on_camera_room_player_entered"]
[connection signal="player_exited" from="cameras/camera_room_center" to="cameras" method="_on_camera_room_player_exited"]
[connection signal="area_entered" from="cameras/camera_room_center/hitbox" to="cameras/camera_room_center" method="_on_hitbox_area_entered"]
[connection signal="area_exited" from="cameras/camera_room_center/hitbox" to="cameras/camera_room_center" method="_on_hitbox_area_exited"]
[connection signal="player_entered" from="cameras/camera_room_hallway" to="cameras" method="_on_camera_room_player_entered"]
[connection signal="player_exited" from="cameras/camera_room_hallway" to="cameras" method="_on_camera_room_player_exited"]
[connection signal="area_entered" from="cameras/camera_room_hallway/hitbox" to="cameras/camera_room_hallway" method="_on_hitbox_area_entered"]
[connection signal="area_exited" from="cameras/camera_room_hallway/hitbox" to="cameras/camera_room_hallway" method="_on_hitbox_area_exited"]
[connection signal="player_entered" from="cameras/camera_room0" to="cameras" method="_on_camera_room_player_entered"]
[connection signal="player_exited" from="cameras/camera_room0" to="cameras" method="_on_camera_room_player_exited"]
[connection signal="player_entered" from="cameras/camera_room1" to="cameras" method="_on_camera_room_player_entered"]
[connection signal="player_exited" from="cameras/camera_room1" to="cameras" method="_on_camera_room_player_exited"]
[connection signal="player_entered" from="cameras/camera_room2" to="cameras" method="_on_camera_room_player_entered"]
[connection signal="player_exited" from="cameras/camera_room2" to="cameras" method="_on_camera_room_player_exited"]
[connection signal="player_entered" from="cameras/camera_room3" to="cameras" method="_on_camera_room_player_entered"]
[connection signal="player_exited" from="cameras/camera_room3" to="cameras" method="_on_camera_room_player_exited"]
[connection signal="player_entered" from="cameras/camera_room4" to="cameras" method="_on_camera_room_player_entered"]
[connection signal="player_exited" from="cameras/camera_room4" to="cameras" method="_on_camera_room_player_exited"]
[connection signal="player_entered" from="cameras/camera_room5" to="cameras" method="_on_camera_room_player_entered"]
[connection signal="player_exited" from="cameras/camera_room5" to="cameras" method="_on_camera_room_player_exited"]
[connection signal="player_entered" from="cameras/camera_room6" to="cameras" method="_on_camera_room_player_entered"]
[connection signal="player_exited" from="cameras/camera_room6" to="cameras" method="_on_camera_room_player_exited"]
