1 | <?php |
||
29 | class LightComponent extends ComponentAbstract implements LightCMPTIF |
||
30 | { |
||
31 | |||
32 | /** |
||
33 | * Initialize Component |
||
34 | * |
||
35 | * {@inheritdoc} |
||
36 | * |
||
37 | * @return bool |
||
38 | */ |
||
39 | 6 | public function initializeComponent(): bool |
|
44 | |||
45 | /** |
||
46 | * Light type |
||
47 | * |
||
48 | * One of ambient, directional, hemisphere, point, spot. |
||
49 | * |
||
50 | * @param string $type |
||
51 | * @return LightCMPTIF |
||
52 | */ |
||
53 | 4 | public function type(string $type = 'directional'): LightCMPTIF |
|
58 | |||
59 | /** |
||
60 | * Light color |
||
61 | * |
||
62 | * @param string $color |
||
63 | * @return LightCMPTIF |
||
64 | */ |
||
65 | 4 | public function color(string $color = '#fff'): LightCMPTIF |
|
70 | |||
71 | /** |
||
72 | * Light angle |
||
73 | * |
||
74 | * Maximum extent of spot light from its direction (in degrees). |
||
75 | * |
||
76 | * @param int|float $angle |
||
77 | * @return LightCMPTIF |
||
78 | */ |
||
79 | 1 | public function angle(float $angle = 60): LightCMPTIF |
|
84 | |||
85 | /** |
||
86 | * Amount the light dims along the distance of the light. |
||
87 | * |
||
88 | * @param int $decay |
||
89 | * @return LightCMPTIF |
||
90 | */ |
||
91 | 1 | public function decay(int $decay = 1): LightCMPTIF |
|
96 | |||
97 | /** |
||
98 | * Light distance |
||
99 | * |
||
100 | * Distance where intensity becomes 0. If distance is 0, then the point light does not decay with distance. |
||
101 | * |
||
102 | * @param float $distance |
||
103 | * @return LightCMPTIF |
||
104 | */ |
||
105 | 4 | public function distance(float $distance = 0.0): LightCMPTIF |
|
110 | |||
111 | /** |
||
112 | * falloff |
||
113 | * |
||
114 | * Rapidity of falloff of light from its target direction. |
||
115 | * |
||
116 | * @param float $exponent |
||
117 | * @return LightCMPTIF |
||
118 | */ |
||
119 | 1 | public function exponent(float $exponent = 10.0): LightCMPTIF |
|
124 | |||
125 | /** |
||
126 | * Light color from below. |
||
127 | * |
||
128 | * @param string $ground_color |
||
129 | * @return LightCMPTIF |
||
130 | */ |
||
131 | 1 | public function groundColor(string $ground_color = '#fff'): LightCMPTIF |
|
136 | |||
137 | /** |
||
138 | * Light strength. |
||
139 | * |
||
140 | * @param float $intensity |
||
141 | * @return LightCMPTIF |
||
142 | */ |
||
143 | 1 | public function intensity(float $intensity = 1.0): LightCMPTIF |
|
148 | } |
||
149 |