Particles



  • THE POST BELOW IS MORE THAN 5 YEARS OLD. RELATED SUPPORT INFORMATION MIGHT BE OUTDATED OR DEPRECATED

    On 01/12/2003 at 14:31, xxxxxxxx wrote:

    User Information:
    Cinema 4D Version:   8.206 
    Platform:      
    Language(s) :     C++  ;

    ---------
    Hi
    I want to be able to get each particle position of the particles that are emitting from an emitter. After many searches on this forum and the archieved forum I believe I have to use a ParticleTag. But I dont know *how* to use the ParticleTag. I thought it would mean just inheriting the ParticleTag class

        
        
        
        
        class MyParticle : public ParticleTag
        
        
        
        
        {
        
        
        
        
        }
        
        
        
    

    but that gives me an error
    'MyParticle' : no appropriate default constructor available
    What am i doing wrong?



  • THE POST BELOW IS MORE THAN 5 YEARS OLD. RELATED SUPPORT INFORMATION MIGHT BE OUTDATED OR DEPRECATED

    On 05/12/2003 at 08:47, xxxxxxxx wrote:

    Hi Geespot,

    I currently don't do C++ but I remember the procedure in COFFEE. The particle tag is an invisible tag every standard C4D particle emitter has. It's its first tag I think. To access it you have to search for the first active tag of the emitter. If I remember correctly.

    cheers mnu



  • THE POST BELOW IS MORE THAN 5 YEARS OLD. RELATED SUPPORT INFORMATION MIGHT BE OUTDATED OR DEPRECATED

    On 06/12/2003 at 01:00, xxxxxxxx wrote:

    Its fairly simple, quick snap of some code:

        
        
        
        
        if (op->GetType()==Oparticle)
        
        
        
        
        {
        
        
        
        
        ParticleTag *ptag=(ParticleTag* )op->GetTag(Tparticle);
        
        
        
        
        if (!ptag) return;
        
        
        
        
        LONG pcnt=op->GetParticleCount();
        
        
        
        
        for (LONG i=0;i<pcnt;i++)
        
        
        
        
        {
        
        
        
        
        Particle *pt=op->GetParticle(ptag,i);
        
        
        
        
        if ((pt->bits&(PARTICLE_VISIBLE|PARTICLE_ALIVE))!=(PARTICLE_VISIBLE|PARTICLE_ALIVE)) continue;  
        
    

    the key is to get the tag (which as mnu said is hidden), use GetTag() to do this. If found, then use the functions of the tag (ParticleTag) to get the particles.



  • THE POST BELOW IS MORE THAN 5 YEARS OLD. RELATED SUPPORT INFORMATION MIGHT BE OUTDATED OR DEPRECATED

    On 06/12/2003 at 06:20, xxxxxxxx wrote:

    Thank you to both. I was going about it the wrong way, which is why I was confused.


Log in to reply