在Away3d粒子系统中,将particleFollowNode添加到particleAnimationSet使得BillboardNode不起作用

时间:2014-03-13 07:05:07

标签: away3d

我在away3d中使用粒子系统制作了雪效果,但是当我将ParticleFollowNode添加到ParticleAnimationSet时,则billboardNode无效。有谁知道如何修复这个bug?谢谢你的帮助。

的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;

1 个答案:

答案 0 :(得分:0)

我已经修复了这个错误。粒子网格的边界没有正确更新,导致网格剔除步骤将其切断,而网格的假边界不在相机的截锥体中。

如何修复:
1.将粒子网格的id设置为“粒子”
2.在MeshNode.cs文件中,函数acceptTraverser,修改为:

   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++]);
        }
    }