1

I've made a snow effect with particles system in away3d, but when I added a particleFollowNode to the ParticleAnimationSet,then the billboardNode did not work. Anybody knows how to fix this bug? Thanks for your help.

ActionScript:

        //setup the particle animation set
        _particleAnimationSet = new ParticleAnimationSet(true, true);           
        _particleAnimationSet.addAnimation(new ParticleVelocityNode(ParticlePropertiesMode.LOCAL_STATIC));
        _particleAnimationSet.addAnimation(new ParticlePositionNode(ParticlePropertiesMode.LOCAL_STATIC));
        particleFollowNode=new ParticleFollowNode(true,true);
         //add particleFollowNode for moving particles around
        _particleAnimationSet.addAnimation(particleFollowNode);
         //then BillBoad stopped working...
        _particleAnimationSet.addAnimation(new ParticleBillboardNode());
        _particleAnimationSet.initParticleFunc = initFunc;
Suntabu
  • 13
  • 5

1 Answers1

0

I've fixed the bug. the particle mesh's bounds doesn't update properly which cause the mesh culling step cut it off while the mesh's fake bounds isn't in camera's frustum .

How to fix:
1. Set particle mesh's id as "Particles"
2. In MeshNode.cs file, function acceptTraverser, modify as :

   override public function acceptTraverser(traverser:PartitionTraverser):void
    {
        //trace(_mesh.id);

        if (traverser.enterNode(this)||_mesh.id=="Particles") 
        {

            super.acceptTraverser(traverser);
            var subs:Vector.<SubMesh> = _mesh.subMeshes;
            var i:uint;
            var len:uint = subs.length;
            while (i < len)
                traverser.applyRenderable(subs[i++]);
        }
    }
Suntabu
  • 13
  • 5