n5ro / aframe-physics-system

Physics system for A-Frame VR, built on CANNON.js.
https://n5ro.github.io/aframe-physics-system/
MIT License
505 stars 136 forks source link

Animated GLTF models issue #179

Open netgfx opened 3 years ago

netgfx commented 3 years ago

Animated models do not receive collisions with either dynamic or static body type. Also shape property doesn't seem to be doing something. Am I missing something or is it not supported?

gftruj commented 3 years ago

As for primitive shapes I think it's because of the same reason why bounding boxes of skinned meshes are off (see this SO answer). If you'd like a collision box which updates itself with the model animation I can re-use what I've done in the said SO thread and make a component out of it.

Although I personally would try using some collision boxes attached to certain bones. It would be more accurate, and less heavy. Actually this could be an idea for another component mapping shapes to bones 😄

edit A component which will create colliders for bones seemed like a neat idea so I've made a one. You can see it working here or here.