Henrik Ladholm (hela++at++ppvku.ericsson.se)
Wed, 30 Aug 1995 15:11:00 +0200
//--------------------this doesn't work------------------------------------------
pfMatrix eyeMatrix = is set up as the eyeposition;
// make segment that points in +Y direction from eyepoint and is 4 m long
// It is only used to make the appropriate cylinder with radius 0.4 m
pfSeg seg;
pfCoord eyeCoord,newAheadCoord;
pfGetOrthoMatCoord(eyeMatrix,&eyeCoord);
pfMatrix newAheadMatrix;
pfCopyMat(newAheadMatrix,eyeMatrix);
pfPreTransMat(newAheadMatrix,0,4.0,0,newAheadMatrix);
pfGetOrthoMatCoord(newAheadMatrix,&newAheadCoord);
pfMakePtsSeg(&seg,eyeCoord.xyz,newAheadCoord.xyz);
// make a cylinder around the segment
pfCylinder cylinder;
pfSeg* segArray[]={&seg};
pfCylAroundSegs(&cylinder,segArray,1);
cylinder.radius = 0.4;//override radius
// create pfSegSet
pfHit** hits[32];
pfSegSet segSet;
segSet.mode = PFTRAV_IS_GSET|PFTRAV_IS_CULL_BACK|PFTRAV_IS_BCYL;
segSet.isectMask = PFUCOLLIDE_OBJECT|PFUCOLLIDE_EVENTWALL;
segSet.activeMask = 0;// mask for the segments, in this case 0 segments
segSet.segs[0] = seg;
segSet.bound = &cylinder;
segSet.discFunc = NULL;
segSet.userData = NULL;
// do intersection with appropriate node
pfNode* sceneNode = is set to the scene;
long retValue = pfSegsIsectNode(sceneNode, &segSet, hits);
\\-----------------------------------------------------------------------------
Comments and suggestions will be appreciated :-]
Regards
Henrik Ladholm
Ericsson Infocom
Sweden
This archive was generated by hypermail 2.0b2 on Mon Aug 10 1998 - 17:51:51 PDT