@awayjs/graphics
Version:
AwayJS graphics classes
99 lines • 4.44 kB
TypeScript
import { ShaderRegisterElement, ShaderRegisterCache, ShaderRegisterData } from '@awayjs/stage';
import { ShaderBase, AnimationRegisterData, IElements, IAnimationSet, AnimationNodeBase } from '@awayjs/renderer';
import { ParticleCollection } from './data/ParticleCollection';
import { AnimationElements } from './data/AnimationElements';
import { ParticleNodeBase } from './nodes/ParticleNodeBase';
import { AnimationSetBase } from './AnimationSetBase';
/**
* The animation data set used by particle-based animators, containing particle animation data.
*
* @see away.animators.ParticleAnimator
*/
export declare class ParticleAnimationSet extends AnimationSetBase implements IAnimationSet {
/** @private */
_iAnimationRegisterData: AnimationRegisterData;
private _timeNode;
/**
* Property used by particle nodes that require compilers at the end of the shader
*/
static POST_PRIORITY: number;
/**
* Property used by particle nodes that require color compilers
*/
static COLOR_PRIORITY: number;
private _animationElements;
private _particleNodes;
private _localDynamicNodes;
private _localStaticNodes;
private _totalLenOfOneVertex;
hasUVNode: boolean;
needVelocity: boolean;
hasBillboard: boolean;
hasColorMulNode: boolean;
hasColorAddNode: boolean;
/**
* Initialiser function for static particle properties. Needs to reference a with the following format
*
* <code>
* initParticleFunc(prop:ParticleProperties)
* {
* //code for settings local properties
* }
* </code>
*
* Aside from setting any properties required in particle animation nodes using local static properties, the initParticleFunc function
* is required to time node requirements as they may be needed. These properties on the ParticleProperties object can include
* <code>startTime</code>, <code>duration</code> and <code>delay</code>. The use of these properties is determined by the setting
* arguments passed in the constructor of the particle animation set. By default, only the <code>startTime</code> property is required.
*/
initParticleFunc: Function;
/**
* Initialiser function scope for static particle properties
*/
initParticleScope: Object;
/**
* Creates a new <code>ParticleAnimationSet</code>
*
* @param [optional] usesDuration Defines whether the animation set uses the <code>duration</code> data in its static properties to determine how long a particle is visible for. Defaults to false.
* @param [optional] usesLooping Defines whether the animation set uses a looping timeframe for each particle determined by the <code>startTime</code>, <code>duration</code> and <code>delay</code> data in its static properties function. Defaults to false. Requires <code>usesDuration</code> to be true.
* @param [optional] usesDelay Defines whether the animation set uses the <code>delay</code> data in its static properties to determine how long a particle is hidden for. Defaults to false. Requires <code>usesLooping</code> to be true.
*/
constructor(usesDuration?: boolean, usesLooping?: boolean, usesDelay?: boolean);
/**
* Returns a vector of the particle animation nodes contained within the set.
*/
get particleNodes(): Array<ParticleNodeBase>;
/**
* @inheritDoc
*/
addAnimation(node: AnimationNodeBase): void;
/**
* @inheritDoc
*/
getAGALVertexCode(shader: ShaderBase, registerCache: ShaderRegisterCache, sharedRegisters: ShaderRegisterData): string;
/**
* @inheritDoc
*/
getAGALUVCode(shader: ShaderBase, registerCache: ShaderRegisterCache, sharedRegisters: ShaderRegisterData): string;
/**
* @inheritDoc
*/
getAGALFragmentCode(shader: ShaderBase, registerCache: ShaderRegisterCache, shadedTarget: ShaderRegisterElement): string;
/**
* @inheritDoc
*/
doneAGALCode(shader: ShaderBase): void;
/**
* @inheritDoc
*/
get usesCPU(): boolean;
/**
* @inheritDoc
*/
cancelGPUCompatibility(): void;
dispose(): void;
getAnimationElements(particleCollection: ParticleCollection, elements: IElements): AnimationElements;
/** @private */
_iGenerateAnimationElements(particleCollection: ParticleCollection): void;
}
//# sourceMappingURL=ParticleAnimationSet.d.ts.map