@awayjs/graphics
Version:
AwayJS graphics classes
62 lines (61 loc) • 2.86 kB
JavaScript
import { __extends } from "tslib";
import { ContextGLVertexBufferFormat } from '@awayjs/stage';
import { ParticlePropertiesMode } from '../data/ParticlePropertiesMode';
import { ParticleStateBase } from './ParticleStateBase';
/**
* ...
*/
var ParticleBezierCurveState = /** @class */ (function (_super) {
__extends(ParticleBezierCurveState, _super);
function ParticleBezierCurveState(animator, particleBezierCurveNode) {
var _this = _super.call(this, animator, particleBezierCurveNode) || this;
_this._particleBezierCurveNode = particleBezierCurveNode;
_this._controlPoint = _this._particleBezierCurveNode._iControlPoint;
_this._endPoint = _this._particleBezierCurveNode._iEndPoint;
return _this;
}
Object.defineProperty(ParticleBezierCurveState.prototype, "controlPoint", {
/**
* Defines the default control point of the node, used when in global mode.
*/
get: function () {
return this._controlPoint;
},
set: function (value) {
this._controlPoint = value;
},
enumerable: false,
configurable: true
});
Object.defineProperty(ParticleBezierCurveState.prototype, "endPoint", {
/**
* Defines the default end point of the node, used when in global mode.
*/
get: function () {
return this._endPoint;
},
set: function (value) {
this._endPoint = value;
},
enumerable: false,
configurable: true
});
ParticleBezierCurveState.prototype.setRenderState = function (shader, renderable, animationElements, animationRegisterData) {
var controlIndex = animationRegisterData.getRegisterIndex(this._pAnimationNode, ParticleBezierCurveState.BEZIER_CONTROL_INDEX);
var endIndex = animationRegisterData.getRegisterIndex(this._pAnimationNode, ParticleBezierCurveState.BEZIER_END_INDEX);
if (this._particleBezierCurveNode.mode == ParticlePropertiesMode.LOCAL_STATIC) {
animationElements.activateVertexBuffer(controlIndex, this._particleBezierCurveNode._iDataOffset, shader.stage, ContextGLVertexBufferFormat.FLOAT_3);
animationElements.activateVertexBuffer(endIndex, this._particleBezierCurveNode._iDataOffset + 3, shader.stage, ContextGLVertexBufferFormat.FLOAT_3);
}
else {
shader.setVertexConst(controlIndex, this._controlPoint.x, this._controlPoint.y, this._controlPoint.z);
shader.setVertexConst(endIndex, this._endPoint.x, this._endPoint.y, this._endPoint.z);
}
};
/** @private */
ParticleBezierCurveState.BEZIER_CONTROL_INDEX = 0;
/** @private */
ParticleBezierCurveState.BEZIER_END_INDEX = 1;
return ParticleBezierCurveState;
}(ParticleStateBase));
export { ParticleBezierCurveState };