|
1
|
|
|
<?php |
|
2
|
|
|
/** @formatter:off |
|
3
|
|
|
* ****************************************************************** |
|
4
|
|
|
* Created by Marko Kungla on Jul 7, 2016 - 4:12:47 AM |
|
5
|
|
|
* Contact [email protected] |
|
6
|
|
|
* @copyright 2016 Marko Kungla - https://github.com/mkungla |
|
7
|
|
|
* @license The MIT License (MIT) |
|
8
|
|
|
* |
|
9
|
|
|
* @category AframeVR |
|
10
|
|
|
* @package aframe-php |
|
11
|
|
|
* |
|
12
|
|
|
* Lang PHP (php version >= 7) |
|
13
|
|
|
* Encoding UTF-8 |
|
14
|
|
|
* File ObjModelComponent.php |
|
15
|
|
|
* Code format PSR-2 and 12 |
|
16
|
|
|
* @link https://github.com/mkungla/aframe-php |
|
17
|
|
|
* @issues https://github.com/mkungla/aframe-php/issues |
|
18
|
|
|
* ******************************************************************** |
|
19
|
|
|
* Contributors: |
|
20
|
|
|
* @author Marko Kungla <[email protected]> |
|
21
|
|
|
* ******************************************************************** |
|
22
|
|
|
* Comments: |
|
23
|
|
|
* @formatter:on */ |
|
24
|
|
|
namespace AframeVR\Core\Components\ObjModel; |
|
25
|
|
|
|
|
26
|
|
|
use \AframeVR\Interfaces\Core\Components\ObjModelCMPTIF; |
|
27
|
|
|
use \AframeVR\Core\Helpers\ComponentAbstract; |
|
28
|
|
|
|
|
29
|
|
|
class ObjModelComponent extends ComponentAbstract implements ObjModelCMPTIF |
|
30
|
|
|
{ |
|
31
|
|
|
|
|
32
|
|
|
/** |
|
33
|
|
|
* Initialize Component |
|
34
|
|
|
* |
|
35
|
|
|
* {@inheritdoc} |
|
36
|
|
|
* |
|
37
|
|
|
* @return bool |
|
38
|
|
|
*/ |
|
39
|
3 |
|
public function initializeComponent(): bool |
|
40
|
|
|
{ |
|
41
|
3 |
|
$this->setDomAttribute('obj-model'); |
|
42
|
3 |
|
return true; |
|
43
|
|
|
} |
|
44
|
|
|
|
|
45
|
|
|
/** |
|
46
|
|
|
* Selector to obj |
|
47
|
|
|
* |
|
48
|
|
|
* Selector to an <a-asset-item> pointing to a .OBJ file or an inline path to a .OBJ file. |
|
49
|
|
|
* |
|
50
|
|
|
* @param string $selector |
|
51
|
|
|
* @return ObjModelCMPTIF |
|
52
|
|
|
*/ |
|
53
|
2 |
|
public function obj(string $selector): ObjModelCMPTIF |
|
54
|
|
|
{ |
|
55
|
2 |
|
$this->dom_attributes['obj'] = $selector; |
|
56
|
2 |
|
return $this; |
|
57
|
|
|
} |
|
58
|
|
|
|
|
59
|
|
|
/** |
|
60
|
|
|
* Selector to mtl |
|
61
|
|
|
* |
|
62
|
|
|
* Selector to an <a-asset-item> pointing to a .MTL file or an inline path to a .MTL file. Optional if you wish to |
|
63
|
|
|
* use the material component instead. |
|
64
|
|
|
* |
|
65
|
|
|
* @param string $selector |
|
66
|
|
|
* @return ObjModelCMPTIF |
|
67
|
|
|
*/ |
|
68
|
2 |
|
public function mtl(string $selector): ObjModelCMPTIF |
|
69
|
|
|
{ |
|
70
|
2 |
|
$this->dom_attributes['mtl'] = $selector; |
|
71
|
2 |
|
return $this; |
|
72
|
|
|
} |
|
73
|
|
|
} |
|
74
|
|
|
|