Reference Source
public class | source

QuadraticBezierCurve

Extends:

ComponentCurve → QuadraticBezierCurve

A QuadraticBezierCurve is a Curve along which a 3D position can be animated.

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

t(value: Number)

Sets the progress along this QuadraticBezierCurve.

public get

t: Number: *

Gets the progress along this QuadraticBezierCurve.

public set

v0(value: Number[])

Sets the starting point on this QuadraticBezierCurve.

public get

v0: Number[]: *

Gets the starting point on this QuadraticBezierCurve.

public set

v1(value: Number[])

Sets the middle control point on this QuadraticBezierCurve.

public get

v1: Number[]: *

Gets the middle control point on this QuadraticBezierCurve.

public set

v2(value: Number[])

Sets the end point on this QuadraticBezierCurve.

public get

v2: Number[]: *

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

viewer: *

public

clear()

Destroys all Components that are owned by this.

public

Destroys this component.

public

error(message: String)

Logs an error for this component to the JavaScript console.

public

fire(event: String, value: Object, forget: Boolean)

Fires an event on this component.

public

Returns true if there are any subscribers to the given event on this component.

public

isType(type: *): *: Boolean

Tests if this component is of the given type, or is a subclass of the given type.

public

log(message: String)

Logs a console debugging message for this component.

public

off(subId: String)

Cancels an event subscription that was previously made with Component#on or Component#once.

public

on(event: String, callback: Function, scope: Object): String

Subscribes to an event on this component.

public

once(event: String, callback: Function, scope: Object)

Subscribes to the next occurrence of the given event, then un-subscribes as soon as the event is subIdd.

public

warn(message: String)

Logs a warning for this component to the JavaScript console.

From class Curve
public get

Gets the length of this Curve.

public get

t: Number: *

Gets the progress along this Curve.

public set

t(value: Number)

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

getPoints(divisions: Number): *

Samples points on this Curve, at the given number of equally-spaced divisions.

public

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#constructor

Params:

NameTypeAttributeDescription
owner Component

Owner component. When destroyed, the owner will destroy this MetallicMaterial as well.

cfg *
  • optional

Configuration

cfg.id String
  • optional

Optional ID, unique among all components in the parent {{#crossLink "Scene"}}Scene{{/crossLink}}, generated automatically when omitted.

cfg.v0 Number[]
  • optional
  • default: [0,0,0]

The starting point.

cfg.v1 Number[]
  • optional
  • default: [0,0,0]

The middle control point.

cfg.v2 Number[]
  • optional
  • default: [0,0,0]

The end point.

cfg.t Number[]
  • optional
  • default: 0

Current position on this QuadraticBezierCurve, in range between 0..1.

Public Members

public get point: * source

Point on this QuadraticBezierCurve at position QuadraticBezierCurve/t.

Properties:

NameTypeAttributeDescription
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#t

public get t: Number: * source

Gets the progress along this QuadraticBezierCurve.

Default value is 0.

Override:

Curve#t

Return:

Number

The current progress location.

public 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].

Return:

Number[]

The starting point.

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].

Return:

Number[]

The middle control point.

public set v2(value: Number[]) source

Sets the end point on this QuadraticBezierCurve.

Default value is [0.0, 0.0, 0.0].

public get v2: Number[]: * source

Gets the end point on this QuadraticBezierCurve.

Default value is [0.0, 0.0, 0.0].

Return:

Number[]

The end point.

Public Methods

public getJSON(): {"v0": *, "v1": *, "v2": *, "t": *} source

Return:

{"v0": *, "v1": *, "v2": *, "t": *}

public getPoint(t: Number): Number[] source

Returns the point on this QuadraticBezierCurve at the given position.

Params:

NameTypeAttributeDescription
t Number

Position to get point at.

Return:

Number[]

The point.