extends Marker3D
#fixme: make DIRECTIONS unique
enum DIRECTIONS {UP, DOWN, LEFT, RIGHT, NONE}

@onready var ray_front = $RayCastFront
@onready var ray_front_pull = $RayCastFrontPull
@onready var ray_back = $RayCastBack
@onready var ray_downramp = $RayCastDownRamp

func update_raycast_direction(direction: DIRECTIONS):
	if direction == DIRECTIONS.UP:	
		rotation = Vector3(0,deg_to_rad(180),0)
	elif direction == DIRECTIONS.DOWN:	
		rotation = Vector3(0,0,0)
	elif direction == DIRECTIONS.LEFT:	
		rotation = Vector3(0,deg_to_rad(-90),0)
	elif direction == DIRECTIONS.RIGHT:
		rotation = Vector3(0,deg_to_rad(90),0)
		
	if direction != DIRECTIONS.NONE:

		#ray_front.enabled = true
		#ray_back.enabled = true
		ray_front.force_raycast_update()
		ray_back.force_raycast_update()
		ray_front_pull.force_raycast_update()
		ray_downramp.force_raycast_update()
	#else:
	#	ray_front.enabled = false
	#	ray_back.enabled = false
