Skip to content

Add @typedef AnimCurveTarget #7349

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

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
25 changes: 23 additions & 2 deletions src/framework/anim/evaluator/anim-curve.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,24 @@
/**
* @example
* [
* {
* "entityPath": [
* "RootNode",
* "AVATAR",
* "C_spine0001_bind_JNT"
* ],
* "component": "graph",
* "propertyPath": [
* "localPosition"
* ]
* }
* ]
* @typedef {object} AnimCurveTarget
* @property {string[]} entityPath - The path to the entity.
* @property {string} component - The component name.
* @property {string[]} propertyPath - The path to the property.
*/

/**
* Animation curve links an input data set to an output data set and defines the interpolation
* method to use.
Expand All @@ -8,7 +29,7 @@ class AnimCurve {
/**
* Create a new animation curve.
*
* @param {string[]} paths - Array of path strings identifying the targets of this curve, for
* @param {(string|AnimCurveTarget)[]} paths - Array of path strings identifying the targets of this curve, for
* example "rootNode.translation".
* @param {number} input - Index of the curve which specifies the key data.
* @param {number} output - Index of the curve which specifies the value data.
Expand All @@ -28,7 +49,7 @@ class AnimCurve {
/**
* The list of paths which identify targets of this curve.
*
* @type {string[]}
* @type {(string|AnimCurveTarget)[]}
*/
get paths() {
return this._paths;
Expand Down