Lots of stuff I forgot to commit because Holidays

- D&D dice engine (see README)
- Markdown support
- Phantom camera
This commit is contained in:
Tony Bark 2023-12-24 20:39:57 -05:00
parent 9589acd877
commit 2b41f84b05
125 changed files with 13170 additions and 23 deletions

View file

@ -0,0 +1,7 @@
#####################
EXAMPLE ASSET CREDITS
#####################
# level_spritesheet
https://opengameart.org/content/a-platformer-in-the-forest
https://opengameart.org/users/buch

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View file

@ -0,0 +1,378 @@
[gd_scene load_steps=35 format=3 uid="uid://ci12ytew5vwty"]
[ext_resource type="Script" path="res://addons/phantom_camera/scripts/phantom_camera_host/phantom_camera_host.gd" id="1_ry0dd"]
[ext_resource type="Script" path="res://addons/phantom_camera/examples/scripts/3D/NPC.gd" id="2_2n1da"]
[ext_resource type="FontFile" uid="uid://c4mm3of2mc8o5" path="res://addons/phantom_camera/fonts/Nunito-Black.ttf" id="2_e7gxt"]
[ext_resource type="Script" path="res://addons/phantom_camera/scripts/phantom_camera/phantom_camera_3D.gd" id="2_y3dy8"]
[ext_resource type="PackedScene" uid="uid://cixlwqycoox8h" path="res://addons/phantom_camera/examples/models/3DPrototypeCubeDark.tscn" id="3_f5qrw"]
[ext_resource type="Resource" uid="uid://cptfoggk2ok67" path="res://addons/phantom_camera/examples/resources/tween/PlayerPhantomCamera3DTween.tres" id="4_a27nb"]
[ext_resource type="Script" path="res://addons/phantom_camera/examples/scripts/3D/3D_trigger_area.gd" id="4_moad5"]
[ext_resource type="Script" path="res://addons/phantom_camera/examples/scripts/3D/player_controller.gd" id="5_c85ys"]
[ext_resource type="Script" path="res://addons/phantom_camera/scripts/resources/tween_resource.gd" id="6_ebm1o"]
[ext_resource type="Resource" uid="uid://c1v786g5agaw5" path="res://addons/phantom_camera/examples/resources/tween/FixedCameraTween.tres" id="8_c0sgt"]
[sub_resource type="CapsuleMesh" id="CapsuleMesh_g0eml"]
[sub_resource type="StandardMaterial3D" id="StandardMaterial3D_flw6w"]
albedo_color = Color(0.988235, 0.498039, 0.498039, 1)
[sub_resource type="CapsuleShape3D" id="CapsuleShape3D_dy1i7"]
[sub_resource type="Resource" id="Resource_su0l1"]
script = ExtResource("6_ebm1o")
duration = 1.2
transition = 3
ease = 2
[sub_resource type="BoxMesh" id="BoxMesh_7tjw4"]
size = Vector3(2, 0.5, 4)
[sub_resource type="StandardMaterial3D" id="StandardMaterial3D_hpllm"]
transparency = 1
albedo_color = Color(0.988235, 0.478431, 0.905882, 0.0901961)
[sub_resource type="BoxShape3D" id="BoxShape3D_65o6h"]
size = Vector3(2, 0.5, 4)
[sub_resource type="CapsuleShape3D" id="CapsuleShape3D_tpc7d"]
[sub_resource type="StandardMaterial3D" id="StandardMaterial3D_v5iy7"]
albedo_color = Color(0.988235, 0.478431, 0.905882, 1)
[sub_resource type="BoxShape3D" id="BoxShape3D_wcrbb"]
size = Vector3(6.8, 0.1, 5.4)
[sub_resource type="BoxShape3D" id="BoxShape3D_ctyr8"]
size = Vector3(7.4, 0.1, 3.6)
[sub_resource type="BoxShape3D" id="BoxShape3D_ua072"]
size = Vector3(6.8, 0.1, 3.6)
[sub_resource type="BoxMesh" id="BoxMesh_ugc3s"]
size = Vector3(1, 1, 2)
[sub_resource type="StandardMaterial3D" id="StandardMaterial3D_68thd"]
albedo_color = Color(0.34902, 0.862745, 0.854902, 1)
[sub_resource type="BoxMesh" id="BoxMesh_wphly"]
size = Vector3(1, 0.5, 1)
[sub_resource type="BoxMesh" id="BoxMesh_gyp5s"]
size = Vector3(20, 40, 30)
[sub_resource type="BoxShape3D" id="BoxShape3D_lfaqs"]
size = Vector3(20, 40, 30)
[sub_resource type="BoxMesh" id="BoxMesh_n70lt"]
size = Vector3(14, 40, 6)
[sub_resource type="BoxShape3D" id="BoxShape3D_jxmqm"]
size = Vector3(14, 40, 6)
[sub_resource type="BoxMesh" id="BoxMesh_x0tgm"]
size = Vector3(8, 40, 1)
[sub_resource type="BoxShape3D" id="BoxShape3D_t67ef"]
size = Vector3(50, 40, 1)
[sub_resource type="BoxMesh" id="BoxMesh_rmslh"]
size = Vector3(0.5, 6, 13.5)
[sub_resource type="BoxMesh" id="BoxMesh_242ij"]
size = Vector3(2, 3, 3)
[sub_resource type="BoxMesh" id="BoxMesh_niuda"]
size = Vector3(8, 6, 0.5)
[node name="Root" type="Node3D"]
[node name="MainCamera3D" type="Camera3D" parent="."]
unique_name_in_owner = true
transform = Transform3D(0.997417, 0.0220127, -0.0662648, 0, 0.948973, 0.315232, 0.0698191, -0.314467, 0.946641, -4.132, 2, 9.011)
[node name="PhantomCameraHost" type="Node" parent="MainCamera3D"]
script = ExtResource("1_ry0dd")
[node name="PlayerGroup" type="Node" parent="."]
[node name="MovementInstructionsLabel" type="Label3D" parent="PlayerGroup"]
transform = Transform3D(1, 0, 0, 0, -4.37114e-08, 1, 0, -1, -4.37114e-08, -2.50422, -0.455369, 6.62486)
modulate = Color(0.294118, 1, 0.631373, 1)
text = "[WASD] to move"
font = ExtResource("2_e7gxt")
font_size = 48
[node name="PlayerPhantomCamera3D" type="Node3D" parent="PlayerGroup"]
unique_name_in_owner = true
transform = Transform3D(0.997417, 0.0220127, -0.0662648, 0, 0.948973, 0.315232, 0.0698191, -0.314467, 0.946641, -4.132, 2, 9.011)
script = ExtResource("2_y3dy8")
priority_override = false
priority = 3
follow_mode = 2
follow_target = NodePath("../PlayerCharacterBody3D")
follow_parameters/target_offset = Vector3(0.5, 1.5, 2)
follow_parameters/damping = true
follow_parameters/damping_value = 10.0
look_at_mode = 0
tween_parameters = ExtResource("4_a27nb")
tween_on_load = false
inactive_update_mode = 0
camera_3D_resource = null
[node name="PlayerCharacterBody3D" type="CharacterBody3D" parent="PlayerGroup"]
unique_name_in_owner = true
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, -4.632, 0.5, 7.011)
script = ExtResource("5_c85ys")
SPEED = 3.5
metadata/_edit_group_ = true
[node name="PlayerMeshInstance3D" type="MeshInstance3D" parent="PlayerGroup/PlayerCharacterBody3D"]
mesh = SubResource("CapsuleMesh_g0eml")
surface_material_override/0 = SubResource("StandardMaterial3D_flw6w")
[node name="PlayerArea3D" type="Area3D" parent="PlayerGroup/PlayerCharacterBody3D"]
[node name="CollisionShape3D" type="CollisionShape3D" parent="PlayerGroup/PlayerCharacterBody3D/PlayerArea3D"]
shape = SubResource("CapsuleShape3D_dy1i7")
[node name="PlayerCollisionShape3D" type="CollisionShape3D" parent="PlayerGroup/PlayerCharacterBody3D"]
shape = SubResource("CapsuleShape3D_dy1i7")
[node name="NPCGroup" type="Node" parent="."]
[node name="NPCPhantomCamera3D" type="Node3D" parent="NPCGroup"]
unique_name_in_owner = true
transform = Transform3D(0.616596, -0.109786, 0.779587, -2.23517e-08, 0.990229, 0.13945, -0.78728, -0.0859841, 0.610571, -2.98802, 1.50739, 1.19719)
script = ExtResource("2_y3dy8")
priority_override = false
priority = 0
follow_mode = 0
look_at_mode = 0
tween_parameters = SubResource("Resource_su0l1")
tween_on_load = true
inactive_update_mode = 0
camera_3D_resource = null
[node name="NPCDescriptionLabel" type="Label3D" parent="NPCGroup"]
transform = Transform3D(1, 0, 0, 0, 0.866026, 0.5, 0, -0.5, 0.866025, -3.04693, 0.367287, 0.953757)
text = "Input Example"
font = ExtResource("2_e7gxt")
[node name="NPCDialogueExampleLabel" type="Label3D" parent="NPCGroup"]
unique_name_in_owner = true
transform = Transform3D(1, 4.54671e-10, 1.65487e-10, 4.25644e-10, 0.939693, 0.34202, 0, -0.34202, 0.939693, -4.46738, 1.58641, -0.253679)
modulate = Color(1, 0.603922, 0.254902, 1)
text = "Press [ F ] to change camera"
font = ExtResource("2_e7gxt")
[node name="NPCInteractionZoneMesh" type="MeshInstance3D" parent="NPCGroup"]
transform = Transform3D(0.819152, 4.83851e-10, -0.573576, -3.92481e-09, 1, -6.3473e-09, 0.573576, 7.45058e-09, 0.819152, -3.46138, -0.4, 0.875321)
mesh = SubResource("BoxMesh_7tjw4")
skeleton = NodePath("../..")
surface_material_override/0 = SubResource("StandardMaterial3D_hpllm")
metadata/_edit_group_ = true
[node name="NPCInteractionArea3D" type="Area3D" parent="NPCGroup/NPCInteractionZoneMesh"]
unique_name_in_owner = true
transform = Transform3D(1, -2.68591e-26, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0)
monitorable = false
[node name="NPCInterationCollisionShape3D" type="CollisionShape3D" parent="NPCGroup/NPCInteractionZoneMesh/NPCInteractionArea3D"]
shape = SubResource("BoxShape3D_65o6h")
[node name="NPC" type="StaticBody3D" parent="NPCGroup"]
transform = Transform3D(1, 4.83851e-10, 0, 4.25644e-10, 1, -7.45058e-09, 0, 7.45058e-09, 1, -4.56338, 0.5, -0.272679)
script = ExtResource("2_2n1da")
[node name="PlayerCollisionShape3D2" type="CollisionShape3D" parent="NPCGroup/NPC"]
transform = Transform3D(1, -2.68591e-26, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0)
shape = SubResource("CapsuleShape3D_tpc7d")
[node name="NPCMesh" type="MeshInstance3D" parent="NPCGroup/NPC"]
transform = Transform3D(1, -2.68591e-26, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0)
mesh = SubResource("CapsuleMesh_g0eml")
skeleton = NodePath("../../..")
surface_material_override/0 = SubResource("StandardMaterial3D_v5iy7")
[node name="MoveToLocation" type="Node3D" parent="NPCGroup"]
unique_name_in_owner = true
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, -4.70084, 0.5, 0.962891)
[node name="FixedCameraTriggerZone" type="Node" parent="."]
[node name="FixedCameraLabel" type="Label3D" parent="FixedCameraTriggerZone"]
unique_name_in_owner = true
transform = Transform3D(0.939693, 0.280167, -0.196175, 1.49012e-08, 0.573577, 0.819152, 0.34202, -0.769751, 0.538986, -0.538716, -0.247626, 3.13456)
text = "Fixed Camera
Example"
font = ExtResource("2_e7gxt")
[node name="NorthRoomPhantomCamera3D" type="Node3D" parent="FixedCameraTriggerZone"]
transform = Transform3D(0.38357, -0.555836, 0.737507, -0.105898, 0.766851, 0.633027, -0.917417, -0.320912, 0.235279, 6.89638, 4.73986, 0.115512)
script = ExtResource("2_y3dy8")
priority_override = false
priority = 0
follow_mode = 0
look_at_mode = 0
tween_parameters = ExtResource("8_c0sgt")
tween_on_load = true
inactive_update_mode = 0
camera_3D_resource = null
[node name="NorthRoomTrigger" type="Area3D" parent="FixedCameraTriggerZone" node_paths=PackedStringArray("area_pcam")]
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 3, -0.45, -0.9)
priority = 5
script = ExtResource("4_moad5")
area_pcam = NodePath("../NorthRoomPhantomCamera3D")
metadata/_edit_group_ = true
[node name="CollisionShape3D" type="CollisionShape3D" parent="FixedCameraTriggerZone/NorthRoomTrigger"]
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0.6, 0, -0.4)
shape = SubResource("BoxShape3D_wcrbb")
[node name="EntryRoomPhantomCamera3D" type="Node3D" parent="FixedCameraTriggerZone"]
transform = Transform3D(0.258818, -0.482963, 0.836515, 1.3027e-15, 0.866025, 0.499999, -0.965924, -0.129409, 0.224143, 6.69741, 4.73364, 4.02374)
script = ExtResource("2_y3dy8")
priority_override = false
priority = 0
follow_mode = 0
look_at_mode = 0
tween_parameters = ExtResource("8_c0sgt")
tween_on_load = true
inactive_update_mode = 0
camera_3D_resource = null
[node name="EntryRoomTrigger" type="Area3D" parent="FixedCameraTriggerZone" node_paths=PackedStringArray("area_pcam")]
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 3.00003, -0.454982, 3.00572)
priority = 5
script = ExtResource("4_moad5")
area_pcam = NodePath("../EntryRoomPhantomCamera3D")
metadata/_edit_group_ = true
[node name="CollisionShape3D" type="CollisionShape3D" parent="FixedCameraTriggerZone/EntryRoomTrigger"]
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0.3, 0, 0.2)
shape = SubResource("BoxShape3D_ctyr8")
[node name="SouthRoomPhantomCamera3D" type="Node3D" parent="FixedCameraTriggerZone"]
transform = Transform3D(-0.766043, -0.492403, 0.413175, 0, 0.642787, 0.766043, -0.642786, 0.586825, -0.492403, 6.89741, 4.73364, 5.62374)
script = ExtResource("2_y3dy8")
priority_override = false
priority = 0
follow_mode = 0
look_at_mode = 0
tween_parameters = ExtResource("8_c0sgt")
tween_on_load = true
inactive_update_mode = 0
camera_3D_resource = null
[node name="SouthRoomTrigger" type="Area3D" parent="FixedCameraTriggerZone" node_paths=PackedStringArray("area_pcam")]
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 3, -0.45, 6.7)
priority = 5
script = ExtResource("4_moad5")
area_pcam = NodePath("../SouthRoomPhantomCamera3D")
metadata/_edit_group_ = true
[node name="CollisionShape3D" type="CollisionShape3D" parent="FixedCameraTriggerZone/SouthRoomTrigger"]
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0.6, 0, 0.1)
shape = SubResource("BoxShape3D_ua072")
[node name="CSGMesh3D" type="CSGMesh3D" parent="FixedCameraTriggerZone"]
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 7.14238, 1.82571, 2.88655)
mesh = SubResource("BoxMesh_ugc3s")
material = SubResource("StandardMaterial3D_68thd")
[node name="CSGMesh3D2" type="CSGMesh3D" parent="FixedCameraTriggerZone/CSGMesh3D"]
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, -0.00192642, -0.0120339, 0.00494432)
operation = 2
mesh = SubResource("BoxMesh_wphly")
material = SubResource("StandardMaterial3D_68thd")
[node name="Environment" type="Node" parent="."]
[node name="DirectionalLight3D" type="DirectionalLight3D" parent="Environment"]
transform = Transform3D(1, 0, 0, 0, 0.707107, 0.707107, 0, -0.707107, 0.707107, 0, 8, 0)
metadata/_edit_lock_ = true
[node name="Environment" type="Node3D" parent="Environment"]
[node name="Floor" parent="Environment/Environment" instance=ExtResource("3_f5qrw")]
transform = Transform3D(1000, 0, 0, 0, 1, 0, 0, 0, 1000, 0, -1, 0)
metadata/_edit_lock_ = true
[node name="West Wall" type="StaticBody3D" parent="Environment/Environment"]
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, -16, 0.5, 0)
metadata/_edit_group_ = true
metadata/_edit_lock_ = true
[node name="MeshInstance3D2" type="MeshInstance3D" parent="Environment/Environment/West Wall"]
mesh = SubResource("BoxMesh_gyp5s")
skeleton = NodePath("")
[node name="CollisionShape3D" type="CollisionShape3D" parent="Environment/Environment/West Wall"]
shape = SubResource("BoxShape3D_lfaqs")
[node name="East Wall" type="StaticBody3D" parent="Environment/Environment"]
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 16.999, 0.502, 0)
metadata/_edit_group_ = true
metadata/_edit_lock_ = true
[node name="MeshInstance3D2" type="MeshInstance3D" parent="Environment/Environment/East Wall"]
mesh = SubResource("BoxMesh_gyp5s")
skeleton = NodePath("")
[node name="CollisionShape3D" type="CollisionShape3D" parent="Environment/Environment/East Wall"]
shape = SubResource("BoxShape3D_lfaqs")
[node name="North Wall" type="StaticBody3D" parent="Environment/Environment"]
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0.5, -6.90828)
metadata/_edit_group_ = true
metadata/_edit_lock_ = true
[node name="MeshInstance3D2" type="MeshInstance3D" parent="Environment/Environment/North Wall"]
mesh = SubResource("BoxMesh_n70lt")
skeleton = NodePath("")
[node name="CollisionShape3D" type="CollisionShape3D" parent="Environment/Environment/North Wall"]
shape = SubResource("BoxShape3D_jxmqm")
[node name="South Wall" type="StaticBody3D" parent="Environment/Environment"]
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, -0.25, 0.5, 9.087)
metadata/_edit_group_ = true
[node name="MeshInstance3D3" type="MeshInstance3D" parent="Environment/Environment/South Wall"]
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 4, 0, 0)
mesh = SubResource("BoxMesh_x0tgm")
skeleton = NodePath("")
[node name="CollisionShape3D" type="CollisionShape3D" parent="Environment/Environment/South Wall"]
shape = SubResource("BoxShape3D_t67ef")
[node name="FixedCamOuterWall" type="CSGMesh3D" parent="Environment/Environment"]
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 2.5, 2)
use_collision = true
mesh = SubResource("BoxMesh_rmslh")
[node name="FixedCamOuterDoorway" type="CSGMesh3D" parent="Environment/Environment/FixedCamOuterWall"]
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, -1.5, 1)
operation = 2
mesh = SubResource("BoxMesh_242ij")
[node name="FixedCamNorthWall" type="CSGMesh3D" parent="Environment/Environment"]
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 4, 2.5, 1)
use_collision = true
mesh = SubResource("BoxMesh_niuda")
[node name="FixedCamNorthDoorway" type="CSGMesh3D" parent="Environment/Environment/FixedCamNorthWall"]
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, -1.5, 0)
operation = 2
mesh = SubResource("BoxMesh_242ij")
[node name="FixedCamSouthWall" type="CSGMesh3D" parent="Environment/Environment"]
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 4, 2.5, 5.1)
use_collision = true
mesh = SubResource("BoxMesh_niuda")
[node name="FixedCamSouthDoorway" type="CSGMesh3D" parent="Environment/Environment/FixedCamSouthWall"]
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, -1.50541, 1.19209e-07)
operation = 2
mesh = SubResource("BoxMesh_242ij")

View file

@ -0,0 +1,172 @@
[gd_scene load_steps=11 format=3 uid="uid://c4llb3gsbfv1a"]
[ext_resource type="Script" path="res://addons/phantom_camera/scripts/phantom_camera_host/phantom_camera_host.gd" id="1_7824u"]
[ext_resource type="Script" path="res://addons/phantom_camera/scripts/phantom_camera/phantom_camera_3D.gd" id="2_g1bv4"]
[ext_resource type="Script" path="res://addons/phantom_camera/examples/scripts/3D/player_controller.gd" id="3_6xt4f"]
[ext_resource type="PackedScene" uid="uid://cixlwqycoox8h" path="res://addons/phantom_camera/examples/models/3DPrototypeCubeDark.tscn" id="4_t4fso"]
[ext_resource type="Texture2D" uid="uid://c7ja4woxol8yc" path="res://addons/phantom_camera/examples/textures/3D/CheckerPatternDark.png" id="5_c0upu"]
[sub_resource type="CapsuleMesh" id="CapsuleMesh_pda7a"]
[sub_resource type="StandardMaterial3D" id="StandardMaterial3D_u74j7"]
albedo_color = Color(0.988235, 0.498039, 0.498039, 1)
[sub_resource type="CapsuleMesh" id="CapsuleMesh_xgjm7"]
radius = 0.05
height = 0.1
[sub_resource type="CapsuleShape3D" id="CapsuleShape3D_3xplc"]
[sub_resource type="StandardMaterial3D" id="StandardMaterial3D_auy8m"]
albedo_texture = ExtResource("5_c0upu")
uv1_triplanar = true
uv1_world_triplanar = true
[node name="Root" type="Node3D"]
[node name="MainCamera3D" type="Camera3D" parent="."]
unique_name_in_owner = true
transform = Transform3D(0.99995, 0, 0, 0, 0.79324, 0.608671, 0, -0.608675, 0.793235, -16.4602, 2.94168, 7.33457)
[node name="PhantomCameraHost" type="Node" parent="MainCamera3D"]
script = ExtResource("1_7824u")
[node name="DirectionalLight3D" type="DirectionalLight3D" parent="."]
transform = Transform3D(1, 0, 0, 0, 0.707107, 0.707107, 0, -0.707107, 0.707107, 0, 8, 0)
metadata/_edit_lock_ = true
[node name="Player" type="Node" parent="."]
[node name="PlayerPhantomCamera3D" type="Node3D" parent="Player"]
unique_name_in_owner = true
transform = Transform3D(0.99995, 0, 0, 0, 0.79324, 0.608671, 0, -0.608675, 0.793235, -16.4602, 2.94168, 7.33457)
script = ExtResource("2_g1bv4")
priority_override = false
priority = 0
follow_mode = 5
follow_target = NodePath("../PlayerCharacterBody3D")
follow_parameters/distance = 4.0
follow_parameters/target_offset = Vector3(0, 0, 0)
follow_parameters/damping = false
follow_parameters/dead_zone_horizontal = 0.294
follow_parameters/dead_zone_vertical = 0.201
follow_parameters/viewfinder_in_play = true
look_at_mode = 0
tween_parameters = null
tween_on_load = false
inactive_update_mode = 0
camera_3D_resource = null
[node name="PlayerCharacterBody3D" type="CharacterBody3D" parent="Player"]
unique_name_in_owner = true
transform = Transform3D(0.999897, 0.0143636, 0, -0.0143636, 0.999897, 0, 0, 0, 1, -16.4602, 0.507, 4.16163)
script = ExtResource("3_6xt4f")
metadata/_edit_group_ = true
[node name="PlayerMeshInstance3D" type="MeshInstance3D" parent="Player/PlayerCharacterBody3D"]
mesh = SubResource("CapsuleMesh_pda7a")
surface_material_override/0 = SubResource("StandardMaterial3D_u74j7")
[node name="PlayerMeshInstance3D2" type="MeshInstance3D" parent="Player/PlayerCharacterBody3D"]
visible = false
mesh = SubResource("CapsuleMesh_xgjm7")
surface_material_override/0 = SubResource("StandardMaterial3D_u74j7")
[node name="PlayerArea3D" type="Area3D" parent="Player/PlayerCharacterBody3D"]
[node name="CollisionShape3D" type="CollisionShape3D" parent="Player/PlayerCharacterBody3D/PlayerArea3D"]
shape = SubResource("CapsuleShape3D_3xplc")
[node name="PlayerCollisionShape3D" type="CollisionShape3D" parent="Player/PlayerCharacterBody3D"]
shape = SubResource("CapsuleShape3D_3xplc")
[node name="Environment" type="Node" parent="."]
[node name="Floor" parent="Environment" instance=ExtResource("4_t4fso")]
transform = Transform3D(1000, 0, 0, 0, 1, 0, 0, 0, 1000, 0, -1, 0)
metadata/_edit_lock_ = true
[node name="CSGCylinder3D" type="CSGCylinder3D" parent="Environment"]
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, -13.6511, 0.805455, -6.37532)
use_collision = true
radius = 1.71971
height = 2.61091
sides = 32
[node name="CSGCylinder3D5" type="CSGCylinder3D" parent="Environment"]
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, -21.8332, -0.540694, -3.39517)
use_collision = true
radius = 1.53269
height = 2.5036
sides = 32
[node name="CSGCylinder3D6" type="CSGCylinder3D" parent="Environment"]
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, -16.936, -1.50101, 1.22863)
use_collision = true
radius = 1.57419
height = 3.47475
sides = 32
[node name="CSGCylinder3D2" type="CSGCylinder3D" parent="Environment"]
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, -3.81402, 0.805455, -8.78984)
use_collision = true
radius = 0.956285
height = 2.61091
sides = 32
[node name="CSGSphere3D" type="CSGSphere3D" parent="Environment"]
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, -23.6875, -1.69814, 3.36997)
use_collision = true
radius = 3.34732
rings = 32
[node name="CSGSphere3D2" type="CSGSphere3D" parent="Environment"]
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, -9.14955, -0.599204, -1.04651)
use_collision = true
radius = 2.65844
rings = 32
[node name="CSGSphere3D3" type="CSGSphere3D" parent="Environment"]
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, -26.0848, -0.599204, -2.42244)
use_collision = true
radius = 2.14606
rings = 32
[node name="CSGTorus3D2" type="CSGTorus3D" parent="Environment"]
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, -6.44645, -0.497663, 4.44352)
use_collision = true
inner_radius = 0.971543
outer_radius = 2.15226
sides = 32
ring_sides = 18
[node name="CSGBox3D" type="CSGBox3D" parent="Environment"]
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, -2.52545, 6.53866, -12.6331)
use_collision = true
size = Vector3(178.429, 14.0773, 1)
material = SubResource("StandardMaterial3D_auy8m")
[node name="CSGBox3D2" type="CSGBox3D" parent="Environment"]
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, -21.1764, 0.760708, -6.1376)
use_collision = true
size = Vector3(2.64182, 2.52142, 2.30997)
[node name="CSGBox3D5" type="CSGBox3D" parent="Environment"]
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, -18.1256, -0.241718, 7.14677)
use_collision = true
size = Vector3(3.80964, 1.67049, 0.932048)
[node name="CSGBox3D3" type="CSGBox3D" parent="Environment"]
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, -6.94346, 0.138478, -4.36159)
use_collision = true
size = Vector3(1.53893, 1.27695, 1.80814)
[node name="CSGBox3D6" type="CSGBox3D" parent="Environment"]
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, -3.30382, 0.138478, -1.89037)
use_collision = true
size = Vector3(4.03502, 1.27695, 5.2198)
[node name="CSGBox3D4" type="CSGBox3D" parent="Environment"]
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, -5.90576, 0.0440434, 8.36617)
use_collision = true
size = Vector3(4.57784, 1.08809, 3.11285)

View file

@ -0,0 +1,222 @@
[gd_scene load_steps=13 format=3 uid="uid://dw2yflu7up2rr"]
[ext_resource type="Script" path="res://addons/phantom_camera/scripts/phantom_camera_host/phantom_camera_host.gd" id="1_pmeux"]
[ext_resource type="Script" path="res://addons/phantom_camera/scripts/phantom_camera/phantom_camera_3D.gd" id="2_q1ygp"]
[ext_resource type="Script" path="res://addons/phantom_camera/examples/scripts/3D/player_controller.gd" id="3_tk586"]
[ext_resource type="PackedScene" uid="uid://cixlwqycoox8h" path="res://addons/phantom_camera/examples/models/3DPrototypeCubeDark.tscn" id="4_8qqha"]
[ext_resource type="Texture2D" uid="uid://c7ja4woxol8yc" path="res://addons/phantom_camera/examples/textures/3D/CheckerPatternDark.png" id="5_wr3bq"]
[sub_resource type="CapsuleMesh" id="CapsuleMesh_pda7a"]
[sub_resource type="StandardMaterial3D" id="StandardMaterial3D_u74j7"]
albedo_color = Color(0.988235, 0.498039, 0.498039, 1)
[sub_resource type="CapsuleShape3D" id="CapsuleShape3D_3xplc"]
[sub_resource type="CapsuleMesh" id="CapsuleMesh_2h36r"]
[sub_resource type="StandardMaterial3D" id="StandardMaterial3D_w3olp"]
albedo_color = Color(0.227451, 0.337255, 0.576471, 1)
[sub_resource type="StandardMaterial3D" id="StandardMaterial3D_cw102"]
albedo_color = Color(0.227451, 0.337255, 0.576471, 1)
[sub_resource type="StandardMaterial3D" id="StandardMaterial3D_auy8m"]
albedo_texture = ExtResource("5_wr3bq")
uv1_triplanar = true
uv1_world_triplanar = true
[node name="Node3D" type="Node3D"]
[node name="MainCamera3D" type="Camera3D" parent="."]
unique_name_in_owner = true
transform = Transform3D(0.999954, 0, 0, 0, 0.638683, 0.769345, 0, -0.769298, 0.638723, -11.2101, 6.38964, 6.74731)
[node name="PhantomCameraHost" type="Node" parent="MainCamera3D"]
script = ExtResource("1_pmeux")
[node name="DirectionalLight3D" type="DirectionalLight3D" parent="."]
transform = Transform3D(1, 0, 0, 0, 0.707107, 0.707107, 0, -0.707107, 0.707107, 0, 8, 0)
metadata/_edit_lock_ = true
[node name="Player" type="Node" parent="."]
[node name="PlayerPhantomCamera3D" type="Node3D" parent="Player"]
unique_name_in_owner = true
transform = Transform3D(0.999954, 0, 0, 0, 0.638683, 0.769345, 0, -0.769298, 0.638723, -11.2101, 6.38964, 6.74731)
script = ExtResource("2_q1ygp")
priority_override = false
priority = 5
follow_mode = 1
follow_target = NodePath("../PlayerCharacterBody3D")
follow_parameters/damping = true
follow_parameters/damping_value = 5.0
look_at_mode = 0
tween_parameters = null
tween_on_load = false
inactive_update_mode = 0
camera_3D_resource = null
[node name="PlayerCharacterBody3D" type="CharacterBody3D" parent="Player"]
unique_name_in_owner = true
transform = Transform3D(0.999897, 0.0143636, 0, -0.0143636, 0.999897, 0, 0, 0, 1, -11.2101, 6.38964, 6.74731)
script = ExtResource("3_tk586")
enable_gravity = false
metadata/_edit_group_ = true
[node name="PlayerMeshInstance3D" type="MeshInstance3D" parent="Player/PlayerCharacterBody3D"]
visible = false
mesh = SubResource("CapsuleMesh_pda7a")
surface_material_override/0 = SubResource("StandardMaterial3D_u74j7")
[node name="PlayerArea3D" type="Area3D" parent="Player/PlayerCharacterBody3D"]
[node name="CollisionShape3D" type="CollisionShape3D" parent="Player/PlayerCharacterBody3D/PlayerArea3D"]
shape = SubResource("CapsuleShape3D_3xplc")
[node name="PlayerCollisionShape3D" type="CollisionShape3D" parent="Player/PlayerCharacterBody3D"]
shape = SubResource("CapsuleShape3D_3xplc")
[node name="PlayerCharacterBody3D2" type="CharacterBody3D" parent="Player"]
unique_name_in_owner = true
transform = Transform3D(0.999897, 0.0143636, 0, -0.0143636, 0.999897, 0, 0, 0, 1, -12.0829, 0.5, 1.40206)
metadata/_edit_group_ = true
[node name="PlayerMeshInstance3D" type="MeshInstance3D" parent="Player/PlayerCharacterBody3D2"]
mesh = SubResource("CapsuleMesh_pda7a")
surface_material_override/0 = SubResource("StandardMaterial3D_u74j7")
[node name="PlayerArea3D" type="Area3D" parent="Player/PlayerCharacterBody3D2"]
[node name="CollisionShape3D" type="CollisionShape3D" parent="Player/PlayerCharacterBody3D2/PlayerArea3D"]
shape = SubResource("CapsuleShape3D_3xplc")
[node name="PlayerCollisionShape3D" type="CollisionShape3D" parent="Player/PlayerCharacterBody3D2"]
shape = SubResource("CapsuleShape3D_3xplc")
[node name="NPCs" type="Node" parent="."]
[node name="PlayerMeshInstance3D" type="MeshInstance3D" parent="NPCs"]
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, -14.6059, 0.519002, -1.52506)
mesh = SubResource("CapsuleMesh_2h36r")
skeleton = NodePath("")
surface_material_override/0 = SubResource("StandardMaterial3D_w3olp")
[node name="PlayerMeshInstance3D2" type="MeshInstance3D" parent="NPCs"]
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, -10.0461, 0.519, 4.06618)
mesh = SubResource("CapsuleMesh_2h36r")
skeleton = NodePath("")
surface_material_override/0 = SubResource("StandardMaterial3D_cw102")
[node name="Environment" type="Node" parent="."]
[node name="Floor" parent="Environment" instance=ExtResource("4_8qqha")]
transform = Transform3D(1000, 0, 0, 0, 1, 0, 0, 0, 1000, 0, -1, 0)
metadata/_edit_lock_ = true
[node name="CSGCylinder3D" type="CSGCylinder3D" parent="Environment"]
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, -13.6511, 0.805455, -6.37532)
use_collision = true
radius = 1.71971
height = 2.61091
sides = 32
[node name="CSGCylinder3D5" type="CSGCylinder3D" parent="Environment"]
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 12.9141, 0.31181, -5.46661)
use_collision = true
radius = 2.77591
height = 1.62362
sides = 32
[node name="CSGCylinder3D6" type="CSGCylinder3D" parent="Environment"]
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, -21.6099, 0.31181, 6.6322)
use_collision = true
radius = 1.57419
height = 3.47475
sides = 32
[node name="CSGCylinder3D3" type="CSGCylinder3D" parent="Environment"]
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 2.75028, 0.201103, 2.71259)
use_collision = true
radius = 1.41311
height = 1.40221
sides = 32
[node name="CSGCylinder3D4" type="CSGCylinder3D" parent="Environment"]
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, -4.61885, 0.201101, 11.6804)
use_collision = true
radius = 2.21673
height = 7.88261
sides = 32
[node name="CSGCylinder3D2" type="CSGCylinder3D" parent="Environment"]
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, -3.81402, 0.805455, -8.78984)
use_collision = true
radius = 0.956285
height = 2.61091
sides = 32
[node name="CSGSphere3D" type="CSGSphere3D" parent="Environment"]
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 2.95333, -1.69814, -6.51262)
use_collision = true
radius = 3.34732
rings = 32
[node name="CSGSphere3D2" type="CSGSphere3D" parent="Environment"]
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, -11.4682, -0.599204, 8.81048)
use_collision = true
radius = 2.65844
rings = 32
[node name="CSGSphere3D3" type="CSGSphere3D" parent="Environment"]
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, -26.0848, -0.599204, -2.42244)
use_collision = true
radius = 2.14606
rings = 32
[node name="CSGTorus3D" type="CSGTorus3D" parent="Environment"]
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, -17.2356, -1.90735e-06, 0.346393)
use_collision = true
inner_radius = 1.3
outer_radius = 2.0
sides = 32
ring_sides = 18
[node name="CSGTorus3D2" type="CSGTorus3D" parent="Environment"]
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 9.90455, -1.90735e-06, 7.89765)
use_collision = true
inner_radius = 0.971543
outer_radius = 2.15226
sides = 32
ring_sides = 18
[node name="CSGBox3D" type="CSGBox3D" parent="Environment"]
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, -2.52545, 6.53866, -12.6331)
use_collision = true
size = Vector3(178.429, 14.0773, 1)
material = SubResource("StandardMaterial3D_auy8m")
[node name="CSGBox3D2" type="CSGBox3D" parent="Environment"]
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, -21.1764, 0.760708, -6.1376)
use_collision = true
size = Vector3(2.64182, 2.52142, 2.30997)
[node name="CSGBox3D5" type="CSGBox3D" parent="Environment"]
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 2.31901, 0.335247, 8.22829)
use_collision = true
size = Vector3(3.80964, 1.67049, 0.932048)
[node name="CSGBox3D3" type="CSGBox3D" parent="Environment"]
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, -6.94346, 0.138478, -4.36159)
use_collision = true
size = Vector3(1.53893, 1.27695, 1.80814)
[node name="CSGBox3D6" type="CSGBox3D" parent="Environment"]
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, -26.7985, 0.138478, 5.20734)
use_collision = true
size = Vector3(4.03502, 1.27695, 5.2198)
[node name="CSGBox3D4" type="CSGBox3D" parent="Environment"]
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 18.1236, 1.78638, -1.60318)
use_collision = true
size = Vector3(4.57784, 4.57276, 3.11285)

View file

@ -0,0 +1,186 @@
[gd_scene load_steps=13 format=3 uid="uid://dbfiy6svpcqap"]
[ext_resource type="PackedScene" uid="uid://cixlwqycoox8h" path="res://addons/phantom_camera/examples/models/3DPrototypeCubeDark.tscn" id="1_r00ve"]
[ext_resource type="Script" path="res://addons/phantom_camera/scripts/phantom_camera/phantom_camera_3D.gd" id="2_pi7mp"]
[ext_resource type="Texture2D" uid="uid://c7ja4woxol8yc" path="res://addons/phantom_camera/examples/textures/3D/CheckerPatternDark.png" id="3_a5igg"]
[ext_resource type="Script" path="res://addons/phantom_camera/scripts/phantom_camera_host/phantom_camera_host.gd" id="3_wr1tj"]
[ext_resource type="Script" path="res://addons/phantom_camera/examples/scripts/3D/player_controller.gd" id="4_hehj7"]
[sub_resource type="CapsuleMesh" id="CapsuleMesh_pda7a"]
[sub_resource type="StandardMaterial3D" id="StandardMaterial3D_u74j7"]
albedo_color = Color(0.988235, 0.498039, 0.498039, 1)
[sub_resource type="CapsuleShape3D" id="CapsuleShape3D_3xplc"]
[sub_resource type="CapsuleMesh" id="CapsuleMesh_2h36r"]
[sub_resource type="StandardMaterial3D" id="StandardMaterial3D_w3olp"]
albedo_color = Color(0.227451, 0.337255, 0.576471, 1)
[sub_resource type="StandardMaterial3D" id="StandardMaterial3D_cw102"]
albedo_color = Color(0.227451, 0.337255, 0.576471, 1)
[sub_resource type="StandardMaterial3D" id="StandardMaterial3D_auy8m"]
albedo_texture = ExtResource("3_a5igg")
uv1_triplanar = true
uv1_world_triplanar = true
[node name="Node3D" type="Node3D"]
[node name="MainCamera3D" type="Camera3D" parent="."]
unique_name_in_owner = true
transform = Transform3D(0.999954, 0, 0, 0, 0.906188, 0.422588, 0, -0.422562, 0.906243, -12.326, 2.60717, 5.26374)
[node name="PhantomCameraHost" type="Node" parent="MainCamera3D"]
script = ExtResource("3_wr1tj")
[node name="DirectionalLight3D" type="DirectionalLight3D" parent="."]
transform = Transform3D(1, 0, 0, 0, 0.707107, 0.707107, 0, -0.707107, 0.707107, 0, 8, 0)
metadata/_edit_lock_ = true
[node name="Player" type="Node" parent="."]
[node name="PlayerPhantomCamera3D" type="Node3D" parent="Player"]
unique_name_in_owner = true
transform = Transform3D(0.999954, 0, 0, 0, 0.906188, 0.422588, 0, -0.422562, 0.906243, -12.326, 2.60717, 5.26374)
script = ExtResource("2_pi7mp")
priority_override = false
priority = 5
follow_mode = 3
follow_group = Array[NodePath]([NodePath("../PlayerCharacterBody3D2"), NodePath("../../NPCs/PlayerMeshInstance3D"), NodePath("../../NPCs/PlayerMeshInstance3D2")])
follow_parameters/auto_distance = true
follow_parameters/min_distance = 2.0
follow_parameters/max_distance = 15.0
follow_parameters/auto_distance_divisor = 20.0
follow_parameters/target_offset = Vector3(0, 0, 0)
follow_parameters/damping = true
follow_parameters/damping_value = 5.0
look_at_mode = 0
tween_parameters = null
tween_on_load = false
inactive_update_mode = 0
camera_3D_resource = null
[node name="PlayerCharacterBody3D2" type="CharacterBody3D" parent="Player"]
unique_name_in_owner = true
transform = Transform3D(0.999897, 0.0143636, 0, -0.0143636, 0.999897, 0, 0, 0, 1, -12.0829, 0.5, 1.40206)
script = ExtResource("4_hehj7")
metadata/_edit_group_ = true
[node name="PlayerMeshInstance3D" type="MeshInstance3D" parent="Player/PlayerCharacterBody3D2"]
mesh = SubResource("CapsuleMesh_pda7a")
surface_material_override/0 = SubResource("StandardMaterial3D_u74j7")
[node name="PlayerArea3D" type="Area3D" parent="Player/PlayerCharacterBody3D2"]
[node name="CollisionShape3D" type="CollisionShape3D" parent="Player/PlayerCharacterBody3D2/PlayerArea3D"]
shape = SubResource("CapsuleShape3D_3xplc")
[node name="PlayerCollisionShape3D" type="CollisionShape3D" parent="Player/PlayerCharacterBody3D2"]
shape = SubResource("CapsuleShape3D_3xplc")
[node name="NPCs" type="Node" parent="."]
[node name="PlayerMeshInstance3D" type="MeshInstance3D" parent="NPCs"]
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, -14.6059, 0.519002, 0.128472)
mesh = SubResource("CapsuleMesh_2h36r")
skeleton = NodePath("")
surface_material_override/0 = SubResource("StandardMaterial3D_w3olp")
[node name="PlayerMeshInstance3D2" type="MeshInstance3D" parent="NPCs"]
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, -10.0461, 0.519, 0.249913)
mesh = SubResource("CapsuleMesh_2h36r")
skeleton = NodePath("")
surface_material_override/0 = SubResource("StandardMaterial3D_cw102")
[node name="Environment" type="Node" parent="."]
[node name="Floor" parent="Environment" instance=ExtResource("1_r00ve")]
transform = Transform3D(1000, 0, 0, 0, 1, 0, 0, 0, 1000, 0, -1, 0)
metadata/_edit_lock_ = true
[node name="Wall" type="CSGBox3D" parent="Environment"]
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, -2.52545, 6.53866, -12.6331)
use_collision = true
size = Vector3(178.429, 14.0773, 1)
material = SubResource("StandardMaterial3D_auy8m")
[node name="CSGCylinder3D" type="CSGCylinder3D" parent="Environment"]
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, -13.6511, 0.805455, -6.37532)
use_collision = true
radius = 1.71971
height = 2.61091
sides = 32
[node name="CSGCylinder3D5" type="CSGCylinder3D" parent="Environment"]
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 12.9141, 0.31181, -5.46661)
use_collision = true
radius = 2.77591
height = 1.62362
sides = 32
[node name="CSGCylinder3D6" type="CSGCylinder3D" parent="Environment"]
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, -21.6099, 0.31181, 6.6322)
use_collision = true
radius = 1.57419
height = 3.47475
sides = 32
[node name="CSGCylinder3D2" type="CSGCylinder3D" parent="Environment"]
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, -3.81402, 0.805455, -8.78984)
use_collision = true
radius = 0.956285
height = 2.61091
sides = 32
[node name="CSGSphere3D" type="CSGSphere3D" parent="Environment"]
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 2.95333, -1.69814, -6.51262)
use_collision = true
radius = 3.34732
rings = 32
[node name="CSGSphere3D2" type="CSGSphere3D" parent="Environment"]
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, -11.4682, -0.599204, 8.81048)
use_collision = true
radius = 2.65844
rings = 32
[node name="CSGSphere3D3" type="CSGSphere3D" parent="Environment"]
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, -26.0848, -0.599204, -2.42244)
use_collision = true
radius = 2.14606
rings = 32
[node name="CSGTorus3D2" type="CSGTorus3D" parent="Environment"]
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 9.90455, -1.90735e-06, 7.89765)
use_collision = true
inner_radius = 0.971543
outer_radius = 2.15226
sides = 32
ring_sides = 18
[node name="CSGBox3D2" type="CSGBox3D" parent="Environment"]
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, -21.1764, 0.760708, -6.1376)
use_collision = true
size = Vector3(2.64182, 2.52142, 2.30997)
[node name="CSGBox3D5" type="CSGBox3D" parent="Environment"]
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 2.31901, 0.335247, 8.22829)
use_collision = true
size = Vector3(3.80964, 1.67049, 0.932048)
[node name="CSGBox3D3" type="CSGBox3D" parent="Environment"]
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, -6.94346, 0.138478, -4.36159)
use_collision = true
size = Vector3(1.53893, 1.27695, 1.80814)
[node name="CSGBox3D6" type="CSGBox3D" parent="Environment"]
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, -26.7985, 0.138478, 5.20734)
use_collision = true
size = Vector3(4.03502, 1.27695, 5.2198)
[node name="CSGBox3D4" type="CSGBox3D" parent="Environment"]
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 18.1236, 1.78638, -1.60318)
use_collision = true
size = Vector3(4.57784, 4.57276, 3.11285)

View file

@ -0,0 +1,239 @@
[gd_scene load_steps=23 format=3 uid="uid://dxx7ngi0emt8h"]
[ext_resource type="Script" path="res://addons/phantom_camera/scripts/phantom_camera_host/phantom_camera_host.gd" id="1_lm5n8"]
[ext_resource type="Script" path="res://addons/phantom_camera/examples/scripts/3D/player_controller.gd" id="2_tsk60"]
[ext_resource type="Script" path="res://addons/phantom_camera/scripts/phantom_camera/phantom_camera_3D.gd" id="3_bd7x3"]
[ext_resource type="Script" path="res://addons/phantom_camera/scripts/resources/tween_resource.gd" id="3_hbjve"]
[ext_resource type="PackedScene" uid="uid://cixlwqycoox8h" path="res://addons/phantom_camera/examples/models/3DPrototypeCubeDark.tscn" id="4_dfdlo"]
[ext_resource type="Script" path="res://addons/phantom_camera/examples/scripts/3D/path_follow.gd" id="5_vdqkm"]
[ext_resource type="FontFile" uid="uid://c4mm3of2mc8o5" path="res://addons/phantom_camera/fonts/Nunito-Black.ttf" id="6_obo83"]
[sub_resource type="Resource" id="Resource_m07s2"]
script = ExtResource("3_hbjve")
duration = 0.6
transition = 1
ease = 2
[sub_resource type="CapsuleMesh" id="CapsuleMesh_vr5ym"]
[sub_resource type="StandardMaterial3D" id="StandardMaterial3D_mjpjo"]
albedo_color = Color(0.988235, 0.498039, 0.498039, 1)
[sub_resource type="CapsuleShape3D" id="CapsuleShape3D_ca4wa"]
[sub_resource type="Resource" id="Resource_rw4bl"]
script = ExtResource("3_hbjve")
duration = 1.0
transition = 3
ease = 2
[sub_resource type="Curve3D" id="Curve3D_b33df"]
_data = {
"points": PackedVector3Array(0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -10),
"tilts": PackedFloat32Array(0, 0)
}
point_count = 2
[sub_resource type="BoxShape3D" id="BoxShape3D_aovgi"]
size = Vector3(6, 0.1, 10)
[sub_resource type="BoxMesh" id="BoxMesh_0hdeh"]
size = Vector3(6, 0.1, 10)
[sub_resource type="StandardMaterial3D" id="StandardMaterial3D_fsm1b"]
transparency = 1
albedo_color = Color(0.988235, 0.478431, 0.905882, 0.0901961)
[sub_resource type="Curve3D" id="Curve3D_8uw2x"]
_data = {
"points": PackedVector3Array(0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 10, 0, 0),
"tilts": PackedFloat32Array(0, 0)
}
point_count = 2
[sub_resource type="BoxShape3D" id="BoxShape3D_ctnqu"]
size = Vector3(12, 0.1, 4)
[sub_resource type="BoxMesh" id="BoxMesh_f6dp8"]
size = Vector3(12, 0.1, 4)
[sub_resource type="StandardMaterial3D" id="StandardMaterial3D_gwnkj"]
transparency = 1
albedo_color = Color(0.568403, 0.988235, 0.762724, 0.0901961)
[sub_resource type="BoxMesh" id="BoxMesh_7l3dh"]
[sub_resource type="BoxMesh" id="BoxMesh_as6ok"]
[node name="Root" type="Node3D"]
[node name="MainCamera3D" type="Camera3D" parent="."]
unique_name_in_owner = true
transform = Transform3D(0.999807, -0.00216249, 0.00184445, 0, 0.648836, 0.760728, -0.00284214, -0.760718, 0.648839, 4.00185, 2.99999, -1.51096)
fov = 90.0
[node name="PhantomCameraHost" type="Node" parent="MainCamera3D"]
script = ExtResource("1_lm5n8")
[node name="DirectionalLight3D" type="DirectionalLight3D" parent="."]
transform = Transform3D(1, 0, 0, 0, 0.707107, 0.707107, 0, -0.707107, 0.707107, 0, 8, 0)
metadata/_edit_lock_ = true
[node name="PlayerPhantomCamera3D" type="Node3D" parent="."]
unique_name_in_owner = true
transform = Transform3D(0.999807, -0.00216249, 0.00184445, 0, 0.648836, 0.760728, -0.00284214, -0.760718, 0.648839, 4.00185, 2.99999, -1.51096)
script = ExtResource("3_bd7x3")
priority_override = false
priority = 3
follow_mode = 2
follow_target = NodePath("../PlayerCharacterBody3D")
follow_parameters/target_offset = Vector3(0, 2.5, 2)
follow_parameters/damping = true
follow_parameters/damping_value = 10.0
look_at_mode = 0
tween_parameters = SubResource("Resource_m07s2")
tween_on_load = false
inactive_update_mode = 0
camera_3D_resource = null
[node name="PlayerCharacterBody3D" type="CharacterBody3D" parent="."]
unique_name_in_owner = true
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 4.00185, 0.499993, -3.51096)
script = ExtResource("2_tsk60")
SPEED = 3.5
metadata/_edit_group_ = true
[node name="PlayerMeshInstance3D" type="MeshInstance3D" parent="PlayerCharacterBody3D"]
mesh = SubResource("CapsuleMesh_vr5ym")
surface_material_override/0 = SubResource("StandardMaterial3D_mjpjo")
[node name="PlayerArea3D" type="Area3D" parent="PlayerCharacterBody3D"]
[node name="CollisionShape3D" type="CollisionShape3D" parent="PlayerCharacterBody3D/PlayerArea3D"]
shape = SubResource("CapsuleShape3D_ca4wa")
[node name="PlayerCollisionShape3D" type="CollisionShape3D" parent="PlayerCharacterBody3D"]
shape = SubResource("CapsuleShape3D_ca4wa")
[node name="Paths" type="Node" parent="."]
[node name="PathPhantomCamera3D" type="Node3D" parent="Paths"]
transform = Transform3D(-4.37114e-08, -1, -4.37114e-08, 0, -4.37114e-08, 1, -1, 4.37114e-08, 1.91069e-15, 3.73176, 7.9199, -4.8731)
script = ExtResource("3_bd7x3")
priority_override = false
priority = 2
follow_mode = 4
follow_target = NodePath("../../PlayerCharacterBody3D")
follow_path = NodePath("../FollowPath")
follow_parameters/damping = true
follow_parameters/damping_value = 3.0
look_at_mode = 0
tween_parameters = SubResource("Resource_rw4bl")
tween_on_load = false
inactive_update_mode = 0
camera_3D_resource = null
[node name="FollowPath" type="Path3D" parent="Paths"]
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 3.73176, 7.9199, -4.8731)
curve = SubResource("Curve3D_b33df")
[node name="StraightPathFollowTrigger" type="Area3D" parent="Paths" node_paths=PackedStringArray("path_pcam")]
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 4, -0.45, -10)
priority = 5
script = ExtResource("5_vdqkm")
path_pcam = NodePath("../PathPhantomCamera3D")
metadata/_edit_group_ = true
[node name="CollisionShape3D" type="CollisionShape3D" parent="Paths/StraightPathFollowTrigger"]
shape = SubResource("BoxShape3D_aovgi")
[node name="NPCInteractionZoneMesh" type="MeshInstance3D" parent="Paths/StraightPathFollowTrigger/CollisionShape3D"]
mesh = SubResource("BoxMesh_0hdeh")
skeleton = NodePath("../../../..")
surface_material_override/0 = SubResource("StandardMaterial3D_fsm1b")
metadata/_edit_group_ = true
[node name="PathPhantomCamera3D2" type="Node3D" parent="Paths"]
transform = Transform3D(1, 0, 0, 0, -4.37114e-08, 1, 0, -1, -4.37114e-08, 4.00185, 7.9199, -16.7205)
visible = false
script = ExtResource("3_bd7x3")
priority_override = false
priority = 2
follow_mode = 4
follow_target = NodePath("../../PlayerCharacterBody3D")
follow_path = NodePath("../FollowPath2")
follow_parameters/damping = true
follow_parameters/damping_value = 3.0
look_at_mode = 0
tween_parameters = SubResource("Resource_rw4bl")
tween_on_load = false
inactive_update_mode = 0
camera_3D_resource = null
[node name="FollowPath2" type="Path3D" parent="Paths"]
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, -0.92937, 7.9199, -16.7205)
curve = SubResource("Curve3D_8uw2x")
[node name="StraightPathFollowTrigger2" type="Area3D" parent="Paths" node_paths=PackedStringArray("path_pcam")]
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 4, 0, -17)
priority = 5
script = ExtResource("5_vdqkm")
path_pcam = NodePath("../PathPhantomCamera3D2")
metadata/_edit_group_ = true
[node name="CollisionShape3D" type="CollisionShape3D" parent="Paths/StraightPathFollowTrigger2"]
shape = SubResource("BoxShape3D_ctnqu")
[node name="NPCInteractionZoneMesh" type="MeshInstance3D" parent="Paths/StraightPathFollowTrigger2/CollisionShape3D"]
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, -0.45, 0)
mesh = SubResource("BoxMesh_f6dp8")
skeleton = NodePath("../../../..")
surface_material_override/0 = SubResource("StandardMaterial3D_gwnkj")
metadata/_edit_group_ = true
[node name="Environment" type="Node" parent="."]
[node name="Floor" parent="Environment" instance=ExtResource("4_dfdlo")]
transform = Transform3D(1000, 0, 0, 0, 1, 0, 0, 0, 1000, 0, -1, 0)
metadata/_edit_lock_ = true
[node name="Floor3" parent="Environment" instance=ExtResource("4_dfdlo")]
transform = Transform3D(6, 0, 0, 0, 1, 0, 0, 0, 1, 3.6, 0, -1.5)
[node name="Floor2" parent="Environment/Floor3" instance=ExtResource("4_dfdlo")]
transform = Transform3D(0.166667, 0, 0, 0, 3, 0, 0, 0, 14, -0.516667, 1, -6.5)
[node name="Floor5" parent="Environment/Floor3" instance=ExtResource("4_dfdlo")]
transform = Transform3D(0.166667, 0, 0, 0, 3, 0, 0, 0, 14, 0.65, 1, -6.5)
[node name="Floor4" parent="Environment/Floor3" instance=ExtResource("4_dfdlo")]
transform = Transform3D(2, 0, 0, 0, 3, 0, 0, 0, 1, 0.0666667, 1, -18)
[node name="Floor6" parent="Environment/Floor3" instance=ExtResource("4_dfdlo")]
transform = Transform3D(0.333333, 0, 0, 0, 3, 0, 0, 0, 1, -0.766667, 1, -13)
mesh = SubResource("BoxMesh_7l3dh")
[node name="Floor8" parent="Environment/Floor3" instance=ExtResource("4_dfdlo")]
transform = Transform3D(0.166667, 0, 0, 0, 3, 0, 0, 0, 6, -1.01667, 1, -15.5)
mesh = SubResource("BoxMesh_as6ok")
[node name="Floor9" parent="Environment/Floor3" instance=ExtResource("4_dfdlo")]
transform = Transform3D(0.166667, 0, 0, 0, 3, 0, 0, 0, 6, 1.15, 1, -15.5)
mesh = SubResource("BoxMesh_as6ok")
[node name="Floor7" parent="Environment/Floor3" instance=ExtResource("4_dfdlo")]
transform = Transform3D(0.333333, 0, 0, 0, 3, 0, 0, 0, 1, 0.9, 1, -13)
mesh = SubResource("BoxMesh_7l3dh")
[node name="NPCDescriptionLabel" type="Label3D" parent="Environment"]
transform = Transform3D(5.21541e-08, -1, -7.7486e-07, -1.10675e-15, 2.23517e-07, 0.999999, -0.999999, -7.45058e-08, -5.68829e-14, 0.568982, 2.59595, -8.78089)
text = "Camera follows player while confined to a Path3D"
font = ExtResource("6_obo83")
font_size = 64
[node name="MovementInstructionsLabel" type="Label3D" parent="Environment"]
transform = Transform3D(1, 0, 0, 0, -4.37114e-08, 1, 0, -1, -4.37114e-08, 4.0203, -0.455369, -2.69276)
modulate = Color(0.294118, 1, 0.631373, 1)
text = "[WASD] to move"
font = ExtResource("6_obo83")
font_size = 48

View file

@ -0,0 +1,170 @@
[gd_scene load_steps=12 format=3 uid="uid://buglvjwpn85ny"]
[ext_resource type="Script" path="res://addons/phantom_camera/scripts/phantom_camera_host/phantom_camera_host.gd" id="1_trxu1"]
[ext_resource type="Script" path="res://addons/phantom_camera/scripts/phantom_camera/phantom_camera_3D.gd" id="2_grjck"]
[ext_resource type="Script" path="res://addons/phantom_camera/scripts/resources/camera_3D_resource.gd" id="3_ac3tw"]
[ext_resource type="Script" path="res://addons/phantom_camera/examples/scripts/3D/player_controller.gd" id="3_uymu2"]
[ext_resource type="PackedScene" uid="uid://cixlwqycoox8h" path="res://addons/phantom_camera/examples/models/3DPrototypeCubeDark.tscn" id="4_4u2y6"]
[ext_resource type="Texture2D" uid="uid://c7ja4woxol8yc" path="res://addons/phantom_camera/examples/textures/3D/CheckerPatternDark.png" id="5_1tybo"]
[sub_resource type="Resource" id="Resource_beoni"]
script = ExtResource("3_ac3tw")
cull_mask = 1048575
h_offset = 0.0
v_offset = 0.0
fov = 75.0
[sub_resource type="CapsuleMesh" id="CapsuleMesh_pda7a"]
[sub_resource type="StandardMaterial3D" id="StandardMaterial3D_u74j7"]
albedo_color = Color(0.988235, 0.498039, 0.498039, 1)
[sub_resource type="CapsuleShape3D" id="CapsuleShape3D_3xplc"]
[sub_resource type="StandardMaterial3D" id="StandardMaterial3D_auy8m"]
albedo_texture = ExtResource("5_1tybo")
uv1_triplanar = true
uv1_world_triplanar = true
[node name="Node3D" type="Node3D"]
[node name="MainCamera3D" type="Camera3D" parent="."]
unique_name_in_owner = true
transform = Transform3D(0.999954, 0, 0, 0, 0.906188, 0.422588, 0, -0.422562, 0.906243, -13.1946, 2.34415, 10.4086)
[node name="PhantomCameraHost" type="Node" parent="MainCamera3D"]
script = ExtResource("1_trxu1")
[node name="DirectionalLight3D" type="DirectionalLight3D" parent="."]
transform = Transform3D(1, 0, 0, 0, 0.707107, 0.707107, 0, -0.707107, 0.707107, 0, 8, 0)
metadata/_edit_lock_ = true
[node name="Player" type="Node" parent="."]
[node name="PlayerPhantomCamera3D" type="Node3D" parent="Player"]
unique_name_in_owner = true
transform = Transform3D(0.999954, 0, 0, 0, 0.906188, 0.422588, 0, -0.422562, 0.906243, -13.1946, 2.34415, 10.4086)
script = ExtResource("2_grjck")
priority_override = false
priority = 0
follow_mode = 2
follow_target = NodePath("../PlayerCharacterBody3D2")
follow_parameters/target_offset = Vector3(0, 2, 2)
follow_parameters/damping = true
follow_parameters/damping_value = 10.0
look_at_mode = 0
tween_parameters = null
tween_on_load = false
inactive_update_mode = 0
camera_3D_resource = SubResource("Resource_beoni")
[node name="PlayerCharacterBody3D2" type="CharacterBody3D" parent="Player"]
unique_name_in_owner = true
transform = Transform3D(0.999897, 0.0143636, 0, -0.0143636, 0.999897, 0, 0, 0, 1, -13.1946, 0.344147, 8.40857)
script = ExtResource("3_uymu2")
metadata/_edit_group_ = true
[node name="PlayerMeshInstance3D" type="MeshInstance3D" parent="Player/PlayerCharacterBody3D2"]
mesh = SubResource("CapsuleMesh_pda7a")
surface_material_override/0 = SubResource("StandardMaterial3D_u74j7")
[node name="PlayerArea3D" type="Area3D" parent="Player/PlayerCharacterBody3D2"]
[node name="CollisionShape3D" type="CollisionShape3D" parent="Player/PlayerCharacterBody3D2/PlayerArea3D"]
shape = SubResource("CapsuleShape3D_3xplc")
[node name="PlayerCollisionShape3D" type="CollisionShape3D" parent="Player/PlayerCharacterBody3D2"]
shape = SubResource("CapsuleShape3D_3xplc")
[node name="NPCs" type="Node" parent="."]
[node name="Environment" type="Node" parent="."]
[node name="Floor" parent="Environment" instance=ExtResource("4_4u2y6")]
transform = Transform3D(1000, 0, 0, 0, 1, 0, 0, 0, 1000, 0, -1, 0)
metadata/_edit_lock_ = true
[node name="CSGCylinder3D" type="CSGCylinder3D" parent="Environment"]
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, -13.6511, 0.805455, -6.37532)
use_collision = true
radius = 1.71971
height = 2.61091
sides = 32
[node name="CSGCylinder3D5" type="CSGCylinder3D" parent="Environment"]
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, -21.8332, -0.540694, -3.39517)
use_collision = true
radius = 1.53269
height = 2.5036
sides = 32
[node name="CSGCylinder3D6" type="CSGCylinder3D" parent="Environment"]
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, -16.936, -1.50101, 1.22863)
use_collision = true
radius = 1.57419
height = 3.47475
sides = 32
[node name="CSGCylinder3D2" type="CSGCylinder3D" parent="Environment"]
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, -3.81402, 0.805455, -8.78984)
use_collision = true
radius = 0.956285
height = 2.61091
sides = 32
[node name="CSGSphere3D" type="CSGSphere3D" parent="Environment"]
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, -23.6875, -1.69814, 3.36997)
use_collision = true
radius = 3.34732
rings = 32
[node name="CSGSphere3D2" type="CSGSphere3D" parent="Environment"]
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, -9.14955, -0.599204, -1.04651)
use_collision = true
radius = 2.65844
rings = 32
[node name="CSGSphere3D3" type="CSGSphere3D" parent="Environment"]
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, -26.0848, -0.599204, -2.42244)
use_collision = true
radius = 2.14606
rings = 32
[node name="CSGTorus3D2" type="CSGTorus3D" parent="Environment"]
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, -6.44645, -0.497663, 4.44352)
use_collision = true
inner_radius = 0.971543
outer_radius = 2.15226
sides = 32
ring_sides = 18
[node name="CSGBox3D" type="CSGBox3D" parent="Environment"]
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, -2.52545, 6.53866, -12.6331)
use_collision = true
size = Vector3(178.429, 14.0773, 1)
material = SubResource("StandardMaterial3D_auy8m")
[node name="CSGBox3D2" type="CSGBox3D" parent="Environment"]
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, -21.1764, 0.760708, -6.1376)
use_collision = true
size = Vector3(2.64182, 2.52142, 2.30997)
[node name="CSGBox3D5" type="CSGBox3D" parent="Environment"]
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, -18.1256, 0.335247, 7.14677)
use_collision = true
size = Vector3(3.80964, 1.67049, 0.932048)
[node name="CSGBox3D3" type="CSGBox3D" parent="Environment"]
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, -6.94346, 0.138478, -4.36159)
use_collision = true
size = Vector3(1.53893, 1.27695, 1.80814)
[node name="CSGBox3D6" type="CSGBox3D" parent="Environment"]
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, -3.30382, 0.138478, -1.89037)
use_collision = true
size = Vector3(4.03502, 1.27695, 5.2198)
[node name="CSGBox3D4" type="CSGBox3D" parent="Environment"]
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, -9.04727, 0.0440434, 8.36617)
use_collision = true
size = Vector3(4.57784, 1.08809, 3.11285)

View file

@ -0,0 +1,216 @@
[gd_scene load_steps=19 format=3 uid="uid://4i5csj0s34nb"]
[ext_resource type="Script" path="res://addons/phantom_camera/scripts/phantom_camera_host/phantom_camera_host.gd" id="1_b4nxi"]
[ext_resource type="Script" path="res://addons/phantom_camera/scripts/phantom_camera/phantom_camera_3D.gd" id="2_whx47"]
[ext_resource type="Script" path="res://addons/phantom_camera/scripts/resources/tween_resource.gd" id="3_oisgy"]
[ext_resource type="PackedScene" uid="uid://cixlwqycoox8h" path="res://addons/phantom_camera/examples/models/3DPrototypeCubeDark.tscn" id="4_lii5s"]
[ext_resource type="Script" path="res://addons/phantom_camera/scripts/resources/camera_3D_resource.gd" id="5_jt2lp"]
[ext_resource type="Script" path="res://addons/phantom_camera/examples/scripts/3D/player_controller_third_person.gd" id="5_p60kr"]
[ext_resource type="FontFile" uid="uid://c4mm3of2mc8o5" path="res://addons/phantom_camera/fonts/Nunito-Black.ttf" id="7_kg7u1"]
[sub_resource type="Resource" id="Resource_0yw0t"]
script = ExtResource("3_oisgy")
duration = 0.3
transition = 1
ease = 2
[sub_resource type="Resource" id="Resource_bai5y"]
script = ExtResource("5_jt2lp")
cull_mask = 1048575
h_offset = 0.0
v_offset = 0.0
fov = 75.0
[sub_resource type="Resource" id="Resource_xvcjx"]
script = ExtResource("3_oisgy")
duration = 0.25
transition = 1
ease = 2
[sub_resource type="Resource" id="Resource_yf1op"]
script = ExtResource("5_jt2lp")
cull_mask = 1048575
h_offset = 1.0
v_offset = 0.0
fov = 50.0
[sub_resource type="CapsuleShape3D" id="CapsuleShape3D_s61dn"]
[sub_resource type="CapsuleMesh" id="CapsuleMesh_47f0o"]
[sub_resource type="StandardMaterial3D" id="StandardMaterial3D_mv4do"]
albedo_color = Color(0.988235, 0.498039, 0.498039, 1)
[sub_resource type="PrismMesh" id="PrismMesh_wg1x3"]
size = Vector3(0.5, 0.5, 0.3)
[sub_resource type="BoxMesh" id="BoxMesh_wsigl"]
size = Vector3(1, 10, 20)
[sub_resource type="BoxMesh" id="BoxMesh_bj3re"]
size = Vector3(1, 7, 7)
[sub_resource type="Resource" id="Resource_daoak"]
script = ExtResource("3_oisgy")
duration = 1.0
transition = 7
ease = 2
[node name="Root" type="Node3D"]
[node name="MainCamera3D" type="Camera3D" parent="."]
unique_name_in_owner = true
transform = Transform3D(1, 0, 0, 0, 0.866025, 0.499999, 0, -0.5, 0.866023, -0.0194088, 2.25688, 3.01476)
current = true
[node name="PhantomCameraHost" type="Node" parent="MainCamera3D"]
script = ExtResource("1_b4nxi")
[node name="PlayerPhantomCamera3D" type="Node3D" parent="."]
unique_name_in_owner = true
transform = Transform3D(1, 0, 0, 0, 0.866025, 0.499999, 0, -0.5, 0.866023, -0.0194088, 2.25688, 3.01476)
script = ExtResource("2_whx47")
priority_override = false
priority = 10
follow_mode = 6
follow_target = NodePath("../PlayerCharacterBody3D")
follow_parameters/spring_arm/spring_length = 3.5
follow_parameters/spring_arm/collision_mask = 1
follow_parameters/spring_arm/shape = null
follow_parameters/spring_arm/margin = 0.2
follow_parameters/target_offset = Vector3(0, 0, 0)
follow_parameters/damping = true
follow_parameters/damping_value = 10.0
look_at_mode = 0
tween_parameters = SubResource("Resource_0yw0t")
tween_on_load = false
inactive_update_mode = 0
camera_3D_resource = SubResource("Resource_bai5y")
[node name="PlayerAimPhantomCamera3D" type="Node3D" parent="."]
unique_name_in_owner = true
transform = Transform3D(0.953716, -0.0104945, 0.300522, 0, 0.99939, 0.0348995, -0.300706, -0.0332842, 0.953135, 0.431374, 1.35423, 1.41338)
script = ExtResource("2_whx47")
priority_override = false
priority = 0
follow_mode = 6
follow_target = NodePath("../PlayerCharacterBody3D")
follow_parameters/spring_arm/spring_length = 1.5
follow_parameters/spring_arm/collision_mask = 1
follow_parameters/spring_arm/shape = null
follow_parameters/spring_arm/margin = 0.5
follow_parameters/target_offset = Vector3(0, 0.795, 0)
follow_parameters/damping = false
look_at_mode = 0
tween_parameters = SubResource("Resource_xvcjx")
tween_on_load = false
inactive_update_mode = 0
camera_3D_resource = SubResource("Resource_yf1op")
[node name="PlayerCharacterBody3D" type="CharacterBody3D" parent="."]
unique_name_in_owner = true
transform = Transform3D(0.999903, 0.0139622, 0, -0.0139622, 0.999903, 0, 0, 0, 1, -0.0194088, 0.506884, -0.0163251)
collision_layer = 2
script = ExtResource("5_p60kr")
metadata/_edit_group_ = true
[node name="PlayerArea3D" type="Area3D" parent="PlayerCharacterBody3D"]
[node name="CollisionShape3D" type="CollisionShape3D" parent="PlayerCharacterBody3D/PlayerArea3D"]
shape = SubResource("CapsuleShape3D_s61dn")
[node name="PlayerCollisionShape3D" type="CollisionShape3D" parent="PlayerCharacterBody3D"]
shape = SubResource("CapsuleShape3D_s61dn")
[node name="PlayerModel" type="Node3D" parent="PlayerCharacterBody3D"]
[node name="PlayerMeshInstance3D" type="MeshInstance3D" parent="PlayerCharacterBody3D/PlayerModel"]
transform = Transform3D(1, 0, 0, 0, 1, 4.65661e-10, 0, 0, 1, 0, 0, 0)
mesh = SubResource("CapsuleMesh_47f0o")
skeleton = NodePath("../..")
surface_material_override/0 = SubResource("StandardMaterial3D_mv4do")
[node name="PlayerMeshInstance3D2" type="MeshInstance3D" parent="PlayerCharacterBody3D/PlayerModel"]
transform = Transform3D(1, 0, 0, -9.31323e-10, 1, 4.65661e-10, 2.98023e-08, 0, 1, -0.0156226, 1.08631, 0)
mesh = SubResource("PrismMesh_wg1x3")
skeleton = NodePath("../..")
surface_material_override/0 = SubResource("StandardMaterial3D_mv4do")
[node name="Environment" type="Node" parent="."]
[node name="Floor" parent="Environment" instance=ExtResource("4_lii5s")]
transform = Transform3D(1000, 0, 0, 0, 1, 0, 0, 0, 1000, 0, -1, 0)
metadata/_edit_lock_ = true
[node name="Wall" parent="Environment" instance=ExtResource("4_lii5s")]
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, -9.5, 4.5, 0)
mesh = SubResource("BoxMesh_wsigl")
metadata/_edit_lock_ = true
[node name="Wall5" parent="Environment" instance=ExtResource("4_lii5s")]
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, -6.133, 3, -6.5)
mesh = SubResource("BoxMesh_bj3re")
metadata/_edit_lock_ = true
[node name="Wall6" parent="Environment" instance=ExtResource("4_lii5s")]
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 2.5, 3, 0)
mesh = SubResource("BoxMesh_bj3re")
metadata/_edit_lock_ = true
[node name="Wall7" parent="Environment" instance=ExtResource("4_lii5s")]
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, -2.5, 3, 0)
mesh = SubResource("BoxMesh_bj3re")
metadata/_edit_lock_ = true
[node name="Wall2" parent="Environment" instance=ExtResource("4_lii5s")]
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 9.5, 4.5, 0)
mesh = SubResource("BoxMesh_wsigl")
metadata/_edit_lock_ = true
[node name="Wall3" parent="Environment" instance=ExtResource("4_lii5s")]
transform = Transform3D(-4.37114e-08, 0, -1, 0, 1, 0, 1, 0, -4.37114e-08, 0, 4.5, 10.5)
mesh = SubResource("BoxMesh_wsigl")
metadata/_edit_lock_ = true
[node name="Wall4" parent="Environment" instance=ExtResource("4_lii5s")]
transform = Transform3D(-4.37114e-08, 0, -1, 0, 1, 0, 1, 0, -4.37114e-08, 0, 4.5, -9.5)
mesh = SubResource("BoxMesh_wsigl")
metadata/_edit_lock_ = true
[node name="DirectionalLight3D" type="DirectionalLight3D" parent="Environment"]
transform = Transform3D(1, 0, 0, 0, 0.707107, 0.707107, 0, -0.707107, 0.707107, 0, 8, 0)
metadata/_edit_lock_ = true
[node name="CeilingPhantomCamera3D" type="Node3D" parent="."]
unique_name_in_owner = true
transform = Transform3D(-4.37114e-08, -1, 2.98023e-08, 0, 2.98023e-08, 1, -1, 4.37114e-08, -1.3027e-15, -0.200665, 13.366, -0.162648)
script = ExtResource("2_whx47")
priority_override = false
priority = 1
follow_mode = 0
look_at_mode = 0
tween_parameters = SubResource("Resource_daoak")
tween_on_load = true
inactive_update_mode = 0
camera_3D_resource = null
[node name="MovementInstructionsLabel" type="Label3D" parent="."]
transform = Transform3D(1, 0, 0, 0, -4.37114e-08, 1, 0, -1, -4.37114e-08, 0.0505604, -0.484909, 1.44357)
modulate = Color(0.294118, 1, 0.631373, 1)
text = "[WASD] to move"
font = ExtResource("7_kg7u1")
font_size = 48
[node name="MovementInstructionsLabel3" type="Label3D" parent="."]
transform = Transform3D(1, 0, 0, 0, -4.37114e-08, 1, 0, -1, -4.37114e-08, 0.0505604, -0.484909, 0.817134)
modulate = Color(0.294118, 1, 0.631373, 1)
text = "[Right Mouse Click] to \"aim\""
font = ExtResource("7_kg7u1")
font_size = 48
[node name="MovementInstructionsLabel2" type="Label3D" parent="."]
transform = Transform3D(1, 0, 0, 0, -4.37114e-08, 1, 0, -1, -4.37114e-08, -0.0440154, -0.490478, -6.30248)
modulate = Color(0.294118, 1, 0.631373, 1)
text = "[Space] to toggle PCam"
font = ExtResource("7_kg7u1")
font_size = 48

View file

@ -0,0 +1,202 @@
[gd_scene load_steps=13 format=3 uid="uid://bdhrdhbux7sjg"]
[ext_resource type="Script" path="res://addons/phantom_camera/scripts/phantom_camera_host/phantom_camera_host.gd" id="1_lldvu"]
[ext_resource type="Script" path="res://addons/phantom_camera/scripts/phantom_camera/phantom_camera_3D.gd" id="2_8md3q"]
[ext_resource type="Script" path="res://addons/phantom_camera/examples/scripts/3D/player_controller.gd" id="3_odwso"]
[ext_resource type="PackedScene" uid="uid://cixlwqycoox8h" path="res://addons/phantom_camera/examples/models/3DPrototypeCubeDark.tscn" id="4_2i811"]
[ext_resource type="Texture2D" uid="uid://c7ja4woxol8yc" path="res://addons/phantom_camera/examples/textures/3D/CheckerPatternDark.png" id="5_u5qhp"]
[sub_resource type="CapsuleMesh" id="CapsuleMesh_pda7a"]
[sub_resource type="StandardMaterial3D" id="StandardMaterial3D_u74j7"]
albedo_color = Color(0.988235, 0.498039, 0.498039, 1)
[sub_resource type="CapsuleShape3D" id="CapsuleShape3D_3xplc"]
[sub_resource type="CapsuleMesh" id="CapsuleMesh_2h36r"]
[sub_resource type="StandardMaterial3D" id="StandardMaterial3D_w3olp"]
albedo_color = Color(0.227451, 0.337255, 0.576471, 1)
[sub_resource type="StandardMaterial3D" id="StandardMaterial3D_cw102"]
albedo_color = Color(0.227451, 0.337255, 0.576471, 1)
[sub_resource type="StandardMaterial3D" id="StandardMaterial3D_auy8m"]
albedo_texture = ExtResource("5_u5qhp")
uv1_triplanar = true
uv1_world_triplanar = true
[node name="Node3D" type="Node3D"]
[node name="MainCamera3D" type="Camera3D" parent="."]
unique_name_in_owner = true
transform = Transform3D(0.999952, -0.00114636, 0.00116873, -5.82049e-11, 0.713788, 0.700216, -0.00163718, -0.700172, 0.713831, -12.3172, 5.78213, 6.64571)
[node name="PhantomCameraHost" type="Node" parent="MainCamera3D"]
script = ExtResource("1_lldvu")
[node name="DirectionalLight3D" type="DirectionalLight3D" parent="."]
transform = Transform3D(1, 0, 0, 0, 0.707107, 0.707107, 0, -0.707107, 0.707107, 0, 8, 0)
metadata/_edit_lock_ = true
[node name="Player" type="Node" parent="."]
[node name="PlayerPhantomCamera3D" type="Node3D" parent="Player"]
unique_name_in_owner = true
transform = Transform3D(0.999952, -0.00114636, 0.00116873, 0, 0.713788, 0.700216, -0.00163718, -0.700172, 0.713831, -12.3172, 5.78213, 6.64571)
script = ExtResource("2_8md3q")
priority_override = false
priority = 5
follow_mode = 0
look_at_mode = 3
look_at_group = Array[NodePath]([NodePath("../PlayerCharacterBody3D2"), NodePath("../../NPCs/PlayerMeshInstance3D"), NodePath("../../NPCs/PlayerMeshInstance3D2")])
tween_parameters = null
tween_on_load = false
inactive_update_mode = 0
camera_3D_resource = null
[node name="PlayerCharacterBody3D2" type="CharacterBody3D" parent="Player"]
unique_name_in_owner = true
transform = Transform3D(0.999897, 0.0143636, 0, -0.0143636, 0.999897, 0, 0, 0, 1, -12.0829, 0.5, 1.40206)
script = ExtResource("3_odwso")
SPEED = 3.0
metadata/_edit_group_ = true
[node name="PlayerMeshInstance3D" type="MeshInstance3D" parent="Player/PlayerCharacterBody3D2"]
mesh = SubResource("CapsuleMesh_pda7a")
surface_material_override/0 = SubResource("StandardMaterial3D_u74j7")
[node name="PlayerArea3D" type="Area3D" parent="Player/PlayerCharacterBody3D2"]
[node name="CollisionShape3D" type="CollisionShape3D" parent="Player/PlayerCharacterBody3D2/PlayerArea3D"]
shape = SubResource("CapsuleShape3D_3xplc")
[node name="PlayerCollisionShape3D" type="CollisionShape3D" parent="Player/PlayerCharacterBody3D2"]
shape = SubResource("CapsuleShape3D_3xplc")
[node name="NPCs" type="Node" parent="."]
[node name="PlayerMeshInstance3D" type="MeshInstance3D" parent="NPCs"]
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, -14.6059, 0.519002, -1.52506)
mesh = SubResource("CapsuleMesh_2h36r")
skeleton = NodePath("")
surface_material_override/0 = SubResource("StandardMaterial3D_w3olp")
[node name="PlayerMeshInstance3D2" type="MeshInstance3D" parent="NPCs"]
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, -10.0461, 0.519, 4.06618)
mesh = SubResource("CapsuleMesh_2h36r")
skeleton = NodePath("")
surface_material_override/0 = SubResource("StandardMaterial3D_cw102")
[node name="Environment" type="Node" parent="."]
[node name="Floor" parent="Environment" instance=ExtResource("4_2i811")]
transform = Transform3D(1000, 0, 0, 0, 1, 0, 0, 0, 1000, 0, -1, 0)
metadata/_edit_lock_ = true
[node name="CSGCylinder3D" type="CSGCylinder3D" parent="Environment"]
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, -13.6511, 0.805455, -6.37532)
use_collision = true
radius = 1.71971
height = 2.61091
sides = 32
[node name="CSGCylinder3D5" type="CSGCylinder3D" parent="Environment"]
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 12.9141, 0.31181, -5.46661)
use_collision = true
radius = 2.77591
height = 1.62362
sides = 32
[node name="CSGCylinder3D6" type="CSGCylinder3D" parent="Environment"]
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, -21.6099, 0.31181, 6.6322)
use_collision = true
radius = 1.57419
height = 3.47475
sides = 32
[node name="CSGCylinder3D3" type="CSGCylinder3D" parent="Environment"]
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 2.75028, 0.201103, 2.71259)
use_collision = true
radius = 1.41311
height = 1.40221
sides = 32
[node name="CSGCylinder3D4" type="CSGCylinder3D" parent="Environment"]
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, -4.61885, 0.201101, 11.6804)
use_collision = true
radius = 2.21673
height = 7.88261
sides = 32
[node name="CSGCylinder3D2" type="CSGCylinder3D" parent="Environment"]
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, -3.81402, 0.805455, -8.78984)
use_collision = true
radius = 0.956285
height = 2.61091
sides = 32
[node name="CSGSphere3D" type="CSGSphere3D" parent="Environment"]
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 2.95333, -1.69814, -6.51262)
use_collision = true
radius = 3.34732
rings = 32
[node name="CSGSphere3D2" type="CSGSphere3D" parent="Environment"]
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, -11.4682, -0.599204, 8.81048)
use_collision = true
radius = 2.65844
rings = 32
[node name="CSGSphere3D3" type="CSGSphere3D" parent="Environment"]
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, -26.0848, -0.599204, -2.42244)
use_collision = true
radius = 2.14606
rings = 32
[node name="CSGTorus3D" type="CSGTorus3D" parent="Environment"]
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, -17.2356, -1.90735e-06, 0.346393)
use_collision = true
inner_radius = 1.3
outer_radius = 2.0
sides = 32
ring_sides = 18
[node name="CSGTorus3D2" type="CSGTorus3D" parent="Environment"]
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 9.90455, -1.90735e-06, 7.89765)
use_collision = true
inner_radius = 0.971543
outer_radius = 2.15226
sides = 32
ring_sides = 18
[node name="CSGBox3D" type="CSGBox3D" parent="Environment"]
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, -2.52545, 6.53866, -12.6331)
use_collision = true
size = Vector3(178.429, 14.0773, 1)
material = SubResource("StandardMaterial3D_auy8m")
[node name="CSGBox3D2" type="CSGBox3D" parent="Environment"]
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, -21.1764, 0.760708, -6.1376)
use_collision = true
size = Vector3(2.64182, 2.52142, 2.30997)
[node name="CSGBox3D5" type="CSGBox3D" parent="Environment"]
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 2.31901, 0.335247, 8.22829)
use_collision = true
size = Vector3(3.80964, 1.67049, 0.932048)
[node name="CSGBox3D3" type="CSGBox3D" parent="Environment"]
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, -6.94346, 0.138478, -4.36159)
use_collision = true
size = Vector3(1.53893, 1.27695, 1.80814)
[node name="CSGBox3D6" type="CSGBox3D" parent="Environment"]
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, -26.7985, 0.138478, 5.20734)
use_collision = true
size = Vector3(4.03502, 1.27695, 5.2198)
[node name="CSGBox3D4" type="CSGBox3D" parent="Environment"]
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 18.1236, 1.78638, -1.60318)
use_collision = true
size = Vector3(4.57784, 4.57276, 3.11285)

View file

@ -0,0 +1,270 @@
[gd_scene load_steps=19 format=3 uid="uid://5xtssqdfilal"]
[ext_resource type="PackedScene" uid="uid://cixlwqycoox8h" path="res://addons/phantom_camera/examples/models/3DPrototypeCubeDark.tscn" id="1_ydeog"]
[ext_resource type="Script" path="res://addons/phantom_camera/scripts/phantom_camera_host/phantom_camera_host.gd" id="2_b2yrt"]
[ext_resource type="Script" path="res://addons/phantom_camera/scripts/phantom_camera/phantom_camera_3D.gd" id="3_m2w30"]
[ext_resource type="Script" path="res://addons/phantom_camera/examples/scripts/3D/player_controller.gd" id="4_68dqc"]
[ext_resource type="Resource" uid="uid://cptfoggk2ok67" path="res://addons/phantom_camera/examples/resources/tween/PlayerPhantomCamera3DTween.tres" id="4_aj0kl"]
[ext_resource type="Script" path="res://addons/phantom_camera/examples/scripts/3D/3D_trigger_area.gd" id="5_h0ouh"]
[ext_resource type="Script" path="res://addons/phantom_camera/scripts/resources/tween_resource.gd" id="6_wup4d"]
[ext_resource type="FontFile" uid="uid://c4mm3of2mc8o5" path="res://addons/phantom_camera/fonts/Nunito-Black.ttf" id="8_60rny"]
[sub_resource type="CapsuleMesh" id="CapsuleMesh_qde4k"]
[sub_resource type="StandardMaterial3D" id="StandardMaterial3D_ks21f"]
albedo_color = Color(0.988235, 0.498039, 0.498039, 1)
[sub_resource type="CapsuleShape3D" id="CapsuleShape3D_12ynn"]
[sub_resource type="BoxShape3D" id="BoxShape3D_j6fha"]
size = Vector3(5, 0.1, 4)
[sub_resource type="BoxMesh" id="BoxMesh_xg4en"]
size = Vector3(5, 0.1, 4)
[sub_resource type="StandardMaterial3D" id="StandardMaterial3D_2dct5"]
transparency = 1
albedo_color = Color(0.988235, 0.478431, 0.905882, 0.0901961)
[sub_resource type="Resource" id="Resource_hml7x"]
script = ExtResource("6_wup4d")
duration = 0.6
transition = 0
ease = 2
[sub_resource type="Resource" id="Resource_pjwwe"]
script = ExtResource("6_wup4d")
duration = 0.3
transition = 1
ease = 2
[sub_resource type="Resource" id="Resource_ex8sv"]
script = ExtResource("6_wup4d")
duration = 0.3
transition = 8
ease = 2
[sub_resource type="Resource" id="Resource_n4qdq"]
script = ExtResource("6_wup4d")
duration = 1.2
transition = 10
ease = 2
[node name="Root" type="Node3D"]
[node name="Environment" type="Node" parent="."]
[node name="DirectionalLight3D" type="DirectionalLight3D" parent="Environment"]
transform = Transform3D(1, 0, 0, 0, 0.707107, 0.707107, 0, -0.707107, 0.707107, 0, 8, 0)
metadata/_edit_lock_ = true
[node name="Floor" parent="Environment" instance=ExtResource("1_ydeog")]
transform = Transform3D(1000, 0, 0, 0, 1, 0, 0, 0, 1000, 0, -1, 0)
metadata/_edit_lock_ = true
[node name="MainCamera3D" type="Camera3D" parent="."]
unique_name_in_owner = true
transform = Transform3D(0.999889, 0, 0, 0, 0.707092, 0.707088, 0, -0.707092, 0.707088, -0.0548701, 2.5, 5.82771)
[node name="PhantomCameraHost" type="Node" parent="MainCamera3D"]
script = ExtResource("2_b2yrt")
[node name="------------------" type="Node" parent="."]
[node name="PlayerPhantomCamera3D" type="Node3D" parent="."]
unique_name_in_owner = true
transform = Transform3D(0.999889, 0, 0, 0, 0.707092, 0.707088, 0, -0.707092, 0.707088, -0.0548701, 2.5, 5.82771)
script = ExtResource("3_m2w30")
priority_override = false
priority = 3
follow_mode = 2
follow_target = NodePath("../PlayerCharacterBody3D")
follow_parameters/target_offset = Vector3(0, 2, 2)
follow_parameters/damping = true
follow_parameters/damping_value = 10.0
look_at_mode = 0
tween_parameters = ExtResource("4_aj0kl")
tween_on_load = false
inactive_update_mode = 0
camera_3D_resource = null
[node name="PlayerCharacterBody3D" type="CharacterBody3D" parent="."]
unique_name_in_owner = true
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, -0.0548701, 0.5, 3.82771)
script = ExtResource("4_68dqc")
metadata/_edit_group_ = true
[node name="PlayerMeshInstance3D" type="MeshInstance3D" parent="PlayerCharacterBody3D"]
mesh = SubResource("CapsuleMesh_qde4k")
surface_material_override/0 = SubResource("StandardMaterial3D_ks21f")
[node name="PlayerArea3D" type="Area3D" parent="PlayerCharacterBody3D"]
[node name="CollisionShape3D" type="CollisionShape3D" parent="PlayerCharacterBody3D/PlayerArea3D"]
shape = SubResource("CapsuleShape3D_12ynn")
[node name="PlayerCollisionShape3D" type="CollisionShape3D" parent="PlayerCharacterBody3D"]
shape = SubResource("CapsuleShape3D_12ynn")
[node name="-------------------" type="Node" parent="."]
[node name="Tweening Example" type="Node3D" parent="."]
[node name="Linear" type="Node3D" parent="Tweening Example"]
[node name="EntryRoomTrigger" type="Area3D" parent="Tweening Example/Linear" node_paths=PackedStringArray("area_pcam")]
priority = 5
script = ExtResource("5_h0ouh")
area_pcam = NodePath("../PhantomCamera3D")
metadata/_edit_group_ = true
[node name="CollisionShape3D" type="CollisionShape3D" parent="Tweening Example/Linear/EntryRoomTrigger"]
shape = SubResource("BoxShape3D_j6fha")
[node name="NPCInteractionZoneMesh" type="MeshInstance3D" parent="Tweening Example/Linear/EntryRoomTrigger"]
mesh = SubResource("BoxMesh_xg4en")
skeleton = NodePath("../../../../..")
surface_material_override/0 = SubResource("StandardMaterial3D_2dct5")
metadata/_edit_group_ = true
[node name="PhantomCamera3D" type="Node3D" parent="Tweening Example/Linear"]
transform = Transform3D(1, 0, 0, 0, 0.642788, 0.766044, 0, -0.766044, 0.642788, 0, 4.8, 3.3)
script = ExtResource("3_m2w30")
priority_override = false
priority = 0
follow_mode = 0
look_at_mode = 0
tween_parameters = SubResource("Resource_hml7x")
tween_on_load = true
inactive_update_mode = 0
camera_3D_resource = null
[node name="TweenNameLabel" type="Label3D" parent="Tweening Example/Linear"]
transform = Transform3D(1, 0, 0, 0, 0.695913, 0.718126, 0, -0.718126, 0.695913, -1.8, 0.5, 0)
text = "Transition Type:
Linear
Duration:
0.6s"
font = ExtResource("8_60rny")
font_size = 48
[node name="Sine" type="Node3D" parent="Tweening Example"]
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, -7.4)
[node name="EntryRoomTrigger" type="Area3D" parent="Tweening Example/Sine" node_paths=PackedStringArray("area_pcam")]
priority = 5
script = ExtResource("5_h0ouh")
area_pcam = NodePath("../PhantomCamera3D")
metadata/_edit_group_ = true
[node name="CollisionShape3D" type="CollisionShape3D" parent="Tweening Example/Sine/EntryRoomTrigger"]
shape = SubResource("BoxShape3D_j6fha")
[node name="NPCInteractionZoneMesh" type="MeshInstance3D" parent="Tweening Example/Sine/EntryRoomTrigger"]
mesh = SubResource("BoxMesh_xg4en")
skeleton = NodePath("../../../../..")
surface_material_override/0 = SubResource("StandardMaterial3D_2dct5")
metadata/_edit_group_ = true
[node name="PhantomCamera3D" type="Node3D" parent="Tweening Example/Sine"]
transform = Transform3D(1, 0, 0, 0, 0.642788, 0.766044, 0, -0.766044, 0.642788, 0, 4.8, 3.3)
script = ExtResource("3_m2w30")
priority_override = false
priority = 0
follow_mode = 0
look_at_mode = 0
tween_parameters = SubResource("Resource_pjwwe")
tween_on_load = true
inactive_update_mode = 0
camera_3D_resource = null
[node name="TweenNameLabel" type="Label3D" parent="Tweening Example/Sine"]
transform = Transform3D(1, 0, 0, 0, 0.695913, 0.718126, 0, -0.718126, 0.695913, 1.7, 0.5, 0)
text = "Transition Type:
Sine
Duration:
0.3s"
font = ExtResource("8_60rny")
font_size = 72
[node name="Circ" type="Node3D" parent="Tweening Example"]
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, -14.1)
[node name="EntryRoomTrigger" type="Area3D" parent="Tweening Example/Circ" node_paths=PackedStringArray("area_pcam")]
priority = 5
script = ExtResource("5_h0ouh")
area_pcam = NodePath("../PhantomCamera3D")
metadata/_edit_group_ = true
[node name="CollisionShape3D" type="CollisionShape3D" parent="Tweening Example/Circ/EntryRoomTrigger"]
shape = SubResource("BoxShape3D_j6fha")
[node name="NPCInteractionZoneMesh" type="MeshInstance3D" parent="Tweening Example/Circ/EntryRoomTrigger"]
mesh = SubResource("BoxMesh_xg4en")
skeleton = NodePath("../../../../..")
surface_material_override/0 = SubResource("StandardMaterial3D_2dct5")
metadata/_edit_group_ = true
[node name="PhantomCamera3D" type="Node3D" parent="Tweening Example/Circ"]
transform = Transform3D(1, 0, 0, 0, 0.642788, 0.766044, 0, -0.766044, 0.642788, 0, 4.8, 3.3)
script = ExtResource("3_m2w30")
priority_override = false
priority = 0
follow_mode = 0
look_at_mode = 0
tween_parameters = SubResource("Resource_ex8sv")
tween_on_load = true
inactive_update_mode = 0
camera_3D_resource = null
[node name="TweenNameLabel" type="Label3D" parent="Tweening Example/Circ"]
transform = Transform3D(1, 0, 0, 0, 0.695913, 0.718126, 0, -0.718126, 0.695913, -1.8, 0.5, 0)
text = "Transition Type:
Circ
Duration:
0.3s"
font = ExtResource("8_60rny")
font_size = 72
[node name="Back" type="Node3D" parent="Tweening Example"]
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, -21)
[node name="EntryRoomTrigger" type="Area3D" parent="Tweening Example/Back" node_paths=PackedStringArray("area_pcam")]
priority = 5
script = ExtResource("5_h0ouh")
area_pcam = NodePath("../PhantomCamera3D")
metadata/_edit_group_ = true
[node name="CollisionShape3D" type="CollisionShape3D" parent="Tweening Example/Back/EntryRoomTrigger"]
shape = SubResource("BoxShape3D_j6fha")
[node name="NPCInteractionZoneMesh" type="MeshInstance3D" parent="Tweening Example/Back/EntryRoomTrigger"]
mesh = SubResource("BoxMesh_xg4en")
skeleton = NodePath("../../../../..")
surface_material_override/0 = SubResource("StandardMaterial3D_2dct5")
metadata/_edit_group_ = true
[node name="PhantomCamera3D" type="Node3D" parent="Tweening Example/Back"]
transform = Transform3D(1, 0, 0, 0, 0.642788, 0.766044, 0, -0.766044, 0.642788, -0.8, 4.8, 3.3)
script = ExtResource("3_m2w30")
priority_override = false
priority = 0
follow_mode = 0
look_at_mode = 0
tween_parameters = SubResource("Resource_n4qdq")
tween_on_load = true
inactive_update_mode = 0
camera_3D_resource = null
[node name="TweenNameLabel" type="Label3D" parent="Tweening Example/Back"]
transform = Transform3D(1, 0, 0, 0, 0.695913, 0.718126, 0, -0.718126, 0.695913, 1.7, 0.5, 0)
text = "Transition Type:
Back
Duration:
1.2s"
font = ExtResource("8_60rny")
font_size = 48

View file

@ -0,0 +1,15 @@
[gd_scene load_steps=4 format=3 uid="uid://cixlwqycoox8h"]
[ext_resource type="Texture2D" uid="uid://c7ja4woxol8yc" path="res://addons/phantom_camera/examples/textures/3D/CheckerPatternDark.png" id="1_836jx"]
[sub_resource type="BoxMesh" id="BoxMesh_d24c3"]
[sub_resource type="StandardMaterial3D" id="StandardMaterial3D_aox6v"]
albedo_texture = ExtResource("1_836jx")
uv1_triplanar = true
uv1_world_triplanar = true
[node name="3DPrototypeCube" type="CSGMesh3D"]
use_collision = true
mesh = SubResource("BoxMesh_d24c3")
material = SubResource("StandardMaterial3D_aox6v")

View file

@ -0,0 +1,9 @@
[gd_resource type="Resource" script_class="PhantomCameraTween" load_steps=2 format=3 uid="uid://c1v786g5agaw5"]
[ext_resource type="Script" path="res://addons/phantom_camera/scripts/resources/tween_resource.gd" id="1_ptlie"]
[resource]
script = ExtResource("1_ptlie")
duration = 0.0
transition = 0
ease = 2

View file

@ -0,0 +1,9 @@
[gd_resource type="Resource" script_class="PhantomCameraTweenResource" load_steps=2 format=3 uid="uid://cllveybboaqk5"]
[ext_resource type="Script" path="res://addons/phantom_camera/scripts/resources/tween_resource.gd" id="1_7yoy0"]
[resource]
script = ExtResource("1_7yoy0")
duration = 0.6
transition = 5
ease = 1

View file

@ -0,0 +1,9 @@
[gd_resource type="Resource" script_class="PhantomCameraTweenResource" load_steps=2 format=3 uid="uid://cecrnq0wnkexh"]
[ext_resource type="Script" path="res://addons/phantom_camera/scripts/resources/tween_resource.gd" id="1_sq5ls"]
[resource]
script = ExtResource("1_sq5ls")
duration = 0.6
transition = 8
ease = 1

View file

@ -0,0 +1,9 @@
[gd_resource type="Resource" script_class="PhantomCameraTween" load_steps=2 format=3 uid="uid://euybd2w0bax"]
[ext_resource type="Script" path="res://addons/phantom_camera/scripts/resources/tween_resource.gd" id="1_by4ei"]
[resource]
script = ExtResource("1_by4ei")
duration = 0.6
transition = 3
ease = 1

View file

@ -0,0 +1,9 @@
[gd_resource type="Resource" script_class="PhantomCameraTween" load_steps=2 format=3 uid="uid://cptfoggk2ok67"]
[ext_resource type="Script" path="res://addons/phantom_camera/scripts/resources/tween_resource.gd" id="1_q5tix"]
[resource]
script = ExtResource("1_q5tix")
duration = 0.6
transition = 3
ease = 2

View file

@ -0,0 +1,16 @@
extends Area2D
@export var area_pcam: PhantomCamera2D
func _ready() -> void:
connect("area_entered", _entered_area)
connect("area_exited", _exited_area)
func _entered_area(area_2D: Area2D) -> void:
if area_2D.get_parent() is CharacterBody2D:
area_pcam.set_priority(20)
func _exited_area(area_2D: Area2D) -> void:
if area_2D.get_parent() is CharacterBody2D:
area_pcam.set_priority(0)

View file

@ -0,0 +1,170 @@
extends CharacterBody2D
@onready var player_area2D = %PlayerArea2D
@onready var player_sprite: Sprite2D = %PlayerSprite
@onready var interaction_prompt: Panel = %InteractionPrompt
@onready var ui_sign:Control = %UISign
@onready var item_pcam2D: PhantomCamera2D = %ItemFocusPhantomCamera2D
@onready var inventory_pcam2D: PhantomCamera2D = %InventoryPhantomCamera2D
@onready var dark_overlay: ColorRect = %DarkOverlay
const KEY_STRINGNAME: StringName = "Key"
const ACTION_STRINGNAME: StringName = "Action"
const INPUT_MOVE_LEFT_STRINGNAME: StringName = "move_left"
const INPUT_MOVE_RIGHT_STRINGNAME: StringName = "move_right"
const SPEED = 350.0
const JUMP_VELOCITY = -750.0
# Get the gravity from the project settings to be synced with RigidBody nodes.
var gravity: int = 2400
var _is_interactive: bool
var _can_open_inventory: bool
var _movement_disabled: bool
var tween: Tween
var _interactive_UI: Control
var _active_pcam: PhantomCamera2D
enum InteractiveType {
NONE = 0,
ITEM = 1,
INVENTORY = 2,
}
var _interactive_object: InteractiveType = InteractiveType.NONE
var InputMovementDic: Dictionary = {
INPUT_MOVE_LEFT_STRINGNAME: {
KEY_STRINGNAME: KEY_A,
ACTION_STRINGNAME: INPUT_MOVE_LEFT_STRINGNAME
},
INPUT_MOVE_RIGHT_STRINGNAME: {
KEY_STRINGNAME: KEY_D,
ACTION_STRINGNAME: INPUT_MOVE_RIGHT_STRINGNAME
},
}
func _ready() -> void:
player_area2D.connect("body_shape_entered", _show_prompt)
player_area2D.connect("body_shape_exited", _hide_prompt)
for input in InputMovementDic:
var key_val = InputMovementDic[input].get(KEY_STRINGNAME)
var action_val = InputMovementDic[input].get(ACTION_STRINGNAME)
var movement_input = InputEventKey.new()
movement_input.physical_keycode = key_val
InputMap.add_action(action_val)
InputMap.action_add_event(action_val, movement_input)
func _unhandled_input(event: InputEvent) -> void:
if _is_interactive:
if Input.is_physical_key_pressed(KEY_F):
if tween:
tween.kill()
if not _movement_disabled:
tween = get_tree().create_tween()
_movement_disabled = true
_active_pcam.set_priority(10)
_show_interactive_node(_interactive_UI)
_interactive_node_logic()
else:
_hide_interactive_node(_interactive_UI)
_interactive_node_logic()
if Input.is_physical_key_pressed(KEY_ESCAPE) and _movement_disabled:
_hide_interactive_node(_interactive_UI)
_interactive_node_logic()
func _show_interactive_node(UI: Control) -> void:
UI.modulate.a = 0
UI.visible = true
tween.tween_property(UI, "modulate", Color.WHITE, 1).set_ease(Tween.EASE_OUT).set_trans(Tween.TRANS_CIRC)
func _hide_interactive_node(UI: Control) -> void:
_movement_disabled = false
_active_pcam.set_priority(0)
UI.visible = false
func _interactive_node_logic() -> void:
match _interactive_object:
2:
if _movement_disabled:
dark_overlay.set_visible(true)
else:
dark_overlay.set_visible(false)
func _physics_process(delta: float) -> void:
if _movement_disabled: return
if not is_on_floor():
velocity.y += gravity * delta
if Input.is_action_just_pressed("ui_accept") and is_on_floor():
velocity.y = JUMP_VELOCITY
var input_dir: = Input.get_axis(
INPUT_MOVE_LEFT_STRINGNAME,
INPUT_MOVE_RIGHT_STRINGNAME
)
if input_dir:
velocity.x = input_dir * SPEED
if input_dir > 0:
player_sprite.set_flip_h(false)
elif input_dir < 0:
player_sprite.set_flip_h(true)
else:
velocity.x = move_toward(velocity.x, 0, SPEED)
move_and_slide()
func _show_prompt(body_rid: RID, body: Node2D, body_shape_index: int, local_shape: int) -> void:
if body is TileMap:
var tile_map: TileMap = body
var tile_coords: Vector2i = tile_map.get_coords_for_body_rid(body_rid)
var cell_data: TileData = tile_map.get_cell_tile_data(1, tile_coords)
if cell_data:
var cell_data_type: StringName = cell_data.get_custom_data("Type")
# var cell_global_pos: Vector2 = tile_map.to_global(tile_map.map_to_local(tile_coords))
_is_interactive = true
interaction_prompt.set_visible(true)
match cell_data_type:
"Sign":
_interactive_UI = %UISign
_active_pcam = item_pcam2D
_interactive_object = InteractiveType.ITEM
"Inventory":
_interactive_UI = %UIInventory
_interactive_object = InteractiveType.INVENTORY
_active_pcam = inventory_pcam2D
func _hide_prompt(body_rid: RID, body: Node2D, body_shape_index: int, local_shape: int) -> void:
if body is TileMap:
var tile_map: TileMap = body
var tile_coords: Vector2i = tile_map.get_coords_for_body_rid(body_rid)
var cell_data: TileData = tile_map.get_cell_tile_data(1, tile_coords)
if cell_data:
interaction_prompt.set_visible(false)
_is_interactive = false
_interactive_UI = null
_interactive_object = InteractiveType.NONE
_active_pcam = null

View file

@ -0,0 +1,26 @@
extends Area3D
@export var area_pcam: PhantomCamera3D
var initial_camera_position: Vector3
var initial_camera_rotation: Vector3
var tween: Tween
var tween_duration: float = 0.9
func _ready() -> void:
connect("area_entered", _entered_area)
connect("area_exited", _exited_area)
func _entered_area(area_3D: Area3D) -> void:
if area_3D.get_parent() is CharacterBody3D:
area_pcam.set_priority(20)
func _exited_area(area_3D: Area3D) -> void:
if area_3D.get_parent() is CharacterBody3D:
area_pcam.set_priority(0)

View file

@ -0,0 +1,66 @@
extends Node3D
@onready var npc_pcam: PhantomCamera3D = %NPCPhantomCamera3D
@onready var dialogueArea: Area3D = %NPCInteractionArea3D
@onready var dialogueLabel3D: Label3D = %NPCDialogueExampleLabel
@onready var player: CharacterBody3D = %PlayerCharacterBody3D
@onready var move_to_location: Vector3 = %MoveToLocation.get_global_position()
var dialogue_label_initial_position: Vector3
var dialogue_label_initial_rotation: Vector3
var tween: Tween
var tween_duration: float = 0.9
var tween_transition: Tween.TransitionType = Tween.TRANS_QUAD
var interactable: bool
var is_interacting: bool
func _ready() -> void:
dialogueArea.connect("area_entered", _interactable)
dialogueArea.connect("area_exited", _not_interactable)
dialogueLabel3D.set_visible(false)
dialogue_label_initial_position = dialogueLabel3D.get_global_position()
dialogue_label_initial_rotation = dialogueLabel3D.get_global_rotation()
func _interactable(area_3D: Area3D) -> void:
if area_3D.get_parent() is CharacterBody3D:
dialogueLabel3D.set_visible(true)
interactable = true
var tween: Tween = get_tree().create_tween().set_trans(tween_transition).set_ease(Tween.EASE_IN_OUT).set_loops()
tween.tween_property(dialogueLabel3D, "position", dialogue_label_initial_position - Vector3(0, -0.2, 0), tween_duration)
tween.tween_property(dialogueLabel3D, "position", dialogue_label_initial_position, tween_duration)
func _not_interactable(area_3D: Area3D) -> void:
if area_3D.get_parent() is CharacterBody3D:
dialogueLabel3D.set_visible(false)
interactable = false
func _input(event) -> void:
if not interactable: return
if event is InputEventKey and event.pressed:
if event.keycode == KEY_F:
var tween: Tween = get_tree().create_tween() \
.set_parallel(true) \
.set_trans(Tween.TRANS_QUART) \
.set_ease(Tween.EASE_IN_OUT)
if not is_interacting:
npc_pcam.set_priority(20)
player.set_physics_process(false)
tween.tween_property(player, "position", move_to_location, 0.6).set_trans(tween_transition)
tween.tween_property(dialogueLabel3D, "rotation", Vector3(deg_to_rad(-20), deg_to_rad(53), 0), 0.6).set_trans(tween_transition)
else:
npc_pcam.set_priority(0)
player.set_physics_process(true)
tween.tween_property(dialogueLabel3D, "rotation", dialogue_label_initial_rotation, 0.9)
is_interacting = !is_interacting

View file

@ -0,0 +1,18 @@
extends Node
@export var path_pcam: PhantomCamera3D
func _ready() -> void:
connect("area_entered", _entered_area)
connect("area_exited", _exited_area)
func _entered_area(area_3D: Area3D) -> void:
if area_3D.get_parent() is CharacterBody3D:
path_pcam.set_priority(20)
func _exited_area(area_3D: Area3D) -> void:
if area_3D.get_parent() is CharacterBody3D:
path_pcam.set_priority(0)

View file

@ -0,0 +1,81 @@
extends CharacterBody3D
@export var SPEED: float = 5.0
@export var JUMP_VELOCITY: float = 4.5
@export var enable_gravity = true
@onready var _camera: Camera3D = %MainCamera3D
@onready var _player_pcam: PhantomCamera3D = %PlayerPhantomCamera3D
# Get the gravity from the project settings to be synced with RigidBody nodes.
var gravity: float = 9.8
const KEY_STRINGNAME: StringName = "Key"
const ACTION_STRINGNAME: StringName = "Action"
const INPUT_MOVE_UP_STRINGNAME: StringName = "move_up"
const INPUT_MOVE_DOWM_STRINGNAME: StringName = "move_down"
const INPUT_MOVE_LEFT_STRINGNAME: StringName = "move_left"
const INPUT_MOVE_RIGHT_STRINGNAME: StringName = "move_right"
var InputMovementDic: Dictionary = {
INPUT_MOVE_UP_STRINGNAME: {
KEY_STRINGNAME: KEY_W,
ACTION_STRINGNAME: INPUT_MOVE_UP_STRINGNAME
},
INPUT_MOVE_DOWM_STRINGNAME: {
KEY_STRINGNAME: KEY_S,
ACTION_STRINGNAME: INPUT_MOVE_DOWM_STRINGNAME
},
INPUT_MOVE_LEFT_STRINGNAME: {
KEY_STRINGNAME: KEY_A,
ACTION_STRINGNAME: INPUT_MOVE_LEFT_STRINGNAME
},
INPUT_MOVE_RIGHT_STRINGNAME: {
KEY_STRINGNAME: KEY_D,
ACTION_STRINGNAME: INPUT_MOVE_RIGHT_STRINGNAME
},
}
func _ready() -> void:
for input in InputMovementDic:
var key_val = InputMovementDic[input].get(KEY_STRINGNAME)
var action_val = InputMovementDic[input].get(ACTION_STRINGNAME)
var movement_input = InputEventKey.new()
movement_input.physical_keycode = key_val
InputMap.add_action(action_val)
InputMap.action_add_event(action_val, movement_input)
func _physics_process(delta: float) -> void:
# Add the gravity.
if enable_gravity and not is_on_floor():
velocity.y -= gravity * delta
# Get the input direction and handle the movement/deceleration.
# As good practice, you should replace UI actions with custom gameplay actions.
var input_dir: Vector2 = Input.get_vector(
INPUT_MOVE_LEFT_STRINGNAME,
INPUT_MOVE_RIGHT_STRINGNAME,
INPUT_MOVE_UP_STRINGNAME,
INPUT_MOVE_DOWM_STRINGNAME
)
var cam_dir: Vector3 = -_camera.global_transform.basis.z
var direction: Vector3 = (transform.basis * Vector3(input_dir.x, 0, input_dir.y)).normalized()
if direction:
var move_dir: Vector3 = Vector3.ZERO
move_dir.x = direction.x
move_dir.z = direction.z
move_dir = move_dir.rotated(Vector3.UP, _camera.rotation.y).normalized()
velocity.x = move_dir.x * SPEED
velocity.z = move_dir.z * SPEED
else:
velocity.x = move_toward(velocity.x, 0, SPEED)
velocity.z = move_toward(velocity.z, 0, SPEED)
move_and_slide()

View file

@ -0,0 +1,83 @@
extends "player_controller.gd"
@onready var _aim_pcam: PhantomCamera3D = %PlayerAimPhantomCamera3D
@onready var _model: Node3D = $PlayerModel
@onready var _ceiling_pcam: PhantomCamera3D = %CeilingPhantomCamera3D
@export var mouse_sensitivity: float = 0.05
@export var min_yaw: float = -89.9
@export var max_yaw: float = 50
@export var min_pitch: float = 0
@export var max_pitch: float = 360
func _ready() -> void:
super()
if _player_pcam.get_follow_mode() == _player_pcam.Constants.FollowMode.THIRD_PERSON:
Input.set_mouse_mode(Input.MOUSE_MODE_CAPTURED)
func _physics_process(delta: float) -> void:
super(delta)
if velocity.length() > 0.2:
var look_direction: Vector2 = Vector2(velocity.z, velocity.x)
_model.rotation.y = look_direction.angle()
func _unhandled_input(event: InputEvent) -> void:
if _player_pcam.get_follow_mode() == _player_pcam.Constants.FollowMode.THIRD_PERSON:
var active_pcam: PhantomCamera3D
if is_instance_valid(_aim_pcam):
_set_pcam_rotation(_player_pcam, event)
_set_pcam_rotation(_aim_pcam, event)
if _player_pcam.get_priority() > _aim_pcam.get_priority():
_toggle_aim_pcam(event)
else:
_toggle_aim_pcam(event)
if event is InputEventKey and event.pressed:
if event.keycode == KEY_SPACE:
if _ceiling_pcam.get_priority() < 30 and _player_pcam.is_active():
_ceiling_pcam.set_priority(30)
else:
_ceiling_pcam.set_priority(1)
func _set_pcam_rotation(pcam: PhantomCamera3D, event: InputEvent) -> void:
if event is InputEventMouseMotion:
var pcam_rotation_degrees: Vector3
# Assigns the current 3D rotation of the SpringArm3D node - so it starts off where it is in the editor
pcam_rotation_degrees = pcam.get_third_person_rotation_degrees()
# Change the X rotation
pcam_rotation_degrees.x -= event.relative.y * mouse_sensitivity
# Clamp the rotation in the X axis so it go over or under the target
pcam_rotation_degrees.x = clampf(pcam_rotation_degrees.x, min_yaw, max_yaw)
# Change the Y rotation value
pcam_rotation_degrees.y -= event.relative.x * mouse_sensitivity
# Sets the rotation to fully loop around its target, but witout going below or exceeding 0 and 360 degrees respectively
pcam_rotation_degrees.y = wrapf(pcam_rotation_degrees.y, min_pitch, max_pitch)
# Change the SpringArm3D node's rotation and rotate around its target
pcam.set_third_person_rotation_degrees(pcam_rotation_degrees)
func _toggle_aim_pcam(event: InputEvent) -> void:
if event is InputEventMouseButton \
and event.is_pressed() \
and event.button_index == 2 \
and (_player_pcam.is_active() or _aim_pcam.is_active()):
if _player_pcam.get_priority() > _aim_pcam.get_priority():
_aim_pcam.set_priority(30)
else:
_aim_pcam.set_priority(0)

Binary file not shown.

After

Width:  |  Height:  |  Size: 3 KiB

View file

@ -0,0 +1,34 @@
[remap]
importer="texture"
type="CompressedTexture2D"
uid="uid://cwep0on2tthn7"
path="res://.godot/imported/PhantomCamera2DSprite.png-6bf2b757da36375026c0e7c928edb9d4.ctex"
metadata={
"vram_texture": false
}
[deps]
source_file="res://addons/phantom_camera/examples/textures/2D/PhantomCamera2DSprite.png"
dest_files=["res://.godot/imported/PhantomCamera2DSprite.png-6bf2b757da36375026c0e7c928edb9d4.ctex"]
[params]
compress/mode=0
compress/high_quality=false
compress/lossy_quality=0.7
compress/hdr_compression=1
compress/normal_map=0
compress/channel_pack=0
mipmaps/generate=false
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=1

Binary file not shown.

After

Width:  |  Height:  |  Size: 67 KiB

View file

@ -0,0 +1,34 @@
[remap]
importer="texture"
type="CompressedTexture2D"
uid="uid://b7cs6me43ufh3"
path="res://.godot/imported/inventory_container.png-12241277f279bfc4bf7d5dad6b3e8ff2.ctex"
metadata={
"vram_texture": false
}
[deps]
source_file="res://addons/phantom_camera/examples/textures/2D/inventory_container.png"
dest_files=["res://.godot/imported/inventory_container.png-12241277f279bfc4bf7d5dad6b3e8ff2.ctex"]
[params]
compress/mode=0
compress/high_quality=false
compress/lossy_quality=0.7
compress/hdr_compression=1
compress/normal_map=0
compress/channel_pack=0
mipmaps/generate=false
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=1

Binary file not shown.

After

Width:  |  Height:  |  Size: 10 KiB

View file

@ -0,0 +1,34 @@
[remap]
importer="texture"
type="CompressedTexture2D"
uid="uid://c77npili4pel4"
path="res://.godot/imported/level_spritesheet.png-26a44dd21a040a5480d5ccba54377d99.ctex"
metadata={
"vram_texture": false
}
[deps]
source_file="res://addons/phantom_camera/examples/textures/2D/level_spritesheet.png"
dest_files=["res://.godot/imported/level_spritesheet.png-26a44dd21a040a5480d5ccba54377d99.ctex"]
[params]
compress/mode=0
compress/high_quality=false
compress/lossy_quality=0.7
compress/hdr_compression=1
compress/normal_map=0
compress/channel_pack=0
mipmaps/generate=false
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=1

Binary file not shown.

After

Width:  |  Height:  |  Size: 172 KiB

View file

@ -0,0 +1,34 @@
[remap]
importer="texture"
type="CompressedTexture2D"
uid="uid://bloouh2jtndx1"
path="res://.godot/imported/sign_prompt.png-18d451127e1cd1a16367acd23cec47e5.ctex"
metadata={
"vram_texture": false
}
[deps]
source_file="res://addons/phantom_camera/examples/textures/2D/sign_prompt.png"
dest_files=["res://.godot/imported/sign_prompt.png-18d451127e1cd1a16367acd23cec47e5.ctex"]
[params]
compress/mode=0
compress/high_quality=false
compress/lossy_quality=0.7
compress/hdr_compression=1
compress/normal_map=0
compress/channel_pack=0
mipmaps/generate=false
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=1

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.8 KiB

View file

@ -0,0 +1,35 @@
[remap]
importer="texture"
type="CompressedTexture2D"
uid="uid://c7ja4woxol8yc"
path.bptc="res://.godot/imported/CheckerPatternDark.png-fdb2fea143d8c120db563be7371308e4.bptc.ctex"
metadata={
"imported_formats": ["s3tc_bptc"],
"vram_texture": true
}
[deps]
source_file="res://addons/phantom_camera/examples/textures/3D/CheckerPatternDark.png"
dest_files=["res://.godot/imported/CheckerPatternDark.png-fdb2fea143d8c120db563be7371308e4.bptc.ctex"]
[params]
compress/mode=2
compress/high_quality=true
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

View file

@ -0,0 +1,38 @@
[gd_scene load_steps=3 format=3 uid="uid://dg7rhrymsrrrm"]
[ext_resource type="Texture2D" uid="uid://b7cs6me43ufh3" path="res://addons/phantom_camera/examples/textures/2D/inventory_container.png" id="1_pi2dp"]
[ext_resource type="FontFile" uid="uid://c4mm3of2mc8o5" path="res://addons/phantom_camera/fonts/Nunito-Black.ttf" id="2_0rdcn"]
[node name="Control" type="Control"]
layout_mode = 3
anchors_preset = 15
anchor_right = 1.0
anchor_bottom = 1.0
grow_horizontal = 2
grow_vertical = 2
[node name="TextureRect" type="TextureRect" parent="."]
layout_mode = 1
anchors_preset = 4
anchor_top = 0.5
anchor_bottom = 0.5
offset_left = 136.0
offset_top = -255.0
offset_right = 1016.0
offset_bottom = 183.0
grow_vertical = 2
scale = Vector2(1.2, 1.2)
texture = ExtResource("1_pi2dp")
[node name="Label" type="Label" parent="TextureRect"]
layout_mode = 0
offset_left = 345.0
offset_top = 12.0
offset_right = 535.0
offset_bottom = 60.0
theme_override_colors/font_color = Color(0.356863, 0.105882, 0.133333, 1)
theme_override_fonts/font = ExtResource("2_0rdcn")
theme_override_font_sizes/font_size = 32
text = "Inventory"
horizontal_alignment = 1
uppercase = true

View file

@ -0,0 +1,84 @@
[gd_scene load_steps=4 format=3 uid="uid://iq5xd1ob1res"]
[ext_resource type="Texture2D" uid="uid://bloouh2jtndx1" path="res://addons/phantom_camera/examples/textures/2D/sign_prompt.png" id="1_tftrk"]
[ext_resource type="FontFile" uid="uid://c4mm3of2mc8o5" path="res://addons/phantom_camera/fonts/Nunito-Black.ttf" id="2_y5454"]
[sub_resource type="StyleBoxFlat" id="StyleBoxFlat_r4h3u"]
bg_color = Color(0.470588, 0.6, 0.45098, 1)
corner_radius_top_right = 47
corner_radius_bottom_left = 40
[node name="Control" type="Control"]
layout_mode = 3
anchors_preset = 15
anchor_right = 1.0
anchor_bottom = 1.0
grow_horizontal = 2
grow_vertical = 2
size_flags_horizontal = 3
size_flags_vertical = 3
[node name="TextureRect" type="TextureRect" parent="."]
layout_mode = 1
anchors_preset = 5
anchor_left = 0.5
anchor_right = 0.5
offset_left = -410.0
offset_top = 108.0
offset_right = 137.135
offset_bottom = 474.0
grow_horizontal = 2
scale = Vector2(1.5, 1.5)
texture = ExtResource("1_tftrk")
metadata/_edit_group_ = true
[node name="Label" type="Label" parent="TextureRect"]
layout_mode = 1
anchors_preset = 15
anchor_right = 1.0
anchor_bottom = 1.0
offset_left = 25.0
offset_top = 64.0
offset_right = -25.0
offset_bottom = -88.0
grow_horizontal = 2
grow_vertical = 2
theme_override_colors/font_color = Color(0.207843, 0.0470588, 0.0666667, 1)
theme_override_fonts/font = ExtResource("2_y5454")
theme_override_font_sizes/font_size = 62
text = "Stay Awhile
and read"
horizontal_alignment = 1
vertical_alignment = 1
uppercase = true
[node name="Panel" type="Panel" parent="."]
visible = false
layout_mode = 1
anchors_preset = 5
anchor_left = 0.5
anchor_right = 0.5
offset_left = -240.0
offset_right = 240.0
offset_bottom = 200.0
grow_horizontal = 2
size_flags_horizontal = 3
size_flags_vertical = 3
theme_override_styles/panel = SubResource("StyleBoxFlat_r4h3u")
metadata/_edit_use_anchors_ = true
[node name="VBoxContainer" type="VBoxContainer" parent="Panel"]
layout_mode = 1
anchors_preset = 15
anchor_right = 1.0
anchor_bottom = 1.0
grow_horizontal = 2
grow_vertical = 2
alignment = 1
[node name="Label2" type="Label" parent="Panel/VBoxContainer"]
layout_mode = 2
text = "Example Textsdadassa
"
horizontal_alignment = 1
vertical_alignment = 1

Binary file not shown.

View file

@ -0,0 +1,33 @@
[remap]
importer="font_data_dynamic"
type="FontFile"
uid="uid://c4mm3of2mc8o5"
path="res://.godot/imported/Nunito-Black.ttf-2a374efbc207a97a99b8c70bdc4b7cbb.fontdata"
[deps]
source_file="res://addons/phantom_camera/fonts/Nunito-Black.ttf"
dest_files=["res://.godot/imported/Nunito-Black.ttf-2a374efbc207a97a99b8c70bdc4b7cbb.fontdata"]
[params]
Rendering=null
antialiasing=1
generate_mipmaps=false
multichannel_signed_distance_field=false
msdf_pixel_range=8
msdf_size=48
allow_system_fallback=true
force_autohinter=false
hinting=1
subpixel_positioning=1
oversampling=0.0
Fallbacks=null
fallbacks=[]
Compress=null
compress=true
preload=[]
language_support={}
script_support={}
opentype_features={}

Binary file not shown.

View file

@ -0,0 +1,33 @@
[remap]
importer="font_data_dynamic"
type="FontFile"
uid="uid://dve7mgsjik4dg"
path="res://.godot/imported/Nunito-Regular.ttf-b6054d499efa1a10921004862b1e217a.fontdata"
[deps]
source_file="res://addons/phantom_camera/fonts/Nunito-Regular.ttf"
dest_files=["res://.godot/imported/Nunito-Regular.ttf-b6054d499efa1a10921004862b1e217a.fontdata"]
[params]
Rendering=null
antialiasing=1
generate_mipmaps=false
multichannel_signed_distance_field=false
msdf_pixel_range=8
msdf_size=48
allow_system_fallback=true
force_autohinter=false
hinting=1
subpixel_positioning=1
oversampling=0.0
Fallbacks=null
fallbacks=[]
Compress=null
compress=true
preload=[]
language_support={}
script_support={}
opentype_features={}

View file

@ -0,0 +1,14 @@
[gd_resource type="StyleBoxFlat" format=3 uid="uid://dpa7yvxlq043a"]
[resource]
bg_color = Color(0.227451, 0.72549, 0.603922, 0.2)
border_width_left = 2
border_width_top = 2
border_width_right = 2
border_width_bottom = 2
border_color = Color(0.227451, 0.72549, 0.603922, 1)
corner_detail = 1
expand_margin_left = 1.0
expand_margin_top = 1.0
expand_margin_right = 1.0
expand_margin_bottom = 1.0

View file

@ -0,0 +1,436 @@
[gd_scene load_steps=22 format=3 uid="uid://dbkr3d716wtx0"]
[ext_resource type="Script" path="res://addons/phantom_camera/scripts/viewfinder/viewfinder.gd" id="1_lgg6a"]
[ext_resource type="StyleBox" uid="uid://dpa7yvxlq043a" path="res://addons/phantom_camera/framed_viewfinder/deadzone_style_box.tres" id="2_cvat1"]
[ext_resource type="FontFile" uid="uid://dve7mgsjik4dg" path="res://addons/phantom_camera/fonts/Nunito-Regular.ttf" id="3_6wxxp"]
[ext_resource type="Texture2D" uid="uid://b671h5enwiljg" path="res://addons/phantom_camera/icons/PhantomCameraGizmoIcon2D.svg" id="3_rn5hf"]
[ext_resource type="FontFile" uid="uid://c4mm3of2mc8o5" path="res://addons/phantom_camera/fonts/Nunito-Black.ttf" id="4_dj3lt"]
[ext_resource type="Texture2D" uid="uid://dy8eifa6aw2en" path="res://addons/phantom_camera/icons/misc/PriorityOverride.svg" id="6_8cb64"]
[sub_resource type="StyleBoxFlat" id="StyleBoxFlat_fle8t"]
bg_color = Color(0.227451, 0.72549, 0.603922, 0.2)
draw_center = false
border_width_left = 2
border_width_top = 2
border_width_right = 2
border_width_bottom = 2
border_color = Color(0.227451, 0.72549, 0.603922, 1)
corner_detail = 1
expand_margin_left = 1.0
expand_margin_top = 1.0
expand_margin_right = 1.0
expand_margin_bottom = 1.0
[sub_resource type="StyleBoxFlat" id="StyleBoxFlat_xmo1t"]
draw_center = false
border_width_left = 1
border_width_top = 1
border_width_right = 1
border_width_bottom = 1
border_color = Color(0.745098, 0.858824, 0.380392, 1)
[sub_resource type="StyleBoxFlat" id="StyleBoxFlat_q7vs4"]
bg_color = Color(0.929412, 0.87451, 0.619608, 1)
border_width_left = 1
border_width_top = 1
border_width_right = 1
border_width_bottom = 1
border_color = Color(0, 0, 0, 1)
corner_radius_top_left = 10
corner_radius_top_right = 10
corner_radius_bottom_right = 10
corner_radius_bottom_left = 10
[sub_resource type="StyleBoxEmpty" id="StyleBoxEmpty_iho1a"]
[sub_resource type="StyleBoxEmpty" id="StyleBoxEmpty_obaj6"]
[sub_resource type="StyleBoxFlat" id="StyleBoxFlat_fsxik"]
content_margin_left = 10.0
content_margin_top = 10.0
content_margin_right = 10.0
content_margin_bottom = 10.0
bg_color = Color(0.129412, 0.407843, 0.337255, 1)
border_width_left = 4
border_width_top = 4
border_width_right = 4
border_width_bottom = 4
border_color = Color(0.227451, 0.72549, 0.603922, 1)
corner_radius_top_left = 10
corner_radius_top_right = 10
corner_radius_bottom_right = 10
corner_radius_bottom_left = 10
[sub_resource type="StyleBoxFlat" id="StyleBoxFlat_yh38y"]
content_margin_left = 10.0
content_margin_top = 10.0
content_margin_right = 10.0
content_margin_bottom = 10.0
bg_color = Color(0.129412, 0.407843, 0.337255, 1)
border_width_left = 4
border_width_top = 4
border_width_right = 4
border_width_bottom = 4
border_color = Color(0.988235, 0.498039, 0.498039, 1)
corner_radius_top_left = 10
corner_radius_top_right = 10
corner_radius_bottom_right = 10
corner_radius_bottom_left = 10
[sub_resource type="StyleBoxFlat" id="StyleBoxFlat_gci88"]
content_margin_left = 10.0
content_margin_top = 10.0
content_margin_right = 10.0
content_margin_bottom = 10.0
bg_color = Color(0.180392, 0.576471, 0.482353, 1)
corner_radius_top_left = 10
corner_radius_top_right = 10
corner_radius_bottom_right = 10
corner_radius_bottom_left = 10
[sub_resource type="StyleBoxEmpty" id="StyleBoxEmpty_4b76l"]
[sub_resource type="StyleBoxEmpty" id="StyleBoxEmpty_g5wua"]
[sub_resource type="StyleBoxEmpty" id="StyleBoxEmpty_x4bx8"]
[sub_resource type="StyleBoxFlat" id="StyleBoxFlat_agqdu"]
bg_color = Color(0.72549, 0.227451, 0.34902, 1)
border_width_left = 2
border_width_top = 2
border_width_right = 2
border_width_bottom = 2
border_blend = true
corner_radius_top_left = 10
corner_radius_top_right = 10
corner_radius_bottom_right = 10
corner_radius_bottom_left = 10
[sub_resource type="StyleBoxFlat" id="StyleBoxFlat_ja3vm"]
bg_color = Color(0.53, 0.1643, 0.255725, 1)
border_width_left = 2
border_width_top = 2
border_width_right = 2
border_width_bottom = 2
border_blend = true
corner_radius_top_left = 10
corner_radius_top_right = 10
corner_radius_bottom_right = 10
corner_radius_bottom_left = 10
[sub_resource type="StyleBoxFlat" id="StyleBoxFlat_mk273"]
bg_color = Color(0.43, 0.1333, 0.207475, 1)
border_width_left = 2
border_width_top = 2
border_width_right = 2
border_width_bottom = 2
border_blend = true
corner_radius_top_left = 10
corner_radius_top_right = 10
corner_radius_bottom_right = 10
corner_radius_bottom_left = 10
[sub_resource type="StyleBoxEmpty" id="StyleBoxEmpty_840sd"]
[node name="ViewfinderControl" type="Control"]
clip_contents = true
custom_minimum_size = Vector2(0, 300)
layout_mode = 3
anchors_preset = 15
anchor_right = 1.0
anchor_bottom = 1.0
grow_horizontal = 2
grow_vertical = 2
size_flags_horizontal = 3
size_flags_vertical = 3
mouse_filter = 2
script = ExtResource("1_lgg6a")
[node name="FramedViewfinder" type="Control" parent="."]
unique_name_in_owner = true
layout_mode = 1
anchors_preset = 15
anchor_right = 1.0
anchor_bottom = 1.0
grow_horizontal = 2
grow_vertical = 2
metadata/_edit_lock_ = true
[node name="SubViewportContainer" type="SubViewportContainer" parent="FramedViewfinder"]
unique_name_in_owner = true
layout_mode = 1
anchors_preset = 15
anchor_right = 1.0
anchor_bottom = 1.0
grow_horizontal = 2
grow_vertical = 2
stretch = true
[node name="SubViewport" type="SubViewport" parent="FramedViewfinder/SubViewportContainer"]
unique_name_in_owner = true
handle_input_locally = false
gui_disable_input = true
size = Vector2i(1920, 1080)
render_target_update_mode = 4
[node name="DeadZoneHBoxContainer" type="HBoxContainer" parent="FramedViewfinder"]
unique_name_in_owner = true
clip_contents = true
layout_mode = 1
anchors_preset = 15
anchor_right = 1.0
anchor_bottom = 1.0
grow_horizontal = 2
grow_vertical = 2
theme_override_constants/separation = 0
[node name="DeadZoneLeftHBoxContainer" type="VBoxContainer" parent="FramedViewfinder/DeadZoneHBoxContainer"]
clip_contents = true
layout_mode = 2
size_flags_horizontal = 3
theme_override_constants/separation = 0
[node name="DeadZoneLeftTopPanel" type="Panel" parent="FramedViewfinder/DeadZoneHBoxContainer/DeadZoneLeftHBoxContainer"]
layout_mode = 2
size_flags_vertical = 3
theme_override_styles/panel = ExtResource("2_cvat1")
[node name="DeadZoneLeftCenterPanel" type="Panel" parent="FramedViewfinder/DeadZoneHBoxContainer/DeadZoneLeftHBoxContainer"]
unique_name_in_owner = true
layout_mode = 2
theme_override_styles/panel = ExtResource("2_cvat1")
[node name="DeadZoneLeftBottomPanel" type="Panel" parent="FramedViewfinder/DeadZoneHBoxContainer/DeadZoneLeftHBoxContainer"]
layout_mode = 2
size_flags_vertical = 3
theme_override_styles/panel = ExtResource("2_cvat1")
[node name="DeadZoneCenterHBoxContainer" type="VBoxContainer" parent="FramedViewfinder/DeadZoneHBoxContainer"]
unique_name_in_owner = true
clip_contents = true
layout_mode = 2
size_flags_horizontal = 4
theme_override_constants/separation = 0
[node name="DeadZoneCenterTopPanel" type="Panel" parent="FramedViewfinder/DeadZoneHBoxContainer/DeadZoneCenterHBoxContainer"]
layout_mode = 2
size_flags_vertical = 3
theme_override_styles/panel = ExtResource("2_cvat1")
[node name="DeadZoneCenterCenterPanel" type="Panel" parent="FramedViewfinder/DeadZoneHBoxContainer/DeadZoneCenterHBoxContainer"]
unique_name_in_owner = true
layout_mode = 2
size_flags_vertical = 4
theme_override_styles/panel = SubResource("StyleBoxFlat_fle8t")
[node name="DeadZoneCenterBottomPanel" type="Panel" parent="FramedViewfinder/DeadZoneHBoxContainer/DeadZoneCenterHBoxContainer"]
layout_mode = 2
size_flags_vertical = 3
theme_override_styles/panel = ExtResource("2_cvat1")
[node name="DeadZoneRightHBoxContainer" type="VBoxContainer" parent="FramedViewfinder/DeadZoneHBoxContainer"]
clip_contents = true
layout_mode = 2
size_flags_horizontal = 3
theme_override_constants/separation = 0
[node name="DeadZoneRightTopPanel" type="Panel" parent="FramedViewfinder/DeadZoneHBoxContainer/DeadZoneRightHBoxContainer"]
layout_mode = 2
size_flags_vertical = 3
theme_override_styles/panel = ExtResource("2_cvat1")
[node name="DeadZoneRightCenterPanel" type="Panel" parent="FramedViewfinder/DeadZoneHBoxContainer/DeadZoneRightHBoxContainer"]
unique_name_in_owner = true
layout_mode = 2
theme_override_styles/panel = ExtResource("2_cvat1")
[node name="DeadZoneRightBottomPanel" type="Panel" parent="FramedViewfinder/DeadZoneHBoxContainer/DeadZoneRightHBoxContainer"]
layout_mode = 2
size_flags_vertical = 3
theme_override_styles/panel = ExtResource("2_cvat1")
[node name="AspectRatioContainer" type="AspectRatioContainer" parent="FramedViewfinder"]
unique_name_in_owner = true
clip_contents = true
layout_mode = 1
anchors_preset = 15
anchor_right = 1.0
anchor_bottom = 1.0
grow_horizontal = 2
grow_vertical = 2
stretch_mode = 1
[node name="CameraViewportPanel" type="Panel" parent="FramedViewfinder/AspectRatioContainer"]
layout_mode = 2
theme_override_styles/panel = SubResource("StyleBoxFlat_xmo1t")
[node name="TargetPoint" type="Panel" parent="FramedViewfinder/AspectRatioContainer/CameraViewportPanel"]
unique_name_in_owner = true
layout_mode = 1
anchors_preset = 8
anchor_left = 0.5
anchor_top = 0.5
anchor_right = 0.5
anchor_bottom = 0.5
offset_left = -3.0
offset_top = -3.0
offset_right = 3.0
offset_bottom = 3.0
grow_horizontal = 2
grow_vertical = 2
theme_override_styles/panel = SubResource("StyleBoxFlat_q7vs4")
[node name="NoSupportMsg" type="Label" parent="."]
unique_name_in_owner = true
visible = false
layout_mode = 1
anchors_preset = 15
anchor_right = 1.0
anchor_bottom = 1.0
offset_top = -8.0
offset_bottom = -8.0
grow_horizontal = 2
grow_vertical = 2
theme_override_fonts/font = ExtResource("4_dj3lt")
theme_override_font_sizes/font_size = 24
theme_override_styles/normal = SubResource("StyleBoxEmpty_iho1a")
text = "2D scene support not available yet
(Control scenes are not supported)"
horizontal_alignment = 1
vertical_alignment = 1
[node name="EmptyStateControl" type="Control" parent="."]
unique_name_in_owner = true
layout_mode = 1
anchors_preset = 15
anchor_right = 1.0
anchor_bottom = 1.0
grow_horizontal = 2
grow_vertical = 2
[node name="BGColorRect" type="ColorRect" parent="EmptyStateControl"]
visible = false
layout_mode = 1
anchors_preset = 15
anchor_right = 1.0
anchor_bottom = 1.0
grow_horizontal = 2
grow_vertical = 2
color = Color(0, 0, 0, 1)
metadata/_edit_lock_ = true
[node name="VBoxContainer" type="VBoxContainer" parent="EmptyStateControl"]
layout_mode = 1
anchors_preset = 14
anchor_top = 0.5
anchor_right = 1.0
anchor_bottom = 0.5
offset_top = -80.0
offset_bottom = 80.0
grow_horizontal = 2
grow_vertical = 2
alignment = 1
[node name="EmptyStateIcon" type="TextureRect" parent="EmptyStateControl/VBoxContainer"]
unique_name_in_owner = true
layout_mode = 2
texture = ExtResource("3_rn5hf")
stretch_mode = 3
[node name="EmptyStateText" type="RichTextLabel" parent="EmptyStateControl/VBoxContainer"]
unique_name_in_owner = true
layout_mode = 2
theme_override_colors/default_color = Color(1, 1, 1, 1)
theme_override_fonts/normal_font = ExtResource("3_6wxxp")
theme_override_fonts/bold_font = ExtResource("4_dj3lt")
theme_override_font_sizes/normal_font_size = 24
theme_override_font_sizes/bold_font_size = 24
theme_override_styles/focus = SubResource("StyleBoxEmpty_obaj6")
theme_override_styles/normal = SubResource("StyleBoxEmpty_iho1a")
bbcode_enabled = true
text = "[center][b]NodeType[/b] Description [/center]"
fit_content = true
[node name="AddNodeButton" type="Button" parent="EmptyStateControl/VBoxContainer"]
unique_name_in_owner = true
custom_minimum_size = Vector2(400, 54)
layout_mode = 2
size_flags_horizontal = 4
focus_mode = 0
theme_override_colors/font_color = Color(1, 1, 1, 1)
theme_override_fonts/font = ExtResource("4_dj3lt")
theme_override_font_sizes/font_size = 24
theme_override_styles/normal = SubResource("StyleBoxFlat_fsxik")
theme_override_styles/hover = SubResource("StyleBoxFlat_yh38y")
theme_override_styles/pressed = SubResource("StyleBoxFlat_gci88")
theme_override_styles/focus = SubResource("StyleBoxEmpty_4b76l")
[node name="AddNodeTypeText" type="RichTextLabel" parent="EmptyStateControl/VBoxContainer/AddNodeButton"]
unique_name_in_owner = true
layout_mode = 1
anchors_preset = 15
anchor_right = 1.0
anchor_bottom = 1.0
offset_top = 9.0
offset_bottom = -11.0
grow_horizontal = 2
grow_vertical = 2
mouse_filter = 2
theme_override_colors/default_color = Color(1, 1, 1, 1)
theme_override_fonts/normal_font = ExtResource("3_6wxxp")
theme_override_fonts/bold_font = ExtResource("4_dj3lt")
theme_override_font_sizes/normal_font_size = 24
theme_override_font_sizes/bold_font_size = 24
theme_override_styles/focus = SubResource("StyleBoxEmpty_g5wua")
theme_override_styles/normal = SubResource("StyleBoxEmpty_x4bx8")
bbcode_enabled = true
text = "[center]Add [img=32]res://addons/phantom_camera/icons/viewfinder/Camera3DIcon.svg[/img] [b]{NodeType}[/b][/center]"
scroll_active = false
[node name="PriorityOverrideButton" type="Button" parent="."]
unique_name_in_owner = true
visible = false
layout_mode = 1
offset_left = 5.0
offset_top = 5.0
offset_right = 165.0
offset_bottom = 57.0
mouse_default_cursor_shape = 2
theme_override_styles/normal = SubResource("StyleBoxFlat_agqdu")
theme_override_styles/hover = SubResource("StyleBoxFlat_ja3vm")
theme_override_styles/pressed = SubResource("StyleBoxFlat_mk273")
theme_override_styles/focus = SubResource("StyleBoxEmpty_840sd")
[node name="PriorityOverrideIcon" type="TextureRect" parent="PriorityOverrideButton"]
layout_mode = 1
offset_left = 8.0
offset_top = 4.0
offset_right = 32.0
offset_bottom = 28.0
texture = ExtResource("6_8cb64")
expand_mode = 1
[node name="PriorityOverrideByLabel" type="Label" parent="PriorityOverrideButton"]
layout_mode = 0
offset_left = 30.0
offset_top = 1.0
offset_right = 140.0
offset_bottom = 24.0
theme_override_fonts/font = ExtResource("4_dj3lt")
theme_override_font_sizes/font_size = 14
text = "OVERRIDDEN BY"
vertical_alignment = 1
[node name="PriorityOverrideNameLabel" type="Label" parent="PriorityOverrideButton"]
unique_name_in_owner = true
layout_mode = 0
offset_left = 6.0
offset_top = 21.0
offset_right = 153.0
offset_bottom = 44.0
theme_override_fonts/font = ExtResource("3_6wxxp")
theme_override_font_sizes/font_size = 14
text = "PCam_Name
"
vertical_alignment = 1
text_overrun_behavior = 3

View file

@ -0,0 +1,93 @@
extends EditorNode3DGizmoPlugin
class_name CustomPluginGizmo
var _gizmo_name
var gizmo_name: String: set = set_gizmo_name
var _gizmo_icon: Texture2D
var gizmo_icon: Texture2D: set = set_gizmo_icon
var _gizmo_spatial_script: Script
var gizmo_spatial_script: Script: set = set_gizmo_spatial_script
var _gizmo_scale: float = 0.035
func set_gizmo_name(name: String) -> void:
_gizmo_name = name
func set_gizmo_icon(icon: Texture2D) -> void:
_gizmo_icon = icon
func set_gizmo_spatial_script(script: Script) -> void:
_gizmo_spatial_script = script
func _get_gizmo_name() -> String:
return _gizmo_name
func _has_gizmo(spatial: Node3D):
return spatial.get_script() == _gizmo_spatial_script
func _init() -> void:
create_icon_material(_gizmo_name, _gizmo_icon, false, Color.WHITE)
create_material("main", Color8(252, 127, 127, 255))
func _draw_frustum() -> PackedVector3Array:
var lines = PackedVector3Array()
var dis: float = 0.25
var width: float = dis * 1.25
var len: float = dis * 1.5
# Straight line
# lines.push_back(Vector3(0, 0, 0))
# lines.push_back(Vector3(0, 0, -len))
# Trapezoid
lines.push_back(Vector3(0, 0, 0))
lines.push_back(Vector3(-width, dis, -len))
lines.push_back(Vector3(0, 0, 0))
lines.push_back(Vector3(width, dis, -len))
lines.push_back(Vector3(0, 0, 0))
lines.push_back(Vector3(-width, -dis, -len))
lines.push_back(Vector3(0, 0, 0))
lines.push_back(Vector3(width, -dis, -len))
# Square
## Left
lines.push_back(Vector3(-width, dis, -len))
lines.push_back(Vector3(-width, -dis, -len))
## Bottom
lines.push_back(Vector3(-width, -dis, -len))
lines.push_back(Vector3(width, -dis, -len))
## Right
lines.push_back(Vector3(width, -dis, -len))
lines.push_back(Vector3(width, dis, -len))
## Top
lines.push_back(Vector3(width, dis, -len))
lines.push_back(Vector3(-width, dis, -len))
return lines
func _redraw(gizmo: EditorNode3DGizmo):
gizmo.clear()
var icon: Material = get_material(_gizmo_name, gizmo)
gizmo.add_unscaled_billboard(icon, _gizmo_scale)
var material = get_material("main", gizmo)
gizmo.add_lines(_draw_frustum(), material)

View file

@ -0,0 +1,11 @@
extends CustomPluginGizmo
var _spatial_script: Script = preload("res://addons/phantom_camera/scripts/phantom_camera/phantom_camera_3D.gd")
var _icon: Texture2D = preload("res://addons/phantom_camera/icons/PhantomCameraGizmoIcon.svg")
func _init() -> void:
set_gizmo_name("PhantomCamera")
set_gizmo_spatial_script(_spatial_script)
set_gizmo_icon(_icon)
super()

View file

@ -0,0 +1,3 @@
<svg width="24" height="24" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg">
<path fill-rule="evenodd" clip-rule="evenodd" d="M11.5 18C12.2464 18 12.9449 17.6758 13.3678 17.1331L19.601 9.1332C20.3102 8.223 20.0488 6.97786 19.0173 6.3521C17.9857 5.72634 16.5746 5.95692 15.8654 6.86712L12.3342 12.2081C11.9388 12.8061 11.0612 12.8061 10.6658 12.2081L7.1346 6.86712C6.42542 5.95692 5.01427 5.72634 3.98272 6.3521C2.95117 6.97786 2.68985 8.223 3.39904 9.1332L9.63222 17.1331C10.0551 17.6758 10.7536 18 11.5 18Z" fill="#F5F5F5"/>
</svg>

After

Width:  |  Height:  |  Size: 552 B

View file

@ -0,0 +1,37 @@
[remap]
importer="texture"
type="CompressedTexture2D"
uid="uid://y4mdbb804sw0"
path="res://.godot/imported/Chevron.svg-93f7d046492ad140824afb8ee9e4ac3b.ctex"
metadata={
"vram_texture": false
}
[deps]
source_file="res://addons/phantom_camera/icons/Chevron.svg"
dest_files=["res://.godot/imported/Chevron.svg-93f7d046492ad140824afb8ee9e4ac3b.ctex"]
[params]
compress/mode=0
compress/high_quality=false
compress/lossy_quality=0.7
compress/hdr_compression=1
compress/normal_map=0
compress/channel_pack=0
mipmaps/generate=false
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=1
svg/scale=2.0
editor/scale_with_editor_scale=false
editor/convert_colors_with_editor_theme=false

View file

@ -0,0 +1,4 @@
<svg width="64" height="64" viewBox="0 0 64 64" fill="none" xmlns="http://www.w3.org/2000/svg">
<path fill-rule="evenodd" clip-rule="evenodd" d="M25.4264 52.5657C25.4069 52.6918 25.3968 52.8209 25.3968 52.9524V55.4762C25.3968 56.8701 24.2598 58 22.8571 58C21.4545 58 20.3175 56.8701 20.3175 55.4762V52.9524C20.3175 51.5585 19.1804 50.4286 17.7778 50.4286C16.3751 50.4286 15.2381 51.5585 15.2381 52.9524V55.4762C15.2381 56.8701 14.101 58 12.6984 58C11.2958 58 10.1587 56.8701 10.1587 55.4762V52.9524C10.1587 51.5585 9.02168 50.4286 7.61905 50.4286C6.21642 50.4286 5.07936 51.5585 5.07936 52.9524V55.4762C5.07936 56.8701 3.94231 58 2.53968 58C1.13705 58 0 56.8701 0 55.4762V22.6667C0 12.9096 7.95938 5 17.7778 5C27.1752 5 34.8697 12.246 35.5121 21.4224C34.7167 21.2876 33.9008 21.2158 33.071 21.2119C32.3974 19.4329 31.2027 18.25 29.8413 18.25C28.0891 18.25 26.6132 20.2092 26.1687 22.8772C21.7814 25.1533 18.6667 29.5712 18.6667 34.9294C18.6667 39.6358 21.1046 43.647 24.6667 46.0882V48.9588C24.6667 50.2664 24.9407 51.4798 25.4264 52.5657ZM17.1429 30.869C19.2468 30.869 20.9524 28.0442 20.9524 24.5595C20.9524 21.0749 19.2468 18.25 17.1429 18.25C15.0389 18.25 13.3333 21.0749 13.3333 24.5595C13.3333 28.0442 15.0389 30.869 17.1429 30.869Z" fill="white"/>
<path d="M55.1664 35.449C56.9108 33.9138 58 31.7347 58 29.3176C58 24.6687 53.9706 20.9 49 20.9C44.0294 20.9 40 24.6687 40 29.3176C40 29.4276 40.0023 29.537 40.0067 29.6459C38.3569 27.7344 35.8311 26.5118 33 26.5118C28.0294 26.5118 24 30.2805 24 34.9294C24 38.5945 26.5044 41.7125 30 42.8681V48.9588C30 51.025 31.7909 52.7 34 52.7H52C54.2091 52.7 56 51.025 56 48.9588V47.7118L64 52.7V33.9941L56 38.9824V37.7353C56 36.8743 55.689 36.0813 55.1664 35.449Z" fill="white"/>
</svg>

After

Width:  |  Height:  |  Size: 1.7 KiB

View file

@ -0,0 +1,37 @@
[remap]
importer="texture"
type="CompressedTexture2D"
uid="uid://r1je7iad5kby"
path="res://.godot/imported/PhantomCameraGizmoIcon.svg-ac3a63e577cdd67a63dfefb53ff46c7f.ctex"
metadata={
"vram_texture": false
}
[deps]
source_file="res://addons/phantom_camera/icons/PhantomCameraGizmoIcon.svg"
dest_files=["res://.godot/imported/PhantomCameraGizmoIcon.svg-ac3a63e577cdd67a63dfefb53ff46c7f.ctex"]
[params]
compress/mode=0
compress/high_quality=false
compress/lossy_quality=0.7
compress/hdr_compression=1
compress/normal_map=0
compress/channel_pack=0
mipmaps/generate=false
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
svg/scale=1.0
editor/scale_with_editor_scale=false
editor/convert_colors_with_editor_theme=false

View file

@ -0,0 +1,4 @@
<svg width="64" height="64" viewBox="0 0 64 64" fill="none" xmlns="http://www.w3.org/2000/svg">
<path fill-rule="evenodd" clip-rule="evenodd" d="M25.4264 52.5657C25.4069 52.6918 25.3968 52.8209 25.3968 52.9524V55.4762C25.3968 56.8701 24.2598 58 22.8571 58C21.4545 58 20.3175 56.8701 20.3175 55.4762V52.9524C20.3175 51.5585 19.1804 50.4286 17.7778 50.4286C16.3751 50.4286 15.2381 51.5585 15.2381 52.9524V55.4762C15.2381 56.8701 14.101 58 12.6984 58C11.2958 58 10.1587 56.8701 10.1587 55.4762V52.9524C10.1587 51.5585 9.02168 50.4286 7.61905 50.4286C6.21642 50.4286 5.07936 51.5585 5.07936 52.9524V55.4762C5.07936 56.8701 3.94231 58 2.53968 58C1.13705 58 0 56.8701 0 55.4762V22.6667C0 12.9096 7.95938 5 17.7778 5C27.1752 5 34.8697 12.246 35.5121 21.4224C34.7167 21.2876 33.9008 21.2158 33.071 21.2119C32.3974 19.4329 31.2027 18.25 29.8413 18.25C28.0891 18.25 26.6132 20.2092 26.1687 22.8772C21.7814 25.1533 18.6667 29.5712 18.6667 34.9294C18.6667 39.6358 21.1046 43.647 24.6667 46.0882V48.9588C24.6667 50.2664 24.9407 51.4798 25.4264 52.5657ZM17.1429 30.869C19.2468 30.869 20.9524 28.0442 20.9524 24.5595C20.9524 21.0749 19.2468 18.25 17.1429 18.25C15.0389 18.25 13.3333 21.0749 13.3333 24.5595C13.3333 28.0442 15.0389 30.869 17.1429 30.869Z" fill="#8BA3F0"/>
<path d="M55.1664 35.449C56.9108 33.9138 58 31.7347 58 29.3176C58 24.6687 53.9706 20.9 49 20.9C44.0294 20.9 40 24.6687 40 29.3176C40 29.4276 40.0023 29.537 40.0067 29.6459C38.3569 27.7344 35.8311 26.5118 33 26.5118C28.0294 26.5118 24 30.2805 24 34.9294C24 38.5945 26.5044 41.7125 30 42.8681V48.9588C30 51.025 31.7909 52.7 34 52.7H52C54.2091 52.7 56 51.025 56 48.9588V47.7118L64 52.7V33.9941L56 38.9824V37.7353C56 36.8743 55.689 36.0813 55.1664 35.449Z" fill="#8BA3F0"/>
</svg>

After

Width:  |  Height:  |  Size: 1.7 KiB

View file

@ -0,0 +1,38 @@
[remap]
importer="texture"
type="CompressedTexture2D"
uid="uid://b671h5enwiljg"
path.s3tc="res://.godot/imported/PhantomCameraGizmoIcon2D.svg-5d7dab204f188a4185c9a05ae4e57434.s3tc.ctex"
metadata={
"imported_formats": ["s3tc_bptc"],
"vram_texture": true
}
[deps]
source_file="res://addons/phantom_camera/icons/PhantomCameraGizmoIcon2D.svg"
dest_files=["res://.godot/imported/PhantomCameraGizmoIcon2D.svg-5d7dab204f188a4185c9a05ae4e57434.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
svg/scale=1.0
editor/scale_with_editor_scale=false
editor/convert_colors_with_editor_theme=false

View file

@ -0,0 +1,4 @@
<svg width="64" height="64" viewBox="0 0 64 64" fill="none" xmlns="http://www.w3.org/2000/svg">
<path fill-rule="evenodd" clip-rule="evenodd" d="M25.4264 52.5657C25.4069 52.6918 25.3968 52.8209 25.3968 52.9524V55.4762C25.3968 56.8701 24.2598 58 22.8571 58C21.4545 58 20.3175 56.8701 20.3175 55.4762V52.9524C20.3175 51.5585 19.1804 50.4286 17.7778 50.4286C16.3751 50.4286 15.2381 51.5585 15.2381 52.9524V55.4762C15.2381 56.8701 14.101 58 12.6984 58C11.2958 58 10.1587 56.8701 10.1587 55.4762V52.9524C10.1587 51.5585 9.02168 50.4286 7.61905 50.4286C6.21642 50.4286 5.07936 51.5585 5.07936 52.9524V55.4762C5.07936 56.8701 3.94231 58 2.53968 58C1.13705 58 0 56.8701 0 55.4762V22.6667C0 12.9096 7.95938 5 17.7778 5C27.1752 5 34.8697 12.246 35.5121 21.4224C34.7167 21.2876 33.9008 21.2158 33.071 21.2119C32.3974 19.4329 31.2027 18.25 29.8413 18.25C28.0891 18.25 26.6132 20.2092 26.1687 22.8772C21.7814 25.1533 18.6667 29.5712 18.6667 34.9294C18.6667 39.6358 21.1046 43.647 24.6667 46.0882V48.9588C24.6667 50.2664 24.9407 51.4798 25.4264 52.5657ZM17.1429 30.869C19.2468 30.869 20.9524 28.0442 20.9524 24.5595C20.9524 21.0749 19.2468 18.25 17.1429 18.25C15.0389 18.25 13.3333 21.0749 13.3333 24.5595C13.3333 28.0442 15.0389 30.869 17.1429 30.869Z" fill="#FC9C9C"/>
<path d="M55.1664 35.449C56.9108 33.9138 58 31.7347 58 29.3176C58 24.6687 53.9706 20.9 49 20.9C44.0294 20.9 40 24.6687 40 29.3176C40 29.4276 40.0023 29.537 40.0067 29.6459C38.3569 27.7344 35.8311 26.5118 33 26.5118C28.0294 26.5118 24 30.2805 24 34.9294C24 38.5945 26.5044 41.7125 30 42.8681V48.9588C30 51.025 31.7909 52.7 34 52.7H52C54.2091 52.7 56 51.025 56 48.9588V47.7118L64 52.7V33.9941L56 38.9824V37.7353C56 36.8743 55.689 36.0813 55.1664 35.449Z" fill="#FC9C9C"/>
</svg>

After

Width:  |  Height:  |  Size: 1.7 KiB

View file

@ -0,0 +1,38 @@
[remap]
importer="texture"
type="CompressedTexture2D"
uid="uid://u5tk5jsy6626"
path.s3tc="res://.godot/imported/PhantomCameraGizmoIcon3D.svg-f1749265faef32688ef013796d030703.s3tc.ctex"
metadata={
"imported_formats": ["s3tc_bptc"],
"vram_texture": true
}
[deps]
source_file="res://addons/phantom_camera/icons/PhantomCameraGizmoIcon3D.svg"
dest_files=["res://.godot/imported/PhantomCameraGizmoIcon3D.svg-f1749265faef32688ef013796d030703.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
svg/scale=1.0
editor/scale_with_editor_scale=false
editor/convert_colors_with_editor_theme=false

View file

@ -0,0 +1,3 @@
<svg width="16" height="16" viewBox="0 0 16 16" fill="none" xmlns="http://www.w3.org/2000/svg">
<path fill-rule="evenodd" clip-rule="evenodd" d="M4.5 2C5.88071 2 7 3.04467 7 4.33333V5.11777C5.33551 5.51497 4 6.88106 4 8.66667V8.93336C3.94031 8.9752 3.86611 9 3.78571 9C3.58847 9 3.42857 8.85076 3.42857 8.66667V8.33333C3.42857 8.14924 3.26867 8 3.07143 8C2.87418 8 2.71429 8.14924 2.71429 8.33333V8.66667C2.71429 8.85076 2.55439 9 2.35714 9C2.1599 9 2 8.85076 2 8.66667V4.33333C2 3.04467 3.11929 2 4.5 2ZM12 8.66667V8.93336C12.0597 8.9752 12.1339 9 12.2143 9C12.4115 9 12.5714 8.85076 12.5714 8.66667V8.33333C12.5714 8.14924 12.7313 8 12.9286 8C13.1258 8 13.2857 8.14924 13.2857 8.33333V8.66667C13.2857 8.85076 13.4456 9 13.6429 9C13.8401 9 14 8.85076 14 8.66667V4.33333C14 3.04467 12.8807 2 11.5 2C10.1193 2 9 3.04467 9 4.33333V5.11777C10.6645 5.51497 12 6.88106 12 8.66667ZM3.68129 5.41667C3.97716 5.41667 4.217 5.04357 4.217 4.58333C4.217 4.1231 3.97716 3.75 3.68129 3.75C3.38542 3.75 3.14558 4.1231 3.14558 4.58333C3.14558 5.04357 3.38542 5.41667 3.68129 5.41667ZM6.00272 4.58333C6.00272 5.04357 5.76287 5.41667 5.467 5.41667C5.17114 5.41667 4.93129 5.04357 4.93129 4.58333C4.93129 4.1231 5.17114 3.75 5.467 3.75C5.76287 3.75 6.00272 4.1231 6.00272 4.58333ZM10.6813 5.41667C10.9772 5.41667 11.217 5.04357 11.217 4.58333C11.217 4.1231 10.9772 3.75 10.6813 3.75C10.3854 3.75 10.1456 4.1231 10.1456 4.58333C10.1456 5.04357 10.3854 5.41667 10.6813 5.41667ZM13.0027 4.58333C13.0027 5.04357 12.7629 5.41667 12.467 5.41667C12.1711 5.41667 11.9313 5.04357 11.9313 4.58333C11.9313 4.1231 12.1711 3.75 12.467 3.75C12.7629 3.75 13.0027 4.1231 13.0027 4.58333ZM8 6C9.65685 6 11 7.19391 11 8.66667V13.619C11 13.8294 10.8081 14 10.5714 14C10.3347 14 10.1429 13.8294 10.1429 13.619V13.2381C10.1429 13.0277 9.95098 12.8571 9.71429 12.8571C9.47759 12.8571 9.28571 13.0277 9.28571 13.2381V13.619C9.28571 13.8294 9.09384 14 8.85714 14C8.62045 14 8.42857 13.8294 8.42857 13.619V13.2381C8.42857 13.0277 8.23669 12.8571 8 12.8571C7.76331 12.8571 7.57143 13.0277 7.57143 13.2381V13.619C7.57143 13.8294 7.37955 14 7.14286 14C6.90616 14 6.71429 13.8294 6.71429 13.619V13.2381C6.71429 13.0277 6.52241 12.8571 6.28571 12.8571C6.04902 12.8571 5.85714 13.0277 5.85714 13.2381V13.619C5.85714 13.8294 5.66526 14 5.42857 14C5.19188 14 5 13.8294 5 13.619V8.66667C5 7.19391 6.34315 6 8 6ZM7.01755 9.90476C7.37259 9.90476 7.6604 9.47837 7.6604 8.95238C7.6604 8.4264 7.37259 8 7.01755 8C6.66251 8 6.37469 8.4264 6.37469 8.95238C6.37469 9.47837 6.66251 9.90476 7.01755 9.90476ZM9.80326 8.95238C9.80326 9.47837 9.51544 9.90476 9.1604 9.90476C8.80536 9.90476 8.51755 9.47837 8.51755 8.95238C8.51755 8.4264 8.80536 8 9.1604 8C9.51544 8 9.80326 8.4264 9.80326 8.95238Z" fill="white"/>
</svg>

After

Width:  |  Height:  |  Size: 2.7 KiB

View file

@ -0,0 +1,37 @@
[remap]
importer="texture"
type="CompressedTexture2D"
uid="uid://wmf1162mnoog"
path="res://.godot/imported/PhantomCameraHostIcon.svg-97309b98913e7760fc2cc984f77a836d.ctex"
metadata={
"vram_texture": false
}
[deps]
source_file="res://addons/phantom_camera/icons/PhantomCameraHostIcon.svg"
dest_files=["res://.godot/imported/PhantomCameraHostIcon.svg-97309b98913e7760fc2cc984f77a836d.ctex"]
[params]
compress/mode=0
compress/high_quality=false
compress/lossy_quality=0.7
compress/hdr_compression=1
compress/normal_map=0
compress/channel_pack=0
mipmaps/generate=false
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=1
svg/scale=4.0
editor/scale_with_editor_scale=false
editor/convert_colors_with_editor_theme=false

View file

@ -0,0 +1,4 @@
<svg width="16" height="16" viewBox="0 0 16 16" fill="none" xmlns="http://www.w3.org/2000/svg">
<path d="M10.4058 6.08062C10.597 6.03686 10.7958 6.01014 11 6.00237C11.0414 6.0008 11.0831 6 11.125 6C12.7404 6 14.05 7.18513 14.05 8.64706C14.05 9.40714 13.696 10.0924 13.1291 10.5752C13.2989 10.774 13.4 11.0234 13.4 11.2941V11.6863L16 10.1176V16L13.4 14.4314V14.8235C13.4 15.4733 12.818 16 12.1 16H6.25C5.53203 16 4.95 15.4733 4.95 14.8235V12.9082C3.81394 12.5448 3 11.5643 3 10.4118C3 8.94983 4.30957 7.76471 5.925 7.76471C6.40224 7.76471 6.85278 7.86814 7.25074 8.05158C7.57517 8.20113 7.86467 8.40385 8.1052 8.64706C8.13848 8.68071 8.17082 8.71513 8.20218 8.75029C8.20073 8.71604 8.2 8.68163 8.2 8.64706C8.2 8.27762 8.28363 7.92587 8.43468 7.60644C8.46297 7.54664 8.49361 7.48798 8.52651 7.43054C8.90646 6.76722 9.58744 6.26786 10.4058 6.08062Z" fill="white"/>
<path d="M3.92857 16C4.04819 16 4.16157 15.9741 4.26306 15.9277C4.06628 15.6125 3.95 15.2392 3.95 14.8235V13.5639C2.81408 12.9472 2 11.796 2 10.4118C2 8.85849 3.00847 7.61238 4.36899 7.06539C4.21598 6.74406 4.125 6.34158 4.125 5.90476C4.125 4.85279 4.65266 4 5.30357 4C5.95448 4 6.48214 4.85279 6.48214 5.90476C6.48214 6.22263 6.43397 6.5223 6.34877 6.78577C6.77687 6.82854 7.18698 6.93548 7.56629 7.09764C7.70528 6.82196 7.88006 6.56716 8.08407 6.33714C8.06412 6.19823 8.05357 6.05348 8.05357 5.90476C8.05357 4.85279 8.58123 4 9.23214 4C9.701 4 10.1059 4.44247 10.2957 5.08313C10.5221 5.0373 10.7542 5.00984 10.9896 5.0022C10.8132 2.21092 8.42289 0 5.5 0C2.46243 0 0 2.38781 0 5.33333V15.2381C0 15.6589 0.351776 16 0.785714 16C1.21965 16 1.57143 15.6589 1.57143 15.2381V14.4762C1.57143 14.0554 1.92321 13.7143 2.35714 13.7143C2.79108 13.7143 3.14286 14.0554 3.14286 14.4762V15.2381C3.14286 15.6589 3.49463 16 3.92857 16Z" fill="white"/>
</svg>

After

Width:  |  Height:  |  Size: 1.8 KiB

View file

@ -0,0 +1,37 @@
[remap]
importer="texture"
type="CompressedTexture2D"
uid="uid://b5d72pljpr1in"
path="res://.godot/imported/PhantomCameraIcon.svg-9ffbadad50d28833b951e45d8f266e31.ctex"
metadata={
"vram_texture": false
}
[deps]
source_file="res://addons/phantom_camera/icons/PhantomCameraIcon.svg"
dest_files=["res://.godot/imported/PhantomCameraIcon.svg-9ffbadad50d28833b951e45d8f266e31.ctex"]
[params]
compress/mode=0
compress/high_quality=false
compress/lossy_quality=0.7
compress/hdr_compression=1
compress/normal_map=0
compress/channel_pack=0
mipmaps/generate=false
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=1
svg/scale=1.0
editor/scale_with_editor_scale=false
editor/convert_colors_with_editor_theme=false

View file

@ -0,0 +1,4 @@
<svg width="16" height="16" viewBox="0 0 16 16" fill="none" xmlns="http://www.w3.org/2000/svg">
<path d="M10.4058 6.08062C10.597 6.03686 10.7958 6.01014 11 6.00237C11.0414 6.0008 11.0831 6 11.125 6C12.7404 6 14.05 7.18513 14.05 8.64706C14.05 9.40714 13.696 10.0924 13.1291 10.5752C13.2989 10.774 13.4 11.0234 13.4 11.2941V11.6863L16 10.1176V16L13.4 14.4314V14.8235C13.4 15.4733 12.818 16 12.1 16H6.25C5.53203 16 4.95 15.4733 4.95 14.8235V12.9082C3.81394 12.5448 3 11.5643 3 10.4118C3 8.94983 4.30957 7.76471 5.925 7.76471C6.40224 7.76471 6.85278 7.86814 7.25074 8.05158C7.57517 8.20113 7.86467 8.40385 8.1052 8.64706C8.13848 8.68071 8.17082 8.71513 8.20218 8.75029C8.20073 8.71604 8.2 8.68163 8.2 8.64706C8.2 8.27762 8.28363 7.92587 8.43468 7.60644C8.46297 7.54664 8.49361 7.48798 8.52651 7.43054C8.90646 6.76722 9.58744 6.26786 10.4058 6.08062Z" fill="#8DA5F3"/>
<path d="M3.92857 16C4.04819 16 4.16157 15.9741 4.26306 15.9277C4.06628 15.6125 3.95 15.2392 3.95 14.8235V13.5639C2.81408 12.9472 2 11.796 2 10.4118C2 8.85849 3.00847 7.61238 4.36899 7.06539C4.21598 6.74406 4.125 6.34158 4.125 5.90476C4.125 4.85279 4.65266 4 5.30357 4C5.95448 4 6.48214 4.85279 6.48214 5.90476C6.48214 6.22263 6.43397 6.5223 6.34877 6.78577C6.77687 6.82854 7.18698 6.93548 7.56629 7.09764C7.70528 6.82196 7.88006 6.56716 8.08407 6.33714C8.06412 6.19823 8.05357 6.05348 8.05357 5.90476C8.05357 4.85279 8.58123 4 9.23214 4C9.701 4 10.1059 4.44247 10.2957 5.08313C10.5221 5.0373 10.7542 5.00984 10.9896 5.0022C10.8132 2.21092 8.42289 0 5.5 0C2.46243 0 0 2.38781 0 5.33333V15.2381C0 15.6589 0.351776 16 0.785714 16C1.21965 16 1.57143 15.6589 1.57143 15.2381V14.4762C1.57143 14.0554 1.92321 13.7143 2.35714 13.7143C2.79108 13.7143 3.14286 14.0554 3.14286 14.4762V15.2381C3.14286 15.6589 3.49463 16 3.92857 16Z" fill="#8DA5F3"/>
</svg>

After

Width:  |  Height:  |  Size: 1.8 KiB

View file

@ -0,0 +1,37 @@
[remap]
importer="texture"
type="CompressedTexture2D"
uid="uid://c88qnl38ej6nr"
path="res://.godot/imported/PhantomCameraIcon2D.svg-ff639bc802b50f88263b8dee8a265dab.ctex"
metadata={
"vram_texture": false
}
[deps]
source_file="res://addons/phantom_camera/icons/PhantomCameraIcon2D.svg"
dest_files=["res://.godot/imported/PhantomCameraIcon2D.svg-ff639bc802b50f88263b8dee8a265dab.ctex"]
[params]
compress/mode=0
compress/high_quality=false
compress/lossy_quality=0.7
compress/hdr_compression=1
compress/normal_map=0
compress/channel_pack=0
mipmaps/generate=false
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=1
svg/scale=2.0
editor/scale_with_editor_scale=false
editor/convert_colors_with_editor_theme=false

View file

@ -0,0 +1,4 @@
<svg width="16" height="16" viewBox="0 0 16 16" fill="none" xmlns="http://www.w3.org/2000/svg">
<path d="M10.4058 6.08062C10.597 6.03686 10.7958 6.01014 11 6.00237C11.0414 6.0008 11.0831 6 11.125 6C12.7404 6 14.05 7.18513 14.05 8.64706C14.05 9.40714 13.696 10.0924 13.1291 10.5752C13.2989 10.774 13.4 11.0234 13.4 11.2941V11.6863L16 10.1176V16L13.4 14.4314V14.8235C13.4 15.4733 12.818 16 12.1 16H6.25C5.53203 16 4.95 15.4733 4.95 14.8235V12.9082C3.81394 12.5448 3 11.5643 3 10.4118C3 8.94983 4.30957 7.76471 5.925 7.76471C6.40224 7.76471 6.85278 7.86814 7.25074 8.05158C7.57517 8.20113 7.86467 8.40385 8.1052 8.64706C8.13848 8.68071 8.17082 8.71513 8.20218 8.75029C8.20073 8.71604 8.2 8.68163 8.2 8.64706C8.2 8.27762 8.28363 7.92587 8.43468 7.60644C8.46297 7.54664 8.49361 7.48798 8.52651 7.43054C8.90646 6.76722 9.58744 6.26786 10.4058 6.08062Z" fill="#FC7F7F"/>
<path d="M3.92857 16C4.04819 16 4.16157 15.9741 4.26306 15.9277C4.06628 15.6125 3.95 15.2392 3.95 14.8235V13.5639C2.81408 12.9472 2 11.796 2 10.4118C2 8.85849 3.00847 7.61238 4.36899 7.06539C4.21598 6.74406 4.125 6.34158 4.125 5.90476C4.125 4.85279 4.65266 4 5.30357 4C5.95448 4 6.48214 4.85279 6.48214 5.90476C6.48214 6.22263 6.43397 6.5223 6.34877 6.78577C6.77687 6.82854 7.18698 6.93548 7.56629 7.09764C7.70528 6.82196 7.88006 6.56716 8.08407 6.33714C8.06412 6.19823 8.05357 6.05348 8.05357 5.90476C8.05357 4.85279 8.58123 4 9.23214 4C9.701 4 10.1059 4.44247 10.2957 5.08313C10.5221 5.0373 10.7542 5.00984 10.9896 5.0022C10.8132 2.21092 8.42289 0 5.5 0C2.46243 0 0 2.38781 0 5.33333V15.2381C0 15.6589 0.351776 16 0.785714 16C1.21965 16 1.57143 15.6589 1.57143 15.2381V14.4762C1.57143 14.0554 1.92321 13.7143 2.35714 13.7143C2.79108 13.7143 3.14286 14.0554 3.14286 14.4762V15.2381C3.14286 15.6589 3.49463 16 3.92857 16Z" fill="#FC7F7F"/>
</svg>

After

Width:  |  Height:  |  Size: 1.8 KiB

View file

@ -0,0 +1,37 @@
[remap]
importer="texture"
type="CompressedTexture2D"
uid="uid://ce6jv7etypg8b"
path="res://.godot/imported/PhantomCameraIcon3D.svg-2bc62e479ff60e942df3edb50acf2cff.ctex"
metadata={
"vram_texture": false
}
[deps]
source_file="res://addons/phantom_camera/icons/PhantomCameraIcon3D.svg"
dest_files=["res://.godot/imported/PhantomCameraIcon3D.svg-2bc62e479ff60e942df3edb50acf2cff.ctex"]
[params]
compress/mode=0
compress/high_quality=false
compress/lossy_quality=0.7
compress/hdr_compression=1
compress/normal_map=0
compress/channel_pack=0
mipmaps/generate=false
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=1
svg/scale=2.0
editor/scale_with_editor_scale=false
editor/convert_colors_with_editor_theme=false

View file

@ -0,0 +1,3 @@
<svg width="24" height="25" viewBox="0 0 24 25" fill="none" xmlns="http://www.w3.org/2000/svg">
<path d="M22.3604 6.25046C22.8995 6.78949 22.6024 7.80236 21.8027 8.15222L20.0083 8.93723L16.0362 12.9093L16.2851 13.1581C16.5047 13.3778 16.5743 13.7158 16.4686 14.0502L15.9128 15.8083C15.6763 16.5568 14.7427 16.8861 14.2511 16.3945L12.3056 14.4489L10.9559 15.7986L3.9104 20.8133C3.74897 20.9282 3.58056 20.7598 3.69546 20.5983L8.71008 13.5529L10.0598 12.2032L8.11427 10.2576C7.62263 9.76598 7.95189 8.83247 8.70038 8.59588L10.4585 8.04016C10.7929 7.93446 11.131 8.00398 11.3506 8.22365L11.5995 8.47248L15.5715 4.50045L16.3565 2.70602C16.7064 1.9063 17.7192 1.60924 18.2583 2.14827L22.3604 6.25046Z" fill="#F5F5F5"/>
</svg>

After

Width:  |  Height:  |  Size: 721 B

View file

@ -0,0 +1,37 @@
[remap]
importer="texture"
type="CompressedTexture2D"
uid="uid://bs431wfbauixi"
path="res://.godot/imported/Pin.svg-e2d0362d47a5481549ac5fa1bd0f6a94.ctex"
metadata={
"vram_texture": false
}
[deps]
source_file="res://addons/phantom_camera/icons/Pin.svg"
dest_files=["res://.godot/imported/Pin.svg-e2d0362d47a5481549ac5fa1bd0f6a94.ctex"]
[params]
compress/mode=0
compress/high_quality=false
compress/lossy_quality=0.7
compress/hdr_compression=1
compress/normal_map=0
compress/channel_pack=0
mipmaps/generate=false
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=1
svg/scale=2.0
editor/scale_with_editor_scale=false
editor/convert_colors_with_editor_theme=false

View file

@ -0,0 +1,9 @@
<svg width="64" height="64" viewBox="0 0 64 64" fill="none" xmlns="http://www.w3.org/2000/svg">
<path fill-rule="evenodd" clip-rule="evenodd" d="M17.6643 17.0163C16.0164 15.545 13.4878 15.6881 12.0165 17.336C10.5451 18.9838 10.6882 21.5124 12.3361 22.9838L21.3233 31.0082C22.2139 31.8034 22.2139 33.1967 21.3233 33.9919L12.336 42.0163C10.6881 43.4876 10.545 46.0162 12.0163 47.6641C13.4876 49.312 16.0162 49.4551 17.6641 47.9838L29.9932 36.9757C32.6651 34.5901 32.6651 30.4101 29.9932 28.0245L17.6643 17.0163ZM38.6643 17.0163C37.0164 15.545 34.4878 15.6881 33.0165 17.336C31.5451 18.9838 31.6882 21.5124 33.3361 22.9838L42.3233 31.0082C43.2139 31.8034 43.2139 33.1967 42.3233 33.9919L33.336 42.0163C31.6881 43.4876 31.545 46.0162 33.0163 47.6641C34.4876 49.312 37.0162 49.4551 38.6641 47.9838L50.9932 36.9757C53.6651 34.5901 53.6651 30.4101 50.9932 28.0245L38.6643 17.0163Z" fill="url(#paint0_linear_628_3589)"/>
<defs>
<linearGradient id="paint0_linear_628_3589" x1="31.4736" y1="18.308" x2="34.1039" y2="48.8186" gradientUnits="userSpaceOnUse">
<stop stop-color="#3AB99A"/>
<stop offset="1" stop-color="#1B9E7F"/>
</linearGradient>
</defs>
</svg>

After

Width:  |  Height:  |  Size: 1.1 KiB

View file

@ -0,0 +1,37 @@
[remap]
importer="texture"
type="CompressedTexture2D"
uid="uid://b8sogykt6nr4w"
path="res://.godot/imported/Follow.svg-20727eddb81c29f51080d89970d3deec.ctex"
metadata={
"vram_texture": false
}
[deps]
source_file="res://addons/phantom_camera/icons/features/Follow.svg"
dest_files=["res://.godot/imported/Follow.svg-20727eddb81c29f51080d89970d3deec.ctex"]
[params]
compress/mode=0
compress/high_quality=false
compress/lossy_quality=0.7
compress/hdr_compression=1
compress/normal_map=0
compress/channel_pack=0
mipmaps/generate=false
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=1
svg/scale=1.0
editor/scale_with_editor_scale=false
editor/convert_colors_with_editor_theme=false

View file

@ -0,0 +1,9 @@
<svg width="64" height="64" viewBox="0 0 64 64" fill="none" xmlns="http://www.w3.org/2000/svg">
<path fill-rule="evenodd" clip-rule="evenodd" d="M44.6212 15.8193L36.0187 20.7859C35.2077 21.2542 34.7846 22.1365 34.8623 23.0117L34.6754 23.1196L41.4246 34.8094L41.611 34.7018C42.3302 35.2073 43.3063 35.2822 44.1177 34.8138L52.7203 29.847C53.3542 30.389 54.2853 30.5018 55.0487 30.0611C56.0096 29.5063 56.3437 28.2829 55.8028 27.3179L48.3526 14.4139C47.7874 13.4629 46.5608 13.1405 45.5999 13.6953C44.8364 14.1361 44.4686 14.9992 44.6212 15.8193ZM51.3217 14.1573L57.5094 24.8746C59.0531 22.7808 59.3065 19.8879 57.9227 17.4911C56.5388 15.0942 53.9069 13.8673 51.3217 14.1573ZM39.0866 36.1593L32.3375 24.4694L27.3415 27.3538C26.5302 27.8223 26.1071 28.7049 26.1851 29.5804L25.9984 29.6882L31.3978 39.0401L31.5846 38.9322C32.3038 39.4372 33.2795 39.512 34.0907 39.0437L39.0866 36.1593ZM29.0598 40.3899L23.6605 31.038L18.6646 33.9224C17.8535 34.3907 17.4304 35.273 17.5082 36.1482L17.3213 36.2561L21.3708 43.27L21.5573 43.1623C22.2765 43.6678 23.2525 43.7427 24.0639 43.2742L29.0598 40.3899ZM19.0329 44.6198L14.9834 37.6059L7.96942 41.6554L7.20228 40.3267C6.88052 39.7694 6.16791 39.5785 5.61061 39.9002L5.29079 40.0849C4.73349 40.4066 4.54255 41.1192 4.86431 41.6765L6.79337 45.0178L6.79662 45.0234L8.51574 48.001L8.519 48.0067L10.4483 51.3482C10.77 51.9055 11.4826 52.0965 12.0399 51.7747L12.3597 51.5901C12.917 51.2683 13.108 50.5557 12.7862 49.9984L12.0189 48.6693L19.0329 44.6198Z" fill="url(#paint0_linear_628_3593)"/>
<defs>
<linearGradient id="paint0_linear_628_3593" x1="54.289" y1="19.3164" x2="20.4239" y2="57.7596" gradientUnits="userSpaceOnUse">
<stop stop-color="#3AB99A"/>
<stop offset="1" stop-color="#1B9E7F"/>
</linearGradient>
</defs>
</svg>

After

Width:  |  Height:  |  Size: 1.7 KiB

View file

@ -0,0 +1,37 @@
[remap]
importer="texture"
type="CompressedTexture2D"
uid="uid://c842m6725xuv2"
path="res://.godot/imported/Look-At.svg-1406876d1233f3264e9f8a21e2b6b1f9.ctex"
metadata={
"vram_texture": false
}
[deps]
source_file="res://addons/phantom_camera/icons/features/Look-At.svg"
dest_files=["res://.godot/imported/Look-At.svg-1406876d1233f3264e9f8a21e2b6b1f9.ctex"]
[params]
compress/mode=0
compress/high_quality=false
compress/lossy_quality=0.7
compress/hdr_compression=1
compress/normal_map=0
compress/channel_pack=0
mipmaps/generate=false
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=1
svg/scale=1.0
editor/scale_with_editor_scale=false
editor/convert_colors_with_editor_theme=false

View file

@ -0,0 +1,19 @@
<svg width="64" height="64" viewBox="0 0 64 64" fill="none" xmlns="http://www.w3.org/2000/svg">
<path d="M7 14C7 12.8954 7.89543 12 9 12H55C56.1046 12 57 12.8954 57 14V18C57 19.1046 56.1046 20 55 20H9C7.89543 20 7 19.1046 7 18V14Z" fill="url(#paint0_linear_628_3588)"/>
<path d="M14.5474 30C14.5474 28.8954 15.4428 28 16.5474 28H47.453C48.5576 28 49.453 28.8954 49.453 30V34C49.453 35.1046 48.5576 36 47.453 36H16.5474C15.4428 36 14.5474 35.1046 14.5474 34V30Z" fill="url(#paint1_linear_628_3588)"/>
<path d="M19.2639 46C19.2639 44.8954 20.1593 44 21.2639 44H42.7356C43.8402 44 44.7356 44.8954 44.7356 46V50C44.7356 51.1046 43.8402 52 42.7356 52H21.2639C20.1593 52 19.2639 51.1046 19.2639 50V46Z" fill="url(#paint2_linear_628_3588)"/>
<defs>
<linearGradient id="paint0_linear_628_3588" x1="31.375" y1="14.7976" x2="34.6201" y2="51.77" gradientUnits="userSpaceOnUse">
<stop stop-color="#3AB99A"/>
<stop offset="1" stop-color="#1B9E7F"/>
</linearGradient>
<linearGradient id="paint1_linear_628_3588" x1="31.375" y1="14.7976" x2="34.6201" y2="51.77" gradientUnits="userSpaceOnUse">
<stop stop-color="#3AB99A"/>
<stop offset="1" stop-color="#1B9E7F"/>
</linearGradient>
<linearGradient id="paint2_linear_628_3588" x1="31.375" y1="14.7976" x2="34.6201" y2="51.77" gradientUnits="userSpaceOnUse">
<stop stop-color="#3AB99A"/>
<stop offset="1" stop-color="#1B9E7F"/>
</linearGradient>
</defs>
</svg>

After

Width:  |  Height:  |  Size: 1.4 KiB

View file

@ -0,0 +1,37 @@
[remap]
importer="texture"
type="CompressedTexture2D"
uid="uid://cblr1js4af56m"
path="res://.godot/imported/Priority.svg-53e78ea3f4625745c7696391c34656d0.ctex"
metadata={
"vram_texture": false
}
[deps]
source_file="res://addons/phantom_camera/icons/features/Priority.svg"
dest_files=["res://.godot/imported/Priority.svg-53e78ea3f4625745c7696391c34656d0.ctex"]
[params]
compress/mode=0
compress/high_quality=false
compress/lossy_quality=0.7
compress/hdr_compression=1
compress/normal_map=0
compress/channel_pack=0
mipmaps/generate=false
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=1
svg/scale=1.0
editor/scale_with_editor_scale=false
editor/convert_colors_with_editor_theme=false

View file

@ -0,0 +1,19 @@
<svg width="64" height="64" viewBox="0 0 64 64" fill="none" xmlns="http://www.w3.org/2000/svg">
<path d="M16.2852 22L20.0472 17.428L16.5192 13.144H20.2452L21.8652 15.232L23.4852 13.144H27.1932L23.6652 17.428L27.4632 22H23.7192L21.8472 19.642L19.9932 22H16.2852Z" fill="url(#paint0_linear_628_3591)"/>
<path d="M53.9159 39.1981C52.5719 39.1981 51.5759 38.8861 50.9279 38.2621C50.2799 37.6381 49.9559 36.6961 49.9559 35.4361V32.5021H48.2999V30.1441H49.9559V27.5701H53.1599V30.1441H55.6799V32.5021H53.1599V35.3281C53.1599 36.1921 53.5979 36.6241 54.4739 36.6241C54.6179 36.6241 54.7739 36.6121 54.9419 36.5881C55.1219 36.5521 55.3199 36.5041 55.5359 36.4441L55.9679 38.7481C55.6919 38.8921 55.3679 39.0001 54.9959 39.0721C54.6239 39.1561 54.2639 39.1981 53.9159 39.1981Z" fill="url(#paint1_linear_628_3591)"/>
<path fill-rule="evenodd" clip-rule="evenodd" d="M9 12.5C10.933 12.5 12.5 14.067 12.5 16V43.4357C19.8423 42.9779 23.2638 40.159 25.0921 37.4773C26.8216 34.9406 27.3486 32.4098 27.8163 30.1634C27.9707 29.422 28.1186 28.7116 28.3012 28.0422C28.8771 25.9304 30.0569 21.8718 34.0139 18.4543C37.9767 15.0319 44.2051 12.6779 54 12.6779C55.933 12.6779 57.5 14.2449 57.5 16.1779C57.5 18.1108 55.933 19.6779 54 19.6779C45.2949 19.6779 40.8957 21.7601 38.5893 23.7521C36.277 25.749 35.5457 28.083 35.0545 29.884C34.9991 30.0871 34.9344 30.4142 34.8502 30.84C34.4303 32.9618 33.5255 37.534 30.8759 41.4205C30.3605 42.1763 29.7852 42.9072 29.144 43.604H54C55.933 43.604 57.5 45.171 57.5 47.104C57.5 49.037 55.933 50.604 54 50.604H11C7.96243 50.604 5.5 48.1416 5.5 45.104V16C5.5 14.067 7.067 12.5 9 12.5Z" fill="url(#paint2_linear_628_3591)"/>
<defs>
<linearGradient id="paint0_linear_628_3591" x1="21.7345" y1="13.7634" x2="22.4461" y2="21.9503" gradientUnits="userSpaceOnUse">
<stop stop-color="#3AB99A"/>
<stop offset="1" stop-color="#1B9E7F"/>
</linearGradient>
<linearGradient id="paint1_linear_628_3591" x1="52.0381" y1="28.3833" x2="53.7915" y2="38.9223" gradientUnits="userSpaceOnUse">
<stop stop-color="#3AB99A"/>
<stop offset="1" stop-color="#1B9E7F"/>
</linearGradient>
<linearGradient id="paint2_linear_628_3591" x1="30.8375" y1="15.5251" x2="33.3369" y2="48.9667" gradientUnits="userSpaceOnUse">
<stop stop-color="#3AB99A"/>
<stop offset="1" stop-color="#1B9E7F"/>
</linearGradient>
</defs>
</svg>

After

Width:  |  Height:  |  Size: 2.3 KiB

View file

@ -0,0 +1,37 @@
[remap]
importer="texture"
type="CompressedTexture2D"
uid="uid://bjuso2kbsicbh"
path="res://.godot/imported/Tween.svg-fb2fdd7fcf23c0b1f2702a06d00f0546.ctex"
metadata={
"vram_texture": false
}
[deps]
source_file="res://addons/phantom_camera/icons/features/Tween.svg"
dest_files=["res://.godot/imported/Tween.svg-fb2fdd7fcf23c0b1f2702a06d00f0546.ctex"]
[params]
compress/mode=0
compress/high_quality=false
compress/lossy_quality=0.7
compress/hdr_compression=1
compress/normal_map=0
compress/channel_pack=0
mipmaps/generate=false
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=1
svg/scale=1.0
editor/scale_with_editor_scale=false
editor/convert_colors_with_editor_theme=false

View file

@ -0,0 +1,9 @@
<svg width="64" height="64" viewBox="0 0 64 64" fill="none" xmlns="http://www.w3.org/2000/svg">
<path fill-rule="evenodd" clip-rule="evenodd" d="M25 34C30.5228 34 35 29.5228 35 24C35 18.4772 30.5228 14 25 14C19.4772 14 15 18.4772 15 24C15 29.5228 19.4772 34 25 34ZM25 40C27.9246 40 30.6659 39.2153 33.0249 37.8451C33.164 38.0689 33.3307 38.2805 33.5251 38.4749L36.525 41.4747C36.3746 43.0518 36.9032 44.6814 38.1109 45.8891L46.1109 53.8891C48.2588 56.037 51.7412 56.037 53.8891 53.8891C56.037 51.7412 56.037 48.2588 53.8891 46.1109L45.8891 38.1109C44.6814 36.9032 43.0518 36.3746 41.4747 36.525L38.4749 33.5251C38.3545 33.4047 38.2275 33.2949 38.0951 33.1958C39.9254 30.5942 41 27.4226 41 24C41 15.1634 33.8366 8 25 8C16.1634 8 9 15.1634 9 24C9 32.8366 16.1634 40 25 40Z" fill="url(#paint0_linear_628_3592)"/>
<defs>
<linearGradient id="paint0_linear_628_3592" x1="32.0066" y1="14.8336" x2="36.1366" y2="51.5323" gradientUnits="userSpaceOnUse">
<stop stop-color="#3AB99A"/>
<stop offset="1" stop-color="#1B9E7F"/>
</linearGradient>
</defs>
</svg>

After

Width:  |  Height:  |  Size: 1 KiB

View file

@ -0,0 +1,37 @@
[remap]
importer="texture"
type="CompressedTexture2D"
uid="uid://oxksi2r6mjtp"
path="res://.godot/imported/Zoom.svg-fb4bc1d9ca6c467b16ba249b238b7b70.ctex"
metadata={
"vram_texture": false
}
[deps]
source_file="res://addons/phantom_camera/icons/features/Zoom.svg"
dest_files=["res://.godot/imported/Zoom.svg-fb4bc1d9ca6c467b16ba249b238b7b70.ctex"]
[params]
compress/mode=0
compress/high_quality=false
compress/lossy_quality=0.7
compress/hdr_compression=1
compress/normal_map=0
compress/channel_pack=0
mipmaps/generate=false
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=1
svg/scale=1.0
editor/scale_with_editor_scale=false
editor/convert_colors_with_editor_theme=false

View file

@ -0,0 +1,14 @@
<svg width="64" height="64" viewBox="0 0 64 64" fill="none" xmlns="http://www.w3.org/2000/svg">
<path d="M14.5474 30C14.5474 28.8954 15.4428 28 16.5474 28H47.453C48.5576 28 49.453 28.8954 49.453 30V34C49.453 35.1046 48.5576 36 47.453 36H16.5474C15.4428 36 14.5474 35.1046 14.5474 34V30Z" fill="url(#paint0_linear_1180_3884)"/>
<path opacity="0.4" fill-rule="evenodd" clip-rule="evenodd" d="M9 12C7.89543 12 7 12.8954 7 14V18C7 19.1046 7.89543 20 9 20H55C56.1046 20 57 19.1046 57 18V14C57 12.8954 56.1046 12 55 12H9ZM21.2639 44C20.1593 44 19.2639 44.8954 19.2639 46V50C19.2639 51.1046 20.1593 52 21.2639 52H42.7356C43.8402 52 44.7356 51.1046 44.7356 50V46C44.7356 44.8954 43.8402 44 42.7356 44H21.2639Z" fill="url(#paint1_linear_1180_3884)"/>
<defs>
<linearGradient id="paint0_linear_1180_3884" x1="31.5639" y1="28.5595" x2="31.7511" y2="36.0063" gradientUnits="userSpaceOnUse">
<stop stop-color="#3AB99A"/>
<stop offset="1" stop-color="#1B9E7F"/>
</linearGradient>
<linearGradient id="paint1_linear_1180_3884" x1="31.375" y1="14.7976" x2="34.6201" y2="51.77" gradientUnits="userSpaceOnUse">
<stop stop-color="#3AB99A"/>
<stop offset="1" stop-color="#1B9E7F"/>
</linearGradient>
</defs>
</svg>

After

Width:  |  Height:  |  Size: 1.2 KiB

View file

@ -0,0 +1,37 @@
[remap]
importer="texture"
type="CompressedTexture2D"
uid="uid://dy8eifa6aw2en"
path="res://.godot/imported/PriorityOverride.svg-e76e07f4bbd98169f119e17fe5f2f03f.ctex"
metadata={
"vram_texture": false
}
[deps]
source_file="res://addons/phantom_camera/icons/misc/PriorityOverride.svg"
dest_files=["res://.godot/imported/PriorityOverride.svg-e76e07f4bbd98169f119e17fe5f2f03f.ctex"]
[params]
compress/mode=0
compress/high_quality=false
compress/lossy_quality=0.7
compress/hdr_compression=1
compress/normal_map=0
compress/channel_pack=0
mipmaps/generate=false
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=1
svg/scale=1.0
editor/scale_with_editor_scale=false
editor/convert_colors_with_editor_theme=false

View file

@ -0,0 +1,3 @@
<svg width="64" height="64" viewBox="0 0 64 64" fill="none" xmlns="http://www.w3.org/2000/svg">
<path d="M39.2002 10.4004C46.3578 10.4004 52.1602 15.615 52.1602 22.0474C52.1602 25.3918 50.5917 28.4069 48.0799 30.5311C49.3195 31.9721 49.2802 33.6462 49.2802 35.42L60.8002 28.518V54.4003L49.2802 47.4984V49.2239C49.2802 52.0828 46.7013 54.4003 43.5202 54.4003H17.6002C14.419 54.4003 11.8402 52.0828 11.8402 49.2239V40.7964C6.80656 39.1976 3.2002 34.8833 3.2002 29.8121C3.2002 23.3796 9.00258 18.1651 16.1602 18.1651C20.237 18.1651 23.8741 19.8569 26.2499 22.5017C26.1635 20.4783 26.6749 18.4492 27.6869 16.6948C29.8438 12.9554 34.19 10.4004 39.2002 10.4004Z" fill="#8DA5F3"/>
</svg>

After

Width:  |  Height:  |  Size: 681 B

View file

@ -0,0 +1,37 @@
[remap]
importer="texture"
type="CompressedTexture2D"
uid="uid://ccnsrg8hq74p2"
path="res://.godot/imported/Camera2DIcon.svg-300e6f57281180711c5ecf391104d4ba.ctex"
metadata={
"vram_texture": false
}
[deps]
source_file="res://addons/phantom_camera/icons/viewfinder/Camera2DIcon.svg"
dest_files=["res://.godot/imported/Camera2DIcon.svg-300e6f57281180711c5ecf391104d4ba.ctex"]
[params]
compress/mode=0
compress/high_quality=false
compress/lossy_quality=0.7
compress/hdr_compression=1
compress/normal_map=0
compress/channel_pack=0
mipmaps/generate=false
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=1
svg/scale=1.0
editor/scale_with_editor_scale=false
editor/convert_colors_with_editor_theme=false

View file

@ -0,0 +1,3 @@
<svg width="64" height="64" viewBox="0 0 64 64" fill="none" xmlns="http://www.w3.org/2000/svg">
<path d="M39.2002 10.4004C46.3578 10.4004 52.1602 15.615 52.1602 22.0474C52.1602 25.3918 50.5917 28.4069 48.0799 30.5311C49.3195 31.9721 49.2802 33.6462 49.2802 35.42L60.8002 28.518V54.4003L49.2802 47.4984V49.2239C49.2802 52.0828 46.7013 54.4003 43.5202 54.4003H17.6002C14.419 54.4003 11.8402 52.0828 11.8402 49.2239V40.7964C6.80656 39.1976 3.2002 34.8833 3.2002 29.8121C3.2002 23.3796 9.00258 18.1651 16.1602 18.1651C20.237 18.1651 23.8741 19.8569 26.2499 22.5017C26.1635 20.4783 26.6749 18.4492 27.6869 16.6948C29.8438 12.9554 34.19 10.4004 39.2002 10.4004Z" fill="#FC7F7F"/>
</svg>

After

Width:  |  Height:  |  Size: 681 B

View file

@ -0,0 +1,37 @@
[remap]
importer="texture"
type="CompressedTexture2D"
uid="uid://dkiefpjsrj37n"
path="res://.godot/imported/Camera3DIcon.svg-4805c46004db1c89cc9443dd740693f5.ctex"
metadata={
"vram_texture": false
}
[deps]
source_file="res://addons/phantom_camera/icons/viewfinder/Camera3DIcon.svg"
dest_files=["res://.godot/imported/Camera3DIcon.svg-4805c46004db1c89cc9443dd740693f5.ctex"]
[params]
compress/mode=0
compress/high_quality=false
compress/lossy_quality=0.7
compress/hdr_compression=1
compress/normal_map=0
compress/channel_pack=0
mipmaps/generate=false
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=1
svg/scale=1.0
editor/scale_with_editor_scale=false
editor/convert_colors_with_editor_theme=false

View file

@ -0,0 +1,4 @@
<svg width="148" height="64" viewBox="0 0 148 64" fill="none" xmlns="http://www.w3.org/2000/svg">
<path d="M43.1201 20.605V27.7013C43.1201 29.3783 45.0599 30.3107 46.3695 29.263L59.9304 18.4143C60.9313 17.6136 60.9313 16.0914 59.9304 15.2908L46.3695 4.44202C45.0599 3.3944 43.1201 4.32674 43.1201 6.00375V13.1L13.1 13.1L13.1 43.1201H6.00376C4.32674 43.1201 3.3944 45.0599 4.44202 46.3695L15.2908 59.9304C16.0914 60.9313 17.6136 60.9313 18.4143 59.9304L29.2631 46.3695C30.3107 45.0599 29.3783 43.1201 27.7013 43.1201H20.605V20.605L43.1201 20.605Z" fill="#F5F5F5"/>
<path d="M104.605 21.561H111.701C113.378 21.561 114.311 19.6211 113.263 18.3116L102.414 4.75061C101.614 3.7498 100.091 3.7498 99.2908 4.75061L88.442 18.3116C87.3944 19.6211 88.3267 21.561 90.0038 21.561H97.1V53.4576H127.12V58.6773C127.12 60.3543 129.06 61.2867 130.369 60.239L143.93 49.3903C144.931 48.5896 144.931 47.0674 143.93 46.2668L130.369 35.418C129.06 34.3704 127.12 35.3027 127.12 36.9797V45.9525H109.912L129.707 26.1573L134.148 30.598C135.334 31.7838 137.365 31.0714 137.55 29.4046L139.468 12.1443C139.609 10.8705 138.533 9.79417 137.259 9.9357L119.999 11.8535C118.332 12.0387 117.62 14.0697 118.805 15.2555L124.4 20.8504L104.605 40.6457V21.561Z" fill="#F5F5F5"/>
</svg>

After

Width:  |  Height:  |  Size: 1.2 KiB

View file

@ -0,0 +1,37 @@
[remap]
importer="texture"
type="CompressedTexture2D"
uid="uid://dk7omm0x44suj"
path="res://.godot/imported/SceneTypesIcon.svg-66e2255bd3398007bec03a5cbfa4d0aa.ctex"
metadata={
"vram_texture": false
}
[deps]
source_file="res://addons/phantom_camera/icons/viewfinder/SceneTypesIcon.svg"
dest_files=["res://.godot/imported/SceneTypesIcon.svg-66e2255bd3398007bec03a5cbfa4d0aa.ctex"]
[params]
compress/mode=0
compress/high_quality=false
compress/lossy_quality=0.7
compress/hdr_compression=1
compress/normal_map=0
compress/channel_pack=0
mipmaps/generate=false
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=1
svg/scale=1.0
editor/scale_with_editor_scale=false
editor/convert_colors_with_editor_theme=false

View file

@ -0,0 +1,46 @@
@tool
extends EditorInspectorPlugin
#var _phantom_camera_script: Script = preload("res://addons/phantom_camera/scripts/phantom_camera.gd")
# TODO - Enable again once work is resumed for inspector based tasks
#func _can_handle(object) -> bool:
# return object is _phantom_camera_script
func _parse_category(object: Object, category: String) -> void:
var _margin_container: MarginContainer = MarginContainer.new()
var _margin_v: float = 20
_margin_container.add_theme_constant_override("margin_left", 10)
_margin_container.add_theme_constant_override("margin_top", _margin_v)
_margin_container.add_theme_constant_override("margin_right", 10)
_margin_container.add_theme_constant_override("margin_bottom", _margin_v)
add_custom_control(_margin_container)
var _vbox_container: VBoxContainer = VBoxContainer.new()
_margin_container.add_child(_vbox_container)
var align_with_view_button = Button.new()
align_with_view_button.connect("pressed", _align_camera_with_view.bind(object))
align_with_view_button.set_custom_minimum_size(Vector2(0, 60))
align_with_view_button.set_text("Align with view")
_vbox_container.add_child(align_with_view_button)
var preview_camera_button = Button.new()
preview_camera_button.connect("pressed", _preview_camera.bind(object))
preview_camera_button.set_custom_minimum_size(Vector2(0, 60))
preview_camera_button.set_text("Preview Camera")
_vbox_container.add_child(preview_camera_button)
func _align_camera_with_view(object: Object) -> void:
print("Aligning camera with view")
print(object)
func _preview_camera(object: Object) -> void:
print("Previewing camera")
print(object)

View file

@ -0,0 +1,7 @@
[plugin]
name="Phantom Camera"
description="Control the movement and dynamically tween 2D & 3D cameras positions. Built for Godot 4. Inspired by Cinemachine."
author="Marcus Skov"
version="0.5.0.5"
script="plugin.gd"

View file

@ -0,0 +1,54 @@
@tool
extends EditorPlugin
const PCAM_HOST: String = "PhantomCameraHost"
const PCAM_2D: String = "PhantomCamera2D"
const PCAM_3D: String = "PhantomCamera3D"
const Pcam3DPlugin = preload("res://addons/phantom_camera/gizmos/phantom_camera_gizmo_plugin_3D.gd")
var pcam_3D_gizmo_plugin = Pcam3DPlugin.new()
const FramedViewPanel = preload("res://addons/phantom_camera/framed_viewfinder/framed_viewfinder_panel.tscn")
var framed_viewfinder_panel_instance
func _enter_tree() -> void:
# Phantom Camera Nodes
add_custom_type(PCAM_2D, "Node2D", preload("res://addons/phantom_camera/scripts/phantom_camera/phantom_camera_2D.gd"), preload("res://addons/phantom_camera/icons/PhantomCameraIcon2D.svg"))
add_custom_type(PCAM_3D, "Node3D", preload("res://addons/phantom_camera/scripts/phantom_camera/phantom_camera_3D.gd"), preload("res://addons/phantom_camera/icons/PhantomCameraIcon3D.svg"))
add_custom_type(PCAM_HOST, "Node", preload("res://addons/phantom_camera/scripts/phantom_camera_host/phantom_camera_host.gd"), preload("res://addons/phantom_camera/icons/PhantomCameraHostIcon.svg"))
# Phantom Camera 3D Gizmo
add_node_3d_gizmo_plugin(pcam_3D_gizmo_plugin)
# Viewfinder
framed_viewfinder_panel_instance = FramedViewPanel.instantiate()
framed_viewfinder_panel_instance.editor_interface = get_editor_interface()
add_control_to_bottom_panel(framed_viewfinder_panel_instance, "Phantom Camera")
_make_visible(false)
connect("scene_changed", _scene_changed)
func _exit_tree() -> void:
remove_custom_type(PCAM_2D)
remove_custom_type(PCAM_3D)
remove_node_3d_gizmo_plugin(pcam_3D_gizmo_plugin)
remove_control_from_bottom_panel(framed_viewfinder_panel_instance)
framed_viewfinder_panel_instance.queue_free()
# if framed_viewfinder_panel_instance:
disconnect("scene_changed", _scene_changed)
#func _has_main_screen():
# return true;
func _make_visible(visible):
if framed_viewfinder_panel_instance:
framed_viewfinder_panel_instance.set_visible(visible)
func _scene_changed(scene_root: Node) -> void:
framed_viewfinder_panel_instance.scene_changed(scene_root)

View file

@ -0,0 +1,5 @@
@tool
extends RefCounted
const PCAM_GROUP_NAME: StringName = "phantom_camera_group"
const PCAM_HOST_GROUP_NAME: StringName = "phantom_camera_host_group"

View file

@ -0,0 +1,477 @@
@tool
@icon("res://addons/phantom_camera/icons/PhantomCameraIcon2D.svg")
class_name PhantomCamera2D
extends Node2D
const Constants = preload("res://addons/phantom_camera/scripts/phantom_camera/phantom_camera_constants.gd")
var Properties = preload("res://addons/phantom_camera/scripts/phantom_camera/phantom_camera_properties.gd").new()
const FOLLOW_GROUP_ZOOM_AUTO: StringName = Constants.FOLLOW_PARAMETERS_NAME + "auto_zoom"
const FOLLOW_GROUP_ZOOM_MIN: StringName = Constants.FOLLOW_PARAMETERS_NAME + "min_zoom"
const FOLLOW_GROUP_ZOOM_MAX: StringName = Constants.FOLLOW_PARAMETERS_NAME + "max_zoom"
const FOLLOW_GROUP_ZOOM_MARGIN: StringName = Constants.FOLLOW_PARAMETERS_NAME + "zoom_margin"
var follow_group_zoom_auto: bool
var follow_group_zoom_min: float = 1
var follow_group_zoom_max: float = 5
var follow_group_zoom_margin: Vector4
var _camera_offset: Vector2
func _get_property_list() -> Array:
var property_list: Array[Dictionary]
property_list.append_array(Properties.add_priority_properties())
property_list.append({
"name": Constants.ZOOM_PROPERTY_NAME,
"type": TYPE_VECTOR2,
"hint": PROPERTY_HINT_NONE,
"usage": PROPERTY_USAGE_DEFAULT
})
property_list.append_array(Properties.add_follow_mode_property())
if Properties.follow_mode != Constants.FollowMode.NONE:
property_list.append_array(Properties.add_follow_target_property())
if Properties.follow_mode == Constants.FollowMode.GROUP:
property_list.append({
"name": FOLLOW_GROUP_ZOOM_AUTO,
"type": TYPE_BOOL,
"hint": PROPERTY_HINT_NONE,
"usage": PROPERTY_USAGE_DEFAULT,
})
if follow_group_zoom_auto:
property_list.append({
"name": FOLLOW_GROUP_ZOOM_MIN,
"type": TYPE_FLOAT,
"hint": PROPERTY_HINT_RANGE,
"hint_string": "0.01, 100, 0.01,",
"usage": PROPERTY_USAGE_DEFAULT,
})
property_list.append({
"name": FOLLOW_GROUP_ZOOM_MAX,
"type": TYPE_FLOAT,
"hint": PROPERTY_HINT_RANGE,
"hint_string": "0.01, 100, 0.01,",
"usage": PROPERTY_USAGE_DEFAULT,
})
property_list.append({
"name": FOLLOW_GROUP_ZOOM_MARGIN,
"type": TYPE_VECTOR4,
"hint": PROPERTY_HINT_RANGE,
"hint_string": "0, 100, 0.01,",
"usage": PROPERTY_USAGE_DEFAULT,
})
if Properties.follow_has_target || Properties.has_follow_group:
property_list.append_array(Properties.add_follow_properties())
property_list.append_array(Properties.add_follow_framed())
property_list.append_array(Properties.add_tween_properties())
property_list.append_array(Properties.add_secondary_properties())
return property_list
func _set(property: StringName, value) -> bool:
Properties.set_priority_property(property, value, self)
# ZOOM
if property == Constants.ZOOM_PROPERTY_NAME:
if value.x == 0:
Properties.zoom.x = 0.001
else:
Properties.zoom.x = value.x
if value.y == 0:
Properties.zoom.y = 0.001
else:
Properties.zoom.y = value.y
# ZOOM CLAMP
if property == FOLLOW_GROUP_ZOOM_AUTO:
follow_group_zoom_auto = value
notify_property_list_changed()
if property == FOLLOW_GROUP_ZOOM_MIN:
if value > 0:
follow_group_zoom_min = value
else:
follow_group_zoom_min = 0
if property == FOLLOW_GROUP_ZOOM_MAX:
if value > 0:
follow_group_zoom_max = value
else:
follow_group_zoom_max = 0
if property == FOLLOW_GROUP_ZOOM_MARGIN:
follow_group_zoom_margin = value
Properties.set_follow_properties(property, value, self)
Properties.set_tween_properties(property, value, self)
Properties.set_secondary_properties(property, value, self)
return false
func _get(property: StringName):
if property == Constants.PRIORITY_PROPERTY_NAME: return Properties.priority
if property == Constants.ZOOM_PROPERTY_NAME: return Properties.zoom
if property == Constants.FOLLOW_MODE_PROPERTY_NAME: return Properties.follow_mode
if property == Constants.FOLLOW_TARGET_OFFSET_PROPERTY_NAME: return Properties.follow_target_offset_2D
if property == Constants.FOLLOW_TARGET_PROPERTY_NAME: return Properties.follow_target_path
if property == Constants.FOLLOW_GROUP_PROPERTY_NAME: return Properties.follow_group_paths
if property == Constants.FOLLOW_PATH_PROPERTY_NAME: return Properties.follow_path_path
if property == Constants.FOLLOW_FRAMED_DEAD_ZONE_HORIZONTAL_NAME: return Properties.follow_framed_dead_zone_width
if property == Constants.FOLLOW_FRAMED_DEAD_ZONE_VERTICAL_NAME: return Properties.follow_framed_dead_zone_height
if property == Constants.FOLLOW_VIEWFINDER_IN_PLAY_NAME: return Properties.show_viewfinder_in_play
if property == FOLLOW_GROUP_ZOOM_AUTO: return follow_group_zoom_auto
if property == FOLLOW_GROUP_ZOOM_MIN: return follow_group_zoom_min
if property == FOLLOW_GROUP_ZOOM_MAX: return follow_group_zoom_max
if property == FOLLOW_GROUP_ZOOM_MARGIN: return follow_group_zoom_margin
if property == Constants.FOLLOW_DAMPING_NAME: return Properties.follow_has_damping
if property == Constants.FOLLOW_DAMPING_VALUE_NAME: return Properties.follow_damping_value
if property == Constants.TWEEN_RESOURCE_PROPERTY_NAME: return Properties.tween_resource
if property == Constants.INACTIVE_UPDATE_MODE_PROPERTY_NAME: return Properties.inactive_update_mode
if property == Constants.TWEEN_ONLOAD_NAME: return Properties.tween_onload
###################
# Private Functions
###################
func _enter_tree() -> void:
Properties.is_2D = true
Properties.camera_enter_tree(self)
Properties.assign_pcam_host(self)
func _exit_tree() -> void:
if Properties.pcam_host_owner:
Properties.pcam_host_owner.pcam_removed_from_scene(self)
Properties.pcam_exit_tree(self)
func _physics_process(delta: float) -> void:
# print(follow_group_zoom_margin)
if not Properties.is_active:
match Properties.inactive_update_mode:
Constants.InactiveUpdateMode.NEVER:
return
# Constants.InactiveUpdateMode.EXPONENTIALLY:
# TODO
if not Properties.should_follow: return
match Properties.follow_mode:
Constants.FollowMode.GLUED:
if Properties.follow_target_node:
_interpolate_position(Properties.follow_target_node.position, delta)
Constants.FollowMode.SIMPLE:
if Properties.follow_target_node:
_interpolate_position(_target_position_with_offset(), delta)
Constants.FollowMode.GROUP:
if Properties.has_follow_group:
if Properties.follow_group_nodes_2D.size() == 1:
_interpolate_position(Properties.follow_group_nodes_2D[0].get_global_position(), delta)
else:
var rect: Rect2 = Rect2(Properties.follow_group_nodes_2D[0].get_global_position(), Vector2.ZERO)
for node in Properties.follow_group_nodes_2D:
rect = rect.expand(node.get_global_position())
if follow_group_zoom_auto:
rect = rect.grow_individual(
follow_group_zoom_margin.x,
follow_group_zoom_margin.y,
follow_group_zoom_margin.z,
follow_group_zoom_margin.w)
# else:
# rect = rect.grow_individual(-80, 0, 0, 0)
if follow_group_zoom_auto:
var screen_size: Vector2 = get_viewport_rect().size
if rect.size.x > rect.size.y * screen_size.aspect():
Properties.zoom = clamp(screen_size.x / rect.size.x, follow_group_zoom_min, follow_group_zoom_max) * Vector2.ONE
else:
Properties.zoom = clamp(screen_size.y / rect.size.y, follow_group_zoom_min, follow_group_zoom_max) * Vector2.ONE
_interpolate_position(rect.get_center(), delta)
Constants.FollowMode.PATH:
if Properties.follow_target_node and Properties.follow_path_node:
var path_position: Vector2 = Properties.follow_path_node.get_global_position()
_interpolate_position(
Properties.follow_path_node.curve.get_closest_point(
Properties.follow_target_node.get_global_position() - path_position
) + path_position, \
delta)
Constants.FollowMode.FRAMED:
if Properties.follow_target_node:
if not Engine.is_editor_hint():
Properties.viewport_position = (get_follow_target_node().get_global_transform_with_canvas().get_origin() + Properties.follow_target_offset_2D) / get_viewport_rect().size
if Properties.get_framed_side_offset() != Vector2.ZERO:
var glo_pos: Vector2
var target_position: Vector2 = _target_position_with_offset() + _camera_offset
var dead_zone_width: float = Properties.follow_framed_dead_zone_width
var dead_zone_height: float = Properties.follow_framed_dead_zone_height
if dead_zone_width == 0 || dead_zone_height == 0:
if dead_zone_width == 0 && dead_zone_height != 0:
_interpolate_position(_target_position_with_offset(), delta)
elif dead_zone_width != 0 && dead_zone_height == 0:
glo_pos = _target_position_with_offset()
glo_pos.x += target_position.x - global_position.x
_interpolate_position(glo_pos, delta)
else:
_interpolate_position(_target_position_with_offset(), delta)
else:
_interpolate_position(target_position, delta)
else:
_camera_offset = global_position - _target_position_with_offset()
else:
set_global_position(_target_position_with_offset())
func _target_position_with_offset() -> Vector2:
return Properties.follow_target_node.get_global_position() + Properties.follow_target_offset_2D
func _interpolate_position(position: Vector2, delta: float, target: Node2D = self) -> void:
if Properties.follow_has_damping:
target.set_global_position(
target.get_global_position().lerp(
position,
delta * Properties.follow_damping_value
)
)
else:
target.set_global_position(position)
##################
# Public Functions
##################
## Assigns the PhantomCamera2D to a new PhantomCameraHost.
func assign_pcam_host() -> void:
Properties.assign_pcam_host(self)
## Gets the current PhantomCameraHost this PhantomCamera2D is assigned to.
func get_pcam_host_owner() -> PhantomCameraHost:
return Properties.pcam_host_owner
## Assigns new Zoom value.
func set_zoom(value: Vector2) -> void:
Properties.zoom = value
## Gets current Zoom value.
func get_zoom() -> Vector2:
return Properties.zoom
## Assigns new Priority value.
func set_priority(value: int) -> void:
Properties.set_priority(value, self)
## Gets current Priority value.
func get_priority() -> int:
return Properties.priority
## Assigns a new PhantomCameraTween resource to the PhantomCamera2D
func set_tween_resource(value: PhantomCameraTween) -> void:
Properties.tween_resource = value
## Gets the PhantomCameraTween resource assigned to the PhantomCamera2D
## Returns null if there's nothing assigned to it.
func get_tween_resource() -> PhantomCameraTween:
return Properties.tween_resource
## Assigns a new Tween Duration value. The duration value is in seconds.
## Note: This will override and make the Tween Resource unique to this PhantomCamera2D.
func set_tween_duration(value: float) -> void:
if get_tween_resource():
Properties.tween_resource_default.duration = value
Properties.tween_resource_default.transition = Properties.tween_resource.transition
Properties.tween_resource_default.ease = Properties.tween_resource.ease
set_tween_resource(null) # Clears resource from PCam instance
else:
Properties.tween_resource_default.duration = value
## Gets the current Tween Duration value. The duration value is in seconds.
func get_tween_duration() -> float:
if get_tween_resource():
return get_tween_resource().duration
else:
return Properties.tween_resource_default.duration
## Assigns a new Tween Transition value.
## Note: This will override and make the Tween Resource unique to this PhantomCamera2D.
func set_tween_transition(value: Constants.TweenTransitions) -> void:
if get_tween_resource():
Properties.tween_resource_default.duration = Properties.tween_resource.duration
Properties.tween_resource_default.transition = value
Properties.tween_resource_default.ease = Properties.tween_resource.ease
set_tween_resource(null) # Clears resource from PCam instance
else:
Properties.tween_resource_default.transition = value
## Gets the current Tween Transition value.
func get_tween_transition() -> int:
if get_tween_resource():
return get_tween_resource().transition
else:
return Properties.tween_resource_default.transition
## Assigns a new Tween Ease value.
## Note: This will override and make the Tween Resource unique to this PhantomCamera2D.
func set_tween_ease(value: Constants.TweenEases) -> void:
if get_tween_resource():
Properties.tween_resource_default.duration = Properties.tween_resource.duration
Properties.tween_resource_default.transition = Properties.tween_resource.ease
Properties.tween_resource_default.ease = value
set_tween_resource(null) # Clears resource from PCam instance
else:
Properties.tween_resource_default.ease = value
## Gets the current Tween Ease value.
func get_tween_ease() -> int:
if get_tween_resource():
return get_tween_resource().ease
else:
return Properties.tween_resource_default.ease
## Gets current active state of the PhantomCamera2D.
## If it returns true, it means the PhantomCamera2D is what the Camera2D is currently following.
func is_active() -> bool:
return Properties.is_active
## Enables or disables the Tween on Load.
func set_tween_on_load(value: bool) -> void:
Properties.tween_onload = value
## Gets the current Tween On Load value.
func is_tween_on_load() -> bool:
return Properties.tween_onload
## Gets the current follow mode as an enum int based on Constants.FOLLOW_MODE enum.
## Note: Setting Follow Mode purposely not added. A separate PCam should be used instead.
func get_follow_mode() -> int:
return Properties.follow_mode
## Assigns a new Node2D as the Follow Target property.
func set_follow_target_node(value: Node2D) -> void:
Properties.follow_target_node = value
Properties.should_follow = true
## Erases the current Node2D from the Follow Target property.
func erase_follow_target_node() -> void:
Properties.should_follow = false
Properties.follow_target_node = null
## Gets the current Node2D target property.
func get_follow_target_node():
if Properties.follow_target_node:
return Properties.follow_target_node
else:
printerr("No Follow Target Node assigned")
## Assigns a new Path2D to the Follow Path property.
func set_follow_path(value: Path2D) -> void:
Properties.follow_path_node = value
## Erases the current Path2D from the Follow Path property.
func erase_follow_path() -> void:
Properties.follow_path_node = null
## Gets the current Path2D from the Follow Path property.
func get_follow_path():
if Properties.follow_path_node:
return Properties.follow_path_node
else:
printerr("No Follow Path assigned")
## Assigns a new Vector2 for the Follow Target Offset property.
func set_follow_target_offset(value: Vector2) -> void:
Properties.follow_target_offset_2D = value
## Gets the current Vector2 for the Follow Target Offset property.
func get_follow_target_offset() -> Vector2:
return Properties.follow_target_offset_2D
## Enables or disables Follow Damping.
func set_follow_has_damping(value: bool) -> void:
Properties.follow_has_damping = value
## Gets the currents Follow Damping property.
func get_follow_has_damping() -> bool:
return Properties.follow_has_damping
## Assigns new Damping value.
func set_follow_damping_value(value: float) -> void:
Properties.follow_damping_value = value
## Gets the currents Follow Damping value.
func get_follow_damping_value() -> float:
return Properties.follow_damping_value
## Adds a single Node2D to Follow Group array.
func append_follow_group_node(value: Node2D) -> void:
if not Properties.follow_group_nodes_2D.has(value):
Properties.follow_group_nodes_2D.append(value)
Properties.should_follow = true
Properties.has_follow_group = true
else:
printerr(value, " is already part of Follow Group")
## Adds an Array of type Node2D to Follow Group array.
func append_follow_group_node_array(value: Array[Node2D]) -> void:
for val in value:
if not Properties.follow_group_nodes_2D.has(val):
Properties.follow_group_nodes_2D.append(val)
Properties.should_follow = true
Properties.has_follow_group = true
else:
printerr(val, " is already part of Follow Group")
## Removes Node2D from Follow Group array.
func erase_follow_group_node(value: Node2D) -> void:
Properties.follow_group_nodes_2D.erase(value)
if Properties.follow_group_nodes_2D.size() < 1:
Properties.should_follow = false
Properties.has_follow_group = false
## Gets all Node2D from Follow Group array.
func get_follow_group_nodes() -> Array[Node2D]:
return Properties.follow_group_nodes_2D
## Enables or disables Auto zoom when using Group Follow.
func set_auto_zoom(value: bool) -> void:
follow_group_zoom_auto = value
## Gets Auto Zoom state.
func get_auto_zoom() -> bool:
return follow_group_zoom_auto
## Assigns new Min Auto Zoom value.
func set_min_auto_zoom(value: float) -> void:
follow_group_zoom_min = value
## Gets Min Auto Zoom value.
func get_min_auto_zoom() -> float:
return follow_group_zoom_min
## Assigns new Max Auto Zoom value.
func set_max_auto_zoom(value: float) -> void:
follow_group_zoom_max = value
## Gets Max Auto Zoom value.
func get_max_auto_zoom() -> float:
return follow_group_zoom_max
## Assigns new Zoom Auto Margin value.
func set_zoom_auto_margin(value: Vector4) -> void:
follow_group_zoom_margin = value
## Gets Zoom Auto Margin value.
func get_zoom_auto_margin() -> Vector4:
return follow_group_zoom_margin
## Gets Interactive Update Mode property.
func get_inactive_update_mode() -> String:
return Constants.InactiveUpdateMode.keys()[Properties.inactive_update_mode].capitalize()

File diff suppressed because it is too large Load diff

View file

@ -0,0 +1,87 @@
@tool
extends RefCounted
const PhantomCameraHost: Script = preload("res://addons/phantom_camera/scripts/phantom_camera_host/phantom_camera_host.gd")
# Values
const CAMERA_2D_NODE_NAME: StringName = "Camera2D"
const CAMERA_3D_NODE_NAME: StringName = "Camera3D"
const PCAM_HOST_NODE_NAME: StringName = "PhantomCameraHost"
const PCAM_2D_NODE_NAME: StringName = "PhantomCamera2D"
const PCAM_3D_NODE_NAME: StringName = "PhantomCamera3D"
const COLOR_2D: Color = Color("8DA5F3")
const COLOR_3D: Color = Color("FC7F7F")
const COLOR_PCAM: Color = Color("3AB99A")
const PCAM_HOST_COLOR: Color = Color("E0E0E0")
# Primary
const PRIORITY_PROPERTY_NAME: StringName = "priority"
const PRIORITY_OVERRIDE: StringName = "priority_override"
const PCAM_HOST: StringName = "phantom_camera_host"
# Follow
const FOLLOW_MODE_PROPERTY_NAME: StringName = "follow_mode"
const FOLLOW_TARGET_PROPERTY_NAME: StringName = "follow_target"
const FOLLOW_GROUP_PROPERTY_NAME: StringName = "follow_group"
const FOLLOW_PATH_PROPERTY_NAME: StringName = "follow_path"
const FOLLOW_PARAMETERS_NAME: StringName = "follow_parameters/"
# Follow Parameters
const FOLLOW_DISTANCE_PROPERTY_NAME: StringName = FOLLOW_PARAMETERS_NAME + "distance"
const FOLLOW_DAMPING_NAME: StringName = FOLLOW_PARAMETERS_NAME + "damping"
const FOLLOW_DAMPING_VALUE_NAME: StringName = FOLLOW_PARAMETERS_NAME + "damping_value"
const FOLLOW_TARGET_OFFSET_PROPERTY_NAME: StringName = FOLLOW_PARAMETERS_NAME + "target_offset"
const FOLLOW_FRAMED_DEAD_ZONE_HORIZONTAL_NAME: StringName = FOLLOW_PARAMETERS_NAME + "dead_zone_horizontal"
const FOLLOW_FRAMED_DEAD_ZONE_VERTICAL_NAME: StringName = FOLLOW_PARAMETERS_NAME + "dead_zone_vertical"
const FOLLOW_VIEWFINDER_IN_PLAY_NAME: StringName = FOLLOW_PARAMETERS_NAME + "viewfinder_in_play"
const DEAD_ZONE_CHANGED_SIGNAL: StringName = "dead_zone_changed"
#Zoom
const ZOOM_PROPERTY_NAME: StringName = "zoom"
# Tween Resource
const TWEEN_RESOURCE_PROPERTY_NAME: StringName = "tween_parameters"
# Secondary
const TWEEN_ONLOAD_NAME: StringName = "tween_on_load"
const INACTIVE_UPDATE_MODE_PROPERTY_NAME: StringName = "inactive_update_mode"
enum FollowMode {
NONE = 0,
GLUED = 1,
SIMPLE = 2,
GROUP = 3,
PATH = 4,
FRAMED = 5,
THIRD_PERSON = 6,
}
enum TweenTransitions {
LINEAR = 0,
SINE = 1,
QUINT = 2,
QUART = 3,
QUAD = 4,
EXPO = 5,
ELASTIC = 6,
CUBIC = 7,
CIRC = 8,
BOUNCE = 9,
BACK = 10,
# CUSTOM = 11,
# NONE = 12,
}
enum TweenEases {
EASE_IN = 0,
EASE_OUT = 1,
EASE_IN_OUT = 2,
EASE_OUT_IN = 3,
}
enum InactiveUpdateMode {
ALWAYS,
NEVER,
# EXPONENTIALLY,
}

View file

@ -0,0 +1,488 @@
@tool
extends RefCounted
const Constants: Script = preload("res://addons/phantom_camera/scripts/phantom_camera/phantom_camera_constants.gd")
const PcamGroupNames: Script = preload("res://addons/phantom_camera/scripts/group_names.gd")
var is_2D: bool
var pcam_host_owner: PhantomCameraHost
var scene_has_multiple_pcam_hosts: bool
var pcam_host_group: Array[Node]
var is_active: bool
var priority_override: bool
var priority: int = 0
var tween_onload: bool = true
var has_tweened_onload: bool = true
# Follow
var should_follow: bool
var has_follow_group: bool
var follow_target_node: Node
var follow_target_path: NodePath
var follow_has_target: bool
var follow_has_path_target: bool
var follow_path_node: Node
var follow_path_path: NodePath
var follow_mode: Constants.FollowMode = Constants.FollowMode.NONE
var follow_target_offset_2D: Vector2
var follow_target_offset_3D: Vector3
var follow_has_damping: bool
var follow_damping_value: float = 10
# Follow Group
var follow_group_nodes_2D: Array[Node2D]
var follow_group_nodes_3D: Array[Node3D]
var follow_group_paths: Array[NodePath]
# Framed Follow
signal dead_zone_changed
var follow_framed_dead_zone_width: float
var follow_framed_dead_zone_height: float
var follow_framed_initial_set: bool
var show_viewfinder_in_play: bool
var viewport_position: Vector2
var zoom: Vector2 = Vector2.ONE
var tween_resource: PhantomCameraTween
var tween_resource_default: PhantomCameraTween = PhantomCameraTween.new()
var inactive_update_mode: Constants.InactiveUpdateMode = Constants.InactiveUpdateMode.ALWAYS
func camera_enter_tree(pcam: Node):
pcam.add_to_group(PcamGroupNames.PCAM_GROUP_NAME)
if pcam.Properties.follow_target_path and \
not pcam.get_parent() is SpringArm3D and \
is_instance_valid(pcam.get_node(pcam.Properties.follow_target_path)):
pcam.Properties.follow_target_node = pcam.get_node(pcam.Properties.follow_target_path)
elif follow_group_paths:
if is_2D:
follow_group_nodes_2D.clear()
else:
follow_group_nodes_3D.clear()
for path in follow_group_paths:
if not path.is_empty() and pcam.get_node(path):
should_follow = true
has_follow_group = true
if is_2D:
follow_group_nodes_2D.append(pcam.get_node(path))
else:
follow_group_nodes_3D.append(pcam.get_node(path))
if pcam.Properties.follow_path_path:
pcam.Properties.follow_path_node = pcam.get_node(pcam.Properties.follow_path_path)
func pcam_exit_tree(pcam: Node):
pcam.remove_from_group(PcamGroupNames.PCAM_GROUP_NAME)
#########################
# Add Properties
#########################
func add_multiple_hosts_properties() -> Array:
var _property_list: Array
if scene_has_multiple_pcam_hosts:
_property_list.append({
"name": Constants.PCAM_HOST,
"type": TYPE_INT,
"hint": PROPERTY_HINT_ENUM,
"hint_string": ",".join(PackedStringArray(pcam_host_group)),
"usage": PROPERTY_USAGE_DEFAULT,
})
return _property_list
func add_priority_properties() -> Array:
var _property_list: Array
_property_list.append({
"name": Constants.PRIORITY_OVERRIDE,
"type": TYPE_BOOL,
})
_property_list.append({
"name": Constants.PRIORITY_PROPERTY_NAME,
"type": TYPE_INT,
"hint": PROPERTY_HINT_NONE,
"usage": PROPERTY_USAGE_DEFAULT,
})
return _property_list
func add_follow_mode_property() -> Array:
var _property_list: Array
var follow_mode_keys: Array = Constants.FollowMode.keys()
if is_2D:
follow_mode_keys.remove_at(Constants.FollowMode.THIRD_PERSON)
_property_list.append({
"name": Constants.FOLLOW_MODE_PROPERTY_NAME,
"type": TYPE_INT,
"hint": PROPERTY_HINT_ENUM,
"hint_string": ", ".join(PackedStringArray(follow_mode_keys)).capitalize(),
"usage": PROPERTY_USAGE_DEFAULT,
})
return _property_list
func add_follow_target_property() -> Array:
var _property_list: Array
if follow_mode == Constants.FollowMode.GROUP:
_property_list.append({
"name": Constants.FOLLOW_GROUP_PROPERTY_NAME,
"type": TYPE_ARRAY,
"hint": PROPERTY_HINT_TYPE_STRING,
"hint_string": TYPE_NODE_PATH,
"usage": PROPERTY_USAGE_DEFAULT,
})
else:
_property_list.append({
"name": Constants.FOLLOW_TARGET_PROPERTY_NAME,
"type": TYPE_NODE_PATH,
"hint": PROPERTY_HINT_NONE,
"usage": PROPERTY_USAGE_DEFAULT,
})
if follow_mode == Constants.FollowMode.PATH:
_property_list.append({
"name": Constants.FOLLOW_PATH_PROPERTY_NAME,
"type": TYPE_NODE_PATH,
"hint": PROPERTY_HINT_NONE,
"usage": PROPERTY_USAGE_DEFAULT,
})
return _property_list
func add_follow_properties() -> Array:
var _property_list: Array
if follow_mode != Constants.FollowMode.NONE:
if follow_mode == Constants.FollowMode.SIMPLE or \
follow_mode == Constants.FollowMode.GROUP or \
follow_mode == Constants.FollowMode.FRAMED or \
follow_mode == Constants.FollowMode.THIRD_PERSON:
if is_2D:
_property_list.append({
"name": Constants.FOLLOW_TARGET_OFFSET_PROPERTY_NAME,
"type": TYPE_VECTOR2,
"hint": PROPERTY_HINT_NONE,
"usage": PROPERTY_USAGE_DEFAULT,
})
else:
_property_list.append({
"name": Constants.FOLLOW_TARGET_OFFSET_PROPERTY_NAME,
"type": TYPE_VECTOR3,
"hint": PROPERTY_HINT_NONE,
"usage": PROPERTY_USAGE_DEFAULT,
})
if follow_mode != Constants.FollowMode.NONE:
_property_list.append({
"name": Constants.FOLLOW_DAMPING_NAME,
"type": TYPE_BOOL,
"hint": PROPERTY_HINT_NONE,
"usage": PROPERTY_USAGE_DEFAULT,
})
if follow_has_damping:
_property_list.append({
"name": Constants.FOLLOW_DAMPING_VALUE_NAME,
"type": TYPE_FLOAT,
"hint": PROPERTY_HINT_RANGE,
"hint_string": "0.01, 100, 0.01,",
"usage": PROPERTY_USAGE_DEFAULT,
})
return _property_list
func add_follow_framed() -> Array:
var _property_list: Array
if follow_mode == Constants.FollowMode.FRAMED:
_property_list.append({
"name": Constants.FOLLOW_FRAMED_DEAD_ZONE_HORIZONTAL_NAME,
"type": TYPE_FLOAT,
"hint": PROPERTY_HINT_RANGE,
"hint_string": "0, 1, 0.01,",
"usage": PROPERTY_USAGE_DEFAULT,
})
_property_list.append({
"name": Constants.FOLLOW_FRAMED_DEAD_ZONE_VERTICAL_NAME,
"type": TYPE_FLOAT,
"hint": PROPERTY_HINT_RANGE,
"hint_string": "0, 1, 0.01,",
"usage": PROPERTY_USAGE_DEFAULT,
})
_property_list.append({
"name": Constants.FOLLOW_VIEWFINDER_IN_PLAY_NAME,
"type": TYPE_BOOL,
"hint": PROPERTY_HINT_NONE,
"usage": PROPERTY_USAGE_DEFAULT
})
return _property_list
func add_tween_properties() -> Array:
var _property_list: Array
_property_list.append({
"name": Constants.TWEEN_RESOURCE_PROPERTY_NAME,
"type": TYPE_OBJECT,
"hint": PROPERTY_HINT_RESOURCE_TYPE,
"hint_string": "PhantomCameraTween"
})
return _property_list
func add_secondary_properties() -> Array:
var _property_list: Array
_property_list.append({
"name": Constants.TWEEN_ONLOAD_NAME,
"type": TYPE_BOOL,
"hint": PROPERTY_HINT_NONE,
"usage": PROPERTY_USAGE_DEFAULT
})
_property_list.append({
"name": Constants.INACTIVE_UPDATE_MODE_PROPERTY_NAME,
"type": TYPE_INT,
"hint": PROPERTY_HINT_ENUM,
"hint_string": ", ".join(PackedStringArray(Constants.InactiveUpdateMode.keys())).capitalize(),
})
return _property_list
#########################
# Set Properties
#########################
func set_phantom_host_property(property: StringName, value, pcam: Node):
if property == Constants.PCAM_HOST:
if value != null && value is int:
var host_node = instance_from_id(value)
pcam_host_owner = host_node
func set_priority_property(property: StringName, value, pcam: Node):
if Engine.is_editor_hint() and is_instance_valid(pcam_host_owner):
if property == Constants.PRIORITY_OVERRIDE:
if value == true:
priority_override = value
pcam_host_owner.pcam_priority_override(pcam)
else:
priority_override = value
pcam_host_owner.pcam_priority_updated(pcam)
pcam_host_owner.pcam_priority_override_disabled()
if property == Constants.PRIORITY_PROPERTY_NAME:
set_priority(value, pcam)
func set_follow_properties(property: StringName, value, pcam: Node):
if property == Constants.FOLLOW_MODE_PROPERTY_NAME:
follow_mode = value
if follow_mode != Constants.FollowMode.GROUP:
has_follow_group = false
if follow_mode == Constants.FollowMode.FRAMED:
follow_framed_initial_set = true
pcam.notify_property_list_changed()
# match value:
# Constants.FollowMode.NONE:
# set_process(pcam, false)
# _:
# set_process(pcam, true)
if property == Constants.FOLLOW_TARGET_PROPERTY_NAME:
if follow_mode != Constants.FollowMode.NONE:
should_follow = true
else:
should_follow = false
follow_target_path = value
var valueNodePath: NodePath = value as NodePath
if not valueNodePath.is_empty():
follow_has_target = true
if pcam.has_node(follow_target_path):
follow_target_node = pcam.get_node(follow_target_path)
else:
follow_has_target = false
follow_target_node = null
pcam.notify_property_list_changed()
if property == Constants.FOLLOW_PATH_PROPERTY_NAME:
follow_path_path = value
var valueNodePath: NodePath = value as NodePath
if not valueNodePath.is_empty():
follow_has_path_target = true
if pcam.has_node(follow_path_path):
follow_path_node = pcam.get_node(follow_path_path)
else:
follow_has_path_target = false
follow_path_node = null
pcam.notify_property_list_changed()
if property == Constants.FOLLOW_GROUP_PROPERTY_NAME:
if value and value.size() > 0:
# Clears the Array in case of reshuffling or updated Nodes
if is_2D:
follow_group_nodes_2D.clear()
else:
follow_group_nodes_3D.clear()
follow_group_paths = value as Array[NodePath]
if not follow_group_paths.is_empty():
for path in follow_group_paths:
if pcam.has_node(path):
should_follow = true
has_follow_group = true
var node: Node = pcam.get_node(path)
if node is Node2D or node is Node3D:
# Prevents duplicated nodes from being assigned to array
if is_2D:
if follow_group_nodes_2D.find(node):
follow_group_nodes_2D.append(node)
else:
if follow_group_nodes_3D.find(node):
follow_group_nodes_3D.append(node)
else:
printerr("Assigned non-Node3D to Follow Group")
pcam.notify_property_list_changed()
# Framed Follow
if property == Constants.FOLLOW_FRAMED_DEAD_ZONE_HORIZONTAL_NAME:
follow_framed_dead_zone_width = value
dead_zone_changed.emit()
if property == Constants.FOLLOW_FRAMED_DEAD_ZONE_VERTICAL_NAME:
follow_framed_dead_zone_height = value
dead_zone_changed.emit()
if property == Constants.FOLLOW_VIEWFINDER_IN_PLAY_NAME:
show_viewfinder_in_play = value
if property == Constants.FOLLOW_TARGET_OFFSET_PROPERTY_NAME:
if value is Vector3:
follow_target_offset_3D = value
else:
follow_target_offset_2D = value
if property == Constants.FOLLOW_DAMPING_NAME:
follow_has_damping = value
pcam.notify_property_list_changed()
if property == Constants.FOLLOW_DAMPING_VALUE_NAME:
follow_damping_value = value
func set_tween_properties(property: StringName, value, pcam: Node):
if property == Constants.TWEEN_RESOURCE_PROPERTY_NAME:
tween_resource = value
func set_secondary_properties(property: StringName, value, pcam: Node):
if property == Constants.TWEEN_ONLOAD_NAME:
tween_onload = value
if value == false:
has_tweened_onload = false
else:
has_tweened_onload = true
if property == Constants.INACTIVE_UPDATE_MODE_PROPERTY_NAME:
inactive_update_mode = value
func set_priority(value: int, pcam: Node) -> void:
if value < 0:
printerr("Phantom Camera's priority cannot be less than 0")
priority = 0
else:
priority = value
if pcam_host_owner:
pcam_host_owner.pcam_priority_updated(pcam)
# else:
## TODO - Add logic to handle Phantom Camera Host in scene
# printerr("Trying to change priority without a Phantom Camera Host - Please attached one to a Camera3D")
# pass
#########################
# Other Functions
#########################
func assign_pcam_host(pcam: Node) -> void:
pcam_host_group = pcam.get_tree().get_nodes_in_group(PcamGroupNames.PCAM_HOST_GROUP_NAME)
if pcam_host_group.size() == 1:
pcam_host_owner = pcam.Properties.pcam_host_group[0]
pcam_host_owner.pcam_added_to_scene(pcam)
# else:
# for camera_host in camera_host_group:
# print("Multiple PhantomCameraBases in scene")
# print(pcam_host_group)
# print(pcam.get_tree().get_nodes_in_group(PhantomCameraGroupNames.PHANTOM_CAMERA_HOST_GROUP_NAME))
# multiple_pcam_host_group.append(camera_host)
# return null
func toggle_priorty_override(pcam: Node) -> void:
if pcam_host_owner:
pcam_host_owner.pcam_priority_updated(pcam)
func assign_specific_pcam_host(pcam: Node, pcam_host: PhantomCameraHost) -> void:
pcam_host = pcam
func check_multiple_pcam_host_property(pcam: Node, multiple_host: bool = false) -> void:
if not multiple_host:
scene_has_multiple_pcam_hosts = false
else:
scene_has_multiple_pcam_hosts = true
pcam.notify_property_list_changed()
# pcam_host_group.append_array(host_group)
func get_framed_side_offset() -> Vector2:
var frame_out_bounds: Vector2
if viewport_position.x < 0.5 - follow_framed_dead_zone_width / 2:
# Is outside left edge
frame_out_bounds.x = -1
if viewport_position.y < 0.5 - follow_framed_dead_zone_height / 2:
# Is outside top edge
frame_out_bounds.y = 1
if viewport_position.x > 0.5 + follow_framed_dead_zone_width / 2:
# Is outside right edge
frame_out_bounds.x = 1
if viewport_position.y > 0.5001 + follow_framed_dead_zone_height / 2: # 0.501 to resolve an issue where the bottom vertical Dead Zone never becoming 0 when the Dead Zone Vertical parameter is set to 0
# Is outside bottom edge
frame_out_bounds.y = -1
return frame_out_bounds

View file

@ -0,0 +1,366 @@
@tool
@icon("res://addons/phantom_camera/icons/PhantomCameraHostIcon.svg")
class_name PhantomCameraHost
extends Node
const PcamGroupNames = preload("res://addons/phantom_camera/scripts/group_names.gd")
var _pcam_tween: Tween
var _tween_default_ease: Tween.EaseType
var _easing: Tween.TransitionType
var camera_2D: Camera2D
var camera_3D: Camera3D
var _pcam_list: Array[Node]
var _active_pcam: Node
var _active_pcam_priority: int = -1
var _active_pcam_missing: bool = true
var _active_pcam_has_damping: bool
var _prev_active_pcam_2D_transform: Transform2D
var _prev_active_pcam_3D_transform: Transform3D
var trigger_pcam_tween: bool
var tween_duration: float
var multiple_pcam_hosts: bool
var is_child_of_camera: bool = false
var _is_2D: bool
signal update_editor_viewfinder
var framed_viewfinder_scene = load("res://addons/phantom_camera/framed_viewfinder/framed_viewfinder_panel.tscn")
var framed_viewfinder_node: Control
var viewfinder_needed_check: bool = true
var camera_zoom: Vector2
var _prev_camera_h_offset: float
var _prev_camera_v_offset: float
var _prev_camera_fov: float
var _should_refresh_transform: bool
var _active_pcam_2D_glob_transform: Transform2D
var _active_pcam_3D_glob_transform: Transform3D
###################
# Private Functions
###################
func _enter_tree() -> void:
# camera = get_parent()
var parent = get_parent()
if parent is Camera2D or parent is Camera3D:
is_child_of_camera = true
if parent is Camera2D:
_is_2D = true
camera_2D = parent
else:
_is_2D = false
camera_3D = parent
add_to_group(PcamGroupNames.PCAM_HOST_GROUP_NAME)
# var already_multi_hosts: bool = multiple_pcam_hosts
_check_camera_host_amount()
if multiple_pcam_hosts:
printerr(
"Only one PhantomCameraHost can exist in a scene",
"\n",
"Multiple PhantomCameraHosts will be supported in https://github.com/MarcusSkov/phantom-camera/issues/26"
)
queue_free()
for pcam in _get_pcam_node_group():
if not multiple_pcam_hosts:
pcam_added_to_scene(pcam)
pcam.assign_pcam_host()
# else:
# pcam.Properties.check_multiple_pcam_host_property(pcam, pca,_host_group, true)
else:
printerr(name, " is not a child of a Camera2D or Camera3D")
func _exit_tree() -> void:
remove_from_group(PcamGroupNames.PCAM_HOST_GROUP_NAME)
_check_camera_host_amount()
for pcam in _get_pcam_node_group():
if not multiple_pcam_hosts:
pcam.Properties.check_multiple_pcam_host_property(pcam)
func _ready() -> void:
if not is_instance_valid(_active_pcam): return
if _is_2D:
_active_pcam_2D_glob_transform = _active_pcam.get_global_transform()
else:
_active_pcam_3D_glob_transform = _active_pcam.get_global_transform()
func _check_camera_host_amount():
if _get_pcam_host_group().size() > 1:
multiple_pcam_hosts = true
else:
multiple_pcam_hosts = false
func _assign_new_active_pcam(pcam: Node) -> void:
var no_previous_pcam: bool
if _active_pcam:
if _is_2D:
_prev_active_pcam_2D_transform = camera_2D.get_transform()
else:
_prev_active_pcam_3D_transform = camera_3D.get_transform()
_prev_camera_fov = camera_3D.get_fov()
_prev_camera_h_offset = camera_3D.get_h_offset()
_prev_camera_v_offset = camera_3D.get_v_offset()
_active_pcam.Properties.is_active = false
else:
no_previous_pcam = true
_active_pcam = pcam
_active_pcam_priority = pcam.get_priority()
_active_pcam_has_damping = pcam.Properties.follow_has_damping
_active_pcam.Properties.is_active = true
if _is_2D:
camera_zoom = camera_2D.get_zoom()
else:
if _active_pcam.get_camera_3D_resource():
camera_3D.set_cull_mask(_active_pcam.get_camera_cull_mask())
if no_previous_pcam:
if _is_2D:
_prev_active_pcam_2D_transform = _active_pcam.get_transform()
else:
_prev_active_pcam_3D_transform = _active_pcam.get_transform()
tween_duration = 0
trigger_pcam_tween = true
func _find_pcam_with_highest_priority() -> void:
for pcam in _pcam_list:
if pcam.get_priority() > _active_pcam_priority:
_assign_new_active_pcam(pcam)
_active_pcam_missing = false
func _tween_pcam(delta: float) -> void:
if _active_pcam.Properties.tween_onload == false && _active_pcam.Properties.has_tweened_onload == false:
trigger_pcam_tween = false
_reset_tween_on_load()
return
else:
_reset_tween_on_load()
tween_duration += delta
if _is_2D:
camera_2D.set_global_position(
_tween_interpolate_value(_prev_active_pcam_2D_transform.origin, _active_pcam_2D_glob_transform.origin)
)
camera_2D.set_zoom(
_tween_interpolate_value(camera_zoom, _active_pcam.Properties.zoom)
)
else:
camera_3D.set_global_position(
_tween_interpolate_value(_prev_active_pcam_3D_transform.origin, _active_pcam_3D_glob_transform.origin)
)
var prev_active_pcam_3D_basis = Quaternion(_prev_active_pcam_3D_transform.basis.orthonormalized())
camera_3D.set_quaternion(
Tween.interpolate_value(
prev_active_pcam_3D_basis, \
prev_active_pcam_3D_basis.inverse() * Quaternion(_active_pcam_3D_glob_transform.basis.orthonormalized()),
tween_duration, \
_active_pcam.get_tween_duration(), \
_active_pcam.get_tween_transition(),
_active_pcam.get_tween_ease(),
)
)
if _prev_camera_fov != _active_pcam.get_camera_fov() and _active_pcam.get_camera_3D_resource():
camera_3D.set_fov(
_tween_interpolate_value(_prev_camera_fov, _active_pcam.get_camera_fov())
)
if _prev_camera_h_offset != _active_pcam.get_camera_h_offset() and _active_pcam.get_camera_3D_resource():
camera_3D.set_h_offset(
_tween_interpolate_value(_prev_camera_h_offset, _active_pcam.get_camera_h_offset())
)
if _prev_camera_v_offset != _active_pcam.get_camera_v_offset() and _active_pcam.get_camera_3D_resource():
camera_3D.set_v_offset(
_tween_interpolate_value(_prev_camera_v_offset, _active_pcam.get_camera_v_offset())
)
func _tween_interpolate_value(from: Variant, to: Variant) -> Variant:
return Tween.interpolate_value(
from, \
to - from,
tween_duration, \
_active_pcam.get_tween_duration(), \
_active_pcam.get_tween_transition(),
_active_pcam.get_tween_ease(),
)
func _reset_tween_on_load() -> void:
for pcam in _get_pcam_node_group():
pcam.Properties.has_tweened_onload = true
if not _is_2D:
if _active_pcam.get_camera_3D_resource():
camera_3D.set_fov(_active_pcam.get_camera_fov())
camera_3D.set_h_offset(_active_pcam.get_camera_h_offset())
camera_3D.set_v_offset(_active_pcam.get_camera_v_offset())
func _pcam_follow(delta: float) -> void:
if not _active_pcam: return
if _is_2D:
camera_2D.set_global_transform(_active_pcam_2D_glob_transform)
if _active_pcam.Properties.has_follow_group:
if _active_pcam.Properties.follow_has_damping:
camera_2D.zoom = camera_2D.zoom.lerp(_active_pcam.Properties.zoom, delta * _active_pcam.Properties.follow_damping_value)
else:
camera_2D.set_zoom(_active_pcam.zoom)
else:
camera_2D.set_zoom(_active_pcam.Properties.zoom)
else:
camera_3D.set_global_transform(_active_pcam_3D_glob_transform)
func _refresh_transform() -> void:
if _is_2D:
_active_pcam_2D_glob_transform = _active_pcam.get_global_transform()
else:
_active_pcam_3D_glob_transform = _active_pcam.get_global_transform()
func _process_pcam(delta: float) -> void:
if _active_pcam_missing or not is_child_of_camera: return
if not trigger_pcam_tween:
_pcam_follow(delta)
if viewfinder_needed_check:
show_viewfinder_in_play()
viewfinder_needed_check = false
if Engine.is_editor_hint():
if not _is_2D:
if _active_pcam.get_camera_3D_resource():
camera_3D.set_fov(_active_pcam.get_camera_fov())
camera_3D.set_h_offset(_active_pcam.get_camera_h_offset())
camera_3D.set_v_offset(_active_pcam.get_camera_v_offset())
else:
if tween_duration < _active_pcam.get_tween_duration():
_tween_pcam(delta)
else:
tween_duration = 0
trigger_pcam_tween = false
show_viewfinder_in_play()
_pcam_follow(delta)
func show_viewfinder_in_play() -> void:
if _active_pcam.Properties.show_viewfinder_in_play:
if not Engine.is_editor_hint() && OS.has_feature("editor"): # Only appears when running in the editor
var canvas_layer: CanvasLayer = CanvasLayer.new()
get_tree().get_root().get_child(0).add_child(canvas_layer)
framed_viewfinder_node = framed_viewfinder_scene.instantiate()
canvas_layer.add_child(framed_viewfinder_node)
else:
if framed_viewfinder_node:
framed_viewfinder_node.queue_free()
func _get_pcam_node_group() -> Array[Node]:
return get_tree().get_nodes_in_group(PcamGroupNames.PCAM_GROUP_NAME)
func _get_pcam_host_group() -> Array[Node]:
return get_tree().get_nodes_in_group(PcamGroupNames.PCAM_HOST_GROUP_NAME)
func _process(delta):
if not is_instance_valid(_active_pcam): return
if _should_refresh_transform:
# _refresh_transform()
if _is_2D:
_active_pcam_2D_glob_transform = _active_pcam.get_global_transform()
else:
_active_pcam_3D_glob_transform = _active_pcam.get_global_transform()
_should_refresh_transform = false
_process_pcam(delta)
func _physics_process(delta: float) -> void:
_should_refresh_transform = true
##################
# Public Functions
##################
func pcam_added_to_scene(pcam: Node) -> void:
_pcam_list.append(pcam)
_find_pcam_with_highest_priority()
func pcam_removed_from_scene(pcam) -> void:
_pcam_list.erase(pcam)
if pcam == _active_pcam:
_active_pcam_missing = true
_active_pcam_priority = -1
_find_pcam_with_highest_priority()
func pcam_priority_updated(pcam: Node) -> void:
if Engine.is_editor_hint() and _active_pcam.Properties.priority_override: return
if not is_instance_valid(pcam): return
var current_pcam_priority: int = pcam.get_priority()
if current_pcam_priority >= _active_pcam_priority and pcam != _active_pcam:
_assign_new_active_pcam(pcam)
elif pcam == _active_pcam:
if current_pcam_priority <= _active_pcam_priority:
_active_pcam_priority = current_pcam_priority
_find_pcam_with_highest_priority()
else:
_active_pcam_priority = current_pcam_priority
func pcam_priority_override(pcam: Node) -> void:
if Engine.is_editor_hint() and _active_pcam.Properties.priority_override:
_active_pcam.Properties.priority_override = false
_assign_new_active_pcam(pcam)
update_editor_viewfinder.emit()
func pcam_priority_override_disabled() -> void:
update_editor_viewfinder.emit()
func get_active_pcam() -> Node:
return _active_pcam

View file

@ -0,0 +1,14 @@
class_name Camera3DResource
extends Resource
## The time it takes to tween to this property
@export_flags_3d_physics var cull_mask: int = 1048575
## Horizontally offsets the Camera3D
@export var h_offset: float = 0
## Vertically offsets the Camera3D
@export var v_offset: float = 0
## Adjusts Camera3D FOV
@export var fov: float = 75

View file

@ -0,0 +1,13 @@
class_name PhantomCameraTween
extends Resource
const Constants = preload("res://addons/phantom_camera/scripts/phantom_camera/phantom_camera_constants.gd")
## The time it takes to tween to this property
@export var duration: float = 1
## The transition bezier type for the tween
@export var transition: Constants.TweenTransitions = Constants.TweenTransitions.LINEAR
## The ease type for the tween
@export var ease: Constants.TweenEases = Constants.TweenEases.EASE_IN_OUT

View file

@ -0,0 +1,439 @@
@tool
extends Control
const PcamGroupNames = preload("res://addons/phantom_camera/scripts/group_names.gd")
const Constants = preload("res://addons/phantom_camera/scripts/phantom_camera/phantom_camera_constants.gd")
var _selected_camera: Node
var _active_pcam_camera
var pcam_host_group: Array[Node]
var editor_interface: EditorInterface
####################
# Dead Zone Controls
####################
@onready var dead_zone_center_hbox: VBoxContainer = %DeadZoneCenterHBoxContainer
@onready var dead_zone_center_center_panel: Panel = %DeadZoneCenterCenterPanel
@onready var dead_zone_left_center_panel: Panel = %DeadZoneLeftCenterPanel
@onready var dead_zone_right_center_panel: Panel = %DeadZoneRightCenterPanel
@onready var target_point: Panel = %TargetPoint
var aspect_ratio_container: AspectRatioContainer
@onready var aspect_ratio_containers: AspectRatioContainer = %AspectRatioContainer
@onready var camera_viewport_panel: Panel = aspect_ratio_containers.get_child(0)
@onready var _framed_viewfinder: Control = %FramedViewfinder
@onready var _dead_zone_h_box_container: Control = %DeadZoneHBoxContainer
@onready var sub_viewport: SubViewport = %SubViewport
###########################
# Viewfinder Empty Controls
###########################
@onready var _empty_state_control: Control = %EmptyStateControl
@onready var _empty_state_icon: Control = %EmptyStateIcon
@onready var _empty_state_text: RichTextLabel = %EmptyStateText
@onready var _add_node_button: Button = %AddNodeButton
@onready var _add_node_button_text: RichTextLabel = %AddNodeTypeText
###################
# Priority Override
###################
@onready var _priority_override_button: Button = %PriorityOverrideButton
@onready var _priority_override_name_label: Label = %PriorityOverrideNameLabel
# TODO - Should be in a central location
const _camera_2d_icon: CompressedTexture2D = preload("res://addons/phantom_camera/icons/viewfinder/Camera2DIcon.svg")
const _camera_3d_icon: CompressedTexture2D = preload("res://addons/phantom_camera/icons/viewfinder/Camera3DIcon.svg")
const _pcam_host_icon: CompressedTexture2D = preload("res://addons/phantom_camera/icons/PhantomCameraHostIcon.svg")
const _pcam_2D_icon: CompressedTexture2D = preload("res://addons/phantom_camera/icons/PhantomCameraGizmoIcon2D.svg")
const _pcam_3D_icon: CompressedTexture2D = preload("res://addons/phantom_camera/icons/PhantomCameraGizmoIcon3D.svg")
const _overlay_color_alpha: float = 0.3
var _no_open_scene_icon: CompressedTexture2D = preload("res://addons/phantom_camera/icons/viewfinder/SceneTypesIcon.svg")
var _no_open_scene_string: String = "[b]2D[/b] or [b]3D[/b] scene open"
var is_2D: bool
var is_scene: bool
var has_camera_viewport_panel_size: bool = true
var min_horizontal: float
var max_horizontal: float
var min_vertical: float
var max_vertical: float
func _ready():
visibility_changed.connect(_visibility_check)
set_process(false)
aspect_ratio_containers.set_ratio(get_viewport_rect().size.x / get_viewport_rect().size.y)
# TODO - Don't think this is needed / does anything?
var root_node = get_tree().get_root().get_child(0)
if root_node is Node3D || root_node is Node2D:
%SubViewportContainer.set_visible(false)
if root_node is Node2D:
is_2D = true
else:
is_2D = false
_set_viewfinder(root_node, false)
if Engine.is_editor_hint():
get_tree().node_added.connect(_node_added)
get_tree().node_removed.connect(_node_added)
else:
_empty_state_control.set_visible(false)
_priority_override_button.set_visible(false)
func _exit_tree() -> void:
if Engine.is_editor_hint():
if get_tree().node_added.is_connected(_node_added):
get_tree().node_added.disconnect(_node_added)
get_tree().node_removed.disconnect(_node_added)
if aspect_ratio_containers.resized.is_connected(_resized):
aspect_ratio_containers.resized.disconnect(_resized)
if _add_node_button.pressed.is_connected(_add_node):
_add_node_button.pressed.disconnect(_add_node)
if is_instance_valid(_active_pcam_camera):
if _active_pcam_camera.Properties.is_connected(Constants.DEAD_ZONE_CHANGED_SIGNAL, _on_dead_zone_changed):
_active_pcam_camera.Properties.disconnect(Constants.DEAD_ZONE_CHANGED_SIGNAL, _on_dead_zone_changed)
if _priority_override_button.pressed.is_connected(_select_override_pcam):
_priority_override_button.pressed.disconnect(_select_override_pcam)
func _process(_delta: float):
if not visible or not is_instance_valid(_active_pcam_camera): return
var unprojected_position_clamped: Vector2 = Vector2(
clamp(_active_pcam_camera.Properties.viewport_position.x, min_horizontal, max_horizontal),
clamp(_active_pcam_camera.Properties.viewport_position.y, min_vertical, max_vertical)
)
target_point.position = camera_viewport_panel.size * unprojected_position_clamped - target_point.size / 2
if not has_camera_viewport_panel_size:
_on_dead_zone_changed()
func _node_added(node: Node) -> void:
if editor_interface == null: return
_visibility_check()
func scene_changed(scene_root: Node) -> void:
if scene_root is Node2D:
# print("Is 2D node")
is_2D = true
is_scene = true
_add_node_button.set_visible(true)
# var camera: Camera2D = scene_root.get_viewport().get_camera_2d()
var camera: Camera2D = _get_camera_2D()
_check_camera(scene_root, camera, true)
elif scene_root is Node3D:
# print("Is 3D node")
# Is 3D scene
is_2D = false
is_scene = true
_add_node_button.set_visible(true)
var camera: Camera3D = scene_root.get_viewport().get_camera_3d()
_check_camera(scene_root, camera, false)
else:
# print("Not a 2D or 3D scene")
is_scene = false
# Is not a 2D or 3D scene
_set_empty_viewfinder_state(_no_open_scene_string, _no_open_scene_icon)
_add_node_button.set_visible(false)
func _visibility_check():
if not editor_interface or not visible: return
if not is_instance_valid(editor_interface):
is_scene = false
# Is not a 2D or 3D scene
_set_empty_viewfinder_state(_no_open_scene_string, _no_open_scene_icon)
_add_node_button.set_visible(false)
return
var root: Node = editor_interface.get_edited_scene_root()
if root is Node2D:
# print("Is a 2D scene")
is_2D = true
is_scene = true
_add_node_button.set_visible(true)
# TODO: Figure out why the line below doesn't work...
# var camera: Camera2D = root.get_viewport().get_camera_2d()
var camera: Camera2D = _get_camera_2D()
_check_camera(root, camera, true)
elif root is Node3D:
# Is 3D scene
is_2D = false
is_scene = true
_add_node_button.set_visible(true)
var camera: Camera3D = root.get_viewport().get_camera_3d()
_check_camera(root, camera, false)
# editor_interface.get_selection().clear()
# editor_interface.get_selection().add_node(pcam_host_group[0].get_active_pcam())
else:
is_scene = false
# Is not a 2D or 3D scene
_set_empty_viewfinder_state(_no_open_scene_string, _no_open_scene_icon)
_add_node_button.set_visible(false)
if not _priority_override_button.pressed.is_connected(_select_override_pcam):
_priority_override_button.pressed.connect(_select_override_pcam)
func _get_camera_2D() -> Camera2D:
var camerasGroupName = "__cameras_%d" % editor_interface.get_edited_scene_root().get_viewport().get_viewport_rid().get_id()
var cameras = get_tree().get_nodes_in_group(camerasGroupName)
for camera in cameras:
if camera is Camera2D and camera.is_current:
return camera
return null
func _check_camera(root: Node, camera: Node, is_2D: bool) -> void:
var camera_string: String
var pcam_string: String
var color: Color
var color_alpha: Color
var camera_icon: CompressedTexture2D
var pcam_icon: CompressedTexture2D
if is_2D:
camera_string = Constants.CAMERA_2D_NODE_NAME
pcam_string = Constants.PCAM_2D_NODE_NAME
color = Constants.COLOR_2D
camera_icon = _camera_2d_icon
pcam_icon = _pcam_2D_icon
else:
camera_string = Constants.CAMERA_3D_NODE_NAME
pcam_string = Constants.PCAM_3D_NODE_NAME
color = Constants.COLOR_3D
camera_icon = _camera_3d_icon
pcam_icon = _pcam_3D_icon
if camera:
# Has Camera
var pcam_host: PhantomCameraHost
if camera.get_children().size() > 0:
for cam_child in camera.get_children():
if cam_child is PhantomCameraHost:
pcam_host = cam_child
if pcam_host:
if get_tree().get_nodes_in_group(PcamGroupNames.PCAM_GROUP_NAME):
# Pcam exists in tree
_set_viewfinder(root, true)
# if pcam_host.get_active_pcam().get_get_follow_mode():
# _on_dead_zone_changed()
_set_viewfinder_state()
# Related to: https://github.com/ramokz/phantom-camera/issues/105
# REMOVE BELOW WHEN 2D VIEWFINDER IS SUPPORTED
if not is_2D:
%NoSupportMsg.set_visible(false)
elif is_2D:
%NoSupportMsg.set_visible(true)
### REMOVAL END
else:
# No PCam in scene
_update_button(pcam_string, pcam_icon, color)
_set_empty_viewfinder_state(pcam_string, pcam_icon)
else:
# No PCamHost in scene
_update_button(Constants.PCAM_HOST_NODE_NAME, _pcam_host_icon, Constants.PCAM_HOST_COLOR)
_set_empty_viewfinder_state(Constants.PCAM_HOST_NODE_NAME, _pcam_host_icon)
else:
# No PCamHost in scene
_update_button(Constants.PCAM_HOST_NODE_NAME, _pcam_host_icon, Constants.PCAM_HOST_COLOR)
_set_empty_viewfinder_state(Constants.PCAM_HOST_NODE_NAME, _pcam_host_icon)
else:
# No Camera
_update_button(camera_string, camera_icon, color)
_set_empty_viewfinder_state(camera_string, camera_icon)
func _update_button(text: String, icon: CompressedTexture2D, color: Color) -> void:
_add_node_button_text.set_text("[center]Add [img=32]" + icon.resource_path + "[/img] [b]"+ text + "[/b][/center]");
var button_theme_hover: StyleBoxFlat = _add_node_button.get_theme_stylebox("hover")
button_theme_hover.border_color = color
_add_node_button.add_theme_stylebox_override("hover", button_theme_hover)
func _set_viewfinder_state() -> void:
_empty_state_control.set_visible(false)
_framed_viewfinder.set_visible(true)
target_point.set_visible(true)
if is_instance_valid(_active_pcam_camera):
if _active_pcam_camera.get_follow_mode() == Constants.FollowMode.FRAMED:
_dead_zone_h_box_container.set_visible(true)
else:
_dead_zone_h_box_container.set_visible(false)
func _set_empty_viewfinder_state(text: String, icon: CompressedTexture2D) -> void:
_framed_viewfinder.set_visible(false)
target_point.set_visible(false)
_empty_state_control.set_visible(true)
_empty_state_icon.set_texture(icon)
if icon == _no_open_scene_icon:
_empty_state_text.set_text("[center]No " + text + "[/center]")
else:
_empty_state_text.set_text("[center]No [b]" + text + "[/b] in scene[/center]")
if _add_node_button.pressed.is_connected(_add_node):
_add_node_button.pressed.disconnect(_add_node)
_add_node_button.pressed.connect(_add_node.bind(text))
func _add_node(node_type: String) -> void:
if not editor_interface: return
var root: Node = editor_interface.get_edited_scene_root()
match node_type:
_no_open_scene_string:
pass
Constants.CAMERA_2D_NODE_NAME:
var camera: Camera2D = Camera2D.new()
_instantiate_node(root, camera, Constants.CAMERA_2D_NODE_NAME)
Constants.CAMERA_3D_NODE_NAME:
var camera: Camera3D = Camera3D.new()
_instantiate_node(root, camera, Constants.CAMERA_3D_NODE_NAME)
Constants.PCAM_HOST_NODE_NAME:
var pcam_host: PhantomCameraHost = PhantomCameraHost.new()
pcam_host.set_name(Constants.PCAM_HOST_NODE_NAME)
if is_2D:
# get_tree().get_edited_scene_root().get_viewport().get_camera_2d().add_child(pcam_host)
_get_camera_2D().add_child(pcam_host)
pcam_host.set_owner(get_tree().get_edited_scene_root())
else:
# var pcam_3D := get_tree().get_edited_scene_root().get_viewport().get_camera_3d()
get_tree().get_edited_scene_root().get_viewport().get_camera_3d().add_child(pcam_host)
pcam_host.set_owner(get_tree().get_edited_scene_root())
Constants.PCAM_2D_NODE_NAME:
var pcam_2D: PhantomCamera2D = PhantomCamera2D.new()
_instantiate_node(root, pcam_2D, Constants.PCAM_2D_NODE_NAME)
Constants.PCAM_3D_NODE_NAME:
var pcam_3D: PhantomCamera3D = PhantomCamera3D.new()
_instantiate_node(root, pcam_3D, Constants.PCAM_3D_NODE_NAME)
func _instantiate_node(root: Node, node: Node, name: String) -> void:
node.set_name(name)
root.add_child(node)
node.set_owner(get_tree().get_edited_scene_root())
func _set_viewfinder(root: Node, editor: bool):
pcam_host_group = root.get_tree().get_nodes_in_group(PcamGroupNames.PCAM_HOST_GROUP_NAME)
if pcam_host_group.size() != 0:
if pcam_host_group.size() == 1:
var pcam_host: PhantomCameraHost = pcam_host_group[0]
if is_2D:
_selected_camera = pcam_host.camera_2D
_active_pcam_camera = _selected_camera.get_child(0).get_active_pcam() as PhantomCamera2D
if editor:
var camera_2D_rid: RID = _selected_camera.get_canvas_item()
# TODO - Missing 2D viewport support - https://github.com/ramokz/phantom-camera/issues/105
RenderingServer.viewport_attach_camera(sub_viewport.get_viewport_rid(), camera_2D_rid)
else:
_selected_camera = pcam_host.camera_3D
_active_pcam_camera = _selected_camera.get_child(0).get_active_pcam() as PhantomCamera3D
if editor:
var camera_3D_rid: RID = _selected_camera.get_camera_rid()
RenderingServer.viewport_attach_camera(sub_viewport.get_viewport_rid(), camera_3D_rid)
if _selected_camera.keep_aspect == Camera3D.KeepAspect.KEEP_HEIGHT:
aspect_ratio_containers.set_stretch_mode(AspectRatioContainer.STRETCH_HEIGHT_CONTROLS_WIDTH)
else:
aspect_ratio_containers.set_stretch_mode(AspectRatioContainer.STRETCH_WIDTH_CONTROLS_HEIGHT)
_on_dead_zone_changed()
set_process(true)
if not pcam_host.update_editor_viewfinder.is_connected(_on_update_editor_viewfinder):
pcam_host.update_editor_viewfinder.connect(_on_update_editor_viewfinder.bind(pcam_host))
if not aspect_ratio_containers.resized.is_connected(_resized):
aspect_ratio_containers.resized.connect(_resized)
if not _active_pcam_camera.Properties.is_connected(_active_pcam_camera.Constants.DEAD_ZONE_CHANGED_SIGNAL, _on_dead_zone_changed):
_active_pcam_camera.Properties.connect(_active_pcam_camera.Constants.DEAD_ZONE_CHANGED_SIGNAL, _on_dead_zone_changed)
# aspect_ratio_container
# TODO - Might not be needed
# _active_pcam_camera.Properties.disconnect(_on_dead_zone_changed)
else:
for pcam_host in pcam_host_group:
print(pcam_host, " is in a scene")
func _resized() -> void:
_on_dead_zone_changed()
func _on_dead_zone_changed() -> void:
if not is_instance_valid(_active_pcam_camera): return
if camera_viewport_panel.size == Vector2.ZERO:
has_camera_viewport_panel_size = false
return
else:
has_camera_viewport_panel_size = true
var dead_zone_width: float = _active_pcam_camera.Properties.follow_framed_dead_zone_width * camera_viewport_panel.size.x
var dead_zone_height: float = _active_pcam_camera.Properties.follow_framed_dead_zone_height * camera_viewport_panel.size.y
dead_zone_center_hbox.set_custom_minimum_size(Vector2(dead_zone_width, 0))
dead_zone_center_center_panel.set_custom_minimum_size(Vector2(0, dead_zone_height))
dead_zone_left_center_panel.set_custom_minimum_size(Vector2(0, dead_zone_height))
dead_zone_right_center_panel.set_custom_minimum_size(Vector2(0, dead_zone_height))
min_horizontal = 0.5 - _active_pcam_camera.Properties.follow_framed_dead_zone_width / 2
max_horizontal = 0.5 + _active_pcam_camera.Properties.follow_framed_dead_zone_width / 2
min_vertical = 0.5 - _active_pcam_camera.Properties.follow_framed_dead_zone_height / 2
max_vertical = 0.5 + _active_pcam_camera.Properties.follow_framed_dead_zone_height / 2
# target_point.position = Vector2(viewport_width / 2, viewport_height / 2)
####################
## Priority Override
####################
func _on_update_editor_viewfinder(pcam_host: PhantomCameraHost) -> void:
if pcam_host.get_active_pcam().Properties.priority_override:
_active_pcam_camera = pcam_host.get_active_pcam()
_priority_override_button.set_visible(true)
_priority_override_name_label.set_text(_active_pcam_camera.name)
_priority_override_button.set_tooltip_text(_active_pcam_camera.name)
else:
_priority_override_button.set_visible(false)
func _select_override_pcam() -> void:
editor_interface.get_selection().clear()
editor_interface.get_selection().add_node(_active_pcam_camera)