0 Replies Latest reply on Sep 22, 2012 9:42 PM by prsolucoes

    Make the particle as same angle of object

    prsolucoes Level 1

      Hi,

       

       

      How to make the particle tail follow the ball rotation.

       

       

      In my example, here:

      http://www.prsolucoes.com/ioarena

       

       

      Whats the calc on update?

       

       

      I made it today in cannon class (particle is a object inside cannon):

       

       

      if (particles)

      {

          particles.emitAngle = Util.radiansToDegrees(rotation);

      }

       

       

       

      But doesnt works well as you see on link [up].

       

       

      After some tests, i discover that i dont need set the rotation/angle on every update, i need set it only one time when construct the particles.

       

       

      Example (change rotation instead of emitAngle):

       

       

      if (particles)

      {

                particles.rotation = rotation; // second rotation property is from cannon

      }

       

       

      Whats wrong? Is not the same rotation?

       

       

      My fire.pex file only for consult if need:

       

       

      <particleEmitterConfig>

        <texture name="fire.png"/>

        <sourcePosition x="0.00" y="0.00"/>

        <sourcePositionVariance x="0.00" y="0.00"/>

        <speed value="100.00"/>

        <speedVariance value="30.00"/>

        <particleLifeSpan value="1.96"/>

        <particleLifespanVariance value="1.9000"/>

        <angle value="0.00"/>

        <angleVariance value="0"/>

        <gravity x="0.00" y="0.00"/>

        <radialAcceleration value="0.00"/>

        <tangentialAcceleration value="0.00"/>

        <radialAccelVariance value="0.00"/>

        <tangentialAccelVariance value="0.00"/>

        <startColor red="1" green="1" blue="1" alpha="0.62"/>

        <startColorVariance red="0.00" green="0.00" blue="0.00" alpha="0.00"/>

        <finishColor red="1.00" green="0.31" blue="0.00" alpha="0.00"/>

        <finishColorVariance red="0.00" green="0.00" blue="0.00" alpha="0.00"/>

        <maxParticles value="100.00"/>

        <startParticleSize value="9.28"/>

        <startParticleSizeVariance value="49.53"/>

        <finishParticleSize value="10.00"/>

        <FinishParticleSizeVariance value="5.00"/>

        <duration value="-1.00"/>

        <emitterType value="0"/>

        <maxRadius value="100.00"/>

        <maxRadiusVariance value="0.00"/>

        <minRadius value="0.00"/>

        <rotatePerSecond value="0.00"/>

        <rotatePerSecondVariance value="0.00"/>

        <blendFuncSource value="770"/>

        <blendFuncDestination value="1"/>

        <rotationStart value="0.00"/>

        <rotationStartVariance value="0.00"/>

        <rotationEnd value="0.00"/>

        <rotationEndVariance value="0.00"/>

      </particleEmitterConfig>

       

       

      Thanks for any help