-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.js
49 lines (40 loc) · 1.42 KB
/
index.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
module.exports = {
'animation-mixer': require('./animation-mixer'),
'fbx-model': require('./fbx-model'),
'json-model': require('./json-model'),
'object-model': require('./object-model'),
'ply-model': require('./ply-model'),
'three-model': require('./three-model'),
registerAll: function (AFRAME) {
if (this._registered) return;
AFRAME = AFRAME || window.AFRAME;
// THREE.AnimationMixer
if (!AFRAME.components['animation-mixer']) {
AFRAME.registerComponent('animation-mixer', this['animation-mixer']);
}
// THREE.PlyLoader
if (!AFRAME.systems['ply-model']) {
AFRAME.registerSystem('ply-model', this['ply-model'].System);
}
if (!AFRAME.components['ply-model']) {
AFRAME.registerComponent('ply-model', this['ply-model'].Component);
}
// THREE.FBXLoader
if (!AFRAME.components['fbx-model']) {
AFRAME.registerComponent('fbx-model', this['fbx-model']);
}
// THREE.JsonLoader
if (!AFRAME.components['json-model']) {
AFRAME.registerComponent('json-model', this['json-model']);
}
// THREE.ObjectLoader
if (!AFRAME.components['object-model']) {
AFRAME.registerComponent('object-model', this['object-model']);
}
// (deprecated) THREE.JsonLoader and THREE.ObjectLoader
if (!AFRAME.components['three-model']) {
AFRAME.registerComponent('three-model', this['three-model']);
}
this._registered = true;
}
};