* If `attr` is a component, returns ALL component data including applied mixins and * defaults. * * If `attr` is not a component, fall back to HTML getAttribute. * * @param {string} attr * @returns {object|string} Object if component, else string.
(attr)
| 714 | * @returns {object|string} Object if component, else string. |
| 715 | */ |
| 716 | getAttribute (attr) { |
| 717 | // If component, return component data. |
| 718 | var component; |
| 719 | if (attr === 'position') { return this.object3D.position; } |
| 720 | if (attr === 'rotation') { return getRotation(this); } |
| 721 | if (attr === 'scale') { return this.object3D.scale; } |
| 722 | if (attr === 'visible') { return this.object3D.visible; } |
| 723 | component = this.components[attr]; |
| 724 | if (component) { return component.data; } |
| 725 | return window.HTMLElement.prototype.getAttribute.call(this, attr); |
| 726 | } |
| 727 | |
| 728 | /** |
| 729 | * If `attr` is a component, returns JUST the component data defined on the entity. |
no test coverage detected