bevyengine / bevyengine/bevy

Sampling fixed distance segments of a curve

Open
#8,493 2 comments 5 reactions 0 assignees View on GitHub
A-Math C-Feature D-Modest S-Ready-For-Implementation
Dominant language
Rust
Stars
48.2k
Forks
4.8k
Avg merge
3d 16h
Merged PRs (30d)
171

Description

## What problem does this solve or what need does it fill?

Some curve types have a property that equally distanced interpolations are not resulting in equal length segments. But this is important when it's needed to move something along a curve at constant speed. For example, train along the tracks, or some animation.

## What solution would you like?

Helper method on Cubic spline that returns points that are equally distanced from each other along the curve.

## What alternative(s) have you considered?

There is a method (`iter_sample`) that accepts a arbitrary sampling function which might be used as described in [this book about Bezier curves](https://pomax.github.io/bezierinfo/#tracing)

Contributor guide

Open the contributing guide

Research direction

Start by reading the Cubic spline API and the existing iter_sample method, then review the linked Bezier-curve tracing reference to understand the intended sampling behavior. Done means the spline offers a helper for points with equal distances along the curve and the behavior is documented or validated against the stated constant-speed use case.

Written by the indexing model from the issue text.

Assessment

Tech stack
rust
Domain
computer-graphics, game-dev
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.