n5ro / aframe-physics-system

Physics system for A-Frame VR, built on CANNON.js.

Home Page:https://n5ro.github.io/aframe-physics-system/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

THREE deprecation warning for a function in tick() has caused my entire OS to crash.

kylebakerio opened this issue · comments

It's technically really the fault of THREE and A-Frame, to some extent, but since they refuse to deal with logging...

These calls:
https://github.com/n5ro/aframe-physics-system/search?q=inverse

now need to be invert, in the version of THREE that A-Frame is now using as of 1.1.0.

I know most of these are just, whatever, too much to keep up with, but because it's in a tick() handler, it's basically makes the console unusable, so it might be worth updating this one.

As I listed here first:
c-frame/aframe-super-hands-component#189

inverse | @ | three.js:37223
-- | -- | --
  | Body.syncFromPhysics | @ | aframe-physics-system.js:17403
  | step | @ | aframe-physics-system.js:17280
  | tick | @ | aframe-physics-system.js:19025
  | tick | @ | a-scene.js:746
  | render | @ | a-scene.js:790
  | bound | @ | bind.js:12

This was when using superhands with this library for physics.

Note that I did also mention this to A-Frame, as I really think they should handle it:
aframevr/aframe#4767

But I also don't think they will.

In the meantime I've just finally hacked console.log/warn/error globals myself and silenced them locally, but that feels a bit absurd, personally.

...I also think that checking if every warn message contains "THREE" in its first five chars hundreds to thousands of times per minute is still a significant overhead to the system, so I'm going to just try to do a built with those functions changed.

I'm happy to do a pull request, but I presume this will break for prior versions of A-Frame using prior versions of THREE. Either the code would need to be rewritten into some way to avoid the breaking function call (maybe just copy/pasting the .inverse()/invert() method itself as a hack for now? Maybe doing a THREE version check? I don't really have deep damiliarity with THREE or this library, so my ability beyond those two options is limited / would require extensive coming-up-to-speed that I doubt I'd get to), or this library would just have to list that projects using A-Frame prior to 1.04 require no newer version of aframe-physics-system.

Thoughts?