Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

GravityParticleSystem add set gravity parameter method #10

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
26 changes: 26 additions & 0 deletions particle/libsrc/bin/particle/particle.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -293,5 +293,31 @@ declare module particle {
initParticle(particle: Particle): void;
private static getValue(base, variance);
advanceParticle(particle: Particle, dt: number): void;
setEmitterXVariance(emitterXVariance: number): void;
setEmitterYVariance(emitterYVariance: number): void;
setLifespan(lifespan: number): void;
setLifespanVariance(lifespanVariance: number): void;
setStartSize(startSize: number): void;
setStartSizeVariance(startSizeVariance: number): void;
setEndSize(endSize: number): void;
setEndSizeVariance(endSizeVariance: number): void;
setEmitAngle(emitAngle: number): void;
setEmitAngleVariance(emitAngleVariance: number): void;
setStartRotation(startRotation: number): void;
setStartRotationVariance(startRotationVariance: number): void;
setEndRotation(endRotation: number): void;
setEndRotationVariance(endRotationVariance: number): void;
setSpeed(speed: number): void;
setSpeedVariance(speedVariance: number): void;
setGravityX(gravityX: number): void;
setGravityY(gravityY: number): void;
setRadialAcceleration(radialAcceleration: number): void;
setRadialAccelerationVariance(radialAccelerationVariance: number): void;
setTangentialAcceleration(tangentialAcceleration: number): void;
setTangentialAccelerationVariance(tangentialAccelerationVariance: number): void;
setStartAlpha(startAlpha: number): void;
setStartAlphaVariance(startAlphaVariance: number): void;
setEndAlpha(endAlpha: number): void;
setEndAlphaVariance(endAlphaVariance: number): void;
}
}
79 changes: 79 additions & 0 deletions particle/libsrc/bin/particle/particle.js
Original file line number Diff line number Diff line change
Expand Up @@ -619,6 +619,85 @@ var particle;
locParticle.rotation += locParticle.rotationDelta * dt * 1000;
locParticle.alpha += locParticle.alphaDelta * dt * 1000;
};
//增加设置重力系统参数的方法,方便动态改变参数
p.setEmitterXVariance = function (emitterXVariance) {
this.emitterXVariance = emitterXVariance;
};
p.setEmitterYVariance = function (emitterYVariance) {
this.emitterYVariance = emitterYVariance;
};
p.setLifespan = function (lifespan) {
this.lifespan = lifespan;
};
p.setLifespanVariance = function (lifespanVariance) {
this.lifespanVariance = lifespanVariance;
};
p.setStartSize = function (startSize) {
this.startSize = startSize;
};
p.setStartSizeVariance = function (startSizeVariance) {
this.startSizeVariance = startSizeVariance;
};
p.setEndSize = function (endSize) {
this.endSize = endSize;
};
p.setEndSizeVariance = function (endSizeVariance) {
this.endSizeVariance = endSizeVariance;
};
p.setEmitAngle = function (emitAngle) {
this.emitAngle = emitAngle;
};
p.setEmitAngleVariance = function (emitAngleVariance) {
this.emitAngleVariance = emitAngleVariance;
};
p.setStartRotation = function (startRotation) {
this.startRotation = startRotation;
};
p.setStartRotationVariance = function (startRotationVariance) {
this.startRotationVariance = startRotationVariance;
};
p.setEndRotation = function (endRotation) {
this.endRotation = endRotation;
};
p.setEndRotationVariance = function (endRotationVariance) {
this.endRotationVariance = endRotationVariance;
};
p.setSpeed = function (speed) {
this.speed = speed;
};
p.setSpeedVariance = function (speedVariance) {
this.speedVariance = speedVariance;
};
p.setGravityX = function (gravityX) {
this.gravityX = gravityX;
};
p.setGravityY = function (gravityY) {
this.gravityY = gravityY;
};
p.setRadialAcceleration = function (radialAcceleration) {
this.radialAcceleration = radialAcceleration;
};
p.setRadialAccelerationVariance = function (radialAccelerationVariance) {
this.radialAccelerationVariance = radialAccelerationVariance;
};
p.setTangentialAcceleration = function (tangentialAcceleration) {
this.tangentialAcceleration = tangentialAcceleration;
};
p.setTangentialAccelerationVariance = function (tangentialAccelerationVariance) {
this.tangentialAccelerationVariance = tangentialAccelerationVariance;
};
p.setStartAlpha = function (startAlpha) {
this.startAlpha = startAlpha;
};
p.setStartAlphaVariance = function (startAlphaVariance) {
this.startAlphaVariance = startAlphaVariance;
};
p.setEndAlpha = function (endAlpha) {
this.endAlpha = endAlpha;
};
p.setEndAlphaVariance = function (endAlphaVariance) {
this.endAlphaVariance = endAlphaVariance;
};
return GravityParticleSystem;
}(particle_1.ParticleSystem));
particle_1.GravityParticleSystem = GravityParticleSystem;
Expand Down
Loading