aframe-physics-system: Broken in A-Frame 1.2.0
Geometry
was completely removed in three.js 125 which is used in A-Frame 1.2.0
https://github.com/mrdoob/three.js/wiki/Migration-Guide
With the current main branch of aframe-physics-system:
aframe-physics-system.js:14331 Uncaught TypeError: t.Geometry is not a constructor
at u (aframe-physics-system.js:14331)
at o (aframe-physics-system.js:14331)
at initBody (aframe-physics-system.js:15151)
at HTMLElement.emit (aframe-v1.2.0.min.js:2586)
at aframe-v1.2.0.min.js:2586
About this issue
- Original URL
- State: open
- Created 3 years ago
- Reactions: 15
- Comments: 21 (7 by maintainers)
Links to this issue
Commits related to this issue
- Warning on html-and-primitives.md aframe-physics-system does not work and has not worked with the newer version(s) of A-Frame for the past few months. Don McCurdy warned that they would stop maintain... — committed to epic-developer/aframe by epic-developer 3 years ago
- Warning on html-and-primitives.md (#4860) * Warning on html-and-primitives.md aframe-physics-system does not work and has not worked with the newer version(s) of A-Frame for the past few months. D... — committed to aframevr/aframe by epic-developer 2 years ago
Easiest solution: Import from
examples/js/deprecated/Geometry.js
in three.js:Here is the fork of the dist file where it works with A-Frame 1.2: https://github.com/gearcoded/aframe-physics-system/blob/master/dist/aframe-physics-system.js
You can add it to this repository. As I understand, you at least need to update some functions to the new Three.js logic.
@novakcgx it’s not working with AFrame v1.3 and gives the following error:
Uncaught TypeError: Cannot read properties of undefined (reading 'addVectors')
Do you have any other ideas?@novakcgx That’s super, nice find.
Do keep in mind that there are real performance benefits to moving away from the deprecated Geometry.js, though, so this should still be regarded as a temp solution.
Great to have that, though, that should allow full compatibility if it works as expected.
Ah, you mean the maintainers of
three-to-cannon
needs to fix this so the maintainers of aframe-physics-system
can fix that. Got it.Here is an example of it working: https://github.com/AdaRoseCannon/aframe-xr-boilerplate/blob/9424510ff01fd478b74780ef240473eea7f948e3/index.html
Note I anchored it to a particular commit because in recent versions I started using a modified version of physx instead.
Some progress on
three-to-cannon
coming soon, see https://github.com/n5ro/aframe-physics-system/issues/189#issuecomment-826034515.Unfortunately AFrame 1.2.0 fixes some breaking WebXR issues which is forcing people to update to it.