1 | <?php |
||
29 | class Light extends Entity implements EntityInterface |
||
30 | { |
||
31 | |||
32 | /** |
||
33 | * Init <a-light> |
||
34 | * |
||
35 | * The light primitive adjusts the lighting setup of the scene. It is an entity that maps attributes to properties |
||
36 | * of the light component. |
||
37 | * |
||
38 | * @return void |
||
39 | */ |
||
40 | 3 | public function reset() |
|
46 | |||
47 | /** |
||
48 | * light.angle |
||
49 | * |
||
50 | * @param int|float $angle |
||
51 | * @return self |
||
52 | */ |
||
53 | 2 | public function angle(float $angle = 60) |
|
54 | { |
||
55 | 2 | $this->component('Light')->angle($angle); |
|
56 | 2 | return $this; |
|
57 | } |
||
58 | |||
59 | /** |
||
60 | * light.color |
||
61 | * |
||
62 | * @param string $color |
||
63 | * @return self |
||
64 | */ |
||
65 | 2 | public function color(string $color = '#fff'): EntityInterface |
|
66 | { |
||
67 | 2 | $this->component('Light')->color($color); |
|
68 | 2 | return $this; |
|
69 | } |
||
70 | |||
71 | /** |
||
72 | * light.decay |
||
73 | * |
||
74 | * @param int $decay |
||
75 | * @return self |
||
76 | */ |
||
77 | 2 | public function decay(int $decay = 1) |
|
78 | { |
||
79 | 2 | $this->component('Light')->decay($decay); |
|
80 | 2 | return $this; |
|
81 | } |
||
82 | |||
83 | /** |
||
84 | * light.distance |
||
85 | * |
||
86 | * @param float $distance |
||
87 | * @return self |
||
88 | */ |
||
89 | 2 | public function distance(float $distance = 0.0) |
|
90 | { |
||
91 | 2 | $this->component('Light')->distance($distance); |
|
92 | 2 | return $this; |
|
93 | } |
||
94 | |||
95 | /** |
||
96 | * light.exponent |
||
97 | * |
||
98 | * @param float $exponent |
||
99 | * @return self |
||
100 | */ |
||
101 | 2 | public function exponent(float $exponent = 10.0) |
|
102 | { |
||
103 | 2 | $this->component('Light')->exponent($exponent); |
|
104 | 2 | return $this; |
|
105 | } |
||
106 | |||
107 | /** |
||
108 | * light.groundColor |
||
109 | * |
||
110 | * @param string $ground_color |
||
111 | * @return self |
||
112 | */ |
||
113 | 2 | public function groundColor(string $ground_color = '#fff') |
|
118 | |||
119 | /** |
||
120 | * light.intensity |
||
121 | * |
||
122 | * @param float $intensity |
||
123 | * @return self |
||
124 | */ |
||
125 | 2 | public function intensity(float $intensity = 1.0) |
|
130 | |||
131 | /** |
||
132 | * light.penumbra |
||
133 | * |
||
134 | * @param float $penumbra |
||
135 | * @return self |
||
136 | */ |
||
137 | 2 | public function penumbra(float $penumbra) |
|
142 | |||
143 | |||
144 | /** |
||
145 | * light.type |
||
146 | * |
||
147 | * @param string $type |
||
148 | * @return self |
||
149 | */ |
||
150 | 2 | public function type(string $type = 'directional') |
|
155 | } |
||
156 |