liaocheng / away3d-particles-system

A particle system based on Stage3D for Away3D engine
68 stars 16 forks source link

change settings of actions after creation #3

Closed matse4 closed 12 years ago

matse4 commented 12 years ago

As I see it,, it is possible to change some settings of actions on the Fly.

for example:

public function ScaleByLifeGlobal(startScale:Number,endScale:Number) 
{
    priority = 3;
    _startScale = startScale;
    _endScale = endScale;
    _delta = _endScale - _startScale;
}

startScale and _delta are only used @ setRenderState() and there it only sets it to an const.

override public function setRenderState(stage3DProxy : Stage3DProxy, pass : MaterialPassBase, renderable : IRenderable) : void
{
    var context : Context3D = stage3DProxy._context3D;
    context.setProgramConstantsFromVector(Context3DProgramType.VERTEX, scaleByLifeConst.index, Vector.<Number>([_startScale,_delta,0,0]));
}

shouldn't it be possible to change them? Or is there an reason why you don't allow that?

cheers Matse

PS: wuhuu Syntax highlighting ;)

liaocheng commented 12 years ago

Please refer to https://github.com/liaocheng/away3d-particles-system/wiki/global-and-local-action . For example,a particle's speed is 5 m/s,now time is 10,so it distance is 50m.If we change the speed to 10m/s,it distance will jump to 100m.