diff --git a/src/components/NGLTF.js b/src/components/NGLTF.js index 44606fde..46cc546b 100644 --- a/src/components/NGLTF.js +++ b/src/components/NGLTF.js @@ -52,7 +52,7 @@ export default class NGLTF extends NativeComponent { */ getBoundingBox() { - return this.callComponent('GetBoundingBox').then(data => { + return this.callComponentFunc('GetBoundingBox').then(data => { const V3 = AFRAME.THREE.Vector3; return new AFRAME.THREE.Box3( new V3().subVectors(data.center, data.extents), diff --git a/src/components/NSound.js b/src/components/NSound.js index 8a2cb53b..83afb9cb 100644 --- a/src/components/NSound.js +++ b/src/components/NSound.js @@ -177,7 +177,7 @@ class NSound extends NativeComponent * @fires module:altspace/components.n-sound#sound-paused */ pauseSound() { - this.callComponent('pause'); + this.callComponentAction('pause'); this.el.emit('sound-paused'); } @@ -187,7 +187,7 @@ class NSound extends NativeComponent * @fires module:altspace/components.n-sound#sound-played */ playSound() { - this.callComponent('play'); + this.callComponentAction('play'); this.el.emit('sound-played'); } @@ -197,7 +197,7 @@ class NSound extends NativeComponent * @param {number} time - The time in milliseconds to jump to. */ seek(time) { - this.callComponent('seek', {time: time}); + this.callComponentAction('seek', {time: time}); } } diff --git a/src/components/NativeComponent.js b/src/components/NativeComponent.js index 33c36fbe..d1d59d80 100644 --- a/src/components/NativeComponent.js +++ b/src/components/NativeComponent.js @@ -71,9 +71,14 @@ class NativeComponent extends AFrameComponent altspace.removeNativeComponent(mesh, this.name); } - callComponent(name, ...args){ + callComponentFunc(name, ...args){ let mesh = this.mesh || this.el.object3DMap.mesh; - return altspace.callNativeComponent(mesh, this.name, name, args); + return altspace.callNativeComponentFunc(mesh, this.name, name, args); + } + + callComponentAction(name, ...args){ + let mesh = this.mesh || this.el.object3DMap.mesh; + return altspace.callNativeComponentAction(mesh, this.name, name, args); } }