User Engines

New Message Reply Date view Thread view Subject view Author view

Neil Witcomb (NWITCOMB++at++mdrobotics.ca)
Thu, 26 Aug 1999 16:15:33 -0400


** High Priority **

In this code at the end in the engine section there is a variable 'd' which comes from the destination. If this infact a float or a pfVec3. At the end I have cut a lot out of this program but there is d[0], d[1], d[2], which is something which can't be done with a float. So am I acting on the pfVec or am I acting on each element in the pfVec3 each pass.

Also, is the number of time the engine called the iterations or is it the iterations*items?

Thanks
Neil Witcomb

// Initialization
flux_coords = new pfFlux(sizeof(pfVec3) * 3, PFFLUX_DEFAULT_NUM_BUFFERS);
flux_coords->initData(coords);

flux_control = new pfFlux(sizeof(float) * 3, PFFLUX_DEFAULT_NUM_BUFFERS);
flux_control->setMode(PFFLUX_PUSH, PF_ON);

user_engine = new pfEngine(PFENG_USER_FUNCTION);
user_engine->setUserFunction(my_mult_engine);
user_engine->setSrc(0, coords, NULL, 0, 0, 3);
user_engine->setSrc(1, flux_control, NULL, 0, 0, 0);
user_engine->setIterations(3, 3);
user_engine->setDst(flux_coords, NULL, 0, 3);

// Engine Code
eng->getDst(&dst, &d_ilist, &d_offset, &d_stride);
eng->getSrc(0, &src0, &s_ilist0, &s_icount0, &s_offset0, &s_stride0);

eng->getIterations(&iterations, &items);

d = (float*)((pfFlux*)dst)->getWritableData();
if (d == NULL) return;

// s0, s1 is the source information

for (i = 0; i < iterations; i++)
{
    for (j = 0; j < items; j++) d[j] = s0[j] * s1[j];
    d += d_stride;
    s0 += s_stride0;
    s1 += s_stride1;
}

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                               
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                       


New Message Reply Date view Thread view Subject view Author view

This archive was generated by hypermail 2.0b2 on Thu Aug 26 1999 - 13:15:58 PDT

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