You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on May 23, 2024. It is now read-only.
When adding ammo-body and ammo-shape components to a loaded gltf-model I get error "Cannot use FIT.ALL without object3DMap.mesh" it seems that the ammo is trying to create a ammo-shape before model loaded.
This is what currently causes the error:
I've created a workaround for now in my A-frame project for now with an A-frame component like so:
const gltfPhysicsObjectComponent = {
schema: {
model: {default: ''},
body: {type: 'string', default: 'dynamic'}, //dynamic: A freely-moving object.
shape: {type: 'string', default: 'hull'}, // hull: Wraps a model in a convex hull, like a shrink-wrap
},
init() {
const gltfmodel = document.createElement('a-entity')
this.el.appendChild(gltfmodel)
gltfmodel.setAttribute('gltf-model', this.data.model)
gltfmodel.setAttribute('shadow', {receive: false})
// Specify what type of ammo-body (dynamic, static, kinematic)
gltfmodel.setAttribute('ammo-body', {type: this.data.body})
// Waiting for model to load before adding ammo-shape (box, cylinder, sphere, capsule, cone, hull)
this.el.addEventListener('model-loaded', () => {
gltfmodel.setAttribute('ammo-shape', {type: this.data.shape})
})
},
}
export {gltfPhysicsObjectComponent}
The ammo component as of now works great with primitives but not with gltf models. This is my current workaround for now...
The text was updated successfully, but these errors were encountered:
When adding ammo-body and ammo-shape components to a loaded gltf-model I get error "Cannot use FIT.ALL without object3DMap.mesh" it seems that the ammo is trying to create a ammo-shape before model loaded.
This is what currently causes the error:
I've created a workaround for now in my A-frame project for now with an A-frame component like so:
The ammo component as of now works great with primitives but not with gltf models. This is my current workaround for now...
The text was updated successfully, but these errors were encountered: