1 | <?php |
||
30 | class Material implements ComponentInterface |
||
31 | { |
||
32 | |||
33 | private $shaderObj; |
||
34 | |||
35 | /** |
||
36 | * Whether depth testing is enabled when rendering the material. |
||
37 | * |
||
38 | * @var bool true |
||
39 | */ |
||
40 | protected $depthTest = 'true'; |
||
41 | |||
42 | /** |
||
43 | * Extent of transparency. |
||
44 | * If the transparent property is not true, |
||
45 | * then the material will remain opaque and opacity will only affect color. |
||
46 | * |
||
47 | * @var string 1.0 |
||
48 | */ |
||
49 | protected $opacity = 1.0; |
||
50 | |||
51 | /** |
||
52 | * Whether material is transparent. |
||
53 | * Transparent entities are rendered after non-transparent entities. |
||
54 | * |
||
55 | * @var bool false |
||
56 | */ |
||
57 | protected $transparent = 'false'; |
||
58 | |||
59 | /** |
||
60 | * Which sides of the mesh to render. |
||
61 | * Can be one of front, back, or double. |
||
62 | * |
||
63 | * @var unknown |
||
64 | */ |
||
65 | protected $side = 'front'; |
||
66 | |||
67 | /** |
||
68 | * To set a texture using one of the built-in shading models, specify the src property. |
||
69 | * |
||
70 | * src can be a selector to either an <img> or <video> element: |
||
71 | */ |
||
72 | protected $src = false; |
||
73 | |||
74 | /** |
||
75 | * Get Component scripts |
||
76 | * |
||
77 | * {@inheritdoc} |
||
78 | * |
||
79 | * @return array |
||
80 | */ |
||
81 | public function getScripts(): array |
||
85 | |||
86 | /** |
||
87 | * Does component have DOM Atributes |
||
88 | * |
||
89 | * {@inheritdoc} |
||
90 | * |
||
91 | * @return bool |
||
92 | */ |
||
93 | public function hasDOMAttributes(): bool |
||
97 | |||
98 | /** |
||
99 | * Remove default DOMElement Attributes which are not required |
||
100 | * |
||
101 | * @return void |
||
102 | */ |
||
103 | public function removeDefaultDOMAttributes() |
||
119 | |||
120 | /** |
||
121 | * Get DOMAttr for the entity |
||
122 | * |
||
123 | * @return DOMAttr |
||
|
|||
124 | */ |
||
125 | public function getDOMAttributes(): \DOMAttr |
||
148 | |||
149 | /** |
||
150 | * Which shader or shading model to use. |
||
151 | * Defaults to the built-in standard shading model. |
||
152 | * Can be set to the built-in flat shading model or to a registered custom shader |
||
153 | * |
||
154 | * @var string standard |
||
155 | */ |
||
156 | public function shader(string $shader = 'standard') |
||
173 | |||
174 | /** |
||
175 | * opacity |
||
176 | * |
||
177 | * Extent of transparency. If the transparent property is not true, |
||
178 | * then the material will remain opaque and opacity will only affect color. |
||
179 | * |
||
180 | * @param float $opacity |
||
181 | * @return Entity |
||
182 | */ |
||
183 | public function opacity(float $opacity = 1.0) |
||
187 | |||
188 | /** |
||
189 | * transparent |
||
190 | * |
||
191 | * Whether material is transparent. Transparent entities are rendered after non-transparent entities. |
||
192 | * |
||
193 | * @param string $transparent |
||
194 | */ |
||
195 | public function transparent(string $transparent = 'false') |
||
199 | |||
200 | /** |
||
201 | * side |
||
202 | * |
||
203 | * Which sides of the mesh to render. Can be one of front, back, or double |
||
204 | * |
||
205 | * @param string $side |
||
206 | * @return EntityInterface |
||
207 | */ |
||
208 | public function side(string $side = 'front'): EntityInterface |
||
212 | } |
||
213 |
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.