Niraj
Niraj

Reputation: 373

aframe physics gltf model model does not get parsed

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.

Upvotes: 0

Views: 413

Answers (1)

Piotr Adam Milewski
Piotr Adam Milewski

Reputation: 14655

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.

Upvotes: 1

Related Questions