[info-performer] Huge Problem with PFQHIT_NAME

Date view Thread view Subject view Author view

From: Christian Rothländer (Mailinglisten++at++rothlaender.net)
Date: 09/11/2005 08:40:10


Hi there.

I have the following Problem to solve. I am trying for about 2 hours now and I am not able to get the solution.
I got code from the guy who wrote his student research project on a similar task.

It's no problem to get intersection Point and the actual Viewmatrix out of the pfHit-Array, but I can't manage to get
the Name of the intersected Object, which I need to finish the Program. I just get a Segfault.

I hope someone already had a similar problem and found a solution to get the Name of the Intersected Object

Christian

void nameit::isecTest(pfSeg line){

        pfSegSet segset;
        pfHit **hits[32];
        int isect;

        segset.activeMask = 1;
        segset.isectMask = 0x01;
        segset.discFunc = NULL;
        segset.mode = PFTRAV_IS_PRIM;

        segset.segs[0].pos.set(line.pos[0], line.pos[1], line.pos[2]);
        segset.segs[0].dir.set(line.dir[0], line.dir[1], line.dir[2]);
        segset.segs[0].length = line.length;

        isect = Shared->scene->isect(&segset, hits);

### here's the problem ###

        std::string * name;
        (*hits[0])->query(PFQHIT_NAME, &name);
        outputs.push_back(*name);

## end of problem ###

        //pnt == Punkt der Intersection.. wie komm ich dran mit was die sich schneidet
        pfVec3 pnt;
        pfMatrix matt;
        (*hits[0])->query(PFQHIT_POINT, pnt.vec);
        (*hits[0])->query(PFQHIT_XFORM, matt.mat);
        pnt.xformPt(pnt, matt);

...
}


Date view Thread view Subject view Author view

This archive was generated by hypermail 2b29 : Sun Sep 11 2005 - 08:40:21 PDT