pfuSmoke

New Message Reply Date view Thread view Subject view Author view

Bill Balloni (m218822++at++fltsim.MDC.COM)
Wed, 2 Nov 1994 09:14:52 -0600 (CST)


A while back a fix was provided for the pfuSmoke stuff (smoke.c).
Thanks. I have incorporated this fix but still get program bombs
when I try to use a smoke effect. I notice that all is well until
I call pfuDrawSmokes. At this point I get some criptic message
about a SIGCHLD signal received. This happens regardless of whether
I use PFUSMOKE_MISSLE or the others. If I comment out the call to
start the smoke, pfuSmokeMode(smoke, PFUSMOKE_START), all is OK except
that I don't get any smoke.

I took the simple.c file and grafted on the pfuSmoke stuff. Below is
a summary of my additions.

Is there anyone who can see an obvious problem with these additions or
how I am doing the smoke? Let me know if you do. Also, if anyone has
any working sample code which uses pfuSmoke I would be most grateful
for a look :^)

Thanks,

Bill Balloni McDonnell Douglas Aerospace St. Louis, MO
                       Flight Simulation Laboratory
                       email: balloni++at++fltsim.MDC.COM
                       phone: (314) 234-0944

*** SIMPLE.C ***

...

#include "pfutil.h"

static pfuSmoke * mtail; /* a missile tail */
static pfVec3 * mtail_eye;

...

main (int argc, char *argv[])
{

...

    pfVec3 mtail_org;

...

    /* Initialize Performer */
    pfInit();

    /* Use default multiprocessing mode based on number of
     * processors.
     */
    pfMultiprocess(PFMP_DEFAULT);

    /* Let's see some smoke */
    pfuInitSmokes ();

    /* Configure multiprocessing mode and start parallel
     * processes.
     */
    pfConfig();

    /* Make a new smoke and configure it */
    mtail = pfuNewSmoke ();
    pfuSmokeType (mtail, PFUSMOKE_EXPLOSION);
    pfSetVec3 (mtail_org, 0.0f, 0.0f, 0.0f);
    pfuSmokeOrigin (mtail, mtail_org, 500.0f);
    pfuSmokeDuration (mtail, 20.0f);
    pfuSmokeMode (mtail, PFUSMOKE_START);

...

    pfChanDrawFunc (chan, draw_callback);

    /* Allocate a buffer for the draw callback */
    mtail_eye = (pfVec3 *) pfAllocChanData (chan, sizeof (pfVec3));

...

    /* Simulate for twenty seconds. */
    while (t < 20.0f)
    {
...

        /* Copy the eyepoint for the draw callback into the pipeline. */
        pfCopyVec3 (*mtail_eye, view.xyz);
        pfPassChanData (chan);
...
}

/*
 * Channel draw callback function.
 */
static void
draw_callback (pfChannel *chan, void *data)
{
    /* Clear the channel */
    pfClearChan (chan); /* e.g. - clear the viewport */

    pfuDrawSmokes (*mtail_eye);

    pfDraw(); /* Render the frame */
}


New Message Reply Date view Thread view Subject view Author view

This archive was generated by hypermail 2.0b2 on Mon Aug 10 1998 - 17:50:38 PDT

This message has been cleansed for anti-spam protection. Replace '++at++' in any mail addresses with the '@' symbol.