Skip to content

Evaluation by time doesn't take in account tangents X-axis #1

Open
@arkaht

Description

@arkaht

The method Curve::evaluate_by_time doesn't take in account the X-axis of tangents, making it useless inside the editor.

As the code suggests, it isn't implemented yet, some tries have been made but the results are not satisfying enough:

// Compute tangents Y-positions
/*const float y1 = p0.y + atan2f( t1.y / m1, t1.x / m1 ) * time_diff * m1 / 3.0f;
const float y2 = p3.y + atan2f( t2.y / m2, t2.x / m2 ) * time_diff * m2 / 3.0f;*/
const float y1 = p0.y + t1.y;
const float y2 = p3.y + t2.y;
return Utils::bezier_interp( p0.y, y1, y2, p3.y, t );

I have looked into Unreal's code and to A Primer on Bézier Curves but I still can't wrap my head around the mathematics behind their implementations to make the tangent weights working as expected.

As a side note, this small yet major change would force any existing timed-based curves to be re-made to correspond to the new behavior.

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or requesthelp wantedExtra attention is needed

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions