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

damp3 and easing function #33

Open
tommhuth opened this issue Apr 4, 2023 · 2 comments
Open

damp3 and easing function #33

tommhuth opened this issue Apr 4, 2023 · 2 comments

Comments

@tommhuth
Copy link

tommhuth commented Apr 4, 2023

I'm trying to use the easeInOutCubic function from easings.net but that does not seem to work as the object just teleports to its destination

function easeInOutCubic(x: number): number { 
    return x < 0.5 ? 4 * x * x * x : 1 - Math.pow(-2 * x + 2, 3) / 2;
}

damp3(ref.current.position, p.current, 5, delta, 2, easeInOutCubic)

Changing smoothTime, lowering eps or maxSpeed does not seem to have any effect. What exactly does easing expect? When I try out the included rsqw there is a marginal improvement, with the object teleporting to its target with only a couple of frames in between. When console.loging the t param, it does not seem to follow the typical 0-1 range.

@deepansh96
Copy link

Hey I'm facing the same issue. Did you find any solution?

@amcc
Copy link

amcc commented Nov 16, 2024

I also have this problem - there is no easing, doing it like this:

   // in the render loop here values for x/y/z are changing
   const deltaTime = clock.getDelta();
   dummyMesh.position.set(x, y, z);
   easing.damp3(nose.position, dummyMesh.position, 0.00025, deltaTime);

Tried manually putting an array in place of the dummyMesh.position as in the example here:
https://github.com/pmndrs/maath/blob/main/README.md

Im find that quaternion easing is working fine using easing.dampQ in the same file

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

No branches or pull requests

3 participants