@awayjs/graphics
Version:
AwayJS graphics classes
26 lines (25 loc) • 1.18 kB
JavaScript
import { __extends } from "tslib";
import { Matrix3D } from '@awayjs/core';
import { ParticleStateBase } from './ParticleStateBase';
/**
* ...
*/
var ParticleRotateToHeadingState = /** @class */ (function (_super) {
__extends(ParticleRotateToHeadingState, _super);
function ParticleRotateToHeadingState(animator, particleNode) {
var _this = _super.call(this, animator, particleNode) || this;
_this._matrix = new Matrix3D();
return _this;
}
ParticleRotateToHeadingState.prototype.setRenderState = function (shader, renderable, animationElements, animationRegisterData) {
if (this._pParticleAnimator.animationSet.hasBillboard) {
this._matrix.copyFrom(renderable.node.getMatrix3D());
this._matrix.append(shader.view.projection.transform.inverseMatrix3D);
shader.setVertexConstFromMatrix(animationRegisterData.getRegisterIndex(this._pAnimationNode, ParticleRotateToHeadingState.MATRIX_INDEX), this._matrix);
}
};
/** @private */
ParticleRotateToHeadingState.MATRIX_INDEX = 0;
return ParticleRotateToHeadingState;
}(ParticleStateBase));
export { ParticleRotateToHeadingState };