Re: Problem with pfQueryHit()

New Message Reply Date view Thread view Subject view Author view

Andy Shein (ashein++at++orac.boston.sgi.com)
Mon, 10 Aug 1998 04:50:10 -0700


On Aug 10, 10:27am, Sujay Kumar wrote:
> Subject: Problem with pfQueryHit()
> Hi,
> I have been facing problem using the pfQueryHit(), the parameter
> passed in PFQHIT_NAME and PFQHIT_PATH, both return null string. Can any
> one kindly help me out in finding out how exactly I should make use of
> these OR under what condition will the Query Token return non-null
> string.
>
> Sujay

Try PFQHIT_FLAGS, from the man page

 PFQHIT_FLAGS returns a bit vector indicating the validity of information
 in the structure. It is formed by a bitwise OR-ing of the PFHIT_POINT,
 PFHIT_NORM, PFHIT_PRIM, PFHIT_TRI, PFHIT_VERTS and PFHIT_XFORM symbols.

   you can also taka look at the code in
/usr/share/Performer/src/lib/libpfui/pfiPick.C
and
/usr/share/Perfomer/src/lib/libpfutil/collide.c

   /* See if we collided with object. */
    if (isect > 0)
    {
        uint query[] = { PFQHIT_FLAGS, PFQHIT_POINT, PFQHIT_NORM, NULL };
        struct
        {
            int flags;
            pfVec3 point;
            pfVec3 normal;
        } result;
        pfMatrix xform;

        pfMQueryHit(hits[0][0], query, &result);

        if ((result.flags & PFHIT_POINT) && (result.flags & PFHIT_NORM))
        {
            if (result.flags & PFHIT_XFORM)
            {
                pfQueryHit(hits[0][0], PFQHIT_XFORM, &xform);

                pfXformPt3(result.point, result.point, xform);
                pfXformVec3(result.normal, result.normal, xform);
                pfNormalizeVec3(result.normal);
            }

Also have you set the pfSegSet.mode to have
PFTRAV_IS_PATH or'ed in ?

                        Andy

-- 
Andrew Shein   SE Stout               email: ashein++at++boston.sgi.com
Silicon Graphics Inc.                 phone: (978) 562 - 4800
1 Cabot Road                            fax: (978) 562 - 4755
Hudson, MA 01749                      vmail: 59688
=======================================================================
List Archives, FAQ, FTP:  http://www.sgi.com/Technology/Performer/
            Submissions:  info-performer++at++sgi.com
        Admin. requests:  info-performer-request++at++sgi.com

New Message Reply Date view Thread view Subject view Author view

This archive was generated by hypermail 2.0b2 on Tue Aug 11 1998 - 13:42:35 PDT

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