Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Need newer buffered-interpolation version with newer threejs (r128) #280

Closed
vincentfretin opened this issue May 8, 2021 · 9 comments
Closed

Comments

@vincentfretin
Copy link
Member

The documentation is wrong, we don't use aframe-lerp-component since may 2018 e15f342. We use buffered-interpolation to update position, rotation, scale.
=> Update the README.md and CONTRIBUTING.md

@vincentfretin
Copy link
Member Author

Also @arpu did a fix for recent threejs in InfiniteLee/buffered-interpolation#6
@InfiniteLee Are you interested to move buffered-interpolation to the networked-aframe organization so we can maintain it there and make new releases?
Another solution for the networked-aframe community is to fork it and release it as @networked-aframe/buffered-interpolation. But I want to ask you @InfiniteLee first before doing this.

@vincentfretin
Copy link
Member Author

@netpro2k merged a similar PR InfiniteLee/buffered-interpolation#7
Does somebody other than @InfiniteLee have the right to publish a new version on npmjs.com?

@vincentfretin
Copy link
Member Author

Note that the slerpQuaternions change is not compatible with aframe 1.2.0 / three r125, so I won't include this change in a new networked-aframe version until aframe updates threejs to at least r128.

@vincentfretin vincentfretin changed the title We don't use aframe-lerp-component but buffered-interpolation Need newer buffered-interpolation version with newer threejs (r128) Jul 28, 2021
@vincentfretin
Copy link
Member Author

If you have your own aframe build with threejs r128, you can create your own networked-aframe build with in package.json:

"buffered-interpolation": "github:Infinitelee/buffered-interpolation"

@vincentfretin
Copy link
Member Author

Folks are still using aframe 1.0.4 or 1.1.0 with latest networked-aframe. So if aframe updates threejs and we update networked-aframe to use the latest version of buffered-interpolation, it would mean networked-aframe won't support old aframe versions anymore. :(

Maybe we can find a way to support both deprecated and new api in buffered-interpolation in our own fork? We will think about it again when aframe update to recent threejs.

@vincentfretin
Copy link
Member Author

I don't think adding a condition to check THREE version in the InterpolationBuffer.slerp method would be a good idea for perf reason, because this is executed on each tick.
Maybe define this.slerp inside the InterpolationBuffer class constructor to define a different slerp method based on THREE version? I didn't test but maybe something like that could work?

class InterpolationBuffer {
  constructor(mode = MODE_LERP, bufferTime = 0.15) {
    if (parseInt(THREE.REVISION, 10) < 128) { // or lower 126 or 127?
      this.slerp = function(target, r1, r2, alpha) {
        THREE.Quaternion.slerp(r1, r2, target, alpha);
      }
    } else {
      this.slerp = function(target, r1, r2, alpha) {
        target.slerpQuaternions(r1, r2, alpha);
      }
    }
    
    // ....
  }

@vincentfretin
Copy link
Member Author

What do you folks think? Do I need to bother about compatibility with older aframe/threejs like this?
Or just release aframe 0.9.0 compatible only with aframe 1.3.0? It means that all new improvements to naf won't be usable for aframe older than 1.3.0.

@arpu
Copy link
Member

arpu commented Oct 4, 2021

i think we should loose compatibility for aframe < 1.3.0, and look forward

@vincentfretin
Copy link
Member Author

Ok, that will be less work for me. :)
In this case, I'll just use "buffered-interpolation": "github:Infinitelee/buffered-interpolation" and update all examples to use aframe 1.3.0 and do a breaking release once aframe 1.3.0 is released.

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

No branches or pull requests

2 participants