1 | <?php |
||
30 | final class Mixin extends AssetsAbstract implements MixinInterface |
||
31 | { |
||
32 | |||
33 | /** |
||
34 | * DOM tag name of asset item |
||
35 | * |
||
36 | * @var string |
||
37 | */ |
||
38 | protected $element_tag = 'a-mixin'; |
||
39 | |||
40 | /** |
||
41 | * Array of mocked components |
||
42 | * |
||
43 | * @var array |
||
44 | */ |
||
45 | protected $components = array(); |
||
46 | |||
47 | /** |
||
48 | * Load component for this entity |
||
49 | * |
||
50 | * @param string $component_name |
||
51 | * @throws \AframeVR\Core\Exceptions\BadComponentCallException |
||
52 | * @return object|null |
||
53 | */ |
||
54 | 2 | public function attr(string $component_name) |
|
68 | |||
69 | /** |
||
70 | * Handle entity components |
||
71 | * |
||
72 | * Since we might need to customize these to have |
||
73 | * custom components loaded as $this->methosd aswell therefore |
||
74 | * we have these placeholder magic methods here |
||
75 | * |
||
76 | * @param string $component_name |
||
77 | * @param array $args |
||
78 | */ |
||
79 | 1 | public function __call(string $component_name, array $args) |
|
83 | |||
84 | /** |
||
85 | * material.color |
||
86 | * |
||
87 | * @param string $color |
||
88 | * @return Mixin |
||
89 | */ |
||
90 | 1 | public function color(string $color = 'gray') |
|
97 | |||
98 | /** |
||
99 | * material.metalness |
||
100 | * |
||
101 | * @param int|float $metalness |
||
102 | * @return Mixin |
||
103 | */ |
||
104 | 1 | public function metalness(float $metalness = 0) |
|
111 | |||
112 | /** |
||
113 | * material.roughness |
||
114 | * |
||
115 | * @param float $roughness |
||
116 | * @return Mixin |
||
117 | */ |
||
118 | 1 | public function roughness(float $roughness = 0.5) |
|
125 | |||
126 | /** |
||
127 | * material.src |
||
128 | * |
||
129 | * @param null|string $src |
||
130 | * @return Mixin |
||
131 | */ |
||
132 | 1 | public function src(string $src = null) |
|
139 | |||
140 | /** |
||
141 | * material.shader |
||
142 | * |
||
143 | * @param string $shader |
||
144 | * @return Mixin |
||
145 | */ |
||
146 | 1 | public function shader($shader = 'standard') |
|
151 | |||
152 | /** |
||
153 | * material.opacity |
||
154 | * |
||
155 | * @param float $opacity |
||
156 | * @return Mixin |
||
157 | */ |
||
158 | 1 | public function opacity(float $opacity = 1.0) |
|
163 | |||
164 | /** |
||
165 | * material.transparent |
||
166 | * |
||
167 | * @param bool $transparent |
||
168 | * @return Mixin |
||
169 | */ |
||
170 | 1 | public function transparent(bool $transparent = false) |
|
175 | } |
||
176 |