Skip to content
This repository has been archived by the owner on May 23, 2024. It is now read-only.

Broken in A-Frame 1.2.0 #187

Open
crcdng opened this issue Feb 6, 2021 · 21 comments
Open

Broken in A-Frame 1.2.0 #187

crcdng opened this issue Feb 6, 2021 · 21 comments

Comments

@crcdng
Copy link

crcdng commented Feb 6, 2021

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
@kylebakerio
Copy link
Contributor

came here to report this as well.

https://glitch.com/edit/#!/1-2-0-colorbug

^this glitch shows the error cropping up

Seems to be from the embedded cannon minified line.

@AdaRoseCannon
Copy link

Unfortunately AFrame 1.2.0 fixes some breaking WebXR issues which is forcing people to update to it.

@AdaRoseCannon
Copy link

Using the Ammo mode fixed the issue and is a good work around.

@crcdng
Copy link
Author

crcdng commented Feb 12, 2021

Unfortunately AFrame 1.2.0 fixes some breaking WebXR issues which is forcing people to update to it.

True. I am quite happy with 1.2.0, it's just that every component who touches the removed three.js Geometry object and other parts of the API has stopped working. I have started to dive into three and fix things but it's not necessarily my happy place.

@crcdng
Copy link
Author

crcdng commented Feb 12, 2021

Using the Ammo mode fixed the issue and is a good work around.

Can you elaborate a bit about Ammo mode?

@crcdng
Copy link
Author

crcdng commented Feb 12, 2021

True. I am quite happy with 1.2.0, it's just that every component who touches the removed three.js Geometry object and other parts of the API has stopped working. I have started to dive into three and fix things but it's not necessarily my happy place.

I opened an issue at A-Frame extras as well c-frame/aframe-extras#348 (comment)

I hope we can do some common effort to update components.

@AdaRoseCannon
Copy link

Using the Ammo mode fixed the issue and is a good work around.

Can you elaborate a bit about Ammo mode?

https://github.com/n5ro/aframe-physics-system/blob/master/AmmoDriver.md#installation

@arpu
Copy link
Contributor

arpu commented Feb 12, 2021

this is needed donmccurdy/three-to-cannon#32

@crcdng
Copy link
Author

crcdng commented Feb 12, 2021

this is needed donmccurdy/three-to-cannon#32

Thanks for the pointer. Do I understand that this thing kind of injects an API around the API, specifically for the physics component? I would suggest to update the aframe-physics-system component such that it works as a component out of the box again.

@arpu
Copy link
Contributor

arpu commented Feb 12, 2021

aframe-physics-system depend on three-to-cannon package see https://github.com/n5ro/aframe-physics-system/blob/master/package.json#L46

@crcdng
Copy link
Author

crcdng commented Feb 12, 2021

aframe-physics-system depend on three-to-cannon package see https://github.com/n5ro/aframe-physics-system/blob/master/package.json#L46

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.

@gearcoded
Copy link

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.

@n5ro
Copy link
Owner

n5ro commented Apr 20, 2021

The Aframe Physics System Cannon version is not working temporarily because it calls the depreciated THREE.Geometry. I opened an issue, I am working on a fix and inviting others to help. In the meantime use Aframe Physics System the Ammo version. #189

@donmccurdy
Copy link
Collaborator

Some progress on three-to-cannon coming soon, see #189 (comment).

epic-developer added a commit to epic-developer/aframe that referenced this issue May 19, 2021
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 maintaining frame-physics-system in [this blog post](https://www.donmccurdy.com/2020/09/06/projects-up-for-adoption/). Developers using this physics system are well aware of this bug and no official solution has been created yet. Possible solutions are being discussed [here](n5ro/aframe-physics-system#187) but since it has been unusable for quite a while now, I think it would be reasonable to warn people that it may not work properly.
@kylebakerio
Copy link
Contributor

kylebakerio commented Aug 28, 2021

@n5ro apologies if I'm missing something, but the fork from @gearcoded is working for me to get superhands working (with one small line commented out that seemed to be missed, which I've pull requested on his fork).

Is it not possible to get a preliminary release out that uses that fork, for some reason, so that this library works in 1.2.0? I'm still getting errors when I try latest release or master branch here, didn't notice if there's some other branch to be trying...?

Here's my patch on gearcoded's fork that does the same inverse->invert update and removes that one missed line I found, and seems to be working with 1.2.0 and, for example here, super-hands and aframe-physics-extras:

patched fork:
https://github.com/kylebakerio/aframe-physics-system/tree/patch-1 (see: dist -> aframe-physics-system.js)

glitch showing working example:
view code: https://glitch.com/edit/#!/super-hands-demo?path=index.html%3A17%3A26
open in quest: https://super-hands-demo.glitch.me/

@cszach
Copy link

cszach commented Nov 2, 2021

Easiest solution: Import from examples/js/deprecated/Geometry.js in three.js:

<script src="https://cdn.jsdelivr.net/gh/mrdoob/three.js@r134/examples/js/deprecated/Geometry.js"></script>

@kylebakerio
Copy link
Contributor

@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.

dmarcos added a commit to aframevr/aframe that referenced this issue Jan 18, 2022
* 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 maintaining frame-physics-system in [this blog post](https://www.donmccurdy.com/2020/09/06/projects-up-for-adoption/). Developers using this physics system are well aware of this bug and no official solution has been created yet. Possible solutions are being discussed [here](n5ro/aframe-physics-system#187) but since it has been unusable for quite a while now, I think it would be reasonable to warn people that it may not work properly.

* Update wording and links

Co-authored-by: Diego Marcos <diego.marcos@gmail.com>
@Yash-Punia
Copy link

@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?

@aaweb
Copy link

aaweb commented May 17, 2022

@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?

same issue here. Anyone got a working glitch of aframe-physics-system and aframe 1.3? Not even the official sample on https://aframe.io/docs/1.3.0/introduction/html-and-primitives.html works :(

@AdaRoseCannon
Copy link

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.

@kylebakerio
Copy link
Contributor

I thought I had seen you post an updated working physics example and intended to hunt it down and link to it, Ada. Glad you stopped by yourself!

I'm not very active in A-Frame right now, but I did the bare minimum for now and added a brief link to this here: https://aframe.wiki/en/physics

So, for anyone in the future wanted to remember how to get back here, that's a good spot.

(Also, join with github and contribute more detailed update to that page, would be super helpful!)

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

10 participants