Skip to content

Commit

Permalink
Updated in light of native components update
Browse files Browse the repository at this point in the history
  • Loading branch information
stevenvergenz committed Feb 14, 2018
1 parent 53df5eb commit 9517e78
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 6 deletions.
2 changes: 1 addition & 1 deletion src/components/NGLTF.js
Original file line number Diff line number Diff line change
Expand Up @@ -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),
Expand Down
6 changes: 3 additions & 3 deletions src/components/NSound.js
Original file line number Diff line number Diff line change
Expand Up @@ -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');
}
Expand All @@ -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');
}
Expand All @@ -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});
}
}

Expand Down
9 changes: 7 additions & 2 deletions src/components/NativeComponent.js
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
}

Expand Down

0 comments on commit 9517e78

Please sign in to comment.