John Sunderland (j.sunderland++at++dial.pipex.com)
Mon, 11 Aug 1997 12:44:11 +0100
I've got some problems with Isectors which I hope you can help me
with. I have an application which involves loading a database and then
creating a number of instances of models within the terrain which I
require to drive over it. The scen has been set up using the following
call:
pScene->setTravMask( PFTRAV_ISECT, 0xFFFFFFFF,
PFTRAV_SELF | PFTRAV_DESCEND | PFTRAV_IS_CACHE, PF_AND);
Each model will call the following function when it's position is due to
be updated to perform the terrain following. The models all start
initially floating above the terrain.
void DMobile::DoTFollow(float *fHt, float *fP, float *fR)
{
static pfSegSet Isegset;
static pfHit **Result[3];
static BOOL bIsectFirstPass = TRUE;
int HitNum;
// Set up isector for terrain following
if ( bIsectFirstPass == TRUE )
{
Isegset.mode = PFTRAV_IS_PRIM | PFTRAV_IS_CULL_BACK;
Isegset.userData = NULL;
Isegset.segs[0].dir.set(0.0f, 0.0f, -1.0f);
Isegset.segs[0].pos.set(0.0f, 1.0f, 0.0f); // front
Isegset.segs[0].length = (50000.0F);
Isegset.segs[1].dir.set(0.0f, 0.0f, -1.0f);
Isegset.segs[1].pos.set(1.0f, -1.0f, 0.0f); // back right
Isegset.segs[1].length = (50000.0F);
Isegset.segs[2].dir.set(0.0f, 0.0f, -1.0f);
Isegset.segs[2].pos.set(-1.0f, -1.0f, 0.0f); // back left
Isegset.segs[2].length = (50000.0F);
Isegset.activeMask = 0x07;
Isegset.isectMask = 0xFFFFFFFF;
Isegset.bound = NULL;
Isegset.discFunc = NULL;
bIsectFirstPass = FALSE;
}
HitNum = ModelsParentDCSNode->isect(&Isegset, Result);
pfNotify(PFNFY_NOTICE, PFNFY_PRINT, "Got %d hits from Isectors",
HitNum);
}
The problem I am having is that the isect call always returns 0 (i.e. in
the above code HitNum = 0 ). Has anyone got any ideas as to what I am
doing wrong? Your help will be much appreciated.
BTW, O2, IRIX 6.3, Performer 2.0.3
Many thanks in advance,
John Sunderland.
-- John Sunderland Software Engineer, Lockheed Martin Solartron Systems Hoddesdon, Hertfordshire, UK (+44) (0)1992 470011
Hi Performers!
===================================List Archives, FAQ, FTP: http://www.sgi.com/Technology/Performer/ Submissions: info-performer++at++sgi.com Admin. requests: info-performer-request++at++sgi.com
I've got some problems with Isectors which I hope you can help me
with. I have an application which involves loading a database and then
creating a number of instances of models within the terrain which I
require to drive over it. The scen has been set up using the following
call:
pScene->setTravMask( PFTRAV_ISECT, 0xFFFFFFFF,
PFTRAV_SELF | PFTRAV_DESCEND | PFTRAV_IS_CACHE, PF_AND);
Each model will call the following function when it's position is due to
be updated to perform the terrain following. The models all start
initially floating above the terrain.
void DMobile::DoTFollow(float *fHt, float *fP, float *fR)
{
static pfSegSet Isegset;
static pfHit **Result[3];
static BOOL bIsectFirstPass = TRUE;
int HitNum;
// Set up isector for terrain following
if ( bIsectFirstPass == TRUE )
{
Isegset.mode = PFTRAV_IS_PRIM | PFTRAV_IS_CULL_BACK;
Isegset.userData = NULL;
Isegset.segs[0].dir.set(0.0f, 0.0f, -1.0f);
Isegset.segs[0].pos.set(0.0f, 1.0f, 0.0f); // front
Isegset.segs[0].length = (50000.0F);
Isegset.segs[1].dir.set(0.0f, 0.0f, -1.0f);
Isegset.segs[1].pos.set(1.0f, -1.0f, 0.0f); // back right
Isegset.segs[1].length = (50000.0F);
Isegset.segs[2].dir.set(0.0f, 0.0f, -1.0f);
Isegset.segs[2].pos.set(-1.0f, -1.0f, 0.0f); // back left
Isegset.segs[2].length = (50000.0F);
Isegset.activeMask = 0x07;
Isegset.isectMask = 0xFFFFFFFF;
Isegset.bound = NULL;
Isegset.discFunc = NULL;
bIsectFirstPass = FALSE;
}
HitNum = ModelsParentDCSNode->isect(&Isegset, Result);
pfNotify(PFNFY_NOTICE, PFNFY_PRINT, "Got %d hits from Isectors", HitNum);
}
The problem I am having is that the isect call always returns 0 (i.e. in
the above code HitNum = 0 ). Has anyone got any ideas as to what I am
doing wrong? Your help will be much appreciated.
BTW, O2, IRIX 6.3, Performer 2.0.3
Many thanks in advance,
John Sunderland.
--
John Sunderland
Software Engineer, Lockheed Martin Solartron Systems
Hoddesdon, Hertfordshire, UK (+44) (0)1992 470011
This archive was generated by hypermail 2.0b2 on Mon Aug 10 1998 - 17:55:43 PDT