Skip to content

damp3 and easing function #33

Description

@tommhuth

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions