File tree Expand file tree Collapse file tree 2 files changed +20
-0
lines changed
Expand file tree Collapse file tree 2 files changed +20
-0
lines changed Original file line number Diff line number Diff line change @@ -122,6 +122,7 @@ import { Material } from "@/materials/Material.js"
122122import { Texture } from "@/textures/Texture.js"
123123import { MeshPhysicalMaterial } from "@/materials/MeshPhysicalMaterial.js"
124124import { Vector2 } from "@/math/Vector2.js"
125+ import { Skeleton } from "@/objects/Skeleton.js"
125126
126127class GLTFLoader extends Loader {
127128 constructor ( manager ) {
Original file line number Diff line number Diff line change @@ -289,6 +289,7 @@ export class App {
289289 this . loadMaterial ( )
290290 this . loadModel ( )
291291 // this.loadGLTF()
292+ // this.loadHair()
292293 // this.loadJSON()
293294 // this.loadCustomModel()
294295 if ( this . state . postProcessing ) {
@@ -735,6 +736,14 @@ export class App {
735736
736737 async loadModel ( ) {
737738 const group = new Group ( )
739+ const loader = new GLTFLoader ( loadingManager )
740+ loader . load ( "/hair/hair.glb" , ( gltf ) => {
741+ window . OPENHUMAN . gltf = gltf
742+ let scene = gltf . scene || gltf . scenes [ 0 ]
743+ group . add ( scene )
744+ // this.loadContent(scene, clips)
745+ } )
746+
738747 this . scene . add ( group )
739748 // const textureLoader = new TextureLoader(loadingManager)
740749
@@ -878,6 +887,16 @@ export class App {
878887 } )
879888 }
880889
890+ async loadHair ( ) {
891+ const loader = new GLTFLoader ( loadingManager )
892+ loader . load ( "/hair/hair.glb" , ( gltf ) => {
893+ window . OPENHUMAN . gltf = gltf
894+ let scene = gltf . scene || gltf . scenes [ 0 ]
895+ let clips = gltf . animations || [ ]
896+ this . loadContent ( scene , clips )
897+ } )
898+ }
899+
881900 async loadGLTF ( ) {
882901 const loader = new GLTFLoader ( loadingManager )
883902 loader . load ( "/facetoy/facetoy.glb" , ( gltf ) => {
You can’t perform that action at this time.
0 commit comments