code: private void updateLight(float tpf) {
          if (sun != null && calendar != null) {
              hour = calendar.getHourOfDay();
              minute = calendar.getMinute();
  
              float xAngle = 0f;
              float yAngle = 0f;
              float zAngle = 0f;
              if (12 > hour && hour >= 6) {
                  yAngle = -(hour - 6f) * (1f / 6f);
                  yAngle -= minute * (1f / (6f * 60f));
                  xAngle = 1f + yAngle;
                  zAngle = -(0.2f + yAngle * 0.8f);
              } else if (18 > hour && hour >= 12) {
                  yAngle = -(18f - hour) * (1f / 6f);
                  yAngle += minute * (1f / (6f * 60f));
                  xAngle = -1f - yAngle;
                  zAngle = -(0.2f + yAngle * 0.8f);
              }
              sun.getDirection().set(xAngle, yAngle, zAngle);
              //System.out.println(hour+":"+minute+" -> "+sun.getDirection());
              sun.getDirection().normalizeLocal();
          }
      }
docs: It simulates the sun movement depending on the time (calendar).
  
  @param tpf