| @@ 30-58 (lines=29) @@ | ||
| 27 | use \AframeVR\Core\Helpers\ComponentHelper; |
|
| 28 | use \AframeVR\Interfaces\ComponentInterface; |
|
| 29 | ||
| 30 | class Component extends ComponentAbstract implements ComponentInterface |
|
| 31 | { |
|
| 32 | use ComponentHelper; |
|
| 33 | ||
| 34 | /** |
|
| 35 | * Initialize Component |
|
| 36 | * |
|
| 37 | * {@inheritdoc} |
|
| 38 | * |
|
| 39 | * @return bool |
|
| 40 | * |
|
| 41 | */ |
|
| 42 | public function initializeComponent(): bool |
|
| 43 | { |
|
| 44 | $this->setDomAttributeName('position'); |
|
| 45 | return true; |
|
| 46 | } |
|
| 47 | ||
| 48 | /** |
|
| 49 | * Return DOM attribute contents |
|
| 50 | * |
|
| 51 | * @return string |
|
| 52 | */ |
|
| 53 | public function getDomAttributeString(): string |
|
| 54 | { |
|
| 55 | $attrs = $this->getDOMAttributesArray(); |
|
| 56 | return $this->createCoordinateString($attrs['x'], $attrs['y'], $attrs['z']); |
|
| 57 | } |
|
| 58 | } |
|
| 59 | ||
| @@ 30-57 (lines=28) @@ | ||
| 27 | use \AframeVR\Core\Helpers\ComponentHelper; |
|
| 28 | use \AframeVR\Interfaces\ComponentInterface; |
|
| 29 | ||
| 30 | class Component extends ComponentAbstract implements ComponentInterface |
|
| 31 | { |
|
| 32 | use ComponentHelper; |
|
| 33 | ||
| 34 | /** |
|
| 35 | * Initialize Component |
|
| 36 | * |
|
| 37 | * {@inheritdoc} |
|
| 38 | * |
|
| 39 | * @return bool |
|
| 40 | */ |
|
| 41 | public function initializeComponent(): bool |
|
| 42 | { |
|
| 43 | $this->setDomAttributeName('rotation'); |
|
| 44 | return true; |
|
| 45 | } |
|
| 46 | ||
| 47 | /** |
|
| 48 | * Return DOM attribute contents |
|
| 49 | * |
|
| 50 | * @return string |
|
| 51 | */ |
|
| 52 | public function getDomAttributeString(): string |
|
| 53 | { |
|
| 54 | $attrs = $this->getDOMAttributesArray(); |
|
| 55 | return $this->createCoordinateString($attrs['x'], $attrs['y'], $attrs['z']); |
|
| 56 | } |
|
| 57 | } |
|
| 58 | ||
| @@ 30-57 (lines=28) @@ | ||
| 27 | use \AframeVR\Core\Helpers\ComponentHelper; |
|
| 28 | use \AframeVR\Interfaces\ComponentInterface; |
|
| 29 | ||
| 30 | class Component extends ComponentAbstract implements ComponentInterface |
|
| 31 | { |
|
| 32 | use ComponentHelper; |
|
| 33 | ||
| 34 | /** |
|
| 35 | * Initialize Component |
|
| 36 | * |
|
| 37 | * {@inheritdoc} |
|
| 38 | * |
|
| 39 | * @return bool |
|
| 40 | */ |
|
| 41 | public function initializeComponent(): bool |
|
| 42 | { |
|
| 43 | $this->setDomAttributeName('scale'); |
|
| 44 | return true; |
|
| 45 | } |
|
| 46 | ||
| 47 | /** |
|
| 48 | * Return DOM attribute contents |
|
| 49 | * |
|
| 50 | * @return string |
|
| 51 | */ |
|
| 52 | public function getDomAttributeString(): string |
|
| 53 | { |
|
| 54 | $attrs = $this->getDOMAttributesArray(); |
|
| 55 | return $this->createCoordinateString($attrs['x'], $attrs['y'], $attrs['z']); |
|
| 56 | } |
|
| 57 | } |
|
| 58 | ||