1 | <?php |
||
33 | class Material implements ComponentInterface |
||
34 | { |
||
35 | |||
36 | private $shaderObj; |
||
37 | |||
38 | /** |
||
39 | * Whether depth testing is enabled when rendering the material. |
||
40 | * |
||
41 | * @var string true |
||
42 | */ |
||
43 | protected $depthTest = 'true'; |
||
44 | |||
45 | /** |
||
46 | * Extent of transparency. |
||
47 | * If the transparent property is not true, |
||
48 | * then the material will remain opaque and opacity will only affect color. |
||
49 | * |
||
50 | * @var float 1.0 |
||
51 | */ |
||
52 | protected $opacity = 1.0; |
||
53 | |||
54 | /** |
||
55 | * Whether material is transparent. |
||
56 | * Transparent entities are rendered after non-transparent entities. |
||
57 | * |
||
58 | * @var string false |
||
59 | */ |
||
60 | protected $transparent = 'false'; |
||
61 | |||
62 | /** |
||
63 | * Which sides of the mesh to render. |
||
64 | * Can be one of front, back, or double. |
||
65 | * |
||
66 | * @var string front |
||
67 | */ |
||
68 | protected $side = 'front'; |
||
69 | |||
70 | /** |
||
71 | * To set a texture using one of the built-in shading models, specify the src property. |
||
72 | * |
||
73 | * src can be a selector to either an <img> or <video> element: |
||
74 | */ |
||
75 | protected $src = false; |
||
76 | |||
77 | /** |
||
78 | * Get Component scripts |
||
79 | * |
||
80 | * {@inheritdoc} |
||
81 | * |
||
82 | * @return array |
||
83 | */ |
||
84 | 1 | public function getScripts(): array |
|
88 | |||
89 | /** |
||
90 | * Does component have DOM Atributes |
||
91 | * |
||
92 | * {@inheritdoc} |
||
93 | * |
||
94 | * @return bool |
||
95 | */ |
||
96 | 2 | public function hasDOMAttributes(): bool |
|
104 | |||
105 | /** |
||
106 | * Remove default DOMElement Attributes which are not required |
||
107 | * |
||
108 | * @return void |
||
109 | */ |
||
110 | 2 | public function removeDefaultDOMAttributes() |
|
133 | |||
134 | /** |
||
135 | * Get DOMAttr for the entity |
||
136 | * |
||
137 | * @return DOMAttr |
||
138 | */ |
||
139 | 1 | public function getDOMAttributes(): DOMAttr |
|
166 | |||
167 | /** |
||
168 | * Which shader or shading model to use. |
||
169 | * Defaults to the built-in standard shading model. |
||
170 | * Can be set to the built-in flat shading model or to a registered custom shader |
||
171 | * |
||
172 | * @var string standard |
||
173 | * @return ShaderInterface|null |
||
|
|||
174 | */ |
||
175 | 12 | public function shader(string $shader = 'standard') |
|
188 | |||
189 | /** |
||
190 | * opacity |
||
191 | * |
||
192 | * Extent of transparency. If the transparent property is not true, |
||
193 | * then the material will remain opaque and opacity will only affect color. |
||
194 | * |
||
195 | * @param float $opacity |
||
196 | */ |
||
197 | 8 | public function opacity(float $opacity = 1.0) |
|
201 | |||
202 | /** |
||
203 | * transparent |
||
204 | * |
||
205 | * Whether material is transparent. Transparent entities are rendered after non-transparent entities. |
||
206 | * |
||
207 | * @param string $transparent |
||
208 | */ |
||
209 | 7 | public function transparent(bool $transparent = false) |
|
213 | |||
214 | /** |
||
215 | * side |
||
216 | * |
||
217 | * Which sides of the mesh to render. Can be one of front, back, or double |
||
218 | * |
||
219 | * @param string $side |
||
220 | * @return EntityInterface |
||
221 | */ |
||
222 | 1 | public function side(string $side = 'front') |
|
226 | } |
||
227 |
This check compares the return type specified in the
@return
annotation of a function or method doc comment with the types returned by the function and raises an issue if they mismatch.