2014-03-13 47 views
1

我已經在away3d中用粒子系統製作了一個雪效果,但是當我將一個particleFollowNode添加到ParticleAnimationSet時,那麼billboardNode不起作用。任何人都知道如何解決這個錯誤?謝謝你的幫助。在Away3d粒子系統中,將particleFollowNode添加到particleAnimationSet中使BillboardNode不起作用

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

你可以張貼一些代碼? – kravits88

回答

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