Closed Toseben closed 7 years ago
The built-in obj-model
and collada-model
components fire an event when they finish loading, something like this:
el.emit('model-loaded', {format: 'obj', model: object});
If the model isn't available immediately, the physics system will wait until the scene loads to initialize. The problem you're seeing, most likely, is that the model is inconsistently loaded before or after the scene. So, you'll need to fire an event like that, after adding the model, to let the physics system know it can check again.
I'm facing a issue when trying to create collision geometries with static-body flag. I have created a custom loader component to update the loading screen progress bar.
However when using it, the results from static-body are inconsistent. Sometimes on page load both object don't have collisions, sometimes one has and sometimes both do. This is most likely something to do with the loading order of objects.
The whole page is here: https://toseben.github.io/interactive_webViz/aframe_defineComponent.html
I already fixed the issue by approaching the loading differently, by using with a custom shader instead.
https://toseben.github.io/interactive_webViz/aframe_collision.html