0
votes

I have found that, for some gltf models, the aframe-physics-system component fails to parse the model to create a wireframe around it even though the model is set as

dynamic-body="shape: box"

For example: this model from sketchfab https://sketchfab.com/models/183df4dd59ea433cb7ebaf824ca8a0e1

You can download this model and try it. Here is a glitch: https://gltf-physics-body.glitch.me/

I would like to understand what causes this and what can I change in the model so that the physics system parses the model correctly and a wire frame gets created. I am using v3.3.0 of Don Mccurdy's aframe-physics-system component.

1
FWIW, there’s a syntax error in your attribute. It’s dynamic-body="shape: box" instead of dynamic-body=""shape: box". Share a complete runnable example to reproduce. glitch.com recommended.Diego Marcos
Sure, let me set it up on glitch. Thanks for pointing out that typo. I just checked it is only in this question and not in my code.Niraj
Diego, I have now added a glitch. I found out that the parsing does occur and a wireframe gets created. However, the box wireframe around this model is so disproportionate to the actual size of the model that I could not notice it with other entities also being present in the scene. Is there a way to reduce the size of this wireframe?Niraj
I just found a work around. Adding shape as sphere and sphereRadius as .5 lets me create a smaller wireframe around the model compared to the box. Not a great solution though because sphere is not as good in performance as box.Niraj

1 Answers

1
votes

The aframe-physics system is working properly, the models bounding box is huge:

max: Object { x: 52.938771493434906, y: 11.528830817271185, z: 3.777786217664259 }
min: Object { x: -54.23814415216446, y: -25.79608226649673, z:-163.07075444090813 }

fiddle here.

Either:
1) open up the .gltf model in blender and check if it contains more than the standing guy. Remove all unnecessary stuff, and export a new .gltf model.
2) adjust the physics shape manually static-body='shape: sphere; sphereRadius: 0.1". Fiddle here.