playcanvas / playcanvas/engine

Allow creating a curve from values only

Open
#6,050 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

enhancement
Dominant language
JavaScript
Stars
16.8k
Forks
2k
Avg merge
4h 32m
Merged PRs (30d)
222

Description

This is a feature request to allow creating a curve only by supplying values. It is tedious creating an extra loop and calculating the normalized distance/time. It doesn't seem like one could create a curve without those, so why not let it be part of the curve itself? It would be nice, if pc.Curve would handle it on developer's behalf.

One option is to create an empty curve and have a method that would take an array of values, which calculates and populates the curve keys.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by locating the pc.Curve implementation and its existing key-construction API. Read how curve keys currently store values and normalized distance/time, then define the values-only creation path described in the issue. Done means a curve can accept an array of values and populate its keys without caller-side looping or normalization.

Written by the indexing model from the issue text.

Assessment

Tech stack
javascript
Domain
game-dev
Issue type
Feature
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.