import {QuadraticBezierCurve} from '@xeokit/xeokit-sdk/src/viewer/scene/paths/QuadraticBezierCurve.js'QuadraticBezierCurve
A QuadraticBezierCurve is a Curve along which a 3D position can be animated.
- As shown in the diagram below, a QuadraticBezierCurve is defined by three control points
- You can sample a QuadraticBezierCurve#point and a Curve#tangent vector on a QuadraticBezierCurve for any given value of QuadraticBezierCurve#t in the range
[0..1] - When you set QuadraticBezierCurve#t on a QuadraticBezierCurve, its QuadraticBezierCurve#point and Curve#tangent will update accordingly.
- To build a complex path, you can combine an unlimited combination of QuadraticBezierCurves, CubicBezierCurves and SplineCurves into a Path.
Quadratic Bezier Curve from WikiPedia
Constructor Summary
| Public Constructor | ||
| public |
constructor(owner: Component, cfg: *) |
|
Member Summary
| Public Members | ||
| public get |
point: * Point on this QuadraticBezierCurve at position QuadraticBezierCurve/t. |
|
| public set |
Sets the progress along this QuadraticBezierCurve. |
|
| public get |
Gets the progress along this QuadraticBezierCurve. |
|
| public set |
Sets the starting point on this QuadraticBezierCurve. |
|
| public get |
Gets the starting point on this QuadraticBezierCurve. |
|
| public set |
Sets the middle control point on this QuadraticBezierCurve. |
|
| public get |
Gets the middle control point on this QuadraticBezierCurve. |
|
| public set |
Sets the end point on this QuadraticBezierCurve. |
|
| public get |
Gets the end point on this QuadraticBezierCurve. |
|
Method Summary
| Public Methods | ||
| public |
getJSON(): {"v0": *, "v1": *, "v2": *, "t": *} |
|
| public |
Returns the point on this QuadraticBezierCurve at the given position. |
|
Inherited Summary
| From class Component | ||
| public get |
The Component that owns the lifecycle of this Component, if any. |
|
| public |
True as soon as this Component has been destroyed |
|
| public |
ID of this Component, unique within the Scene. |
|
| public |
meta: * Arbitrary, user-defined metadata on this component. |
|
| public |
The parent Scene that contains this Component. |
|
| public |
The viewer that contains this Scene. |
|
| public |
clear() Destroys all Components that are owned by this. |
|
| public |
destroy() Destroys this component. |
|
| public |
Logs an error for this component to the JavaScript console. |
|
| public |
Fires an event on this component. |
|
| public |
Returns true if there are any subscribers to the given event on this component. |
|
| public |
Tests if this component is of the given type, or is a subclass of the given type. |
|
| public |
Logs a console debugging message for this component. |
|
| public |
Cancels an event subscription that was previously made with Component#on or Component#once. |
|
| public |
Subscribes to an event on this component. |
|
| public |
Subscribes to the next occurrence of the given event, then un-subscribes as soon as the event is subIdd. |
|
| public |
Logs a warning for this component to the JavaScript console. |
|
| From class Curve | ||
| public get |
Gets the length of this Curve. |
|
| public get |
Gets the progress along this Curve. |
|
| public set |
Sets the progress along this Curve. |
|
| public get |
tangent: *: * Gets the tangent on this Curve at position Curve#t. |
|
| public |
|
|
| public |
|
|
| public |
getPointAt(u: *): * |
|
| public |
Samples points on this Curve, at the given number of equally-spaced divisions. |
|
| public |
getTangent(t: Number): * Returns a normalized tangent vector on this Curve at the given position. |
|
| public |
getUToTMapping(u: *, distance: *): * |
|
Public Constructors
public constructor(owner: Component, cfg: *) source
Override:
Curve#constructorParams:
| Name | Type | Attribute | Description |
| owner | Component | Owner component. When destroyed, the owner will destroy this MetallicMaterial as well. |
|
| cfg | * |
|
Configuration |
| cfg.id | String |
|
Optional ID, unique among all components in the parent {{#crossLink "Scene"}}Scene{{/crossLink}}, generated automatically when omitted. |
| cfg.v0 | Number[] |
|
The starting point. |
| cfg.v1 | Number[] |
|
The middle control point. |
| cfg.v2 | Number[] |
|
The end point. |
| cfg.t | Number[] |
|
Current position on this QuadraticBezierCurve, in range between |
Public Members
public get point: * source
Point on this QuadraticBezierCurve at position QuadraticBezierCurve/t.
Properties:
| Name | Type | Attribute | Description |
| point | * |
public set t(value: Number) source
Sets the progress along this QuadraticBezierCurve.
Automatically clamps to range [0..1].
Default value is 0.
Override:
Curve#tpublic get t: Number: * source
Gets the progress along this QuadraticBezierCurve.
Default value is 0.
Override:
Curve#tpublic set v0(value: Number[]) source
Sets the starting point on this QuadraticBezierCurve.
Default value is [0.0, 0.0, 0.0].
public get v0: Number[]: * source
Gets the starting point on this QuadraticBezierCurve.
Default value is [0.0, 0.0, 0.0].
public set v1(value: Number[]) source
Sets the middle control point on this QuadraticBezierCurve.
Default value is [0.0, 0.0, 0.0].
public get v1: Number[]: * source
Gets the middle control point on this QuadraticBezierCurve.
Default value is [0.0, 0.0, 0.0].
Public Methods
public getJSON(): {"v0": *, "v1": *, "v2": *, "t": *} source
Return:
| {"v0": *, "v1": *, "v2": *, "t": *} |
Reference
Source
