From 23aa03efd9dcbdf895727f2a8630b0b17841ad2b Mon Sep 17 00:00:00 2001 From: yannk Date: Sun, 17 Apr 2022 22:29:33 +0200 Subject: [PATCH] Getting celestial positions via script --- maps/basic_setup.gd | 24 ++++++++++++++++++++++++ scenes/developper/developper.gd | 12 ++++++------ 2 files changed, 30 insertions(+), 6 deletions(-) create mode 100644 maps/basic_setup.gd diff --git a/maps/basic_setup.gd b/maps/basic_setup.gd new file mode 100644 index 0000000..8d099f7 --- /dev/null +++ b/maps/basic_setup.gd @@ -0,0 +1,24 @@ +extends Node3D + +# Called when the node enters the scene tree for the first time. +func _ready(): + var celestial_positions = get_celestial_position() + print(celestial_positions) + +# Called every frame. 'delta' is the elapsed time since the previous frame. +func _process(delta): + pass + +func get_celestial_position(): + var stigi_pos = get_node("WorldEnvironment").environment.sky.sky_material.get_shader_param("stigi_position") + var stigi_arc = get_node("WorldEnvironment").environment.sky.sky_material.get_shader_param("stigi_arc") + + var samayun_pos = get_node("WorldEnvironment").environment.sky.sky_material.get_shader_param("samayun_position") + var samayun_arc = get_node("WorldEnvironment").environment.sky.sky_material.get_shader_param("samayun_arc") + + var zabr_pos = get_node("WorldEnvironment").environment.sky.sky_material.get_shader_param("zabr_position") + var zabr_arc = get_node("WorldEnvironment").environment.sky.sky_material.get_shader_param("zabr_arc") + + var positions = {"stigi_pos":stigi_pos, "stigi_arc":stigi_arc, "samayun_pos":samayun_pos, "samayun_arc":samayun_arc, "zabr_pos":zabr_pos, "zabr_arc":zabr_arc} + + return positions diff --git a/scenes/developper/developper.gd b/scenes/developper/developper.gd index e101c11..ed6211c 100644 --- a/scenes/developper/developper.gd +++ b/scenes/developper/developper.gd @@ -1,16 +1,16 @@ -extends Control +# Panel to include all developpment tools for testing / debugging etc. +extends Control # Called when the node enters the scene tree for the first time. func _ready(): - pass # Replace with function body. - + pass # Called every frame. 'delta' is the elapsed time since the previous frame. func _process(delta): pass +# Signals calls +# Quit button func _on_quit_pressed(): - var parentname = get_parent().name - print(parentname) - get_parent().get_node("developper_panel").queue_free() + queue_free()