Skip to content
Snippets Groups Projects
Commit 4a895b10 authored by Greg Fodor's avatar Greg Fodor
Browse files

Missing file

parent 5864abb0
No related branches found
No related tags found
No related merge requests found
// Used for tracking and managing camera tools in the scene
AFRAME.registerSystem("cameras", {
init() {
this.cameraEls = [];
},
register(el) {
this.cameraEls.push(el);
el.addEventListener("ownership-changed", this._onOwnershipChange);
this.currentCamera = null;
},
deregister(el) {
this.cameraEls = this.cameraEls.filter(c => c !== el);
el.removeEventListener("ownership-changed", this._onOwnershipChange);
this.currentCamera = null;
},
getCurrent() {
if (this.currentCamera) return this.currentCamera;
this.currentCamera = this.cameraEls.find(NAF.utils.isMine);
return this.currentCamera;
},
_onOwnershipChange() {
this.currentCamera = null;
}
});
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment