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 | public function attr(string $component_name, string $attr_data = null) |
||
72 | |||
73 | /** |
||
74 | * Handle entity components |
||
75 | * |
||
76 | * Since we might need to customize these to have |
||
77 | * custom components loaded as $this->methosd aswell therefore |
||
78 | * we have these placeholder magic methods here |
||
79 | * |
||
80 | 1 | * @param string $component_name |
|
81 | * @param array $args |
||
82 | 1 | */ |
|
83 | 1 | public function __call(string $component_name, array $args) |
|
87 | |||
88 | /** |
||
89 | 1 | * material.color |
|
90 | * |
||
91 | * @param string $color |
||
92 | * @return Mixin |
||
93 | */ |
||
94 | public function color(string $color = 'gray') |
||
101 | 1 | ||
102 | 1 | /** |
|
103 | 1 | * material.metalness |
|
104 | * |
||
105 | * @param int|float $metalness |
||
106 | * @return Mixin |
||
107 | */ |
||
108 | public function metalness(float $metalness = 0) |
||
115 | 1 | ||
116 | 1 | /** |
|
117 | 1 | * material.roughness |
|
118 | * |
||
119 | * @param float $roughness |
||
120 | * @return Mixin |
||
121 | */ |
||
122 | public function roughness(float $roughness = 0.5) |
||
129 | 1 | ||
130 | 1 | /** |
|
131 | 1 | * material.src |
|
132 | * |
||
133 | * @param null|string $src |
||
134 | * @return Mixin |
||
135 | */ |
||
136 | public function src(string $src = null) |
||
143 | 1 | ||
144 | 1 | /** |
|
145 | 1 | * material.shader |
|
146 | * |
||
147 | * @param string $shader |
||
148 | * @return Mixin |
||
149 | */ |
||
150 | public function shader($shader = 'standard') |
||
155 | |||
156 | 1 | /** |
|
157 | 1 | * material.opacity |
|
158 | * |
||
159 | * @param float $opacity |
||
160 | * @return Mixin |
||
161 | */ |
||
162 | public function opacity(float $opacity = 1.0) |
||
167 | |||
168 | 1 | /** |
|
169 | 1 | * material.transparent |
|
170 | * |
||
171 | * @param bool $transparent |
||
172 | * @return Mixin |
||
173 | */ |
||
174 | public function transparent(bool $transparent = false) |
||
179 | } |
||
180 |