UNPKG

@awayjs/graphics

Version:
26 lines (25 loc) 1.31 kB
import { __extends } from "tslib"; import { ContextGLVertexBufferFormat } from '@awayjs/stage'; import { ParticleStateBase } from './ParticleStateBase'; /** * ... */ var ParticleTimeState = /** @class */ (function (_super) { __extends(ParticleTimeState, _super); function ParticleTimeState(animator, particleTimeNode) { var _this = _super.call(this, animator, particleTimeNode, true) || this; _this._particleTimeNode = particleTimeNode; return _this; } ParticleTimeState.prototype.setRenderState = function (shader, renderable, animationElements, animationRegisterData) { animationElements.activateVertexBuffer(animationRegisterData.getRegisterIndex(this._pAnimationNode, ParticleTimeState.TIME_STREAM_INDEX), this._particleTimeNode._iDataOffset, shader.stage, ContextGLVertexBufferFormat.FLOAT_4); var particleTime = this._pTime / 1000; shader.setVertexConst(animationRegisterData.getRegisterIndex(this._pAnimationNode, ParticleTimeState.TIME_CONSTANT_INDEX), particleTime, particleTime, particleTime, particleTime); }; /** @private */ ParticleTimeState.TIME_STREAM_INDEX = 0; /** @private */ ParticleTimeState.TIME_CONSTANT_INDEX = 1; return ParticleTimeState; }(ParticleStateBase)); export { ParticleTimeState };