Closed elkizana closed 8 months ago
sure you can look at chess demo
what comes after : phy.load("object.glb") ? No need for material
when I try importing a simple box i get this error :
GLTFLoader.js:219 TypeError: Cannot read properties of undefined (reading 'traverse') at Object.onComplete [as callback] (<anonymous>:47:21) at Object.next (Pool.js:342:25) at Object.add (Pool.js:183:14) at Pool.js:540:18 at GLTFLoader.js:241:6 at GLTFLoader.js:2630:5
you need a callback when loading complete
phy.load("yourObject.glb", onComplete)
onComplete = () => {
let scene = phy.getGlb('yourObject');// is your main scene
let mat = phy.getGlbMaterial('yourObject');// list of material
let mesh = phy.getMesh('yourObject' );// for all mesh ex: mesh.model1
let group = phy.getGroup('yourObject' );// for all group
}
Thank you for your work it is a big thing making all of this work alone how the engine adds collision to the mesh ? convex mesh ?
Could you add a simple example to how to add a gdb model to the scene ?