Rigidbody3D functional prototype

This commit is contained in:
2025-02-02 20:00:55 -05:00
parent 1550f57f5d
commit 54352990fd
9 changed files with 1550 additions and 74 deletions

View File

@@ -0,0 +1,16 @@
extends Node3D
@export var camera_array: Array[Camera3D] = []
@export var current_camera: int = 0
func _process(delta):
if camera_array.size() != 0 and Input.is_action_just_released("change_camera_view"):
current_camera += 1
if current_camera <= camera_array.size() - 1:
camera_array[current_camera].make_current()
else:
current_camera = 0
camera_array[current_camera].make_current()
print(current_camera)

View File

@@ -0,0 +1,5 @@
extends Camera3D
func _ready():
GameManager.camera_array.append(self)

20
core/scripts/los_view.gd Normal file
View File

@@ -0,0 +1,20 @@
extends Node3D
@export var zoom_curve: Curve
var child_camera: Camera3D
var drone: RigidBody3D
var dist_to_drone: float = 0.0
func _ready():
child_camera = get_child(0)
drone = get_parent().get_node("Drone")
func _physics_process(delta):
look_at(drone.global_position)
dist_to_drone = global_position.distance_to(drone.global_position)
child_camera.fov = zoom_curve.sample((dist_to_drone-1)/89)