Fork me on GitHub
Not signed in (Sign In)

Welcome, Guest

Want to take part in these discussions? Sign in if you have an account, or apply for one below

    • CommentAuthorpsilos
    • CommentTimeNov 12th 2008
     
    Hello,

    my first attempt to create an emitter didn't work at all,

    here is my code:

    // PARTICLES SYSTEM
    var particles:Particles = new Particles();
    this._scene.addChild( particles );

    var emitter:Emitter3D = new Whizzer( new LineZone( new Vector3D( -200, 0, 0 ), new Vector3D( 200, 0, 0) ) );
    _flintRenderer = new PV3DParticleRenderer(particles);
    _flintRenderer.addEmitter(emitter);
    //emitter.addEventListener( ParticleEvent.PARTICLE_DEAD, whizzBang, false, 0, true );
    //emitter.start();

    And after running this I get the following error:

    TypeError: Error #1034: Type Coercion failed: cannot convert org.flintparticles.common.displayObjects::Dot@1fe165f1 to org.papervision3d.core.geom.renderables.Particle.
    at org.flintparticles.threeD.papervision3d::PV3DParticleRenderer/addParticle()[/Users/konstantinos/Documents/Flex Builder 3/FlintParticles/src/org/flintparticles/threeD/papervision3d/PV3DParticleRenderer.as:112]
    at org.flintparticles.common.renderers::RendererBase/particleAdded()[/Users/konstantinos/Documents/Flex Builder 3/FlintParticles/src/org/flintparticles/common/renderers/RendererBase.as:91]
    at flash.events::EventDispatcher/dispatchEventFunction()
    at flash.events::EventDispatcher/dispatchEvent()
    at org.flintparticles.common.emitters::Emitter/createParticle()[/Users/konstantinos/Documents/Flex Builder 3/FlintParticles/src/org/flintparticles/common/emitters/Emitter.as:548]
    at org.flintparticles.common.emitters::Emitter/update()[/Users/konstantinos/Documents/Flex Builder 3/FlintParticles/src/org/flintparticles/common/emitters/Emitter.as:677]
    at org.flintparticles.common.emitters::Emitter/updateEventListener()[/Users/konstantinos/Documents/Flex Builder 3/FlintParticles/src/org/flintparticles/common/emitters/Emitter.as:642]
    at flash.events::EventDispatcher/dispatchEventFunction()
    at flash.events::EventDispatcher/dispatchEvent()
    at org.flintparticles.common.utils::FrameUpdater/frameUpdate()[/Users/konstantinos/Documents/Flex Builder 3/FlintParticles/src/org/flintparticles/common/utils/FrameUpdater.as:88]

    Any ideas, did I forget something obvious?

    Thanks in advance.
    • CommentAuthorpsilos
    • CommentTimeNov 12th 2008
     
    ok, after modifying Whizzer Class it seems to compile without errors,

    changed

    addInitializer( new SharedImage( new Dot( 4 ) ) );

    to

    addInitializer( new PV3DObjectClass ( Particle, new ParticleMaterial(0xFFFFFFFF, 0xFFFFFFFF, 1), 5, 5));

    the same should be done on SphereBang as well.

    Cheers