Skip to content

Commit

Permalink
docs: Update curveTo/By bezier curve typedoc
Browse files Browse the repository at this point in the history
  • Loading branch information
eonarheim committed Nov 26, 2024
1 parent e82c0bd commit 4f995c5
Show file tree
Hide file tree
Showing 3 changed files with 24 additions and 2 deletions.
9 changes: 8 additions & 1 deletion src/engine/Actions/Action/CurveBy.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import { Action, nextActionId } from '../Action';

export interface CurveByOptions {
/**
* Curve relative to the current actor position to move
* Bezier Curve relative to the current actor position to move
*/
controlPoints: [control1: Vector, control2: Vector, end: Vector];
/**
Expand All @@ -20,6 +20,13 @@ export interface CurveByOptions {
*/
mode?: 'dynamic' | 'uniform';

/**
* Quality when sampling uniform points on the curve. Samples = 4 * quality;
*
* For bigger 'uniform' curves you may want to increase quality
*
* Default 4
*/
quality?: number;
}

Expand Down
10 changes: 9 additions & 1 deletion src/engine/Actions/Action/CurveTo.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import { Action, nextActionId } from '../Action';

export interface CurveToOptions {
/**
* Curve in world coordinates to animate towards
* Bezier Curve in world coordinates to animate towards
*
* The start control point is assumed to be the actor's current position
*/
Expand All @@ -21,6 +21,13 @@ export interface CurveToOptions {
* Default: 'dynamic'
*/
mode?: 'dynamic' | 'uniform';
/**
* Quality when sampling uniform points on the curve. Samples = 4 * quality;
*
* For bigger 'uniform' curves you may want to increase quality
*
* Default 4
*/
quality?: number;
}

Expand Down Expand Up @@ -79,6 +86,7 @@ export class CurveTo implements Action {
this._stopped = false;
}
stop(): void {
this._stopped = true;
this._currentMs = 0;
}
}
7 changes: 7 additions & 0 deletions src/engine/Math/bezier-curve.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,13 @@ export interface BezierCurveOptions {
* [start, control1, control2, end]
*/
controlPoints: [start: Vector, control1: Vector, control2: Vector, end: Vector];
/**
* Quality when sampling uniform points on the curve. Samples = 4 * quality;
*
* For bigger 'uniform' curves you may want to increase quality
*
* Default 4
*/
quality?: number;
}

Expand Down

0 comments on commit 4f995c5

Please sign in to comment.