From 4f995c5611755540ca3a5e0fa7ad6bfe3ed9e43d Mon Sep 17 00:00:00 2001 From: Erik Onarheim Date: Tue, 26 Nov 2024 08:06:29 -0600 Subject: [PATCH] docs: Update curveTo/By bezier curve typedoc --- src/engine/Actions/Action/CurveBy.ts | 9 ++++++++- src/engine/Actions/Action/CurveTo.ts | 10 +++++++++- src/engine/Math/bezier-curve.ts | 7 +++++++ 3 files changed, 24 insertions(+), 2 deletions(-) diff --git a/src/engine/Actions/Action/CurveBy.ts b/src/engine/Actions/Action/CurveBy.ts index 9a56f7226..be74b0bd2 100644 --- a/src/engine/Actions/Action/CurveBy.ts +++ b/src/engine/Actions/Action/CurveBy.ts @@ -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]; /** @@ -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; } diff --git a/src/engine/Actions/Action/CurveTo.ts b/src/engine/Actions/Action/CurveTo.ts index 33236a797..e136b60a1 100644 --- a/src/engine/Actions/Action/CurveTo.ts +++ b/src/engine/Actions/Action/CurveTo.ts @@ -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 */ @@ -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; } @@ -79,6 +86,7 @@ export class CurveTo implements Action { this._stopped = false; } stop(): void { + this._stopped = true; this._currentMs = 0; } } diff --git a/src/engine/Math/bezier-curve.ts b/src/engine/Math/bezier-curve.ts index c7fb1c13a..dcc0e056e 100644 --- a/src/engine/Math/bezier-curve.ts +++ b/src/engine/Math/bezier-curve.ts @@ -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; }