1 | <?php |
||
31 | class Material implements ComponentInterface |
||
32 | { |
||
33 | |||
34 | private $shaderObj; |
||
35 | |||
36 | /** |
||
37 | * Whether depth testing is enabled when rendering the material. |
||
38 | * |
||
39 | * @var string true |
||
40 | */ |
||
41 | protected $depthTest = 'true'; |
||
42 | |||
43 | /** |
||
44 | * Extent of transparency. |
||
45 | * If the transparent property is not true, |
||
46 | * then the material will remain opaque and opacity will only affect color. |
||
47 | * |
||
48 | * @var float 1.0 |
||
49 | */ |
||
50 | protected $opacity = 1.0; |
||
51 | |||
52 | /** |
||
53 | * Whether material is transparent. |
||
54 | * Transparent entities are rendered after non-transparent entities. |
||
55 | * |
||
56 | * @var string false |
||
57 | */ |
||
58 | protected $transparent = 'false'; |
||
59 | |||
60 | /** |
||
61 | * Which sides of the mesh to render. |
||
62 | * Can be one of front, back, or double. |
||
63 | * |
||
64 | * @var string front |
||
65 | */ |
||
66 | protected $side = 'front'; |
||
67 | |||
68 | /** |
||
69 | * To set a texture using one of the built-in shading models, specify the src property. |
||
70 | * |
||
71 | * src can be a selector to either an <img> or <video> element: |
||
72 | */ |
||
73 | protected $src = false; |
||
74 | |||
75 | /** |
||
76 | * Get Component scripts |
||
77 | * |
||
78 | * {@inheritdoc} |
||
79 | * |
||
80 | * @return array |
||
81 | */ |
||
82 | public function getScripts(): array |
||
86 | |||
87 | /** |
||
88 | * Does component have DOM Atributes |
||
89 | * |
||
90 | * {@inheritdoc} |
||
91 | * |
||
92 | * @return bool |
||
93 | */ |
||
94 | 1 | public function hasDOMAttributes(): bool |
|
102 | |||
103 | /** |
||
104 | * Remove default DOMElement Attributes which are not required |
||
105 | * |
||
106 | * @return void |
||
107 | */ |
||
108 | 1 | public function removeDefaultDOMAttributes() |
|
130 | |||
131 | /** |
||
132 | * Get DOMAttr for the entity |
||
133 | * |
||
134 | * @return DOMAttr |
||
135 | */ |
||
136 | public function getDOMAttributes(): DOMAttr |
||
165 | |||
166 | /** |
||
167 | * Which shader or shading model to use. |
||
168 | * Defaults to the built-in standard shading model. |
||
169 | * Can be set to the built-in flat shading model or to a registered custom shader |
||
170 | * |
||
171 | * @var string standard |
||
172 | */ |
||
173 | 6 | public function shader(string $shader = 'standard') |
|
190 | |||
191 | /** |
||
192 | * opacity |
||
193 | * |
||
194 | * Extent of transparency. If the transparent property is not true, |
||
195 | * then the material will remain opaque and opacity will only affect color. |
||
196 | * |
||
197 | * @param float $opacity |
||
198 | */ |
||
199 | 6 | public function opacity(float $opacity = 1.0) |
|
203 | |||
204 | /** |
||
205 | * transparent |
||
206 | * |
||
207 | * Whether material is transparent. Transparent entities are rendered after non-transparent entities. |
||
208 | * |
||
209 | * @param string $transparent |
||
210 | */ |
||
211 | 6 | public function transparent(string $transparent = 'false') |
|
215 | |||
216 | /** |
||
217 | * side |
||
218 | * |
||
219 | * Which sides of the mesh to render. Can be one of front, back, or double |
||
220 | * |
||
221 | * @param string $side |
||
222 | * @return EntityInterface |
||
223 | */ |
||
224 | public function side(string $side = 'front'): EntityInterface |
||
228 | } |
||
229 |