n5ro / aframe-physics-system

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

Ammo: bounding box not scaling, if parent entity is scaled #132

Open Zweidrittelstein opened 5 years ago

Zweidrittelstein commented 5 years ago

Rescaling of entities with an ammo-body works fine, but if I rescale their parent entities, the collision box does not rescale.

I provided a small example which shows the problem - pressing x rescales the boxes and works fine, while pressing y rescales the parent entity and leaves the colission boxes untouched:

https://glitch.com/edit/#!/dune-anteater

InfiniteLee commented 5 years ago

Thanks for reporting this. I think _updateShapes just needs to be updated to use WorldScale instead of just local scale, though it might be more complicated than that. Scale has been a tricky thing to get working correctly with ammo. https://github.com/donmccurdy/aframe-physics-system/blob/9d121c4b54bae03893e51a1e1c36e5865de55237/src/components/body/ammo-body.js#L175