@needle-tools/engine
Version:
Needle Engine is a web-based runtime for 3D apps. It runs on your machine for development with great integrations into editors like Unity or Blender - and can be deployed onto any device! It is flexible, extensible and networking and XR are built-in.
41 lines (40 loc) • 1.53 kB
TypeScript
/**
* Keyframe is a representation of a keyframe in an AnimationCurve.
*/
export declare class Keyframe {
time: number;
value: number;
inTangent: number;
inWeight?: number;
outTangent: number;
outWeight?: number;
weightedMode?: number;
constructor(time?: number, value?: number);
}
/**
* AnimationCurve is a representation of a curve that can be used to animate values over time.
*/
export declare class AnimationCurve {
/**
* Creates an animation curve that goes from the `from` value to the `to` value over the given `duration`.
*/
static linearFromTo(from: number, to: number, duration: number): AnimationCurve;
/** Creates an animation curve with just one keyframe */
static constant(value: number): AnimationCurve;
/**
* The keyframes that define the curve.
*/
keys: Array<Keyframe>;
/**
* Clones this AnimationCurve and returns a new instance with the same keyframes (the keyframes are also cloned).
*/
clone(): AnimationCurve;
/** The duration of the curve, which is the time of the last keyframe. */
get duration(): number;
/** Evaluates the curve at the given time and returns the value of the curve at that time.
* @param time The time at which to evaluate the curve.
* @returns The value of the curve at the given time.
*/
evaluate(time: number): number;
static interpolateValue(time: number, keyframe1: Keyframe, keyframe2: Keyframe): number;
}