| 590 | } |
| 591 | } |
| 592 | rgbf lightingEngineViewscreen::getSkyColor(float v) |
| 593 | { |
| 594 | if(dayColors.size()<2) |
| 595 | { |
| 596 | v=abs(fmod(v+0.5,1)-0.5)*2; |
| 597 | return rgbf(v,v,v); |
| 598 | } |
| 599 | else |
| 600 | { |
| 601 | float pos=v*(dayColors.size()-1); |
| 602 | int pre=floor(pos); |
| 603 | pos-=pre; |
| 604 | if(pre==int(dayColors.size())-1) |
| 605 | return dayColors[pre]; |
| 606 | return dayColors[pre]*(1-pos)+dayColors[pre+1]*pos; |
| 607 | } |
| 608 | } |
| 609 | void lightingEngineViewscreen::doOcupancyAndLights() |
| 610 | { |
| 611 | float daycol; |