full_reflective_body.gd 756 B

1234567891011121314151617181920212223242526
  1. extends Spatial
  2. onready var global_v=get_tree().get_root().get_node("scene")
  3. var is_rot=true;
  4. func rotate_check():
  5. is_rot=!is_rot;
  6. func set_visible_obj(idx):
  7. global_v.get_node("full_refl").get_child(idx).visible=true
  8. idx=(idx+1)%3
  9. global_v.get_node("full_refl").get_child(idx).visible=false
  10. idx=(idx+1)%3
  11. global_v.get_node("full_refl").get_child(idx).visible=false
  12. func _ready():
  13. for a in global_v.get_node("viewports").get_child_count():
  14. global_v.get_node("viewports").get_child(a).get_child(0).environment=load("res://default_env.tres") as Environment
  15. pass
  16. func _process(delta):
  17. if is_rot:
  18. for a in range(3):
  19. global_v.get_node("full_refl").get_child(a).rotate_z(-0.003)
  20. global_v.get_node("full_refl").get_child(a).rotate_y(-0.01)