| 513 | } |
| 514 | |
| 515 | inline void UpdateHorizontalCoords() |
| 516 | { |
| 517 | Float3 sunDir = SunDirection.Value(); |
| 518 | SunElevation.SetValue(RadToDeg(asin(sunDir.y))); |
| 519 | |
| 520 | float rad = atan2(sunDir.z, sunDir.x); |
| 521 | if(rad < 0.0f) |
| 522 | rad = 2.0f * Pi + rad; |
| 523 | |
| 524 | float deg = RadToDeg(rad); |
| 525 | SunAzimuth.SetValue(deg); |
| 526 | } |
| 527 | |
| 528 | inline void UpdateUnitVector() |
| 529 | { |