File size: 3,034 Bytes
73c6193
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
var THREE = require('three');

var glAvatarSystem = {

    curSkeleton: {
        name: null,
        scene: null
        // sceneID: null
        // asset: null
    },

    curVisibilityArray: null,

    curAccessories: {
        clothes: {
            name: null,
            scene: null
            // sceneID: null
            // asset: null
        },
        hair: {
            name: null,
            scene: null
            // sceneID: null
            // asset: null
        },
        face: {
            name: null,
            scene: null
        },
        instrument: {
            name: null,
            scene: null
        }
    },

    // assets
    skeletons: {},

    accessories: {
        clothes: {},
        hair: {},
        face: {},
        instrument: {}
    },



    repo: {
        skeletons: {
            // 'mixamo': {
            //     url: 'models/gltf/saber-body-mixamo-animations/saber-body-animations.gltf',
            //     // scene info (camera, light)
            //     cameraPos: new THREE.Vector3(1.5, 2, 1.5),
            //     center: new THREE.Vector3(0, 0.8, 0),
            //     objectRotation: new THREE.Euler(0, 180, 0),
            //     // init skins
            //     skins: {
            //         hair: 'maid',
            //         clothes: 'maid-dress'
            //     }
            // },
            // 'stand-pose': {
            //     url: 'models/gltf/saber-stand-pose/saber-stand-pose.gltf',
                
            //     cameraPos: new THREE.Vector3(1.5, 2, 1.5),
            //     center: new THREE.Vector3(0, 0.8, 0),
            //     objectRotation: new THREE.Euler(0, 180, 0),

            //     skins: {
            //         hair: 'lily',
            //         clothes: 'maid-dress'
            //     }
            // },
            'no-face': {
                url: 'models/gltf/saber-mixamo-body-no-face/saber-body-animations.gltf',
                
                cameraPos: new THREE.Vector3(1.5, 2, 1.5),
                center: new THREE.Vector3(0, 0.8, 0),
                objectRotation: new THREE.Euler(0, 180, 0),

                skins: {
                    hair: 'maid',
                    clothes: 'maid-dress',
                    face: 'saber'
                }
            }

        },

        // skins
        clothes: {
            'maid-dress': 'models/gltf/saber-dress-mixamo/saber-dress.gltf',
            'suit': 'models/gltf/saber-suit/saber-suit.gltf'
        },
        hair: {
            'maid': 'models/gltf/saber-maid-hair-mixamo/saber-maid-hair.gltf',
            'lily': 'models/gltf/saber-lily-hair-sub-skeleton/saber-lily-hair-sub-skeleton.gltf'
        },
        
        face: {
            'saber': 'models/gltf/saber-face/saber-face.gltf',
            'eriri': 'models/gltf/saber-face/eriri-face-test.gltf'
        },


        instrument: {
            
        }
    },

    isLoaded: function (type, key) {
        return key in this.accessories[type];
    }
};

export { glAvatarSystem };