1 | <?php |
||
34 | class MaterialComponent extends ComponentAbstract implements MaterialCMPTIF |
||
35 | { |
||
36 | private $shaderObj; |
||
37 | |||
38 | /** |
||
39 | * Initialize Component |
||
40 | * |
||
41 | * {@inheritdoc} |
||
42 | * |
||
43 | * @return bool |
||
44 | */ |
||
45 | 26 | public function initializeComponent(): bool |
|
50 | |||
51 | /** |
||
52 | * Return DOM attribute contents |
||
53 | * |
||
54 | * @return string |
||
55 | */ |
||
56 | 7 | public function getDomAttributeString(): string |
|
61 | |||
62 | /** |
||
63 | * Call passes all calls to no existing methods to self::methodProvider |
||
64 | * |
||
65 | * @param string $method |
||
66 | * @param array $args |
||
67 | * @throws InvalidComponentMethodException |
||
68 | */ |
||
69 | 12 | public function __call(string $method, $args) |
|
86 | |||
87 | /** |
||
88 | * Material Shader |
||
89 | * |
||
90 | * {@inheritdoc} |
||
91 | * |
||
92 | * @param null|string $shader |
||
93 | * @throws BadShaderCallException |
||
94 | * @return ShaderInterface|MaterialComponent |
||
95 | */ |
||
96 | 21 | public function shader(string $shader = null) |
|
111 | |||
112 | /** |
||
113 | * opacity |
||
114 | * |
||
115 | * {@inheritdoc} |
||
116 | * |
||
117 | * @param float $opacity |
||
118 | * @return MaterialCMPTIF |
||
119 | */ |
||
120 | 11 | public function opacity(float $opacity = 1.0): MaterialCMPTIF |
|
125 | |||
126 | /** |
||
127 | * transparent |
||
128 | * |
||
129 | * {@inheritdoc} |
||
130 | * |
||
131 | * @param bool $transparent |
||
132 | * @return MaterialCMPTIF |
||
133 | */ |
||
134 | 10 | public function transparent(bool $transparent = false): MaterialCMPTIF |
|
139 | |||
140 | /** |
||
141 | * depthTest |
||
142 | * |
||
143 | * {@inheritdoc} |
||
144 | * |
||
145 | * @param bool $depth_test |
||
146 | * @return MaterialCMPTIF |
||
147 | */ |
||
148 | 1 | public function depthTest(bool $depth_test = true): MaterialCMPTIF |
|
153 | |||
154 | /** |
||
155 | * side |
||
156 | * |
||
157 | * {@inheritdoc} |
||
158 | * |
||
159 | * @param string $side |
||
160 | * @return MaterialCMPTIF |
||
161 | */ |
||
162 | 7 | public function side(string $side = 'front'): MaterialCMPTIF |
|
167 | |||
168 | /** |
||
169 | * Do not apply fog to certain entities, we can disable fog for certain materials. |
||
170 | * |
||
171 | * @param bool $fog |
||
172 | * @return MaterialCMPTIF |
||
173 | */ |
||
174 | 1 | public function fog(bool $fog = true): MaterialCMPTIF |
|
179 | |||
180 | /** |
||
181 | * Prepare Shader attributes |
||
182 | * |
||
183 | * @return void |
||
184 | */ |
||
185 | 7 | private function prepareShader() |
|
191 | } |
||
192 |