@pilotlab/lux-attributes
Version:
A luxurious user experience framework, developed by your friends at Pilot.
42 lines (33 loc) • 1.11 kB
text/typescript
import PointBase from './pointBase';
import IPoint3D from './interfaces/iPoint3D';
import {
AttributeChangeOptions,
AttributeChangeActions,
IAttributeChangeOptions,
IAttributeUpdateTracker
} from '@pilotlab/lux-attributes';
import {
IAnimationEaseFunction,
ISpeed
} from '@pilotlab/lux-animation';
export class Point extends PointBase<Point> {
constructor(x:number = 0, y:number = 0, z:number = 0, label?:string) { super('point', x, y, z, label); }
go(
target:IPoint3D,
durationSpeed?:(number | ISpeed),
ease?:IAnimationEaseFunction,
repeatCount:number = 0
):IAttributeUpdateTracker {
const options:IAttributeChangeOptions = new AttributeChangeOptions(AttributeChangeActions.SIGNAL_CHANGE, durationSpeed, ease);
options.repeatCount = repeatCount;
return this.attributes.update(target, options);
}
static get empty():Point {
let point:Point = new Point();
point.x = null;
point.y = null;
point.z = null;
return point;
}
} // End class
export default Point;