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.
in our application we are trying to change Aframe with cannon to aframe with ammo.
We get load the model well by this way:
First loading the model then the ammo-body.
When the model is loaded, the event loads ammo-shape (the collison mesh) and then when the body is loaded we set the restitution.
const gltfmodel = document.getElementById(this.data.id)
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)
gltfmodel.addEventListener('model-loaded', () => {
gltfmodel.setAttribute('ammo-shape', {type: this.data.shape,
fit: this.data.fit,
halfExtents: this.data.halfExtents,
offset: this.data.offset})
});
gltfmodel.addEventListener('body-loaded', () => {
try {
var sceneEl = document.querySelector('a-scene');
//Set robot restitution
sceneEl.querySelector("#"+toString(this.data.id)).body.setRestitution(this.data.restitution);
//Set a-plane restitution
sceneEl.querySelector("#a-plane").body.setRestitution(0.8);
} catch (e) {}
}
})
It works really well in Firefox but the body-loaded event doesn't work quite right for Chrome. This event 'body-loaded' is not picked up properly in chrome, do you have any idea what could be happening?
The text was updated successfully, but these errors were encountered:
martaquintana
changed the title
Problem with event body-loaded in Chrome
AMMO DRIVER Problem with event body-loaded in Chrome
Jan 25, 2022
Hello!!
in our application we are trying to change Aframe with cannon to aframe with ammo.
We get load the model well by this way:
First loading the model then the ammo-body.
When the model is loaded, the event loads ammo-shape (the collison mesh) and then when the body is loaded we set the restitution.
It works really well in Firefox but the body-loaded event doesn't work quite right for Chrome. This event 'body-loaded' is not picked up properly in chrome, do you have any idea what could be happening?
The text was updated successfully, but these errors were encountered: