class_name PlayerInput extends Node

var camera : Camera3D

func getInputVector() -> Vector3 :
	var cam_basis = camera.global_transform.basis
	cam_basis.x.y = 0
	cam_basis.x = cam_basis.x.normalized()
	cam_basis.z.y = 0
	cam_basis.z = cam_basis.z.normalized()

	var input = Input.get_vector("move_left", "move_right", "move_up", "move_down")
	var relativeInput = Vector3.ZERO
	relativeInput += input.x * cam_basis.x
	relativeInput += input.y * cam_basis.z

	return relativeInput

# Called when the node enters the scene tree for the first time.
func _ready() -> void:
	pass # Replace with function body.


# Called every frame. 'delta' is the elapsed time since the previous frame.
func _process(delta: float) -> void:
	pass
